summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore9089
-rw-r--r--GCC-README.md129
-rw-r--r--boot.manifest34
-rw-r--r--exception_lists/cstyle10
-rw-r--r--manifest19712
-rw-r--r--usr/src/Makefile13
-rw-r--r--usr/src/Makefile.lint2
-rw-r--r--usr/src/Makefile.master20
-rw-r--r--usr/src/Targetdirs5
-rw-r--r--usr/src/cmd/Makefile20
-rw-r--r--usr/src/cmd/Makefile.check3
-rw-r--r--usr/src/cmd/boot/bootadm/bootadm_upgrade.c1
-rw-r--r--usr/src/cmd/cmd-inet/lib/ipmgmtd/net-ipmgmt7
-rw-r--r--usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c22
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/mdnsd/DNSCommon.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm.c32
-rw-r--r--usr/src/cmd/column/Makefile43
-rw-r--r--usr/src/cmd/column/THIRDPARTYLICENSE26
-rw-r--r--usr/src/cmd/column/THIRDPARTYLICENSE.descrip1
-rw-r--r--usr/src/cmd/column/column.c335
-rw-r--r--usr/src/cmd/coreadm/coreadm.xml8
-rw-r--r--usr/src/cmd/cron/Makefile36
-rw-r--r--usr/src/cmd/cron/cron.c154
-rw-r--r--usr/src/cmd/cron/cron.h3
-rw-r--r--usr/src/cmd/cron/crontab.c38
-rw-r--r--usr/src/cmd/devfsadm/Makefile.com1
-rw-r--r--usr/src/cmd/devfsadm/devlink.tab.sh5
-rw-r--r--usr/src/cmd/dladm/dladm.c134
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_db.c97
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_door.c50
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_impl.h5
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_main.c41
-rw-r--r--usr/src/cmd/dlmgmtd/dlmgmt_util.c16
-rw-r--r--usr/src/cmd/dlmgmtd/svc-dlmgmtd9
-rw-r--r--usr/src/cmd/dlstat/dlstat.c70
-rw-r--r--usr/src/cmd/dtrace/Makefile.com2
-rw-r--r--usr/src/cmd/dtrace/dtrace.c8
-rw-r--r--usr/src/cmd/dtrace/test/cmd/scripts/dtest.pl2
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/Makefile58
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d32
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out646
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d46
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out38
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d53
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out124
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh75
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out102
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d42
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out149
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d34
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out211
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/arithmetic/tst.nonarrow.ksh48
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.general.d179
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.general.d.out218
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d51
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d.out13
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.c61
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d65
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d.out11
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/json/usdt.d27
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/llquantize/tst.range.d4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/mdb/tst.postmort.ksh69
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh97
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh8
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh8
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/privs/tst.fds.ksh91
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh9
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/privs/tst.getf.ksh98
-rwxr-xr-xusr/src/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh138
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/privs/tst.providers.ksh126
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooLarge.d35
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooSmall.d34
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d66
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d.out20
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid.d21
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid2.d21
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid3.d21
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh34
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh35
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh90
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c46
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh44
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c79
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh76
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh.out4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.c29
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh45
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.linkmap.ksh44
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh69
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh70
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.c72
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh69
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh.out16
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh70
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh83
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh.out4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh72
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh.out4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh12
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh12
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh12
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.header.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.static.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/usdt/tst.user.ksh4
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.c7
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.ksh68
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/ustack/unpriv_helper.d4
-rw-r--r--usr/src/cmd/flowadm/flowadm.c51
-rw-r--r--usr/src/cmd/flowstat/flowstat.c21
-rw-r--r--usr/src/cmd/fs.d/Makefile5
-rw-r--r--usr/src/cmd/fs.d/hyprlofs/Makefile42
-rw-r--r--usr/src/cmd/fs.d/hyprlofs/hlcfg/Makefile30
-rw-r--r--usr/src/cmd/fs.d/hyprlofs/hlcfg/hlcfg.c244
-rw-r--r--usr/src/cmd/fs.d/hyprlofs/mount/Makefile31
-rw-r--r--usr/src/cmd/fs.d/hyprlofs/mount/mount.c148
-rw-r--r--usr/src/cmd/fs.d/lxproc/Makefile32
-rw-r--r--usr/src/cmd/fs.d/lxproc/mount.c140
-rw-r--r--usr/src/cmd/fs.d/nfs/lib/smfcfg.c20
-rw-r--r--usr/src/cmd/fs.d/nfs/lib/smfcfg.h2
-rw-r--r--usr/src/cmd/fs.d/nfs/mount/mount.c2
-rw-r--r--usr/src/cmd/fs.d/nfs/mountd/mountd.c8
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsd/nfsd.c8
-rw-r--r--usr/src/cmd/fs.d/nfs/svc/nfs-server4
-rw-r--r--usr/src/cmd/fs.d/nfs/umount/umount.c2
-rw-r--r--usr/src/cmd/halt/halt.c19
-rw-r--r--usr/src/cmd/ibd_upgrade/ibd_delete_link.c2
-rw-r--r--usr/src/cmd/init/Makefile10
-rw-r--r--usr/src/cmd/init/init.c40
-rw-r--r--usr/src/cmd/initpkg/mountall.sh5
-rw-r--r--usr/src/cmd/initpkg/shutdown.sh2
-rw-r--r--usr/src/cmd/initpkg/umountall.sh4
-rw-r--r--usr/src/cmd/ipf/lib/common/load_hash.c12
-rw-r--r--usr/src/cmd/ipf/lib/common/load_hashnode.c12
-rw-r--r--usr/src/cmd/ipf/lib/common/load_pool.c12
-rw-r--r--usr/src/cmd/ipf/lib/common/load_poolnode.c12
-rw-r--r--usr/src/cmd/ipf/tools/Makefile.tools15
-rw-r--r--usr/src/cmd/ipf/tools/ipf.c54
-rw-r--r--usr/src/cmd/ipf/tools/ipfs.c48
-rw-r--r--usr/src/cmd/ipf/tools/ipfstat.c52
-rw-r--r--usr/src/cmd/ipf/tools/ipfzone.c135
-rw-r--r--usr/src/cmd/ipf/tools/ipfzone.h17
-rw-r--r--usr/src/cmd/ipf/tools/ipmon.c49
-rw-r--r--usr/src/cmd/ipf/tools/ipnat.c31
-rw-r--r--usr/src/cmd/ipf/tools/ippool.c144
-rw-r--r--usr/src/cmd/krb5/kadmin/Makefile2
-rw-r--r--usr/src/cmd/ksh/Makefile.com2
-rw-r--r--usr/src/cmd/localedef/Makefile14
-rw-r--r--usr/src/cmd/lofiadm/main.c30
-rw-r--r--usr/src/cmd/lp/terminfo/40.ti68
-rw-r--r--usr/src/cmd/lp/terminfo/44x.ti57
-rw-r--r--usr/src/cmd/lp/terminfo/45x.ti42
-rw-r--r--usr/src/cmd/lp/terminfo/477.ti181
-rw-r--r--usr/src/cmd/lp/terminfo/47x.ti134
-rw-r--r--usr/src/cmd/lp/terminfo/495.ti78
-rw-r--r--usr/src/cmd/lp/terminfo/53x0.ti81
-rw-r--r--usr/src/cmd/lp/terminfo/57x.ti105
-rw-r--r--usr/src/cmd/lp/terminfo/58x.ti103
-rw-r--r--usr/src/cmd/lp/terminfo/593.ti73
-rw-r--r--usr/src/cmd/lp/terminfo/Makefile77
-rw-r--r--usr/src/cmd/lp/terminfo/PS.ti36
-rw-r--r--usr/src/cmd/lp/terminfo/citoh.ti127
-rw-r--r--usr/src/cmd/lp/terminfo/daisy.ti126
-rw-r--r--usr/src/cmd/lp/terminfo/dec.ti130
-rw-r--r--usr/src/cmd/lp/terminfo/epson.ti301
-rw-r--r--usr/src/cmd/lp/terminfo/hplaser.ti122
-rw-r--r--usr/src/cmd/lp/terminfo/ibm.ti353
-rw-r--r--usr/src/cmd/lp/terminfo/unknown.ti30
-rw-r--r--usr/src/cmd/man/src/man.c11
-rw-r--r--usr/src/cmd/mdb/Makefile.common3
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb.h2
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_cmds.c3
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_ctf.c1
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_help.h1
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_modapi.h27
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_module.h2
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_print.c49
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_print.h2
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_proc.c31
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_tab.c24
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_termio.c2
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_whatis.c2
-rw-r--r--usr/src/cmd/mdb/common/modules/dtrace/dtrace.c10
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/genunix.c108
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/netstack.c30
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/netstack.h3
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/zone.c67
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/zone.h4
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/mdb_v8.c4245
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c728
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/v8cfg.h55
-rw-r--r--usr/src/cmd/mdb/common/modules/v8/v8dbg.h83
-rw-r--r--usr/src/cmd/mdb/i86pc/modules/unix/unix.c141
-rw-r--r--usr/src/cmd/mdb/intel/amd64/libumem/Makefile1
-rw-r--r--usr/src/cmd/mdb/intel/amd64/v8/Makefile45
-rw-r--r--usr/src/cmd/mdb/intel/ia32/libumem/Makefile1
-rw-r--r--usr/src/cmd/mdb/intel/ia32/v8/Makefile44
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libumem/Makefile1
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libumem/Makefile1
-rwxr-xr-x[-rw-r--r--]usr/src/cmd/mdb/test/mtest.sh0
-rw-r--r--usr/src/cmd/mdb/test/typedef/tst.dellist.mdb.out0
-rw-r--r--usr/src/cmd/mdb/test/typedef/tst.emptylist.mdb.out0
-rw-r--r--usr/src/cmd/nicstat/Makefile31
-rw-r--r--usr/src/cmd/nicstat/nicstat.pl422
-rw-r--r--usr/src/cmd/nscd/Makefile1
-rw-r--r--usr/src/cmd/nscd/svc-nscd4
-rw-r--r--usr/src/cmd/passwd/Makefile2
-rw-r--r--usr/src/cmd/perl/Makefile2
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/PerlGcc/Makefile.PL9
-rw-r--r--usr/src/cmd/perl/skel/Makefile2
-rw-r--r--usr/src/cmd/prstat/prsort.c15
-rw-r--r--usr/src/cmd/prstat/prstat.c27
-rw-r--r--usr/src/cmd/prstat/prstat.h2
-rw-r--r--usr/src/cmd/prstat/prutil.c3
-rw-r--r--usr/src/cmd/prtconf/prtconf.c52
-rw-r--r--usr/src/cmd/prtconf/prtconf.h1
-rw-r--r--usr/src/cmd/psrset/psrset.c64
-rw-r--r--usr/src/cmd/ptools/Makefile.bld5
-rw-r--r--usr/src/cmd/ptools/ptime/ptime.c111
-rw-r--r--usr/src/cmd/rcap/common/utils.c75
-rw-r--r--usr/src/cmd/rcap/common/utils.h2
-rw-r--r--usr/src/cmd/rcap/rcapadm/rcapadm.c16
-rw-r--r--usr/src/cmd/rcap/rcapd/rcapd_collection_zone.c141
-rw-r--r--usr/src/cmd/rcap/rcapd/rcapd_scanner.c3
-rw-r--r--usr/src/cmd/rcap/rcapstat/rcapstat.c7
-rw-r--r--usr/src/cmd/rcm_daemon/Makefile.com4
-rw-r--r--usr/src/cmd/sed/main.c27
-rw-r--r--usr/src/cmd/sendmail/src/Makefile2
-rw-r--r--usr/src/cmd/sgs/elfdump/Makefile.targ2
-rw-r--r--usr/src/cmd/sgs/elfdump/amd64/Makefile2
-rw-r--r--usr/src/cmd/sgs/elfdump/i386/Makefile2
-rw-r--r--usr/src/cmd/sgs/lex/common/main.c45
-rw-r--r--usr/src/cmd/sgs/lex/common/once.h12
-rw-r--r--usr/src/cmd/sgs/lorder/lorder.sh2
-rw-r--r--usr/src/cmd/sgs/yacc/common/dextern.h19
-rw-r--r--usr/src/cmd/sgs/yacc/common/y1.c36
-rw-r--r--usr/src/cmd/sgs/yacc/common/y2.c7
-rw-r--r--usr/src/cmd/ssh/Makefile2
-rw-r--r--usr/src/cmd/ssh/include/key.h15
-rw-r--r--usr/src/cmd/ssh/include/servconf.h1
-rw-r--r--usr/src/cmd/ssh/libssh/Makefile.com2
-rw-r--r--usr/src/cmd/ssh/libssh/common/canohost.c35
-rw-r--r--usr/src/cmd/ssh/libssh/common/key.c17
-rw-r--r--usr/src/cmd/ssh/sftp-server/Makefile2
-rw-r--r--usr/src/cmd/ssh/sftp/Makefile2
-rw-r--r--usr/src/cmd/ssh/ssh-add/Makefile2
-rw-r--r--usr/src/cmd/ssh/ssh-agent/Makefile2
-rw-r--r--usr/src/cmd/ssh/ssh-keygen/Makefile2
-rw-r--r--usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c277
-rw-r--r--usr/src/cmd/ssh/ssh-keyscan/Makefile2
-rw-r--r--usr/src/cmd/ssh/ssh-keysign/Makefile2
-rw-r--r--usr/src/cmd/ssh/ssh/Makefile2
-rw-r--r--usr/src/cmd/ssh/sshd/Makefile2
-rw-r--r--usr/src/cmd/ssh/sshd/auth2-pubkey.c109
-rw-r--r--usr/src/cmd/ssh/sshd/servconf.c9
-rw-r--r--usr/src/cmd/ssh/sshd/sshlogin.c3
-rw-r--r--usr/src/cmd/stat/Makefile11
-rw-r--r--usr/src/cmd/stat/arcstat/Makefile41
-rw-r--r--usr/src/cmd/stat/arcstat/arcstat.pl332
-rw-r--r--usr/src/cmd/stat/vfsstat/Makefile41
-rw-r--r--usr/src/cmd/stat/vfsstat/vfsstat.pl227
-rw-r--r--usr/src/cmd/stat/ziostat/Makefile41
-rwxr-xr-xusr/src/cmd/stat/ziostat/ziostat.pl204
-rw-r--r--usr/src/cmd/svc/configd/rc_node.c3
-rw-r--r--usr/src/cmd/svc/milestone/net-routing-setup13
-rw-r--r--usr/src/cmd/svc/milestone/network-location.xml2
-rw-r--r--usr/src/cmd/svc/milestone/network-routing-setup.xml14
-rw-r--r--usr/src/cmd/svc/milestone/network.xml8
-rw-r--r--usr/src/cmd/svc/milestone/single-user.xml2
-rw-r--r--usr/src/cmd/svc/shell/smf_include.sh6
-rw-r--r--usr/src/cmd/svc/startd/graph.c26
-rw-r--r--usr/src/cmd/svc/startd/method.c96
-rw-r--r--usr/src/cmd/svc/startd/restarter.c26
-rw-r--r--usr/src/cmd/svc/startd/startd.c130
-rw-r--r--usr/src/cmd/svc/startd/startd.h4
-rw-r--r--usr/src/cmd/svc/svcadm/Makefile7
-rw-r--r--usr/src/cmd/svc/svcadm/svcadm.c361
-rw-r--r--usr/src/cmd/svc/svccfg/svccfg_libscf.c267
-rw-r--r--usr/src/cmd/svc/svcs/Makefile2
-rw-r--r--usr/src/cmd/svc/svcs/explain.c4
-rw-r--r--usr/src/cmd/svc/svcs/svcs.c97
-rw-r--r--usr/src/cmd/svr4pkg/pkgadd/Makefile2
-rw-r--r--usr/src/cmd/svr4pkg/pkgadm/Makefile2
-rw-r--r--usr/src/cmd/tail/Makefile5
-rw-r--r--usr/src/cmd/truss/print.c13
-rw-r--r--usr/src/cmd/vi/port/Makefile3
-rw-r--r--usr/src/cmd/vi/port/ex_cmdsub.c2
-rw-r--r--usr/src/cmd/zfs/zfs_main.c143
-rw-r--r--usr/src/cmd/zic/README.illumos52
-rw-r--r--usr/src/cmd/zic/africa249
-rw-r--r--usr/src/cmd/zic/antarctica87
-rw-r--r--usr/src/cmd/zic/asia406
-rw-r--r--usr/src/cmd/zic/australasia183
-rw-r--r--usr/src/cmd/zic/backward14
-rw-r--r--usr/src/cmd/zic/country.tab26
-rw-r--r--usr/src/cmd/zic/etcetera5
-rw-r--r--usr/src/cmd/zic/europe313
-rw-r--r--usr/src/cmd/zic/northamerica353
-rw-r--r--usr/src/cmd/zic/pacificnew1
-rw-r--r--usr/src/cmd/zic/southamerica213
-rw-r--r--usr/src/cmd/zic/systemv1
-rw-r--r--usr/src/cmd/zic/zone.tab.txt67
-rw-r--r--usr/src/cmd/zic/zone_sun.tab20
-rw-r--r--usr/src/cmd/zoneadm/Makefile11
-rw-r--r--usr/src/cmd/zoneadm/zfs.c16
-rw-r--r--usr/src/cmd/zoneadm/zoneadm.c184
-rw-r--r--usr/src/cmd/zoneadm/zones.xml12
-rw-r--r--usr/src/cmd/zoneadmd/Makefile49
-rw-r--r--usr/src/cmd/zoneadmd/Makefile.com70
-rw-r--r--usr/src/cmd/zoneadmd/amd64/Makefile31
-rw-r--r--usr/src/cmd/zoneadmd/i386/Makefile30
-rw-r--r--usr/src/cmd/zoneadmd/mcap.c1148
-rw-r--r--usr/src/cmd/zoneadmd/vplat.c470
-rw-r--r--usr/src/cmd/zoneadmd/zcons.c122
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.c485
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.h16
-rw-r--r--usr/src/cmd/zonecfg/Makefile3
-rw-r--r--usr/src/cmd/zonecfg/zonecfg.c888
-rw-r--r--usr/src/cmd/zonecfg/zonecfg.h13
-rw-r--r--usr/src/cmd/zonecfg/zonecfg_grammar.y89
-rw-r--r--usr/src/cmd/zonecfg/zonecfg_lex.l29
-rw-r--r--usr/src/cmd/zonename/Makefile10
-rw-r--r--usr/src/cmd/zonestat/zonestatd/zonestatd.c11
-rw-r--r--usr/src/cmd/zpool/zpool_main.c41
-rw-r--r--usr/src/common/ctf/ctf_open.c88
-rw-r--r--usr/src/common/ctf/ctf_types.c41
-rw-r--r--usr/src/common/fs/bootfsops.c329
-rw-r--r--usr/src/common/openssl/README.ENGINE2
-rw-r--r--usr/src/common/openssl/README.SUNW4
-rw-r--r--usr/src/common/util/string.h1
-rw-r--r--usr/src/common/util/strtolctype.h8
-rw-r--r--usr/src/common/zfs/zfeature_common.c4
-rw-r--r--usr/src/common/zfs/zfeature_common.h1
-rw-r--r--usr/src/common/zfs/zfs_prop.c17
-rw-r--r--usr/src/common/zfs/zfs_prop.h2
-rw-r--r--usr/src/grub/Makefile6
-rw-r--r--usr/src/grub/Makefile.grub1
-rw-r--r--usr/src/grub/grub-0.97/stage2/Makefile.solaris54
-rw-r--r--usr/src/grub/grub-0.97/stage2/asm.S3
-rw-r--r--usr/src/grub/grub-0.97/stage2/boot.c13
-rw-r--r--usr/src/grub/grub-0.97/stage2/builtins.c481
-rw-r--r--usr/src/grub/grub-0.97/stage2/char_io.c22
-rw-r--r--usr/src/grub/grub-0.97/stage2/cmdline.c23
-rw-r--r--usr/src/grub/grub-0.97/stage2/common.c3
-rw-r--r--usr/src/grub/grub-0.97/stage2/cpu.h7
-rw-r--r--usr/src/grub/grub-0.97/stage2/expand.c465
-rw-r--r--usr/src/grub/grub-0.97/stage2/expand.h31
-rw-r--r--usr/src/grub/grub-0.97/stage2/serial.c71
-rw-r--r--usr/src/grub/grub-0.97/stage2/shared.h4
-rw-r--r--usr/src/grub/grub-0.97/stage2/stage2.c45
-rw-r--r--usr/src/grub/grub-0.97/stage2/term.h8
-rw-r--r--usr/src/head/Makefile2
-rw-r--r--usr/src/head/libzonecfg.h47
-rw-r--r--usr/src/head/resolv_joy.h472
-rw-r--r--usr/src/head/zdoor.h74
-rw-r--r--usr/src/head/zone.h3
-rw-r--r--usr/src/lib/Makefile30
-rw-r--r--usr/src/lib/Makefile.astmsg4
-rw-r--r--usr/src/lib/brand/Makefile2
-rw-r--r--usr/src/lib/brand/shared/zone/common.ksh69
-rw-r--r--usr/src/lib/brand/shared/zone/uninstall.ksh50
-rw-r--r--usr/src/lib/brand/sngl/Makefile51
-rw-r--r--usr/src/lib/brand/sngl/Makefile.sngl28
-rw-r--r--usr/src/lib/brand/sngl/sngl_brand/Makefile47
-rw-r--r--usr/src/lib/brand/sngl/sngl_brand/Makefile.com76
-rw-r--r--usr/src/lib/brand/sngl/sngl_brand/amd64/Makefile48
-rw-r--r--usr/src/lib/brand/sngl/sngl_brand/common/mapfile-vers48
-rw-r--r--usr/src/lib/brand/sngl/sngl_brand/common/sngl_brand.c429
-rw-r--r--usr/src/lib/brand/sngl/sngl_brand/i386/Makefile46
-rw-r--r--usr/src/lib/brand/sngl/zone/Makefile53
-rw-r--r--usr/src/lib/brand/sngl/zone/config.xml112
-rw-r--r--usr/src/lib/brand/sngl/zone/platform.xml160
-rw-r--r--usr/src/lib/brand/sngl/zone/sinstall.sh118
-rw-r--r--usr/src/lib/common/i386/crtn.s1
-rw-r--r--usr/src/lib/fm/topo/libtopo/common/libtopo.h5
-rw-r--r--usr/src/lib/fm/topo/libtopo/common/mapfile-vers2
-rw-r--r--usr/src/lib/fm/topo/libtopo/common/topo_mod.h5
-rw-r--r--usr/src/lib/fm/topo/libtopo/common/topo_string.c64
-rwxr-xr-x[-rw-r--r--]usr/src/lib/fm/topo/maps/Joyent,Joyent-Compute-Platform-1101/Joyent-Compute-Platform-1101-disk-hc-topology.xmlgenksh10
-rw-r--r--usr/src/lib/fm/topo/modules/common/disk/disk_mptsas.c65
-rw-r--r--usr/src/lib/fm/topo/modules/common/fac_prov_mptsas/fac_prov_mptsas.c51
-rw-r--r--usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com2
-rw-r--r--usr/src/lib/libbe/common/be_list.c3
-rw-r--r--usr/src/lib/libbrand/common/libbrand.c25
-rw-r--r--usr/src/lib/libbrand/common/libbrand.h2
-rw-r--r--usr/src/lib/libbrand/common/mapfile-vers2
-rw-r--r--usr/src/lib/libbrand/dtd/brand.dtd.118
-rw-r--r--usr/src/lib/libbsm/common/adt.c102
-rw-r--r--usr/src/lib/libc/i386/Makefile.com1
-rw-r--r--usr/src/lib/libc/inc/thr_inlines.h12
-rw-r--r--usr/src/lib/libc/port/gen/getlogin.c1
-rw-r--r--usr/src/lib/libc/port/mapfile-vers1
-rw-r--r--usr/src/lib/libc/port/sys/zone.c5
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com1
-rw-r--r--usr/src/lib/libc/sparc/crt/_rtld.c9
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile.com1
-rw-r--r--usr/src/lib/libctf/common/mapfile-vers6
-rw-r--r--usr/src/lib/libdiskmgt/common/libdiskmgt.h180
-rw-r--r--usr/src/lib/libdladm/common/libdladm.h6
-rw-r--r--usr/src/lib/libdladm/common/libdllink.c28
-rw-r--r--usr/src/lib/libdladm/common/libdllink.h6
-rw-r--r--usr/src/lib/libdladm/common/libdlmgmt.c19
-rw-r--r--usr/src/lib/libdladm/common/libdlvnic.c29
-rw-r--r--usr/src/lib/libdladm/common/linkprop.c263
-rw-r--r--usr/src/lib/libdladm/common/mapfile-vers2
-rw-r--r--usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java20
-rw-r--r--usr/src/lib/libdtrace/Makefile.com2
-rw-r--r--usr/src/lib/libdtrace/common/dt_aggregate.c264
-rw-r--r--usr/src/lib/libdtrace/common/dt_as.c8
-rw-r--r--usr/src/lib/libdtrace/common/dt_cc.c28
-rw-r--r--usr/src/lib/libdtrace/common/dt_cg.c2
-rw-r--r--usr/src/lib/libdtrace/common/dt_consume.c460
-rw-r--r--usr/src/lib/libdtrace/common/dt_decl.c10
-rw-r--r--usr/src/lib/libdtrace/common/dt_decl.h7
-rw-r--r--usr/src/lib/libdtrace/common/dt_dis.c10
-rw-r--r--usr/src/lib/libdtrace/common/dt_error.c3
-rw-r--r--usr/src/lib/libdtrace/common/dt_grammar.y8
-rw-r--r--usr/src/lib/libdtrace/common/dt_ident.c21
-rw-r--r--usr/src/lib/libdtrace/common/dt_impl.h20
-rw-r--r--usr/src/lib/libdtrace/common/dt_lex.l15
-rw-r--r--usr/src/lib/libdtrace/common/dt_module.c283
-rw-r--r--usr/src/lib/libdtrace/common/dt_module.h10
-rw-r--r--usr/src/lib/libdtrace/common/dt_open.c23
-rw-r--r--usr/src/lib/libdtrace/common/dt_options.c95
-rw-r--r--usr/src/lib/libdtrace/common/dt_parser.c155
-rw-r--r--usr/src/lib/libdtrace/common/dt_parser.h8
-rw-r--r--usr/src/lib/libdtrace/common/dt_pid.c164
-rw-r--r--usr/src/lib/libdtrace/common/dt_pid.h8
-rw-r--r--usr/src/lib/libdtrace/common/dt_print.c27
-rw-r--r--usr/src/lib/libdtrace/common/dt_printf.c6
-rw-r--r--usr/src/lib/libdtrace/common/dt_program.c9
-rw-r--r--usr/src/lib/libdtrace/common/dt_provider.c29
-rw-r--r--usr/src/lib/libdtrace/common/dt_work.c32
-rw-r--r--usr/src/lib/libdtrace/common/dt_xlator.c13
-rw-r--r--usr/src/lib/libdtrace/common/dtrace.h17
-rw-r--r--usr/src/lib/libdtrace/common/io.d.in8
-rw-r--r--usr/src/lib/libgrubmgmt/common/libgrub_fs.c5
-rw-r--r--usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com8
-rw-r--r--usr/src/lib/libnisdb/db_mindex3.cc4
-rw-r--r--usr/src/lib/libnisdb/db_table.cc4
-rw-r--r--usr/src/lib/libnisdb/nis_db.cc8
-rw-r--r--usr/src/lib/libpkg/Makefile.com2
-rw-r--r--usr/src/lib/libproc/common/Pzone.c22
-rw-r--r--usr/src/lib/libresolv2_joy/Makefile76
-rw-r--r--usr/src/lib/libresolv2_joy/Makefile.com162
-rw-r--r--usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE185
-rw-r--r--usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE.descrip1
-rw-r--r--usr/src/lib/libresolv2_joy/amd64/Makefile31
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/daemon.c81
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/ftruncate.c64
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/gettimeofday.c62
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/mktemp.c156
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/putenv.c27
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/readv.c39
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/setenv.c151
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/setitimer.c29
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/strcasecmp.c124
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/strdup.c20
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/strerror.c94
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/strpbrk.c70
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/strsep.c88
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/strtoul.c119
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/utimes.c40
-rw-r--r--usr/src/lib/libresolv2_joy/common/bsd/writev.c89
-rw-r--r--usr/src/lib/libresolv2_joy/common/dst/dst_api.c1048
-rw-r--r--usr/src/lib/libresolv2_joy/common/dst/dst_internal.h155
-rw-r--r--usr/src/lib/libresolv2_joy/common/dst/hmac_link.c491
-rw-r--r--usr/src/lib/libresolv2_joy/common/dst/support.c342
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_cidr_ntop.c263
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_cidr_pton.c277
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_data.c46
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_lnaof.c65
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_makeaddr.c68
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_net_ntop.c279
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_net_pton.c407
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_neta.c89
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_netof.c64
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/inet_network.c106
-rw-r--r--usr/src/lib/libresolv2_joy/common/inet/nsap_addr.c111
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/dns.c154
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/dns_ho.c1143
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/dns_nw.c591
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/dns_p.h52
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/dns_pr.c268
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/dns_sv.c300
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gai_strerror.c105
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen.c459
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen_ho.c391
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen_ng.c174
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen_nw.c264
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen_p.h113
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen_pr.c228
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gen_sv.c229
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getaddrinfo.c1253
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gethostent.c1096
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/gethostent_r.c278
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getnameinfo.c334
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getnetent.c345
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getnetent_r.c234
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getnetgrent.c160
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getnetgrent_r.c219
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getprotoent.c176
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getprotoent_r.c223
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getservent.c179
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/getservent_r.c242
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/hesiod.c505
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/hesiod_p.h48
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp.c583
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp_ho.c405
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp_ng.c253
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp_nw.c348
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp_p.h60
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp_pr.c327
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irp_sv.c346
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irpmarshall.c2301
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irs_data.c254
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irs_data.h63
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/irs_p.h51
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl.c142
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl_ho.c578
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl_ng.c446
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl_nw.c373
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl_p.h51
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl_pr.c294
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/lcl_sv.c432
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/nis.c156
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/nis_p.h47
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/nul_ng.c127
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/pathnames.h52
-rw-r--r--usr/src/lib/libresolv2_joy/common/irs/util.c109
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/assertions.c94
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/base64.c333
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/bitncmp.c68
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ctl_clnt.c620
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ctl_p.c188
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ctl_p.h28
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ctl_srvr.c787
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ev_connects.c369
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ev_files.c277
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ev_streams.c308
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ev_timers.c499
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/ev_waits.c247
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/eventlib.c933
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/eventlib_p.h281
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/heap.c236
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/hex.c119
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/logging.c716
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/logging_p.h61
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/memcluster.c588
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/movefile.c43
-rw-r--r--usr/src/lib/libresolv2_joy/common/isc/tree.c534
-rw-r--r--usr/src/lib/libresolv2_joy/common/llib-lresolv_joy59
-rw-r--r--usr/src/lib/libresolv2_joy/common/mapfile-vers60
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_date.c129
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_name.c1153
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_netint.c61
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_newmsg.c273
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_parse.c275
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_print.c1242
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_rdata.c300
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_samedomain.c207
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_sign.c387
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_ttl.c162
-rw-r--r--usr/src/lib/libresolv2_joy/common/nameser/ns_verify.c484
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/herror.c129
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/mtctxres.c135
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_comp.c287
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_data.c322
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_debug.c1252
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_debug.h35
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_findzonecut.c722
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_init.c958
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_mkquery.c386
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.c1163
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.h25
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_private.h22
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_query.c440
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_send.c1120
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_sendsigned.c170
-rw-r--r--usr/src/lib/libresolv2_joy/common/resolv/res_update.c213
-rw-r--r--usr/src/lib/libresolv2_joy/common/sunw/sunw_mtctxres.c126
-rw-r--r--usr/src/lib/libresolv2_joy/common/sunw/sunw_updrec.c249
-rw-r--r--usr/src/lib/libresolv2_joy/common/sunw/sunw_wrappers.c23
-rw-r--r--usr/src/lib/libresolv2_joy/i386/Makefile30
-rw-r--r--usr/src/lib/libresolv2_joy/include/Makefile60
-rw-r--r--usr/src/lib/libresolv2_joy/include/arpa/port_inet.h41
-rw-r--r--usr/src/lib/libresolv2_joy/include/arpa/port_nameser.h40
-rw-r--r--usr/src/lib/libresolv2_joy/include/conf/sunoptions.h30
-rw-r--r--usr/src/lib/libresolv2_joy/include/config.h75
-rw-r--r--usr/src/lib/libresolv2_joy/include/err.h62
-rw-r--r--usr/src/lib/libresolv2_joy/include/fd_setsize.h10
-rw-r--r--usr/src/lib/libresolv2_joy/include/hesiod.h39
-rw-r--r--usr/src/lib/libresolv2_joy/include/irp.h107
-rw-r--r--usr/src/lib/libresolv2_joy/include/irs.h348
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/assertions.h123
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/ctl.h112
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/dst.h168
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/eventlib.h206
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/heap.h49
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/irpmarshall.h112
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/list.h118
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/logging.h113
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/memcluster.h50
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/misc.h44
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/platform.h42
-rw-r--r--usr/src/lib/libresolv2_joy/include/isc/tree.h59
-rwxr-xr-xusr/src/lib/libresolv2_joy/include/make_os_version34
-rw-r--r--usr/src/lib/libresolv2_joy/include/make_os_version.sh34
-rw-r--r--usr/src/lib/libresolv2_joy/include/port_after.h539
-rw-r--r--usr/src/lib/libresolv2_joy/include/port_before.h201
-rw-r--r--usr/src/lib/libresolv2_joy/include/port_netdb.h188
-rw-r--r--usr/src/lib/libresolv2_joy/include/port_resolv.h42
-rwxr-xr-xusr/src/lib/libresolv2_joy/include/probe_ipv673
-rw-r--r--usr/src/lib/libresolv2_joy/include/probe_ipv6.sh73
-rw-r--r--usr/src/lib/libresolv2_joy/include/res_update.h88
-rw-r--r--usr/src/lib/libresolv2_joy/include/resolv_mt.h47
-rw-r--r--usr/src/lib/libresolv2_joy/include/sunw_port_after.h123
-rw-r--r--usr/src/lib/libresolv2_joy/include/sunw_port_before.h43
-rw-r--r--usr/src/lib/libresolv2_joy/include/sys/bitypes.h37
-rw-r--r--usr/src/lib/libresolv2_joy/include/sys/cdefs.h144
-rw-r--r--usr/src/lib/libresolv2_joy/sparc/Makefile30
-rw-r--r--usr/src/lib/libresolv2_joy/sparcv9/Makefile38
-rw-r--r--usr/src/lib/librestart/common/librestart.c51
-rw-r--r--usr/src/lib/librestart/common/librestart.h3
-rw-r--r--usr/src/lib/librestart/common/mapfile-vers1
-rw-r--r--usr/src/lib/libscf/common/error.c5
-rw-r--r--usr/src/lib/libscf/common/libscf_impl.h4
-rw-r--r--usr/src/lib/libscf/common/lowlevel.c27
-rw-r--r--usr/src/lib/libscf/inc/libscf.h7
-rw-r--r--usr/src/lib/libscf/inc/libscf_priv.h7
-rw-r--r--usr/src/lib/libshare/nfs/libshare_nfs.c14
-rw-r--r--usr/src/lib/libshell/Makefile1
-rw-r--r--usr/src/lib/libshell/Makefile.doc93
-rw-r--r--usr/src/lib/libshell/common/COMPATIBILITY134
-rw-r--r--usr/src/lib/libshell/common/DESIGN170
-rw-r--r--usr/src/lib/libshell/common/OBSOLETE152
-rw-r--r--usr/src/lib/libshell/common/README232
-rw-r--r--usr/src/lib/libshell/common/RELEASE2204
-rw-r--r--usr/src/lib/libshell/common/TYPES182
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/1.pngbin236 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/10.pngbin284 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/2.pngbin261 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/3.pngbin265 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/4.pngbin260 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/5.pngbin261 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/6.pngbin278 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/7.pngbin253 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/8.pngbin275 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/callouts/9.pngbin284 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_bourne.pngbin130 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_i18n.pngbin124 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_ksh.pngbin122 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_ksh88.pngbin124 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_ksh93.pngbin140 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_l10n.pngbin118 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/images/tag_perf.pngbin127 -> 0 bytes
-rw-r--r--usr/src/lib/libshell/misc/shell_styleguide.docbook1464
-rw-r--r--usr/src/lib/libsmartsshd/Makefile48
-rw-r--r--usr/src/lib/libsmartsshd/Makefile.com47
-rw-r--r--usr/src/lib/libsmartsshd/amd64/Makefile32
-rw-r--r--usr/src/lib/libsmartsshd/common/llib-lsmartsshd32
-rw-r--r--usr/src/lib/libsmartsshd/common/mapfile-vers45
-rw-r--r--usr/src/lib/libsmartsshd/common/sshd-plugin.c123
-rw-r--r--usr/src/lib/libsmartsshd/i386/Makefile31
-rw-r--r--usr/src/lib/libumem/amd64/umem_genasm.c2
-rw-r--r--usr/src/lib/libwanboot/Makefile.com2
-rw-r--r--usr/src/lib/libzdoor/Makefile48
-rw-r--r--usr/src/lib/libzdoor/Makefile.com50
-rw-r--r--usr/src/lib/libzdoor/amd64/Makefile32
-rw-r--r--usr/src/lib/libzdoor/common/llib-lzdoor34
-rw-r--r--usr/src/lib/libzdoor/common/mapfile-vers48
-rw-r--r--usr/src/lib/libzdoor/common/zdoor-int.c324
-rw-r--r--usr/src/lib/libzdoor/common/zdoor-int.h64
-rw-r--r--usr/src/lib/libzdoor/common/zdoor.c437
-rw-r--r--usr/src/lib/libzdoor/common/zerror.c117
-rw-r--r--usr/src/lib/libzdoor/common/zerror.h48
-rw-r--r--usr/src/lib/libzdoor/common/ztree.c344
-rw-r--r--usr/src/lib/libzdoor/common/ztree.h88
-rw-r--r--usr/src/lib/libzdoor/i386/Makefile31
-rw-r--r--usr/src/lib/libzfs/common/libzfs.h4
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c25
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h3
-rw-r--r--usr/src/lib/libzfs/common/libzfs_iter.c16
-rw-r--r--usr/src/lib/libzfs/common/libzfs_pool.c13
-rw-r--r--usr/src/lib/libzfs/common/libzfs_util.c42
-rw-r--r--usr/src/lib/libzfs/common/mapfile-vers3
-rw-r--r--usr/src/lib/libzonecfg/common/getzoneent.c14
-rw-r--r--usr/src/lib/libzonecfg/common/libzonecfg.c648
-rw-r--r--usr/src/lib/libzonecfg/common/mapfile-vers13
-rw-r--r--usr/src/lib/libzonecfg/dtd/zonecfg.dtd.115
-rw-r--r--usr/src/lib/libzpool/common/sys/zfs_context.h3
-rw-r--r--usr/src/lib/nsswitch/dns/Makefile.com4
-rw-r--r--usr/src/lib/nsswitch/dns/common/dns_common.c215
-rw-r--r--usr/src/lib/nsswitch/dns/common/dns_common.h4
-rw-r--r--usr/src/lib/nsswitch/dns/common/dns_mt.c155
-rw-r--r--usr/src/lib/nsswitch/dns/common/gethostent.c8
-rw-r--r--usr/src/lib/nsswitch/dns/common/gethostent6.c4
-rw-r--r--usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com2
-rw-r--r--usr/src/lib/print/mod_ipp/Makefile2
-rw-r--r--usr/src/lib/pysolaris/Makefile.com1
-rw-r--r--usr/src/man/man1/Makefile1
-rw-r--r--usr/src/man/man1/column.1129
-rw-r--r--usr/src/man/man1/crontab.150
-rw-r--r--usr/src/man/man1/ld.12
-rw-r--r--usr/src/man/man1/nawk.19
-rw-r--r--usr/src/man/man1/proc.111
-rw-r--r--usr/src/man/man1/ps.16
-rw-r--r--usr/src/man/man1/sed.124
-rw-r--r--usr/src/man/man1m/Makefile3
-rw-r--r--usr/src/man/man1m/dladm.1m113
-rw-r--r--usr/src/man/man1m/flowadm.1m52
-rw-r--r--usr/src/man/man1m/ipf.1m36
-rw-r--r--usr/src/man/man1m/ipfs.1m44
-rw-r--r--usr/src/man/man1m/ipfstat.1m31
-rw-r--r--usr/src/man/man1m/ipmon.1m33
-rw-r--r--usr/src/man/man1m/ipnat.1m32
-rw-r--r--usr/src/man/man1m/ippool.1m48
-rw-r--r--usr/src/man/man1m/lofiadm.1m8
-rw-r--r--usr/src/man/man1m/mount_tmpfs.1m14
-rw-r--r--usr/src/man/man1m/prstat.1m35
-rw-r--r--usr/src/man/man1m/prtconf.1m12
-rw-r--r--usr/src/man/man1m/psrset.1m13
-rw-r--r--usr/src/man/man1m/reboot.1m3
-rw-r--r--usr/src/man/man1m/svc.startd.1m9
-rw-r--r--usr/src/man/man1m/svcadm.1m52
-rw-r--r--usr/src/man/man1m/svccfg.1m9
-rw-r--r--usr/src/man/man1m/tunefs.1m8
-rw-r--r--usr/src/man/man1m/zfs.1m42
-rw-r--r--usr/src/man/man1m/zoneadm.1m17
-rw-r--r--usr/src/man/man1m/zonecfg.1m123
-rw-r--r--usr/src/man/man1m/zpool.1m31
-rw-r--r--usr/src/man/man3xnet/Makefile4
-rw-r--r--usr/src/man/man3xnet/htonl.3xnet29
-rw-r--r--usr/src/man/man5/privileges.512
-rw-r--r--usr/src/man/man5/resource_controls.5114
-rw-r--r--usr/src/man/man7d/lofi.7d4
-rw-r--r--usr/src/man/man7fs/Makefile3
-rw-r--r--usr/src/man/man7fs/hyprlofs.7fs62
-rw-r--r--usr/src/man/man7fs/lxproc.7fs115
-rw-r--r--usr/src/man/man9e/detach.9e2
-rw-r--r--usr/src/man/man9f/kmem_cache_create.9f2
-rw-r--r--usr/src/pkg/manifests/SUNWcs.mf28
-rw-r--r--usr/src/pkg/manifests/developer-build-onbld.mf3
-rw-r--r--usr/src/pkg/manifests/driver-network-bge.mf13
-rw-r--r--usr/src/pkg/manifests/service-file-system-smb.mf1
-rw-r--r--usr/src/pkg/manifests/system-zones-brand-joyent.mf54
-rw-r--r--usr/src/prototypes/prototype.Makefile2
-rw-r--r--usr/src/prototypes/prototype.c2
-rw-r--r--usr/src/prototypes/prototype.csh2
-rw-r--r--usr/src/prototypes/prototype.h2
-rw-r--r--usr/src/prototypes/prototype.java2
-rw-r--r--usr/src/prototypes/prototype.ksh2
-rw-r--r--usr/src/prototypes/prototype.man2
-rw-r--r--usr/src/prototypes/prototype.mapfile-vers2
-rw-r--r--usr/src/prototypes/prototype.pl2
-rw-r--r--usr/src/prototypes/prototype.py2
-rw-r--r--usr/src/prototypes/prototype.s2
-rw-r--r--usr/src/prototypes/prototype.sh2
-rw-r--r--usr/src/psm/stand/bootblks/ufs/i386/mboot.S1
-rw-r--r--usr/src/stand/lib/fs/hsfs/hsfsops.c1
-rw-r--r--usr/src/stand/lib/wanboot/Makefile2
-rw-r--r--usr/src/tools/README.tools3
-rw-r--r--usr/src/tools/cscope-fast/Makefile1
-rw-r--r--usr/src/tools/ctf/common/ctf_headers.h13
-rw-r--r--usr/src/tools/ctf/common/utils.h3
-rw-r--r--usr/src/tools/ctf/cvt/ctftools.h13
-rw-r--r--usr/src/tools/findunref/exception_list.git39
-rw-r--r--usr/src/tools/findunref/exception_list.unknown0
-rw-r--r--usr/src/tools/onbld/Checks/Cddl.py2
-rw-r--r--usr/src/tools/onbld/Checks/CmtBlk.py2
-rw-r--r--usr/src/tools/onbld/Checks/Comments.py2
-rw-r--r--usr/src/tools/onbld/Checks/Copyright.py2
-rw-r--r--usr/src/tools/onbld/Checks/DbLookups.py2
-rw-r--r--usr/src/tools/onbld/Checks/HdrChk.py2
-rw-r--r--usr/src/tools/onbld/Checks/Keywords.py4
-rw-r--r--usr/src/tools/onbld/Checks/Mapfile.py2
-rw-r--r--usr/src/tools/onbld/Checks/__init__.py2
-rw-r--r--usr/src/tools/onbld/Scm/Ignore.py91
-rw-r--r--usr/src/tools/onbld/Scm/Makefile2
-rw-r--r--usr/src/tools/onbld/Scm/__init__.py4
-rw-r--r--usr/src/tools/onbld/hgext/__init__.py4
-rw-r--r--usr/src/tools/onbld/hgext/cdm.py6
-rw-r--r--usr/src/tools/scripts/cddlchk.py2
-rw-r--r--usr/src/tools/scripts/copyrightchk.py2
-rw-r--r--usr/src/tools/scripts/git-pbchk.py13
-rw-r--r--usr/src/tools/scripts/hdrchk.py2
-rw-r--r--usr/src/tools/scripts/hg-active.py2
-rw-r--r--usr/src/tools/scripts/mapfilechk.py2
-rw-r--r--usr/src/tools/scripts/nightly.sh38
-rw-r--r--usr/src/tools/scripts/validate_pkg.py2
-rw-r--r--usr/src/tools/scripts/webrev.sh8
-rw-r--r--usr/src/tools/scripts/wsdiff.py2
-rw-r--r--usr/src/ucbhead/Makefile68
-rw-r--r--usr/src/ucbhead/sys/file.h4
-rw-r--r--usr/src/uts/Makefile.uts1
-rw-r--r--usr/src/uts/common/Makefile.files12
-rw-r--r--usr/src/uts/common/Makefile.rules32
-rw-r--r--usr/src/uts/common/brand/sngl/sngl_brand.c250
-rw-r--r--usr/src/uts/common/brand/sngl/sngl_brand.h72
-rw-r--r--usr/src/uts/common/conf/param.c12
-rw-r--r--usr/src/uts/common/crypto/api/kcf_random.c4
-rw-r--r--usr/src/uts/common/crypto/core/kcf_sched.c6
-rw-r--r--usr/src/uts/common/disp/cmt.c8
-rw-r--r--usr/src/uts/common/disp/cpucaps.c285
-rw-r--r--usr/src/uts/common/disp/disp.c26
-rw-r--r--usr/src/uts/common/disp/fss.c388
-rw-r--r--usr/src/uts/common/disp/thread.c16
-rw-r--r--usr/src/uts/common/dtrace/dtrace.c1114
-rw-r--r--usr/src/uts/common/dtrace/sdt_subr.c55
-rw-r--r--usr/src/uts/common/fs/hsfs/hsfs_vfsops.c3
-rw-r--r--usr/src/uts/common/fs/hyprlofs/hyprlofs_dir.c640
-rw-r--r--usr/src/uts/common/fs/hyprlofs/hyprlofs_subr.c127
-rw-r--r--usr/src/uts/common/fs/hyprlofs/hyprlofs_vfsops.c614
-rw-r--r--usr/src/uts/common/fs/hyprlofs/hyprlofs_vnops.c1414
-rw-r--r--usr/src/uts/common/fs/lxproc/lxpr_subr.c524
-rw-r--r--usr/src/uts/common/fs/lxproc/lxpr_vfsops.c367
-rw-r--r--usr/src/uts/common/fs/lxproc/lxpr_vnops.c3092
-rw-r--r--usr/src/uts/common/fs/lxproc/lxproc.h275
-rw-r--r--usr/src/uts/common/fs/nfs/nfs3_vfsops.c1
-rw-r--r--usr/src/uts/common/fs/nfs/nfs4_common.c3
-rw-r--r--usr/src/uts/common/fs/nfs/nfs4_vfsops.c1
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_common.c7
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_server.c5
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_vfsops.c1
-rw-r--r--usr/src/uts/common/fs/proc/prcontrol.c12
-rw-r--r--usr/src/uts/common/fs/proc/prdata.h4
-rw-r--r--usr/src/uts/common/fs/smbclnt/smbfs/smbfs_vfsops.c3
-rw-r--r--usr/src/uts/common/fs/swapfs/swap_subr.c6
-rw-r--r--usr/src/uts/common/fs/tmpfs/tmp_dir.c12
-rw-r--r--usr/src/uts/common/fs/tmpfs/tmp_subr.c34
-rw-r--r--usr/src/uts/common/fs/tmpfs/tmp_vfsops.c229
-rw-r--r--usr/src/uts/common/fs/tmpfs/tmp_vnops.c78
-rw-r--r--usr/src/uts/common/fs/udfs/udf_vnops.c9
-rw-r--r--usr/src/uts/common/fs/ufs/ufs_vnops.c42
-rw-r--r--usr/src/uts/common/fs/vfs.c26
-rw-r--r--usr/src/uts/common/fs/vnode.c109
-rw-r--r--usr/src/uts/common/fs/zfs/arc.c38
-rw-r--r--usr/src/uts/common/fs/zfs/dbuf.c15
-rw-r--r--usr/src/uts/common/fs/zfs/dmu.c3
-rw-r--r--usr/src/uts/common/fs/zfs/dmu_tx.c4
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_dir.c3
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_pool.c2
-rw-r--r--usr/src/uts/common/fs/zfs/metaslab.c8
-rw-r--r--usr/src/uts/common/fs/zfs/sys/dsl_dir.h1
-rw-r--r--usr/src/uts/common/fs/zfs/sys/vdev_impl.h1
-rw-r--r--usr/src/uts/common/fs/zfs/sys/zfs_zone.h62
-rw-r--r--usr/src/uts/common/fs/zfs/sys/zio.h6
-rw-r--r--usr/src/uts/common/fs/zfs/txg.c3
-rw-r--r--usr/src/uts/common/fs/zfs/vdev_disk.c14
-rw-r--r--usr/src/uts/common/fs/zfs/vdev_queue.c12
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_ioctl.c59
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_vfsops.c12
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_vnops.c82
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_zone.c1329
-rw-r--r--usr/src/uts/common/fs/zfs/zio.c34
-rw-r--r--usr/src/uts/common/fs/zfs/zvol.c13
-rw-r--r--usr/src/uts/common/inet/ilb/ilb_conn.c8
-rw-r--r--usr/src/uts/common/inet/ip/ip_attr.c5
-rw-r--r--usr/src/uts/common/inet/ip/ip_if.c169
-rw-r--r--usr/src/uts/common/inet/ip/ip_tunables.c1
-rw-r--r--usr/src/uts/common/inet/ip/ipsecesp.c3
-rw-r--r--usr/src/uts/common/inet/ipf/fil.c46
-rw-r--r--usr/src/uts/common/inet/ipf/ip_fil_solaris.c315
-rw-r--r--usr/src/uts/common/inet/ipf/ip_log.c8
-rw-r--r--usr/src/uts/common/inet/ipf/ip_state.c1
-rw-r--r--usr/src/uts/common/inet/ipf/ipf.conf5
-rw-r--r--usr/src/uts/common/inet/ipf/netinet/ip_fil.h31
-rw-r--r--usr/src/uts/common/inet/ipf/netinet/ipf_stack.h3
-rw-r--r--usr/src/uts/common/inet/ipf/solaris.c125
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_time_wait.c90
-rw-r--r--usr/src/uts/common/inet/tcp_impl.h6
-rw-r--r--usr/src/uts/common/io/aggr/aggr_port.c8
-rw-r--r--usr/src/uts/common/io/aggr/aggr_recv.c36
-rw-r--r--usr/src/uts/common/io/bge/bge_chip2.c234
-rw-r--r--usr/src/uts/common/io/bge/bge_hw.h218
-rw-r--r--usr/src/uts/common/io/bge/bge_impl.h14
-rw-r--r--usr/src/uts/common/io/bge/bge_main2.c14
-rw-r--r--usr/src/uts/common/io/bge/bge_mii.c71
-rw-r--r--usr/src/uts/common/io/dld/dld_drv.c6
-rw-r--r--usr/src/uts/common/io/dls/dls.c16
-rw-r--r--usr/src/uts/common/io/dls/dls_mgmt.c179
-rw-r--r--usr/src/uts/common/io/dls/dls_stat.c172
-rw-r--r--usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE32
-rw-r--r--usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE.descrip1
-rw-r--r--usr/src/uts/common/io/dr_sas/dr_sas.c5506
-rw-r--r--usr/src/uts/common/io/dr_sas/dr_sas.conf15
-rw-r--r--usr/src/uts/common/io/dr_sas/dr_sas.h1766
-rw-r--r--usr/src/uts/common/io/dr_sas/dr_sas_list.h212
-rw-r--r--usr/src/uts/common/io/fibre-channel/fca/oce/oce_rx.c3
-rw-r--r--usr/src/uts/common/io/hook.c19
-rw-r--r--usr/src/uts/common/io/ixgbe/ixgbe_main.c4
-rw-r--r--usr/src/uts/common/io/mac/mac.c4
-rw-r--r--usr/src/uts/common/io/mac/mac_client.c178
-rw-r--r--usr/src/uts/common/io/mac/mac_protect.c21
-rw-r--r--usr/src/uts/common/io/mac/mac_stat.c9
-rw-r--r--usr/src/uts/common/io/mr_sas/mr_sas.conf8
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd.c79
-rw-r--r--usr/src/uts/common/io/vnic/vnic_dev.c211
-rw-r--r--usr/src/uts/common/krtld/bootrd.c83
-rw-r--r--usr/src/uts/common/os/bio.c10
-rw-r--r--usr/src/uts/common/os/clock.c5
-rw-r--r--usr/src/uts/common/os/core.c9
-rw-r--r--usr/src/uts/common/os/cred.c8
-rw-r--r--usr/src/uts/common/os/ddi_intr_irm.c2
-rw-r--r--usr/src/uts/common/os/dtrace_subr.c1
-rw-r--r--usr/src/uts/common/os/exit.c15
-rw-r--r--usr/src/uts/common/os/fio.c14
-rw-r--r--usr/src/uts/common/os/fork.c15
-rw-r--r--usr/src/uts/common/os/kstat_fr.c13
-rw-r--r--usr/src/uts/common/os/logsubr.c4
-rw-r--r--usr/src/uts/common/os/lwp.c11
-rw-r--r--usr/src/uts/common/os/msacct.c64
-rw-r--r--usr/src/uts/common/os/netstack.c33
-rw-r--r--usr/src/uts/common/os/policy.c9
-rw-r--r--usr/src/uts/common/os/priv_defs4
-rw-r--r--usr/src/uts/common/os/vmem.c2
-rw-r--r--usr/src/uts/common/os/zone.c918
-rw-r--r--usr/src/uts/common/sys/Makefile2
-rw-r--r--usr/src/uts/common/sys/aggr_impl.h3
-rw-r--r--usr/src/uts/common/sys/buf.h8
-rw-r--r--usr/src/uts/common/sys/cpucaps.h5
-rw-r--r--usr/src/uts/common/sys/cpucaps_impl.h6
-rw-r--r--usr/src/uts/common/sys/cred.h1
-rw-r--r--usr/src/uts/common/sys/ctf_api.h5
-rw-r--r--usr/src/uts/common/sys/dktp/dadk.h2
-rw-r--r--usr/src/uts/common/sys/dld.h3
-rw-r--r--usr/src/uts/common/sys/dls.h5
-rw-r--r--usr/src/uts/common/sys/dls_impl.h4
-rw-r--r--usr/src/uts/common/sys/dls_mgmt.h2
-rw-r--r--usr/src/uts/common/sys/dtrace.h39
-rw-r--r--usr/src/uts/common/sys/dtrace_impl.h2
-rw-r--r--usr/src/uts/common/sys/fs/hyprlofs.h91
-rw-r--r--usr/src/uts/common/sys/fs/hyprlofs_info.h174
-rw-r--r--usr/src/uts/common/sys/fs/tmp.h39
-rw-r--r--usr/src/uts/common/sys/fss.h7
-rw-r--r--usr/src/uts/common/sys/mac.h15
-rw-r--r--usr/src/uts/common/sys/mac_client.h5
-rw-r--r--usr/src/uts/common/sys/mac_client_impl.h27
-rw-r--r--usr/src/uts/common/sys/mac_client_priv.h4
-rw-r--r--usr/src/uts/common/sys/mac_flow.h2
-rw-r--r--usr/src/uts/common/sys/mac_impl.h3
-rw-r--r--usr/src/uts/common/sys/mman.h2
-rw-r--r--usr/src/uts/common/sys/mntent.h2
-rw-r--r--usr/src/uts/common/sys/param.h2
-rw-r--r--usr/src/uts/common/sys/policy.h1
-rw-r--r--usr/src/uts/common/sys/sdt_impl.h8
-rw-r--r--usr/src/uts/common/sys/sunddi.h1
-rw-r--r--usr/src/uts/common/sys/thread.h2
-rw-r--r--usr/src/uts/common/sys/uadmin.h3
-rw-r--r--usr/src/uts/common/sys/vm_usage.h4
-rw-r--r--usr/src/uts/common/sys/vnic_impl.h10
-rw-r--r--usr/src/uts/common/sys/zone.h195
-rw-r--r--usr/src/uts/common/syscall/getloadavg.c14
-rw-r--r--usr/src/uts/common/syscall/memcntl.c9
-rw-r--r--usr/src/uts/common/syscall/sysconfig.c24
-rw-r--r--usr/src/uts/common/syscall/uadmin.c6
-rw-r--r--usr/src/uts/common/vm/hat.h2
-rw-r--r--usr/src/uts/common/vm/seg_vn.c12
-rw-r--r--usr/src/uts/common/vm/vm_anon.c11
-rw-r--r--usr/src/uts/common/vm/vm_as.c20
-rw-r--r--usr/src/uts/common/vm/vm_pvn.c28
-rw-r--r--usr/src/uts/common/vm/vm_usage.c198
-rw-r--r--usr/src/uts/i86pc/Makefile.rules2
-rw-r--r--usr/src/uts/i86pc/dboot/dboot_startkern.c302
-rw-r--r--usr/src/uts/i86pc/io/ppm/acpisleep.c24
-rw-r--r--usr/src/uts/i86pc/io/psm/psm_common.c3
-rw-r--r--usr/src/uts/i86pc/os/cpr_impl.c14
-rw-r--r--usr/src/uts/i86pc/os/fakebop.c38
-rw-r--r--usr/src/uts/i86pc/os/ibft.c6
-rw-r--r--usr/src/uts/i86pc/os/lgrpplat.c14
-rw-r--r--usr/src/uts/i86pc/os/mlsetup.c20
-rw-r--r--usr/src/uts/i86pc/os/mp_startup.c16
-rw-r--r--usr/src/uts/i86pc/os/startup.c51
-rw-r--r--usr/src/uts/i86pc/sys/acpidev.h3
-rw-r--r--usr/src/uts/i86pc/vm/hat_i86.c44
-rw-r--r--usr/src/uts/intel/Makefile.files19
-rw-r--r--usr/src/uts/intel/Makefile.intel8
-rw-r--r--usr/src/uts/intel/Makefile.rules13
-rw-r--r--usr/src/uts/intel/brand/sngl/sngl_brand_asm.s31
-rw-r--r--usr/src/uts/intel/core_pcbe/Makefile4
-rw-r--r--usr/src/uts/intel/dr_sas/Makefile90
-rw-r--r--usr/src/uts/intel/dtrace/Makefile2
-rw-r--r--usr/src/uts/intel/dtrace/sdt.c17
-rw-r--r--usr/src/uts/intel/hook/hook.global-objs.debug643
-rw-r--r--usr/src/uts/intel/hyprlofs/Makefile83
-rw-r--r--usr/src/uts/intel/io/acpica/changes.txt585
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbcmds.c473
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbdisply.c34
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbexec.c2
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbfileio.c7
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbhistry.c2
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbinput.c14
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbmethod.c2
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbnames.c2
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbstats.c30
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbutils.c9
-rw-r--r--usr/src/uts/intel/io/acpica/debugger/dbxface.c2
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmbuffer.c10
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmnames.c2
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmobject.c2
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmopcode.c75
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmresrc.c15
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c3
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmresrcl2.c700
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmresrcs.c51
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmutils.c52
-rw-r--r--usr/src/uts/intel/io/acpica/disassembler/dmwalk.c5
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsargs.c12
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsfield.c80
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsinit.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsobject.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsopcode.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dsutils.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dswexec.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dswload.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dswload2.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dswscope.c2
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dswstate.c2
-rw-r--r--usr/src/uts/intel/io/acpica/events/evevent.c20
-rw-r--r--usr/src/uts/intel/io/acpica/events/evglock.c12
-rw-r--r--usr/src/uts/intel/io/acpica/events/evgpe.c5
-rw-r--r--usr/src/uts/intel/io/acpica/events/evgpeblk.c5
-rw-r--r--usr/src/uts/intel/io/acpica/events/evgpeinit.c5
-rw-r--r--usr/src/uts/intel/io/acpica/events/evgpeutil.c5
-rw-r--r--usr/src/uts/intel/io/acpica/events/evmisc.c186
-rw-r--r--usr/src/uts/intel/io/acpica/events/evregion.c32
-rw-r--r--usr/src/uts/intel/io/acpica/events/evrgnini.c2
-rw-r--r--usr/src/uts/intel/io/acpica/events/evsci.c6
-rw-r--r--usr/src/uts/intel/io/acpica/events/evxface.c686
-rw-r--r--usr/src/uts/intel/io/acpica/events/evxfevnt.c5
-rw-r--r--usr/src/uts/intel/io/acpica/events/evxfgpe.c5
-rw-r--r--usr/src/uts/intel/io/acpica/events/evxfregn.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exconfig.c4
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exconvrt.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/excreate.c30
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exdebug.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exdump.c37
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exfield.c28
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exfldio.c28
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exmisc.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exmutex.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exnames.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exoparg1.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exoparg2.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exoparg3.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exoparg6.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exprep.c29
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exregion.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exresnte.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exresolv.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exresop.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exstore.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exstoren.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exstorob.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exsystem.c2
-rw-r--r--usr/src/uts/intel/io/acpica/executer/exutils.c32
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwacpi.c5
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwesleep.c277
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwgpe.c5
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwpci.c2
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwregs.c16
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwsleep.c395
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwtimer.c4
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwvalid.c4
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwxface.c57
-rw-r--r--usr/src/uts/intel/io/acpica/hardware/hwxfsleep.c478
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsaccess.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsalloc.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsdump.c18
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsdumpdv.c4
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nseval.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsinit.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsload.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsnames.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsobject.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsparse.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nspredef.c47
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsrepair.c167
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsrepair2.c22
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nssearch.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsutils.c4
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nswalk.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsxfeval.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsxfname.c2
-rw-r--r--usr/src/uts/intel/io/acpica/namespace/nsxfobj.c2
-rw-r--r--usr/src/uts/intel/io/acpica/osl.c17
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psargs.c147
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psloop.c2
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psopcode.c13
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psparse.c2
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psscope.c2
-rw-r--r--usr/src/uts/intel/io/acpica/parser/pstree.c9
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psutils.c2
-rw-r--r--usr/src/uts/intel/io/acpica/parser/pswalk.c2
-rw-r--r--usr/src/uts/intel/io/acpica/parser/psxface.c2
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsaddr.c2
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rscalc.c69
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rscreate.c75
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsdump.c158
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsinfo.c61
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsio.c2
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsirq.c34
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rslist.c77
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsmemory.c2
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsmisc.c268
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsserial.c425
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsutils.c61
-rw-r--r--usr/src/uts/intel/io/acpica/resources/rsxface.c58
-rw-r--r--usr/src/uts/intel/io/acpica/tables/tbfadt.c54
-rw-r--r--usr/src/uts/intel/io/acpica/tables/tbfind.c2
-rw-r--r--usr/src/uts/intel/io/acpica/tables/tbinstal.c121
-rw-r--r--usr/src/uts/intel/io/acpica/tables/tbutils.c103
-rw-r--r--usr/src/uts/intel/io/acpica/tables/tbxface.c2
-rw-r--r--usr/src/uts/intel/io/acpica/tables/tbxfroot.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utaddress.c322
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utalloc.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utcache.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utclib.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utcopy.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utdebug.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utdecode.c41
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utdelete.c33
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/uteval.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utglobal.c22
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utids.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utinit.c46
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utlock.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utmath.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utmisc.c40
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utmutex.c11
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utobject.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utosi.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utresrc.c295
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utstate.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/uttrack.c8
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utxface.c54
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utxferror.c2
-rw-r--r--usr/src/uts/intel/io/acpica/utilities/utxfmutex.c213
-rw-r--r--usr/src/uts/intel/io/dktp/dcdev/dadk.c48
-rw-r--r--usr/src/uts/intel/io/ipmi/ipmi_kcs.c4
-rw-r--r--usr/src/uts/intel/io/ipmi/ipmi_main.c21
-rw-r--r--usr/src/uts/intel/io/ipmi/ipmivars.h1
-rw-r--r--usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c1
-rw-r--r--usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.h1
-rw-r--r--usr/src/uts/intel/io/vmxnet/buildNumber.h12
-rw-r--r--usr/src/uts/intel/io/vmxnet/includeCheck.h159
-rw-r--r--usr/src/uts/intel/io/vmxnet/net.h220
-rw-r--r--usr/src/uts/intel/io/vmxnet/net_sg.h84
-rw-r--r--usr/src/uts/intel/io/vmxnet/vm_basic_types.h1037
-rw-r--r--usr/src/uts/intel/io/vmxnet/vm_device_version.h246
-rw-r--r--usr/src/uts/intel/io/vmxnet/vmnet_def.h91
-rw-r--r--usr/src/uts/intel/io/vmxnet/vmxnet.c2438
-rw-r--r--usr/src/uts/intel/io/vmxnet/vmxnet.conf24
-rw-r--r--usr/src/uts/intel/io/vmxnet/vmxnet2_def.h436
-rw-r--r--usr/src/uts/intel/io/vmxnet/vmxnet_def.h184
-rw-r--r--usr/src/uts/intel/ip/ip.global-objs.debug641
-rw-r--r--usr/src/uts/intel/ip/ip.global-objs.obj641
-rw-r--r--usr/src/uts/intel/ipf/ipf.global-objs.debug6424
-rw-r--r--usr/src/uts/intel/kdi/kdi_idt.c3
-rw-r--r--usr/src/uts/intel/lxprocfs/Makefile88
-rw-r--r--usr/src/uts/intel/opteron_pcbe/Makefile2
-rw-r--r--usr/src/uts/intel/os/driver_aliases1
-rw-r--r--usr/src/uts/intel/os/name_to_major1
-rw-r--r--usr/src/uts/intel/p123_pcbe/Makefile4
-rw-r--r--usr/src/uts/intel/p4_pcbe/Makefile2
-rw-r--r--usr/src/uts/intel/sngl_brand/Makefile98
-rw-r--r--usr/src/uts/intel/sys/acpi/acapps.h13
-rw-r--r--usr/src/uts/intel/sys/acpi/accommon.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acconfig.h30
-rw-r--r--usr/src/uts/intel/sys/acpi/acdebug.h12
-rw-r--r--usr/src/uts/intel/sys/acpi/acdisasm.h202
-rw-r--r--usr/src/uts/intel/sys/acpi/acdispat.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acevents.h21
-rw-r--r--usr/src/uts/intel/sys/acpi/acexcep.h8
-rw-r--r--usr/src/uts/intel/sys/acpi/acglobal.h34
-rw-r--r--usr/src/uts/intel/sys/acpi/achware.h63
-rw-r--r--usr/src/uts/intel/sys/acpi/acinterp.h6
-rw-r--r--usr/src/uts/intel/sys/acpi/aclocal.h56
-rw-r--r--usr/src/uts/intel/sys/acpi/acmacros.h11
-rw-r--r--usr/src/uts/intel/sys/acpi/acnames.h15
-rw-r--r--usr/src/uts/intel/sys/acpi/acnamesp.h5
-rw-r--r--usr/src/uts/intel/sys/acpi/acobject.h13
-rw-r--r--usr/src/uts/intel/sys/acpi/acopcode.h6
-rw-r--r--usr/src/uts/intel/sys/acpi/acoutput.h3
-rw-r--r--usr/src/uts/intel/sys/acpi/acparser.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acpi.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/acpiosxf.h12
-rw-r--r--usr/src/uts/intel/sys/acpi/acpixf.h201
-rw-r--r--usr/src/uts/intel/sys/acpi/acpredef.h40
-rw-r--r--usr/src/uts/intel/sys/acpi/acresrc.h117
-rw-r--r--usr/src/uts/intel/sys/acpi/acrestyp.h228
-rw-r--r--usr/src/uts/intel/sys/acpi/acstruct.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/actables.h7
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl.h32
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl1.h87
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl2.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/actbl3.h650
-rw-r--r--usr/src/uts/intel/sys/acpi/actypes.h48
-rw-r--r--usr/src/uts/intel/sys/acpi/acutils.h50
-rw-r--r--usr/src/uts/intel/sys/acpi/amlcode.h31
-rw-r--r--usr/src/uts/intel/sys/acpi/amlresrc.h162
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/accygwin.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acefi.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acenv.h26
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acfreebsd.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acgcc.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acintel.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/aclinux.h5
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acmsvc.h24
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acnetbsd.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acos2.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acwin.h2
-rw-r--r--usr/src/uts/intel/sys/acpi/platform/acwin64.h2
-rw-r--r--usr/src/uts/intel/sys/bootinfo.h21
-rw-r--r--usr/src/uts/intel/sys/bootvfs.h17
-rw-r--r--usr/src/uts/intel/sys/x86_archext.h33
-rw-r--r--usr/src/uts/intel/vmxnet/Makefile93
-rw-r--r--usr/src/uts/sparc/dtrace/Makefile1
-rw-r--r--usr/src/uts/sparc/dtrace/sdt.c17
-rw-r--r--usr/src/uts/sparc/ip/ip.global-objs.debug641
-rw-r--r--usr/src/uts/sparc/ip/ip.global-objs.obj641
-rw-r--r--usr/src/uts/sun4u/io/pci/pcisch.c5
1245 files changed, 144880 insertions, 11647 deletions
diff --git a/.gitignore b/.gitignore
index 1c3b884ffc..2b182e6db5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,9079 @@
-# .gitignore for illumos checkouts.
-# Note: this does not try to ignore all files in a fully built workspace.
-# Rather, you are expected to "make clobber" before running "git status".
+<<<<<<< HEAD
+*.o
.make.state*
+*.po
+*.so
+*.so.1
+*.a
+*.pyc
+/closed
+/illumos.sh
/log
+/nightly
+/on-closed-bins-nd.i386.tar.bz2
+/on-closed-bins.i386.tar.bz2
/packages
/proto
/webrev
-/usr/src/.build.tstamp
-/usr/src/ELF-data.*
-/usr/src/check-*.out
-/usr/src/clobber-*.out
-/usr/src/install-*.out
-/usr/src/lint-*.out
-/usr/src/lint-noise-*.out
-/usr/src/lint-noise-*.ref
-/usr/src/noise-*.out
-/usr/src/noise-*.ref
-/usr/src/tools/clobber-*.out
-/usr/src/tools/install-*.out
+.make.state
+.build.tstamp
+usr/src/ELF-data.*
+usr/src/check-i386.out
+usr/src/cmd/Adm/sun/motd
+usr/src/cmd/Adm/sun/smbpasswd
+usr/src/cmd/abi/appcert/etc/etc.alt
+usr/src/cmd/abi/appcert/etc/etc.scoped
+usr/src/cmd/abi/appcert/etc/etc.tweaks
+usr/src/cmd/abi/appcert/etc/etc.warn
+usr/src/cmd/abi/appcert/scripts/abi_index
+usr/src/cmd/abi/appcert/scripts/appcert
+usr/src/cmd/abi/appcert/scripts/symcheck
+usr/src/cmd/abi/appcert/scripts/symprof
+usr/src/cmd/abi/appcert/scripts/symreport
+usr/src/cmd/abi/appcert/static_prof/i386/static_prof
+usr/src/cmd/abi/apptracecmd/apptrace
+usr/src/cmd/abi/spectrans/spec2map/i386/spec2map
+usr/src/cmd/abi/spectrans/spec2trace/i386/spec2trace
+usr/src/cmd/acct/acct
+usr/src/cmd/acct/acctcms
+usr/src/cmd/acct/acctcom
+usr/src/cmd/acct/acctcon
+usr/src/cmd/acct/acctcon1
+usr/src/cmd/acct/acctcon2
+usr/src/cmd/acct/acctdisk
+usr/src/cmd/acct/acctdusg
+usr/src/cmd/acct/acctmerg
+usr/src/cmd/acct/accton
+usr/src/cmd/acct/acctprc
+usr/src/cmd/acct/acctprc1
+usr/src/cmd/acct/acctprc2
+usr/src/cmd/acct/acctwtmp
+usr/src/cmd/acct/chargefee
+usr/src/cmd/acct/ckpacct
+usr/src/cmd/acct/closewtmp
+usr/src/cmd/acct/dodisk
+usr/src/cmd/acct/fwtmp
+usr/src/cmd/acct/holidays
+usr/src/cmd/acct/lastlogin
+usr/src/cmd/acct/monacct
+usr/src/cmd/acct/nulladm
+usr/src/cmd/acct/prctmp
+usr/src/cmd/acct/prdaily
+usr/src/cmd/acct/prtacct
+usr/src/cmd/acct/remove
+usr/src/cmd/acct/runacct
+usr/src/cmd/acct/shutacct
+usr/src/cmd/acct/startup
+usr/src/cmd/acct/turnacct
+usr/src/cmd/acct/utmp2wtmp
+usr/src/cmd/acct/wtmpfix
+usr/src/cmd/acctadm/acctadm
+usr/src/cmd/acpihpd/THIRDPARTYLICENSE
+usr/src/cmd/acpihpd/i386/acpihpd
+usr/src/cmd/adbgen/i386/adbgen
+usr/src/cmd/adbgen/i386/adbgen1
+usr/src/cmd/adbgen/i386/adbgen3
+usr/src/cmd/adbgen/i386/adbgen4
+usr/src/cmd/addbadsec/addbadsec
+usr/src/cmd/allocate/add_allocatable
+usr/src/cmd/allocate/allocate
+usr/src/cmd/allocate/allscripts.sh
+usr/src/cmd/allocate/audio
+usr/src/cmd/allocate/audio_clean
+usr/src/cmd/allocate/disk_clean
+usr/src/cmd/allocate/dminfo
+usr/src/cmd/allocate/fd0
+usr/src/cmd/allocate/mkdevalloc
+usr/src/cmd/allocate/sr0
+usr/src/cmd/allocate/st0
+obj32
+obj64
+usr/src/cmd/allocate/st1
+usr/src/cmd/allocate/st_clean
+usr/src/cmd/amt/amd64/amt
+usr/src/cmd/amt/amt
+usr/src/cmd/amt/i386/amt
+usr/src/cmd/arch/arch
+usr/src/cmd/asa/asa
+usr/src/cmd/ast/msgcc/msgcc
+usr/src/cmd/ast/msgcc/msgcpp
+usr/src/cmd/ast/msgcc/msgcvt
+usr/src/cmd/ast/msgcc/msggen
+usr/src/cmd/ast/msgcc/msgget
+usr/src/cmd/audio/audioconvert/audioconvert
+usr/src/cmd/audio/audioctl/audioctl
+usr/src/cmd/audio/audioplay/audioplay
+usr/src/cmd/audio/audiorecord/audiorecord
+usr/src/cmd/audio/audiotest/audiotest
+usr/src/cmd/audit/audit
+usr/src/cmd/audit_warn/audit_warn
+usr/src/cmd/auditconfig/auditconfig
+usr/src/cmd/auditd/auditd
+usr/src/cmd/auditrecord/audit_record_attr
+usr/src/cmd/auditrecord/auditrecord
+usr/src/cmd/auditrecord/filter_txt
+usr/src/cmd/auditrecord/mkmsg
+usr/src/cmd/auditreduce/auditreduce
+usr/src/cmd/auditset/svc-auditset
+usr/src/cmd/auditstat/auditstat
+usr/src/cmd/auths/auths
+usr/src/cmd/autopush/autopush
+usr/src/cmd/availdevs/availdevs
+usr/src/cmd/avs/dsbitmap/dsbitmap
+usr/src/cmd/avs/dscfg/dscfg
+usr/src/cmd/avs/dscfg/dscfgadm
+usr/src/cmd/avs/dscfglockd/dscfgcli
+usr/src/cmd/avs/dscfglockd/dscfglockd
+usr/src/cmd/avs/dsstat/dsstat
+usr/src/cmd/avs/dsw/etc/ii
+usr/src/cmd/avs/dsw/etc/ii.cluster
+usr/src/cmd/avs/dsw/iiadm
+usr/src/cmd/avs/dsw/iiboot
+usr/src/cmd/avs/dsw/iicpbmp
+usr/src/cmd/avs/dsw/iicpshd
+usr/src/cmd/avs/errgen/errgen
+usr/src/cmd/avs/ncall/ncalladm
+usr/src/cmd/avs/nsctl/nscadm
+usr/src/cmd/avs/nsctl/nskernd
+usr/src/cmd/avs/rdc/etc/rdc
+usr/src/cmd/avs/rdc/etc/rdc.cluster
+usr/src/cmd/avs/rdc/etc/rdcfinish
+usr/src/cmd/avs/rdc/sndradm
+usr/src/cmd/avs/rdc/sndrboot
+usr/src/cmd/avs/rdc/sndrd
+usr/src/cmd/avs/rdc/sndrsyncd
+usr/src/cmd/avs/sdbc/etc/dscfg_reconfigure.cluster
+usr/src/cmd/avs/sdbc/etc/scm
+usr/src/cmd/avs/sdbc/scmadm
+usr/src/cmd/avs/sdbc/sd_diag
+usr/src/cmd/avs/sdbc/sd_stats
+usr/src/cmd/avs/sv/etc/sv
+usr/src/cmd/avs/sv/etc/sv.cluster
+usr/src/cmd/avs/sv/svadm
+usr/src/cmd/avs/sv/svboot
+usr/src/cmd/avs/svc/nws_ii.xml
+usr/src/cmd/avs/svc/nws_rdc.xml
+usr/src/cmd/avs/svc/nws_rdcsyncd.xml
+usr/src/cmd/avs/svc/nws_scm.xml
+usr/src/cmd/avs/svc/nws_sv.xml
+usr/src/cmd/awk/awk.g.c
+usr/src/cmd/awk/awk.lx.c
+usr/src/cmd/awk/maketab
+usr/src/cmd/awk/nawk
+usr/src/cmd/awk/proctab.c
+usr/src/cmd/awk/y.tab.h
+usr/src/cmd/awk_xpg4/awk.c
+usr/src/cmd/awk_xpg4/awk.xpg4
+usr/src/cmd/awk_xpg4/y.tab.h
+usr/src/cmd/backup/dump/dumpdates
+usr/src/cmd/backup/dump/ufsdump
+usr/src/cmd/backup/lib/getdate.c
+usr/src/cmd/backup/restore/ufsrestore
+usr/src/cmd/banner/banner
+usr/src/cmd/bart/bart
+usr/src/cmd/basename/basename
+usr/src/cmd/basename/basename.xpg4
+usr/src/cmd/bc/bc
+usr/src/cmd/bc/bc.xpg6
+usr/src/cmd/bc/lib.b
+usr/src/cmd/bdiff/bdiff
+usr/src/cmd/beadm/beadm
+usr/src/cmd/bfs/bfs
+usr/src/cmd/biosdev/biosdev
+usr/src/cmd/bnu/bnuconvert
+usr/src/cmd/bnu/bnuconvert.cat
+usr/src/cmd/bnu/ct
+usr/src/cmd/bnu/ct.cat
+usr/src/cmd/bnu/cu
+usr/src/cmd/bnu/cu.cat
+usr/src/cmd/bnu/in.uucpd
+usr/src/cmd/bnu/in.uucpd.cat
+usr/src/cmd/bnu/remote.unknown
+usr/src/cmd/bnu/remote.unknown.cat
+usr/src/cmd/bnu/uucheck
+usr/src/cmd/bnu/uucheck.cat
+usr/src/cmd/bnu/uucico
+usr/src/cmd/bnu/uucico.cat
+usr/src/cmd/bnu/uucleanup
+usr/src/cmd/bnu/uucleanup.cat
+usr/src/cmd/bnu/uucp
+usr/src/cmd/bnu/uucp.cat
+usr/src/cmd/bnu/uudecode
+usr/src/cmd/bnu/uudecode.cat
+usr/src/cmd/bnu/uuencode
+usr/src/cmd/bnu/uuencode.cat
+usr/src/cmd/bnu/uuglist
+usr/src/cmd/bnu/uuglist.cat
+usr/src/cmd/bnu/uuname
+usr/src/cmd/bnu/uuname.cat
+usr/src/cmd/bnu/uusched
+usr/src/cmd/bnu/uusched.cat
+usr/src/cmd/bnu/uustat
+usr/src/cmd/bnu/uustat.cat
+usr/src/cmd/bnu/uux
+usr/src/cmd/bnu/uux.cat
+usr/src/cmd/bnu/uuxqt
+usr/src/cmd/bnu/uuxqt.cat
+usr/src/cmd/boot/bootadm/bootadm
+usr/src/cmd/boot/fiocompress/fiocompress
+usr/src/cmd/boot/installgrub/installgrub
+usr/src/cmd/boot/mbr/mbr
+usr/src/cmd/boot/scripts/boot-archive-update
+usr/src/cmd/boot/scripts/create_diskmap
+usr/src/cmd/boot/scripts/create_ramdisk
+usr/src/cmd/boot/scripts/extract_boot_filelist
+usr/src/cmd/boot/scripts/root_archive
+usr/src/cmd/boot/scripts/update_grub
+usr/src/cmd/boot/symdef/symdef
+usr/src/cmd/busstat/busstat
+usr/src/cmd/cal/cal
+usr/src/cmd/cal/cal.dc
+usr/src/cmd/calendar/calendar
+usr/src/cmd/calendar/calprog
+usr/src/cmd/captoinfo/captoinfo
+usr/src/cmd/cat/cat
+usr/src/cmd/cdrw/cdrw
+usr/src/cmd/cfgadm/cfgadm
+usr/src/cmd/cfgadm/cfgadm.dc
+usr/src/cmd/checkeq/checkeq
+usr/src/cmd/checknr/checknr
+usr/src/cmd/chgrp/chgrp
+usr/src/cmd/chgrp/chgrp.xpg4
+usr/src/cmd/chmod/chmod
+usr/src/cmd/chown/chown
+usr/src/cmd/chown/chown.xpg4
+usr/src/cmd/chroot/chroot
+usr/src/cmd/clear/clear
+usr/src/cmd/clinfo/clinfo
+usr/src/cmd/cmd-crypto/cryptoadm/cryptoadm
+usr/src/cmd/cmd-crypto/decrypt/amd64/decrypt
+usr/src/cmd/cmd-crypto/decrypt/i386/decrypt
+usr/src/cmd/cmd-crypto/digest/amd64/digest
+usr/src/cmd/cmd-crypto/digest/i386/digest
+usr/src/cmd/cmd-crypto/elfsign/elfsign
+usr/src/cmd/cmd-crypto/etc/certs/SUNWObjectCA
+usr/src/cmd/cmd-crypto/kmfcfg/kmfcfg
+usr/src/cmd/cmd-crypto/kmscfg/kmscfg
+usr/src/cmd/cmd-crypto/pktool/pktool
+usr/src/cmd/cmd-crypto/tpmadm/tpmadm
+usr/src/cmd/cmd-inet/etc/datemsk.ndpd
+usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmtd
+usr/src/cmd/cmd-inet/lib/netcfgd/netcfgd
+usr/src/cmd/cmd-inet/lib/nwamd/nwamd
+usr/src/cmd/cmd-inet/sbin/dhcpagent/dhcpagent
+usr/src/cmd/cmd-inet/sbin/dhcpinfo/dhcpinfo
+usr/src/cmd/cmd-inet/sbin/ifparse/ifparse
+usr/src/cmd/cmd-inet/sbin/netstrategy/netstrategy
+usr/src/cmd/cmd-inet/usr.bin/chat/chat
+usr/src/cmd/cmd-inet/usr.bin/dns-sd
+usr/src/cmd/cmd-inet/usr.bin/finger
+usr/src/cmd/cmd-inet/usr.bin/ftp/ftp
+usr/src/cmd/cmd-inet/usr.bin/nc/nc
+usr/src/cmd/cmd-inet/usr.bin/nca/ncab2clf
+usr/src/cmd/cmd-inet/usr.bin/netstat/netstat
+usr/src/cmd/cmd-inet/usr.bin/pppd/pppd
+usr/src/cmd/cmd-inet/usr.bin/pppdump/THIRDPARTYLICENSE
+usr/src/cmd/cmd-inet/usr.bin/pppdump/pppdump
+usr/src/cmd/cmd-inet/usr.bin/pppstats/pppstats
+usr/src/cmd/cmd-inet/usr.bin/rcp
+usr/src/cmd/cmd-inet/usr.bin/rdate
+usr/src/cmd/cmd-inet/usr.bin/rdist/rdist
+usr/src/cmd/cmd-inet/usr.bin/rlogin
+usr/src/cmd/cmd-inet/usr.bin/rsh
+usr/src/cmd/cmd-inet/usr.bin/ruptime
+usr/src/cmd/cmd-inet/usr.bin/rwho
+usr/src/cmd/cmd-inet/usr.bin/talk/talk
+usr/src/cmd/cmd-inet/usr.bin/telnet/telnet
+usr/src/cmd/cmd-inet/usr.bin/tftp/tftp
+usr/src/cmd/cmd-inet/usr.bin/whois
+usr/src/cmd/cmd-inet/usr.lib/bridged/bridged
+usr/src/cmd/cmd-inet/usr.lib/dhcp/dhcpconfig
+usr/src/cmd/cmd-inet/usr.lib/dhcp/dhtadm
+usr/src/cmd/cmd-inet/usr.lib/dhcp/pntadm
+usr/src/cmd/cmd-inet/usr.lib/dsvclockd/dsvclockd
+usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/ilb_probe
+usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd
+usr/src/cmd/cmd-inet/usr.lib/in.chargend/in.chargend
+usr/src/cmd/cmd-inet/usr.lib/in.daytimed/in.daytimed
+usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/in.dhcpd
+usr/src/cmd/cmd-inet/usr.lib/in.discardd/in.discardd
+usr/src/cmd/cmd-inet/usr.lib/in.echod/in.echod
+usr/src/cmd/cmd-inet/usr.lib/in.mpathd/in.mpathd
+usr/src/cmd/cmd-inet/usr.lib/in.ndpd/in.ndpd
+usr/src/cmd/cmd-inet/usr.lib/in.ripngd/in.ripngd
+usr/src/cmd/cmd-inet/usr.lib/in.timed/in.timed
+usr/src/cmd/cmd-inet/usr.lib/inetd/inetd
+usr/src/cmd/cmd-inet/usr.lib/inetd/inetd-upgrade
+usr/src/cmd/cmd-inet/usr.lib/mdnsd/mdnsd
+usr/src/cmd/cmd-inet/usr.lib/ncaconfd/ncaconfd
+usr/src/cmd/cmd-inet/usr.lib/pppoe/pppoec
+usr/src/cmd/cmd-inet/usr.lib/pppoe/pppoed
+usr/src/cmd/cmd-inet/usr.lib/slpd/slpd
+usr/src/cmd/cmd-inet/usr.lib/vrrpd/vrrpd
+usr/src/cmd/cmd-inet/usr.lib/wanboot/encr/encr
+usr/src/cmd/cmd-inet/usr.lib/wanboot/hmac/hmac
+usr/src/cmd/cmd-inet/usr.lib/wanboot/ickey/ickey
+usr/src/cmd/cmd-inet/usr.lib/wanboot/keygen/keygen
+usr/src/cmd/cmd-inet/usr.lib/wanboot/keymgmt/keymgmt
+usr/src/cmd/cmd-inet/usr.lib/wanboot/netbootinfo/netbootinfo
+usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/p12split
+usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/wanboot-cgi
+usr/src/cmd/cmd-inet/usr.lib/wpad/wpad
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/SUNWbinfiles.jar
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/SUNWbinfiles.manifest
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/SUNWfiles.jar
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/SUNWfiles.manifest
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/bin/dhcpmgr
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/Bridge.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/BridgeException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/DsymException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/ExistsException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/HostExistsException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/InvalidPathException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/InvalidRsrcException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/NoDefaultsException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/NoEntryException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/NoHostsEntryException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/NoTableException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/NotRunningException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/TableExistsException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/WordexpException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/bridge/com_sun_dhcpmgr_bridge_Bridge.h
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/Console.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/DhcpCliFunction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/DhcpCliOption.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/DhcpCliOptions.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/DhcpCliPrint.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/DhcpCliProgram.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/Format.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/GetOpt.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/GetSubOpt.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/common/Util.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpbatch/DhcpBatch.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpbatch/DhcpCommand.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpbatch/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureBootp.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureDhcp.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureNetwork.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$Action.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$ActionDisable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$ActionEnable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$ActionImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$ActionQuery.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService$ActionReenable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConfigureService.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ConvertDataStore.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/DhcpCfg.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/DhcpCfgFunction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ExportData.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/IPAddressList.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ImportData.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter$Action.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter$ActionDelete.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter$ActionGet.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter$ActionGetAll.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter$ActionImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter$ActionSet.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/ServerParameter.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhcpconfig/UnconfigureDhcp.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/AddEntry.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/CreateTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/DeleteEntry.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/DhtAdm.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/DhtAdmBatch.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/DhtAdmFunction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/DisplayTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/ModifyEntry.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/RemoveTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/dhtadm/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/AddClientEntry.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/CreateNetworkTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/DeleteClientEntry.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/DisplayNetworkTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/ListNetworkTables.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/ModifyClientEntry.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/PntAdm.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/PntAdmBatch.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/PntAdmFunction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/RemoveNetworkTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/cli/pntadm/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$10.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$11.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$5.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$6$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$6.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$7$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$7.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$8.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$9.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$AddressLoader$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$AddressLoader.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$AddressTableCellRenderer.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$AddressTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$DialogListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView$NetworkListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressView.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$2$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$Address.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ConfigureStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ConfigureStep$MacroListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ConfigureStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ConfirmStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$LeaseStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$NumberStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$NumberStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ReviewStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ServerStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$ServerStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard$WizardTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/AddressWizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$DnsStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$LeaseStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetTypeStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetTypeStep$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetTypeStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetworkStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetworkStep$NetworkComboBoxEditor.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetworkStep$NetworkListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NetworkStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$NisStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard$ReviewStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigWizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigureChoiceDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConfigureRelayDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConvertWizard$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConvertWizard$2$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConvertWizard$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConvertWizard$ReviewStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConvertWizard$SaveTablesStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ConvertWizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateAddressDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateAddressDialog$MacroListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateAddressDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateMacroDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateMacroDialog$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateMacroDialog$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateMacroDialog$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateMacroDialog$MacroTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateMacroDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$5.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$6.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog$ClassListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/CreateOptionDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSModule.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSModuleEvent.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSModuleListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard$DSConf.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard$DSConfButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard$DSConfList.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard$DatastoreModuleStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard$DatastoreStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard$DatastoreStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DSWizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DataManager.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteAddressDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteAddressDialog$AddressTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteAddressDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteMacroDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog$5.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog$NetworkListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteNetworksDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DeleteOptionDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ConversionTransition.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ConvertAction$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ConvertAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$DisableAction$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$DisableAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$EnableAction$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$EnableAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ExportAction$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ExportAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$HowToAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ImportAction$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ImportAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$IndexAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ModifyServiceAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$OverviewAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$RestartAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$ServiceAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$StartAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$StopAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$UnconfigureServiceAction$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$UnconfigureServiceAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet$WizardTransition.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrApplet.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcpmgrDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcptabNameDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DhcptabNameField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DialogActions.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/DisableServiceDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ErrorTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ErrorTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$ErrorDisplay.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$FileStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$FileStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$MacroStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$NetworkStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$OptionStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$OverwritePrompter.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$ReviewStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard$WarningDisplay.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ExportWizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$ErrorDisplay.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$LocationStep$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$LocationStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard$ReviewStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ImportWizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroLoader$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroLoader.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroNameField$MacroNameDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroNameField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$DialogListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$MacroTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$MacroTreeModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$MacroTreeNode.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView$MacroTreeRootNode.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MacroView.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ModifyAddressesDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ModifyAddressesDialog$MacroListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ModifyAddressesDialog$ServerListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ModifyAddressesDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MultipleOperationDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MultipleOperationDialog$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/MultipleOperationDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionNameField$OptionNameDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionNameField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$5.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$DialogListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$OptionLoader$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$OptionLoader.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView$OptionTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/OptionView.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/RelayView.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ReleaseAddressDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ReleaseAddressDialog$AddressTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ReleaseAddressDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SUNWModule$PathListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SUNWModule.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SUNWbinfiles/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SUNWbinfiles/SUNWbinfiles.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SUNWfiles/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SUNWfiles/SUNWfiles.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SelectOptionDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SelectOptionDialog$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SelectOptionDialog$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SelectOptionDialog$OptionTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/SelectOptionDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$5.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$6.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$7.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$8.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog$InterfaceTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ServerOptionsDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/UnconfigureDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/UnconfigureDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ViewMacroDialog$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ViewMacroDialog$MacroTableModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/client/ViewMacroDialog.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/common/ExportController.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/common/Exporter.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/common/ImportController.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/common/Importer.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/common/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/ActionError.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/AsciiOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/BogusOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/BooleanOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpClientFlagType.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpClientFlagTypes.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpClientRecord.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpConfigOpts.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpConfigOpts.java
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpDatastore.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpResource.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcpdOptions.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/DhcptabRecord.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/ExportHeader.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/IPAddress.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/IPInterface.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/IPOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/IncludeOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/Macro.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/Network.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/NumberOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/NumberValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/OctetOptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/Option.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/OptionContext.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/OptionType.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/OptionValue.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/OptionValueFactory.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/OptionsTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/StandardOptions$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/StandardOptions.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/ValidationException.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/Qualifier.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierAnd.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierArray.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierBoolean.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierEnum.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierFQDN.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierIPv4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierIPv6.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierInteger.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierIntegerEnum.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierIntegerRange.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierOr.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierRange.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierString.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierStringEnum.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierType.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/data/qualifier/QualifierTypeImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcpMgr.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcpMgrImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcpNetMgr.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcpNetMgrImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcpServiceMgr.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcpServiceMgrImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcptabMgr.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/server/DhcptabMgrImpl.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ALIGNMENT.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/AutosizingTable.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ButtonLayout.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ButtonPanel$ButtonAdaptor.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ButtonPanel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ButtonPanelListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/DownButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ExtendedCellRenderer.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/FieldLayout$Row.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/FieldLayout.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/FixedSelectionModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/HelpIds.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/HostnameField$HostnameDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/HostnameField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressField$IPAddressDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressList$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressList$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressList$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressList$IPAddressListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IPAddressList.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ImageButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IntegerField$IntegerDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/IntegerField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/LeftButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ListPair$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ListPair$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ListPair$3.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ListPair$4.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ListPair.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ListPairLayout.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$CreateAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$DeleteAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$DuplicateAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$ExitAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$FindPanel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$PropertiesAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$StatusBar.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$UpdateAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame$ViewSelectionListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MainFrame.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Mnemonic.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/MnemonicAction.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/NextButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/NoSpaceField$NoSpaceDocument.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/NoSpaceField.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/OurListModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/PreviousButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ProgressManager$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ProgressManager.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ProportionalLayout.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/ResourceStrings.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/RightButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/SelectionListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/SortedHeaderRenderer.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/SwingWorker$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/SwingWorker$2.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/SwingWorker.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/TableMap.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/TableSorter$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/TableSorter.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/UpButton.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/VerticalButtonLayout.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/View.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/WizButtonListener.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$1.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$1MyTextArea.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizButtonPanel$ButtonAdaptor.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizButtonPanel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizContentsPanel$ContentsModel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizContentsPanel$ContentsRenderer.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizContentsPanel$MyList.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizContentsPanel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard$WizStepPanel.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/Wizard.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/com/sun/dhcpmgr/ui/WizardStep.class
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/dhcpcli.jar
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/dhcpcommon.jar
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/dhcpmgr.jar
+usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/dhcpsvc.jar
+usr/src/cmd/cmd-inet/usr.sbin/6to4relay
+usr/src/cmd/cmd-inet/usr.sbin/THIRDPARTYLICENSE.arp
+usr/src/cmd/cmd-inet/usr.sbin/arp
+usr/src/cmd/cmd-inet/usr.sbin/bootconfchk/bootconfchk
+usr/src/cmd/cmd-inet/usr.sbin/dhcpconfig
+usr/src/cmd/cmd-inet/usr.sbin/dhtadm
+usr/src/cmd/cmd-inet/usr.sbin/gettable
+usr/src/cmd/cmd-inet/usr.sbin/hostconfig
+usr/src/cmd/cmd-inet/usr.sbin/htable/htable
+usr/src/cmd/cmd-inet/usr.sbin/htable/y.tab.h
+usr/src/cmd/cmd-inet/usr.sbin/if_mpadm
+usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig
+usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm
+usr/src/cmd/cmd-inet/usr.sbin/in.comsat
+usr/src/cmd/cmd-inet/usr.sbin/in.fingerd
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ckconfig
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftpaddhost
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftpcmd.c
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftpconfig
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftpcount
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftprestart
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftpshut
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/ftpwho
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/in.ftpd
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/privatepw
+usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/y.tab.h
+usr/src/cmd/cmd-inet/usr.sbin/in.rarpd
+usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/in.rdisc
+usr/src/cmd/cmd-inet/usr.sbin/in.rexecd
+usr/src/cmd/cmd-inet/usr.sbin/in.rlogind
+usr/src/cmd/cmd-inet/usr.sbin/in.routed/in.routed
+usr/src/cmd/cmd-inet/usr.sbin/in.routed/rtquery
+usr/src/cmd/cmd-inet/usr.sbin/in.rshd
+usr/src/cmd/cmd-inet/usr.sbin/in.rwhod
+usr/src/cmd/cmd-inet/usr.sbin/in.talkd/in.talkd
+usr/src/cmd/cmd-inet/usr.sbin/in.telnetd
+usr/src/cmd/cmd-inet/usr.sbin/in.tftpd
+usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm
+usr/src/cmd/cmd-inet/usr.sbin/inetconv/inetconv
+usr/src/cmd/cmd-inet/usr.sbin/ipaddrsel
+usr/src/cmd/cmd-inet/usr.sbin/ipadm/ipadm
+usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/ipmpstat
+usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf
+usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm
+usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikecert
+usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecalgs
+usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf
+usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey
+usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm
+usr/src/cmd/cmd-inet/usr.sbin/kssl/ksslcfg/ksslcfg
+usr/src/cmd/cmd-inet/usr.sbin/ndd
+usr/src/cmd/cmd-inet/usr.sbin/nwamadm/nwamadm
+usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg
+usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg_grammar.tab.c
+usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg_grammar.tab.h
+usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg_lex.c
+usr/src/cmd/cmd-inet/usr.sbin/ping/ping
+usr/src/cmd/cmd-inet/usr.sbin/pntadm
+usr/src/cmd/cmd-inet/usr.sbin/route
+usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm
+usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop
+usr/src/cmd/cmd-inet/usr.sbin/soconfig
+usr/src/cmd/cmd-inet/usr.sbin/sppptun/sppptun
+usr/src/cmd/cmd-inet/usr.sbin/syncinit
+usr/src/cmd/cmd-inet/usr.sbin/syncloop
+usr/src/cmd/cmd-inet/usr.sbin/syncstat
+usr/src/cmd/cmd-inet/usr.sbin/traceroute/traceroute
+usr/src/cmd/cmd-inet/usr.sbin/wanbootutil
+usr/src/cmd/cmd-inet/usr.sbin/wificonfig/wificonfig
+usr/src/cmd/col/col
+usr/src/cmd/compress/compress
+usr/src/cmd/consadm/i386/consadm
+usr/src/cmd/coreadm/coreadm
+usr/src/cmd/cpc/cpustat/cpustat
+usr/src/cmd/cpc/cputrack/amd64/cputrack
+usr/src/cmd/cpc/cputrack/i386/cputrack
+usr/src/cmd/cpio/cpio
+usr/src/cmd/cron/at
+usr/src/cmd/cron/at.xpg4
+usr/src/cmd/cron/atq
+usr/src/cmd/cron/atrm
+usr/src/cmd/cron/att1.c
+usr/src/cmd/cron/att1.h
+usr/src/cmd/cron/att2.c
+usr/src/cmd/cron/batch
+usr/src/cmd/cron/batch.xpg4
+usr/src/cmd/cron/cron
+usr/src/cmd/cron/crontab
+usr/src/cmd/cron/crontab.xpg4
+usr/src/cmd/cron/crontab.xpg6
+usr/src/cmd/crypt/crypt
+usr/src/cmd/csh/i386/csh
+usr/src/cmd/csh/sh.tconst.h
+usr/src/cmd/csplit/csplit
+usr/src/cmd/ctrun/ctrun
+usr/src/cmd/ctstat/ctstat
+usr/src/cmd/ctwatch/ctwatch
+usr/src/cmd/datadm/datadm
+usr/src/cmd/date/date
+usr/src/cmd/date/date.xpg4
+usr/src/cmd/dc/dc
+usr/src/cmd/dc/dc.xpg6
+usr/src/cmd/dd/dd
+usr/src/cmd/deroff/deroff
+usr/src/cmd/devctl/devctl
+usr/src/cmd/devfsadm/i386/devfsadm
+usr/src/cmd/devfsadm/i386/devlink.tab
+usr/src/cmd/devfsadm/plcysubr.c
+usr/src/cmd/devinfo/devinfo
+usr/src/cmd/devmgmt/cmds/devattr
+usr/src/cmd/devmgmt/cmds/devfree
+usr/src/cmd/devmgmt/cmds/devreserv
+usr/src/cmd/devmgmt/cmds/getdev
+usr/src/cmd/devmgmt/cmds/getdgrp
+usr/src/cmd/devmgmt/cmds/getvol
+usr/src/cmd/devmgmt/cmds/listdgrp
+usr/src/cmd/devmgmt/cmds/putdev
+usr/src/cmd/devmgmt/cmds/putdgrp
+usr/src/cmd/devmgmt/mkdtab/mkdtab
+usr/src/cmd/devprop/devprop
+usr/src/cmd/dfs.cmds/dfshares/dfshares
+usr/src/cmd/dfs.cmds/general/unshare
+usr/src/cmd/dfs.cmds/shareall/shareall
+usr/src/cmd/dfs.cmds/sharectl/i386/sharectl
+usr/src/cmd/dfs.cmds/sharectl/i386/shareutil.c
+usr/src/cmd/dfs.cmds/sharemgr/i386/sharemgr
+usr/src/cmd/dfs.cmds/unshareall/unshareall
+usr/src/cmd/diff/diff
+usr/src/cmd/diff/diff.dc
+usr/src/cmd/diff/diffh
+usr/src/cmd/diff3/diff3
+usr/src/cmd/diff3/diff3prog
+usr/src/cmd/diffmk/diffmk
+usr/src/cmd/dircmp/dircmp
+usr/src/cmd/dirname/dirname
+usr/src/cmd/dis/dis
+usr/src/cmd/diskscan/diskscan
+usr/src/cmd/dispadmin/FSSdispadmin
+usr/src/cmd/dispadmin/FXdispadmin
+usr/src/cmd/dispadmin/IAdispadmin
+usr/src/cmd/dispadmin/RTdispadmin
+usr/src/cmd/dispadmin/SDCdispadmin
+usr/src/cmd/dispadmin/TSdispadmin
+usr/src/cmd/dispadmin/dispadmin
+usr/src/cmd/dladm/dladm
+usr/src/cmd/dlmgmtd/dlmgmtd
+usr/src/cmd/dlstat/dlstat
+usr/src/cmd/dmesg/dmesg
+usr/src/cmd/dtrace/amd64/dtrace
+usr/src/cmd/dtrace/demo/applicat.d
+usr/src/cmd/dtrace/demo/badopen.d
+usr/src/cmd/dtrace/demo/begin.d
+usr/src/cmd/dtrace/demo/callout.d
+usr/src/cmd/dtrace/demo/clause.d
+usr/src/cmd/dtrace/demo/clear.d
+usr/src/cmd/dtrace/demo/countdown.d
+usr/src/cmd/dtrace/demo/counter.d
+usr/src/cmd/dtrace/demo/dateprof.d
+usr/src/cmd/dtrace/demo/delay.d
+usr/src/cmd/dtrace/demo/denorm.d
+usr/src/cmd/dtrace/demo/end.d
+usr/src/cmd/dtrace/demo/error.d
+usr/src/cmd/dtrace/demo/errorpath.d
+usr/src/cmd/dtrace/demo/find.d
+usr/src/cmd/dtrace/demo/firebird.d
+usr/src/cmd/dtrace/demo/hello.d
+usr/src/cmd/dtrace/demo/howlong.d
+usr/src/cmd/dtrace/demo/index.html
+usr/src/cmd/dtrace/demo/interp.d
+usr/src/cmd/dtrace/demo/interval.d
+usr/src/cmd/dtrace/demo/intr.d
+usr/src/cmd/dtrace/demo/iocpu.d
+usr/src/cmd/dtrace/demo/iosnoop.d
+usr/src/cmd/dtrace/demo/iothrough.d
+usr/src/cmd/dtrace/demo/iotime.d
+usr/src/cmd/dtrace/demo/ipio.d
+usr/src/cmd/dtrace/demo/ipproto.d
+usr/src/cmd/dtrace/demo/iprb.d
+usr/src/cmd/dtrace/demo/kstat.d
+usr/src/cmd/dtrace/demo/ksyms.d
+usr/src/cmd/dtrace/demo/libc.d
+usr/src/cmd/dtrace/demo/lquantize.d
+usr/src/cmd/dtrace/demo/lwptime.d
+usr/src/cmd/dtrace/demo/mkdemo
+usr/src/cmd/dtrace/demo/normalize.d
+usr/src/cmd/dtrace/demo/nscd.d
+usr/src/cmd/dtrace/demo/pri.d
+usr/src/cmd/dtrace/demo/printa.d
+usr/src/cmd/dtrace/demo/pritime.d
+usr/src/cmd/dtrace/demo/prof.d
+usr/src/cmd/dtrace/demo/profpri.d
+usr/src/cmd/dtrace/demo/progtime.d
+usr/src/cmd/dtrace/demo/putnext.d
+usr/src/cmd/dtrace/demo/qlen.d
+usr/src/cmd/dtrace/demo/qtime.d
+usr/src/cmd/dtrace/demo/renormalize.d
+usr/src/cmd/dtrace/demo/restest.d
+usr/src/cmd/dtrace/demo/ring.d
+usr/src/cmd/dtrace/demo/rtime.d
+usr/src/cmd/dtrace/demo/rwinfo.d
+usr/src/cmd/dtrace/demo/rwtime.d
+usr/src/cmd/dtrace/demo/sig.d
+usr/src/cmd/dtrace/demo/soffice.d
+usr/src/cmd/dtrace/demo/spec.d
+usr/src/cmd/dtrace/demo/specopen.d
+usr/src/cmd/dtrace/demo/ssd.d
+usr/src/cmd/dtrace/demo/syscall.d
+usr/src/cmd/dtrace/demo/tcp1stbyte.d
+usr/src/cmd/dtrace/demo/tcpbytes.d
+usr/src/cmd/dtrace/demo/tcpbytesstat.d
+usr/src/cmd/dtrace/demo/tcpconnlat.d
+usr/src/cmd/dtrace/demo/tcpio.d
+usr/src/cmd/dtrace/demo/tcpioflags.d
+usr/src/cmd/dtrace/demo/tcprst.d
+usr/src/cmd/dtrace/demo/tcpsnoop.d
+usr/src/cmd/dtrace/demo/tcpstate.d
+usr/src/cmd/dtrace/demo/tcptop.d
+usr/src/cmd/dtrace/demo/tick.d
+usr/src/cmd/dtrace/demo/ticktime.d
+usr/src/cmd/dtrace/demo/time.d
+usr/src/cmd/dtrace/demo/tracewrite.d
+usr/src/cmd/dtrace/demo/trunc.d
+usr/src/cmd/dtrace/demo/trussrw.d
+usr/src/cmd/dtrace/demo/udpbytes.d
+usr/src/cmd/dtrace/demo/udpbytesstat.d
+usr/src/cmd/dtrace/demo/udpio.d
+usr/src/cmd/dtrace/demo/udpsnoop.d
+usr/src/cmd/dtrace/demo/udptop.d
+usr/src/cmd/dtrace/demo/userfunc.d
+usr/src/cmd/dtrace/demo/whatfor.d
+usr/src/cmd/dtrace/demo/whatlock.d
+usr/src/cmd/dtrace/demo/where.d
+usr/src/cmd/dtrace/demo/whererun.d
+usr/src/cmd/dtrace/demo/whoexec.d
+usr/src/cmd/dtrace/demo/whofor.d
+usr/src/cmd/dtrace/demo/whoio.d
+usr/src/cmd/dtrace/demo/whopreempt.d
+usr/src/cmd/dtrace/demo/whoqueue.d
+usr/src/cmd/dtrace/demo/whosteal.d
+usr/src/cmd/dtrace/demo/whowrite.d
+usr/src/cmd/dtrace/demo/writes.d
+usr/src/cmd/dtrace/demo/writesbycmd.d
+usr/src/cmd/dtrace/demo/writesbycmdfd.d
+usr/src/cmd/dtrace/demo/writetime.d
+usr/src/cmd/dtrace/demo/writetimeq.d
+usr/src/cmd/dtrace/demo/xioctl.d
+usr/src/cmd/dtrace/demo/xterm.d
+usr/src/cmd/dtrace/demo/xwork.d
+usr/src/cmd/dtrace/i386/dtrace
+usr/src/cmd/dtrace/test/cmd/baddof/baddof
+usr/src/cmd/dtrace/test/cmd/badioctl/badioctl
+usr/src/cmd/dtrace/test/cmd/chkargs/amd64/chkargs
+usr/src/cmd/dtrace/test/cmd/chkargs/i386/chkargs
+usr/src/cmd/dtrace/test/cmd/jdtrace/classes/
+usr/src/cmd/dtrace/test/cmd/jdtrace/jdtrace
+usr/src/cmd/dtrace/test/cmd/jdtrace/lib/
+usr/src/cmd/dtrace/test/tst/common/io/tst.fds.exe
+usr/src/cmd/dtrace/test/tst/common/java_api/classes/
+usr/src/cmd/dtrace/test/tst/common/java_api/test.jar
+usr/src/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.exe
+usr/src/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.exe
+usr/src/cmd/dtrace/test/tst/common/nfs/tst.call.exe
+usr/src/cmd/dtrace/test/tst/common/nfs/tst.call3.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.args1.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.float.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.fork.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.gcc.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.ret1.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.ret2.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.vfork.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.weak1.exe
+usr/src/cmd/dtrace/test/tst/common/pid/tst.weak2.exe
+usr/src/cmd/dtrace/test/tst/common/proc/tst.sigwait.exe
+usr/src/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.exe
+usr/src/cmd/dtrace/test/tst/common/raise/tst.raise1.exe
+usr/src/cmd/dtrace/test/tst/common/raise/tst.raise2.exe
+usr/src/cmd/dtrace/test/tst/common/raise/tst.raise3.exe
+usr/src/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.exe
+usr/src/cmd/dtrace/test/tst/common/stop/tst.stop1.exe
+usr/src/cmd/dtrace/test/tst/common/stop/tst.stop2.exe
+usr/src/cmd/dtrace/test/tst/common/syscall/tst.args.exe
+usr/src/cmd/dtrace/test/tst/common/sysevent/tst.post.exe
+usr/src/cmd/dtrace/test/tst/common/sysevent/tst.post_chan.exe
+usr/src/cmd/dtrace/test/tst/common/usdt/forker.h
+usr/src/cmd/dtrace/test/tst/common/usdt/tst.argmap.exe
+usr/src/cmd/dtrace/test/tst/common/usdt/tst.args.exe
+usr/src/cmd/dtrace/test/tst/common/usdt/tst.forker.exe
+usr/src/cmd/dtrace/test/tst/common/ustack/tst.bigstack.exe
+usr/src/cmd/dtrace/test/tst/common/ustack/tst.spin.exe
+usr/src/cmd/dtrace/test/tst/i386/pid/tst.badinstr.exe
+usr/src/cmd/dtrace/test/tst/i386/pid/tst.branch.exe
+usr/src/cmd/dtrace/test/tst/i386/pid/tst.embedded.exe
+usr/src/cmd/dtrace/test/tst/i386/pid/tst.ret.exe
+usr/src/cmd/dtrace/test/tst/i386/pid/tst.retlist.exe
+usr/src/cmd/dtrace/test/tst/i386/ustack/tst.annotated.exe
+usr/src/cmd/dtrace/test/tst/i386/ustack/tst.circstack.exe
+usr/src/cmd/dtrace/test/tst/i386/ustack/tst.helper.exe
+usr/src/cmd/du/du
+usr/src/cmd/du/du.po.xpg4
+usr/src/cmd/du/du.xpg4
+usr/src/cmd/dumpadm/dumpadm
+usr/src/cmd/dumpcs/dumpcs
+usr/src/cmd/echo/echo
+usr/src/cmd/ed/compile.c.i
+usr/src/cmd/ed/ed
+usr/src/cmd/ed/ed.xpg4
+usr/src/cmd/ed/ed.xpg6
+usr/src/cmd/eeprom/i386/eeprom
+usr/src/cmd/egrep/egrep
+usr/src/cmd/egrep/egrep.c
+usr/src/cmd/eject/eject
+usr/src/cmd/emul64ioctl/emul64ioctl
+usr/src/cmd/enhance/enhance
+usr/src/cmd/env/env
+usr/src/cmd/env/env.xpg4
+usr/src/cmd/eqn/eqn.d/e.c
+usr/src/cmd/eqn/eqn.d/e.def
+usr/src/cmd/eqn/eqn.d/eqn
+usr/src/cmd/eqn/neqn.d/e.c
+usr/src/cmd/eqn/neqn.d/e.def
+usr/src/cmd/eqn/neqn.d/neqn
+usr/src/cmd/expand/expand
+usr/src/cmd/expand/expand_cmd.c
+usr/src/cmd/expand/unexpand
+usr/src/cmd/expr/expr
+usr/src/cmd/expr/expr.xpg4
+usr/src/cmd/expr/expr.xpg6
+usr/src/cmd/exstr/exstr
+usr/src/cmd/factor/factor
+usr/src/cmd/false/false
+usr/src/cmd/fcinfo/fcinfo
+usr/src/cmd/fcoesvc/svc-fcoei
+usr/src/cmd/fcoesvc/svc-fcoet
+usr/src/cmd/fdetach/fdetach
+usr/src/cmd/fdformat/fdformat
+usr/src/cmd/fdisk/fdisk
+usr/src/cmd/fgrep/fgrep
+usr/src/cmd/file/file
+usr/src/cmd/file/file.xpg4
+usr/src/cmd/filebench/amd64/go_filebench
+usr/src/cmd/filebench/amd64/parser_gram.c
+usr/src/cmd/filebench/amd64/parser_gram.h
+usr/src/cmd/filebench/amd64/parser_lex.c
+usr/src/cmd/filebench/fbscript/filebench
+usr/src/cmd/filebench/i386/go_filebench
+usr/src/cmd/filebench/i386/parser_gram.c
+usr/src/cmd/filebench/i386/parser_gram.h
+usr/src/cmd/filebench/i386/parser_lex.c
+usr/src/cmd/filebench/scripts/filebench_compare
+usr/src/cmd/filebench/scripts/fs_flush
+usr/src/cmd/filesync/filesync
+usr/src/cmd/find/find
+usr/src/cmd/find/find.xpg4
+usr/src/cmd/flowadm/flowadm
+usr/src/cmd/flowstat/flowstat
+usr/src/cmd/fm/dicts/AMD.mo
+usr/src/cmd/fm/dicts/DISK.mo
+usr/src/cmd/fm/dicts/FMD.mo
+usr/src/cmd/fm/dicts/FMNOTIFY.mo
+usr/src/cmd/fm/dicts/GMCA.mo
+usr/src/cmd/fm/dicts/INTEL.mo
+usr/src/cmd/fm/dicts/NXGE.mo
+usr/src/cmd/fm/dicts/PCI.mo
+usr/src/cmd/fm/dicts/PCIEX.mo
+usr/src/cmd/fm/dicts/SCA1000.mo
+usr/src/cmd/fm/dicts/SCA500.mo
+usr/src/cmd/fm/dicts/SENSOR.mo
+usr/src/cmd/fm/dicts/SMF.mo
+usr/src/cmd/fm/dicts/STORAGE.mo
+usr/src/cmd/fm/dicts/SUNOS.mo
+usr/src/cmd/fm/dicts/TEST.mo
+usr/src/cmd/fm/dicts/ZFS.mo
+usr/src/cmd/fm/eversholt/eftinfo/i386/eftinfo
+usr/src/cmd/fm/eversholt/eftinfo/i386/y.output
+usr/src/cmd/fm/eversholt/eftinfo/i386/y.tab.c
+usr/src/cmd/fm/eversholt/eftinfo/i386/y.tab.h
+usr/src/cmd/fm/eversholt/esc/i386/esc
+usr/src/cmd/fm/eversholt/esc/i386/y.output
+usr/src/cmd/fm/eversholt/esc/i386/y.tab.c
+usr/src/cmd/fm/eversholt/esc/i386/y.tab.h
+usr/src/cmd/fm/eversholt/files/i386/disk.eft
+usr/src/cmd/fm/eversholt/files/i386/i86pc/amd64.eft
+usr/src/cmd/fm/eversholt/files/i386/i86pc/gcpu.eft
+usr/src/cmd/fm/eversholt/files/i386/i86pc/gcpu_amd.eft
+usr/src/cmd/fm/eversholt/files/i386/i86pc/intel.eft
+usr/src/cmd/fm/eversholt/files/i386/neptune_xaui.eft
+usr/src/cmd/fm/eversholt/files/i386/neptune_xfp.eft
+usr/src/cmd/fm/eversholt/files/i386/pci.eft
+usr/src/cmd/fm/eversholt/files/i386/pciex.eft
+usr/src/cmd/fm/eversholt/files/i386/pciexrc.eft
+usr/src/cmd/fm/eversholt/files/i386/sca1000.eft
+usr/src/cmd/fm/eversholt/files/i386/sca500.eft
+usr/src/cmd/fm/eversholt/files/i386/sensor.eft
+usr/src/cmd/fm/eversholt/files/i386/storage.eft
+usr/src/cmd/fm/fmadm/i386/fmadm
+usr/src/cmd/fm/fmd/common/fmd_error.c
+usr/src/cmd/fm/fmd/common/fmd_rpc_adm.h
+usr/src/cmd/fm/fmd/common/fmd_rpc_api.h
+usr/src/cmd/fm/fmd/i386/fmd
+usr/src/cmd/fm/fmd/i386/fmd_svc_adm.c
+usr/src/cmd/fm/fmd/i386/fmd_svc_api.c
+usr/src/cmd/fm/fmd/i386/fmd_xdr_adm.c
+usr/src/cmd/fm/fmd/i386/fmd_xdr_api.c
+usr/src/cmd/fm/fmdump/i386/fmdump
+usr/src/cmd/fm/fminject/i386/fminject
+usr/src/cmd/fm/fminject/i386/inj_grammar.c
+usr/src/cmd/fm/fminject/i386/inj_grammar.h
+usr/src/cmd/fm/fminject/i386/inj_lex.c
+usr/src/cmd/fm/fmstat/i386/fmstat
+usr/src/cmd/fm/fmtopo/i386/fmtopo
+usr/src/cmd/fm/ipmitopo/i386/ipmitopo
+usr/src/cmd/fm/modules/common/eversholt/y.tab.c
+usr/src/cmd/fm/modules/common/eversholt/y.tab.h
+usr/src/cmd/fm/notify/smtp-notify/i386/process_msg_template.sh
+usr/src/cmd/fm/notify/smtp-notify/i386/smtp-notify
+usr/src/cmd/fm/notify/snmp-notify/i386/snmp-notify
+usr/src/cmd/fm/scripts/buildcode
+usr/src/cmd/fm/scripts/bustcode
+usr/src/cmd/fm/scripts/dictck
+usr/src/cmd/fm/scripts/fmsim
+usr/src/cmd/fmt/fmt
+usr/src/cmd/fmthard/fmthard
+usr/src/cmd/fmtmsg/fmtmsg
+usr/src/cmd/fold/fold
+usr/src/cmd/format/format
+usr/src/cmd/fs.d/autofs/automount
+usr/src/cmd/fs.d/autofs/automountd
+usr/src/cmd/fs.d/autofs/dfshares
+usr/src/cmd/fs.d/autofs/mount
+usr/src/cmd/fs.d/autofs/share
+usr/src/cmd/fs.d/autofs/unshare
+usr/src/cmd/fs.d/autofs/webnfs.h
+usr/src/cmd/fs.d/autofs/webnfs.x
+usr/src/cmd/fs.d/autofs/webnfs_client.c
+usr/src/cmd/fs.d/autofs/webnfs_xdr.c
+usr/src/cmd/fs.d/cachefs/cachefslog/cachefslog
+usr/src/cmd/fs.d/cachefs/cachefspack/cachefspack
+usr/src/cmd/fs.d/cachefs/cachefsstat/cachefsstat
+usr/src/cmd/fs.d/cachefs/cachefswssize/cachefswssize
+usr/src/cmd/fs.d/cachefs/cfsadmin/cfsadmin
+usr/src/cmd/fs.d/cachefs/cfsd/cachefsd
+usr/src/cmd/fs.d/cachefs/cfsd/cachefsd_tbl.i
+usr/src/cmd/fs.d/cachefs/cfsfstype/cfsfstype
+usr/src/cmd/fs.d/cachefs/cfstagchk/cfstagchk
+usr/src/cmd/fs.d/cachefs/common/cachefsd.h
+usr/src/cmd/fs.d/cachefs/common/cachefsd_clnt.c
+usr/src/cmd/fs.d/cachefs/common/cachefsd_xdr.c
+usr/src/cmd/fs.d/cachefs/dfshares/dfshares
+usr/src/cmd/fs.d/cachefs/fsck/fsck
+usr/src/cmd/fs.d/cachefs/mount/mount
+usr/src/cmd/fs.d/cachefs/share/share
+usr/src/cmd/fs.d/cachefs/umount/umount
+usr/src/cmd/fs.d/cachefs/unshare/unshare
+usr/src/cmd/fs.d/clri
+usr/src/cmd/fs.d/ctfs/mount
+usr/src/cmd/fs.d/dev/mount
+usr/src/cmd/fs.d/df
+usr/src/cmd/fs.d/df.po.xpg4
+usr/src/cmd/fs.d/df.xpg4
+usr/src/cmd/fs.d/fd/mount
+usr/src/cmd/fs.d/ff
+usr/src/cmd/fs.d/fs.dfl
+usr/src/cmd/fs.d/fsck
+usr/src/cmd/fs.d/hsfs/labelit/labelit
+usr/src/cmd/fs.d/hsfs/mount/mount
+usr/src/cmd/fs.d/lofs/mount/mount
+usr/src/cmd/fs.d/mntfs/mount
+usr/src/cmd/fs.d/mnttab
+usr/src/cmd/fs.d/mount
+usr/src/cmd/fs.d/nfs/clear_locks/clear_locks
+usr/src/cmd/fs.d/nfs/dfmounts/dfmounts
+usr/src/cmd/fs.d/nfs/dfshares/dfshares
+usr/src/cmd/fs.d/nfs/exportfs/exportfs
+usr/src/cmd/fs.d/nfs/mount/mount
+usr/src/cmd/fs.d/nfs/mount/webnfs.h
+usr/src/cmd/fs.d/nfs/mount/webnfs.x
+usr/src/cmd/fs.d/nfs/mount/webnfs_client.c
+usr/src/cmd/fs.d/nfs/mount/webnfs_xdr.c
+usr/src/cmd/fs.d/nfs/mountd/mountd
+usr/src/cmd/fs.d/nfs/nfs4cbd/nfs4cbd
+usr/src/cmd/fs.d/nfs/nfsd/nfsd
+usr/src/cmd/fs.d/nfs/nfsfind/nfsfind
+usr/src/cmd/fs.d/nfs/nfslog/nfslogd
+usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid
+usr/src/cmd/fs.d/nfs/nfsmapid/nfsmapid_test
+usr/src/cmd/fs.d/nfs/nfsref/nfsref
+usr/src/cmd/fs.d/nfs/nfsstat/nfsstat
+usr/src/cmd/fs.d/nfs/rquotad/rquota_xdr.c
+usr/src/cmd/fs.d/nfs/rquotad/rquotad
+usr/src/cmd/fs.d/nfs/share/sharetab
+usr/src/cmd/fs.d/nfs/showmount/showmount
+usr/src/cmd/fs.d/nfs/statd/statd
+usr/src/cmd/fs.d/nfs/umount/umount
+usr/src/cmd/fs.d/objfs/mount
+usr/src/cmd/fs.d/pcfs/fsck/fsck
+usr/src/cmd/fs.d/pcfs/mkfs/mkfs
+usr/src/cmd/fs.d/pcfs/mount/mount
+usr/src/cmd/fs.d/proc/mount
+usr/src/cmd/fs.d/reparsed/reparsed
+usr/src/cmd/fs.d/sharefs/mount
+usr/src/cmd/fs.d/smbclnt/chacl/chacl
+usr/src/cmd/fs.d/smbclnt/lsacl/lsacl
+usr/src/cmd/fs.d/smbclnt/mount/mount
+usr/src/cmd/fs.d/smbclnt/share/dfshares
+usr/src/cmd/fs.d/smbclnt/share/share
+usr/src/cmd/fs.d/smbclnt/share/unshare
+usr/src/cmd/fs.d/smbclnt/smbiod-svc/smbiod-svc
+usr/src/cmd/fs.d/smbclnt/smbiod/smbiod
+usr/src/cmd/fs.d/smbclnt/smbutil/smbutil
+usr/src/cmd/fs.d/smbclnt/umount/umount
+usr/src/cmd/fs.d/tmpfs/mount
+usr/src/cmd/fs.d/udfs/fsck/fsck
+usr/src/cmd/fs.d/udfs/fsdb/fsdb
+usr/src/cmd/fs.d/udfs/fsdb/lex.yy.c
+usr/src/cmd/fs.d/udfs/fsdb/ud_lib.c
+usr/src/cmd/fs.d/udfs/fsdb/ud_lib.h
+usr/src/cmd/fs.d/udfs/fsdb/y.tab.c
+usr/src/cmd/fs.d/udfs/fsdb/y.tab.h
+usr/src/cmd/fs.d/udfs/labelit/labelit
+usr/src/cmd/fs.d/udfs/labelit/ud_lib.c
+usr/src/cmd/fs.d/udfs/labelit/ud_lib.h
+usr/src/cmd/fs.d/udfs/mkfs/mkfs
+usr/src/cmd/fs.d/udfs/mount/mount
+usr/src/cmd/fs.d/ufs/clri/clri
+usr/src/cmd/fs.d/ufs/df/df
+usr/src/cmd/fs.d/ufs/edquota/edquota
+usr/src/cmd/fs.d/ufs/ff/ff
+usr/src/cmd/fs.d/ufs/fsck/fsck
+usr/src/cmd/fs.d/ufs/fsckall/fsckall
+usr/src/cmd/fs.d/ufs/fsdb/fsdb
+usr/src/cmd/fs.d/ufs/fsirand/fsirand
+usr/src/cmd/fs.d/ufs/fssnap/fssnap
+usr/src/cmd/fs.d/ufs/labelit/labelit
+usr/src/cmd/fs.d/ufs/lockfs/lockfs
+usr/src/cmd/fs.d/ufs/mkfs/mkfs
+usr/src/cmd/fs.d/ufs/mount/mount
+usr/src/cmd/fs.d/ufs/ncheck/ncheck
+usr/src/cmd/fs.d/ufs/newfs/newfs
+usr/src/cmd/fs.d/ufs/quot/quot
+usr/src/cmd/fs.d/ufs/quota/quota
+usr/src/cmd/fs.d/ufs/quota/rquota_xdr.c
+usr/src/cmd/fs.d/ufs/quotacheck/quotacheck
+usr/src/cmd/fs.d/ufs/quotaon/quotaon
+usr/src/cmd/fs.d/ufs/repquota/repquota
+usr/src/cmd/fs.d/ufs/tunefs/tunefs
+usr/src/cmd/fs.d/ufs/volcopy/volcopy
+usr/src/cmd/fs.d/umount
+usr/src/cmd/fs.d/volcopy
+usr/src/cmd/fs.d/zfs/bootinstall/bootinstall
+usr/src/cmd/fstyp/fstyp
+usr/src/cmd/fuser/fuser
+usr/src/cmd/fwflash/i386/fwflash
+usr/src/cmd/gcore/amd64/gcore
+usr/src/cmd/gcore/i386/gcore
+usr/src/cmd/gencat/gencat
+usr/src/cmd/geniconvtbl/i386/geniconvtbl
+usr/src/cmd/geniconvtbl/i386/lex.yy.c
+usr/src/cmd/geniconvtbl/i386/y.output
+usr/src/cmd/geniconvtbl/i386/y.tab.c
+usr/src/cmd/geniconvtbl/i386/y.tab.h
+usr/src/cmd/geniconvtbl/itm_comp.c
+usr/src/cmd/geniconvtbl/native/geniconvtbl
+usr/src/cmd/geniconvtbl/native/lex.yy.c
+usr/src/cmd/geniconvtbl/native/y.output
+usr/src/cmd/geniconvtbl/native/y.tab.c
+usr/src/cmd/geniconvtbl/native/y.tab.h
+usr/src/cmd/geniconvtbl/samples/ISO646%ISO8859-1.bt
+usr/src/cmd/geniconvtbl/samples/ISO8859-1%ISO646.bt
+usr/src/cmd/genmsg/genmsg
+usr/src/cmd/genmsg/genmsg.c
+usr/src/cmd/genmsg/lex.yy.c
+usr/src/cmd/genmsg/y.tab.h
+usr/src/cmd/getconf/getconf
+usr/src/cmd/getconf/getconf.xpg4
+usr/src/cmd/getconf/getconf.xpg6
+usr/src/cmd/getdevpolicy/getdevpolicy
+usr/src/cmd/getent/getent
+usr/src/cmd/getfacl/getfacl
+usr/src/cmd/getmajor/getmajor
+usr/src/cmd/getopt/getopt
+usr/src/cmd/getopt/getoptcvt
+usr/src/cmd/gettext/gettext
+usr/src/cmd/gettxt/gettxt
+usr/src/cmd/grep/grep
+usr/src/cmd/grep_xpg4/grep.xpg4
+usr/src/cmd/groups/groups
+usr/src/cmd/grpck/grpck
+usr/src/cmd/gss/etc/dummy_mech_token.conf
+usr/src/cmd/gss/gsscred/gsscred
+usr/src/cmd/gss/gsscred_clean/gsscred_clean
+usr/src/cmd/gss/gssd/gssd
+usr/src/cmd/gss/gssd/gssd.h
+usr/src/cmd/gss/gssd/gssd.x
+usr/src/cmd/gss/gssd/gssd_clnt.c
+usr/src/cmd/gss/gssd/gssd_svc.c
+usr/src/cmd/gss/gssd/gssd_xdr.c
+usr/src/cmd/gss/gssd/gssdtest
+usr/src/cmd/hal/addons/acpi/hald-addon-acpi
+usr/src/cmd/hal/addons/cpufreq/hald-addon-cpufreq
+usr/src/cmd/hal/addons/network-devices/hald-addon-network-discovery
+usr/src/cmd/hal/addons/storage/hald-addon-storage
+usr/src/cmd/hal/hal.conf
+usr/src/cmd/hal/hald-runner/hald-runner
+usr/src/cmd/hal/hald/hald
+usr/src/cmd/hal/hald/hald_marshal.c
+usr/src/cmd/hal/hald/hald_marshal.h
+usr/src/cmd/hal/probing/acpi/hald-probe-acpi
+usr/src/cmd/hal/probing/network-printer/hald-probe-network-printer
+usr/src/cmd/hal/probing/printer/hald-probe-printer
+usr/src/cmd/hal/probing/storage/hald-probe-storage
+usr/src/cmd/hal/probing/volume/hald-probe-volume
+usr/src/cmd/hal/probing/xkb/hald-probe-xkb
+usr/src/cmd/hal/tools/hal-device
+usr/src/cmd/hal/tools/hal-fdi-validate
+usr/src/cmd/hal/tools/hal-find-by-capability
+usr/src/cmd/hal/tools/hal-find-by-property
+usr/src/cmd/hal/tools/hal-functions
+usr/src/cmd/hal/tools/hal-get-property
+usr/src/cmd/hal/tools/hal-is-caller-privileged
+usr/src/cmd/hal/tools/hal-set-property
+usr/src/cmd/hal/tools/hal-storage-cleanup-all-mountpoints
+usr/src/cmd/hal/tools/hal-storage-cleanup-mountpoint
+usr/src/cmd/hal/tools/hal-storage-closetray
+usr/src/cmd/hal/tools/hal-storage-eject
+usr/src/cmd/hal/tools/hal-storage-mount
+usr/src/cmd/hal/tools/hal-storage-unmount
+usr/src/cmd/hal/tools/hal-storage-zpool-export
+usr/src/cmd/hal/tools/hal-storage-zpool-import
+usr/src/cmd/hal/tools/hal-system-lcd-get-brightness
+usr/src/cmd/hal/tools/hal-system-lcd-set-brightness
+usr/src/cmd/hal/tools/hal-system-power-hibernate
+usr/src/cmd/hal/tools/hal-system-power-reboot
+usr/src/cmd/hal/tools/hal-system-power-shutdown
+usr/src/cmd/hal/tools/hal-system-power-suspend
+usr/src/cmd/hal/tools/lshal
+usr/src/cmd/hal/tools/sunos/hal-system-lcd-get-brightness-sunos
+usr/src/cmd/hal/tools/sunos/hal-system-lcd-set-brightness-sunos
+usr/src/cmd/hal/tools/sunos/hal-system-power-hibernate-sunos
+usr/src/cmd/hal/tools/sunos/hal-system-power-reboot-sunos
+usr/src/cmd/hal/tools/sunos/hal-system-power-shutdown-sunos
+usr/src/cmd/hal/tools/sunos/hal-system-power-suspend-sunos
+usr/src/cmd/halt/halt
+usr/src/cmd/head/head
+usr/src/cmd/hostid/hostid
+usr/src/cmd/hostname/hostname
+usr/src/cmd/hotplug/hotplug
+usr/src/cmd/hotplugd/hotplugd
+usr/src/cmd/hwdata/THIRDPARTYLICENSE.pciids
+usr/src/cmd/ibd_upgrade/ibd_delete_link
+usr/src/cmd/ibd_upgrade/ibd_upgrade
+usr/src/cmd/id/id
+usr/src/cmd/id/id.xpg4
+usr/src/cmd/idmap/idmap/idmap
+usr/src/cmd/idmap/idmapd/idmapd
+usr/src/cmd/infocmp/infocmp
+usr/src/cmd/init/init
+usr/src/cmd/initpkg/dfstab
+usr/src/cmd/initpkg/mountall
+usr/src/cmd/initpkg/rc0
+usr/src/cmd/initpkg/rc1
+usr/src/cmd/initpkg/rc2
+usr/src/cmd/initpkg/rc3
+usr/src/cmd/initpkg/rcS
+usr/src/cmd/initpkg/shutdown
+usr/src/cmd/initpkg/swapadd
+usr/src/cmd/initpkg/umountall
+usr/src/cmd/initpkg/vfstab
+usr/src/cmd/install.d/install.d
+usr/src/cmd/intrd/intrd
+usr/src/cmd/intrstat/amd64/intrstat
+usr/src/cmd/intrstat/i386/intrstat
+usr/src/cmd/ipcrm/ipcrm
+usr/src/cmd/ipcs/ipcs
+usr/src/cmd/ipf/examples/mkfilters
+usr/src/cmd/ipf/svc/svc.ipfd
+usr/src/cmd/ipf/tools/amd64/ipf
+usr/src/cmd/ipf/tools/amd64/ipf.tab.c
+usr/src/cmd/ipf/tools/amd64/ipf.tab.h
+usr/src/cmd/ipf/tools/amd64/ipfs
+usr/src/cmd/ipf/tools/amd64/ipfstat
+usr/src/cmd/ipf/tools/amd64/ipftest
+usr/src/cmd/ipf/tools/amd64/ipmon
+usr/src/cmd/ipf/tools/amd64/ipmon.tab.c
+usr/src/cmd/ipf/tools/amd64/ipmon.tab.h
+usr/src/cmd/ipf/tools/amd64/ipnat
+usr/src/cmd/ipf/tools/amd64/ipnat.tab.c
+usr/src/cmd/ipf/tools/amd64/ipnat.tab.h
+usr/src/cmd/ipf/tools/amd64/ippool
+usr/src/cmd/ipf/tools/amd64/ippool.tab.c
+usr/src/cmd/ipf/tools/amd64/ippool.tab.h
+usr/src/cmd/ipf/tools/i386/ipf
+usr/src/cmd/ipf/tools/i386/ipf.tab.c
+usr/src/cmd/ipf/tools/i386/ipf.tab.h
+usr/src/cmd/ipf/tools/i386/ipfs
+usr/src/cmd/ipf/tools/i386/ipfstat
+usr/src/cmd/ipf/tools/i386/ipftest
+usr/src/cmd/ipf/tools/i386/ipmon
+usr/src/cmd/ipf/tools/i386/ipmon.tab.c
+usr/src/cmd/ipf/tools/i386/ipmon.tab.h
+usr/src/cmd/ipf/tools/i386/ipnat
+usr/src/cmd/ipf/tools/i386/ipnat.tab.c
+usr/src/cmd/ipf/tools/i386/ipnat.tab.h
+usr/src/cmd/ipf/tools/i386/ippool
+usr/src/cmd/ipf/tools/i386/ippool.tab.c
+usr/src/cmd/ipf/tools/i386/ippool.tab.h
+usr/src/cmd/ipf/tools/ipf_l.c
+usr/src/cmd/ipf/tools/ipf_l.h
+usr/src/cmd/ipf/tools/ipf_y.c
+usr/src/cmd/ipf/tools/ipf_y.h
+usr/src/cmd/ipf/tools/ipmon_l.c
+usr/src/cmd/ipf/tools/ipmon_l.h
+usr/src/cmd/ipf/tools/ipmon_y.c
+usr/src/cmd/ipf/tools/ipmon_y.h
+usr/src/cmd/ipf/tools/ipnat_l.c
+usr/src/cmd/ipf/tools/ipnat_l.h
+usr/src/cmd/ipf/tools/ipnat_y.c
+usr/src/cmd/ipf/tools/ipnat_y.h
+usr/src/cmd/ipf/tools/ippool_l.c
+usr/src/cmd/ipf/tools/ippool_l.h
+usr/src/cmd/ipf/tools/ippool_y.c
+usr/src/cmd/ipf/tools/ippool_y.h
+usr/src/cmd/isaexec/isaexec
+usr/src/cmd/isainfo/isainfo
+usr/src/cmd/isalist/isalist
+usr/src/cmd/isalist/optisa
+usr/src/cmd/iscsiadm/iscsiadm
+usr/src/cmd/iscsid/iscsid
+usr/src/cmd/iscsitsvc/iscsi-target
+usr/src/cmd/isns/isnsadm/isnsadm
+usr/src/cmd/isns/isnsd/isns
+usr/src/cmd/isns/isnsd/isns_provider.h
+usr/src/cmd/itadm/itadm
+usr/src/cmd/itutools/itu
+usr/src/cmd/itutools/mkbootmedia
+usr/src/cmd/itutools/pkg2du
+usr/src/cmd/itutools/updatemedia
+usr/src/cmd/kbd/kbd
+usr/src/cmd/keyserv/chkey
+usr/src/cmd/keyserv/domainname
+usr/src/cmd/keyserv/keylogin
+usr/src/cmd/keyserv/keylogout
+usr/src/cmd/keyserv/keyserv
+usr/src/cmd/keyserv/newkey
+usr/src/cmd/killall/killall
+usr/src/cmd/krb5/kadmin/cli/k5srvutil
+usr/src/cmd/krb5/kadmin/cli/kadmin
+usr/src/cmd/krb5/kadmin/cli/kadmin.local
+usr/src/cmd/krb5/kadmin/dbutil/iprop.h
+usr/src/cmd/krb5/kadmin/dbutil/kdb5_util
+usr/src/cmd/krb5/kadmin/kclient/kclient
+usr/src/cmd/krb5/kadmin/kclient/kconf
+usr/src/cmd/krb5/kadmin/kclient/kdyndns
+usr/src/cmd/krb5/kadmin/kclient/ksetpw
+usr/src/cmd/krb5/kadmin/kclient/ksmb
+usr/src/cmd/krb5/kadmin/kdcmgr/kdcmgr
+usr/src/cmd/krb5/kadmin/kdcmgr/klookup
+usr/src/cmd/krb5/kadmin/kpasswd/kpasswd
+usr/src/cmd/krb5/kadmin/ktutil/ktutil
+usr/src/cmd/krb5/kadmin/server/iprop.h
+usr/src/cmd/krb5/kadmin/server/iprop_xdr.c
+usr/src/cmd/krb5/kadmin/server/kadmind
+usr/src/cmd/krb5/kdestroy/kdestroy
+usr/src/cmd/krb5/kinit/kinit
+usr/src/cmd/krb5/klist/klist
+usr/src/cmd/krb5/kproplog/iprop.h
+usr/src/cmd/krb5/kproplog/iprop_xdr.c
+usr/src/cmd/krb5/kproplog/kproplog
+usr/src/cmd/krb5/krb5-config/krb5-config
+usr/src/cmd/krb5/krb5kdc/krb5kdc
+usr/src/cmd/krb5/kwarn/ktkt_warnd
+usr/src/cmd/krb5/kwarn/kwarnd.h
+usr/src/cmd/krb5/kwarn/kwarnd_svc.c
+usr/src/cmd/krb5/kwarn/kwarnd_xdr.c
+usr/src/cmd/krb5/ldap_util/kdb5_ldap_util
+usr/src/cmd/krb5/slave/iprop.h
+usr/src/cmd/krb5/slave/iprop_xdr.c
+usr/src/cmd/krb5/slave/kprop
+usr/src/cmd/krb5/slave/kprop_script
+usr/src/cmd/krb5/slave/kpropd
+usr/src/cmd/ksh/amd64/ksh
+usr/src/cmd/ksh/amd64/ksh93
+usr/src/cmd/ksh/builtins/alias
+usr/src/cmd/ksh/i386/ksh
+usr/src/cmd/ksh/i386/ksh93
+usr/src/cmd/kstat/kstat
+usr/src/cmd/kvmstat/kvmstat
+usr/src/cmd/last/last
+usr/src/cmd/last/wtmpx
+usr/src/cmd/lastcomm/lastcomm
+usr/src/cmd/ldap/i386/idsconfig
+usr/src/cmd/ldap/i386/ldapaddent
+usr/src/cmd/ldap/i386/ldapclient
+usr/src/cmd/ldap/i386/ldapdelete
+usr/src/cmd/ldap/i386/ldaplist
+usr/src/cmd/ldap/i386/ldapmodify
+usr/src/cmd/ldap/i386/ldapmodrdn
+usr/src/cmd/ldap/i386/ldapsearch
+usr/src/cmd/ldapcachemgr/ldap_cachemgr
+usr/src/cmd/lgrpinfo/lgrpinfo
+usr/src/cmd/line/line
+usr/src/cmd/link/link
+usr/src/cmd/link/link.xpg4
+usr/src/cmd/listen/listen
+usr/src/cmd/listen/nlps_server
+usr/src/cmd/lms/lms
+usr/src/cmd/loadkeys/dumpkeys
+usr/src/cmd/loadkeys/loadkeys
+usr/src/cmd/loadkeys/loadkeys.c
+usr/src/cmd/locale/amd64/locale
+usr/src/cmd/locale/i386/locale
+usr/src/cmd/localedef/8859-1.cm
+usr/src/cmd/localedef/8859-11.cm
+usr/src/cmd/localedef/8859-13.cm
+usr/src/cmd/localedef/8859-15.cm
+usr/src/cmd/localedef/8859-2.cm
+usr/src/cmd/localedef/8859-5.cm
+usr/src/cmd/localedef/8859-6.cm
+usr/src/cmd/localedef/8859-7.cm
+usr/src/cmd/localedef/8859-9.cm
+usr/src/cmd/localedef/KOI8-R.cm
+usr/src/cmd/localedef/UTF-8.cm
+usr/src/cmd/localedef/locale/
+usr/src/cmd/localedef/localedef
+usr/src/cmd/localedef/parser.tab.c
+usr/src/cmd/localedef/parser.tab.h
+usr/src/cmd/locator/locator
+usr/src/cmd/lockstat/amd64/lockstat
+usr/src/cmd/lockstat/i386/lockstat
+usr/src/cmd/lofiadm/lofiadm
+usr/src/cmd/logadm/logadm
+usr/src/cmd/logger/logger
+usr/src/cmd/login/login
+usr/src/cmd/login/logindevperm
+usr/src/cmd/logins/logins
+usr/src/cmd/look/look
+usr/src/cmd/ls/amd64/ls
+usr/src/cmd/ls/amd64/ls.xpg4
+usr/src/cmd/ls/amd64/ls.xpg6
+usr/src/cmd/ls/i386/ls
+usr/src/cmd/ls/i386/ls.xpg4
+usr/src/cmd/ls/i386/ls.xpg6
+usr/src/cmd/ls/ls.dc
+usr/src/cmd/luxadm/luxadm
+usr/src/cmd/mach/mach
+usr/src/cmd/machid/machid
+usr/src/cmd/mail/mail
+usr/src/cmd/mailx/mailx
+usr/src/cmd/mailx/mailx.help
+usr/src/cmd/mailx/mailx.help.~
+usr/src/cmd/makekey/makekey
+usr/src/cmd/man/src/apropos
+usr/src/cmd/man/src/catman
+usr/src/cmd/man/src/getNAME
+usr/src/cmd/man/src/makewhatis
+usr/src/cmd/man/src/man
+usr/src/cmd/man/src/util/instant
+usr/src/cmd/man/src/util/instant.src/THIRDPARTYLICENSE
+usr/src/cmd/man/src/util/instant.src/instant
+usr/src/cmd/man/src/util/nsgmls
+usr/src/cmd/man/src/util/nsgmls.src/lib/Makefile.dep
+usr/src/cmd/man/src/util/nsgmls.src/lib/app_inst.cxx
+usr/src/cmd/man/src/util/nsgmls.src/lib/arc_inst.cxx
+usr/src/cmd/man/src/util/nsgmls.src/lib/entmgr_inst.cxx
+usr/src/cmd/man/src/util/nsgmls.src/lib/parser_inst.cxx
+usr/src/cmd/man/src/util/nsgmls.src/lib/xentmgr_inst.cxx
+usr/src/cmd/man/src/util/nsgmls.src/nsgmls/Makefile.dep
+usr/src/cmd/man/src/util/nsgmls.src/nsgmls/nsgmls
+usr/src/cmd/man/src/util/nsgmls.src/nsgmls/nsgmls_inst.cxx
+usr/src/cmd/man/src/util/sgml2roff
+usr/src/cmd/man/src/util/solbookv2/THIRDPARTYLICENSE
+usr/src/cmd/man/src/whatis
+usr/src/cmd/mdb/i86pc/modules/apix/amd64/kmod/
+usr/src/cmd/mdb/i86pc/modules/apix/ia32/kmod/
+usr/src/cmd/mdb/i86pc/modules/pcplusmp/amd64/kmod/
+usr/src/cmd/mdb/i86pc/modules/pcplusmp/ia32/kmod/
+usr/src/cmd/mdb/i86pc/modules/unix/amd64/kmod/
+usr/src/cmd/mdb/i86pc/modules/unix/ia32/kmod/
+usr/src/cmd/mdb/i86pc/modules/uppc/amd64/kmod/
+usr/src/cmd/mdb/i86pc/modules/uppc/ia32/kmod/
+usr/src/cmd/mdb/i86xpv/modules/unix/amd64/kmod/
+usr/src/cmd/mdb/i86xpv/modules/unix/ia32/kmod/
+usr/src/cmd/mdb/i86xpv/modules/xpv_psm/amd64/kmod/
+usr/src/cmd/mdb/i86xpv/modules/xpv_psm/ia32/kmod/
+usr/src/cmd/mdb/i86xpv/modules/xpv_uppc/amd64/kmod/
+usr/src/cmd/mdb/i86xpv/modules/xpv_uppc/ia32/kmod/
+usr/src/cmd/mdb/intel/amd64/arp/kmod/
+usr/src/cmd/mdb/intel/amd64/cpc/kmod/
+usr/src/cmd/mdb/intel/amd64/crypto/kmod/
+usr/src/cmd/mdb/intel/amd64/dof/dof_names.c
+usr/src/cmd/mdb/intel/amd64/dtrace/dof_names.c
+usr/src/cmd/mdb/intel/amd64/emlxs/kmod/
+usr/src/cmd/mdb/intel/amd64/fcip/kmod/
+usr/src/cmd/mdb/intel/amd64/fcp/kmod/
+usr/src/cmd/mdb/intel/amd64/fctl/kmod/
+usr/src/cmd/mdb/intel/amd64/genunix/kmod/
+usr/src/cmd/mdb/intel/amd64/hook/kmod/
+usr/src/cmd/mdb/intel/amd64/idm/kmod/
+usr/src/cmd/mdb/intel/amd64/ii/kmod/
+usr/src/cmd/mdb/intel/amd64/ip/kmod/
+usr/src/cmd/mdb/intel/amd64/ipc/kmod/
+usr/src/cmd/mdb/intel/amd64/ipp/kmod/
+usr/src/cmd/mdb/intel/amd64/kmdb/kmdb_context_off.h
+usr/src/cmd/mdb/intel/amd64/kmdb/kmdb_modlinktest.c
+usr/src/cmd/mdb/intel/amd64/kmdb/kmdb_terminfo.c
+usr/src/cmd/mdb/intel/amd64/kmdb/kmdbmod
+usr/src/cmd/mdb/intel/amd64/kmdb/kmdbmod.core
+usr/src/cmd/mdb/intel/amd64/kmdb/mapfile
+usr/src/cmd/mdb/intel/amd64/kmdb/mapfile.i
+usr/src/cmd/mdb/intel/amd64/kmdb/mdb_grammar.c
+usr/src/cmd/mdb/intel/amd64/kmdb/mdb_grammar.h
+usr/src/cmd/mdb/intel/amd64/kmdb/mdb_lex.c
+usr/src/cmd/mdb/intel/amd64/kmdb/y.output
+usr/src/cmd/mdb/intel/amd64/krtld/kmod/
+usr/src/cmd/mdb/intel/amd64/lofs/kmod/
+usr/src/cmd/mdb/intel/amd64/logindmux/kmod/
+usr/src/cmd/mdb/intel/amd64/mac/kmod/
+usr/src/cmd/mdb/intel/amd64/md/kmod/
+usr/src/cmd/mdb/intel/amd64/mdb/mdb
+usr/src/cmd/mdb/intel/amd64/mdb/mdb_grammar.c
+usr/src/cmd/mdb/intel/amd64/mdb/mdb_grammar.h
+usr/src/cmd/mdb/intel/amd64/mdb/mdb_lex.c
+usr/src/cmd/mdb/intel/amd64/mdb/y.output
+usr/src/cmd/mdb/intel/amd64/mdb_ds/kmod/
+usr/src/cmd/mdb/intel/amd64/mdb_ks/kmod/
+usr/src/cmd/mdb/intel/amd64/mpt_sas/kmod/
+usr/src/cmd/mdb/intel/amd64/mr_sas/kmod/
+usr/src/cmd/mdb/intel/amd64/nca/kmod/
+usr/src/cmd/mdb/intel/amd64/neti/kmod/
+usr/src/cmd/mdb/intel/amd64/nsctl/kmod/
+usr/src/cmd/mdb/intel/amd64/nsmb/kmod/
+usr/src/cmd/mdb/intel/amd64/pmcs/kmod/
+usr/src/cmd/mdb/intel/amd64/ptm/kmod/
+usr/src/cmd/mdb/intel/amd64/qlc/kmod/
+usr/src/cmd/mdb/intel/amd64/random/kmod/
+usr/src/cmd/mdb/intel/amd64/rdc/kmod/
+usr/src/cmd/mdb/intel/amd64/s1394/kmod/
+usr/src/cmd/mdb/intel/amd64/scsi_vhci/kmod/
+usr/src/cmd/mdb/intel/amd64/sctp/kmod/
+usr/src/cmd/mdb/intel/amd64/sd/kmod/
+usr/src/cmd/mdb/intel/amd64/sdbc/kmod/
+usr/src/cmd/mdb/intel/amd64/smbfs/kmod/
+usr/src/cmd/mdb/intel/amd64/smbsrv/kmod/
+usr/src/cmd/mdb/intel/amd64/sockfs/kmod/
+usr/src/cmd/mdb/intel/amd64/specfs/kmod/
+usr/src/cmd/mdb/intel/amd64/sppp/kmod/
+usr/src/cmd/mdb/intel/amd64/srpt/kmod/
+usr/src/cmd/mdb/intel/amd64/stmf/kmod/
+usr/src/cmd/mdb/intel/amd64/stmf_sbd/kmod/
+usr/src/cmd/mdb/intel/amd64/sv/kmod/
+usr/src/cmd/mdb/intel/amd64/ufs/kmod/
+usr/src/cmd/mdb/intel/amd64/uhci/kmod/
+usr/src/cmd/mdb/intel/amd64/usba/kmod/
+usr/src/cmd/mdb/intel/amd64/zfs/kmod/
+usr/src/cmd/mdb/intel/ia32/arp/kmod/
+usr/src/cmd/mdb/intel/ia32/cpc/kmod/
+usr/src/cmd/mdb/intel/ia32/crypto/kmod/
+usr/src/cmd/mdb/intel/ia32/dof/dof_names.c
+usr/src/cmd/mdb/intel/ia32/dtrace/dof_names.c
+usr/src/cmd/mdb/intel/ia32/emlxs/kmod/
+usr/src/cmd/mdb/intel/ia32/fcip/kmod/
+usr/src/cmd/mdb/intel/ia32/fcp/kmod/
+usr/src/cmd/mdb/intel/ia32/fctl/kmod/
+usr/src/cmd/mdb/intel/ia32/genunix/kmod/
+usr/src/cmd/mdb/intel/ia32/hook/kmod/
+usr/src/cmd/mdb/intel/ia32/idm/kmod/
+usr/src/cmd/mdb/intel/ia32/ii/kmod/
+usr/src/cmd/mdb/intel/ia32/ip/kmod/
+usr/src/cmd/mdb/intel/ia32/ipc/kmod/
+usr/src/cmd/mdb/intel/ia32/ipp/kmod/
+usr/src/cmd/mdb/intel/ia32/kmdb/kmdb_context_off.h
+usr/src/cmd/mdb/intel/ia32/kmdb/kmdb_modlinktest.c
+usr/src/cmd/mdb/intel/ia32/kmdb/kmdb_terminfo.c
+usr/src/cmd/mdb/intel/ia32/kmdb/kmdbmod
+usr/src/cmd/mdb/intel/ia32/kmdb/kmdbmod.core
+usr/src/cmd/mdb/intel/ia32/kmdb/mapfile
+usr/src/cmd/mdb/intel/ia32/kmdb/mapfile.i
+usr/src/cmd/mdb/intel/ia32/kmdb/mdb_grammar.c
+usr/src/cmd/mdb/intel/ia32/kmdb/mdb_grammar.h
+usr/src/cmd/mdb/intel/ia32/kmdb/mdb_lex.c
+usr/src/cmd/mdb/intel/ia32/kmdb/y.output
+usr/src/cmd/mdb/intel/ia32/krtld/kmod/
+usr/src/cmd/mdb/intel/ia32/lofs/kmod/
+usr/src/cmd/mdb/intel/ia32/logindmux/kmod/
+usr/src/cmd/mdb/intel/ia32/mac/kmod/
+usr/src/cmd/mdb/intel/ia32/md/kmod/
+usr/src/cmd/mdb/intel/ia32/mdb/mdb
+usr/src/cmd/mdb/intel/ia32/mdb/mdb_grammar.c
+usr/src/cmd/mdb/intel/ia32/mdb/mdb_grammar.h
+usr/src/cmd/mdb/intel/ia32/mdb/mdb_lex.c
+usr/src/cmd/mdb/intel/ia32/mdb/y.output
+usr/src/cmd/mdb/intel/ia32/mdb_ds/kmod/
+usr/src/cmd/mdb/intel/ia32/mdb_ks/kmod/
+usr/src/cmd/mdb/intel/ia32/mpt_sas/kmod/
+usr/src/cmd/mdb/intel/ia32/mr_sas/kmod/
+usr/src/cmd/mdb/intel/ia32/nca/kmod/
+usr/src/cmd/mdb/intel/ia32/neti/kmod/
+usr/src/cmd/mdb/intel/ia32/nsctl/kmod/
+usr/src/cmd/mdb/intel/ia32/nsmb/kmod/
+usr/src/cmd/mdb/intel/ia32/pmcs/kmod/
+usr/src/cmd/mdb/intel/ia32/ptm/kmod/
+usr/src/cmd/mdb/intel/ia32/qlc/kmod/
+usr/src/cmd/mdb/intel/ia32/random/kmod/
+usr/src/cmd/mdb/intel/ia32/rdc/kmod/
+usr/src/cmd/mdb/intel/ia32/s1394/kmod/
+usr/src/cmd/mdb/intel/ia32/scsi_vhci/kmod/
+usr/src/cmd/mdb/intel/ia32/sctp/kmod/
+usr/src/cmd/mdb/intel/ia32/sd/kmod/
+usr/src/cmd/mdb/intel/ia32/sdbc/kmod/
+usr/src/cmd/mdb/intel/ia32/smbfs/kmod/
+usr/src/cmd/mdb/intel/ia32/smbsrv/kmod/
+usr/src/cmd/mdb/intel/ia32/sockfs/kmod/
+usr/src/cmd/mdb/intel/ia32/specfs/kmod/
+usr/src/cmd/mdb/intel/ia32/sppp/kmod/
+usr/src/cmd/mdb/intel/ia32/srpt/kmod/
+usr/src/cmd/mdb/intel/ia32/stmf/kmod/
+usr/src/cmd/mdb/intel/ia32/stmf_sbd/kmod/
+usr/src/cmd/mdb/intel/ia32/sv/kmod/
+usr/src/cmd/mdb/intel/ia32/ufs/kmod/
+usr/src/cmd/mdb/intel/ia32/uhci/kmod/
+usr/src/cmd/mdb/intel/ia32/usba/kmod/
+usr/src/cmd/mdb/intel/ia32/zfs/kmod/
+usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/kmod/
+usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/kmod/
+usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/kmod/
+usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/kmod/
+usr/src/cmd/mdb/intel/modules/sata/amd64/kmod/
+usr/src/cmd/mdb/intel/modules/sata/ia32/kmod/
+usr/src/cmd/mdb/tools/scripts/hdr2map
+usr/src/cmd/mdb/tools/scripts/map2linktest
+usr/src/cmd/mdb/tools/scripts/mdb
+usr/src/cmd/mdb/tools/scripts/mkmodules
+usr/src/cmd/mdb/tools/scripts/tigen
+usr/src/cmd/mdb/tools/setdynflag/i386/setdynflag
+usr/src/cmd/mesg/mesg
+usr/src/cmd/mkdir/mkdir
+usr/src/cmd/mkfifo/mkfifo
+usr/src/cmd/mkfile/mkfile
+usr/src/cmd/mkmsgs/mkmsgs
+usr/src/cmd/mknod/mknod
+usr/src/cmd/mkpwdict/mkpwdict
+usr/src/cmd/mktemp/mktemp
+usr/src/cmd/modload/amd64/add_drv
+usr/src/cmd/modload/amd64/modinfo
+usr/src/cmd/modload/amd64/modload
+usr/src/cmd/modload/amd64/modunload
+usr/src/cmd/modload/amd64/rem_drv
+usr/src/cmd/modload/amd64/update_drv
+usr/src/cmd/modload/i386/add_drv
+usr/src/cmd/modload/i386/modinfo
+usr/src/cmd/modload/i386/modload
+usr/src/cmd/modload/i386/modunload
+usr/src/cmd/modload/i386/rem_drv
+usr/src/cmd/modload/i386/update_drv
+usr/src/cmd/more/more
+usr/src/cmd/mpathadm/mpathadm
+usr/src/cmd/msgfmt/gmsgfmt
+usr/src/cmd/msgfmt/gmsgfmt_rev
+usr/src/cmd/msgfmt/gnu_po.c
+usr/src/cmd/msgfmt/msgfmt
+usr/src/cmd/msgfmt/xgettext
+usr/src/cmd/msgfmt/y.tab.h
+usr/src/cmd/msgid/msgid
+usr/src/cmd/mt/mt
+usr/src/cmd/mv/cp
+usr/src/cmd/mv/ln
+usr/src/cmd/mv/mv
+usr/src/cmd/mv/mv.xpg4
+usr/src/cmd/mvdir/mvdir
+usr/src/cmd/ndmpadm/ndmpadm
+usr/src/cmd/ndmpd/ndmp/ndmp.h
+usr/src/cmd/ndmpd/ndmp/ndmp_xdr.c
+usr/src/cmd/ndmpd/ndmp/ndmp_xdr.h
+usr/src/cmd/ndmpd/ndmpd
+usr/src/cmd/ndmpstat/ndmpstat
+usr/src/cmd/netadm/_pmtab
+usr/src/cmd/netadm/_sactab
+usr/src/cmd/netadm/_sysconfig
+usr/src/cmd/netadm/etc/ttydefs.cleanup
+usr/src/cmd/netadm/iu.ap
+usr/src/cmd/netadm/log
+usr/src/cmd/netadm/ttydefs
+usr/src/cmd/newform/newform
+usr/src/cmd/newgrp/newgrp
+usr/src/cmd/news/news
+usr/src/cmd/newtask/amd64/newtask
+usr/src/cmd/newtask/i386/newtask
+usr/src/cmd/nice/nice
+usr/src/cmd/nice/nice.xpg4
+usr/src/cmd/nl/nl
+usr/src/cmd/nl/nl.xpg4
+usr/src/cmd/nlsadmin/nlsadmin
+usr/src/cmd/nohup/amd64/nohup
+usr/src/cmd/nohup/amd64/nohup.xpg4
+usr/src/cmd/nohup/i386/nohup
+usr/src/cmd/nohup/i386/nohup.xpg4
+usr/src/cmd/nsadmin/.bashrc
+usr/src/cmd/nsadmin/.login
+usr/src/cmd/nsadmin/.profile
+usr/src/cmd/nsadmin/profile
+usr/src/cmd/nscd/nscd
+usr/src/cmd/ntfsprogs/THIRDPARTYLICENSE
+usr/src/cmd/ntfsprogs/mkntfs
+usr/src/cmd/ntfsprogs/ntfscat
+usr/src/cmd/ntfsprogs/ntfsclone
+usr/src/cmd/ntfsprogs/ntfscluster
+usr/src/cmd/ntfsprogs/ntfscmp
+usr/src/cmd/ntfsprogs/ntfscp
+usr/src/cmd/ntfsprogs/ntfsfix
+usr/src/cmd/ntfsprogs/ntfsinfo
+usr/src/cmd/ntfsprogs/ntfslabel
+usr/src/cmd/ntfsprogs/ntfsls
+usr/src/cmd/ntfsprogs/ntfsresize
+usr/src/cmd/ntfsprogs/ntfsundelete
+usr/src/cmd/oamuser/group/groupadd
+usr/src/cmd/oamuser/group/groupdel
+usr/src/cmd/oamuser/group/groupmod
+usr/src/cmd/oamuser/lib/ugdates
+usr/src/cmd/oamuser/user/useradd
+usr/src/cmd/oamuser/user/userdel
+usr/src/cmd/oamuser/user/usermod
+usr/src/cmd/oawk/awk.g.c
+usr/src/cmd/oawk/awk.h
+usr/src/cmd/oawk/awk.lx.c
+usr/src/cmd/oawk/native/
+usr/src/cmd/oawk/oawk
+usr/src/cmd/oawk/proctab.c
+usr/src/cmd/oawk/temp
+usr/src/cmd/oawk/tmptoken.c
+usr/src/cmd/od/od
+usr/src/cmd/pack/pack
+usr/src/cmd/pagesize/pagesize
+usr/src/cmd/parted/THIRDPARTYLICENSE
+usr/src/cmd/parted/parted
+usr/src/cmd/passmgmt/datemsk
+usr/src/cmd/passmgmt/passmgmt
+usr/src/cmd/passwd/passwd
+usr/src/cmd/pathchk/pathchk
+usr/src/cmd/pbind/amd64/pbind
+usr/src/cmd/pbind/i386/pbind
+usr/src/cmd/pcidr/pcidr
+usr/src/cmd/pcitool/i386/pcitool
+usr/src/cmd/perl/5.12/
+usr/src/cmd/pfexec/pfexec
+usr/src/cmd/pfexecd/pfexecd
+usr/src/cmd/pg/pg
+usr/src/cmd/pginfo/pginfo
+usr/src/cmd/pgrep/pgrep
+usr/src/cmd/pgrep/pkill
+usr/src/cmd/pgstat/pgstat
+usr/src/cmd/picl/picld/picld
+usr/src/cmd/picl/plugins/lib/picld_pluginutil/i386/lint.out
+usr/src/cmd/picl/plugins/lib/picld_pluginutil/i386/llib-lpicld_pluginutil.ln
+usr/src/cmd/picl/prtpicl/prtpicl
+usr/src/cmd/platexec/platexec
+usr/src/cmd/plimit/amd64/plimit
+usr/src/cmd/plimit/i386/plimit
+usr/src/cmd/plockstat/amd64/plockstat
+usr/src/cmd/plockstat/i386/plockstat
+usr/src/cmd/policykit/polkit-is-privileged
+usr/src/cmd/pools/pooladm/pooladm
+usr/src/cmd/pools/poolbind/poolbind
+usr/src/cmd/pools/poolcfg/poolcfg
+usr/src/cmd/pools/poolcfg/poolcfg_grammar.c
+usr/src/cmd/pools/poolcfg/poolcfg_grammar.h
+usr/src/cmd/pools/poolcfg/poolcfg_lex.c
+usr/src/cmd/pools/poold/JPool.jar
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/AbstractObjective.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/AbstractStatistic.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/AggregateStatistic.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/ComponentMove.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/ConfigurationException.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/DRM.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/DecisionHistory$1.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/DecisionHistory$ComponentMoveDecision.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/DecisionHistory$Decision.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/DecisionHistory.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/DoubleStatistic.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Expression.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/IllegalOFValueException.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/KExpression.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/KVExpression.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/KVOpExpression.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/LGroupData.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/LocalityObjective.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/LogDRM.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/LongStatistic.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Monitor.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Move.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Objective.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/PSETData.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Poold$1.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Poold$logHelper.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Poold$utility.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Poold.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/PooldException.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/QuantityMove.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/ResourceMonitor.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/ResultTuple.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Solver.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/StaleMonitorException.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/Statistic.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/StatisticEvent.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/StatisticList.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/StatisticListener.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/StatisticOperations.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/SystemMonitor.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/SystemSolver$ScoreMove.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/SystemSolver.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/UnsignedInt64Statistic.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/UtilizationObjective.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/WeightedLoadObjective$Calculation.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/WeightedLoadObjective.class
+usr/src/cmd/pools/poold/com/sun/solaris/domain/pools/WorkloadDependentObjective.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/exception/SuccinctStackTraceFormatter.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/kstat/Kstat.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/kstat/KstatChainUpdateException.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/kstat/KstatCtl.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/kstat/KstatException.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/kstat/KstatReadException.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/kstat/KstatTypeNotSupportedException.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/locality/LocalityDomain.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/locality/LocalityGroup.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/logging/Facility.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/logging/Severity.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/logging/SyslogHandler.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/logging/SysloglikeFormatter$1.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/logging/SysloglikeFormatter.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Component.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Configuration.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Element.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/HRTime.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Pool.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/PoolInternal.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/PoolsException.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Property.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/PropertyWalk.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Resource.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/UnsignedInt64.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/pools/Value.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/timer/RecurringEventTimer.class
+usr/src/cmd/pools/poold/com/sun/solaris/service/timer/SimpleRecurringEventTimer.class
+usr/src/cmd/pools/poold/libjkstat/jkstat.h
+usr/src/cmd/pools/poold/libjlgrp/jlgrp.h
+usr/src/cmd/pools/poold/libjpool/jpool.h
+usr/src/cmd/pools/poold/libjsyslog/jsyslog.h
+usr/src/cmd/pools/poold/poold
+usr/src/cmd/pools/poolstat/poolstat
+usr/src/cmd/power/pmconfig
+usr/src/cmd/power/power.conf
+usr/src/cmd/power/powerd
+usr/src/cmd/power/sys-suspend
+usr/src/cmd/power/sysidpm
+usr/src/cmd/powertop/amd64/powertop
+usr/src/cmd/powertop/i386/powertop
+usr/src/cmd/ppgsz/amd64/ppgsz
+usr/src/cmd/ppgsz/i386/ppgsz
+usr/src/cmd/pr/pr
+usr/src/cmd/pr/pr.dc
+usr/src/cmd/pr/pr.xpg4
+usr/src/cmd/praudit/praudit
+usr/src/cmd/prctl/amd64/prctl
+usr/src/cmd/prctl/i386/prctl
+usr/src/cmd/printf/printf
+usr/src/cmd/priocntl/FSSpriocntl
+usr/src/cmd/priocntl/FXpriocntl
+usr/src/cmd/priocntl/IApriocntl
+usr/src/cmd/priocntl/RTpriocntl
+usr/src/cmd/priocntl/SDCpriocntl
+usr/src/cmd/priocntl/TSpriocntl
+usr/src/cmd/priocntl/priocntl
+usr/src/cmd/profiles/profiles
+usr/src/cmd/projadd/projadd
+usr/src/cmd/projadd/projdel
+usr/src/cmd/projadd/projmod
+usr/src/cmd/projects/projects
+usr/src/cmd/prstat/amd64/prstat
+usr/src/cmd/prstat/i386/prstat
+usr/src/cmd/prtconf/amd64/prtconf
+usr/src/cmd/prtconf/i386/prtconf
+usr/src/cmd/prtdiag/i386/prtdiag
+usr/src/cmd/prtvtoc/prtvtoc
+usr/src/cmd/ps/amd64/ps
+usr/src/cmd/ps/i386/ps
+usr/src/cmd/ps/ps.dc
+usr/src/cmd/psradm/psradm
+usr/src/cmd/psrinfo/psrinfo
+usr/src/cmd/psrset/amd64/psrset
+usr/src/cmd/psrset/i386/psrset
+usr/src/cmd/ptools/pargs/amd64/
+usr/src/cmd/ptools/pargs/i386/
+usr/src/cmd/ptools/pcred/amd64/
+usr/src/cmd/ptools/pcred/i386/
+usr/src/cmd/ptools/pfiles/amd64/
+usr/src/cmd/ptools/pfiles/i386/
+usr/src/cmd/ptools/pflags/amd64/
+usr/src/cmd/ptools/pflags/i386/
+usr/src/cmd/ptools/pldd/amd64/
+usr/src/cmd/ptools/pldd/i386/
+usr/src/cmd/ptools/plgrp/amd64/
+usr/src/cmd/ptools/plgrp/i386/
+usr/src/cmd/ptools/pmadvise/amd64/
+usr/src/cmd/ptools/pmadvise/i386/
+usr/src/cmd/ptools/pmap/amd64/
+usr/src/cmd/ptools/pmap/i386/
+usr/src/cmd/ptools/ppriv/amd64/
+usr/src/cmd/ptools/ppriv/i386/
+usr/src/cmd/ptools/preap/amd64/
+usr/src/cmd/ptools/preap/i386/
+usr/src/cmd/ptools/prun/amd64/
+usr/src/cmd/ptools/prun/i386/
+usr/src/cmd/ptools/psig/amd64/
+usr/src/cmd/ptools/psig/i386/
+usr/src/cmd/ptools/pstack/amd64/
+usr/src/cmd/ptools/pstack/i386/
+usr/src/cmd/ptools/pstop/amd64/
+usr/src/cmd/ptools/pstop/i386/
+usr/src/cmd/ptools/ptime/amd64/
+usr/src/cmd/ptools/ptime/i386/
+usr/src/cmd/ptools/ptree/amd64/
+usr/src/cmd/ptools/ptree/i386/
+usr/src/cmd/ptools/pwait/amd64/
+usr/src/cmd/ptools/pwait/i386/
+usr/src/cmd/ptools/pwdx/amd64/
+usr/src/cmd/ptools/pwdx/i386/
+usr/src/cmd/pwck/pwck
+usr/src/cmd/pwconv/pwconv
+usr/src/cmd/pwd/pwd
+usr/src/cmd/raidctl/raidctl
+usr/src/cmd/ramdiskadm/ramdiskadm
+usr/src/cmd/rcap/rcapadm/rcapadm
+usr/src/cmd/rcap/rcapd/amd64/rcapd
+usr/src/cmd/rcap/rcapd/i386/rcapd
+usr/src/cmd/rcap/rcapstat/rcapstat
+usr/src/cmd/rcm_daemon/i386/rcm_daemon
+usr/src/cmd/rctladm/rctladm
+usr/src/cmd/refer/addbib
+usr/src/cmd/refer/hunt
+usr/src/cmd/refer/indxbib
+usr/src/cmd/refer/inv
+usr/src/cmd/refer/lookbib
+usr/src/cmd/refer/mkey
+usr/src/cmd/refer/refer
+usr/src/cmd/refer/roffbib
+usr/src/cmd/refer/sortbib
+usr/src/cmd/regcmp/regcmp
+usr/src/cmd/renice/renice
+usr/src/cmd/rexd/on
+usr/src/cmd/rexd/rpc.rexd
+usr/src/cmd/rm/rm
+usr/src/cmd/rm/rm.xpg4
+usr/src/cmd/rmdir/rmdir
+usr/src/cmd/rmformat/rmformat
+usr/src/cmd/rmmount/rmmount
+usr/src/cmd/rmt/rmt
+usr/src/cmd/rmvolmgr/rmvolmgr
+usr/src/cmd/roles/roles
+usr/src/cmd/rpcbind/rpc-bind
+usr/src/cmd/rpcbind/rpcbind
+usr/src/cmd/rpcgen/rpcgen
+usr/src/cmd/rpcinfo/rpcinfo
+usr/src/cmd/rpcsvc/rpc.bootparamd/rpc.bootparamd
+usr/src/cmd/rpcsvc/rpc.rstatd
+usr/src/cmd/rpcsvc/rpc.rusersd
+usr/src/cmd/rpcsvc/rpc.rwalld
+usr/src/cmd/rpcsvc/rpc.sprayd
+usr/src/cmd/rpcsvc/rstat.h
+usr/src/cmd/rpcsvc/rstat.x
+usr/src/cmd/rpcsvc/rstat_svc.c
+usr/src/cmd/rpcsvc/rstat_v2.h
+usr/src/cmd/rpcsvc/rstat_v2_svc.c
+usr/src/cmd/rpcsvc/rstat_v2_xdr.c
+usr/src/cmd/rpcsvc/rup
+usr/src/cmd/rpcsvc/rusers
+usr/src/cmd/rpcsvc/rwall
+usr/src/cmd/rpcsvc/rwall.h
+usr/src/cmd/rpcsvc/rwall.x
+usr/src/cmd/rpcsvc/rwall_clnt.c
+usr/src/cmd/rpcsvc/rwall_svc.c
+usr/src/cmd/rpcsvc/spray
+usr/src/cmd/rpcsvc/spray.h
+usr/src/cmd/rpcsvc/spray.x
+usr/src/cmd/rpcsvc/spray_clnt.c
+usr/src/cmd/rpcsvc/spray_svc.c
+usr/src/cmd/rtc/rtc
+usr/src/cmd/runat/runat
+usr/src/cmd/sa/sa1
+usr/src/cmd/sa/sa2
+usr/src/cmd/sa/sadc
+usr/src/cmd/sa/sar
+usr/src/cmd/sa/timex
+usr/src/cmd/saf/pmadm
+usr/src/cmd/saf/sac
+usr/src/cmd/saf/sacadm
+usr/src/cmd/sasinfo/sasinfo
+usr/src/cmd/savecore/amd64/savecore
+usr/src/cmd/savecore/i386/savecore
+usr/src/cmd/sbdadm/sbdadm
+usr/src/cmd/script/script
+usr/src/cmd/scsi/sestopo/i386/sestopo
+usr/src/cmd/scsi/smp/i386/smp
+usr/src/cmd/sdiff/sdiff
+usr/src/cmd/sdpadm/sdpadm
+usr/src/cmd/sed/sed
+usr/src/cmd/sendmail/THIRDPARTYLICENSE
+usr/src/cmd/sendmail/aux/editmap
+usr/src/cmd/sendmail/aux/etrn
+usr/src/cmd/sendmail/aux/mail.local
+usr/src/cmd/sendmail/aux/mailcompat
+usr/src/cmd/sendmail/aux/mailq
+usr/src/cmd/sendmail/aux/mailstats
+usr/src/cmd/sendmail/aux/makemap
+usr/src/cmd/sendmail/aux/mconnect
+usr/src/cmd/sendmail/aux/praliases
+usr/src/cmd/sendmail/aux/smrsh
+usr/src/cmd/sendmail/aux/vacation
+usr/src/cmd/sendmail/cf/cf/sendmail.cf
+usr/src/cmd/sendmail/cf/cf/submit.cf
+usr/src/cmd/sendmail/cf/sendmail.cf
+usr/src/cmd/sendmail/cf/submit.cf
+usr/src/cmd/sendmail/libmilter/i386/lint.out
+usr/src/cmd/sendmail/libmilter/i386/llib-lmilter.ln
+usr/src/cmd/sendmail/src/sendmail
+usr/src/cmd/setfacl/setfacl
+usr/src/cmd/setmnt/setmnt
+usr/src/cmd/setpgrp/setpgrp
+usr/src/cmd/setuname/amd64/setuname
+usr/src/cmd/setuname/i386/setuname
+usr/src/cmd/sgs/0@0/.make.state.i386
+usr/src/cmd/sgs/ar/.make.state.i386
+usr/src/cmd/sgs/ar/amd64/.make.state.i386
+usr/src/cmd/sgs/ar/amd64/ar
+usr/src/cmd/sgs/ar/amd64/msg.c
+usr/src/cmd/sgs/ar/amd64/msg.h
+usr/src/cmd/sgs/ar/i386/.make.state.i386
+usr/src/cmd/sgs/ar/i386/ar
+usr/src/cmd/sgs/ar/i386/ar.xpg4
+usr/src/cmd/sgs/ar/i386/msg.c
+usr/src/cmd/sgs/ar/i386/msg.h
+usr/src/cmd/sgs/crle/.make.state.i386
+usr/src/cmd/sgs/crle/amd64/.make.state.i386
+usr/src/cmd/sgs/crle/amd64/crle
+usr/src/cmd/sgs/crle/amd64/msg.c
+usr/src/cmd/sgs/crle/amd64/msg.h
+usr/src/cmd/sgs/crle/i386/.make.state.i386
+usr/src/cmd/sgs/crle/i386/crle
+usr/src/cmd/sgs/crle/i386/msg.c
+usr/src/cmd/sgs/crle/i386/msg.h
+usr/src/cmd/sgs/dump/.make.state.i386
+usr/src/cmd/sgs/dump/amd64/.make.state.i386
+usr/src/cmd/sgs/dump/amd64/dump
+usr/src/cmd/sgs/dump/i386/.make.state.i386
+usr/src/cmd/sgs/dump/i386/dump
+usr/src/cmd/sgs/elfdump/.make.state.i386
+usr/src/cmd/sgs/elfdump/amd64/.make.state.i386
+usr/src/cmd/sgs/elfdump/amd64/elfdump
+usr/src/cmd/sgs/elfdump/amd64/gen_struct_layout
+usr/src/cmd/sgs/elfdump/amd64/msg.c
+usr/src/cmd/sgs/elfdump/amd64/msg.h
+usr/src/cmd/sgs/elfdump/i386/.make.state.i386
+usr/src/cmd/sgs/elfdump/i386/elfdump
+usr/src/cmd/sgs/elfdump/i386/gen_struct_layout
+usr/src/cmd/sgs/elfdump/i386/msg.c
+usr/src/cmd/sgs/elfdump/i386/msg.h
+usr/src/cmd/sgs/elfedit/.make.state.i386
+usr/src/cmd/sgs/elfedit/amd64/.make.state.i386
+usr/src/cmd/sgs/elfedit/amd64/elfedit
+usr/src/cmd/sgs/elfedit/amd64/msg.c
+usr/src/cmd/sgs/elfedit/amd64/msg.h
+usr/src/cmd/sgs/elfedit/i386/.make.state.i386
+usr/src/cmd/sgs/elfedit/i386/elfedit
+usr/src/cmd/sgs/elfedit/i386/msg.c
+usr/src/cmd/sgs/elfedit/i386/msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/.make.state.i386
+usr/src/cmd/sgs/elfedit/modules/amd64/cap_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/cap_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/dyn_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/dyn_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/ehdr_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/ehdr_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/phdr_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/phdr_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/shdr_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/shdr_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/str_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/str_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/sym_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/sym_msg.h
+usr/src/cmd/sgs/elfedit/modules/amd64/syminfo_msg.c
+usr/src/cmd/sgs/elfedit/modules/amd64/syminfo_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/.make.state.i386
+usr/src/cmd/sgs/elfedit/modules/i386/cap_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/cap_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/dyn_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/dyn_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/ehdr_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/ehdr_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/phdr_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/phdr_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/shdr_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/shdr_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/str_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/str_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/sym_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/sym_msg.h
+usr/src/cmd/sgs/elfedit/modules/i386/syminfo_msg.c
+usr/src/cmd/sgs/elfedit/modules/i386/syminfo_msg.h
+usr/src/cmd/sgs/elfwrap/.make.state.i386
+usr/src/cmd/sgs/elfwrap/amd64/.make.state.i386
+usr/src/cmd/sgs/elfwrap/amd64/elfwrap
+usr/src/cmd/sgs/elfwrap/amd64/msg.c
+usr/src/cmd/sgs/elfwrap/amd64/msg.h
+usr/src/cmd/sgs/elfwrap/i386/.make.state.i386
+usr/src/cmd/sgs/elfwrap/i386/elfwrap
+usr/src/cmd/sgs/elfwrap/i386/msg.c
+usr/src/cmd/sgs/elfwrap/i386/msg.h
+usr/src/cmd/sgs/error/i386/error
+usr/src/cmd/sgs/gprof/i386/.make.state.i386
+usr/src/cmd/sgs/gprof/i386/gprof
+usr/src/cmd/sgs/lari/.make.state.i386
+usr/src/cmd/sgs/lari/lari
+usr/src/cmd/sgs/ld/.make.state.i386
+usr/src/cmd/sgs/ld/amd64/.make.state.i386
+usr/src/cmd/sgs/ld/amd64/ld
+usr/src/cmd/sgs/ld/amd64/msg.c
+usr/src/cmd/sgs/ld/amd64/msg.h
+usr/src/cmd/sgs/ld/i386/.make.state.i386
+usr/src/cmd/sgs/ld/i386/ld
+usr/src/cmd/sgs/ld/i386/msg.c
+usr/src/cmd/sgs/ld/i386/msg.h
+usr/src/cmd/sgs/ldd/.make.state.i386
+usr/src/cmd/sgs/ldd/amd64/.make.state.i386
+usr/src/cmd/sgs/ldd/amd64/ldd
+usr/src/cmd/sgs/ldd/amd64/msg.c
+usr/src/cmd/sgs/ldd/amd64/msg.h
+usr/src/cmd/sgs/ldd/i386/.make.state.i386
+usr/src/cmd/sgs/ldd/i386/ldd
+usr/src/cmd/sgs/ldd/i386/msg.c
+usr/src/cmd/sgs/ldd/i386/msg.h
+usr/src/cmd/sgs/lddstub/.make.state.i386
+usr/src/cmd/sgs/lddstub/amd64/.make.state.i386
+usr/src/cmd/sgs/lddstub/amd64/lddstub
+usr/src/cmd/sgs/lddstub/i386/.make.state.i386
+usr/src/cmd/sgs/lddstub/i386/lddstub
+usr/src/cmd/sgs/ldprof/.make.state.i386
+usr/src/cmd/sgs/ldprof/amd64/.make.state.i386
+usr/src/cmd/sgs/ldprof/amd64/msg.c
+usr/src/cmd/sgs/ldprof/amd64/msg.h
+usr/src/cmd/sgs/ldprof/i386/.make.state.i386
+usr/src/cmd/sgs/ldprof/i386/msg.c
+usr/src/cmd/sgs/ldprof/i386/msg.h
+usr/src/cmd/sgs/lex/amd64/llib-ll.ln
+usr/src/cmd/sgs/lex/common/parser.c
+usr/src/cmd/sgs/lex/i386/lex
+usr/src/cmd/sgs/lex/i386/llib-ll.ln
+usr/src/cmd/sgs/libconv/.make.state.i386
+usr/src/cmd/sgs/libconv/amd64/.make.state.i386
+usr/src/cmd/sgs/libconv/amd64/arch_msg.c
+usr/src/cmd/sgs/libconv/amd64/arch_msg.h
+usr/src/cmd/sgs/libconv/amd64/audit_msg.c
+usr/src/cmd/sgs/libconv/amd64/audit_msg.h
+usr/src/cmd/sgs/libconv/amd64/bld_vernote
+usr/src/cmd/sgs/libconv/amd64/c_literal_msg.c
+usr/src/cmd/sgs/libconv/amd64/c_literal_msg.h
+usr/src/cmd/sgs/libconv/amd64/cap_msg.c
+usr/src/cmd/sgs/libconv/amd64/cap_msg.h
+usr/src/cmd/sgs/libconv/amd64/config_msg.c
+usr/src/cmd/sgs/libconv/amd64/config_msg.h
+usr/src/cmd/sgs/libconv/amd64/corenote_msg.c
+usr/src/cmd/sgs/libconv/amd64/corenote_msg.h
+usr/src/cmd/sgs/libconv/amd64/data_msg.c
+usr/src/cmd/sgs/libconv/amd64/data_msg.h
+usr/src/cmd/sgs/libconv/amd64/deftag_msg.c
+usr/src/cmd/sgs/libconv/amd64/deftag_msg.h
+usr/src/cmd/sgs/libconv/amd64/demangle_msg.c
+usr/src/cmd/sgs/libconv/amd64/demangle_msg.h
+usr/src/cmd/sgs/libconv/amd64/dl_msg.c
+usr/src/cmd/sgs/libconv/amd64/dl_msg.h
+usr/src/cmd/sgs/libconv/amd64/dwarf_ehe_msg.c
+usr/src/cmd/sgs/libconv/amd64/dwarf_ehe_msg.h
+usr/src/cmd/sgs/libconv/amd64/dwarf_msg.c
+usr/src/cmd/sgs/libconv/amd64/dwarf_msg.h
+usr/src/cmd/sgs/libconv/amd64/dynamic_msg.c
+usr/src/cmd/sgs/libconv/amd64/dynamic_msg.h
+usr/src/cmd/sgs/libconv/amd64/elf_msg.c
+usr/src/cmd/sgs/libconv/amd64/elf_msg.h
+usr/src/cmd/sgs/libconv/amd64/entry_msg.c
+usr/src/cmd/sgs/libconv/amd64/entry_msg.h
+usr/src/cmd/sgs/libconv/amd64/globals_msg.c
+usr/src/cmd/sgs/libconv/amd64/globals_msg.h
+usr/src/cmd/sgs/libconv/amd64/group_msg.c
+usr/src/cmd/sgs/libconv/amd64/group_msg.h
+usr/src/cmd/sgs/libconv/amd64/lddstub_msg.c
+usr/src/cmd/sgs/libconv/amd64/lddstub_msg.h
+usr/src/cmd/sgs/libconv/amd64/map_msg.c
+usr/src/cmd/sgs/libconv/amd64/map_msg.h
+usr/src/cmd/sgs/libconv/amd64/phdr_msg.c
+usr/src/cmd/sgs/libconv/amd64/phdr_msg.h
+usr/src/cmd/sgs/libconv/amd64/relocate_amd64_msg.c
+usr/src/cmd/sgs/libconv/amd64/relocate_amd64_msg.h
+usr/src/cmd/sgs/libconv/amd64/relocate_i386_msg.c
+usr/src/cmd/sgs/libconv/amd64/relocate_i386_msg.h
+usr/src/cmd/sgs/libconv/amd64/relocate_sparc_msg.c
+usr/src/cmd/sgs/libconv/amd64/relocate_sparc_msg.h
+usr/src/cmd/sgs/libconv/amd64/report_bufsize.h
+usr/src/cmd/sgs/libconv/amd64/sections_msg.c
+usr/src/cmd/sgs/libconv/amd64/sections_msg.h
+usr/src/cmd/sgs/libconv/amd64/segments_msg.c
+usr/src/cmd/sgs/libconv/amd64/segments_msg.h
+usr/src/cmd/sgs/libconv/amd64/symbols_msg.c
+usr/src/cmd/sgs/libconv/amd64/symbols_msg.h
+usr/src/cmd/sgs/libconv/amd64/symbols_sparc_msg.c
+usr/src/cmd/sgs/libconv/amd64/symbols_sparc_msg.h
+usr/src/cmd/sgs/libconv/amd64/syminfo_msg.c
+usr/src/cmd/sgs/libconv/amd64/syminfo_msg.h
+usr/src/cmd/sgs/libconv/amd64/time_msg.c
+usr/src/cmd/sgs/libconv/amd64/time_msg.h
+usr/src/cmd/sgs/libconv/amd64/vernote.s
+usr/src/cmd/sgs/libconv/amd64/version_msg.c
+usr/src/cmd/sgs/libconv/amd64/version_msg.h
+usr/src/cmd/sgs/libconv/i386/.make.state.i386
+usr/src/cmd/sgs/libconv/i386/arch_msg.c
+usr/src/cmd/sgs/libconv/i386/arch_msg.h
+usr/src/cmd/sgs/libconv/i386/audit_msg.c
+usr/src/cmd/sgs/libconv/i386/audit_msg.h
+usr/src/cmd/sgs/libconv/i386/bld_vernote
+usr/src/cmd/sgs/libconv/i386/c_literal_msg.c
+usr/src/cmd/sgs/libconv/i386/c_literal_msg.h
+usr/src/cmd/sgs/libconv/i386/cap_msg.c
+usr/src/cmd/sgs/libconv/i386/cap_msg.h
+usr/src/cmd/sgs/libconv/i386/config_msg.c
+usr/src/cmd/sgs/libconv/i386/config_msg.h
+usr/src/cmd/sgs/libconv/i386/corenote_msg.c
+usr/src/cmd/sgs/libconv/i386/corenote_msg.h
+usr/src/cmd/sgs/libconv/i386/data_msg.c
+usr/src/cmd/sgs/libconv/i386/data_msg.h
+usr/src/cmd/sgs/libconv/i386/deftag_msg.c
+usr/src/cmd/sgs/libconv/i386/deftag_msg.h
+usr/src/cmd/sgs/libconv/i386/demangle_msg.c
+usr/src/cmd/sgs/libconv/i386/demangle_msg.h
+usr/src/cmd/sgs/libconv/i386/dl_msg.c
+usr/src/cmd/sgs/libconv/i386/dl_msg.h
+usr/src/cmd/sgs/libconv/i386/dwarf_ehe_msg.c
+usr/src/cmd/sgs/libconv/i386/dwarf_ehe_msg.h
+usr/src/cmd/sgs/libconv/i386/dwarf_msg.c
+usr/src/cmd/sgs/libconv/i386/dwarf_msg.h
+usr/src/cmd/sgs/libconv/i386/dynamic_msg.c
+usr/src/cmd/sgs/libconv/i386/dynamic_msg.h
+usr/src/cmd/sgs/libconv/i386/elf_msg.c
+usr/src/cmd/sgs/libconv/i386/elf_msg.h
+usr/src/cmd/sgs/libconv/i386/entry_msg.c
+usr/src/cmd/sgs/libconv/i386/entry_msg.h
+usr/src/cmd/sgs/libconv/i386/globals_msg.c
+usr/src/cmd/sgs/libconv/i386/globals_msg.h
+usr/src/cmd/sgs/libconv/i386/group_msg.c
+usr/src/cmd/sgs/libconv/i386/group_msg.h
+usr/src/cmd/sgs/libconv/i386/lddstub_msg.c
+usr/src/cmd/sgs/libconv/i386/lddstub_msg.h
+usr/src/cmd/sgs/libconv/i386/map_msg.c
+usr/src/cmd/sgs/libconv/i386/map_msg.h
+usr/src/cmd/sgs/libconv/i386/phdr_msg.c
+usr/src/cmd/sgs/libconv/i386/phdr_msg.h
+usr/src/cmd/sgs/libconv/i386/relocate_amd64_msg.c
+usr/src/cmd/sgs/libconv/i386/relocate_amd64_msg.h
+usr/src/cmd/sgs/libconv/i386/relocate_i386_msg.c
+usr/src/cmd/sgs/libconv/i386/relocate_i386_msg.h
+usr/src/cmd/sgs/libconv/i386/relocate_sparc_msg.c
+usr/src/cmd/sgs/libconv/i386/relocate_sparc_msg.h
+usr/src/cmd/sgs/libconv/i386/report_bufsize.h
+usr/src/cmd/sgs/libconv/i386/sections_msg.c
+usr/src/cmd/sgs/libconv/i386/sections_msg.h
+usr/src/cmd/sgs/libconv/i386/segments_msg.c
+usr/src/cmd/sgs/libconv/i386/segments_msg.h
+usr/src/cmd/sgs/libconv/i386/symbols_msg.c
+usr/src/cmd/sgs/libconv/i386/symbols_msg.h
+usr/src/cmd/sgs/libconv/i386/symbols_sparc_msg.c
+usr/src/cmd/sgs/libconv/i386/symbols_sparc_msg.h
+usr/src/cmd/sgs/libconv/i386/syminfo_msg.c
+usr/src/cmd/sgs/libconv/i386/syminfo_msg.h
+usr/src/cmd/sgs/libconv/i386/time_msg.c
+usr/src/cmd/sgs/libconv/i386/time_msg.h
+usr/src/cmd/sgs/libconv/i386/vernote.s
+usr/src/cmd/sgs/libconv/i386/version_msg.c
+usr/src/cmd/sgs/libconv/i386/version_msg.h
+usr/src/cmd/sgs/libcrle/.make.state.i386
+usr/src/cmd/sgs/libcrle/amd64/.make.state.i386
+usr/src/cmd/sgs/libcrle/amd64/msg.c
+usr/src/cmd/sgs/libcrle/amd64/msg.h
+usr/src/cmd/sgs/libcrle/i386/.make.state.i386
+usr/src/cmd/sgs/libcrle/i386/msg.c
+usr/src/cmd/sgs/libcrle/i386/msg.h
+usr/src/cmd/sgs/libdl/.make.state.i386
+usr/src/cmd/sgs/libdl/amd64/lint.out
+usr/src/cmd/sgs/libdl/amd64/llib-ldl.ln
+usr/src/cmd/sgs/libdl/i386/lint.out
+usr/src/cmd/sgs/libdl/i386/llib-ldl.ln
+usr/src/cmd/sgs/libelf/.make.state.i386
+usr/src/cmd/sgs/libelf/amd64/.make.state.i386
+usr/src/cmd/sgs/libelf/amd64/lint.out.1
+usr/src/cmd/sgs/libelf/amd64/llib-lelf.ln
+usr/src/cmd/sgs/libelf/amd64/msg.c
+usr/src/cmd/sgs/libelf/amd64/msg.h
+usr/src/cmd/sgs/libelf/amd64/xlate.c
+usr/src/cmd/sgs/libelf/amd64/xlate64.c
+usr/src/cmd/sgs/libelf/i386/.make.state.i386
+usr/src/cmd/sgs/libelf/i386/lint.out.1
+usr/src/cmd/sgs/libelf/i386/llib-lelf.ln
+usr/src/cmd/sgs/libelf/i386/msg.c
+usr/src/cmd/sgs/libelf/i386/msg.h
+usr/src/cmd/sgs/libelf/i386/xlate.c
+usr/src/cmd/sgs/libelf/i386/xlate64.c
+usr/src/cmd/sgs/libld/.make.state.i386
+usr/src/cmd/sgs/libld/amd64/.make.state.i386
+usr/src/cmd/sgs/libld/amd64/libld.so.4
+usr/src/cmd/sgs/libld/amd64/msg.c
+usr/src/cmd/sgs/libld/amd64/msg.h
+usr/src/cmd/sgs/libld/i386/.make.state.i386
+usr/src/cmd/sgs/libld/i386/libld.so.4
+usr/src/cmd/sgs/libld/i386/msg.c
+usr/src/cmd/sgs/libld/i386/msg.h
+usr/src/cmd/sgs/liblddbg/.make.state.i386
+usr/src/cmd/sgs/liblddbg/amd64/.make.state.i386
+usr/src/cmd/sgs/liblddbg/amd64/liblddbg.so.4
+usr/src/cmd/sgs/liblddbg/amd64/msg.c
+usr/src/cmd/sgs/liblddbg/amd64/msg.h
+usr/src/cmd/sgs/liblddbg/i386/.make.state.i386
+usr/src/cmd/sgs/liblddbg/i386/liblddbg.so.4
+usr/src/cmd/sgs/liblddbg/i386/msg.c
+usr/src/cmd/sgs/liblddbg/i386/msg.h
+usr/src/cmd/sgs/libldmake/.make.state.i386
+usr/src/cmd/sgs/libldmake/amd64/.make.state.i386
+usr/src/cmd/sgs/libldmake/i386/.make.state.i386
+usr/src/cmd/sgs/libldstab/.make.state.i386
+usr/src/cmd/sgs/libldstab/amd64/.make.state.i386
+usr/src/cmd/sgs/libldstab/i386/.make.state.i386
+usr/src/cmd/sgs/librtld/.make.state.i386
+usr/src/cmd/sgs/librtld/amd64/.make.state.i386
+usr/src/cmd/sgs/librtld/amd64/msg.c
+usr/src/cmd/sgs/librtld/amd64/msg.h
+usr/src/cmd/sgs/librtld/i386/.make.state.i386
+usr/src/cmd/sgs/librtld/i386/msg.c
+usr/src/cmd/sgs/librtld/i386/msg.h
+usr/src/cmd/sgs/librtld_db/.make.state.i386
+usr/src/cmd/sgs/librtld_db/amd64/.make.state.i386
+usr/src/cmd/sgs/librtld_db/amd64/lint.out.1
+usr/src/cmd/sgs/librtld_db/amd64/llib-lrtld_db.ln
+usr/src/cmd/sgs/librtld_db/amd64/msg.c
+usr/src/cmd/sgs/librtld_db/amd64/msg.h
+usr/src/cmd/sgs/librtld_db/demo/Makefile.com.demo
+usr/src/cmd/sgs/librtld_db/demo/Makefile.targ.demo
+usr/src/cmd/sgs/librtld_db/demo/amd64/Makefile.demo
+usr/src/cmd/sgs/librtld_db/demo/i386/Makefile.demo
+usr/src/cmd/sgs/librtld_db/demo/sparc/Makefile.demo
+usr/src/cmd/sgs/librtld_db/demo/sparcv9/Makefile.demo
+usr/src/cmd/sgs/librtld_db/i386/.make.state.i386
+usr/src/cmd/sgs/librtld_db/i386/lint.out.1
+usr/src/cmd/sgs/librtld_db/i386/llib-lrtld_db.ln
+usr/src/cmd/sgs/librtld_db/i386/msg.c
+usr/src/cmd/sgs/librtld_db/i386/msg.h
+usr/src/cmd/sgs/link_audit/amd64/.make.state.i386
+usr/src/cmd/sgs/link_audit/amd64/perfcnt
+usr/src/cmd/sgs/link_audit/amd64/symbindrep
+usr/src/cmd/sgs/link_audit/i386/.make.state.i386
+usr/src/cmd/sgs/link_audit/i386/dumpbind
+usr/src/cmd/sgs/link_audit/i386/perfcnt
+usr/src/cmd/sgs/link_audit/i386/sotruss
+usr/src/cmd/sgs/link_audit/i386/symbindrep
+usr/src/cmd/sgs/link_audit/i386/whocalls
+usr/src/cmd/sgs/lorder/.make.state.i386
+usr/src/cmd/sgs/lorder/lorder
+usr/src/cmd/sgs/m4/common/m4y.c
+usr/src/cmd/sgs/m4/common/m4y_xpg4.c
+usr/src/cmd/sgs/m4/i386/m4
+usr/src/cmd/sgs/m4/i386/m4.xpg4
+usr/src/cmd/sgs/mcs/.make.state.i386
+usr/src/cmd/sgs/mcs/amd64/.make.state.i386
+usr/src/cmd/sgs/mcs/amd64/mcs
+usr/src/cmd/sgs/mcs/i386/.make.state.i386
+usr/src/cmd/sgs/mcs/i386/mcs
+usr/src/cmd/sgs/messages/.make.state.i386
+usr/src/cmd/sgs/messages/i386/.make.state.i386
+usr/src/cmd/sgs/messages/i386/ar
+usr/src/cmd/sgs/messages/i386/crle
+usr/src/cmd/sgs/messages/i386/elfdump
+usr/src/cmd/sgs/messages/i386/elfedit
+usr/src/cmd/sgs/messages/i386/elfedit_cap
+usr/src/cmd/sgs/messages/i386/elfedit_dyn
+usr/src/cmd/sgs/messages/i386/elfedit_ehdr
+usr/src/cmd/sgs/messages/i386/elfedit_phdr
+usr/src/cmd/sgs/messages/i386/elfedit_shdr
+usr/src/cmd/sgs/messages/i386/elfedit_str
+usr/src/cmd/sgs/messages/i386/elfedit_sym
+usr/src/cmd/sgs/messages/i386/elfedit_syminfo
+usr/src/cmd/sgs/messages/i386/elfwrap
+usr/src/cmd/sgs/messages/i386/lari
+usr/src/cmd/sgs/messages/i386/ld
+usr/src/cmd/sgs/messages/i386/ldd
+usr/src/cmd/sgs/messages/i386/ldprof
+usr/src/cmd/sgs/messages/i386/libcrle
+usr/src/cmd/sgs/messages/i386/libelf
+usr/src/cmd/sgs/messages/i386/libld
+usr/src/cmd/sgs/messages/i386/liblddbg
+usr/src/cmd/sgs/messages/i386/librtld
+usr/src/cmd/sgs/messages/i386/moe
+usr/src/cmd/sgs/messages/i386/pvs
+usr/src/cmd/sgs/messages/i386/rtld
+usr/src/cmd/sgs/moe/.make.state.i386
+usr/src/cmd/sgs/moe/amd64/.make.state.i386
+usr/src/cmd/sgs/moe/amd64/moe
+usr/src/cmd/sgs/moe/amd64/msg.c
+usr/src/cmd/sgs/moe/amd64/msg.h
+usr/src/cmd/sgs/moe/i386/.make.state.i386
+usr/src/cmd/sgs/moe/i386/moe
+usr/src/cmd/sgs/moe/i386/msg.c
+usr/src/cmd/sgs/moe/i386/msg.h
+usr/src/cmd/sgs/nm/amd64/.make.state.i386
+usr/src/cmd/sgs/nm/amd64/nm
+usr/src/cmd/sgs/nm/i386/.make.state.i386
+usr/src/cmd/sgs/nm/i386/nm
+usr/src/cmd/sgs/nm/i386/nm.xpg4
+usr/src/cmd/sgs/prof/i386/.make.state.i386
+usr/src/cmd/sgs/prof/i386/prof
+usr/src/cmd/sgs/proto/
+usr/src/cmd/sgs/pvs/.make.state.i386
+usr/src/cmd/sgs/pvs/amd64/.make.state.i386
+usr/src/cmd/sgs/pvs/amd64/msg.c
+usr/src/cmd/sgs/pvs/amd64/msg.h
+usr/src/cmd/sgs/pvs/amd64/pvs
+usr/src/cmd/sgs/pvs/i386/.make.state.i386
+usr/src/cmd/sgs/pvs/i386/msg.c
+usr/src/cmd/sgs/pvs/i386/msg.h
+usr/src/cmd/sgs/pvs/i386/pvs
+usr/src/cmd/sgs/ranlib/ranlib
+usr/src/cmd/sgs/rtld/.make.state.i386
+usr/src/cmd/sgs/rtld/amd64/.make.state.i386
+usr/src/cmd/sgs/rtld/amd64/msg.c
+usr/src/cmd/sgs/rtld/amd64/msg.h
+usr/src/cmd/sgs/rtld/i386/.make.state.i386
+usr/src/cmd/sgs/rtld/i386/msg.c
+usr/src/cmd/sgs/rtld/i386/msg.h
+usr/src/cmd/sgs/rtld/mdbmod/.make.state.i386
+usr/src/cmd/sgs/rtld/mdbmod/amd64/.make.state.i386
+usr/src/cmd/sgs/rtld/mdbmod/amd64/msg.c
+usr/src/cmd/sgs/rtld/mdbmod/amd64/msg.h
+usr/src/cmd/sgs/rtld/mdbmod/i386/.make.state.i386
+usr/src/cmd/sgs/rtld/mdbmod/i386/msg.c
+usr/src/cmd/sgs/rtld/mdbmod/i386/msg.h
+usr/src/cmd/sgs/size/amd64/.make.state.i386
+usr/src/cmd/sgs/size/amd64/size
+usr/src/cmd/sgs/size/i386/.make.state.i386
+usr/src/cmd/sgs/size/i386/size
+usr/src/cmd/sgs/symorder/symorder
+usr/src/cmd/sgs/tools/i386/.make.state.i386
+usr/src/cmd/sgs/tools/i386/piglatin
+usr/src/cmd/sgs/tools/i386/sgsmsg
+usr/src/cmd/sgs/tsort/i386/tsort
+usr/src/cmd/sgs/unifdef/i386/unifdef
+usr/src/cmd/sgs/yacc/amd64/llib-ly.ln
+usr/src/cmd/sgs/yacc/i386/llib-ly.ln
+usr/src/cmd/sgs/yacc/i386/yacc
+usr/src/cmd/sh/sh
+usr/src/cmd/shcomp/shcomp
+usr/src/cmd/smbios/smbios
+usr/src/cmd/smserverd/rpc.smserverd
+usr/src/cmd/smserverd/smed.h
+usr/src/cmd/smserverd/smed_svc.c
+usr/src/cmd/smserverd/smed_xdr.c
+usr/src/cmd/soelim/soelim
+usr/src/cmd/sort/amd64/sort
+usr/src/cmd/sort/amd64/sort.xpg4
+usr/src/cmd/sort/i386/sort
+usr/src/cmd/sort/i386/sort.xpg4
+usr/src/cmd/spell/compress
+usr/src/cmd/spell/hashcheck
+usr/src/cmd/spell/hashmake
+usr/src/cmd/spell/hashmk1
+usr/src/cmd/spell/hlista
+usr/src/cmd/spell/hlistb
+usr/src/cmd/spell/hstop
+usr/src/cmd/spell/htemp1
+usr/src/cmd/spell/spell
+usr/src/cmd/spell/spellhist
+usr/src/cmd/spell/spellin
+usr/src/cmd/spell/spellin1
+usr/src/cmd/spell/spellprog
+usr/src/cmd/split/split
+usr/src/cmd/sqlite/sqlite
+usr/src/cmd/srchtxt/srchtxt
+usr/src/cmd/srptadm/srptadm
+usr/src/cmd/srptsvc/svc-srpt
+usr/src/cmd/ssh/THIRDPARTYLICENSE
+usr/src/cmd/ssh/libopenbsd-compat/i386/lint.out
+usr/src/cmd/ssh/libopenbsd-compat/i386/llib-lopenbsd-compat.ln
+usr/src/cmd/ssh/libssh/i386/lint.out
+usr/src/cmd/ssh/libssh/i386/llib-lssh.ln
+usr/src/cmd/ssh/scp/scp
+usr/src/cmd/ssh/sftp-server/sftp-server
+usr/src/cmd/ssh/sftp/sftp
+usr/src/cmd/ssh/ssh-add/ssh-add
+usr/src/cmd/ssh/ssh-agent/ssh-agent
+usr/src/cmd/ssh/ssh-http-proxy-connect/ssh-http-proxy-connect
+usr/src/cmd/ssh/ssh-keygen/ssh-keygen
+usr/src/cmd/ssh/ssh-keyscan/ssh-keyscan
+usr/src/cmd/ssh/ssh-keysign/ssh-keysign
+usr/src/cmd/ssh/ssh-socks5-proxy-connect/ssh-socks5-proxy-connect
+usr/src/cmd/ssh/ssh/ssh
+usr/src/cmd/ssh/sshd/sshd
+usr/src/cmd/stat/arcstat/arcstat
+usr/src/cmd/stat/fsstat/fsstat
+usr/src/cmd/stat/iostat/iostat
+usr/src/cmd/stat/mpstat/mpstat
+usr/src/cmd/stat/vfsstat/vfsstat
+usr/src/cmd/stat/vmstat/vmstat
+usr/src/cmd/stat/ziostat/ziostat
+usr/src/cmd/stmfadm/stmfadm
+usr/src/cmd/stmfproxy/aluaadm/aluaadm
+usr/src/cmd/stmfproxy/stmfproxy/svc-stmfproxy
+usr/src/cmd/stmfsvc/svc-stmf
+usr/src/cmd/stmsboot/stmsboot
+usr/src/cmd/stmsboot/stmsboot_util
+usr/src/cmd/streams/log/strace
+usr/src/cmd/streams/log/strclean
+usr/src/cmd/streams/log/strerr
+usr/src/cmd/streams/strcmd/strchg
+usr/src/cmd/streams/strcmd/strconf
+usr/src/cmd/strings/amd64/strings
+usr/src/cmd/strings/i386/strings
+usr/src/cmd/su/embedded_su
+usr/src/cmd/su/su
+usr/src/cmd/su/su.static
+usr/src/cmd/sulogin/sulogin
+usr/src/cmd/sunpc/other/dos2unix
+usr/src/cmd/sunpc/other/unix2dos
+usr/src/cmd/svc/configd/svc.configd
+usr/src/cmd/svc/configd/svc.configd-native
+usr/src/cmd/svc/lsvcrun/lsvcrun
+usr/src/cmd/svc/mfstscan/mfstscan
+usr/src/cmd/svc/milestone/console-login.xml
+usr/src/cmd/svc/profile/check_limited
+usr/src/cmd/svc/profile/check_limited.all
+usr/src/cmd/svc/profile/check_limited.enabled
+usr/src/cmd/svc/profile/check_limited.notcovered
+usr/src/cmd/svc/profile/check_open
+usr/src/cmd/svc/profile/check_open.all
+usr/src/cmd/svc/profile/check_open.enabled
+usr/src/cmd/svc/profile/check_open.notcovered
+usr/src/cmd/svc/seed/common.db
+usr/src/cmd/svc/seed/global.db
+usr/src/cmd/svc/seed/miniroot.db
+usr/src/cmd/svc/seed/nonglobal.db
+usr/src/cmd/svc/servinfo/servinfo
+usr/src/cmd/svc/startd/svc.startd
+usr/src/cmd/svc/svcadm/svcadm
+usr/src/cmd/svc/svccfg/svccfg
+usr/src/cmd/svc/svccfg/svccfg-native
+usr/src/cmd/svc/svccfg/svccfg_grammar.c
+usr/src/cmd/svc/svccfg/svccfg_grammar.h
+usr/src/cmd/svc/svccfg/svccfg_lex.c
+usr/src/cmd/svc/svcprop/svcprop
+usr/src/cmd/svc/svcs/svcs
+usr/src/cmd/svr4pkg/installf/dofinal.i
+usr/src/cmd/svr4pkg/installf/installf
+usr/src/cmd/svr4pkg/installf/installf.i
+usr/src/cmd/svr4pkg/installf/main.i
+usr/src/cmd/svr4pkg/installf/removef.i
+usr/src/cmd/svr4pkg/libinst/copyf.i
+usr/src/cmd/svr4pkg/libinst/cvtpath.i
+usr/src/cmd/svr4pkg/libinst/depchk.i
+usr/src/cmd/svr4pkg/libinst/dockdeps.i
+usr/src/cmd/svr4pkg/libinst/doulimit.i
+usr/src/cmd/svr4pkg/libinst/dryrun.i
+usr/src/cmd/svr4pkg/libinst/echo.i
+usr/src/cmd/svr4pkg/libinst/eptstat.i
+usr/src/cmd/svr4pkg/libinst/finalck.i
+usr/src/cmd/svr4pkg/libinst/findscripts.i
+usr/src/cmd/svr4pkg/libinst/fixpath.i
+usr/src/cmd/svr4pkg/libinst/flex_dev.i
+usr/src/cmd/svr4pkg/libinst/is_local_host.i
+usr/src/cmd/svr4pkg/libinst/isreloc.i
+usr/src/cmd/svr4pkg/libinst/listmgr.i
+usr/src/cmd/svr4pkg/libinst/lockinst.i
+usr/src/cmd/svr4pkg/libinst/log.i
+usr/src/cmd/svr4pkg/libinst/mntinfo.i
+usr/src/cmd/svr4pkg/libinst/nblk.i
+usr/src/cmd/svr4pkg/libinst/ocfile.i
+usr/src/cmd/svr4pkg/libinst/open_package_datastream.i
+usr/src/cmd/svr4pkg/libinst/pathdup.i
+usr/src/cmd/svr4pkg/libinst/pkgdbmerg.i
+usr/src/cmd/svr4pkg/libinst/pkgobjmap.i
+usr/src/cmd/svr4pkg/libinst/pkgops.i
+usr/src/cmd/svr4pkg/libinst/procmap.i
+usr/src/cmd/svr4pkg/libinst/ptext.i
+usr/src/cmd/svr4pkg/libinst/putparam.i
+usr/src/cmd/svr4pkg/libinst/qreason.i
+usr/src/cmd/svr4pkg/libinst/qstrdup.i
+usr/src/cmd/svr4pkg/libinst/scriptvfy.i
+usr/src/cmd/svr4pkg/libinst/setadmin.i
+usr/src/cmd/svr4pkg/libinst/setlist.i
+usr/src/cmd/svr4pkg/libinst/setup_temporary_directory.i
+usr/src/cmd/svr4pkg/libinst/sml.i
+usr/src/cmd/svr4pkg/libinst/srcpath.i
+usr/src/cmd/svr4pkg/libinst/stub.i
+usr/src/cmd/svr4pkg/libinst/unpack_package_from_stream.i
+usr/src/cmd/svr4pkg/pkgadd/check.i
+usr/src/cmd/svr4pkg/pkgadd/main.i
+usr/src/cmd/svr4pkg/pkgadd/pkgadd
+usr/src/cmd/svr4pkg/pkgadd/quit.i
+usr/src/cmd/svr4pkg/pkgadm/addcert.i
+usr/src/cmd/svr4pkg/pkgadm/certs.i
+usr/src/cmd/svr4pkg/pkgadm/listcert.i
+usr/src/cmd/svr4pkg/pkgadm/lock.i
+usr/src/cmd/svr4pkg/pkgadm/main.i
+usr/src/cmd/svr4pkg/pkgadm/pkgadm
+usr/src/cmd/svr4pkg/pkgadm/removecert.i
+usr/src/cmd/svr4pkg/pkgchk/checkmap.i
+usr/src/cmd/svr4pkg/pkgchk/ckentry.i
+usr/src/cmd/svr4pkg/pkgchk/main.i
+usr/src/cmd/svr4pkg/pkgchk/pkgchk
+usr/src/cmd/svr4pkg/pkgcond/main.i
+usr/src/cmd/svr4pkg/pkgcond/pkgcond
+usr/src/cmd/svr4pkg/pkginfo/pkginfo
+usr/src/cmd/svr4pkg/pkginfo/pkginfo.i
+usr/src/cmd/svr4pkg/pkginstall/backup.i
+usr/src/cmd/svr4pkg/pkginstall/check.i
+usr/src/cmd/svr4pkg/pkginstall/cppath.i
+usr/src/cmd/svr4pkg/pkginstall/dockspace.i
+usr/src/cmd/svr4pkg/pkginstall/getinst.i
+usr/src/cmd/svr4pkg/pkginstall/instvol.i
+usr/src/cmd/svr4pkg/pkginstall/main.i
+usr/src/cmd/svr4pkg/pkginstall/merginfo.i
+usr/src/cmd/svr4pkg/pkginstall/pkgenv.i
+usr/src/cmd/svr4pkg/pkginstall/pkginstall
+usr/src/cmd/svr4pkg/pkginstall/pkgvolume.i
+usr/src/cmd/svr4pkg/pkginstall/quit.i
+usr/src/cmd/svr4pkg/pkginstall/reqexec.i
+usr/src/cmd/svr4pkg/pkginstall/sortmap.i
+usr/src/cmd/svr4pkg/pkgmk/main.i
+usr/src/cmd/svr4pkg/pkgmk/mkpkgmap.i
+usr/src/cmd/svr4pkg/pkgmk/pkgmk
+usr/src/cmd/svr4pkg/pkgmk/quit.i
+usr/src/cmd/svr4pkg/pkgmk/splpkgmap.i
+usr/src/cmd/svr4pkg/pkgname/pkgname
+usr/src/cmd/svr4pkg/pkgname/pkgname.i
+usr/src/cmd/svr4pkg/pkgparam/pkgparam
+usr/src/cmd/svr4pkg/pkgparam/pkgparam.i
+usr/src/cmd/svr4pkg/pkgproto/main.i
+usr/src/cmd/svr4pkg/pkgproto/pkgproto
+usr/src/cmd/svr4pkg/pkgremove/check.i
+usr/src/cmd/svr4pkg/pkgremove/delmap.i
+usr/src/cmd/svr4pkg/pkgremove/main.i
+usr/src/cmd/svr4pkg/pkgremove/pkgremove
+usr/src/cmd/svr4pkg/pkgremove/quit.i
+usr/src/cmd/svr4pkg/pkgremove/special.i
+usr/src/cmd/svr4pkg/pkgrm/check.i
+usr/src/cmd/svr4pkg/pkgrm/main.i
+usr/src/cmd/svr4pkg/pkgrm/pkgrm
+usr/src/cmd/svr4pkg/pkgrm/quit.i
+usr/src/cmd/svr4pkg/pkgscripts/cmdexec
+usr/src/cmd/svr4pkg/pkgscripts/cmdexec.i
+usr/src/cmd/svr4pkg/pkgscripts/i.CompCpio
+usr/src/cmd/svr4pkg/pkgscripts/i.awk
+usr/src/cmd/svr4pkg/pkgscripts/i.build
+usr/src/cmd/svr4pkg/pkgscripts/i.preserve
+usr/src/cmd/svr4pkg/pkgscripts/i.sed
+usr/src/cmd/svr4pkg/pkgscripts/r.awk
+usr/src/cmd/svr4pkg/pkgscripts/r.build
+usr/src/cmd/svr4pkg/pkgscripts/r.sed
+usr/src/cmd/svr4pkg/pkgserv/pkgserv
+usr/src/cmd/svr4pkg/pkgserv/pkgserv.i
+usr/src/cmd/svr4pkg/pkgtrans/main.i
+usr/src/cmd/svr4pkg/pkgtrans/pkgtrans
+usr/src/cmd/swap/amd64/swap
+usr/src/cmd/swap/i386/swap
+usr/src/cmd/sync/sync
+usr/src/cmd/sysdef/amd64/sysdef
+usr/src/cmd/sysdef/i386/sysdef
+usr/src/cmd/syseventadm/syseventadm
+usr/src/cmd/syseventd/daemons/syseventconfd/syseventconfd
+usr/src/cmd/syseventd/daemons/syseventd/syseventd
+usr/src/cmd/syslogd/i386/authlog
+usr/src/cmd/syslogd/i386/syslog
+usr/src/cmd/syslogd/i386/syslogd
+usr/src/cmd/tabs/tabs
+usr/src/cmd/tail/tail
+usr/src/cmd/tar/tar
+usr/src/cmd/tar/tar.dc
+usr/src/cmd/tbl/tbl
+usr/src/cmd/tcopy/tcopy
+usr/src/cmd/tcpd/THIRDPARTYLICENSE
+usr/src/cmd/tcpd/safe_finger
+usr/src/cmd/tcpd/sunman/
+usr/src/cmd/tcpd/tcpd
+usr/src/cmd/tcpd/tcpdchk
+usr/src/cmd/tcpd/tcpdmatch
+usr/src/cmd/tcpd/try-from
+usr/src/cmd/terminfo/errs
+usr/src/cmd/terminfo/terminfo.src
+usr/src/cmd/th_tools/th_define
+usr/src/cmd/th_tools/th_manage
+usr/src/cmd/th_tools/th_script
+usr/src/cmd/tic/tic
+usr/src/cmd/time/time
+usr/src/cmd/tip/aculog
+usr/src/cmd/tip/tip
+usr/src/cmd/tnf/prex/amd64/prex
+usr/src/cmd/tnf/prex/amd64/prexgram.c
+usr/src/cmd/tnf/prex/amd64/prexlex.c
+usr/src/cmd/tnf/prex/amd64/y.tab.h
+usr/src/cmd/tnf/prex/i386/prex
+usr/src/cmd/tnf/prex/i386/prexgram.c
+usr/src/cmd/tnf/prex/i386/prexlex.c
+usr/src/cmd/tnf/prex/i386/y.tab.h
+usr/src/cmd/tnf/tnfdump/tnfdump
+usr/src/cmd/tnf/tnfxtract/amd64/tnfxtract
+usr/src/cmd/tnf/tnfxtract/i386/tnfxtract
+usr/src/cmd/touch/touch
+usr/src/cmd/tput/tput
+usr/src/cmd/tr/tr
+usr/src/cmd/troff/nroff.d/nroff
+usr/src/cmd/troff/nroff.d/terms.d/tab.2631
+usr/src/cmd/troff/nroff.d/terms.d/tab.2631-c
+usr/src/cmd/troff/nroff.d/terms.d/tab.2631-e
+usr/src/cmd/troff/nroff.d/terms.d/tab.300
+usr/src/cmd/troff/nroff.d/terms.d/tab.300-12
+usr/src/cmd/troff/nroff.d/terms.d/tab.300s
+usr/src/cmd/troff/nroff.d/terms.d/tab.300s-12
+usr/src/cmd/troff/nroff.d/terms.d/tab.37
+usr/src/cmd/troff/nroff.d/terms.d/tab.382
+usr/src/cmd/troff/nroff.d/terms.d/tab.4000a
+usr/src/cmd/troff/nroff.d/terms.d/tab.450
+usr/src/cmd/troff/nroff.d/terms.d/tab.450-12
+usr/src/cmd/troff/nroff.d/terms.d/tab.832
+usr/src/cmd/troff/nroff.d/terms.d/tab.8510
+usr/src/cmd/troff/nroff.d/terms.d/tab.X
+usr/src/cmd/troff/nroff.d/terms.d/tab.lp
+usr/src/cmd/troff/nroff.d/terms.d/tab.tn300
+usr/src/cmd/troff/troff.d/makedev
+usr/src/cmd/troff/troff.d/ta
+usr/src/cmd/troff/troff.d/troff
+usr/src/cmd/true/true
+usr/src/cmd/truss/amd64/truss
+usr/src/cmd/truss/i386/truss
+usr/src/cmd/tsol/atohexlabel/atohexlabel
+usr/src/cmd/tsol/getlabel/getlabel
+usr/src/cmd/tsol/getzonepath/getzonepath
+usr/src/cmd/tsol/hextoalabel/hextoalabel
+usr/src/cmd/tsol/lslabels/lslabels
+usr/src/cmd/tsol/misc/relabel
+usr/src/cmd/tsol/misc/txzonemgr
+usr/src/cmd/tsol/plabel/plabel
+usr/src/cmd/tsol/setlabel/setlabel
+usr/src/cmd/tsol/tnchkdb/tnchkdb
+usr/src/cmd/tsol/tnctl/tnctl
+usr/src/cmd/tsol/tnd/tnd
+usr/src/cmd/tsol/tninfo/tninfo
+usr/src/cmd/tsol/updatehome/updatehome
+usr/src/cmd/tsol/zones/zoneshare
+usr/src/cmd/tsol/zones/zoneunshare
+usr/src/cmd/tty/tty
+usr/src/cmd/ttymon/stty
+usr/src/cmd/ttymon/stty.xpg4
+usr/src/cmd/ttymon/sttydefs
+usr/src/cmd/ttymon/ttyadm
+usr/src/cmd/ttymon/ttymon
+usr/src/cmd/tzreload/tzreload
+usr/src/cmd/uadmin/uadmin
+usr/src/cmd/ucodeadm/ucode_errno.c
+usr/src/cmd/ucodeadm/ucodeadm
+usr/src/cmd/ul/ul
+usr/src/cmd/uname/uname
+usr/src/cmd/units/units
+usr/src/cmd/unlink/unlink
+usr/src/cmd/unpack/unpack
+usr/src/cmd/userattr/userattr
+usr/src/cmd/users/listusers
+usr/src/cmd/utmp_update/utmp_update
+usr/src/cmd/utmpd/utmpd
+usr/src/cmd/valtools/ckdate
+usr/src/cmd/valtools/ckgid
+usr/src/cmd/valtools/ckint
+usr/src/cmd/valtools/ckitem
+usr/src/cmd/valtools/ckkeywd
+usr/src/cmd/valtools/ckpath
+usr/src/cmd/valtools/ckrange
+usr/src/cmd/valtools/ckstr
+usr/src/cmd/valtools/cktime
+usr/src/cmd/valtools/ckuid
+usr/src/cmd/valtools/ckyorn
+usr/src/cmd/valtools/puttext
+usr/src/cmd/vgrind/vfontedpr
+usr/src/cmd/vgrind/vgrind
+usr/src/cmd/vgrind/vgrindefs
+usr/src/cmd/vi/misc/ctags
+usr/src/cmd/vi/misc/ctags.xpg4
+usr/src/cmd/vi/misc/cxref
+usr/src/cmd/vi/misc/fold
+usr/src/cmd/vi/port/ex
+usr/src/cmd/vi/port/ex.xpg4
+usr/src/cmd/vi/port/ex.xpg6
+usr/src/cmd/vi/port/expreserve
+usr/src/cmd/vi/port/exrecover
+usr/src/cmd/volcheck/volcheck
+usr/src/cmd/volrmmount/volrmmount
+usr/src/cmd/vrrpadm/vrrpadm
+usr/src/cmd/vscan/vscanadm/vscanadm
+usr/src/cmd/vscan/vscand/vscand
+usr/src/cmd/vt/vtdaemon
+usr/src/cmd/vt/vtinfo
+usr/src/cmd/vt/vtxlock
+usr/src/cmd/w/amd64/w
+usr/src/cmd/w/i386/w
+usr/src/cmd/w/w.dc
+usr/src/cmd/wall/wall
+usr/src/cmd/which/which
+usr/src/cmd/who/utmpx
+usr/src/cmd/who/who
+usr/src/cmd/who/who.dc
+usr/src/cmd/who/who.xpg4
+usr/src/cmd/whodo/amd64/whodo
+usr/src/cmd/whodo/i386/whodo
+usr/src/cmd/whodo/whodo.dc
+usr/src/cmd/wracct/wracct
+usr/src/cmd/write/write
+usr/src/cmd/write/write.dc
+usr/src/cmd/wusbadm/wusbadm
+usr/src/cmd/xargs/xargs
+usr/src/cmd/xstr/xstr
+usr/src/cmd/xvm/ipagent/ipagent
+usr/src/cmd/yes/yes
+usr/src/cmd/ypcmd/makedbm
+usr/src/cmd/ypcmd/mkalias
+usr/src/cmd/ypcmd/mknetid/mknetid
+usr/src/cmd/ypcmd/multi
+usr/src/cmd/ypcmd/multi.awk
+usr/src/cmd/ypcmd/revnetgroup/revnetgroup
+usr/src/cmd/ypcmd/stdethers
+usr/src/cmd/ypcmd/stdhosts
+usr/src/cmd/ypcmd/udpublickey
+usr/src/cmd/ypcmd/yp
+usr/src/cmd/ypcmd/yp2lscripts/inityp2l
+usr/src/cmd/ypcmd/yp2lscripts/ypmap2src
+usr/src/cmd/ypcmd/ypalias
+usr/src/cmd/ypcmd/ypbind
+usr/src/cmd/ypcmd/ypcat
+usr/src/cmd/ypcmd/ypinit
+usr/src/cmd/ypcmd/ypmatch
+usr/src/cmd/ypcmd/yppasswd/rpc.yppasswdd
+usr/src/cmd/ypcmd/yppoll
+usr/src/cmd/ypcmd/yppush
+usr/src/cmd/ypcmd/ypserv
+usr/src/cmd/ypcmd/ypset
+usr/src/cmd/ypcmd/ypstart
+usr/src/cmd/ypcmd/ypstop
+usr/src/cmd/ypcmd/ypupdated/rpc.ypupdated
+usr/src/cmd/ypcmd/ypupdated/ypupdated_prot.h
+usr/src/cmd/ypcmd/ypwhich
+usr/src/cmd/ypcmd/ypxfr
+usr/src/cmd/ypcmd/ypxfr_1perday
+usr/src/cmd/ypcmd/ypxfr_1perhour
+usr/src/cmd/ypcmd/ypxfr_2perday
+usr/src/cmd/ypcmd/ypxfrd
+usr/src/cmd/ypcmd/ypxfrd.h
+usr/src/cmd/ypcmd/ypxfrd_xdr.c
+usr/src/cmd/yppasswd/yppasswd
+usr/src/cmd/zdb/amd64/zdb
+usr/src/cmd/zdb/i386/zdb
+usr/src/cmd/zdump/zdump
+usr/src/cmd/zfs/zfs
+usr/src/cmd/zic/native/
+usr/src/cmd/zic/tzselect
+usr/src/cmd/zic/zic
+usr/src/cmd/zinject/amd64/zinject
+usr/src/cmd/zinject/i386/zinject
+usr/src/cmd/zlogin/zlogin
+usr/src/cmd/zlook/amd64/zlook
+usr/src/cmd/zlook/i386/zlook
+usr/src/cmd/zoneadm/zoneadm
+usr/src/cmd/zoneadm/zonemon
+usr/src/cmd/zoneadmd/zoneadmd
+usr/src/cmd/zonecfg/zonecfg
+usr/src/cmd/zonecfg/zonecfg_grammar.tab.c
+usr/src/cmd/zonecfg/zonecfg_grammar.tab.h
+usr/src/cmd/zonecfg/zonecfg_lex.c
+usr/src/cmd/zonename/zonename
+usr/src/cmd/zonestat/zonestat/zonestat
+usr/src/cmd/zonestat/zonestatd/zonestatd
+usr/src/cmd/zpool/zpool
+usr/src/cmd/zstreamdump/zstreamdump
+usr/src/cmd/ztest/amd64/ztest
+usr/src/cmd/ztest/i386/ztest
+usr/src/common/mapfiles/gen/amd64_cc_map.noexeglobs
+usr/src/common/mapfiles/gen/amd64_gcc_map.noexeglobs
+usr/src/common/mapfiles/gen/i386_cc_map.noexeglobs
+usr/src/common/mapfiles/gen/i386_gcc_map.noexeglobs
+usr/src/grub/grub-0.97/grub/grub
+usr/src/grub/grub-0.97/stage1/stage1
+usr/src/grub/grub-0.97/stage1/stage1.exec
+usr/src/grub/grub-0.97/stage2/diskless
+usr/src/grub/grub-0.97/stage2/diskless.exec
+usr/src/grub/grub-0.97/stage2/diskless_size.h
+usr/src/grub/grub-0.97/stage2/e2fs_stage1_5
+usr/src/grub/grub-0.97/stage2/e2fs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/fat_stage1_5
+usr/src/grub/grub-0.97/stage2/fat_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/ffs_stage1_5
+usr/src/grub/grub-0.97/stage2/ffs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/iso9660_stage1_5
+usr/src/grub/grub-0.97/stage2/iso9660_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/jfs_stage1_5
+usr/src/grub/grub-0.97/stage2/jfs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/minix_stage1_5
+usr/src/grub/grub-0.97/stage2/minix_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/nbgrub
+usr/src/grub/grub-0.97/stage2/nbloader
+usr/src/grub/grub-0.97/stage2/nbloader.exec
+usr/src/grub/grub-0.97/stage2/pre_stage2
+usr/src/grub/grub-0.97/stage2/pre_stage2.exec
+usr/src/grub/grub-0.97/stage2/pxegrub
+usr/src/grub/grub-0.97/stage2/pxeloader
+usr/src/grub/grub-0.97/stage2/pxeloader.exec
+usr/src/grub/grub-0.97/stage2/reiserfs_stage1_5
+usr/src/grub/grub-0.97/stage2/reiserfs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/stage2
+usr/src/grub/grub-0.97/stage2/stage2_eltorito
+usr/src/grub/grub-0.97/stage2/stage2_size.h
+usr/src/grub/grub-0.97/stage2/start
+usr/src/grub/grub-0.97/stage2/start.exec
+usr/src/grub/grub-0.97/stage2/start_eltorito
+usr/src/grub/grub-0.97/stage2/start_eltorito.exec
+usr/src/grub/grub-0.97/stage2/ufs2_stage1_5
+usr/src/grub/grub-0.97/stage2/ufs2_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/ufs_stage1_5
+usr/src/grub/grub-0.97/stage2/ufs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/vstafs_stage1_5
+usr/src/grub/grub-0.97/stage2/vstafs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/xfs_stage1_5
+usr/src/grub/grub-0.97/stage2/xfs_stage1_5.exec
+usr/src/grub/grub-0.97/stage2/zfs_stage1_5
+usr/src/grub/grub-0.97/stage2/zfs_stage1_5.exec
+usr/src/head/mdiox.h
+usr/src/head/meta_basic.h
+usr/src/head/metacl.h
+usr/src/head/metad.h
+usr/src/head/metamed.h
+usr/src/head/metamhd.h
+usr/src/head/mhdx.h
+usr/src/head/rpcsvc/bootparam_prot.h
+usr/src/head/rpcsvc/mount.h
+usr/src/head/rpcsvc/nfs4_prot.h
+usr/src/head/rpcsvc/nfs_acl.h
+usr/src/head/rpcsvc/nfs_prot.c
+usr/src/head/rpcsvc/nfs_prot.h
+usr/src/head/rpcsvc/nis.h
+usr/src/head/rpcsvc/nlm_prot.h
+usr/src/head/rpcsvc/rex.h
+usr/src/head/rpcsvc/rquota.h
+usr/src/head/rpcsvc/rstat.h
+usr/src/head/rpcsvc/rusers.h
+usr/src/head/rpcsvc/rwall.h
+usr/src/head/rpcsvc/spray.h
+usr/src/head/rpcsvc/ufs_prot.h
+usr/src/install-nd-i386.out
+usr/src/lib/abi/apptrace/common/abienv.i
+usr/src/lib/abi/apptrace/common/apptrace.i
+usr/src/lib/brand/joyent/zone/jattach
+usr/src/lib/brand/joyent/zone/jdetach
+usr/src/lib/brand/joyent/zone/jinstall
+usr/src/lib/brand/joyent/zone/juninstall
+usr/src/lib/brand/joyent/zone/pinstall
+usr/src/lib/brand/joyent/zone/poststate
+usr/src/lib/brand/joyent/zone/prestate
+usr/src/lib/brand/joyent/zone/query
+usr/src/lib/brand/joyent/zone/statechange
+usr/src/lib/brand/kvm/zone/kattach
+usr/src/lib/brand/kvm/zone/kdetach
+usr/src/lib/brand/kvm/zone/kinstall
+usr/src/lib/brand/kvm/zone/kuninstall
+usr/src/lib/brand/kvm/zone/pinstall
+usr/src/lib/brand/kvm/zone/poststate
+usr/src/lib/brand/kvm/zone/prestate
+usr/src/lib/brand/kvm/zone/statechange
+usr/src/lib/brand/shared/brand/amd64/assym.h
+usr/src/lib/brand/shared/brand/i386/assym.h
+usr/src/lib/brand/shared/zone/query
+usr/src/lib/brand/sn1/zone/sn1_boot
+usr/src/lib/brand/solaris10/cmd/s10_isaexec_wrapper
+usr/src/lib/brand/solaris10/cmd/s10_native
+usr/src/lib/brand/solaris10/cmd/s10_net_physical
+usr/src/lib/brand/solaris10/cmd/s10_python_wrapper
+usr/src/lib/brand/solaris10/s10_replacefile/s10_replacefile
+usr/src/lib/brand/solaris10/s10_support/s10_support
+usr/src/lib/brand/solaris10/zone/attach
+usr/src/lib/brand/solaris10/zone/clone
+usr/src/lib/brand/solaris10/zone/detach
+usr/src/lib/brand/solaris10/zone/image_install
+usr/src/lib/brand/solaris10/zone/p2v
+usr/src/lib/brand/solaris10/zone/postattach
+usr/src/lib/brand/solaris10/zone/poststate
+usr/src/lib/brand/solaris10/zone/prestate
+usr/src/lib/brand/solaris10/zone/preuninstall
+usr/src/lib/brand/solaris10/zone/s10_boot
+usr/src/lib/brand/solaris10/zone/uninstall
+usr/src/lib/c_synonyms/amd64/mapfile-vers
+usr/src/lib/c_synonyms/amd64/synonym_list
+usr/src/lib/c_synonyms/i386/mapfile-vers
+usr/src/lib/c_synonyms/i386/synonym_list
+usr/src/lib/cfgadm_plugins/sbd/common/ap_err.c
+usr/src/lib/cfgadm_plugins/sbd/sbdgenerr
+usr/src/lib/fm/libdiagcode/amd64/lint.out
+usr/src/lib/fm/libdiagcode/amd64/llib-ldiagcode.ln
+usr/src/lib/fm/libdiagcode/i386/lint.out
+usr/src/lib/fm/libdiagcode/i386/llib-ldiagcode.ln
+usr/src/lib/fm/libdiskstatus/amd64/lint.out
+usr/src/lib/fm/libdiskstatus/amd64/llib-ldiskstatus.ln
+usr/src/lib/fm/libdiskstatus/i386/lint.out
+usr/src/lib/fm/libdiskstatus/i386/llib-ldiskstatus.ln
+usr/src/lib/fm/libfmd_adm/amd64/fmd_rpc.c
+usr/src/lib/fm/libfmd_adm/amd64/fmd_rpc_adm.h
+usr/src/lib/fm/libfmd_adm/amd64/fmd_rpc_adm.x
+usr/src/lib/fm/libfmd_adm/amd64/fmd_xdr.c
+usr/src/lib/fm/libfmd_adm/amd64/lint.out
+usr/src/lib/fm/libfmd_adm/amd64/llib-lfmd_adm.ln
+usr/src/lib/fm/libfmd_adm/i386/fmd_rpc.c
+usr/src/lib/fm/libfmd_adm/i386/fmd_rpc_adm.h
+usr/src/lib/fm/libfmd_adm/i386/fmd_rpc_adm.x
+usr/src/lib/fm/libfmd_adm/i386/fmd_xdr.c
+usr/src/lib/fm/libfmd_adm/i386/lint.out
+usr/src/lib/fm/libfmd_adm/i386/llib-lfmd_adm.ln
+usr/src/lib/fm/libfmd_agent/amd64/lint.out
+usr/src/lib/fm/libfmd_agent/amd64/llib-lfmd_agent.ln
+usr/src/lib/fm/libfmd_agent/i386/lint.out
+usr/src/lib/fm/libfmd_agent/i386/llib-lfmd_agent.ln
+usr/src/lib/fm/libfmd_log/amd64/lint.out
+usr/src/lib/fm/libfmd_log/amd64/llib-lfmd_log.ln
+usr/src/lib/fm/libfmd_log/i386/lint.out
+usr/src/lib/fm/libfmd_log/i386/llib-lfmd_log.ln
+usr/src/lib/fm/libfmd_msg/amd64/lint.out
+usr/src/lib/fm/libfmd_msg/amd64/llib-lfmd_msg.ln
+usr/src/lib/fm/libfmd_msg/i386/lint.out
+usr/src/lib/fm/libfmd_msg/i386/llib-lfmd_msg.ln
+usr/src/lib/fm/libfmd_snmp/amd64/lint.out
+usr/src/lib/fm/libfmd_snmp/amd64/llib-lfmd_snmp.ln
+usr/src/lib/fm/libfmd_snmp/i386/lint.out
+usr/src/lib/fm/libfmd_snmp/i386/llib-lfmd_snmp.ln
+usr/src/lib/fm/libfmevent/amd64/lint.out
+usr/src/lib/fm/libfmevent/amd64/llib-lfmevent.ln
+usr/src/lib/fm/libfmevent/common/fmev_errstring.c
+usr/src/lib/fm/libfmevent/i386/lint.out
+usr/src/lib/fm/libfmevent/i386/llib-lfmevent.ln
+usr/src/lib/fm/libfmnotify/amd64/lint.out
+usr/src/lib/fm/libfmnotify/amd64/llib-lfmnotify.ln
+usr/src/lib/fm/libfmnotify/i386/lint.out
+usr/src/lib/fm/libfmnotify/i386/llib-lfmnotify.ln
+usr/src/lib/fm/libseslog/amd64/lint.out
+usr/src/lib/fm/libseslog/amd64/llib-lseslog.ln
+usr/src/lib/fm/libseslog/i386/lint.out
+usr/src/lib/fm/libseslog/i386/llib-lseslog.ln
+usr/src/lib/fm/topo/libtopo/amd64/lint.out
+usr/src/lib/fm/topo/libtopo/amd64/llib-ltopo.ln
+usr/src/lib/fm/topo/libtopo/common/topo_error.c
+usr/src/lib/fm/topo/libtopo/common/topo_tables.c
+usr/src/lib/fm/topo/libtopo/i386/lint.out
+usr/src/lib/fm/topo/libtopo/i386/llib-ltopo.ln
+usr/src/lib/fm/topo/maps/SUNW,Netra-X4200-M2/Netra-X4200-M2-disk-hc-topology.xml
+usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4200-M2/Sun-Fire-X4200-M2-disk-hc-topology.xml
+usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4200-Server/Sun-Fire-X4200-Server-disk-hc-topology.xml
+usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4500/Sun-Fire-X4500-disk-hc-topology.xml
+usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4540/Sun-Fire-X4540-disk-hc-topology.xml
+usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-X4600-M2/Sun-Fire-X4600-M2-disk-hc-topology.xml
+usr/src/lib/fm/topo/maps/i386/xfp-hc-topology.xml
+usr/src/lib/fm/topo/maps/i86pc/fan-hc-topology.xml
+usr/src/lib/gss_mechs/mech_dh/backend/mech/dhmech_prot.h
+usr/src/lib/gss_mechs/mech_dh/backend/mech/xdr_token.c
+usr/src/lib/gss_mechs/mech_krb5/amd64/kwarnd.h
+usr/src/lib/gss_mechs/mech_krb5/amd64/kwarnd_clnt.c
+usr/src/lib/gss_mechs/mech_krb5/amd64/kwarnd_clnt_stubs.c
+usr/src/lib/gss_mechs/mech_krb5/amd64/kwarnd_handle.c
+usr/src/lib/gss_mechs/mech_krb5/amd64/kwarnd_xdr.c
+usr/src/lib/gss_mechs/mech_krb5/i386/kwarnd.h
+usr/src/lib/gss_mechs/mech_krb5/i386/kwarnd_clnt.c
+usr/src/lib/gss_mechs/mech_krb5/i386/kwarnd_clnt_stubs.c
+usr/src/lib/gss_mechs/mech_krb5/i386/kwarnd_handle.c
+usr/src/lib/gss_mechs/mech_krb5/i386/kwarnd_xdr.c
+usr/src/lib/hal/libhal-storage/amd64/hal-storage.pc
+usr/src/lib/hal/libhal-storage/amd64/libhal-storage.so.1.0.0
+usr/src/lib/hal/libhal-storage/amd64/lint.out
+usr/src/lib/hal/libhal-storage/amd64/llib-lhal-storage.ln
+usr/src/lib/hal/libhal-storage/i386/hal-storage.pc
+usr/src/lib/hal/libhal-storage/i386/libhal-storage.so.1.0.0
+usr/src/lib/hal/libhal-storage/i386/lint.out
+usr/src/lib/hal/libhal-storage/i386/llib-lhal-storage.ln
+usr/src/lib/hal/libhal/amd64/hal.pc
+usr/src/lib/hal/libhal/amd64/libhal.so.1.0.0
+usr/src/lib/hal/libhal/amd64/lint.out
+usr/src/lib/hal/libhal/amd64/llib-lhal.ln
+usr/src/lib/hal/libhal/i386/hal.pc
+usr/src/lib/hal/libhal/i386/libhal.so.1.0.0
+usr/src/lib/hal/libhal/i386/lint.out
+usr/src/lib/hal/libhal/i386/llib-lhal.ln
+usr/src/lib/hbaapi/amd64/lint.out
+usr/src/lib/hbaapi/amd64/llib-lHBAAPI.ln
+usr/src/lib/hbaapi/i386/lint.out
+usr/src/lib/hbaapi/i386/llib-lHBAAPI.ln
+usr/src/lib/krb5/kadm5/clnt/iprop.h
+usr/src/lib/krb5/kdb/iprop.h
+usr/src/lib/krb5/kdb/iprop_xdr.c
+usr/src/lib/libadm/amd64/lint.out
+usr/src/lib/libadm/amd64/llib-ladm.ln
+usr/src/lib/libadm/i386/lint.out
+usr/src/lib/libadm/i386/llib-ladm.ln
+usr/src/lib/libadt_jni/amd64/lint.out
+usr/src/lib/libadt_jni/amd64/llib-ladt_jni.ln
+usr/src/lib/libadt_jni/com/sun/audit/Audit.jar
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_admin_authenticate.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_admin_authenticate.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_filesystem_add.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_filesystem_add.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_filesystem_delete.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_filesystem_delete.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_filesystem_modify.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_filesystem_modify.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_ilb_delete_rule.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_ilb_delete_rule.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_ilb_disable_rule.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_ilb_disable_rule.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_ilb_enable_rule.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_ilb_enable_rule.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_logout.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_logout.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_network_add.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_network_add.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_network_delete.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_network_delete.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_network_modify.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_network_modify.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_printer_add.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_printer_add.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_printer_delete.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_printer_delete.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_printer_modify.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_printer_modify.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_role_login.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_role_login.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_scheduledjob_add.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_scheduledjob_add.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_scheduledjob_delete.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_scheduledjob_delete.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_scheduledjob_modify.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_scheduledjob_modify.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_serialport_add.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_serialport_add.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_serialport_delete.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_serialport_delete.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_serialport_modify.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_serialport_modify.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_uauth.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_uauth.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_usermgr_add.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_usermgr_add.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_usermgr_delete.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_usermgr_delete.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_usermgr_modify.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditEvent_usermgr_modify.java
+usr/src/lib/libadt_jni/com/sun/audit/AuditSession.class
+usr/src/lib/libadt_jni/com/sun/audit/AuditSession.h
+usr/src/lib/libadt_jni/common/adt_jni_event.c
+usr/src/lib/libadt_jni/common/mapfile-vers
+usr/src/lib/libadt_jni/i386/lint.out
+usr/src/lib/libadt_jni/i386/llib-ladt_jni.ln
+usr/src/lib/libadutils/amd64/lint.out
+usr/src/lib/libadutils/amd64/llib-ladutils.ln
+usr/src/lib/libadutils/i386/lint.out
+usr/src/lib/libadutils/i386/llib-ladutils.ln
+usr/src/lib/libaio/amd64/lint.out
+usr/src/lib/libaio/amd64/llib-laio.ln
+usr/src/lib/libaio/i386/lint.out
+usr/src/lib/libaio/i386/llib-laio.ln
+usr/src/lib/libast/amd64/libast.msg
+usr/src/lib/libast/amd64/lint.out
+usr/src/lib/libast/amd64/llib-last.ln
+usr/src/lib/libast/amd64/msgcc.out
+usr/src/lib/libast/amd64/msgs/
+usr/src/lib/libast/i386/libast.msg
+usr/src/lib/libast/i386/lint.out
+usr/src/lib/libast/i386/llib-last.ln
+usr/src/lib/libast/i386/msgcc.out
+usr/src/lib/libast/i386/msgs/
+usr/src/lib/libast/tmpastinclude/
+usr/src/lib/libavl/amd64/lint.out
+usr/src/lib/libavl/amd64/llib-lavl.ln
+usr/src/lib/libavl/i386/lint.out
+usr/src/lib/libavl/i386/llib-lavl.ln
+usr/src/lib/libbe/i386/lint.out
+usr/src/lib/libbe/i386/llib-lbe.ln
+usr/src/lib/libbrand/amd64/lint.out
+usr/src/lib/libbrand/amd64/llib-lbrand.ln
+usr/src/lib/libbrand/i386/lint.out
+usr/src/lib/libbrand/i386/llib-lbrand.ln
+usr/src/lib/libbsdmalloc/amd64/lint.out
+usr/src/lib/libbsdmalloc/amd64/llib-lbsdmalloc.ln
+usr/src/lib/libbsdmalloc/i386/lint.out
+usr/src/lib/libbsdmalloc/i386/llib-lbsdmalloc.ln
+usr/src/lib/libbsm/amd64/lint.out
+usr/src/lib/libbsm/amd64/llib-lbsm.ln
+usr/src/lib/libbsm/audit_uevents.h
+usr/src/lib/libbsm/common/adt_event.h
+usr/src/lib/libbsm/common/adt_xlate.c
+usr/src/lib/libbsm/i386/lint.out
+usr/src/lib/libbsm/i386/llib-lbsm.ln
+usr/src/lib/libc/THIRDPARTYLICENSE
+usr/src/lib/libc/amd64/assym.h
+usr/src/lib/libc/amd64/genassym
+usr/src/lib/libc/amd64/lint.out
+usr/src/lib/libc/amd64/llib-lc.ln
+usr/src/lib/libc/extract-copyright
+usr/src/lib/libc/i386/assym.h
+usr/src/lib/libc/i386/crt/_rtbootld.s
+usr/src/lib/libc/i386/etc/caplib
+usr/src/lib/libc/i386/genassym
+usr/src/lib/libc/i386/lint.out
+usr/src/lib/libc/i386/llib-lc.ln
+usr/src/lib/libc/i386_hwcap1/assym.h
+usr/src/lib/libc/i386_hwcap1/genassym
+usr/src/lib/libc/i386_hwcap2/assym.h
+usr/src/lib/libc/i386_hwcap2/genassym
+usr/src/lib/libc/i386_hwcap3/assym.h
+usr/src/lib/libc/i386_hwcap3/genassym
+usr/src/lib/libc/port/gen/errlst.c
+usr/src/lib/libc/port/gen/new_list.c
+usr/src/lib/libc_db/amd64/lint.out
+usr/src/lib/libc_db/amd64/llib-lc_db.ln
+usr/src/lib/libc_db/i386/lint.out
+usr/src/lib/libc_db/i386/llib-lc_db.ln
+usr/src/lib/libcfgadm/amd64/lint.out
+usr/src/lib/libcfgadm/amd64/llib-lcfgadm.ln
+usr/src/lib/libcfgadm/i386/lint.out
+usr/src/lib/libcfgadm/i386/llib-lcfgadm.ln
+usr/src/lib/libcmd/amd64/libcmd.msg
+usr/src/lib/libcmd/amd64/lint.out
+usr/src/lib/libcmd/amd64/llib-lcmd.ln
+usr/src/lib/libcmd/amd64/msgcc.out
+usr/src/lib/libcmd/amd64/msgs/
+usr/src/lib/libcmd/i386/libcmd.msg
+usr/src/lib/libcmd/i386/lint.out
+usr/src/lib/libcmd/i386/llib-lcmd.ln
+usr/src/lib/libcmd/i386/msgcc.out
+usr/src/lib/libcmd/i386/msgs/
+usr/src/lib/libcmd/tmpastinclude/
+usr/src/lib/libcmdutils/amd64/lint.out
+usr/src/lib/libcmdutils/amd64/llib-lcmdutils.ln
+usr/src/lib/libcmdutils/i386/lint.out
+usr/src/lib/libcmdutils/i386/llib-lcmdutils.ln
+usr/src/lib/libcommputil/amd64/lint.out
+usr/src/lib/libcommputil/amd64/llib-lcommputil.ln
+usr/src/lib/libcommputil/i386/lint.out
+usr/src/lib/libcommputil/i386/llib-lcommputil.ln
+usr/src/lib/libcontract/amd64/lint.out
+usr/src/lib/libcontract/amd64/llib-lcontract.ln
+usr/src/lib/libcontract/i386/lint.out
+usr/src/lib/libcontract/i386/llib-lcontract.ln
+usr/src/lib/libcpc/amd64/lint.out
+usr/src/lib/libcpc/amd64/llib-lcpc.ln
+usr/src/lib/libcpc/i386/lint.out
+usr/src/lib/libcpc/i386/llib-lcpc.ln
+usr/src/lib/libcrypt/amd64/lint.out
+usr/src/lib/libcrypt/amd64/llib-lcrypt.ln
+usr/src/lib/libcrypt/i386/lint.out
+usr/src/lib/libcrypt/i386/llib-lcrypt.ln
+usr/src/lib/libcryptoutil/amd64/lint.out
+usr/src/lib/libcryptoutil/amd64/llib-lcryptoutil.ln
+usr/src/lib/libcryptoutil/i386/lint.out
+usr/src/lib/libcryptoutil/i386/llib-lcryptoutil.ln
+usr/src/lib/libctf/amd64/lint.out
+usr/src/lib/libctf/amd64/llib-lctf.ln
+usr/src/lib/libctf/i386/lint.out
+usr/src/lib/libctf/i386/llib-lctf.ln
+usr/src/lib/libcurses/amd64/lint.out
+usr/src/lib/libcurses/amd64/llib-lcurses.ln
+usr/src/lib/libcurses/i386/lint.out
+usr/src/lib/libcurses/i386/llib-lcurses.ln
+usr/src/lib/libcurses/screen/curses.h
+usr/src/lib/libcurses/screen/keycaps
+usr/src/lib/libcurses/screen/keyname.c
+usr/src/lib/libcurses/screen/term.h
+usr/src/lib/libcurses/screen/termcap.c
+usr/src/lib/libcurses/screen/tifget.c
+usr/src/lib/libcurses/screen/tifnames.c
+usr/src/lib/libcurses/screen/tiget.c
+usr/src/lib/libcurses/screen/tinames.c
+usr/src/lib/libcurses/screen/tmp/
+usr/src/lib/libcurses/screen/tnames.c
+usr/src/lib/libdevice/amd64/lint.out
+usr/src/lib/libdevice/amd64/llib-ldevice.ln
+usr/src/lib/libdevice/i386/lint.out
+usr/src/lib/libdevice/i386/llib-ldevice.ln
+usr/src/lib/libdevid/amd64/lint.out
+usr/src/lib/libdevid/amd64/llib-ldevid.ln
+usr/src/lib/libdevid/i386/lint.out
+usr/src/lib/libdevid/i386/llib-ldevid.ln
+usr/src/lib/libdevinfo/amd64/lint.out
+usr/src/lib/libdevinfo/amd64/llib-ldevinfo.ln
+usr/src/lib/libdevinfo/i386/lint.out
+usr/src/lib/libdevinfo/i386/llib-ldevinfo.ln
+usr/src/lib/libdhcpagent/i386/lint.out
+usr/src/lib/libdhcpagent/i386/llib-ldhcpagent.ln
+usr/src/lib/libdhcpsvc/head/dhcp_svc_confkey.h
+usr/src/lib/libdhcpsvc/modules/files0/i386/ds_SUNWfiles.so.0
+usr/src/lib/libdhcpsvc/private/i386/lint.out
+usr/src/lib/libdhcpsvc/private/i386/llib-ldhcpsvc.ln
+usr/src/lib/libdhcputil/i386/lint.out
+usr/src/lib/libdhcputil/i386/llib-ldhcputil.ln
+usr/src/lib/libdisasm/amd64/lint.out
+usr/src/lib/libdisasm/amd64/llib-ldisasm.ln
+usr/src/lib/libdisasm/i386/lint.out
+usr/src/lib/libdisasm/i386/llib-ldisasm.ln
+usr/src/lib/libdiskmgt/amd64/lint.out
+usr/src/lib/libdiskmgt/amd64/llib-ldiskmgt.ln
+usr/src/lib/libdiskmgt/i386/lint.out
+usr/src/lib/libdiskmgt/i386/llib-ldiskmgt.ln
+usr/src/lib/libdladm/amd64/lint.out
+usr/src/lib/libdladm/amd64/llib-ldladm.ln
+usr/src/lib/libdladm/i386/lint.out
+usr/src/lib/libdladm/i386/llib-ldladm.ln
+usr/src/lib/libdll/amd64/libdll.msg
+usr/src/lib/libdll/amd64/lint.out
+usr/src/lib/libdll/amd64/llib-ldll.ln
+usr/src/lib/libdll/amd64/msgcc.out
+usr/src/lib/libdll/amd64/msgs/
+usr/src/lib/libdll/i386/libdll.msg
+usr/src/lib/libdll/i386/lint.out
+usr/src/lib/libdll/i386/llib-ldll.ln
+usr/src/lib/libdll/i386/msgcc.out
+usr/src/lib/libdll/i386/msgs/
+usr/src/lib/libdll/tmpastinclude/
+usr/src/lib/libdlpi/amd64/lint.out
+usr/src/lib/libdlpi/amd64/llib-ldlpi.ln
+usr/src/lib/libdlpi/i386/lint.out
+usr/src/lib/libdlpi/i386/llib-ldlpi.ln
+usr/src/lib/libdns_sd/amd64/lint.out
+usr/src/lib/libdns_sd/amd64/llib-ldns_sd.ln
+usr/src/lib/libdns_sd/i386/lint.out
+usr/src/lib/libdns_sd/i386/llib-ldns_sd.ln
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleBrowser.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleDNSRecord.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleDNSSD.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleDNSSDException.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleDomainEnum.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleQuery.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleRecordRegistrar.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleRegistration.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleResolver.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/AppleService.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/BaseListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/BrowseListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSRecord.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSD.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSD.java.h
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDException.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRegistration.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDService.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/DomainListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/QueryListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/RegisterListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/RegisterRecordListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/ResolveListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/TXTRecord.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/dnssd.jar
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/BrowserApp$1.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/BrowserApp.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/BrowserApp.jar
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/BrowserListModel$BrowserListElem.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/BrowserListModel.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/DomainListModel.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/ListenerThread.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/ServicesBrowserListModel.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SimpleChat$1.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SimpleChat.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SimpleChat.jar
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SwingBrowseListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SwingDomainListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SwingQueryListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/SwingResolveListener.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/TargetListElem.class
+usr/src/lib/libdns_sd/java/com/apple/dnssd/docs/examples/TargetListModel.class
+usr/src/lib/libdoor/amd64/lint.out
+usr/src/lib/libdoor/amd64/llib-ldoor.ln
+usr/src/lib/libdoor/i386/lint.out
+usr/src/lib/libdoor/i386/llib-ldoor.ln
+usr/src/lib/libdscfg/i386/lint.out
+usr/src/lib/libdscfg/i386/llib-ldscfg.ln
+usr/src/lib/libdtrace/amd64/dt_grammar.c
+usr/src/lib/libdtrace/amd64/dt_grammar.h
+usr/src/lib/libdtrace/amd64/dt_lex.c
+usr/src/lib/libdtrace/amd64/lint.out
+usr/src/lib/libdtrace/amd64/llib-ldtrace.ln
+usr/src/lib/libdtrace/amd64/y.output
+usr/src/lib/libdtrace/common/dt_errtags.c
+usr/src/lib/libdtrace/common/dt_names.c
+usr/src/lib/libdtrace/common/errno.d
+usr/src/lib/libdtrace/common/io.d
+usr/src/lib/libdtrace/common/io.sed
+usr/src/lib/libdtrace/common/ip.d
+usr/src/lib/libdtrace/common/ip.sed
+usr/src/lib/libdtrace/common/net.d
+usr/src/lib/libdtrace/common/net.sed
+usr/src/lib/libdtrace/common/procfs.d
+usr/src/lib/libdtrace/common/procfs.sed
+usr/src/lib/libdtrace/common/signal.d
+usr/src/lib/libdtrace/common/sysevent.d
+usr/src/lib/libdtrace/common/sysevent.sed
+usr/src/lib/libdtrace/common/tcp.d
+usr/src/lib/libdtrace/common/tcp.sed
+usr/src/lib/libdtrace/common/udp.d
+usr/src/lib/libdtrace/common/udp.sed
+usr/src/lib/libdtrace/i386/dt_grammar.c
+usr/src/lib/libdtrace/i386/dt_grammar.h
+usr/src/lib/libdtrace/i386/dt_lex.c
+usr/src/lib/libdtrace/i386/lint.out
+usr/src/lib/libdtrace/i386/llib-ldtrace.ln
+usr/src/lib/libdtrace/i386/regs.d
+usr/src/lib/libdtrace/i386/regs.sed
+usr/src/lib/libdtrace/i386/y.output
+usr/src/lib/libdtrace_jni/java/classes/
+usr/src/lib/libdtrace_jni/java/lib/
+usr/src/lib/libdtrace_jni/java/native/
+usr/src/lib/libefi/amd64/lint.out
+usr/src/lib/libefi/amd64/llib-lefi.ln
+usr/src/lib/libefi/i386/lint.out
+usr/src/lib/libefi/i386/llib-lefi.ln
+usr/src/lib/libelfsign/i386/lint.out
+usr/src/lib/libelfsign/i386/llib-lelfsign.ln
+usr/src/lib/libeti/form/amd64/lint.out
+usr/src/lib/libeti/form/amd64/llib-lform.ln
+usr/src/lib/libeti/form/i386/lint.out
+usr/src/lib/libeti/form/i386/llib-lform.ln
+usr/src/lib/libeti/menu/amd64/lint.out
+usr/src/lib/libeti/menu/amd64/llib-lmenu.ln
+usr/src/lib/libeti/menu/i386/lint.out
+usr/src/lib/libeti/menu/i386/llib-lmenu.ln
+usr/src/lib/libeti/panel/amd64/lint.out
+usr/src/lib/libeti/panel/amd64/llib-lpanel.ln
+usr/src/lib/libeti/panel/i386/lint.out
+usr/src/lib/libeti/panel/i386/llib-lpanel.ln
+usr/src/lib/libexacct/amd64/lint.out
+usr/src/lib/libexacct/amd64/llib-lexacct.ln
+usr/src/lib/libexacct/demo/exdump
+usr/src/lib/libexacct/i386/lint.out
+usr/src/lib/libexacct/i386/llib-lexacct.ln
+usr/src/lib/libfcoe/amd64/lint.out
+usr/src/lib/libfcoe/amd64/llib-lfcoe.ln
+usr/src/lib/libfcoe/i386/lint.out
+usr/src/lib/libfcoe/i386/llib-lfcoe.ln
+usr/src/lib/libfdisk/amd64/lint.out
+usr/src/lib/libfdisk/amd64/llib-lfdisk.ln
+usr/src/lib/libfdisk/i386/lint.out
+usr/src/lib/libfdisk/i386/llib-lfdisk.ln
+usr/src/lib/libfru/amd64/pics/
+usr/src/lib/libfru/i386/pics/
+usr/src/lib/libfsmgt/common/nfs_sec.c
+usr/src/lib/libfsmgt/common/replica.c
+usr/src/lib/libfsmgt/common/sharetab.c
+usr/src/lib/libfsmgt/i386/lint.out
+usr/src/lib/libfsmgt/i386/llib-lfsmgt.ln
+usr/src/lib/libfstyp/i386/lint.out
+usr/src/lib/libfstyp/i386/llib-lfstyp.ln
+usr/src/lib/libgen/amd64/lint.out
+usr/src/lib/libgen/amd64/llib-lgen.ln
+usr/src/lib/libgen/i386/lint.out
+usr/src/lib/libgen/i386/llib-lgen.ln
+usr/src/lib/libgrubmgmt/i386/lint.out
+usr/src/lib/libgrubmgmt/i386/llib-lgrubmgmt.ln
+usr/src/lib/libgss/amd64/lint.out
+usr/src/lib/libgss/amd64/llib-lgss.ln
+usr/src/lib/libgss/i386/lint.out
+usr/src/lib/libgss/i386/llib-lgss.ln
+usr/src/lib/libhotplug/amd64/lint.out
+usr/src/lib/libhotplug/amd64/llib-lhotplug.ln
+usr/src/lib/libhotplug/i386/lint.out
+usr/src/lib/libhotplug/i386/llib-lhotplug.ln
+usr/src/lib/libidmap/amd64/idmap_xdr.c
+usr/src/lib/libidmap/amd64/lint.out
+usr/src/lib/libidmap/amd64/llib-lidmap.ln
+usr/src/lib/libidmap/i386/idmap_xdr.c
+usr/src/lib/libidmap/i386/lint.out
+usr/src/lib/libidmap/i386/llib-lidmap.ln
+usr/src/lib/libilb/amd64/lint.out
+usr/src/lib/libilb/amd64/llib-lilb.ln
+usr/src/lib/libilb/i386/lint.out
+usr/src/lib/libilb/i386/llib-lilb.ln
+usr/src/lib/libima/amd64/lint.out
+usr/src/lib/libima/amd64/llib-lima.ln
+usr/src/lib/libima/i386/lint.out
+usr/src/lib/libima/i386/llib-lima.ln
+usr/src/lib/libinetsvc/i386/lint.out
+usr/src/lib/libinetsvc/i386/llib-linetsvc.ln
+usr/src/lib/libinetutil/amd64/lint.out
+usr/src/lib/libinetutil/amd64/llib-linetutil.ln
+usr/src/lib/libinetutil/i386/lint.out
+usr/src/lib/libinetutil/i386/llib-linetutil.ln
+usr/src/lib/libinstzones/common/zones.i
+usr/src/lib/libinstzones/common/zones_args.i
+usr/src/lib/libinstzones/common/zones_exec.i
+usr/src/lib/libinstzones/common/zones_locks.i
+usr/src/lib/libinstzones/common/zones_lofs.i
+usr/src/lib/libinstzones/common/zones_paths.i
+usr/src/lib/libinstzones/common/zones_states.i
+usr/src/lib/libinstzones/common/zones_str.i
+usr/src/lib/libinstzones/common/zones_utils.i
+usr/src/lib/libinstzones/i386/lint.out
+usr/src/lib/libinstzones/i386/llib-linstzones.ln
+usr/src/lib/libintl/amd64/lint.out
+usr/src/lib/libintl/amd64/llib-lintl.ln
+usr/src/lib/libintl/i386/lint.out
+usr/src/lib/libintl/i386/llib-lintl.ln
+usr/src/lib/libipadm/i386/lint.out
+usr/src/lib/libipadm/i386/llib-lipadm.ln
+usr/src/lib/libipmi/amd64/lint.out
+usr/src/lib/libipmi/amd64/llib-lipmi.ln
+usr/src/lib/libipmi/common/ipmi_tables.c
+usr/src/lib/libipmi/i386/lint.out
+usr/src/lib/libipmi/i386/llib-lipmi.ln
+usr/src/lib/libipmp/i386/lint.out
+usr/src/lib/libipmp/i386/llib-lipmp.ln
+usr/src/lib/libipp/amd64/lint.out
+usr/src/lib/libipp/amd64/llib-lipp.ln
+usr/src/lib/libipp/i386/lint.out
+usr/src/lib/libipp/i386/llib-lipp.ln
+usr/src/lib/libipsecutil/amd64/lint.out
+usr/src/lib/libipsecutil/amd64/llib-lipsecutil.ln
+usr/src/lib/libipsecutil/i386/lint.out
+usr/src/lib/libipsecutil/i386/llib-lipsecutil.ln
+usr/src/lib/libiscsit/amd64/lint.out
+usr/src/lib/libiscsit/amd64/llib-liscsit.ln
+usr/src/lib/libiscsit/i386/lint.out
+usr/src/lib/libiscsit/i386/llib-liscsit.ln
+usr/src/lib/libkmf/THIRDPARTYLICENSE
+usr/src/lib/libkmf/ber_der/amd64/lint.out
+usr/src/lib/libkmf/ber_der/amd64/llib-lkmfberder.ln
+usr/src/lib/libkmf/ber_der/i386/lint.out
+usr/src/lib/libkmf/ber_der/i386/llib-lkmfberder.ln
+usr/src/lib/libkmf/libkmf/amd64/lint.out
+usr/src/lib/libkmf/libkmf/amd64/llib-lkmf.ln
+usr/src/lib/libkmf/libkmf/i386/lint.out
+usr/src/lib/libkmf/libkmf/i386/llib-lkmf.ln
+usr/src/lib/libkstat/amd64/lint.out
+usr/src/lib/libkstat/amd64/llib-lkstat.ln
+usr/src/lib/libkstat/i386/lint.out
+usr/src/lib/libkstat/i386/llib-lkstat.ln
+usr/src/lib/libkvm/amd64/lint.out
+usr/src/lib/libkvm/amd64/llib-lkvm.ln
+usr/src/lib/libkvm/i386/lint.out
+usr/src/lib/libkvm/i386/llib-lkvm.ln
+usr/src/lib/libldap4/amd64/libldap.so.4
+usr/src/lib/libldap4/i386/libldap.so.4
+usr/src/lib/libldap5/amd64/libldap.so.5
+usr/src/lib/libldap5/amd64/lint.out
+usr/src/lib/libldap5/amd64/llib-lldap.ln
+usr/src/lib/libldap5/i386/libldap.so.5
+usr/src/lib/libldap5/i386/lint.out
+usr/src/lib/libldap5/i386/llib-lldap.ln
+usr/src/lib/liblgrp/amd64/lint.out
+usr/src/lib/liblgrp/amd64/llib-llgrp.ln
+usr/src/lib/liblgrp/i386/lint.out
+usr/src/lib/liblgrp/i386/llib-llgrp.ln
+usr/src/lib/libmail/amd64/lint.out
+usr/src/lib/libmail/amd64/llib-lmail.ln
+usr/src/lib/libmail/i386/lint.out
+usr/src/lib/libmail/i386/llib-lmail.ln
+usr/src/lib/libmalloc/amd64/lint.out
+usr/src/lib/libmalloc/amd64/llib-lmalloc.ln
+usr/src/lib/libmalloc/i386/lint.out
+usr/src/lib/libmalloc/i386/llib-lmalloc.ln
+usr/src/lib/libmapid/i386/lint.out
+usr/src/lib/libmapid/i386/llib-lmapid.ln
+usr/src/lib/libmapmalloc/amd64/lint.out
+usr/src/lib/libmapmalloc/amd64/llib-lmapmalloc.ln
+usr/src/lib/libmapmalloc/i386/lint.out
+usr/src/lib/libmapmalloc/i386/llib-lmapmalloc.ln
+usr/src/lib/libmd/amd64/lint.out
+usr/src/lib/libmd/amd64/llib-lmd.ln
+usr/src/lib/libmd/amd64/md5_amd64.s
+usr/src/lib/libmd/amd64/sha1-x86_64.s
+usr/src/lib/libmd/amd64/sha256-x86_64.s
+usr/src/lib/libmd/amd64/sha512-x86_64.s
+usr/src/lib/libmd/i386/lint.out
+usr/src/lib/libmd/i386/llib-lmd.ln
+usr/src/lib/libmd5/amd64/lint.out
+usr/src/lib/libmd5/amd64/llib-lmd5.ln
+usr/src/lib/libmd5/i386/lint.out
+usr/src/lib/libmd5/i386/llib-lmd5.ln
+usr/src/lib/libmp/amd64/libmp.so.2
+usr/src/lib/libmp/i386/libmp.so.2
+usr/src/lib/libmtmalloc/amd64/lint.out
+usr/src/lib/libmtmalloc/amd64/llib-lmtmalloc.ln
+usr/src/lib/libmtmalloc/i386/lint.out
+usr/src/lib/libmtmalloc/i386/llib-lmtmalloc.ln
+usr/src/lib/libndmp/amd64/lint.out
+usr/src/lib/libndmp/amd64/llib-lndmp.ln
+usr/src/lib/libndmp/i386/lint.out
+usr/src/lib/libndmp/i386/llib-lndmp.ln
+usr/src/lib/libnisdb/db.h
+usr/src/lib/libnisdb/db_c.h
+usr/src/lib/libnisdb/db_c_xdr.c
+usr/src/lib/libnisdb/db_dictionary.h
+usr/src/lib/libnisdb/db_dictionary_c.h
+usr/src/lib/libnisdb/db_dictionary_c_xdr.c
+usr/src/lib/libnisdb/db_dictlog.h
+usr/src/lib/libnisdb/db_dictlog_c.h
+usr/src/lib/libnisdb/db_dictlog_c_xdr.c
+usr/src/lib/libnisdb/db_entry.h
+usr/src/lib/libnisdb/db_entry_c.h
+usr/src/lib/libnisdb/db_entry_c_xdr.c
+usr/src/lib/libnisdb/db_index.h
+usr/src/lib/libnisdb/db_index_c.h
+usr/src/lib/libnisdb/db_index_c_xdr.c
+usr/src/lib/libnisdb/db_index_entry.h
+usr/src/lib/libnisdb/db_index_entry_c.h
+usr/src/lib/libnisdb/db_index_entry_c_xdr.c
+usr/src/lib/libnisdb/db_item.h
+usr/src/lib/libnisdb/db_item_c.h
+usr/src/lib/libnisdb/db_item_c_xdr.c
+usr/src/lib/libnisdb/db_log.h
+usr/src/lib/libnisdb/db_log_c.h
+usr/src/lib/libnisdb/db_log_c_xdr.c
+usr/src/lib/libnisdb/db_log_entry.h
+usr/src/lib/libnisdb/db_log_entry_c.h
+usr/src/lib/libnisdb/db_log_entry_c_xdr.c
+usr/src/lib/libnisdb/db_mindex.h
+usr/src/lib/libnisdb/db_mindex_c.h
+usr/src/lib/libnisdb/db_mindex_c_xdr.c
+usr/src/lib/libnisdb/db_query.h
+usr/src/lib/libnisdb/db_query_c.h
+usr/src/lib/libnisdb/db_query_c_xdr.c
+usr/src/lib/libnisdb/db_scheme.h
+usr/src/lib/libnisdb/db_scheme_c.h
+usr/src/lib/libnisdb/db_scheme_c_xdr.c
+usr/src/lib/libnisdb/db_table.h
+usr/src/lib/libnisdb/db_table_c.h
+usr/src/lib/libnisdb/db_table_c_xdr.c
+usr/src/lib/libnisdb/db_vers.h
+usr/src/lib/libnisdb/db_vers_c.h
+usr/src/lib/libnisdb/db_vers_c_xdr.c
+usr/src/lib/libnisdb/libnisdb.so.2
+usr/src/lib/libnls/amd64/lint.out
+usr/src/lib/libnls/amd64/llib-lnls.ln
+usr/src/lib/libnls/i386/lint.out
+usr/src/lib/libnls/i386/llib-lnls.ln
+usr/src/lib/libnsctl/i386/lint.out
+usr/src/lib/libnsctl/i386/llib-lnsctl.ln
+usr/src/lib/libnsl/amd64/lint.out
+usr/src/lib/libnsl/amd64/llib-lnsl.ln
+usr/src/lib/libnsl/i386/lint.out
+usr/src/lib/libnsl/i386/llib-lnsl.ln
+usr/src/lib/libnsl/nis/gen/nis_clnt.h
+usr/src/lib/libntfs/THIRDPARTYLICENSE
+usr/src/lib/libntfs/i386/libntfs.so.10
+usr/src/lib/libnvpair/amd64/lint.out
+usr/src/lib/libnvpair/amd64/llib-lnvpair.ln
+usr/src/lib/libnvpair/i386/lint.out
+usr/src/lib/libnvpair/i386/llib-lnvpair.ln
+usr/src/lib/libnwam/i386/lint.out
+usr/src/lib/libnwam/i386/llib-lnwam.ln
+usr/src/lib/libpam/amd64/lint.out
+usr/src/lib/libpam/amd64/llib-lpam.ln
+usr/src/lib/libpam/i386/lint.out
+usr/src/lib/libpam/i386/llib-lpam.ln
+usr/src/lib/libparted/THIRDPARTYLICENSE
+usr/src/lib/libparted/i386/libparted.so.8
+usr/src/lib/libpctx/amd64/lint.out
+usr/src/lib/libpctx/amd64/llib-lpctx.ln
+usr/src/lib/libpctx/i386/lint.out
+usr/src/lib/libpctx/i386/llib-lpctx.ln
+usr/src/lib/libpicl/amd64/lint.out
+usr/src/lib/libpicl/amd64/llib-lpicl.ln
+usr/src/lib/libpicl/i386/lint.out
+usr/src/lib/libpicl/i386/llib-lpicl.ln
+usr/src/lib/libpicltree/i386/lint.out
+usr/src/lib/libpicltree/i386/llib-lpicltree.ln
+usr/src/lib/libpkg/common/canonize.i
+usr/src/lib/libpkg/common/ckparam.i
+usr/src/lib/libpkg/common/ckvolseq.i
+usr/src/lib/libpkg/common/devtype.i
+usr/src/lib/libpkg/common/dstream.i
+usr/src/lib/libpkg/common/fmkdir.i
+usr/src/lib/libpkg/common/gpkglist.i
+usr/src/lib/libpkg/common/gpkgmap.i
+usr/src/lib/libpkg/common/handlelocalfs.i
+usr/src/lib/libpkg/common/isdir.i
+usr/src/lib/libpkg/common/keystore.i
+usr/src/lib/libpkg/common/logerr.i
+usr/src/lib/libpkg/common/mappath.i
+usr/src/lib/libpkg/common/ncgrpw.i
+usr/src/lib/libpkg/common/nhash.i
+usr/src/lib/libpkg/common/p12lib.i
+usr/src/lib/libpkg/common/pkgerr.i
+usr/src/lib/libpkg/common/pkgexecl.i
+usr/src/lib/libpkg/common/pkgexecv.i
+usr/src/lib/libpkg/common/pkgmount.i
+usr/src/lib/libpkg/common/pkgserv.i
+usr/src/lib/libpkg/common/pkgstr.i
+usr/src/lib/libpkg/common/pkgtrans.i
+usr/src/lib/libpkg/common/pkgweb.i
+usr/src/lib/libpkg/common/ppkgmap.i
+usr/src/lib/libpkg/common/progerr.i
+usr/src/lib/libpkg/common/putcfile.i
+usr/src/lib/libpkg/common/rrmdir.i
+usr/src/lib/libpkg/common/runcmd.i
+usr/src/lib/libpkg/common/security.i
+usr/src/lib/libpkg/common/srchcfile.i
+usr/src/lib/libpkg/common/tputcfent.i
+usr/src/lib/libpkg/common/verify.i
+usr/src/lib/libpkg/common/vfpops.i
+usr/src/lib/libpkg/i386/lint.out
+usr/src/lib/libpkg/i386/llib-lpkg.ln
+usr/src/lib/libpool/amd64/lint.out
+usr/src/lib/libpool/amd64/llib-lpool.ln
+usr/src/lib/libpool/i386/lint.out
+usr/src/lib/libpool/i386/llib-lpool.ln
+usr/src/lib/libpp/i386/libpp.msg
+usr/src/lib/libpp/i386/lint.out
+usr/src/lib/libpp/i386/llib-lpp.ln
+usr/src/lib/libpp/i386/msgcc.out
+usr/src/lib/libpp/i386/msgs/
+usr/src/lib/libpp/tmpastinclude/
+usr/src/lib/libproc/amd64/lint.out
+usr/src/lib/libproc/amd64/llib-lproc.ln
+usr/src/lib/libproc/i386/lint.out
+usr/src/lib/libproc/i386/llib-lproc.ln
+usr/src/lib/libproject/amd64/lint.out
+usr/src/lib/libproject/amd64/llib-lproject.ln
+usr/src/lib/libproject/i386/lint.out
+usr/src/lib/libproject/i386/llib-lproject.ln
+usr/src/lib/libpthread/amd64/lint.out
+usr/src/lib/libpthread/amd64/llib-lpthread.ln
+usr/src/lib/libpthread/i386/lint.out
+usr/src/lib/libpthread/i386/llib-lpthread.ln
+usr/src/lib/libraidcfg/amd64/lint.out
+usr/src/lib/libraidcfg/amd64/llib-lraidcfg.ln
+usr/src/lib/libraidcfg/i386/lint.out
+usr/src/lib/libraidcfg/i386/llib-lraidcfg.ln
+usr/src/lib/librcm/amd64/lint.out
+usr/src/lib/librcm/amd64/llib-lrcm.ln
+usr/src/lib/librcm/i386/lint.out
+usr/src/lib/librcm/i386/llib-lrcm.ln
+usr/src/lib/librdc/i386/lint.out
+usr/src/lib/librdc/i386/llib-lrdc.ln
+usr/src/lib/libreparse/amd64/lint.out
+usr/src/lib/libreparse/amd64/llib-lreparse.ln
+usr/src/lib/libreparse/i386/lint.out
+usr/src/lib/libreparse/i386/llib-lreparse.ln
+usr/src/lib/libresolv2/amd64/libresolv.so.2
+usr/src/lib/libresolv2/amd64/lint.out
+usr/src/lib/libresolv2/amd64/llib-lresolv.ln
+usr/src/lib/libresolv2/i386/libresolv.so.2
+usr/src/lib/libresolv2/i386/lint.out
+usr/src/lib/libresolv2/i386/llib-lresolv.ln
+usr/src/lib/libresolv2/include/make_os_version
+usr/src/lib/libresolv2/include/os_version.h
+usr/src/lib/libresolv2/include/port_ipv6.h
+usr/src/lib/libresolv2/include/probe_ipv6
+usr/src/lib/libresolv2_joy/amd64/libresolv_joy.so.2
+usr/src/lib/libresolv2_joy/amd64/lint.out
+usr/src/lib/libresolv2_joy/amd64/llib-lresolv_joy.ln
+usr/src/lib/libresolv2_joy/i386/libresolv_joy.so.2
+usr/src/lib/libresolv2_joy/i386/lint.out
+usr/src/lib/libresolv2_joy/i386/llib-lresolv_joy.ln
+usr/src/lib/libresolv2_joy/include/make_os_version
+usr/src/lib/libresolv2_joy/include/os_version.h
+usr/src/lib/libresolv2_joy/include/port_ipv6.h
+usr/src/lib/libresolv2_joy/include/probe_ipv6
+usr/src/lib/librestart/amd64/lint.out
+usr/src/lib/librestart/amd64/llib-lrestart.ln
+usr/src/lib/librestart/i386/lint.out
+usr/src/lib/librestart/i386/llib-lrestart.ln
+usr/src/lib/librpcsvc/amd64/lint.out
+usr/src/lib/librpcsvc/amd64/llib-lrpcsvc.ln
+usr/src/lib/librpcsvc/common/bootparam_prot_xdr.c
+usr/src/lib/librpcsvc/common/mount_xdr.c
+usr/src/lib/librpcsvc/common/nlm_prot.c
+usr/src/lib/librpcsvc/common/nsm_addr_xdr.c
+usr/src/lib/librpcsvc/common/rpc_sztypes.c
+usr/src/lib/librpcsvc/common/rstat_xdr.c
+usr/src/lib/librpcsvc/common/rusers_xdr.c
+usr/src/lib/librpcsvc/common/sm_inter_xdr.c
+usr/src/lib/librpcsvc/common/spray_xdr.c
+usr/src/lib/librpcsvc/i386/lint.out
+usr/src/lib/librpcsvc/i386/llib-lrpcsvc.ln
+usr/src/lib/librsm/amd64/librsm.so.2
+usr/src/lib/librsm/i386/librsm.so.2
+usr/src/lib/librstp/i386/lint.out
+usr/src/lib/librstp/i386/llib-lrstp.ln
+usr/src/lib/librt/amd64/lint.out
+usr/src/lib/librt/amd64/llib-lrt.ln
+usr/src/lib/librt/i386/lint.out
+usr/src/lib/librt/i386/llib-lrt.ln
+usr/src/lib/libsasl/THIRDPARTYLICENSE
+usr/src/lib/libsasl/amd64/lint.out
+usr/src/lib/libsasl/amd64/llib-lsasl.ln
+usr/src/lib/libsasl/i386/lint.out
+usr/src/lib/libsasl/i386/llib-lsasl.ln
+usr/src/lib/libscf/amd64/lint.out
+usr/src/lib/libscf/amd64/llib-lscf.ln
+usr/src/lib/libscf/i386/lint.out
+usr/src/lib/libscf/i386/llib-lscf.ln
+usr/src/lib/libsched/amd64/lint.out
+usr/src/lib/libsched/amd64/llib-lsched.ln
+usr/src/lib/libsched/i386/lint.out
+usr/src/lib/libsched/i386/llib-lsched.ln
+usr/src/lib/libsctp/amd64/lint.out
+usr/src/lib/libsctp/amd64/llib-lsctp.ln
+usr/src/lib/libsctp/i386/lint.out
+usr/src/lib/libsctp/i386/llib-lsctp.ln
+usr/src/lib/libsec/amd64/acl.output
+usr/src/lib/libsec/amd64/acl.tab.c
+usr/src/lib/libsec/amd64/acl.tab.h
+usr/src/lib/libsec/amd64/acl_lex.c
+usr/src/lib/libsec/amd64/lint.out
+usr/src/lib/libsec/amd64/llib-lsec.ln
+usr/src/lib/libsec/i386/acl.output
+usr/src/lib/libsec/i386/acl.tab.c
+usr/src/lib/libsec/i386/acl.tab.h
+usr/src/lib/libsec/i386/acl_lex.c
+usr/src/lib/libsec/i386/lint.out
+usr/src/lib/libsec/i386/llib-lsec.ln
+usr/src/lib/libsecdb/amd64/lint.out
+usr/src/lib/libsecdb/amd64/llib-lsecdb.ln
+usr/src/lib/libsecdb/auth_attr
+usr/src/lib/libsecdb/exec_attr
+usr/src/lib/libsecdb/i386/lint.out
+usr/src/lib/libsecdb/i386/llib-lsecdb.ln
+usr/src/lib/libsecdb/prof_attr
+usr/src/lib/libsecdb/user_attr
+usr/src/lib/libsendfile/amd64/lint.out
+usr/src/lib/libsendfile/amd64/llib-lsendfile.ln
+usr/src/lib/libsendfile/i386/lint.out
+usr/src/lib/libsendfile/i386/llib-lsendfile.ln
+usr/src/lib/libshare/amd64/lint.out
+usr/src/lib/libshare/amd64/llib-lshare.ln
+usr/src/lib/libshare/i386/lint.out
+usr/src/lib/libshare/i386/llib-lshare.ln
+usr/src/lib/libshell/amd64/libshell.msg
+usr/src/lib/libshell/amd64/lint.out
+usr/src/lib/libshell/amd64/llib-lshell.ln
+usr/src/lib/libshell/amd64/msgcc.out
+usr/src/lib/libshell/amd64/msgs/
+usr/src/lib/libshell/i386/libshell.msg
+usr/src/lib/libshell/i386/lint.out
+usr/src/lib/libshell/i386/llib-lshell.ln
+usr/src/lib/libshell/i386/msgcc.out
+usr/src/lib/libshell/i386/msgs/
+usr/src/lib/libshell/tmpastinclude/
+usr/src/lib/libshell/xsltproc.log
+usr/src/lib/libsip/amd64/lint.out
+usr/src/lib/libsip/amd64/llib-lsip.ln
+usr/src/lib/libsip/i386/lint.out
+usr/src/lib/libsip/i386/llib-lsip.ln
+usr/src/lib/libsldap/amd64/lint.out
+usr/src/lib/libsldap/amd64/llib-lsldap.ln
+usr/src/lib/libsldap/i386/lint.out
+usr/src/lib/libsldap/i386/llib-lsldap.ln
+usr/src/lib/libslp/amd64/lint.out
+usr/src/lib/libslp/amd64/llib-lslp.ln
+usr/src/lib/libslp/classes/
+usr/src/lib/libslp/i386/lint.out
+usr/src/lib/libslp/i386/llib-lslp.ln
+usr/src/lib/libsmartsshd/amd64/lint.out
+usr/src/lib/libsmartsshd/amd64/llib-lsmartsshd.ln
+usr/src/lib/libsmartsshd/i386/lint.out
+usr/src/lib/libsmartsshd/i386/llib-lsmartsshd.ln
+usr/src/lib/libsmbfs/amd64/lint.out
+usr/src/lib/libsmbfs/amd64/llib-lsmbfs.ln
+usr/src/lib/libsmbfs/i386/lint.out
+usr/src/lib/libsmbfs/i386/llib-lsmbfs.ln
+usr/src/lib/libsmbios/amd64/lint.out
+usr/src/lib/libsmbios/amd64/llib-lsmbios.ln
+usr/src/lib/libsmbios/common/smb_tables.c
+usr/src/lib/libsmbios/i386/lint.out
+usr/src/lib/libsmbios/i386/llib-lsmbios.ln
+usr/src/lib/libsmedia/library/amd64/lint.out
+usr/src/lib/libsmedia/library/amd64/llib-lsmedia.ln
+usr/src/lib/libsmedia/library/common/smed.h
+usr/src/lib/libsmedia/library/common/smed_clnt.c
+usr/src/lib/libsmedia/library/common/smed_xdr.c
+usr/src/lib/libsmedia/library/i386/lint.out
+usr/src/lib/libsmedia/library/i386/llib-lsmedia.ln
+usr/src/lib/libsocket/amd64/lint.out
+usr/src/lib/libsocket/amd64/llib-lsocket.ln
+usr/src/lib/libsocket/i386/lint.out
+usr/src/lib/libsocket/i386/llib-lsocket.ln
+usr/src/lib/libsqlite/i386/lemon
+usr/src/lib/libsqlite/i386/lemon-build
+usr/src/lib/libsqlite/i386/lempar.c
+usr/src/lib/libsqlite/i386/lint.out
+usr/src/lib/libsqlite/i386/llib-lsqlite.ln
+usr/src/lib/libsqlite/i386/opcodes.c
+usr/src/lib/libsqlite/i386/opcodes.h
+usr/src/lib/libsqlite/i386/parse.c
+usr/src/lib/libsqlite/i386/parse.h
+usr/src/lib/libsqlite/i386/parse_tmp.c
+usr/src/lib/libsqlite/i386/parse_tmp.h
+usr/src/lib/libsqlite/i386/parse_tmp.out
+usr/src/lib/libsqlite/i386/parse_tmp.y
+usr/src/lib/libsqlite/sqlite.h
+usr/src/lib/libsrpt/amd64/lint.out
+usr/src/lib/libsrpt/amd64/llib-lsrpt.ln
+usr/src/lib/libsrpt/i386/lint.out
+usr/src/lib/libsrpt/i386/llib-lsrpt.ln
+usr/src/lib/libstmf/amd64/lint.out
+usr/src/lib/libstmf/amd64/llib-lstmf.ln
+usr/src/lib/libstmf/i386/lint.out
+usr/src/lib/libstmf/i386/llib-lstmf.ln
+usr/src/lib/libstmfproxy/amd64/lint.out
+usr/src/lib/libstmfproxy/amd64/llib-lstmfproxy.ln
+usr/src/lib/libstmfproxy/i386/lint.out
+usr/src/lib/libstmfproxy/i386/llib-lstmfproxy.ln
+usr/src/lib/libsum/amd64/libsum.msg
+usr/src/lib/libsum/amd64/lint.out
+usr/src/lib/libsum/amd64/llib-lsum.ln
+usr/src/lib/libsum/amd64/msgcc.out
+usr/src/lib/libsum/amd64/msgs/
+usr/src/lib/libsum/i386/libsum.msg
+usr/src/lib/libsum/i386/lint.out
+usr/src/lib/libsum/i386/llib-lsum.ln
+usr/src/lib/libsum/i386/msgcc.out
+usr/src/lib/libsum/i386/msgs/
+usr/src/lib/libsum/tmpastinclude/
+usr/src/lib/libsun_ima/amd64/lint.out
+usr/src/lib/libsun_ima/amd64/llib-lsun_ima.ln
+usr/src/lib/libsun_ima/i386/lint.out
+usr/src/lib/libsun_ima/i386/llib-lsun_ima.ln
+usr/src/lib/libsys/i386/libsys.c
+usr/src/lib/libsysevent/amd64/lint.out
+usr/src/lib/libsysevent/amd64/llib-lsysevent.ln
+usr/src/lib/libsysevent/i386/lint.out
+usr/src/lib/libsysevent/i386/llib-lsysevent.ln
+usr/src/lib/libtecla/amd64/lint.out
+usr/src/lib/libtecla/amd64/llib-ltecla.ln
+usr/src/lib/libtecla/i386/lint.out
+usr/src/lib/libtecla/i386/llib-ltecla.ln
+usr/src/lib/libthread/amd64/lint.out
+usr/src/lib/libthread/amd64/llib-lthread.ln
+usr/src/lib/libthread/i386/lint.out
+usr/src/lib/libthread/i386/llib-lthread.ln
+usr/src/lib/libtsnet/amd64/lint.out
+usr/src/lib/libtsnet/amd64/llib-ltsnet.ln
+usr/src/lib/libtsnet/i386/lint.out
+usr/src/lib/libtsnet/i386/llib-ltsnet.ln
+usr/src/lib/libtsol/amd64/libtsol.so.2
+usr/src/lib/libtsol/amd64/lint.out
+usr/src/lib/libtsol/amd64/llib-ltsol.ln
+usr/src/lib/libtsol/i386/libtsol.so.2
+usr/src/lib/libtsol/i386/lint.out
+usr/src/lib/libtsol/i386/llib-ltsol.ln
+usr/src/lib/libumem/amd64/lint.out
+usr/src/lib/libumem/amd64/llib-lumem.ln
+usr/src/lib/libumem/i386/lint.out
+usr/src/lib/libumem/i386/llib-lumem.ln
+usr/src/lib/libunistat/common/dsw/dsw.dtrnk
+usr/src/lib/libunistat/common/dsw/dsw.edef
+usr/src/lib/libunistat/common/dsw/dsw.msg
+usr/src/lib/libunistat/common/dsw/dsw.trnk
+usr/src/lib/libunistat/common/rdc/rdc.dtrnk
+usr/src/lib/libunistat/common/rdc/rdc.edef
+usr/src/lib/libunistat/common/rdc/rdc.msg
+usr/src/lib/libunistat/common/rdc/rdc.trnk
+usr/src/lib/libunistat/common/sdbc/sdbc.dtrnk
+usr/src/lib/libunistat/common/sdbc/sdbc.edef
+usr/src/lib/libunistat/common/sdbc/sdbc.msg
+usr/src/lib/libunistat/common/sdbc/sdbc.trnk
+usr/src/lib/libunistat/common/solaris/solaris.dtrnk
+usr/src/lib/libunistat/common/solaris/solaris.edef
+usr/src/lib/libunistat/common/solaris/solaris.msg
+usr/src/lib/libunistat/common/solaris/solaris.trnk
+usr/src/lib/libunistat/common/spcs/spcs.dtrnk
+usr/src/lib/libunistat/common/spcs/spcs.edef
+usr/src/lib/libunistat/common/spcs/spcs.msg
+usr/src/lib/libunistat/common/spcs/spcs.trnk
+usr/src/lib/libunistat/common/sv/sv.dtrnk
+usr/src/lib/libunistat/common/sv/sv.edef
+usr/src/lib/libunistat/common/sv/sv.msg
+usr/src/lib/libunistat/common/sv/sv.trnk
+usr/src/lib/libunistat/i386/lint.out
+usr/src/lib/libunistat/i386/llib-lunistat.ln
+usr/src/lib/libunistat/i386/spcs_dtrinkets.h
+usr/src/lib/libunistat/i386/spcs_errors.h
+usr/src/lib/libunistat/i386/spcs_etext.h
+usr/src/lib/libunistat/i386/spcs_etrinkets.h
+usr/src/lib/libuuid/amd64/lint.out
+usr/src/lib/libuuid/amd64/llib-luuid.ln
+usr/src/lib/libuuid/i386/lint.out
+usr/src/lib/libuuid/i386/llib-luuid.ln
+usr/src/lib/libuutil/amd64/lint.out
+usr/src/lib/libuutil/amd64/llib-luutil.ln
+usr/src/lib/libuutil/i386/lint.out
+usr/src/lib/libuutil/i386/llib-luutil.ln
+usr/src/lib/libuutil/native/sys/
+usr/src/lib/libvolmgt/amd64/lint.out
+usr/src/lib/libvolmgt/amd64/llib-lvolmgt.ln
+usr/src/lib/libvolmgt/i386/lint.out
+usr/src/lib/libvolmgt/i386/llib-lvolmgt.ln
+usr/src/lib/libvrrpadm/amd64/lint.out
+usr/src/lib/libvrrpadm/amd64/llib-lvrrpadm.ln
+usr/src/lib/libvrrpadm/i386/lint.out
+usr/src/lib/libvrrpadm/i386/llib-lvrrpadm.ln
+usr/src/lib/libvscan/i386/lint.out
+usr/src/lib/libvscan/i386/llib-lvscan.ln
+usr/src/lib/libwanboot/i386/lint.out
+usr/src/lib/libwanboot/i386/llib-lwanboot.ln
+usr/src/lib/libwanbootutil/common/key_xdr.c
+usr/src/lib/libwanbootutil/common/key_xdr.h
+usr/src/lib/libwanbootutil/i386/lint.out
+usr/src/lib/libwanbootutil/i386/llib-lwanbootutil.ln
+usr/src/lib/libwrap/THIRDPARTYLICENSE
+usr/src/lib/libwrap/i386/libwrap.so.1.0
+usr/src/lib/libwrap/i386/lint.out
+usr/src/lib/libwrap/i386/llib-lwrap.ln
+usr/src/lib/libxcurses/h/term.h
+usr/src/lib/libxcurses/src/libc/xcurses/boolcode.c
+usr/src/lib/libxcurses/src/libc/xcurses/boolfnam.c
+usr/src/lib/libxcurses/src/libc/xcurses/boolname.c
+usr/src/lib/libxcurses/src/libc/xcurses/keyindex.c
+usr/src/lib/libxcurses/src/libc/xcurses/numcode.c
+usr/src/lib/libxcurses/src/libc/xcurses/numfnam.c
+usr/src/lib/libxcurses/src/libc/xcurses/numname.c
+usr/src/lib/libxcurses/src/libc/xcurses/strcode.c
+usr/src/lib/libxcurses/src/libc/xcurses/strfnam.c
+usr/src/lib/libxcurses/src/libc/xcurses/strname.c
+usr/src/lib/libxcurses2/amd64/libcurses.so.2
+usr/src/lib/libxcurses2/amd64/lint.out
+usr/src/lib/libxcurses2/amd64/llib-lcurses.ln
+usr/src/lib/libxcurses2/h/term.h
+usr/src/lib/libxcurses2/i386/libcurses.so.2
+usr/src/lib/libxcurses2/i386/lint.out
+usr/src/lib/libxcurses2/i386/llib-lcurses.ln
+usr/src/lib/libxcurses2/src/libc/xcurses/boolcode.c
+usr/src/lib/libxcurses2/src/libc/xcurses/boolfnam.c
+usr/src/lib/libxcurses2/src/libc/xcurses/boolname.c
+usr/src/lib/libxcurses2/src/libc/xcurses/keyindex.c
+usr/src/lib/libxcurses2/src/libc/xcurses/numcode.c
+usr/src/lib/libxcurses2/src/libc/xcurses/numfnam.c
+usr/src/lib/libxcurses2/src/libc/xcurses/numname.c
+usr/src/lib/libxcurses2/src/libc/xcurses/strcode.c
+usr/src/lib/libxcurses2/src/libc/xcurses/strfnam.c
+usr/src/lib/libxcurses2/src/libc/xcurses/strname.c
+usr/src/lib/libxnet/amd64/lint.out
+usr/src/lib/libxnet/amd64/llib-lxnet.ln
+usr/src/lib/libxnet/i386/lint.out
+usr/src/lib/libxnet/i386/llib-lxnet.ln
+usr/src/lib/libzdoor/amd64/lint.out
+usr/src/lib/libzdoor/amd64/llib-lzdoor.ln
+usr/src/lib/libzdoor/i386/lint.out
+usr/src/lib/libzdoor/i386/llib-lzdoor.ln
+usr/src/lib/libzfs/amd64/lint.out
+usr/src/lib/libzfs/amd64/llib-lzfs.ln
+usr/src/lib/libzfs/i386/lint.out
+usr/src/lib/libzfs/i386/llib-lzfs.ln
+usr/src/lib/libzfs_jni/amd64/lint.out
+usr/src/lib/libzfs_jni/amd64/llib-lzfs_jni.ln
+usr/src/lib/libzfs_jni/i386/lint.out
+usr/src/lib/libzfs_jni/i386/llib-lzfs_jni.ln
+usr/src/lib/libzonecfg/amd64/lint.out
+usr/src/lib/libzonecfg/amd64/llib-lzonecfg.ln
+usr/src/lib/libzonecfg/i386/lint.out
+usr/src/lib/libzonecfg/i386/llib-lzonecfg.ln
+usr/src/lib/libzoneinfo/i386/lint.out
+usr/src/lib/libzoneinfo/i386/llib-lzoneinfo.ln
+usr/src/lib/libzonestat/amd64/lint.out
+usr/src/lib/libzonestat/amd64/llib-lzonestat.ln
+usr/src/lib/libzonestat/i386/lint.out
+usr/src/lib/libzonestat/i386/llib-lzonestat.ln
+usr/src/lib/libzpool/amd64/lint.out
+usr/src/lib/libzpool/amd64/llib-lzpool.ln
+usr/src/lib/libzpool/i386/lint.out
+usr/src/lib/libzpool/i386/llib-lzpool.ln
+usr/src/lib/mpapi/libmpapi/amd64/lint.out
+usr/src/lib/mpapi/libmpapi/amd64/llib-lMPAPI.ln
+usr/src/lib/mpapi/libmpapi/i386/lint.out
+usr/src/lib/mpapi/libmpapi/i386/llib-lMPAPI.ln
+usr/src/lib/nametoaddr/straddr/amd64/straddr.so.2
+usr/src/lib/nametoaddr/straddr/i386/straddr.so.2
+usr/src/lib/passwdutil/amd64/lint.out
+usr/src/lib/passwdutil/amd64/llib-lpasswdutil.ln
+usr/src/lib/passwdutil/i386/lint.out
+usr/src/lib/passwdutil/i386/llib-lpasswdutil.ln
+usr/src/lib/pkcs11/libkcfd/i386/lint.out
+usr/src/lib/pkcs11/libkcfd/i386/llib-lkcfd.ln
+usr/src/lib/pkcs11/libpkcs11/amd64/lint.out
+usr/src/lib/pkcs11/libpkcs11/amd64/llib-lpkcs11.ln
+usr/src/lib/pkcs11/libpkcs11/i386/lint.out
+usr/src/lib/pkcs11/libpkcs11/i386/llib-lpkcs11.ln
+usr/src/lib/pkcs11/libsoftcrypto/amd64/arcfour-x86_64.s
+usr/src/lib/pkcs11/libsoftcrypto/amd64/lint.out
+usr/src/lib/pkcs11/libsoftcrypto/amd64/llib-lsoftcrypto.ln
+usr/src/lib/pkcs11/libsoftcrypto/i386/lint.out
+usr/src/lib/pkcs11/libsoftcrypto/i386/llib-lsoftcrypto.ln
+usr/src/lib/policykit/libpolkit/i386/libpolkit.so.0.0.0
+usr/src/lib/policykit/libpolkit/i386/lint.out
+usr/src/lib/policykit/libpolkit/i386/llib-lpolkit.ln
+usr/src/lib/policykit/libpolkit/i386/polkit.pc
+usr/src/lib/sasl_plugins/gssapi/THIRDPARTYLICENSE
+usr/src/lib/scsi/libscsi/amd64/lint.out
+usr/src/lib/scsi/libscsi/amd64/llib-lscsi.ln
+usr/src/lib/scsi/libscsi/common/scsi_errno.c
+usr/src/lib/scsi/libscsi/i386/lint.out
+usr/src/lib/scsi/libscsi/i386/llib-lscsi.ln
+usr/src/lib/scsi/libses/amd64/lint.out
+usr/src/lib/scsi/libses/amd64/llib-lses.ln
+usr/src/lib/scsi/libses/common/ses_errno.c
+usr/src/lib/scsi/libses/i386/lint.out
+usr/src/lib/scsi/libses/i386/llib-lses.ln
+usr/src/lib/scsi/libsmp/amd64/lint.out
+usr/src/lib/scsi/libsmp/amd64/llib-lsmp.ln
+usr/src/lib/scsi/libsmp/common/smp_errno.c
+usr/src/lib/scsi/libsmp/i386/lint.out
+usr/src/lib/scsi/libsmp/i386/llib-lsmp.ln
+usr/src/lib/scsi/plugins/ses/libses/common/libses_elemtype.c
+usr/src/lib/smbsrv/libmlrpc/amd64/lint.out
+usr/src/lib/smbsrv/libmlrpc/amd64/llib-lmlrpc.ln
+usr/src/lib/smbsrv/libmlrpc/amd64/rpcpdu_ndr.c
+usr/src/lib/smbsrv/libmlrpc/i386/lint.out
+usr/src/lib/smbsrv/libmlrpc/i386/llib-lmlrpc.ln
+usr/src/lib/smbsrv/libmlrpc/i386/rpcpdu_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/dssetup_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/eventlog_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/lint.out
+usr/src/lib/smbsrv/libmlsvc/amd64/llib-lmlsvc.ln
+usr/src/lib/smbsrv/libmlsvc/amd64/lsarpc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/msgsvc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/netdfs_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/netlogon_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/samrpc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/spoolss_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/srvsvc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/svcctl_ndr.c
+usr/src/lib/smbsrv/libmlsvc/amd64/winreg_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/dssetup_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/eventlog_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/lint.out
+usr/src/lib/smbsrv/libmlsvc/i386/llib-lmlsvc.ln
+usr/src/lib/smbsrv/libmlsvc/i386/lsarpc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/msgsvc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/netdfs_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/netlogon_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/samrpc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/spoolss_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/srvsvc_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/svcctl_ndr.c
+usr/src/lib/smbsrv/libmlsvc/i386/winreg_ndr.c
+usr/src/lib/smbsrv/libsmb/amd64/lint.out
+usr/src/lib/smbsrv/libsmb/amd64/llib-lsmb.ln
+usr/src/lib/smbsrv/libsmb/common/smb_status_tbl.h
+usr/src/lib/smbsrv/libsmb/i386/lint.out
+usr/src/lib/smbsrv/libsmb/i386/llib-lsmb.ln
+usr/src/lib/smbsrv/libsmbns/amd64/lint.out
+usr/src/lib/smbsrv/libsmbns/amd64/llib-lsmbns.ln
+usr/src/lib/smbsrv/libsmbns/i386/lint.out
+usr/src/lib/smbsrv/libsmbns/i386/llib-lsmbns.ln
+usr/src/lib/smbsrv/libsmbrdr/amd64/lint.out
+usr/src/lib/smbsrv/libsmbrdr/amd64/llib-lsmbrdr.ln
+usr/src/lib/smbsrv/libsmbrdr/i386/lint.out
+usr/src/lib/smbsrv/libsmbrdr/i386/llib-lsmbrdr.ln
+usr/src/lib/smbsrv/libsmbrp/amd64/lint.out
+usr/src/lib/smbsrv/libsmbrp/amd64/llib-lreparse_smb.ln
+usr/src/lib/smbsrv/libsmbrp/i386/lint.out
+usr/src/lib/smbsrv/libsmbrp/i386/llib-lreparse_smb.ln
+usr/src/lib/smhba/amd64/lint.out
+usr/src/lib/smhba/amd64/llib-lSMHBAAPI.ln
+usr/src/lib/smhba/i386/lint.out
+usr/src/lib/smhba/i386/llib-lSMHBAAPI.ln
+usr/src/lib/udapl/libdat/amd64/lint.out
+usr/src/lib/udapl/libdat/amd64/llib-ldat.ln
+usr/src/lib/udapl/libdat/i386/lint.out
+usr/src/lib/udapl/libdat/i386/llib-ldat.ln
+usr/src/man/man1/batch.1
+usr/src/man/man1/bg.1
+usr/src/man/man1/case.1
+usr/src/man/man1/chdir.1
+usr/src/man/man1/checkeq.1
+usr/src/man/man1/continue.1
+usr/src/man/man1/decrypt.1
+usr/src/man/man1/dirname.1
+usr/src/man/man1/dirs.1
+usr/src/man/man1/disable.1
+usr/src/man/man1/dumpkeys.1
+usr/src/man/man1/edit.1
+usr/src/man/man1/errange.1
+usr/src/man/man1/errdate.1
+usr/src/man/man1/errgid.1
+usr/src/man/man1/errint.1
+usr/src/man/man1/erritem.1
+usr/src/man/man1/errpath.1
+usr/src/man/man1/errstr.1
+usr/src/man/man1/errtime.1
+usr/src/man/man1/erruid.1
+usr/src/man/man1/erryorn.1
+usr/src/man/man1/eval.1
+usr/src/man/man1/export.1
+usr/src/man/man1/false.1
+usr/src/man/man1/fc.1
+usr/src/man/man1/fg.1
+usr/src/man/man1/for.1
+usr/src/man/man1/foreach.1
+usr/src/man/man1/function.1
+usr/src/man/man1/goto.1
+usr/src/man/man1/hashcheck.1
+usr/src/man/man1/hashmake.1
+usr/src/man/man1/hashstat.1
+usr/src/man/man1/helpdate.1
+usr/src/man/man1/helpgid.1
+usr/src/man/man1/helpint.1
+usr/src/man/man1/helpitem.1
+usr/src/man/man1/helppath.1
+usr/src/man/man1/helprange.1
+usr/src/man/man1/helpstr.1
+usr/src/man/man1/helptime.1
+usr/src/man/man1/helpuid.1
+usr/src/man/man1/helpyorn.1
+usr/src/man/man1/hist.1
+usr/src/man/man1/i286.1
+usr/src/man/man1/i386.1
+usr/src/man/man1/i486.1
+usr/src/man/man1/i860.1
+usr/src/man/man1/iAPX286.1
+usr/src/man/man1/if.1
+usr/src/man/man1/intro.1
+usr/src/man/man1/jsh.1
+usr/src/man/man1/ksh.1
+usr/src/man/man1/ldapadd.1
+usr/src/man/man1/neqn.1
+usr/src/man/man1/notify.1
+usr/src/man/man1/onintr.1
+usr/src/man/man1/page.1
+usr/src/man/man1/pcat.1
+usr/src/man/man1/pcred.1
+usr/src/man/man1/pdp11.1
+usr/src/man/man1/pfcsh.1
+usr/src/man/man1/pfiles.1
+usr/src/man/man1/pfksh.1
+usr/src/man/man1/pflags.1
+usr/src/man/man1/pfsh.1
+usr/src/man/man1/pkill.1
+usr/src/man/man1/pldd.1
+usr/src/man/man1/popd.1
+usr/src/man/man1/prun.1
+usr/src/man/man1/psig.1
+usr/src/man/man1/pstack.1
+usr/src/man/man1/pstop.1
+usr/src/man/man1/ptime.1
+usr/src/man/man1/pushd.1
+usr/src/man/man1/pwait.1
+usr/src/man/man1/pwdx.1
+usr/src/man/man1/red.1
+usr/src/man/man1/rehash.1
+usr/src/man/man1/remote_shell.1
+usr/src/man/man1/remsh.1
+usr/src/man/man1/repeat.1
+usr/src/man/man1/return.1
+usr/src/man/man1/rksh.1
+usr/src/man/man1/rksh93.1
+usr/src/man/man1/rmail.1
+usr/src/man/man1/rmdir.1
+usr/src/man/man1/rmumount.1
+usr/src/man/man1/select.1
+usr/src/man/man1/setenv.1
+usr/src/man/man1/settime.1
+usr/src/man/man1/sh.1
+usr/src/man/man1/snca.1
+usr/src/man/man1/source.1
+usr/src/man/man1/sparc.1
+usr/src/man/man1/spellin.1
+usr/src/man/man1/stop.1
+usr/src/man/man1/strconf.1
+usr/src/man/man1/sun.1
+usr/src/man/man1/switch.1
+usr/src/man/man1/t300.1
+usr/src/man/man1/t300s.1
+usr/src/man/man1/t4014.1
+usr/src/man/man1/t450.1
+usr/src/man/man1/tek.1
+usr/src/man/man1/u370.1
+usr/src/man/man1/u3b.1
+usr/src/man/man1/u3b15.1
+usr/src/man/man1/u3b2.1
+usr/src/man/man1/u3b5.1
+usr/src/man/man1/ulimit.1
+usr/src/man/man1/unalias.1
+usr/src/man/man1/uncompress.1
+usr/src/man/man1/unexpand.1
+usr/src/man/man1/unhash.1
+usr/src/man/man1/unlimit.1
+usr/src/man/man1/unpack.1
+usr/src/man/man1/unset.1
+usr/src/man/man1/unsetenv.1
+usr/src/man/man1/until.1
+usr/src/man/man1/valdate.1
+usr/src/man/man1/valgid.1
+usr/src/man/man1/valint.1
+usr/src/man/man1/valpath.1
+usr/src/man/man1/valrange.1
+usr/src/man/man1/valstr.1
+usr/src/man/man1/valtime.1
+usr/src/man/man1/valuid.1
+usr/src/man/man1/valyorn.1
+usr/src/man/man1/vax.1
+usr/src/man/man1/vedit.1
+usr/src/man/man1/ver.1
+usr/src/man/man1/whence.1
+usr/src/man/man1/while.1
+usr/src/man/man1/zcat.1
+usr/src/man/man1b/Mail.1b
+usr/src/man/man1b/fasthalt.1b
+usr/src/man/man1b/reset.1b
+usr/src/man/man1c/uudecode.1c
+usr/src/man/man1c/uulog.1c
+usr/src/man/man1c/uuname.1c
+usr/src/man/man1c/uupick.1c
+usr/src/man/man1m/acctcon1.1m
+usr/src/man/man1m/acctcon2.1m
+usr/src/man/man1m/acctdisk.1m
+usr/src/man/man1m/acctdusg.1m
+usr/src/man/man1m/accton.1m
+usr/src/man/man1m/acctprc1.1m
+usr/src/man/man1m/acctprc2.1m
+usr/src/man/man1m/acctwtmp.1m
+usr/src/man/man1m/bootparamd.1m
+usr/src/man/man1m/chargefee.1m
+usr/src/man/man1m/ckpacct.1m
+usr/src/man/man1m/closewtmp.1m
+usr/src/man/man1m/comsat.1m
+usr/src/man/man1m/dcopy.1m
+usr/src/man/man1m/devfsadmd.1m
+usr/src/man/man1m/dodisk.1m
+usr/src/man/man1m/fcadm.1m
+usr/src/man/man1m/fingerd.1m
+usr/src/man/man1m/ftpd.1m
+usr/src/man/man1m/grpck.1m
+usr/src/man/man1m/hal-find-by-capability.1m
+usr/src/man/man1m/hal-find-by-property.1m
+usr/src/man/man1m/hal-set-property.1m
+usr/src/man/man1m/intro.1m
+usr/src/man/man1m/kadmin.local.1m
+usr/src/man/man1m/lastlogin.1m
+usr/src/man/man1m/metadetach.1m
+usr/src/man/man1m/metaonline.1m
+usr/src/man/man1m/monacct.1m
+usr/src/man/man1m/nulladm.1m
+usr/src/man/man1m/poweroff.1m
+usr/src/man/man1m/prctmp.1m
+usr/src/man/man1m/prdaily.1m
+usr/src/man/man1m/prtacct.1m
+usr/src/man/man1m/quotaoff.1m
+usr/src/man/man1m/rarpd.1m
+usr/src/man/man1m/rdisc.1m
+usr/src/man/man1m/reject.1m
+usr/src/man/man1m/restricted_shell.1m
+usr/src/man/man1m/rexd.1m
+usr/src/man/man1m/rexecd.1m
+usr/src/man/man1m/rlogind.1m
+usr/src/man/man1m/routed.1m
+usr/src/man/man1m/rshd.1m
+usr/src/man/man1m/rstatd.1m
+usr/src/man/man1m/rusersd.1m
+usr/src/man/man1m/rwalld.1m
+usr/src/man/man1m/rwhod.1m
+usr/src/man/man1m/sa1.1m
+usr/src/man/man1m/sa2.1m
+usr/src/man/man1m/sadc.1m
+usr/src/man/man1m/shutacct.1m
+usr/src/man/man1m/sprayd.1m
+usr/src/man/man1m/startup.1m
+usr/src/man/man1m/talkd.1m
+usr/src/man/man1m/telinit.1m
+usr/src/man/man1m/telnetd.1m
+usr/src/man/man1m/tftpd.1m
+usr/src/man/man1m/turnacct.1m
+usr/src/man/man1m/umount.1m
+usr/src/man/man1m/umount_smbfs.1m
+usr/src/man/man1m/umountall.1m
+usr/src/man/man1m/unlink.1m
+usr/src/man/man1m/unshareall.1m
+usr/src/man/man1m/utmp2wtmp.1m
+usr/src/man/man1m/uucpd.1m
+usr/src/man/man1m/uutry.1m
+usr/src/man/man1m/wtmpfix.1m
+usr/src/man/man1m/yppasswdd.1m
+usr/src/man/man1m/ypstop.1m
+usr/src/man/man1m/ypupdated.1m
+usr/src/man/man1m/ypxfr_1perday.1m
+usr/src/man/man1m/ypxfr_1perhour.1m
+usr/src/man/man1m/ypxfr_2perday.1m
+usr/src/man/man1m/ypxfrd.1m
+usr/src/man/man2/_Exit.2
+usr/src/man/man2/_exit.2
+usr/src/man/man2/_lwp_cond_broadcast.2
+usr/src/man/man2/_lwp_cond_reltimedwait.2
+usr/src/man/man2/_lwp_cond_timedwait.2
+usr/src/man/man2/_lwp_continue.2
+usr/src/man/man2/_lwp_mutex_trylock.2
+usr/src/man/man2/_lwp_mutex_unlock.2
+usr/src/man/man2/_lwp_sema_init.2
+usr/src/man/man2/_lwp_sema_post.2
+usr/src/man/man2/_lwp_sema_trywait.2
+usr/src/man/man2/execl.2
+usr/src/man/man2/execle.2
+usr/src/man/man2/execlp.2
+usr/src/man/man2/execv.2
+usr/src/man/man2/execve.2
+usr/src/man/man2/execvp.2
+usr/src/man/man2/faccessat.2
+usr/src/man/man2/facl.2
+usr/src/man/man2/fchdir.2
+usr/src/man/man2/fchmod.2
+usr/src/man/man2/fchown.2
+usr/src/man/man2/fchownat.2
+usr/src/man/man2/fchroot.2
+usr/src/man/man2/fgetlabel.2
+usr/src/man/man2/fork1.2
+usr/src/man/man2/forkall.2
+usr/src/man/man2/forkallx.2
+usr/src/man/man2/forkx.2
+usr/src/man/man2/fstat.2
+usr/src/man/man2/fstatat.2
+usr/src/man/man2/fstatvfs.2
+usr/src/man/man2/futimesat.2
+usr/src/man/man2/getaudit_addr.2
+usr/src/man/man2/getegid.2
+usr/src/man/man2/geteuid.2
+usr/src/man/man2/getgid.2
+usr/src/man/man2/getpgid.2
+usr/src/man/man2/getpgrp.2
+usr/src/man/man2/getpmsg.2
+usr/src/man/man2/getppid.2
+usr/src/man/man2/getprojid.2
+usr/src/man/man2/getrctl.2
+usr/src/man/man2/gettaskid.2
+usr/src/man/man2/intro.2
+usr/src/man/man2/lchown.2
+usr/src/man/man2/lstat.2
+usr/src/man/man2/openat.2
+usr/src/man/man2/pathconf.2
+usr/src/man/man2/pread.2
+usr/src/man/man2/pset_assign.2
+usr/src/man/man2/pset_destroy.2
+usr/src/man/man2/pset_getattr.2
+usr/src/man/man2/putacct.2
+usr/src/man/man2/putpmsg.2
+usr/src/man/man2/pwrite.2
+usr/src/man/man2/readv.2
+usr/src/man/man2/renameat.2
+usr/src/man/man2/sbrk.2
+usr/src/man/man2/semtimedop.2
+usr/src/man/man2/setaudit.2
+usr/src/man/man2/setaudit_addr.2
+usr/src/man/man2/setauid.2
+usr/src/man/man2/setcontext.2
+usr/src/man/man2/setegid.2
+usr/src/man/man2/seteuid.2
+usr/src/man/man2/setgid.2
+usr/src/man/man2/setgroups.2
+usr/src/man/man2/setitimer.2
+usr/src/man/man2/setpflags.2
+usr/src/man/man2/setppriv.2
+usr/src/man/man2/setrlimit.2
+usr/src/man/man2/setustack.2
+usr/src/man/man2/shmat.2
+usr/src/man/man2/shmdt.2
+usr/src/man/man2/sigsendset.2
+usr/src/man/man2/umount2.2
+usr/src/man/man2/unlinkat.2
+usr/src/man/man2/vforkx.2
+usr/src/man/man2/wracct.2
+usr/src/man/man2/writev.2
+usr/src/man/man3/intro.3
+usr/src/man/man3bsm/au_close.3bsm
+usr/src/man/man3bsm/au_to_arg.3bsm
+usr/src/man/man3bsm/au_to_arg32.3bsm
+usr/src/man/man3bsm/au_to_arg64.3bsm
+usr/src/man/man3bsm/au_to_attr.3bsm
+usr/src/man/man3bsm/au_to_cmd.3bsm
+usr/src/man/man3bsm/au_to_data.3bsm
+usr/src/man/man3bsm/au_to_groups.3bsm
+usr/src/man/man3bsm/au_to_in_addr.3bsm
+usr/src/man/man3bsm/au_to_ipc.3bsm
+usr/src/man/man3bsm/au_to_iport.3bsm
+usr/src/man/man3bsm/au_to_me.3bsm
+usr/src/man/man3bsm/au_to_newgroups.3bsm
+usr/src/man/man3bsm/au_to_opaque.3bsm
+usr/src/man/man3bsm/au_to_path.3bsm
+usr/src/man/man3bsm/au_to_process.3bsm
+usr/src/man/man3bsm/au_to_process_ex.3bsm
+usr/src/man/man3bsm/au_to_return.3bsm
+usr/src/man/man3bsm/au_to_return32.3bsm
+usr/src/man/man3bsm/au_to_return64.3bsm
+usr/src/man/man3bsm/au_to_socket.3bsm
+usr/src/man/man3bsm/au_to_subject.3bsm
+usr/src/man/man3bsm/au_to_subject_ex.3bsm
+usr/src/man/man3bsm/au_to_text.3bsm
+usr/src/man/man3bsm/au_write.3bsm
+usr/src/man/man3bsm/endac.3bsm
+usr/src/man/man3bsm/endauclass.3bsm
+usr/src/man/man3bsm/endauevent.3bsm
+usr/src/man/man3bsm/endauuser.3bsm
+usr/src/man/man3bsm/endddent.3bsm
+usr/src/man/man3bsm/getacdir.3bsm
+usr/src/man/man3bsm/getacflg.3bsm
+usr/src/man/man3bsm/getacmin.3bsm
+usr/src/man/man3bsm/getacna.3bsm
+usr/src/man/man3bsm/getauclassent_r.3bsm
+usr/src/man/man3bsm/getauclassnam.3bsm
+usr/src/man/man3bsm/getauclassnam_r.3bsm
+usr/src/man/man3bsm/getauditflagsbin.3bsm
+usr/src/man/man3bsm/getauditflagschar.3bsm
+usr/src/man/man3bsm/getauevent_r.3bsm
+usr/src/man/man3bsm/getauevnam.3bsm
+usr/src/man/man3bsm/getauevnam_r.3bsm
+usr/src/man/man3bsm/getauevnonam.3bsm
+usr/src/man/man3bsm/getauevnum.3bsm
+usr/src/man/man3bsm/getauevnum_r.3bsm
+usr/src/man/man3bsm/getauuserent.3bsm
+usr/src/man/man3bsm/getauuserent_r.3bsm
+usr/src/man/man3bsm/getauusernam_r.3bsm
+usr/src/man/man3bsm/getddnam.3bsm
+usr/src/man/man3bsm/setac.3bsm
+usr/src/man/man3bsm/setauclass.3bsm
+usr/src/man/man3bsm/setauevent.3bsm
+usr/src/man/man3bsm/setauuser.3bsm
+usr/src/man/man3bsm/setddent.3bsm
+usr/src/man/man3bsm/setddfile.3bsm
+usr/src/man/man3c/FD_CLR.3c
+usr/src/man/man3c/FD_ISSET.3c
+usr/src/man/man3c/FD_SET.3c
+usr/src/man/man3c/FD_ZERO.3c
+usr/src/man/man3c/__flbf.3c
+usr/src/man/man3c/__fpending.3c
+usr/src/man/man3c/__fpurge.3c
+usr/src/man/man3c/__freadable.3c
+usr/src/man/man3c/__freading.3c
+usr/src/man/man3c/__fsetlocking.3c
+usr/src/man/man3c/__fwritable.3c
+usr/src/man/man3c/__fwriting.3c
+usr/src/man/man3c/_edata.3c
+usr/src/man/man3c/_end.3c
+usr/src/man/man3c/_etext.3c
+usr/src/man/man3c/_exithandle.3c
+usr/src/man/man3c/_flushlbf.3c
+usr/src/man/man3c/_setjmp.3c
+usr/src/man/man3c/addrtosymstr.3c
+usr/src/man/man3c/aiowrite.3c
+usr/src/man/man3c/alloca.3c
+usr/src/man/man3c/alphasort.3c
+usr/src/man/man3c/ascftime.3c
+usr/src/man/man3c/asctime.3c
+usr/src/man/man3c/asctime_r.3c
+usr/src/man/man3c/asprintf.3c
+usr/src/man/man3c/atof.3c
+usr/src/man/man3c/atoi.3c
+usr/src/man/man3c/atol.3c
+usr/src/man/man3c/atoll.3c
+usr/src/man/man3c/atomic_add_16.3c
+usr/src/man/man3c/atomic_add_16_nv.3c
+usr/src/man/man3c/atomic_add_32.3c
+usr/src/man/man3c/atomic_add_32_nv.3c
+usr/src/man/man3c/atomic_add_64.3c
+usr/src/man/man3c/atomic_add_64_nv.3c
+usr/src/man/man3c/atomic_add_8.3c
+usr/src/man/man3c/atomic_add_8_nv.3c
+usr/src/man/man3c/atomic_add_char.3c
+usr/src/man/man3c/atomic_add_char_nv.3c
+usr/src/man/man3c/atomic_add_int.3c
+usr/src/man/man3c/atomic_add_int_nv.3c
+usr/src/man/man3c/atomic_add_long.3c
+usr/src/man/man3c/atomic_add_long_nv.3c
+usr/src/man/man3c/atomic_add_ptr.3c
+usr/src/man/man3c/atomic_add_ptr_nv.3c
+usr/src/man/man3c/atomic_add_short.3c
+usr/src/man/man3c/atomic_add_short_nv.3c
+usr/src/man/man3c/atomic_and_16.3c
+usr/src/man/man3c/atomic_and_16_nv.3c
+usr/src/man/man3c/atomic_and_32.3c
+usr/src/man/man3c/atomic_and_32_nv.3c
+usr/src/man/man3c/atomic_and_64.3c
+usr/src/man/man3c/atomic_and_64_nv.3c
+usr/src/man/man3c/atomic_and_8.3c
+usr/src/man/man3c/atomic_and_8_nv.3c
+usr/src/man/man3c/atomic_and_uchar.3c
+usr/src/man/man3c/atomic_and_uchar_nv.3c
+usr/src/man/man3c/atomic_and_uint.3c
+usr/src/man/man3c/atomic_and_uint_nv.3c
+usr/src/man/man3c/atomic_and_ulong.3c
+usr/src/man/man3c/atomic_and_ulong_nv.3c
+usr/src/man/man3c/atomic_and_ushort.3c
+usr/src/man/man3c/atomic_and_ushort_nv.3c
+usr/src/man/man3c/atomic_cas_16.3c
+usr/src/man/man3c/atomic_cas_32.3c
+usr/src/man/man3c/atomic_cas_64.3c
+usr/src/man/man3c/atomic_cas_8.3c
+usr/src/man/man3c/atomic_cas_ptr.3c
+usr/src/man/man3c/atomic_cas_uchar.3c
+usr/src/man/man3c/atomic_cas_uint.3c
+usr/src/man/man3c/atomic_cas_ulong.3c
+usr/src/man/man3c/atomic_cas_ushort.3c
+usr/src/man/man3c/atomic_clear_long_excl.3c
+usr/src/man/man3c/atomic_dec_16.3c
+usr/src/man/man3c/atomic_dec_16_nv.3c
+usr/src/man/man3c/atomic_dec_32.3c
+usr/src/man/man3c/atomic_dec_32_nv.3c
+usr/src/man/man3c/atomic_dec_64.3c
+usr/src/man/man3c/atomic_dec_64_nv.3c
+usr/src/man/man3c/atomic_dec_8.3c
+usr/src/man/man3c/atomic_dec_8_nv.3c
+usr/src/man/man3c/atomic_dec_ptr.3c
+usr/src/man/man3c/atomic_dec_ptr_nv.3c
+usr/src/man/man3c/atomic_dec_uchar.3c
+usr/src/man/man3c/atomic_dec_uchar_nv.3c
+usr/src/man/man3c/atomic_dec_uint.3c
+usr/src/man/man3c/atomic_dec_uint_nv.3c
+usr/src/man/man3c/atomic_dec_ulong.3c
+usr/src/man/man3c/atomic_dec_ulong_nv.3c
+usr/src/man/man3c/atomic_dec_ushort.3c
+usr/src/man/man3c/atomic_dec_ushort_nv.3c
+usr/src/man/man3c/atomic_inc_16.3c
+usr/src/man/man3c/atomic_inc_16_nv.3c
+usr/src/man/man3c/atomic_inc_32.3c
+usr/src/man/man3c/atomic_inc_32_nv.3c
+usr/src/man/man3c/atomic_inc_64.3c
+usr/src/man/man3c/atomic_inc_64_nv.3c
+usr/src/man/man3c/atomic_inc_8.3c
+usr/src/man/man3c/atomic_inc_8_nv.3c
+usr/src/man/man3c/atomic_inc_ptr.3c
+usr/src/man/man3c/atomic_inc_ptr_nv.3c
+usr/src/man/man3c/atomic_inc_uchar.3c
+usr/src/man/man3c/atomic_inc_uchar_nv.3c
+usr/src/man/man3c/atomic_inc_uint.3c
+usr/src/man/man3c/atomic_inc_uint_nv.3c
+usr/src/man/man3c/atomic_inc_ulong.3c
+usr/src/man/man3c/atomic_inc_ulong_nv.3c
+usr/src/man/man3c/atomic_inc_ushort.3c
+usr/src/man/man3c/atomic_inc_ushort_nv.3c
+usr/src/man/man3c/atomic_or_16.3c
+usr/src/man/man3c/atomic_or_16_nv.3c
+usr/src/man/man3c/atomic_or_32.3c
+usr/src/man/man3c/atomic_or_32_nv.3c
+usr/src/man/man3c/atomic_or_64.3c
+usr/src/man/man3c/atomic_or_64_nv.3c
+usr/src/man/man3c/atomic_or_8.3c
+usr/src/man/man3c/atomic_or_8_nv.3c
+usr/src/man/man3c/atomic_or_uchar.3c
+usr/src/man/man3c/atomic_or_uchar_nv.3c
+usr/src/man/man3c/atomic_or_uint.3c
+usr/src/man/man3c/atomic_or_uint_nv.3c
+usr/src/man/man3c/atomic_or_ulong.3c
+usr/src/man/man3c/atomic_or_ulong_nv.3c
+usr/src/man/man3c/atomic_or_ushort.3c
+usr/src/man/man3c/atomic_or_ushort_nv.3c
+usr/src/man/man3c/atomic_set_long_excl.3c
+usr/src/man/man3c/atomic_swap_16.3c
+usr/src/man/man3c/atomic_swap_32.3c
+usr/src/man/man3c/atomic_swap_64.3c
+usr/src/man/man3c/atomic_swap_8.3c
+usr/src/man/man3c/atomic_swap_ptr.3c
+usr/src/man/man3c/atomic_swap_uchar.3c
+usr/src/man/man3c/atomic_swap_uint.3c
+usr/src/man/man3c/atomic_swap_ulong.3c
+usr/src/man/man3c/atomic_swap_ushort.3c
+usr/src/man/man3c/backtrace.3c
+usr/src/man/man3c/backtrace_symbols.3c
+usr/src/man/man3c/backtrace_symbols_fd.3c
+usr/src/man/man3c/bcmp.3c
+usr/src/man/man3c/bcopy.3c
+usr/src/man/man3c/bind_textdomain_codeset.3c
+usr/src/man/man3c/bindtextdomain.3c
+usr/src/man/man3c/bzero.3c
+usr/src/man/man3c/calloc.3c
+usr/src/man/man3c/catclose.3c
+usr/src/man/man3c/cfgetospeed.3c
+usr/src/man/man3c/cfsetospeed.3c
+usr/src/man/man3c/cftime.3c
+usr/src/man/man3c/clearerr.3c
+usr/src/man/man3c/clock_getres.3c
+usr/src/man/man3c/clock_gettime.3c
+usr/src/man/man3c/closelog.3c
+usr/src/man/man3c/cond_broadcast.3c
+usr/src/man/man3c/cond_destroy.3c
+usr/src/man/man3c/cond_reltimedwait.3c
+usr/src/man/man3c/cond_signal.3c
+usr/src/man/man3c/cond_timedwait.3c
+usr/src/man/man3c/cond_wait.3c
+usr/src/man/man3c/csetcol.3c
+usr/src/man/man3c/csetlen.3c
+usr/src/man/man3c/csetno.3c
+usr/src/man/man3c/ctermid_r.3c
+usr/src/man/man3c/ctime_r.3c
+usr/src/man/man3c/dbm_clearerr.3c
+usr/src/man/man3c/dbm_close.3c
+usr/src/man/man3c/dbm_delete.3c
+usr/src/man/man3c/dbm_error.3c
+usr/src/man/man3c/dbm_fetch.3c
+usr/src/man/man3c/dbm_firstkey.3c
+usr/src/man/man3c/dbm_nextkey.3c
+usr/src/man/man3c/dbm_open.3c
+usr/src/man/man3c/dbm_store.3c
+usr/src/man/man3c/dcgettext.3c
+usr/src/man/man3c/dcngettext.3c
+usr/src/man/man3c/decimal_to_double.3c
+usr/src/man/man3c/decimal_to_extended.3c
+usr/src/man/man3c/decimal_to_quadruple.3c
+usr/src/man/man3c/decimal_to_single.3c
+usr/src/man/man3c/dgettext.3c
+usr/src/man/man3c/dladdr1.3c
+usr/src/man/man3c/dlmopen.3c
+usr/src/man/man3c/dngettext.3c
+usr/src/man/man3c/door_setparam.3c
+usr/src/man/man3c/door_unbind.3c
+usr/src/man/man3c/double_to_decimal.3c
+usr/src/man/man3c/edata.3c
+usr/src/man/man3c/endgrent.3c
+usr/src/man/man3c/endnetgrent.3c
+usr/src/man/man3c/endpwent.3c
+usr/src/man/man3c/endspent.3c
+usr/src/man/man3c/endusershell.3c
+usr/src/man/man3c/endutent.3c
+usr/src/man/man3c/endutxent.3c
+usr/src/man/man3c/erand48.3c
+usr/src/man/man3c/errno.3c
+usr/src/man/man3c/errx.3c
+usr/src/man/man3c/etext.3c
+usr/src/man/man3c/euccol.3c
+usr/src/man/man3c/eucscol.3c
+usr/src/man/man3c/extended_to_decimal.3c
+usr/src/man/man3c/fconvert.3c
+usr/src/man/man3c/fcvt.3c
+usr/src/man/man3c/fdopendir.3c
+usr/src/man/man3c/fdwalk.3c
+usr/src/man/man3c/feof.3c
+usr/src/man/man3c/fgetgrent.3c
+usr/src/man/man3c/fgetgrent_r.3c
+usr/src/man/man3c/fgetpwent.3c
+usr/src/man/man3c/fgetpwent_r.3c
+usr/src/man/man3c/fgets.3c
+usr/src/man/man3c/fgetspent.3c
+usr/src/man/man3c/fgetspent_r.3c
+usr/src/man/man3c/fgetws.3c
+usr/src/man/man3c/file_to_decimal.3c
+usr/src/man/man3c/fileno.3c
+usr/src/man/man3c/finite.3c
+usr/src/man/man3c/fpclass.3c
+usr/src/man/man3c/fpgetmask.3c
+usr/src/man/man3c/fpgetsticky.3c
+usr/src/man/man3c/fprintf.3c
+usr/src/man/man3c/fpsetmask.3c
+usr/src/man/man3c/fpsetround.3c
+usr/src/man/man3c/fpsetsticky.3c
+usr/src/man/man3c/fputs.3c
+usr/src/man/man3c/free.3c
+usr/src/man/man3c/fscanf.3c
+usr/src/man/man3c/fseeko.3c
+usr/src/man/man3c/fsetattr.3c
+usr/src/man/man3c/ftello.3c
+usr/src/man/man3c/ftruncate.3c
+usr/src/man/man3c/ftrylockfile.3c
+usr/src/man/man3c/func_to_decimal.3c
+usr/src/man/man3c/funlockfile.3c
+usr/src/man/man3c/gconvert.3c
+usr/src/man/man3c/gcvt.3c
+usr/src/man/man3c/getattrat.3c
+usr/src/man/man3c/getc.3c
+usr/src/man/man3c/getc_unlocked.3c
+usr/src/man/man3c/getchar.3c
+usr/src/man/man3c/getchar_unlocked.3c
+usr/src/man/man3c/getextmntent.3c
+usr/src/man/man3c/getgrent.3c
+usr/src/man/man3c/getgrent_r.3c
+usr/src/man/man3c/getgrgid.3c
+usr/src/man/man3c/getgrgid_r.3c
+usr/src/man/man3c/getgrnam_r.3c
+usr/src/man/man3c/gethomelgroup.3c
+usr/src/man/man3c/gethrvtime.3c
+usr/src/man/man3c/getlogin_r.3c
+usr/src/man/man3c/getmntany.3c
+usr/src/man/man3c/getnetgrent_r.3c
+usr/src/man/man3c/getpassphrase.3c
+usr/src/man/man3c/getpwent.3c
+usr/src/man/man3c/getpwent_r.3c
+usr/src/man/man3c/getpwnam_r.3c
+usr/src/man/man3c/getpwuid.3c
+usr/src/man/man3c/getpwuid_r.3c
+usr/src/man/man3c/getspent.3c
+usr/src/man/man3c/getspent_r.3c
+usr/src/man/man3c/getspnam_r.3c
+usr/src/man/man3c/getutid.3c
+usr/src/man/man3c/getutline.3c
+usr/src/man/man3c/getutmp.3c
+usr/src/man/man3c/getutmpx.3c
+usr/src/man/man3c/getutxid.3c
+usr/src/man/man3c/getutxline.3c
+usr/src/man/man3c/getvfsany.3c
+usr/src/man/man3c/getvfsfile.3c
+usr/src/man/man3c/getvfsspec.3c
+usr/src/man/man3c/getw.3c
+usr/src/man/man3c/getzoneidbyname.3c
+usr/src/man/man3c/getzonenamebyid.3c
+usr/src/man/man3c/globfree.3c
+usr/src/man/man3c/gmtime.3c
+usr/src/man/man3c/gmtime_r.3c
+usr/src/man/man3c/gsignal.3c
+usr/src/man/man3c/hasmntopt.3c
+usr/src/man/man3c/hcreate.3c
+usr/src/man/man3c/hdestroy.3c
+usr/src/man/man3c/initstate.3c
+usr/src/man/man3c/innetgr.3c
+usr/src/man/man3c/isalnum.3c
+usr/src/man/man3c/isalpha.3c
+usr/src/man/man3c/isascii.3c
+usr/src/man/man3c/isblank.3c
+usr/src/man/man3c/iscntrl.3c
+usr/src/man/man3c/isdigit.3c
+usr/src/man/man3c/isenglish.3c
+usr/src/man/man3c/isgraph.3c
+usr/src/man/man3c/isideogram.3c
+usr/src/man/man3c/islower.3c
+usr/src/man/man3c/isnanf.3c
+usr/src/man/man3c/isnumber.3c
+usr/src/man/man3c/isphonogram.3c
+usr/src/man/man3c/isprint.3c
+usr/src/man/man3c/ispunct.3c
+usr/src/man/man3c/isspace.3c
+usr/src/man/man3c/isspecial.3c
+usr/src/man/man3c/isupper.3c
+usr/src/man/man3c/iswalnum.3c
+usr/src/man/man3c/iswascii.3c
+usr/src/man/man3c/iswblank.3c
+usr/src/man/man3c/iswcntrl.3c
+usr/src/man/man3c/iswdigit.3c
+usr/src/man/man3c/iswgraph.3c
+usr/src/man/man3c/iswlower.3c
+usr/src/man/man3c/iswprint.3c
+usr/src/man/man3c/iswpunct.3c
+usr/src/man/man3c/iswspace.3c
+usr/src/man/man3c/iswupper.3c
+usr/src/man/man3c/iswxdigit.3c
+usr/src/man/man3c/isxdigit.3c
+usr/src/man/man3c/jrand48.3c
+usr/src/man/man3c/l64a.3c
+usr/src/man/man3c/labs.3c
+usr/src/man/man3c/lcong48.3c
+usr/src/man/man3c/ldiv.3c
+usr/src/man/man3c/lfind.3c
+usr/src/man/man3c/llabs.3c
+usr/src/man/man3c/lldiv.3c
+usr/src/man/man3c/lltostr.3c
+usr/src/man/man3c/localtime.3c
+usr/src/man/man3c/localtime_r.3c
+usr/src/man/man3c/longjmp.3c
+usr/src/man/man3c/lrand48.3c
+usr/src/man/man3c/major.3c
+usr/src/man/man3c/memalign.3c
+usr/src/man/man3c/membar_consumer.3c
+usr/src/man/man3c/membar_enter.3c
+usr/src/man/man3c/membar_exit.3c
+usr/src/man/man3c/membar_producer.3c
+usr/src/man/man3c/memccpy.3c
+usr/src/man/man3c/memchr.3c
+usr/src/man/man3c/memcmp.3c
+usr/src/man/man3c/memcpy.3c
+usr/src/man/man3c/memmove.3c
+usr/src/man/man3c/memset.3c
+usr/src/man/man3c/minor.3c
+usr/src/man/man3c/mkdtemp.3c
+usr/src/man/man3c/mkstemps.3c
+usr/src/man/man3c/mq_reltimedreceive_np.3c
+usr/src/man/man3c/mq_reltimedsend_np.3c
+usr/src/man/man3c/mq_timedreceive.3c
+usr/src/man/man3c/mq_timedsend.3c
+usr/src/man/man3c/mrand48.3c
+usr/src/man/man3c/munlock.3c
+usr/src/man/man3c/munlockall.3c
+usr/src/man/man3c/mutex_consistent.3c
+usr/src/man/man3c/mutex_destroy.3c
+usr/src/man/man3c/mutex_lock.3c
+usr/src/man/man3c/mutex_trylock.3c
+usr/src/man/man3c/mutex_unlock.3c
+usr/src/man/man3c/nftw.3c
+usr/src/man/man3c/ngettext.3c
+usr/src/man/man3c/nrand48.3c
+usr/src/man/man3c/openlog.3c
+usr/src/man/man3c/pclose.3c
+usr/src/man/man3c/port_dissociate.3c
+usr/src/man/man3c/port_getn.3c
+usr/src/man/man3c/port_sendn.3c
+usr/src/man/man3c/posix_spawn_file_actions_addopen.3c
+usr/src/man/man3c/posix_spawn_file_actions_init.3c
+usr/src/man/man3c/posix_spawnattr_init.3c
+usr/src/man/man3c/posix_spawnattr_setflags.3c
+usr/src/man/man3c/posix_spawnattr_setpgroup.3c
+usr/src/man/man3c/posix_spawnattr_setschedparam.3c
+usr/src/man/man3c/posix_spawnattr_setschedpolicy.3c
+usr/src/man/man3c/posix_spawnattr_setsigdefault.3c
+usr/src/man/man3c/posix_spawnattr_setsigignore_np.3c
+usr/src/man/man3c/posix_spawnattr_setsigmask.3c
+usr/src/man/man3c/posix_spawnp.3c
+usr/src/man/man3c/printstack.3c
+usr/src/man/man3c/priv_allocset.3c
+usr/src/man/man3c/priv_basicset.3c
+usr/src/man/man3c/priv_copyset.3c
+usr/src/man/man3c/priv_delset.3c
+usr/src/man/man3c/priv_emptyset.3c
+usr/src/man/man3c/priv_fillset.3c
+usr/src/man/man3c/priv_freeset.3c
+usr/src/man/man3c/priv_getbyname.3c
+usr/src/man/man3c/priv_getbynum.3c
+usr/src/man/man3c/priv_getsetbyname.3c
+usr/src/man/man3c/priv_getsetbynum.3c
+usr/src/man/man3c/priv_gettext.3c
+usr/src/man/man3c/priv_ineffect.3c
+usr/src/man/man3c/priv_intersect.3c
+usr/src/man/man3c/priv_inverse.3c
+usr/src/man/man3c/priv_isemptyset.3c
+usr/src/man/man3c/priv_isequalset.3c
+usr/src/man/man3c/priv_isfullset.3c
+usr/src/man/man3c/priv_ismember.3c
+usr/src/man/man3c/priv_issubset.3c
+usr/src/man/man3c/priv_set_to_str.3c
+usr/src/man/man3c/priv_union.3c
+usr/src/man/man3c/pselect.3c
+usr/src/man/man3c/psiginfo.3c
+usr/src/man/man3c/pthread_attr_destroy.3c
+usr/src/man/man3c/pthread_attr_setdetachstate.3c
+usr/src/man/man3c/pthread_attr_setguardsize.3c
+usr/src/man/man3c/pthread_attr_setinheritsched.3c
+usr/src/man/man3c/pthread_attr_setschedparam.3c
+usr/src/man/man3c/pthread_attr_setschedpolicy.3c
+usr/src/man/man3c/pthread_attr_setscope.3c
+usr/src/man/man3c/pthread_attr_setstack.3c
+usr/src/man/man3c/pthread_attr_setstackaddr.3c
+usr/src/man/man3c/pthread_attr_setstacksize.3c
+usr/src/man/man3c/pthread_barrier_init.3c
+usr/src/man/man3c/pthread_barrierattr_init.3c
+usr/src/man/man3c/pthread_barrierattr_setpshared.3c
+usr/src/man/man3c/pthread_cond_broadcast.3c
+usr/src/man/man3c/pthread_cond_destroy.3c
+usr/src/man/man3c/pthread_cond_reltimedwait_np.3c
+usr/src/man/man3c/pthread_cond_timedwait.3c
+usr/src/man/man3c/pthread_condattr_destroy.3c
+usr/src/man/man3c/pthread_condattr_setclock.3c
+usr/src/man/man3c/pthread_condattr_setpshared.3c
+usr/src/man/man3c/pthread_key_create_once_np.3c
+usr/src/man/man3c/pthread_mutex_destroy.3c
+usr/src/man/man3c/pthread_mutex_reltimedlock_np.3c
+usr/src/man/man3c/pthread_mutex_setprioceiling.3c
+usr/src/man/man3c/pthread_mutex_trylock.3c
+usr/src/man/man3c/pthread_mutex_unlock.3c
+usr/src/man/man3c/pthread_mutexattr_destroy.3c
+usr/src/man/man3c/pthread_mutexattr_setprioceiling.3c
+usr/src/man/man3c/pthread_mutexattr_setprotocol.3c
+usr/src/man/man3c/pthread_mutexattr_setpshared.3c
+usr/src/man/man3c/pthread_mutexattr_settype.3c
+usr/src/man/man3c/pthread_rwlock_destroy.3c
+usr/src/man/man3c/pthread_rwlock_reltimedrdlock_np.3c
+usr/src/man/man3c/pthread_rwlock_reltimedwrlock_np.3c
+usr/src/man/man3c/pthread_rwlock_tryrdlock.3c
+usr/src/man/man3c/pthread_rwlock_trywrlock.3c
+usr/src/man/man3c/pthread_rwlockattr_destroy.3c
+usr/src/man/man3c/pthread_rwlockattr_setpshared.3c
+usr/src/man/man3c/pthread_setconcurrency.3c
+usr/src/man/man3c/pthread_setschedparam.3c
+usr/src/man/man3c/pthread_setspecific.3c
+usr/src/man/man3c/pthread_spin_init.3c
+usr/src/man/man3c/pthread_spin_trylock.3c
+usr/src/man/man3c/putc.3c
+usr/src/man/man3c/putc_unlocked.3c
+usr/src/man/man3c/putchar.3c
+usr/src/man/man3c/putchar_unlocked.3c
+usr/src/man/man3c/putmntent.3c
+usr/src/man/man3c/pututline.3c
+usr/src/man/man3c/pututxline.3c
+usr/src/man/man3c/putw.3c
+usr/src/man/man3c/putwc.3c
+usr/src/man/man3c/putwchar.3c
+usr/src/man/man3c/qeconvert.3c
+usr/src/man/man3c/qfconvert.3c
+usr/src/man/man3c/qgconvert.3c
+usr/src/man/man3c/quadruple_to_decimal.3c
+usr/src/man/man3c/rand_r.3c
+usr/src/man/man3c/rctlblk_get_enforced_value.3c
+usr/src/man/man3c/rctlblk_get_firing_time.3c
+usr/src/man/man3c/rctlblk_get_global_action.3c
+usr/src/man/man3c/rctlblk_get_global_flags.3c
+usr/src/man/man3c/rctlblk_get_local_action.3c
+usr/src/man/man3c/rctlblk_get_local_flags.3c
+usr/src/man/man3c/rctlblk_get_privilege.3c
+usr/src/man/man3c/rctlblk_get_recipient_pid.3c
+usr/src/man/man3c/rctlblk_get_value.3c
+usr/src/man/man3c/rctlblk_set_local_action.3c
+usr/src/man/man3c/rctlblk_set_local_flags.3c
+usr/src/man/man3c/rctlblk_set_privilege.3c
+usr/src/man/man3c/rctlblk_set_recipient_pid.3c
+usr/src/man/man3c/rctlblk_size.3c
+usr/src/man/man3c/re_exec.3c
+usr/src/man/man3c/readdir_r.3c
+usr/src/man/man3c/realloc.3c
+usr/src/man/man3c/regerror.3c
+usr/src/man/man3c/regex.3c
+usr/src/man/man3c/regexec.3c
+usr/src/man/man3c/regfree.3c
+usr/src/man/man3c/remque.3c
+usr/src/man/man3c/resetmnttab.3c
+usr/src/man/man3c/rindex.3c
+usr/src/man/man3c/rw_rdlock.3c
+usr/src/man/man3c/rw_tryrdlock.3c
+usr/src/man/man3c/rw_trywrlock.3c
+usr/src/man/man3c/rw_unlock.3c
+usr/src/man/man3c/rw_wrlock.3c
+usr/src/man/man3c/rwlock_destroy.3c
+usr/src/man/man3c/rwlock_init.3c
+usr/src/man/man3c/sched_get_priority_min.3c
+usr/src/man/man3c/schedctl_exit.3c
+usr/src/man/man3c/schedctl_lookup.3c
+usr/src/man/man3c/schedctl_start.3c
+usr/src/man/man3c/schedctl_stop.3c
+usr/src/man/man3c/seconvert.3c
+usr/src/man/man3c/seed48.3c
+usr/src/man/man3c/sem_reltimedwait_np.3c
+usr/src/man/man3c/sem_trywait.3c
+usr/src/man/man3c/sema_destroy.3c
+usr/src/man/man3c/sema_init.3c
+usr/src/man/man3c/sema_post.3c
+usr/src/man/man3c/sema_trywait.3c
+usr/src/man/man3c/sema_wait.3c
+usr/src/man/man3c/setattrat.3c
+usr/src/man/man3c/setgrent.3c
+usr/src/man/man3c/sethostname.3c
+usr/src/man/man3c/setlinebuf.3c
+usr/src/man/man3c/setlogmask.3c
+usr/src/man/man3c/setnetgrent.3c
+usr/src/man/man3c/setpriority.3c
+usr/src/man/man3c/setpwent.3c
+usr/src/man/man3c/setspent.3c
+usr/src/man/man3c/setstate.3c
+usr/src/man/man3c/settimeofday.3c
+usr/src/man/man3c/setusershell.3c
+usr/src/man/man3c/setutent.3c
+usr/src/man/man3c/setutxent.3c
+usr/src/man/man3c/setvbuf.3c
+usr/src/man/man3c/sfconvert.3c
+usr/src/man/man3c/sgconvert.3c
+usr/src/man/man3c/sig2str.3c
+usr/src/man/man3c/sigaddset.3c
+usr/src/man/man3c/sigdelset.3c
+usr/src/man/man3c/sigemptyset.3c
+usr/src/man/man3c/sigfillset.3c
+usr/src/man/man3c/sighold.3c
+usr/src/man/man3c/sigignore.3c
+usr/src/man/man3c/sigismember.3c
+usr/src/man/man3c/siglongjmp.3c
+usr/src/man/man3c/sigpause.3c
+usr/src/man/man3c/sigrelse.3c
+usr/src/man/man3c/sigset.3c
+usr/src/man/man3c/sigsetjmp.3c
+usr/src/man/man3c/sigtimedwait.3c
+usr/src/man/man3c/single_to_decimal.3c
+usr/src/man/man3c/snprintf.3c
+usr/src/man/man3c/sprintf.3c
+usr/src/man/man3c/srand.3c
+usr/src/man/man3c/srand48.3c
+usr/src/man/man3c/srandom.3c
+usr/src/man/man3c/sscanf.3c
+usr/src/man/man3c/strcasecmp.3c
+usr/src/man/man3c/strcat.3c
+usr/src/man/man3c/strchr.3c
+usr/src/man/man3c/strcmp.3c
+usr/src/man/man3c/strcpy.3c
+usr/src/man/man3c/strcspn.3c
+usr/src/man/man3c/strdup.3c
+usr/src/man/man3c/strerror_r.3c
+usr/src/man/man3c/strlcat.3c
+usr/src/man/man3c/strlcpy.3c
+usr/src/man/man3c/strlen.3c
+usr/src/man/man3c/strncasecmp.3c
+usr/src/man/man3c/strncat.3c
+usr/src/man/man3c/strncmp.3c
+usr/src/man/man3c/strncpy.3c
+usr/src/man/man3c/strnlen.3c
+usr/src/man/man3c/strpbrk.3c
+usr/src/man/man3c/strrchr.3c
+usr/src/man/man3c/strsep.3c
+usr/src/man/man3c/strspn.3c
+usr/src/man/man3c/strstr.3c
+usr/src/man/man3c/strtof.3c
+usr/src/man/man3c/strtok.3c
+usr/src/man/man3c/strtok_r.3c
+usr/src/man/man3c/strtold.3c
+usr/src/man/man3c/strtoll.3c
+usr/src/man/man3c/strtoull.3c
+usr/src/man/man3c/strtoumax.3c
+usr/src/man/man3c/swapcontext.3c
+usr/src/man/man3c/swprintf.3c
+usr/src/man/man3c/swscanf.3c
+usr/src/man/man3c/tdelete.3c
+usr/src/man/man3c/tempnam.3c
+usr/src/man/man3c/textdomain.3c
+usr/src/man/man3c/tfind.3c
+usr/src/man/man3c/thr_continue.3c
+usr/src/man/man3c/thr_getspecific.3c
+usr/src/man/man3c/thr_keycreate_once.3c
+usr/src/man/man3c/thr_setconcurrency.3c
+usr/src/man/man3c/thr_setprio.3c
+usr/src/man/man3c/thr_setspecific.3c
+usr/src/man/man3c/timer_getoverrun.3c
+usr/src/man/man3c/timer_gettime.3c
+usr/src/man/man3c/timerclear.3c
+usr/src/man/man3c/timercmp.3c
+usr/src/man/man3c/timerisset.3c
+usr/src/man/man3c/timersub.3c
+usr/src/man/man3c/tmpnam_r.3c
+usr/src/man/man3c/ttyname_r.3c
+usr/src/man/man3c/twalk.3c
+usr/src/man/man3c/tzset.3c
+usr/src/man/man3c/uconv_u16tou8.3c
+usr/src/man/man3c/uconv_u32tou16.3c
+usr/src/man/man3c/uconv_u32tou8.3c
+usr/src/man/man3c/uconv_u8tou16.3c
+usr/src/man/man3c/uconv_u8tou32.3c
+usr/src/man/man3c/ucred_free.3c
+usr/src/man/man3c/ucred_getegid.3c
+usr/src/man/man3c/ucred_geteuid.3c
+usr/src/man/man3c/ucred_getgroups.3c
+usr/src/man/man3c/ucred_getlabel.3c
+usr/src/man/man3c/ucred_getpflags.3c
+usr/src/man/man3c/ucred_getpid.3c
+usr/src/man/man3c/ucred_getprivset.3c
+usr/src/man/man3c/ucred_getprojid.3c
+usr/src/man/man3c/ucred_getrgid.3c
+usr/src/man/man3c/ucred_getruid.3c
+usr/src/man/man3c/ucred_getsgid.3c
+usr/src/man/man3c/ucred_getsuid.3c
+usr/src/man/man3c/ucred_getzoneid.3c
+usr/src/man/man3c/ucred_size.3c
+usr/src/man/man3c/ulckpwdf.3c
+usr/src/man/man3c/ulltostr.3c
+usr/src/man/man3c/unordered.3c
+usr/src/man/man3c/updwtmp.3c
+usr/src/man/man3c/updwtmpx.3c
+usr/src/man/man3c/utmpname.3c
+usr/src/man/man3c/utmpxname.3c
+usr/src/man/man3c/valloc.3c
+usr/src/man/man3c/vasprintf.3c
+usr/src/man/man3c/verr.3c
+usr/src/man/man3c/verrx.3c
+usr/src/man/man3c/vfprintf.3c
+usr/src/man/man3c/vfscanf.3c
+usr/src/man/man3c/vfwscanf.3c
+usr/src/man/man3c/vscanf.3c
+usr/src/man/man3c/vsnprintf.3c
+usr/src/man/man3c/vsprintf.3c
+usr/src/man/man3c/vsscanf.3c
+usr/src/man/man3c/vswprintf.3c
+usr/src/man/man3c/vswscanf.3c
+usr/src/man/man3c/vwarn.3c
+usr/src/man/man3c/vwarnx.3c
+usr/src/man/man3c/vwprintf.3c
+usr/src/man/man3c/vwscanf.3c
+usr/src/man/man3c/wait4.3c
+usr/src/man/man3c/warn.3c
+usr/src/man/man3c/warnx.3c
+usr/src/man/man3c/watof.3c
+usr/src/man/man3c/watoi.3c
+usr/src/man/man3c/watol.3c
+usr/src/man/man3c/watoll.3c
+usr/src/man/man3c/wcscat.3c
+usr/src/man/man3c/wcschr.3c
+usr/src/man/man3c/wcscmp.3c
+usr/src/man/man3c/wcscpy.3c
+usr/src/man/man3c/wcscspn.3c
+usr/src/man/man3c/wcsetno.3c
+usr/src/man/man3c/wcslen.3c
+usr/src/man/man3c/wcsncat.3c
+usr/src/man/man3c/wcsncmp.3c
+usr/src/man/man3c/wcsncpy.3c
+usr/src/man/man3c/wcspbrk.3c
+usr/src/man/man3c/wcsrchr.3c
+usr/src/man/man3c/wcsspn.3c
+usr/src/man/man3c/wcstof.3c
+usr/src/man/man3c/wcstok.3c
+usr/src/man/man3c/wcstold.3c
+usr/src/man/man3c/wcstoll.3c
+usr/src/man/man3c/wcstoull.3c
+usr/src/man/man3c/wcstoumax.3c
+usr/src/man/man3c/wcswcs.3c
+usr/src/man/man3c/windex.3c
+usr/src/man/man3c/wordfree.3c
+usr/src/man/man3c/wprintf.3c
+usr/src/man/man3c/wrindex.3c
+usr/src/man/man3c/wscanf.3c
+usr/src/man/man3c/wscasecmp.3c
+usr/src/man/man3c/wscat.3c
+usr/src/man/man3c/wschr.3c
+usr/src/man/man3c/wscmp.3c
+usr/src/man/man3c/wscol.3c
+usr/src/man/man3c/wscoll.3c
+usr/src/man/man3c/wscpy.3c
+usr/src/man/man3c/wscspn.3c
+usr/src/man/man3c/wsdup.3c
+usr/src/man/man3c/wslen.3c
+usr/src/man/man3c/wsncasecmp.3c
+usr/src/man/man3c/wsncat.3c
+usr/src/man/man3c/wsncmp.3c
+usr/src/man/man3c/wsncpy.3c
+usr/src/man/man3c/wspbrk.3c
+usr/src/man/man3c/wsrchr.3c
+usr/src/man/man3c/wsspn.3c
+usr/src/man/man3c/wstod.3c
+usr/src/man/man3c/wstok.3c
+usr/src/man/man3c/wstol.3c
+usr/src/man/man3c/wstostr.3c
+usr/src/man/man3c/wsxfrm.3c
+usr/src/man/man3c_db/td_event_addset.3c_db
+usr/src/man/man3c_db/td_event_delset.3c_db
+usr/src/man/man3c_db/td_event_emptyset.3c_db
+usr/src/man/man3c_db/td_event_fillset.3c_db
+usr/src/man/man3c_db/td_eventisempty.3c_db
+usr/src/man/man3c_db/td_eventismember.3c_db
+usr/src/man/man3c_db/td_sync_get_stats.3c_db
+usr/src/man/man3c_db/td_sync_setstate.3c_db
+usr/src/man/man3c_db/td_sync_waiters.3c_db
+usr/src/man/man3c_db/td_ta_clear_event.3c_db
+usr/src/man/man3c_db/td_ta_delete.3c_db
+usr/src/man/man3c_db/td_ta_event_getmsg.3c_db
+usr/src/man/man3c_db/td_ta_get_ph.3c_db
+usr/src/man/man3c_db/td_ta_get_stats.3c_db
+usr/src/man/man3c_db/td_ta_map_lwp2thr.3c_db
+usr/src/man/man3c_db/td_ta_reset_stats.3c_db
+usr/src/man/man3c_db/td_ta_set_event.3c_db
+usr/src/man/man3c_db/td_ta_sync_tracking_enable.3c_db
+usr/src/man/man3c_db/td_ta_thr_iter.3c_db
+usr/src/man/man3c_db/td_ta_tsd_iter.3c_db
+usr/src/man/man3c_db/td_thr_clear_event.3c_db
+usr/src/man/man3c_db/td_thr_dbresume.3c_db
+usr/src/man/man3c_db/td_thr_event_enable.3c_db
+usr/src/man/man3c_db/td_thr_event_getmsg.3c_db
+usr/src/man/man3c_db/td_thr_getfpregs.3c_db
+usr/src/man/man3c_db/td_thr_getxregs.3c_db
+usr/src/man/man3c_db/td_thr_getxregsize.3c_db
+usr/src/man/man3c_db/td_thr_set_event.3c_db
+usr/src/man/man3c_db/td_thr_setfpregs.3c_db
+usr/src/man/man3c_db/td_thr_setgregs.3c_db
+usr/src/man/man3c_db/td_thr_setxregs.3c_db
+usr/src/man/man3c_db/td_thr_sigsetmask.3c_db
+usr/src/man/man3cfgadm/config_ap_id_cmp.3cfgadm
+usr/src/man/man3cfgadm/config_change_state.3cfgadm
+usr/src/man/man3cfgadm/config_list.3cfgadm
+usr/src/man/man3cfgadm/config_list_ext.3cfgadm
+usr/src/man/man3cfgadm/config_private_func.3cfgadm
+usr/src/man/man3cfgadm/config_stat.3cfgadm
+usr/src/man/man3cfgadm/config_strerror.3cfgadm
+usr/src/man/man3cfgadm/config_test.3cfgadm
+usr/src/man/man3cfgadm/config_unload_libs.3cfgadm
+usr/src/man/man3commputil/sdp_add_attribute.3commputil
+usr/src/man/man3commputil/sdp_add_bandwidth.3commputil
+usr/src/man/man3commputil/sdp_add_connection.3commputil
+usr/src/man/man3commputil/sdp_add_email.3commputil
+usr/src/man/man3commputil/sdp_add_information.3commputil
+usr/src/man/man3commputil/sdp_add_key.3commputil
+usr/src/man/man3commputil/sdp_add_media.3commputil
+usr/src/man/man3commputil/sdp_add_name.3commputil
+usr/src/man/man3commputil/sdp_add_phone.3commputil
+usr/src/man/man3commputil/sdp_add_repeat.3commputil
+usr/src/man/man3commputil/sdp_add_time.3commputil
+usr/src/man/man3commputil/sdp_add_uri.3commputil
+usr/src/man/man3commputil/sdp_add_zone.3commputil
+usr/src/man/man3commputil/sdp_delete_all_media_field.3commputil
+usr/src/man/man3commputil/sdp_delete_attribute.3commputil
+usr/src/man/man3commputil/sdp_free_session.3commputil
+usr/src/man/man3contract/ct_ctl_abandon.3contract
+usr/src/man/man3contract/ct_ctl_ack.3contract
+usr/src/man/man3contract/ct_ctl_nack.3contract
+usr/src/man/man3contract/ct_ctl_newct.3contract
+usr/src/man/man3contract/ct_ctl_qack.3contract
+usr/src/man/man3contract/ct_dev_status_get_aset.3contract
+usr/src/man/man3contract/ct_dev_status_get_minor.3contract
+usr/src/man/man3contract/ct_dev_status_get_noneg.3contract
+usr/src/man/man3contract/ct_dev_tmpl_clear_noneg.3contract
+usr/src/man/man3contract/ct_dev_tmpl_get_aset.3contract
+usr/src/man/man3contract/ct_dev_tmpl_get_minor.3contract
+usr/src/man/man3contract/ct_dev_tmpl_get_noneg.3contract
+usr/src/man/man3contract/ct_dev_tmpl_set_minor.3contract
+usr/src/man/man3contract/ct_dev_tmpl_set_noneg.3contract
+usr/src/man/man3contract/ct_event_free.3contract
+usr/src/man/man3contract/ct_event_get_ctid.3contract
+usr/src/man/man3contract/ct_event_get_evid.3contract
+usr/src/man/man3contract/ct_event_get_flags.3contract
+usr/src/man/man3contract/ct_event_get_nevid.3contract
+usr/src/man/man3contract/ct_event_get_newct.3contract
+usr/src/man/man3contract/ct_event_get_type.3contract
+usr/src/man/man3contract/ct_event_read_critical.3contract
+usr/src/man/man3contract/ct_event_reliable.3contract
+usr/src/man/man3contract/ct_event_reset.3contract
+usr/src/man/man3contract/ct_pr_event_get_exitstatus.3contract
+usr/src/man/man3contract/ct_pr_event_get_gcorefile.3contract
+usr/src/man/man3contract/ct_pr_event_get_pcorefile.3contract
+usr/src/man/man3contract/ct_pr_event_get_ppid.3contract
+usr/src/man/man3contract/ct_pr_event_get_sender.3contract
+usr/src/man/man3contract/ct_pr_event_get_senderct.3contract
+usr/src/man/man3contract/ct_pr_event_get_signal.3contract
+usr/src/man/man3contract/ct_pr_event_get_zcorefile.3contract
+usr/src/man/man3contract/ct_pr_status_get_contracts.3contract
+usr/src/man/man3contract/ct_pr_status_get_fatal.3contract
+usr/src/man/man3contract/ct_pr_status_get_members.3contract
+usr/src/man/man3contract/ct_pr_status_get_svc_aux.3contract
+usr/src/man/man3contract/ct_pr_status_get_svc_creator.3contract
+usr/src/man/man3contract/ct_pr_status_get_svc_ctid.3contract
+usr/src/man/man3contract/ct_pr_status_get_svc_fmri.3contract
+usr/src/man/man3contract/ct_pr_tmpl_get_fatal.3contract
+usr/src/man/man3contract/ct_pr_tmpl_get_param.3contract
+usr/src/man/man3contract/ct_pr_tmpl_get_svc_aux.3contract
+usr/src/man/man3contract/ct_pr_tmpl_get_svc_fmri.3contract
+usr/src/man/man3contract/ct_pr_tmpl_get_transfer.3contract
+usr/src/man/man3contract/ct_pr_tmpl_set_fatal.3contract
+usr/src/man/man3contract/ct_pr_tmpl_set_param.3contract
+usr/src/man/man3contract/ct_pr_tmpl_set_svc_aux.3contract
+usr/src/man/man3contract/ct_pr_tmpl_set_svc_fmri.3contract
+usr/src/man/man3contract/ct_status_free.3contract
+usr/src/man/man3contract/ct_status_get_cookie.3contract
+usr/src/man/man3contract/ct_status_get_critical.3contract
+usr/src/man/man3contract/ct_status_get_holder.3contract
+usr/src/man/man3contract/ct_status_get_id.3contract
+usr/src/man/man3contract/ct_status_get_informative.3contract
+usr/src/man/man3contract/ct_status_get_nevents.3contract
+usr/src/man/man3contract/ct_status_get_nevid.3contract
+usr/src/man/man3contract/ct_status_get_ntime.3contract
+usr/src/man/man3contract/ct_status_get_qtime.3contract
+usr/src/man/man3contract/ct_status_get_state.3contract
+usr/src/man/man3contract/ct_status_get_type.3contract
+usr/src/man/man3contract/ct_status_get_zoneid.3contract
+usr/src/man/man3contract/ct_tmpl_clear.3contract
+usr/src/man/man3contract/ct_tmpl_create.3contract
+usr/src/man/man3contract/ct_tmpl_get_cookie.3contract
+usr/src/man/man3contract/ct_tmpl_get_critical.3contract
+usr/src/man/man3contract/ct_tmpl_get_informative.3contract
+usr/src/man/man3contract/ct_tmpl_set_cookie.3contract
+usr/src/man/man3contract/ct_tmpl_set_critical.3contract
+usr/src/man/man3contract/ct_tmpl_set_informative.3contract
+usr/src/man/man3cpc/cpc_bind_cpu.3cpc
+usr/src/man/man3cpc/cpc_bind_pctx.3cpc
+usr/src/man/man3cpc/cpc_buf_add.3cpc
+usr/src/man/man3cpc/cpc_buf_copy.3cpc
+usr/src/man/man3cpc/cpc_buf_destroy.3cpc
+usr/src/man/man3cpc/cpc_buf_get.3cpc
+usr/src/man/man3cpc/cpc_buf_hrtime.3cpc
+usr/src/man/man3cpc/cpc_buf_set.3cpc
+usr/src/man/man3cpc/cpc_buf_sub.3cpc
+usr/src/man/man3cpc/cpc_buf_tick.3cpc
+usr/src/man/man3cpc/cpc_buf_zero.3cpc
+usr/src/man/man3cpc/cpc_caps.3cpc
+usr/src/man/man3cpc/cpc_cciname.3cpc
+usr/src/man/man3cpc/cpc_close.3cpc
+usr/src/man/man3cpc/cpc_count_sys_events.3cpc
+usr/src/man/man3cpc/cpc_cpuref.3cpc
+usr/src/man/man3cpc/cpc_disable.3cpc
+usr/src/man/man3cpc/cpc_event_accum.3cpc
+usr/src/man/man3cpc/cpc_eventtostr.3cpc
+usr/src/man/man3cpc/cpc_getcciname.3cpc
+usr/src/man/man3cpc/cpc_getcpuref.3cpc
+usr/src/man/man3cpc/cpc_getnpic.3cpc
+usr/src/man/man3cpc/cpc_getusage.3cpc
+usr/src/man/man3cpc/cpc_pctx_invalidate.3cpc
+usr/src/man/man3cpc/cpc_pctx_rele.3cpc
+usr/src/man/man3cpc/cpc_pctx_take_sample.3cpc
+usr/src/man/man3cpc/cpc_rele.3cpc
+usr/src/man/man3cpc/cpc_request_preset.3cpc
+usr/src/man/man3cpc/cpc_set_add_request.3cpc
+usr/src/man/man3cpc/cpc_set_destroy.3cpc
+usr/src/man/man3cpc/cpc_set_restart.3cpc
+usr/src/man/man3cpc/cpc_set_sample.3cpc
+usr/src/man/man3cpc/cpc_shared_bind_event.3cpc
+usr/src/man/man3cpc/cpc_shared_close.3cpc
+usr/src/man/man3cpc/cpc_shared_rele.3cpc
+usr/src/man/man3cpc/cpc_shared_take_sample.3cpc
+usr/src/man/man3cpc/cpc_take_sample.3cpc
+usr/src/man/man3cpc/cpc_unbind.3cpc
+usr/src/man/man3cpc/cpc_walk_attrs.3cpc
+usr/src/man/man3cpc/cpc_walk_events_all.3cpc
+usr/src/man/man3cpc/cpc_walk_events_pic.3cpc
+usr/src/man/man3cpc/cpc_walk_generic_events_all.3cpc
+usr/src/man/man3cpc/cpc_walk_generic_events_pic.3cpc
+usr/src/man/man3cpc/cpc_walk_names.3cpc
+usr/src/man/man3cpc/cpc_walk_requests.3cpc
+usr/src/man/man3cpc/pctx_create.3cpc
+usr/src/man/man3cpc/pctx_release.3cpc
+usr/src/man/man3cpc/pctx_run.3cpc
+usr/src/man/man3curses/addch.3curses
+usr/src/man/man3curses/addchnstr.3curses
+usr/src/man/man3curses/addchstr.3curses
+usr/src/man/man3curses/addnstr.3curses
+usr/src/man/man3curses/addnwstr.3curses
+usr/src/man/man3curses/addstr.3curses
+usr/src/man/man3curses/addwch.3curses
+usr/src/man/man3curses/addwchnstr.3curses
+usr/src/man/man3curses/addwchstr.3curses
+usr/src/man/man3curses/addwstr.3curses
+usr/src/man/man3curses/adjcurspos.3curses
+usr/src/man/man3curses/attroff.3curses
+usr/src/man/man3curses/attron.3curses
+usr/src/man/man3curses/attrset.3curses
+usr/src/man/man3curses/baudrate.3curses
+usr/src/man/man3curses/beep.3curses
+usr/src/man/man3curses/bkgd.3curses
+usr/src/man/man3curses/bkgdset.3curses
+usr/src/man/man3curses/border.3curses
+usr/src/man/man3curses/bottom_panel.3curses
+usr/src/man/man3curses/box.3curses
+usr/src/man/man3curses/can_change_color.3curses
+usr/src/man/man3curses/cbreak.3curses
+usr/src/man/man3curses/clear.3curses
+usr/src/man/man3curses/clearok.3curses
+usr/src/man/man3curses/clrtobot.3curses
+usr/src/man/man3curses/clrtoeol.3curses
+usr/src/man/man3curses/color_content.3curses
+usr/src/man/man3curses/copywin.3curses
+usr/src/man/man3curses/current_field.3curses
+usr/src/man/man3curses/current_item.3curses
+usr/src/man/man3curses/curs_set.3curses
+usr/src/man/man3curses/data_ahead.3curses
+usr/src/man/man3curses/data_behind.3curses
+usr/src/man/man3curses/def_prog_mode.3curses
+usr/src/man/man3curses/def_shell_mode.3curses
+usr/src/man/man3curses/del_curterm.3curses
+usr/src/man/man3curses/del_panel.3curses
+usr/src/man/man3curses/delay_output.3curses
+usr/src/man/man3curses/delch.3curses
+usr/src/man/man3curses/deleteln.3curses
+usr/src/man/man3curses/delscreen.3curses
+usr/src/man/man3curses/delwin.3curses
+usr/src/man/man3curses/derwin.3curses
+usr/src/man/man3curses/doupdate.3curses
+usr/src/man/man3curses/dup_field.3curses
+usr/src/man/man3curses/dupwin.3curses
+usr/src/man/man3curses/dynamic_field_info.3curses
+usr/src/man/man3curses/echo.3curses
+usr/src/man/man3curses/echochar.3curses
+usr/src/man/man3curses/echowchar.3curses
+usr/src/man/man3curses/endwin.3curses
+usr/src/man/man3curses/erase.3curses
+usr/src/man/man3curses/erasechar.3curses
+usr/src/man/man3curses/field_arg.3curses
+usr/src/man/man3curses/field_back.3curses
+usr/src/man/man3curses/field_buffer.3curses
+usr/src/man/man3curses/field_count.3curses
+usr/src/man/man3curses/field_fore.3curses
+usr/src/man/man3curses/field_index.3curses
+usr/src/man/man3curses/field_info.3curses
+usr/src/man/man3curses/field_init.3curses
+usr/src/man/man3curses/field_just.3curses
+usr/src/man/man3curses/field_opts.3curses
+usr/src/man/man3curses/field_opts_off.3curses
+usr/src/man/man3curses/field_opts_on.3curses
+usr/src/man/man3curses/field_pad.3curses
+usr/src/man/man3curses/field_status.3curses
+usr/src/man/man3curses/field_term.3curses
+usr/src/man/man3curses/field_type.3curses
+usr/src/man/man3curses/field_userptr.3curses
+usr/src/man/man3curses/filter.3curses
+usr/src/man/man3curses/flash.3curses
+usr/src/man/man3curses/flushinp.3curses
+usr/src/man/man3curses/form_fields.3curses
+usr/src/man/man3curses/form_init.3curses
+usr/src/man/man3curses/form_opts_off.3curses
+usr/src/man/man3curses/form_opts_on.3curses
+usr/src/man/man3curses/form_sub.3curses
+usr/src/man/man3curses/form_term.3curses
+usr/src/man/man3curses/free_field.3curses
+usr/src/man/man3curses/free_fieldtype.3curses
+usr/src/man/man3curses/free_form.3curses
+usr/src/man/man3curses/free_item.3curses
+usr/src/man/man3curses/free_menu.3curses
+usr/src/man/man3curses/getbegyx.3curses
+usr/src/man/man3curses/getch.3curses
+usr/src/man/man3curses/getmaxyx.3curses
+usr/src/man/man3curses/getnwstr.3curses
+usr/src/man/man3curses/getparyx.3curses
+usr/src/man/man3curses/getstr.3curses
+usr/src/man/man3curses/getsyx.3curses
+usr/src/man/man3curses/getwch.3curses
+usr/src/man/man3curses/getwin.3curses
+usr/src/man/man3curses/getwstr.3curses
+usr/src/man/man3curses/getyx.3curses
+usr/src/man/man3curses/halfdelay.3curses
+usr/src/man/man3curses/has_colors.3curses
+usr/src/man/man3curses/has_ic.3curses
+usr/src/man/man3curses/has_il.3curses
+usr/src/man/man3curses/hide_panel.3curses
+usr/src/man/man3curses/idcok.3curses
+usr/src/man/man3curses/idlok.3curses
+usr/src/man/man3curses/immedok.3curses
+usr/src/man/man3curses/inch.3curses
+usr/src/man/man3curses/inchnstr.3curses
+usr/src/man/man3curses/inchstr.3curses
+usr/src/man/man3curses/init_color.3curses
+usr/src/man/man3curses/init_pair.3curses
+usr/src/man/man3curses/initscr.3curses
+usr/src/man/man3curses/innstr.3curses
+usr/src/man/man3curses/innwstr.3curses
+usr/src/man/man3curses/insch.3curses
+usr/src/man/man3curses/insdelln.3curses
+usr/src/man/man3curses/insertln.3curses
+usr/src/man/man3curses/insnstr.3curses
+usr/src/man/man3curses/insnwstr.3curses
+usr/src/man/man3curses/insstr.3curses
+usr/src/man/man3curses/instr.3curses
+usr/src/man/man3curses/inswch.3curses
+usr/src/man/man3curses/inswstr.3curses
+usr/src/man/man3curses/intrflush.3curses
+usr/src/man/man3curses/inwch.3curses
+usr/src/man/man3curses/inwchnstr.3curses
+usr/src/man/man3curses/inwchstr.3curses
+usr/src/man/man3curses/inwstr.3curses
+usr/src/man/man3curses/is_linetouched.3curses
+usr/src/man/man3curses/is_wintouched.3curses
+usr/src/man/man3curses/isendwin.3curses
+usr/src/man/man3curses/item_count.3curses
+usr/src/man/man3curses/item_description.3curses
+usr/src/man/man3curses/item_index.3curses
+usr/src/man/man3curses/item_init.3curses
+usr/src/man/man3curses/item_name.3curses
+usr/src/man/man3curses/item_opts.3curses
+usr/src/man/man3curses/item_opts_off.3curses
+usr/src/man/man3curses/item_opts_on.3curses
+usr/src/man/man3curses/item_term.3curses
+usr/src/man/man3curses/item_userptr.3curses
+usr/src/man/man3curses/item_value.3curses
+usr/src/man/man3curses/item_visible.3curses
+usr/src/man/man3curses/keyname.3curses
+usr/src/man/man3curses/keypad.3curses
+usr/src/man/man3curses/killchar.3curses
+usr/src/man/man3curses/leaveok.3curses
+usr/src/man/man3curses/link_field.3curses
+usr/src/man/man3curses/link_fieldtype.3curses
+usr/src/man/man3curses/longname.3curses
+usr/src/man/man3curses/menu_back.3curses
+usr/src/man/man3curses/menu_fore.3curses
+usr/src/man/man3curses/menu_grey.3curses
+usr/src/man/man3curses/menu_init.3curses
+usr/src/man/man3curses/menu_opts_off.3curses
+usr/src/man/man3curses/menu_opts_on.3curses
+usr/src/man/man3curses/menu_pad.3curses
+usr/src/man/man3curses/menu_sub.3curses
+usr/src/man/man3curses/menu_term.3curses
+usr/src/man/man3curses/meta.3curses
+usr/src/man/man3curses/move.3curses
+usr/src/man/man3curses/move_field.3curses
+usr/src/man/man3curses/move_panel.3curses
+usr/src/man/man3curses/movenextch.3curses
+usr/src/man/man3curses/moveprevch.3curses
+usr/src/man/man3curses/mvaddch.3curses
+usr/src/man/man3curses/mvaddchnstr.3curses
+usr/src/man/man3curses/mvaddchstr.3curses
+usr/src/man/man3curses/mvaddnstr.3curses
+usr/src/man/man3curses/mvaddnwstr.3curses
+usr/src/man/man3curses/mvaddstr.3curses
+usr/src/man/man3curses/mvaddwch.3curses
+usr/src/man/man3curses/mvaddwchnstr.3curses
+usr/src/man/man3curses/mvaddwchstr.3curses
+usr/src/man/man3curses/mvaddwstr.3curses
+usr/src/man/man3curses/mvcur.3curses
+usr/src/man/man3curses/mvdelch.3curses
+usr/src/man/man3curses/mvderwin.3curses
+usr/src/man/man3curses/mvgetch.3curses
+usr/src/man/man3curses/mvgetnwstr.3curses
+usr/src/man/man3curses/mvgetstr.3curses
+usr/src/man/man3curses/mvgetwch.3curses
+usr/src/man/man3curses/mvgetwstr.3curses
+usr/src/man/man3curses/mvinch.3curses
+usr/src/man/man3curses/mvinchnstr.3curses
+usr/src/man/man3curses/mvinchstr.3curses
+usr/src/man/man3curses/mvinnstr.3curses
+usr/src/man/man3curses/mvinnwstr.3curses
+usr/src/man/man3curses/mvinsch.3curses
+usr/src/man/man3curses/mvinsnstr.3curses
+usr/src/man/man3curses/mvinsnwstr.3curses
+usr/src/man/man3curses/mvinsstr.3curses
+usr/src/man/man3curses/mvinstr.3curses
+usr/src/man/man3curses/mvinswch.3curses
+usr/src/man/man3curses/mvinswstr.3curses
+usr/src/man/man3curses/mvinwch.3curses
+usr/src/man/man3curses/mvinwchnstr.3curses
+usr/src/man/man3curses/mvinwchstr.3curses
+usr/src/man/man3curses/mvinwstr.3curses
+usr/src/man/man3curses/mvprintw.3curses
+usr/src/man/man3curses/mvscanw.3curses
+usr/src/man/man3curses/mvwaddch.3curses
+usr/src/man/man3curses/mvwaddchnstr.3curses
+usr/src/man/man3curses/mvwaddchstr.3curses
+usr/src/man/man3curses/mvwaddnstr.3curses
+usr/src/man/man3curses/mvwaddnwstr.3curses
+usr/src/man/man3curses/mvwaddstr.3curses
+usr/src/man/man3curses/mvwaddwch.3curses
+usr/src/man/man3curses/mvwaddwchnstr.3curses
+usr/src/man/man3curses/mvwaddwchstr.3curses
+usr/src/man/man3curses/mvwaddwstr.3curses
+usr/src/man/man3curses/mvwdelch.3curses
+usr/src/man/man3curses/mvwgetch.3curses
+usr/src/man/man3curses/mvwgetnwstr.3curses
+usr/src/man/man3curses/mvwgetstr.3curses
+usr/src/man/man3curses/mvwgetwch.3curses
+usr/src/man/man3curses/mvwgetwstr.3curses
+usr/src/man/man3curses/mvwin.3curses
+usr/src/man/man3curses/mvwinch.3curses
+usr/src/man/man3curses/mvwinchnstr.3curses
+usr/src/man/man3curses/mvwinchstr.3curses
+usr/src/man/man3curses/mvwinnstr.3curses
+usr/src/man/man3curses/mvwinnwstr.3curses
+usr/src/man/man3curses/mvwinsch.3curses
+usr/src/man/man3curses/mvwinsnstr.3curses
+usr/src/man/man3curses/mvwinsnwstr.3curses
+usr/src/man/man3curses/mvwinsstr.3curses
+usr/src/man/man3curses/mvwinstr.3curses
+usr/src/man/man3curses/mvwinswch.3curses
+usr/src/man/man3curses/mvwinswstr.3curses
+usr/src/man/man3curses/mvwinwch.3curses
+usr/src/man/man3curses/mvwinwchnstr.3curses
+usr/src/man/man3curses/mvwinwchstr.3curses
+usr/src/man/man3curses/mvwinwstr.3curses
+usr/src/man/man3curses/mvwprintw.3curses
+usr/src/man/man3curses/mvwscanw.3curses
+usr/src/man/man3curses/napms.3curses
+usr/src/man/man3curses/new_field.3curses
+usr/src/man/man3curses/new_fieldtype.3curses
+usr/src/man/man3curses/new_form.3curses
+usr/src/man/man3curses/new_item.3curses
+usr/src/man/man3curses/new_menu.3curses
+usr/src/man/man3curses/new_page.3curses
+usr/src/man/man3curses/new_panel.3curses
+usr/src/man/man3curses/newpad.3curses
+usr/src/man/man3curses/newterm.3curses
+usr/src/man/man3curses/newwin.3curses
+usr/src/man/man3curses/nl.3curses
+usr/src/man/man3curses/nocbreak.3curses
+usr/src/man/man3curses/nodelay.3curses
+usr/src/man/man3curses/noecho.3curses
+usr/src/man/man3curses/nonl.3curses
+usr/src/man/man3curses/noqiflush.3curses
+usr/src/man/man3curses/noraw.3curses
+usr/src/man/man3curses/notimeout.3curses
+usr/src/man/man3curses/overlay.3curses
+usr/src/man/man3curses/overwrite.3curses
+usr/src/man/man3curses/pair_content.3curses
+usr/src/man/man3curses/panel_below.3curses
+usr/src/man/man3curses/panel_hidden.3curses
+usr/src/man/man3curses/pechochar.3curses
+usr/src/man/man3curses/pechowchar.3curses
+usr/src/man/man3curses/pnoutrefresh.3curses
+usr/src/man/man3curses/pos_form_cursor.3curses
+usr/src/man/man3curses/pos_menu_cursor.3curses
+usr/src/man/man3curses/post_form.3curses
+usr/src/man/man3curses/post_menu.3curses
+usr/src/man/man3curses/prefresh.3curses
+usr/src/man/man3curses/printw.3curses
+usr/src/man/man3curses/putp.3curses
+usr/src/man/man3curses/putwin.3curses
+usr/src/man/man3curses/qiflush.3curses
+usr/src/man/man3curses/raw.3curses
+usr/src/man/man3curses/redrawwin.3curses
+usr/src/man/man3curses/refresh.3curses
+usr/src/man/man3curses/replace_panel.3curses
+usr/src/man/man3curses/reset_prog_mode.3curses
+usr/src/man/man3curses/reset_shell_mode.3curses
+usr/src/man/man3curses/resetty.3curses
+usr/src/man/man3curses/restartterm.3curses
+usr/src/man/man3curses/ripoffline.3curses
+usr/src/man/man3curses/savetty.3curses
+usr/src/man/man3curses/scale_form.3curses
+usr/src/man/man3curses/scale_menu.3curses
+usr/src/man/man3curses/scanw.3curses
+usr/src/man/man3curses/scr_dump.3curses
+usr/src/man/man3curses/scr_init.3curses
+usr/src/man/man3curses/scr_restore.3curses
+usr/src/man/man3curses/scr_set.3curses
+usr/src/man/man3curses/scrl.3curses
+usr/src/man/man3curses/scroll.3curses
+usr/src/man/man3curses/scrollok.3curses
+usr/src/man/man3curses/set_current_field.3curses
+usr/src/man/man3curses/set_current_item.3curses
+usr/src/man/man3curses/set_curterm.3curses
+usr/src/man/man3curses/set_field_back.3curses
+usr/src/man/man3curses/set_field_buffer.3curses
+usr/src/man/man3curses/set_field_fore.3curses
+usr/src/man/man3curses/set_field_init.3curses
+usr/src/man/man3curses/set_field_just.3curses
+usr/src/man/man3curses/set_field_opts.3curses
+usr/src/man/man3curses/set_field_pad.3curses
+usr/src/man/man3curses/set_field_status.3curses
+usr/src/man/man3curses/set_field_term.3curses
+usr/src/man/man3curses/set_field_type.3curses
+usr/src/man/man3curses/set_field_userptr.3curses
+usr/src/man/man3curses/set_fieldtype_arg.3curses
+usr/src/man/man3curses/set_fieldtype_choice.3curses
+usr/src/man/man3curses/set_form_fields.3curses
+usr/src/man/man3curses/set_form_init.3curses
+usr/src/man/man3curses/set_form_opts.3curses
+usr/src/man/man3curses/set_form_page.3curses
+usr/src/man/man3curses/set_form_sub.3curses
+usr/src/man/man3curses/set_form_term.3curses
+usr/src/man/man3curses/set_form_userptr.3curses
+usr/src/man/man3curses/set_form_win.3curses
+usr/src/man/man3curses/set_item_init.3curses
+usr/src/man/man3curses/set_item_opts.3curses
+usr/src/man/man3curses/set_item_term.3curses
+usr/src/man/man3curses/set_item_userptr.3curses
+usr/src/man/man3curses/set_item_value.3curses
+usr/src/man/man3curses/set_max_field.3curses
+usr/src/man/man3curses/set_menu_back.3curses
+usr/src/man/man3curses/set_menu_fore.3curses
+usr/src/man/man3curses/set_menu_format.3curses
+usr/src/man/man3curses/set_menu_grey.3curses
+usr/src/man/man3curses/set_menu_init.3curses
+usr/src/man/man3curses/set_menu_items.3curses
+usr/src/man/man3curses/set_menu_mark.3curses
+usr/src/man/man3curses/set_menu_opts.3curses
+usr/src/man/man3curses/set_menu_pad.3curses
+usr/src/man/man3curses/set_menu_pattern.3curses
+usr/src/man/man3curses/set_menu_sub.3curses
+usr/src/man/man3curses/set_menu_term.3curses
+usr/src/man/man3curses/set_menu_userptr.3curses
+usr/src/man/man3curses/set_menu_win.3curses
+usr/src/man/man3curses/set_new_page.3curses
+usr/src/man/man3curses/set_panel_userptr.3curses
+usr/src/man/man3curses/set_term.3curses
+usr/src/man/man3curses/set_top_row.3curses
+usr/src/man/man3curses/setscrreg.3curses
+usr/src/man/man3curses/setsyx.3curses
+usr/src/man/man3curses/setterm.3curses
+usr/src/man/man3curses/setupterm.3curses
+usr/src/man/man3curses/show_panel.3curses
+usr/src/man/man3curses/slk_attroff.3curses
+usr/src/man/man3curses/slk_attron.3curses
+usr/src/man/man3curses/slk_attrset.3curses
+usr/src/man/man3curses/slk_clear.3curses
+usr/src/man/man3curses/slk_init.3curses
+usr/src/man/man3curses/slk_label.3curses
+usr/src/man/man3curses/slk_noutrefresh.3curses
+usr/src/man/man3curses/slk_refresh.3curses
+usr/src/man/man3curses/slk_restore.3curses
+usr/src/man/man3curses/slk_set.3curses
+usr/src/man/man3curses/slk_touch.3curses
+usr/src/man/man3curses/standend.3curses
+usr/src/man/man3curses/standout.3curses
+usr/src/man/man3curses/start_color.3curses
+usr/src/man/man3curses/subpad.3curses
+usr/src/man/man3curses/subwin.3curses
+usr/src/man/man3curses/syncok.3curses
+usr/src/man/man3curses/termattrs.3curses
+usr/src/man/man3curses/termname.3curses
+usr/src/man/man3curses/tgetent.3curses
+usr/src/man/man3curses/tgetflag.3curses
+usr/src/man/man3curses/tgetnum.3curses
+usr/src/man/man3curses/tgetstr.3curses
+usr/src/man/man3curses/tgoto.3curses
+usr/src/man/man3curses/tigetflag.3curses
+usr/src/man/man3curses/tigetnum.3curses
+usr/src/man/man3curses/tigetstr.3curses
+usr/src/man/man3curses/timeout.3curses
+usr/src/man/man3curses/top_panel.3curses
+usr/src/man/man3curses/top_row.3curses
+usr/src/man/man3curses/touchline.3curses
+usr/src/man/man3curses/touchwin.3curses
+usr/src/man/man3curses/tparm.3curses
+usr/src/man/man3curses/tputs.3curses
+usr/src/man/man3curses/typeahead.3curses
+usr/src/man/man3curses/unctrl.3curses
+usr/src/man/man3curses/ungetch.3curses
+usr/src/man/man3curses/ungetwch.3curses
+usr/src/man/man3curses/unpost_form.3curses
+usr/src/man/man3curses/unpost_menu.3curses
+usr/src/man/man3curses/untouchwin.3curses
+usr/src/man/man3curses/update_panels.3curses
+usr/src/man/man3curses/use_env.3curses
+usr/src/man/man3curses/vidattr.3curses
+usr/src/man/man3curses/vidputs.3curses
+usr/src/man/man3curses/vwprintw.3curses
+usr/src/man/man3curses/vwscanw.3curses
+usr/src/man/man3curses/waddch.3curses
+usr/src/man/man3curses/waddchnstr.3curses
+usr/src/man/man3curses/waddchstr.3curses
+usr/src/man/man3curses/waddnstr.3curses
+usr/src/man/man3curses/waddnwstr.3curses
+usr/src/man/man3curses/waddstr.3curses
+usr/src/man/man3curses/waddwch.3curses
+usr/src/man/man3curses/waddwchnstr.3curses
+usr/src/man/man3curses/waddwchstr.3curses
+usr/src/man/man3curses/waddwstr.3curses
+usr/src/man/man3curses/wadjcurspos.3curses
+usr/src/man/man3curses/wattroff.3curses
+usr/src/man/man3curses/wattron.3curses
+usr/src/man/man3curses/wattrset.3curses
+usr/src/man/man3curses/wbkgd.3curses
+usr/src/man/man3curses/wbkgdset.3curses
+usr/src/man/man3curses/wborder.3curses
+usr/src/man/man3curses/wclear.3curses
+usr/src/man/man3curses/wclrtobot.3curses
+usr/src/man/man3curses/wclrtoeol.3curses
+usr/src/man/man3curses/wcursyncup.3curses
+usr/src/man/man3curses/wdelch.3curses
+usr/src/man/man3curses/wdeleteln.3curses
+usr/src/man/man3curses/wechochar.3curses
+usr/src/man/man3curses/wechowchar.3curses
+usr/src/man/man3curses/werase.3curses
+usr/src/man/man3curses/wgetch.3curses
+usr/src/man/man3curses/wgetnstr.3curses
+usr/src/man/man3curses/wgetnwstr.3curses
+usr/src/man/man3curses/wgetstr.3curses
+usr/src/man/man3curses/wgetwch.3curses
+usr/src/man/man3curses/wgetwstr.3curses
+usr/src/man/man3curses/whline.3curses
+usr/src/man/man3curses/winch.3curses
+usr/src/man/man3curses/winchnstr.3curses
+usr/src/man/man3curses/winchstr.3curses
+usr/src/man/man3curses/winnstr.3curses
+usr/src/man/man3curses/winnwstr.3curses
+usr/src/man/man3curses/winsch.3curses
+usr/src/man/man3curses/winsdelln.3curses
+usr/src/man/man3curses/winsertln.3curses
+usr/src/man/man3curses/winsnstr.3curses
+usr/src/man/man3curses/winsnwstr.3curses
+usr/src/man/man3curses/winsstr.3curses
+usr/src/man/man3curses/winstr.3curses
+usr/src/man/man3curses/winswch.3curses
+usr/src/man/man3curses/winswstr.3curses
+usr/src/man/man3curses/winwch.3curses
+usr/src/man/man3curses/winwchnstr.3curses
+usr/src/man/man3curses/winwchstr.3curses
+usr/src/man/man3curses/winwstr.3curses
+usr/src/man/man3curses/wmove.3curses
+usr/src/man/man3curses/wmovenextch.3curses
+usr/src/man/man3curses/wmoveprevch.3curses
+usr/src/man/man3curses/wnoutrefresh.3curses
+usr/src/man/man3curses/wprintw.3curses
+usr/src/man/man3curses/wredrawln.3curses
+usr/src/man/man3curses/wrefresh.3curses
+usr/src/man/man3curses/wscanw.3curses
+usr/src/man/man3curses/wscrl.3curses
+usr/src/man/man3curses/wsetscrreg.3curses
+usr/src/man/man3curses/wstandend.3curses
+usr/src/man/man3curses/wstandout.3curses
+usr/src/man/man3curses/wsyncdown.3curses
+usr/src/man/man3curses/wsyncup.3curses
+usr/src/man/man3curses/wtimeout.3curses
+usr/src/man/man3curses/wtouchln.3curses
+usr/src/man/man3curses/wvline.3curses
+usr/src/man/man3devid/devid_compare.3devid
+usr/src/man/man3devid/devid_deviceid_to_nmlist.3devid
+usr/src/man/man3devid/devid_free.3devid
+usr/src/man/man3devid/devid_free_nmlist.3devid
+usr/src/man/man3devid/devid_get_minor_name.3devid
+usr/src/man/man3devid/devid_sizeof.3devid
+usr/src/man/man3devid/devid_str_decode.3devid
+usr/src/man/man3devid/devid_str_encode.3devid
+usr/src/man/man3devid/devid_str_free.3devid
+usr/src/man/man3devid/devid_valid.3devid
+usr/src/man/man3devinfo/di_bus_addr.3devinfo
+usr/src/man/man3devinfo/di_compatible_names.3devinfo
+usr/src/man/man3devinfo/di_devfs_minor_path.3devinfo
+usr/src/man/man3devinfo/di_devfs_path_free.3devinfo
+usr/src/man/man3devinfo/di_devid.3devinfo
+usr/src/man/man3devinfo/di_devlink_content.3devinfo
+usr/src/man/man3devinfo/di_devlink_fini.3devinfo
+usr/src/man/man3devinfo/di_devlink_free.3devinfo
+usr/src/man/man3devinfo/di_devlink_type.3devinfo
+usr/src/man/man3devinfo/di_driver_major.3devinfo
+usr/src/man/man3devinfo/di_driver_name.3devinfo
+usr/src/man/man3devinfo/di_driver_ops.3devinfo
+usr/src/man/man3devinfo/di_drv_first_node.3devinfo
+usr/src/man/man3devinfo/di_drv_next_node.3devinfo
+usr/src/man/man3devinfo/di_fini.3devinfo
+usr/src/man/man3devinfo/di_instance.3devinfo
+usr/src/man/man3devinfo/di_link_next_by_lnode.3devinfo
+usr/src/man/man3devinfo/di_link_private_get.3devinfo
+usr/src/man/man3devinfo/di_link_private_set.3devinfo
+usr/src/man/man3devinfo/di_link_to_lnode.3devinfo
+usr/src/man/man3devinfo/di_lnode_devinfo.3devinfo
+usr/src/man/man3devinfo/di_lnode_devt.3devinfo
+usr/src/man/man3devinfo/di_lnode_private_get.3devinfo
+usr/src/man/man3devinfo/di_lnode_private_set.3devinfo
+usr/src/man/man3devinfo/di_minor_name.3devinfo
+usr/src/man/man3devinfo/di_minor_nodetype.3devinfo
+usr/src/man/man3devinfo/di_minor_private_get.3devinfo
+usr/src/man/man3devinfo/di_minor_private_set.3devinfo
+usr/src/man/man3devinfo/di_minor_spectype.3devinfo
+usr/src/man/man3devinfo/di_node_name.3devinfo
+usr/src/man/man3devinfo/di_node_private_get.3devinfo
+usr/src/man/man3devinfo/di_nodeid.3devinfo
+usr/src/man/man3devinfo/di_parent_node.3devinfo
+usr/src/man/man3devinfo/di_path_client_devfs_path.3devinfo
+usr/src/man/man3devinfo/di_path_client_node.3devinfo
+usr/src/man/man3devinfo/di_path_devfs_path.3devinfo
+usr/src/man/man3devinfo/di_path_instance.3devinfo
+usr/src/man/man3devinfo/di_path_node_name.3devinfo
+usr/src/man/man3devinfo/di_path_phci_next_path.3devinfo
+usr/src/man/man3devinfo/di_path_phci_node.3devinfo
+usr/src/man/man3devinfo/di_path_private_get.3devinfo
+usr/src/man/man3devinfo/di_path_private_set.3devinfo
+usr/src/man/man3devinfo/di_path_prop_int64s.3devinfo
+usr/src/man/man3devinfo/di_path_prop_ints.3devinfo
+usr/src/man/man3devinfo/di_path_prop_lookup_int64s.3devinfo
+usr/src/man/man3devinfo/di_path_prop_lookup_ints.3devinfo
+usr/src/man/man3devinfo/di_path_prop_lookup_strings.3devinfo
+usr/src/man/man3devinfo/di_path_prop_name.3devinfo
+usr/src/man/man3devinfo/di_path_prop_strings.3devinfo
+usr/src/man/man3devinfo/di_path_prop_type.3devinfo
+usr/src/man/man3devinfo/di_path_state.3devinfo
+usr/src/man/man3devinfo/di_prom_fini.3devinfo
+usr/src/man/man3devinfo/di_prom_prop_lookup_ints.3devinfo
+usr/src/man/man3devinfo/di_prom_prop_lookup_strings.3devinfo
+usr/src/man/man3devinfo/di_prom_prop_name.3devinfo
+usr/src/man/man3devinfo/di_prom_prop_next.3devinfo
+usr/src/man/man3devinfo/di_prop_devt.3devinfo
+usr/src/man/man3devinfo/di_prop_int64.3devinfo
+usr/src/man/man3devinfo/di_prop_ints.3devinfo
+usr/src/man/man3devinfo/di_prop_lookup_int64.3devinfo
+usr/src/man/man3devinfo/di_prop_lookup_ints.3devinfo
+usr/src/man/man3devinfo/di_prop_lookup_strings.3devinfo
+usr/src/man/man3devinfo/di_prop_name.3devinfo
+usr/src/man/man3devinfo/di_prop_strings.3devinfo
+usr/src/man/man3devinfo/di_prop_type.3devinfo
+usr/src/man/man3devinfo/di_sibling_node.3devinfo
+usr/src/man/man3dlpi/dlpi_disabmulti.3dlpi
+usr/src/man/man3dlpi/dlpi_promiscoff.3dlpi
+usr/src/man/man3dns_sd/DNSServiceAddRecord.3dns_sd
+usr/src/man/man3dns_sd/DNSServiceRegisterRecord.3dns_sd
+usr/src/man/man3dns_sd/DNSServiceRemoveRecord.3dns_sd
+usr/src/man/man3dns_sd/DNSServiceUpdateRecord.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordContainsKey.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordDeallocate.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordGetBytesPtr.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordGetCount.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordGetItemAtIndex.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordGetLength.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordGetValuePtr.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordRemoveValue.3dns_sd
+usr/src/man/man3dns_sd/TXTRecordSetValue.3dns_sd
+usr/src/man/man3elf/elf32_newehdr.3elf
+usr/src/man/man3elf/elf32_newphdr.3elf
+usr/src/man/man3elf/elf32_xlatetom.3elf
+usr/src/man/man3elf/elf64_checksum.3elf
+usr/src/man/man3elf/elf64_fsize.3elf
+usr/src/man/man3elf/elf64_getehdr.3elf
+usr/src/man/man3elf/elf64_getphdr.3elf
+usr/src/man/man3elf/elf64_getshdr.3elf
+usr/src/man/man3elf/elf64_newehdr.3elf
+usr/src/man/man3elf/elf64_newphdr.3elf
+usr/src/man/man3elf/elf64_xlatetof.3elf
+usr/src/man/man3elf/elf64_xlatetom.3elf
+usr/src/man/man3elf/elf_end.3elf
+usr/src/man/man3elf/elf_errno.3elf
+usr/src/man/man3elf/elf_flagehdr.3elf
+usr/src/man/man3elf/elf_flagelf.3elf
+usr/src/man/man3elf/elf_flagphdr.3elf
+usr/src/man/man3elf/elf_flagscn.3elf
+usr/src/man/man3elf/elf_flagshdr.3elf
+usr/src/man/man3elf/elf_getphdrnum.3elf
+usr/src/man/man3elf/elf_getphnum.3elf
+usr/src/man/man3elf/elf_getshdrnum.3elf
+usr/src/man/man3elf/elf_getshdrstrndx.3elf
+usr/src/man/man3elf/elf_getshnum.3elf
+usr/src/man/man3elf/elf_getshstrndx.3elf
+usr/src/man/man3elf/elf_memory.3elf
+usr/src/man/man3elf/elf_ndxscn.3elf
+usr/src/man/man3elf/elf_newdata.3elf
+usr/src/man/man3elf/elf_newscn.3elf
+usr/src/man/man3elf/elf_next.3elf
+usr/src/man/man3elf/elf_nextscn.3elf
+usr/src/man/man3elf/elf_rand.3elf
+usr/src/man/man3elf/elf_rawdata.3elf
+usr/src/man/man3elf/gelf_checksum.3elf
+usr/src/man/man3elf/gelf_fsize.3elf
+usr/src/man/man3elf/gelf_getcap.3elf
+usr/src/man/man3elf/gelf_getclass.3elf
+usr/src/man/man3elf/gelf_getdyn.3elf
+usr/src/man/man3elf/gelf_getehdr.3elf
+usr/src/man/man3elf/gelf_getmove.3elf
+usr/src/man/man3elf/gelf_getphdr.3elf
+usr/src/man/man3elf/gelf_getrel.3elf
+usr/src/man/man3elf/gelf_getrela.3elf
+usr/src/man/man3elf/gelf_getshdr.3elf
+usr/src/man/man3elf/gelf_getsym.3elf
+usr/src/man/man3elf/gelf_getsyminfo.3elf
+usr/src/man/man3elf/gelf_getsymshndx.3elf
+usr/src/man/man3elf/gelf_newehdr.3elf
+usr/src/man/man3elf/gelf_newphdr.3elf
+usr/src/man/man3elf/gelf_update_cap.3elf
+usr/src/man/man3elf/gelf_update_dyn.3elf
+usr/src/man/man3elf/gelf_update_ehdr.3elf
+usr/src/man/man3elf/gelf_update_getmove.3elf
+usr/src/man/man3elf/gelf_update_move.3elf
+usr/src/man/man3elf/gelf_update_phdr.3elf
+usr/src/man/man3elf/gelf_update_rel.3elf
+usr/src/man/man3elf/gelf_update_rela.3elf
+usr/src/man/man3elf/gelf_update_shdr.3elf
+usr/src/man/man3elf/gelf_update_sym.3elf
+usr/src/man/man3elf/gelf_update_syminfo.3elf
+usr/src/man/man3elf/gelf_update_symshndx.3elf
+usr/src/man/man3elf/gelf_xlatetof.3elf
+usr/src/man/man3elf/gelf_xlatetom.3elf
+usr/src/man/man3exacct/ea_alloc.3exacct
+usr/src/man/man3exacct/ea_attach_to_group.3exacct
+usr/src/man/man3exacct/ea_attach_to_object.3exacct
+usr/src/man/man3exacct/ea_close.3exacct
+usr/src/man/man3exacct/ea_copy_object.3exacct
+usr/src/man/man3exacct/ea_copy_object_tree.3exacct
+usr/src/man/man3exacct/ea_free.3exacct
+usr/src/man/man3exacct/ea_free_item.3exacct
+usr/src/man/man3exacct/ea_free_object.3exacct
+usr/src/man/man3exacct/ea_get_creator.3exacct
+usr/src/man/man3exacct/ea_get_hostname.3exacct
+usr/src/man/man3exacct/ea_get_object.3exacct
+usr/src/man/man3exacct/ea_get_object_tree.3exacct
+usr/src/man/man3exacct/ea_match_object_catalog.3exacct
+usr/src/man/man3exacct/ea_next_object.3exacct
+usr/src/man/man3exacct/ea_previous_object.3exacct
+usr/src/man/man3exacct/ea_set_group.3exacct
+usr/src/man/man3exacct/ea_strdup.3exacct
+usr/src/man/man3exacct/ea_strfree.3exacct
+usr/src/man/man3exacct/ea_unpack_object.3exacct
+usr/src/man/man3exacct/ea_write_object.3exacct
+usr/src/man/man3ext/DES_FAILED.3ext
+usr/src/man/man3ext/MD4Final.3ext
+usr/src/man/man3ext/MD4Init.3ext
+usr/src/man/man3ext/MD4Update.3ext
+usr/src/man/man3ext/MD5Final.3ext
+usr/src/man/man3ext/MD5Init.3ext
+usr/src/man/man3ext/MD5Update.3ext
+usr/src/man/man3ext/SHA1Final.3ext
+usr/src/man/man3ext/SHA1Init.3ext
+usr/src/man/man3ext/SHA1Update.3ext
+usr/src/man/man3ext/SHA256Final.3ext
+usr/src/man/man3ext/SHA256Init.3ext
+usr/src/man/man3ext/SHA256Update.3ext
+usr/src/man/man3ext/SHA2Final.3ext
+usr/src/man/man3ext/SHA2Init.3ext
+usr/src/man/man3ext/SHA2Update.3ext
+usr/src/man/man3ext/SHA384Final.3ext
+usr/src/man/man3ext/SHA384Init.3ext
+usr/src/man/man3ext/SHA384Update.3ext
+usr/src/man/man3ext/SHA512Final.3ext
+usr/src/man/man3ext/SHA512Init.3ext
+usr/src/man/man3ext/SHA512Update.3ext
+usr/src/man/man3ext/SUNW_C_KeyToObject.3ext
+usr/src/man/man3ext/_NOTE.3ext
+usr/src/man/man3ext/auto_ef_file.3ext
+usr/src/man/man3ext/auto_ef_free.3ext
+usr/src/man/man3ext/auto_ef_get_encoding.3ext
+usr/src/man/man3ext/auto_ef_get_score.3ext
+usr/src/man/man3ext/auto_ef_str.3ext
+usr/src/man/man3ext/cbc_crypt.3ext
+usr/src/man/man3ext/cplus_demangle.3ext
+usr/src/man/man3ext/crypt_close.3ext
+usr/src/man/man3ext/des_crypt.3ext
+usr/src/man/man3ext/des_encrypt.3ext
+usr/src/man/man3ext/des_setkey.3ext
+usr/src/man/man3ext/des_setparity.3ext
+usr/src/man/man3ext/efi_alloc_and_read.3ext
+usr/src/man/man3ext/efi_free.3ext
+usr/src/man/man3ext/efi_use_whole_disk.3ext
+usr/src/man/man3ext/efi_write.3ext
+usr/src/man/man3ext/encrypt.3ext
+usr/src/man/man3ext/la_activity.3ext
+usr/src/man/man3ext/la_amd64_pltenter.3ext
+usr/src/man/man3ext/la_i86_pltenter.3ext
+usr/src/man/man3ext/la_objfilter.3ext
+usr/src/man/man3ext/la_objopen.3ext
+usr/src/man/man3ext/la_objsearch.3ext
+usr/src/man/man3ext/la_pltexit.3ext
+usr/src/man/man3ext/la_pltexit64.3ext
+usr/src/man/man3ext/la_preinit.3ext
+usr/src/man/man3ext/la_sparcv8_pltenter.3ext
+usr/src/man/man3ext/la_sparcv9_pltenter.3ext
+usr/src/man/man3ext/la_symbind32.3ext
+usr/src/man/man3ext/la_symbind64.3ext
+usr/src/man/man3ext/la_version.3ext
+usr/src/man/man3ext/ld_atexit.3ext
+usr/src/man/man3ext/ld_atexit64.3ext
+usr/src/man/man3ext/ld_file.3ext
+usr/src/man/man3ext/ld_file64.3ext
+usr/src/man/man3ext/ld_input_done.3ext
+usr/src/man/man3ext/ld_input_section.3ext
+usr/src/man/man3ext/ld_input_section64.3ext
+usr/src/man/man3ext/ld_open.3ext
+usr/src/man/man3ext/ld_open64.3ext
+usr/src/man/man3ext/ld_section.3ext
+usr/src/man/man3ext/ld_section64.3ext
+usr/src/man/man3ext/ld_start.3ext
+usr/src/man/man3ext/ld_start64.3ext
+usr/src/man/man3ext/ld_version.3ext
+usr/src/man/man3ext/md5_calc.3ext
+usr/src/man/man3ext/rd_delete.3ext
+usr/src/man/man3ext/rd_errstr.3ext
+usr/src/man/man3ext/rd_event_addr.3ext
+usr/src/man/man3ext/rd_event_enable.3ext
+usr/src/man/man3ext/rd_event_getmsg.3ext
+usr/src/man/man3ext/rd_init.3ext
+usr/src/man/man3ext/rd_loadobj_iter.3ext
+usr/src/man/man3ext/rd_log.3ext
+usr/src/man/man3ext/rd_new.3ext
+usr/src/man/man3ext/rd_objpad_enable.3ext
+usr/src/man/man3ext/rd_plt_resolution.3ext
+usr/src/man/man3ext/rd_reset.3ext
+usr/src/man/man3ext/run_crypt.3ext
+usr/src/man/man3ext/run_setkey.3ext
+usr/src/man/man3ext/setkey.3ext
+usr/src/man/man3ext/tsalarm_set.3ext
+usr/src/man/man3ext/write_vtoc.3ext
+usr/src/man/man3fstyp/fstyp_fini.3fstyp
+usr/src/man/man3fstyp/fstyp_mod_dump.3fstyp
+usr/src/man/man3fstyp/fstyp_mod_fini.3fstyp
+usr/src/man/man3fstyp/fstyp_mod_get_attr.3fstyp
+usr/src/man/man3fstyp/fstyp_mod_ident.3fstyp
+usr/src/man/man3gen/advance.3gen
+usr/src/man/man3gen/compile.3gen
+usr/src/man/man3gen/p2close.3gen
+usr/src/man/man3gen/rmdirp.3gen
+usr/src/man/man3gen/step.3gen
+usr/src/man/man3gen/str.3gen
+usr/src/man/man3gen/strcadd.3gen
+usr/src/man/man3gen/streadd.3gen
+usr/src/man/man3gen/strecpy.3gen
+usr/src/man/man3gen/strrspn.3gen
+usr/src/man/man3gen/strtrns.3gen
+usr/src/man/man3head/acct.3head
+usr/src/man/man3head/aio.3head
+usr/src/man/man3head/ar.3head
+usr/src/man/man3head/archives.3head
+usr/src/man/man3head/assert.3head
+usr/src/man/man3head/complex.3head
+usr/src/man/man3head/cpio.3head
+usr/src/man/man3head/dirent.3head
+usr/src/man/man3head/errno.3head
+usr/src/man/man3head/fcntl.3head
+usr/src/man/man3head/fenv.3head
+usr/src/man/man3head/float.3head
+usr/src/man/man3head/floatingpoint.3head
+usr/src/man/man3head/fmtmsg.3head
+usr/src/man/man3head/fnmatch.3head
+usr/src/man/man3head/ftw.3head
+usr/src/man/man3head/glob.3head
+usr/src/man/man3head/grp.3head
+usr/src/man/man3head/iconv.3head
+usr/src/man/man3head/if.3head
+usr/src/man/man3head/in.3head
+usr/src/man/man3head/inet.3head
+usr/src/man/man3head/inttypes.3head
+usr/src/man/man3head/ipc.3head
+usr/src/man/man3head/iso646.3head
+usr/src/man/man3head/langinfo.3head
+usr/src/man/man3head/libgen.3head
+usr/src/man/man3head/libintl.3head
+usr/src/man/man3head/limits.3head
+usr/src/man/man3head/locale.3head
+usr/src/man/man3head/math.3head
+usr/src/man/man3head/mman.3head
+usr/src/man/man3head/monetary.3head
+usr/src/man/man3head/mqueue.3head
+usr/src/man/man3head/msg.3head
+usr/src/man/man3head/ndbm.3head
+usr/src/man/man3head/netdb.3head
+usr/src/man/man3head/nl_types.3head
+usr/src/man/man3head/poll.3head
+usr/src/man/man3head/pthread.3head
+usr/src/man/man3head/pwd.3head
+usr/src/man/man3head/regex.3head
+usr/src/man/man3head/resource.3head
+usr/src/man/man3head/sched.3head
+usr/src/man/man3head/search.3head
+usr/src/man/man3head/select.3head
+usr/src/man/man3head/sem.3head
+usr/src/man/man3head/semaphore.3head
+usr/src/man/man3head/setjmp.3head
+usr/src/man/man3head/shm.3head
+usr/src/man/man3head/siginfo.3head
+usr/src/man/man3head/signal.3head
+usr/src/man/man3head/socket.3head
+usr/src/man/man3head/spawn.3head
+usr/src/man/man3head/stat.3head
+usr/src/man/man3head/statvfs.3head
+usr/src/man/man3head/stdbool.3head
+usr/src/man/man3head/stddef.3head
+usr/src/man/man3head/stdint.3head
+usr/src/man/man3head/stdio.3head
+usr/src/man/man3head/stdlib.3head
+usr/src/man/man3head/string.3head
+usr/src/man/man3head/strings.3head
+usr/src/man/man3head/stropts.3head
+usr/src/man/man3head/syslog.3head
+usr/src/man/man3head/tar.3head
+usr/src/man/man3head/tcp.3head
+usr/src/man/man3head/termios.3head
+usr/src/man/man3head/tgmath.3head
+usr/src/man/man3head/time.3head
+usr/src/man/man3head/timeb.3head
+usr/src/man/man3head/times.3head
+usr/src/man/man3head/types.3head
+usr/src/man/man3head/types32.3head
+usr/src/man/man3head/ucontext.3head
+usr/src/man/man3head/uio.3head
+usr/src/man/man3head/ulimit.3head
+usr/src/man/man3head/un.3head
+usr/src/man/man3head/unistd.3head
+usr/src/man/man3head/utime.3head
+usr/src/man/man3head/utmpx.3head
+usr/src/man/man3head/utsname.3head
+usr/src/man/man3head/values.3head
+usr/src/man/man3head/wait.3head
+usr/src/man/man3head/wchar.3head
+usr/src/man/man3head/wctype.3head
+usr/src/man/man3head/wordexp.3head
+usr/src/man/man3iscsit/it_config_commit.3iscsit
+usr/src/man/man3iscsit/it_config_free.3iscsit
+usr/src/man/man3iscsit/it_config_setprop.3iscsit
+usr/src/man/man3iscsit/it_ini_delete.3iscsit
+usr/src/man/man3iscsit/it_ini_free.3iscsit
+usr/src/man/man3iscsit/it_ini_setprop.3iscsit
+usr/src/man/man3iscsit/it_portal_delete.3iscsit
+usr/src/man/man3iscsit/it_tgt_delete.3iscsit
+usr/src/man/man3iscsit/it_tgt_free.3iscsit
+usr/src/man/man3iscsit/it_tgt_setprop.3iscsit
+usr/src/man/man3iscsit/it_tpg_delete.3iscsit
+usr/src/man/man3iscsit/it_tpg_free.3iscsit
+usr/src/man/man3iscsit/it_tpgt_create.3iscsit
+usr/src/man/man3iscsit/it_tpgt_delete.3iscsit
+usr/src/man/man3iscsit/it_tpgt_free.3iscsit
+usr/src/man/man3kstat/kstat_close.3kstat
+usr/src/man/man3kstat/kstat_data_lookup.3kstat
+usr/src/man/man3kstat/kstat_write.3kstat
+usr/src/man/man3kvm/kvm_close.3kvm
+usr/src/man/man3kvm/kvm_getcmd.3kvm
+usr/src/man/man3kvm/kvm_getproc.3kvm
+usr/src/man/man3kvm/kvm_kwrite.3kvm
+usr/src/man/man3kvm/kvm_setproc.3kvm
+usr/src/man/man3kvm/kvm_uread.3kvm
+usr/src/man/man3kvm/kvm_uwrite.3kvm
+usr/src/man/man3kvm/kvm_write.3kvm
+usr/src/man/man3ldap/ber_alloc.3ldap
+usr/src/man/man3ldap/ber_alloc_t.3ldap
+usr/src/man/man3ldap/ber_bvdup.3ldap
+usr/src/man/man3ldap/ber_bvecfree.3ldap
+usr/src/man/man3ldap/ber_bvfree.3ldap
+usr/src/man/man3ldap/ber_first_element.3ldap
+usr/src/man/man3ldap/ber_flatten.3ldap
+usr/src/man/man3ldap/ber_free.3ldap
+usr/src/man/man3ldap/ber_get_bitstring.3ldap
+usr/src/man/man3ldap/ber_get_boolean.3ldap
+usr/src/man/man3ldap/ber_get_int.3ldap
+usr/src/man/man3ldap/ber_get_next.3ldap
+usr/src/man/man3ldap/ber_get_null.3ldap
+usr/src/man/man3ldap/ber_get_stringa.3ldap
+usr/src/man/man3ldap/ber_get_stringal.3ldap
+usr/src/man/man3ldap/ber_get_stringb.3ldap
+usr/src/man/man3ldap/ber_init.3ldap
+usr/src/man/man3ldap/ber_next_element.3ldap
+usr/src/man/man3ldap/ber_peek_tag.3ldap
+usr/src/man/man3ldap/ber_printf.3ldap
+usr/src/man/man3ldap/ber_put_bitstring.3ldap
+usr/src/man/man3ldap/ber_put_boolean.3ldap
+usr/src/man/man3ldap/ber_put_int.3ldap
+usr/src/man/man3ldap/ber_put_null.3ldap
+usr/src/man/man3ldap/ber_put_ostring.3ldap
+usr/src/man/man3ldap/ber_put_seq.3ldap
+usr/src/man/man3ldap/ber_put_set.3ldap
+usr/src/man/man3ldap/ber_put_string.3ldap
+usr/src/man/man3ldap/ber_scanf.3ldap
+usr/src/man/man3ldap/ber_skip_tag.3ldap
+usr/src/man/man3ldap/ber_start_seq.3ldap
+usr/src/man/man3ldap/ber_start_set.3ldap
+usr/src/man/man3ldap/ldap_8859_to_t61.3ldap
+usr/src/man/man3ldap/ldap_add_ext.3ldap
+usr/src/man/man3ldap/ldap_add_ext_s.3ldap
+usr/src/man/man3ldap/ldap_add_s.3ldap
+usr/src/man/man3ldap/ldap_bind_s.3ldap
+usr/src/man/man3ldap/ldap_build_filter.3ldap
+usr/src/man/man3ldap/ldap_compare_ext.3ldap
+usr/src/man/man3ldap/ldap_compare_ext_s.3ldap
+usr/src/man/man3ldap/ldap_compare_s.3ldap
+usr/src/man/man3ldap/ldap_controls_free.3ldap
+usr/src/man/man3ldap/ldap_count_entries.3ldap
+usr/src/man/man3ldap/ldap_count_messages.3ldap
+usr/src/man/man3ldap/ldap_count_references.3ldap
+usr/src/man/man3ldap/ldap_count_values.3ldap
+usr/src/man/man3ldap/ldap_count_values_len.3ldap
+usr/src/man/man3ldap/ldap_delete_ext.3ldap
+usr/src/man/man3ldap/ldap_delete_ext_s.3ldap
+usr/src/man/man3ldap/ldap_delete_s.3ldap
+usr/src/man/man3ldap/ldap_dn2ufn.3ldap
+usr/src/man/man3ldap/ldap_dn_to_url.3ldap
+usr/src/man/man3ldap/ldap_dns_to_dn.3ldap
+usr/src/man/man3ldap/ldap_dns_to_url.3ldap
+usr/src/man/man3ldap/ldap_enable_translation.3ldap
+usr/src/man/man3ldap/ldap_entry2html.3ldap
+usr/src/man/man3ldap/ldap_entry2html_search.3ldap
+usr/src/man/man3ldap/ldap_entry2text_search.3ldap
+usr/src/man/man3ldap/ldap_err2string.3ldap
+usr/src/man/man3ldap/ldap_explode_dn.3ldap
+usr/src/man/man3ldap/ldap_explode_dns.3ldap
+usr/src/man/man3ldap/ldap_first_disptmpl.3ldap
+usr/src/man/man3ldap/ldap_first_reference.3ldap
+usr/src/man/man3ldap/ldap_first_searchobj.3ldap
+usr/src/man/man3ldap/ldap_first_tmplcol.3ldap
+usr/src/man/man3ldap/ldap_first_tmplrow.3ldap
+usr/src/man/man3ldap/ldap_free_friendlymap.3ldap
+usr/src/man/man3ldap/ldap_free_searchprefs.3ldap
+usr/src/man/man3ldap/ldap_free_templates.3ldap
+usr/src/man/man3ldap/ldap_free_urldesc.3ldap
+usr/src/man/man3ldap/ldap_friendly_name.3ldap
+usr/src/man/man3ldap/ldap_get_lang_values_len.3ldap
+usr/src/man/man3ldap/ldap_get_values_len.3ldap
+usr/src/man/man3ldap/ldap_getfilter_free.3ldap
+usr/src/man/man3ldap/ldap_getfirstfilter.3ldap
+usr/src/man/man3ldap/ldap_getnextfilter.3ldap
+usr/src/man/man3ldap/ldap_init.3ldap
+usr/src/man/man3ldap/ldap_init_getfilter.3ldap
+usr/src/man/man3ldap/ldap_init_getfilter_buf.3ldap
+usr/src/man/man3ldap/ldap_init_searchprefs.3ldap
+usr/src/man/man3ldap/ldap_init_searchprefs_buf.3ldap
+usr/src/man/man3ldap/ldap_init_templates.3ldap
+usr/src/man/man3ldap/ldap_init_templates_buf.3ldap
+usr/src/man/man3ldap/ldap_is_dns_dn.3ldap
+usr/src/man/man3ldap/ldap_is_ldap_url.3ldap
+usr/src/man/man3ldap/ldap_memcache_destroy.3ldap
+usr/src/man/man3ldap/ldap_memcache_flush.3ldap
+usr/src/man/man3ldap/ldap_memcache_get.3ldap
+usr/src/man/man3ldap/ldap_memcache_init.3ldap
+usr/src/man/man3ldap/ldap_memcache_set.3ldap
+usr/src/man/man3ldap/ldap_memcache_update.3ldap
+usr/src/man/man3ldap/ldap_modify_ext.3ldap
+usr/src/man/man3ldap/ldap_modify_ext_s.3ldap
+usr/src/man/man3ldap/ldap_modify_s.3ldap
+usr/src/man/man3ldap/ldap_modrdn2.3ldap
+usr/src/man/man3ldap/ldap_modrdn2_s.3ldap
+usr/src/man/man3ldap/ldap_modrdn_s.3ldap
+usr/src/man/man3ldap/ldap_mods_free.3ldap
+usr/src/man/man3ldap/ldap_msgfree.3ldap
+usr/src/man/man3ldap/ldap_msgtype.3ldap
+usr/src/man/man3ldap/ldap_name2template.3ldap
+usr/src/man/man3ldap/ldap_next_attribute.3ldap
+usr/src/man/man3ldap/ldap_next_disptmpl.3ldap
+usr/src/man/man3ldap/ldap_next_entry.3ldap
+usr/src/man/man3ldap/ldap_next_message.3ldap
+usr/src/man/man3ldap/ldap_next_reference.3ldap
+usr/src/man/man3ldap/ldap_next_searchobj.3ldap
+usr/src/man/man3ldap/ldap_next_tmplcol.3ldap
+usr/src/man/man3ldap/ldap_next_tmplrow.3ldap
+usr/src/man/man3ldap/ldap_oc2template.3ldap
+usr/src/man/man3ldap/ldap_parse_extended_result.3ldap
+usr/src/man/man3ldap/ldap_parse_sasl_bind_result.3ldap
+usr/src/man/man3ldap/ldap_perror.3ldap
+usr/src/man/man3ldap/ldap_rename.3ldap
+usr/src/man/man3ldap/ldap_rename_s.3ldap
+usr/src/man/man3ldap/ldap_result2error.3ldap
+usr/src/man/man3ldap/ldap_sasl_bind.3ldap
+usr/src/man/man3ldap/ldap_sasl_bind_s.3ldap
+usr/src/man/man3ldap/ldap_sasl_interactive_bind_s.3ldap
+usr/src/man/man3ldap/ldap_search_ext.3ldap
+usr/src/man/man3ldap/ldap_search_ext_s.3ldap
+usr/src/man/man3ldap/ldap_search_s.3ldap
+usr/src/man/man3ldap/ldap_search_st.3ldap
+usr/src/man/man3ldap/ldap_set_option.3ldap
+usr/src/man/man3ldap/ldap_set_rebind_proc.3ldap
+usr/src/man/man3ldap/ldap_set_string_translators.3ldap
+usr/src/man/man3ldap/ldap_setfilteraffixes.3ldap
+usr/src/man/man3ldap/ldap_simple_bind.3ldap
+usr/src/man/man3ldap/ldap_simple_bind_s.3ldap
+usr/src/man/man3ldap/ldap_sort_entries.3ldap
+usr/src/man/man3ldap/ldap_sort_strcasecmp.3ldap
+usr/src/man/man3ldap/ldap_sort_values.3ldap
+usr/src/man/man3ldap/ldap_t61_to_8859.3ldap
+usr/src/man/man3ldap/ldap_tmplattrs.3ldap
+usr/src/man/man3ldap/ldap_translate_from_t61.3ldap
+usr/src/man/man3ldap/ldap_translate_to_t61.3ldap
+usr/src/man/man3ldap/ldap_ufn_search_c.3ldap
+usr/src/man/man3ldap/ldap_ufn_search_ct.3ldap
+usr/src/man/man3ldap/ldap_ufn_search_s.3ldap
+usr/src/man/man3ldap/ldap_ufn_setfilter.3ldap
+usr/src/man/man3ldap/ldap_ufn_setprefix.3ldap
+usr/src/man/man3ldap/ldap_ufn_timeout.3ldap
+usr/src/man/man3ldap/ldap_unbind.3ldap
+usr/src/man/man3ldap/ldap_unbind_ext.3ldap
+usr/src/man/man3ldap/ldap_unbind_s.3ldap
+usr/src/man/man3ldap/ldap_url_parse.3ldap
+usr/src/man/man3ldap/ldap_url_parse_nodn.3ldap
+usr/src/man/man3ldap/ldap_url_search.3ldap
+usr/src/man/man3ldap/ldap_url_search_s.3ldap
+usr/src/man/man3ldap/ldap_url_search_st.3ldap
+usr/src/man/man3ldap/ldap_vals2html.3ldap
+usr/src/man/man3ldap/ldap_vals2text.3ldap
+usr/src/man/man3ldap/ldap_value_free.3ldap
+usr/src/man/man3ldap/ldap_value_free_len.3ldap
+usr/src/man/man3lgrp/lgrp_affinity_set.3lgrp
+usr/src/man/man3lgrp/lgrp_latency_cookie.3lgrp
+usr/src/man/man3lib/SMHBA_GetAdapterAttributes.3lib
+usr/src/man/man3lib/SMHBA_GetAdapterPortAttributes.3lib
+usr/src/man/man3lib/SMHBA_GetBindingCapability.3lib
+usr/src/man/man3lib/SMHBA_GetBindingSupport.3lib
+usr/src/man/man3lib/SMHBA_GetDiscoveredPortAttributes.3lib
+usr/src/man/man3lib/SMHBA_GetFCPhyAttributes.3lib
+usr/src/man/man3lib/SMHBA_GetLUNStatistics.3lib
+usr/src/man/man3lib/SMHBA_GetNumberofPorts.3lib
+usr/src/man/man3lib/SMHBA_GetPersistentBinding.3lib
+usr/src/man/man3lib/SMHBA_GetPhyStatistics.3lib
+usr/src/man/man3lib/SMHBA_GetPortAttributesByWWN.3lib
+usr/src/man/man3lib/SMHBA_GetPortType.3lib
+usr/src/man/man3lib/SMHBA_GetProtocolStatistics.3lib
+usr/src/man/man3lib/SMHBA_GetSASPhyAttributes.3lib
+usr/src/man/man3lib/SMHBA_GetTargetMapping.3lib
+usr/src/man/man3lib/SMHBA_GetVendorLibraryAttributes.3lib
+usr/src/man/man3lib/SMHBA_GetVersion.3lib
+usr/src/man/man3lib/SMHBA_GetWrapperLibraryAttributes.3lib
+usr/src/man/man3lib/SMHBA_RegisterForAdapterAddEvents.3lib
+usr/src/man/man3lib/SMHBA_RegisterForAdapterEvents.3lib
+usr/src/man/man3lib/SMHBA_RegisterForAdapterPhyStatEvents.3lib
+usr/src/man/man3lib/SMHBA_RegisterForAdapterPortEvents.3lib
+usr/src/man/man3lib/SMHBA_RegisterForAdapterPortStatEvents.3lib
+usr/src/man/man3lib/SMHBA_RegisterForTargetEvents.3lib
+usr/src/man/man3lib/SMHBA_RegisterLibrary.3lib
+usr/src/man/man3lib/SMHBA_RemoveAllPersistentBindings.3lib
+usr/src/man/man3lib/SMHBA_RemovePersistentBinding.3lib
+usr/src/man/man3lib/SMHBA_ScsiInquiry.3lib
+usr/src/man/man3lib/SMHBA_ScsiReadCapacity.3lib
+usr/src/man/man3lib/SMHBA_ScsiReportLuns.3lib
+usr/src/man/man3lib/SMHBA_SendECHO.3lib
+usr/src/man/man3lib/SMHBA_SendSMPPassThru.3lib
+usr/src/man/man3lib/SMHBA_SendTEST.3lib
+usr/src/man/man3lib/SMHBA_SetBindingSupport.3lib
+usr/src/man/man3lib/SMHBA_SetPersistentBinding.3lib
+usr/src/man/man3lib/libmpapi.3lib
+usr/src/man/man3lib/libposix4.3lib
+usr/src/man/man3lib/libsmhbaapi.3lib
+usr/src/man/man3lib/libtermcap.3lib
+usr/src/man/man3lib/libtermlib.3lib
+usr/src/man/man3mail/mailunlock.3mail
+usr/src/man/man3mail/touchlock.3mail
+usr/src/man/man3malloc/calloc.3malloc
+usr/src/man/man3malloc/free.3malloc
+usr/src/man/man3malloc/mallinfo.3malloc
+usr/src/man/man3malloc/mallocctl.3malloc
+usr/src/man/man3malloc/mallopt.3malloc
+usr/src/man/man3malloc/memalign.3malloc
+usr/src/man/man3malloc/realloc.3malloc
+usr/src/man/man3malloc/umem_cache_alloc.3malloc
+usr/src/man/man3malloc/umem_cache_destroy.3malloc
+usr/src/man/man3malloc/umem_cache_free.3malloc
+usr/src/man/man3malloc/umem_free.3malloc
+usr/src/man/man3malloc/umem_nofail_callback.3malloc
+usr/src/man/man3malloc/umem_zalloc.3malloc
+usr/src/man/man3malloc/valloc.3malloc
+usr/src/man/man3mp/mp_gcd.3mp
+usr/src/man/man3mp/mp_itom.3mp
+usr/src/man/man3mp/mp_madd.3mp
+usr/src/man/man3mp/mp_mcmp.3mp
+usr/src/man/man3mp/mp_mdiv.3mp
+usr/src/man/man3mp/mp_mfree.3mp
+usr/src/man/man3mp/mp_min.3mp
+usr/src/man/man3mp/mp_mout.3mp
+usr/src/man/man3mp/mp_msqrt.3mp
+usr/src/man/man3mp/mp_msub.3mp
+usr/src/man/man3mp/mp_mtox.3mp
+usr/src/man/man3mp/mp_mult.3mp
+usr/src/man/man3mp/mp_pow.3mp
+usr/src/man/man3mp/mp_rpow.3mp
+usr/src/man/man3mp/mp_sdiv.3mp
+usr/src/man/man3mp/mp_xtom.3mp
+usr/src/man/man3nsl/auth_destroy.3nsl
+usr/src/man/man3nsl/authdes_create.3nsl
+usr/src/man/man3nsl/authdes_getucred.3nsl
+usr/src/man/man3nsl/authdes_seccreate.3nsl
+usr/src/man/man3nsl/authnone_create.3nsl
+usr/src/man/man3nsl/authsys_create.3nsl
+usr/src/man/man3nsl/authsys_create_default.3nsl
+usr/src/man/man3nsl/authunix_create.3nsl
+usr/src/man/man3nsl/authunix_create_default.3nsl
+usr/src/man/man3nsl/callrpc.3nsl
+usr/src/man/man3nsl/clnt_broadcast.3nsl
+usr/src/man/man3nsl/clnt_call.3nsl
+usr/src/man/man3nsl/clnt_control.3nsl
+usr/src/man/man3nsl/clnt_create.3nsl
+usr/src/man/man3nsl/clnt_create_timed.3nsl
+usr/src/man/man3nsl/clnt_create_vers.3nsl
+usr/src/man/man3nsl/clnt_create_vers_timed.3nsl
+usr/src/man/man3nsl/clnt_destroy.3nsl
+usr/src/man/man3nsl/clnt_dg_create.3nsl
+usr/src/man/man3nsl/clnt_door_create.3nsl
+usr/src/man/man3nsl/clnt_freeres.3nsl
+usr/src/man/man3nsl/clnt_geterr.3nsl
+usr/src/man/man3nsl/clnt_pcreateerror.3nsl
+usr/src/man/man3nsl/clnt_perrno.3nsl
+usr/src/man/man3nsl/clnt_perror.3nsl
+usr/src/man/man3nsl/clnt_raw_create.3nsl
+usr/src/man/man3nsl/clnt_send.3nsl
+usr/src/man/man3nsl/clnt_spcreateerror.3nsl
+usr/src/man/man3nsl/clnt_sperrno.3nsl
+usr/src/man/man3nsl/clnt_sperror.3nsl
+usr/src/man/man3nsl/clnt_tli_create.3nsl
+usr/src/man/man3nsl/clnt_tp_create.3nsl
+usr/src/man/man3nsl/clnt_tp_create_timed.3nsl
+usr/src/man/man3nsl/clnt_vc_create.3nsl
+usr/src/man/man3nsl/clntraw_create.3nsl
+usr/src/man/man3nsl/clnttcp_create.3nsl
+usr/src/man/man3nsl/clntudp_bufcreate.3nsl
+usr/src/man/man3nsl/clntudp_create.3nsl
+usr/src/man/man3nsl/endhostent.3nsl
+usr/src/man/man3nsl/endnetconfig.3nsl
+usr/src/man/man3nsl/endnetpath.3nsl
+usr/src/man/man3nsl/endrpcent.3nsl
+usr/src/man/man3nsl/freeipsecalgent.3nsl
+usr/src/man/man3nsl/freenetconfigent.3nsl
+usr/src/man/man3nsl/get_myaddress.3nsl
+usr/src/man/man3nsl/gethostbyaddr.3nsl
+usr/src/man/man3nsl/gethostbyaddr_r.3nsl
+usr/src/man/man3nsl/gethostbyname_r.3nsl
+usr/src/man/man3nsl/gethostent.3nsl
+usr/src/man/man3nsl/gethostent_r.3nsl
+usr/src/man/man3nsl/getipsecalgbynum.3nsl
+usr/src/man/man3nsl/getipsecprotobynum.3nsl
+usr/src/man/man3nsl/getnetconfigent.3nsl
+usr/src/man/man3nsl/getnetname.3nsl
+usr/src/man/man3nsl/getrpcbyname_r.3nsl
+usr/src/man/man3nsl/getrpcbynumber.3nsl
+usr/src/man/man3nsl/getrpcbynumber_r.3nsl
+usr/src/man/man3nsl/getrpcent.3nsl
+usr/src/man/man3nsl/getrpcent_r.3nsl
+usr/src/man/man3nsl/getrpcport.3nsl
+usr/src/man/man3nsl/getsecretkey.3nsl
+usr/src/man/man3nsl/host2netname.3nsl
+usr/src/man/man3nsl/key_decryptsession.3nsl
+usr/src/man/man3nsl/key_encryptsession.3nsl
+usr/src/man/man3nsl/key_gendes.3nsl
+usr/src/man/man3nsl/key_secretkey_is_set.3nsl
+usr/src/man/man3nsl/key_setsecret.3nsl
+usr/src/man/man3nsl/nc_perror.3nsl
+usr/src/man/man3nsl/nc_sperror.3nsl
+usr/src/man/man3nsl/netdir_free.3nsl
+usr/src/man/man3nsl/netdir_getbyaddr.3nsl
+usr/src/man/man3nsl/netdir_getbyname.3nsl
+usr/src/man/man3nsl/netdir_mergeaddr.3nsl
+usr/src/man/man3nsl/netdir_options.3nsl
+usr/src/man/man3nsl/netdir_perror.3nsl
+usr/src/man/man3nsl/netdir_sperror.3nsl
+usr/src/man/man3nsl/netname2host.3nsl
+usr/src/man/man3nsl/netname2user.3nsl
+usr/src/man/man3nsl/pmap_getmaps.3nsl
+usr/src/man/man3nsl/pmap_getport.3nsl
+usr/src/man/man3nsl/pmap_rmtcall.3nsl
+usr/src/man/man3nsl/pmap_set.3nsl
+usr/src/man/man3nsl/pmap_unset.3nsl
+usr/src/man/man3nsl/publickey.3nsl
+usr/src/man/man3nsl/registerrpc.3nsl
+usr/src/man/man3nsl/rpc_broadcast.3nsl
+usr/src/man/man3nsl/rpc_broadcast_exp.3nsl
+usr/src/man/man3nsl/rpc_call.3nsl
+usr/src/man/man3nsl/rpc_createerr.3nsl
+usr/src/man/man3nsl/rpc_gss_get_mech_info.3nsl
+usr/src/man/man3nsl/rpc_gss_get_versions.3nsl
+usr/src/man/man3nsl/rpc_gss_is_installed.3nsl
+usr/src/man/man3nsl/rpc_gss_qop_to_num.3nsl
+usr/src/man/man3nsl/rpc_gss_svc_max_data_length.3nsl
+usr/src/man/man3nsl/rpc_reg.3nsl
+usr/src/man/man3nsl/rpcb_getaddr.3nsl
+usr/src/man/man3nsl/rpcb_getmaps.3nsl
+usr/src/man/man3nsl/rpcb_gettime.3nsl
+usr/src/man/man3nsl/rpcb_rmtcall.3nsl
+usr/src/man/man3nsl/rpcb_set.3nsl
+usr/src/man/man3nsl/rpcb_unset.3nsl
+usr/src/man/man3nsl/sethostent.3nsl
+usr/src/man/man3nsl/setnetconfig.3nsl
+usr/src/man/man3nsl/setnetpath.3nsl
+usr/src/man/man3nsl/setrpcent.3nsl
+usr/src/man/man3nsl/svc_add_input.3nsl
+usr/src/man/man3nsl/svc_auth_reg.3nsl
+usr/src/man/man3nsl/svc_control.3nsl
+usr/src/man/man3nsl/svc_create.3nsl
+usr/src/man/man3nsl/svc_destroy.3nsl
+usr/src/man/man3nsl/svc_dg_create.3nsl
+usr/src/man/man3nsl/svc_dg_enablecache.3nsl
+usr/src/man/man3nsl/svc_done.3nsl
+usr/src/man/man3nsl/svc_door_create.3nsl
+usr/src/man/man3nsl/svc_exit.3nsl
+usr/src/man/man3nsl/svc_fd_create.3nsl
+usr/src/man/man3nsl/svc_fd_negotiate_ucred.3nsl
+usr/src/man/man3nsl/svc_fds.3nsl
+usr/src/man/man3nsl/svc_fdset.3nsl
+usr/src/man/man3nsl/svc_freeargs.3nsl
+usr/src/man/man3nsl/svc_getargs.3nsl
+usr/src/man/man3nsl/svc_getcaller.3nsl
+usr/src/man/man3nsl/svc_getcallerucred.3nsl
+usr/src/man/man3nsl/svc_getreq.3nsl
+usr/src/man/man3nsl/svc_getreq_common.3nsl
+usr/src/man/man3nsl/svc_getreq_poll.3nsl
+usr/src/man/man3nsl/svc_getreqset.3nsl
+usr/src/man/man3nsl/svc_getrpccaller.3nsl
+usr/src/man/man3nsl/svc_max_pollfd.3nsl
+usr/src/man/man3nsl/svc_pollfd.3nsl
+usr/src/man/man3nsl/svc_raw_create.3nsl
+usr/src/man/man3nsl/svc_reg.3nsl
+usr/src/man/man3nsl/svc_register.3nsl
+usr/src/man/man3nsl/svc_remove_input.3nsl
+usr/src/man/man3nsl/svc_run.3nsl
+usr/src/man/man3nsl/svc_sendreply.3nsl
+usr/src/man/man3nsl/svc_tli_create.3nsl
+usr/src/man/man3nsl/svc_tp_create.3nsl
+usr/src/man/man3nsl/svc_unreg.3nsl
+usr/src/man/man3nsl/svc_unregister.3nsl
+usr/src/man/man3nsl/svc_vc_create.3nsl
+usr/src/man/man3nsl/svcerr_auth.3nsl
+usr/src/man/man3nsl/svcerr_decode.3nsl
+usr/src/man/man3nsl/svcerr_noproc.3nsl
+usr/src/man/man3nsl/svcerr_noprog.3nsl
+usr/src/man/man3nsl/svcerr_progvers.3nsl
+usr/src/man/man3nsl/svcerr_systemerr.3nsl
+usr/src/man/man3nsl/svcerr_weakauth.3nsl
+usr/src/man/man3nsl/svcfd_create.3nsl
+usr/src/man/man3nsl/svcraw_create.3nsl
+usr/src/man/man3nsl/svctcp_create.3nsl
+usr/src/man/man3nsl/svcudp_bufcreate.3nsl
+usr/src/man/man3nsl/svcudp_create.3nsl
+usr/src/man/man3nsl/taddr2uaddr.3nsl
+usr/src/man/man3nsl/uaddr2taddr.3nsl
+usr/src/man/man3nsl/undial.3nsl
+usr/src/man/man3nsl/user2netname.3nsl
+usr/src/man/man3nsl/xdr_accepted_reply.3nsl
+usr/src/man/man3nsl/xdr_array.3nsl
+usr/src/man/man3nsl/xdr_authsys_parms.3nsl
+usr/src/man/man3nsl/xdr_authunix_parms.3nsl
+usr/src/man/man3nsl/xdr_bool.3nsl
+usr/src/man/man3nsl/xdr_bytes.3nsl
+usr/src/man/man3nsl/xdr_callhdr.3nsl
+usr/src/man/man3nsl/xdr_callmsg.3nsl
+usr/src/man/man3nsl/xdr_char.3nsl
+usr/src/man/man3nsl/xdr_control.3nsl
+usr/src/man/man3nsl/xdr_destroy.3nsl
+usr/src/man/man3nsl/xdr_double.3nsl
+usr/src/man/man3nsl/xdr_enum.3nsl
+usr/src/man/man3nsl/xdr_float.3nsl
+usr/src/man/man3nsl/xdr_free.3nsl
+usr/src/man/man3nsl/xdr_getpos.3nsl
+usr/src/man/man3nsl/xdr_hyper.3nsl
+usr/src/man/man3nsl/xdr_inline.3nsl
+usr/src/man/man3nsl/xdr_int.3nsl
+usr/src/man/man3nsl/xdr_long.3nsl
+usr/src/man/man3nsl/xdr_longlong_t.3nsl
+usr/src/man/man3nsl/xdr_opaque.3nsl
+usr/src/man/man3nsl/xdr_opaque_auth.3nsl
+usr/src/man/man3nsl/xdr_pointer.3nsl
+usr/src/man/man3nsl/xdr_quadruple.3nsl
+usr/src/man/man3nsl/xdr_reference.3nsl
+usr/src/man/man3nsl/xdr_rejected_reply.3nsl
+usr/src/man/man3nsl/xdr_replymsg.3nsl
+usr/src/man/man3nsl/xdr_setpos.3nsl
+usr/src/man/man3nsl/xdr_short.3nsl
+usr/src/man/man3nsl/xdr_sizeof.3nsl
+usr/src/man/man3nsl/xdr_string.3nsl
+usr/src/man/man3nsl/xdr_u_char.3nsl
+usr/src/man/man3nsl/xdr_u_hyper.3nsl
+usr/src/man/man3nsl/xdr_u_int.3nsl
+usr/src/man/man3nsl/xdr_u_long.3nsl
+usr/src/man/man3nsl/xdr_u_longlong_t.3nsl
+usr/src/man/man3nsl/xdr_u_short.3nsl
+usr/src/man/man3nsl/xdr_union.3nsl
+usr/src/man/man3nsl/xdr_vector.3nsl
+usr/src/man/man3nsl/xdr_void.3nsl
+usr/src/man/man3nsl/xdr_wrapstring.3nsl
+usr/src/man/man3nsl/xdrmem_create.3nsl
+usr/src/man/man3nsl/xdrrec_create.3nsl
+usr/src/man/man3nsl/xdrrec_endofrecord.3nsl
+usr/src/man/man3nsl/xdrrec_eof.3nsl
+usr/src/man/man3nsl/xdrrec_readbytes.3nsl
+usr/src/man/man3nsl/xdrrec_skiprecord.3nsl
+usr/src/man/man3nsl/xdrstdio_create.3nsl
+usr/src/man/man3nsl/xprt_register.3nsl
+usr/src/man/man3nsl/xprt_unregister.3nsl
+usr/src/man/man3nsl/yp_all.3nsl
+usr/src/man/man3nsl/yp_bind.3nsl
+usr/src/man/man3nsl/yp_first.3nsl
+usr/src/man/man3nsl/yp_get_default_domain.3nsl
+usr/src/man/man3nsl/yp_master.3nsl
+usr/src/man/man3nsl/yp_match.3nsl
+usr/src/man/man3nsl/yp_next.3nsl
+usr/src/man/man3nsl/yp_order.3nsl
+usr/src/man/man3nsl/yp_unbind.3nsl
+usr/src/man/man3nsl/yperr_string.3nsl
+usr/src/man/man3nsl/ypprot_err.3nsl
+usr/src/man/man3nvpair/nv_alloc_fini.3nvpair
+usr/src/man/man3nvpair/nv_alloc_init.3nvpair
+usr/src/man/man3nvpair/nv_alloc_reset.3nvpair
+usr/src/man/man3nvpair/nvlist_add_boolean_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_boolean_value.3nvpair
+usr/src/man/man3nvpair/nvlist_add_byte.3nvpair
+usr/src/man/man3nvpair/nvlist_add_byte_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_double.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int16.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int16_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int32.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int32_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int64.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int64_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int8.3nvpair
+usr/src/man/man3nvpair/nvlist_add_int8_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_nvlist.3nvpair
+usr/src/man/man3nvpair/nvlist_add_nvlist_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_nvpair.3nvpair
+usr/src/man/man3nvpair/nvlist_add_string.3nvpair
+usr/src/man/man3nvpair/nvlist_add_string_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint16.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint16_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint32.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint32_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint64.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint64_array.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint8.3nvpair
+usr/src/man/man3nvpair/nvlist_add_uint8_array.3nvpair
+usr/src/man/man3nvpair/nvlist_dup.3nvpair
+usr/src/man/man3nvpair/nvlist_exists.3nvpair
+usr/src/man/man3nvpair/nvlist_free.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_boolean_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_boolean_value.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_byte.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_byte_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_double.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int16.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int16_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int32.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int32_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int64.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int64_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int8.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_int8_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_nv_alloc.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_nvlist.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_nvlist_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_pairs.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_string.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_string_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint16.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint16_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint32.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint32_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint64.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint64_array.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint8.3nvpair
+usr/src/man/man3nvpair/nvlist_lookup_uint8_array.3nvpair
+usr/src/man/man3nvpair/nvlist_merge.3nvpair
+usr/src/man/man3nvpair/nvlist_pack.3nvpair
+usr/src/man/man3nvpair/nvlist_remove_all.3nvpair
+usr/src/man/man3nvpair/nvlist_size.3nvpair
+usr/src/man/man3nvpair/nvlist_unpack.3nvpair
+usr/src/man/man3nvpair/nvlist_xalloc.3nvpair
+usr/src/man/man3nvpair/nvlist_xdup.3nvpair
+usr/src/man/man3nvpair/nvlist_xpack.3nvpair
+usr/src/man/man3nvpair/nvlist_xunpack.3nvpair
+usr/src/man/man3nvpair/nvpair_name.3nvpair
+usr/src/man/man3nvpair/nvpair_type.3nvpair
+usr/src/man/man3nvpair/nvpair_value_boolean_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_boolean_value.3nvpair
+usr/src/man/man3nvpair/nvpair_value_byte_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_double.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int16.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int16_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int32.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int32_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int64.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int64_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int8.3nvpair
+usr/src/man/man3nvpair/nvpair_value_int8_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_nvlist.3nvpair
+usr/src/man/man3nvpair/nvpair_value_nvlist_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_string.3nvpair
+usr/src/man/man3nvpair/nvpair_value_string_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint16.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint16_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint32.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint32_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint64.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint64_array.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint8.3nvpair
+usr/src/man/man3nvpair/nvpair_value_uint8_array.3nvpair
+usr/src/man/man3pam/pam_close_session.3pam
+usr/src/man/man3pam/pam_end.3pam
+usr/src/man/man3pam/pam_get_data.3pam
+usr/src/man/man3pam/pam_get_item.3pam
+usr/src/man/man3pam/pam_sm_close_session.3pam
+usr/src/man/man3papi/papiAttributeListAddBoolean.3papi
+usr/src/man/man3papi/papiAttributeListAddCollection.3papi
+usr/src/man/man3papi/papiAttributeListAddDatetime.3papi
+usr/src/man/man3papi/papiAttributeListAddInteger.3papi
+usr/src/man/man3papi/papiAttributeListAddMetadata.3papi
+usr/src/man/man3papi/papiAttributeListAddRange.3papi
+usr/src/man/man3papi/papiAttributeListAddResolution.3papi
+usr/src/man/man3papi/papiAttributeListAddString.3papi
+usr/src/man/man3papi/papiAttributeListDelete.3papi
+usr/src/man/man3papi/papiAttributeListFind.3papi
+usr/src/man/man3papi/papiAttributeListFree.3papi
+usr/src/man/man3papi/papiAttributeListFromString.3papi
+usr/src/man/man3papi/papiAttributeListGetBoolean.3papi
+usr/src/man/man3papi/papiAttributeListGetCollection.3papi
+usr/src/man/man3papi/papiAttributeListGetDatetime.3papi
+usr/src/man/man3papi/papiAttributeListGetInteger.3papi
+usr/src/man/man3papi/papiAttributeListGetMetadata.3papi
+usr/src/man/man3papi/papiAttributeListGetNext.3papi
+usr/src/man/man3papi/papiAttributeListGetRange.3papi
+usr/src/man/man3papi/papiAttributeListGetResolution.3papi
+usr/src/man/man3papi/papiAttributeListGetString.3papi
+usr/src/man/man3papi/papiAttributeListGetValue.3papi
+usr/src/man/man3papi/papiAttributeListToString.3papi
+usr/src/man/man3papi/papiJobCancel.3papi
+usr/src/man/man3papi/papiJobFree.3papi
+usr/src/man/man3papi/papiJobGetAttributeList.3papi
+usr/src/man/man3papi/papiJobGetId.3papi
+usr/src/man/man3papi/papiJobGetJobTicket.3papi
+usr/src/man/man3papi/papiJobGetPrinterName.3papi
+usr/src/man/man3papi/papiJobHold.3papi
+usr/src/man/man3papi/papiJobListFree.3papi
+usr/src/man/man3papi/papiJobModify.3papi
+usr/src/man/man3papi/papiJobMove.3papi
+usr/src/man/man3papi/papiJobPromote.3papi
+usr/src/man/man3papi/papiJobQuery.3papi
+usr/src/man/man3papi/papiJobRelease.3papi
+usr/src/man/man3papi/papiJobRestart.3papi
+usr/src/man/man3papi/papiJobStreamClose.3papi
+usr/src/man/man3papi/papiJobStreamOpen.3papi
+usr/src/man/man3papi/papiJobStreamWrite.3papi
+usr/src/man/man3papi/papiJobSubmitByReference.3papi
+usr/src/man/man3papi/papiJobValidate.3papi
+usr/src/man/man3papi/papiLibrarySupportedCalls.3papi
+usr/src/man/man3papi/papiPrinterAdd.3papi
+usr/src/man/man3papi/papiPrinterDisable.3papi
+usr/src/man/man3papi/papiPrinterEnable.3papi
+usr/src/man/man3papi/papiPrinterFree.3papi
+usr/src/man/man3papi/papiPrinterGetAttributeList.3papi
+usr/src/man/man3papi/papiPrinterListFree.3papi
+usr/src/man/man3papi/papiPrinterListJobs.3papi
+usr/src/man/man3papi/papiPrinterModify.3papi
+usr/src/man/man3papi/papiPrinterPause.3papi
+usr/src/man/man3papi/papiPrinterPurgeJobs.3papi
+usr/src/man/man3papi/papiPrinterQuery.3papi
+usr/src/man/man3papi/papiPrinterRemove.3papi
+usr/src/man/man3papi/papiPrinterResume.3papi
+usr/src/man/man3papi/papiServiceDestroy.3papi
+usr/src/man/man3papi/papiServiceGetAppData.3papi
+usr/src/man/man3papi/papiServiceGetAttributeList.3papi
+usr/src/man/man3papi/papiServiceGetEncryption.3papi
+usr/src/man/man3papi/papiServiceGetPassword.3papi
+usr/src/man/man3papi/papiServiceGetServiceName.3papi
+usr/src/man/man3papi/papiServiceGetStatusMessage.3papi
+usr/src/man/man3papi/papiServiceGetUserName.3papi
+usr/src/man/man3papi/papiServiceSetAppData.3papi
+usr/src/man/man3papi/papiServiceSetAuthCB.3papi
+usr/src/man/man3papi/papiServiceSetEncryption.3papi
+usr/src/man/man3papi/papiServiceSetPassword.3papi
+usr/src/man/man3papi/papiServiceSetUserName.3papi
+usr/src/man/man3picl/picl_get_next_by_col.3picl
+usr/src/man/man3picl/picl_get_next_prop.3picl
+usr/src/man/man3picl/picl_get_propval_by_name.3picl
+usr/src/man/man3picl/picl_set_propval_by_name.3picl
+usr/src/man/man3picltree/ptree_add_row_to_table.3picltree
+usr/src/man/man3picltree/ptree_delete_node.3picltree
+usr/src/man/man3picltree/ptree_delete_prop.3picltree
+usr/src/man/man3picltree/ptree_destroy_node.3picltree
+usr/src/man/man3picltree/ptree_destroy_prop.3picltree
+usr/src/man/man3picltree/ptree_get_next_by_col.3picltree
+usr/src/man/man3picltree/ptree_get_next_prop.3picltree
+usr/src/man/man3picltree/ptree_get_propval_by_name.3picltree
+usr/src/man/man3picltree/ptree_update_propval_by_name.3picltree
+usr/src/man/man3pool/pool_conf_close.3pool
+usr/src/man/man3pool/pool_conf_commit.3pool
+usr/src/man/man3pool/pool_conf_export.3pool
+usr/src/man/man3pool/pool_conf_free.3pool
+usr/src/man/man3pool/pool_conf_info.3pool
+usr/src/man/man3pool/pool_conf_location.3pool
+usr/src/man/man3pool/pool_conf_open.3pool
+usr/src/man/man3pool/pool_conf_remove.3pool
+usr/src/man/man3pool/pool_conf_rollback.3pool
+usr/src/man/man3pool/pool_conf_status.3pool
+usr/src/man/man3pool/pool_conf_to_elem.3pool
+usr/src/man/man3pool/pool_conf_update.3pool
+usr/src/man/man3pool/pool_conf_validate.3pool
+usr/src/man/man3pool/pool_create.3pool
+usr/src/man/man3pool/pool_destroy.3pool
+usr/src/man/man3pool/pool_dissociate.3pool
+usr/src/man/man3pool/pool_get_owning_resource.3pool
+usr/src/man/man3pool/pool_get_resource.3pool
+usr/src/man/man3pool/pool_get_resource_binding.3pool
+usr/src/man/man3pool/pool_get_status.3pool
+usr/src/man/man3pool/pool_info.3pool
+usr/src/man/man3pool/pool_put_property.3pool
+usr/src/man/man3pool/pool_query_components.3pool
+usr/src/man/man3pool/pool_query_pool_resources.3pool
+usr/src/man/man3pool/pool_query_pools.3pool
+usr/src/man/man3pool/pool_query_resource_components.3pool
+usr/src/man/man3pool/pool_query_resources.3pool
+usr/src/man/man3pool/pool_resource_destroy.3pool
+usr/src/man/man3pool/pool_resource_info.3pool
+usr/src/man/man3pool/pool_resource_to_elem.3pool
+usr/src/man/man3pool/pool_resource_transfer.3pool
+usr/src/man/man3pool/pool_resource_type_list.3pool
+usr/src/man/man3pool/pool_resource_xtransfer.3pool
+usr/src/man/man3pool/pool_rm_property.3pool
+usr/src/man/man3pool/pool_set_binding.3pool
+usr/src/man/man3pool/pool_set_status.3pool
+usr/src/man/man3pool/pool_static_location.3pool
+usr/src/man/man3pool/pool_strerror.3pool
+usr/src/man/man3pool/pool_to_elem.3pool
+usr/src/man/man3pool/pool_value_free.3pool
+usr/src/man/man3pool/pool_value_get_bool.3pool
+usr/src/man/man3pool/pool_value_get_double.3pool
+usr/src/man/man3pool/pool_value_get_int64.3pool
+usr/src/man/man3pool/pool_value_get_name.3pool
+usr/src/man/man3pool/pool_value_get_string.3pool
+usr/src/man/man3pool/pool_value_get_type.3pool
+usr/src/man/man3pool/pool_value_get_uint64.3pool
+usr/src/man/man3pool/pool_value_set_bool.3pool
+usr/src/man/man3pool/pool_value_set_double.3pool
+usr/src/man/man3pool/pool_value_set_int64.3pool
+usr/src/man/man3pool/pool_value_set_name.3pool
+usr/src/man/man3pool/pool_value_set_string.3pool
+usr/src/man/man3pool/pool_value_set_uint64.3pool
+usr/src/man/man3pool/pool_version.3pool
+usr/src/man/man3pool/pool_walk_pools.3pool
+usr/src/man/man3pool/pool_walk_properties.3pool
+usr/src/man/man3pool/pool_walk_resources.3pool
+usr/src/man/man3proc/ps_kill.3proc
+usr/src/man/man3proc/ps_lcontinue.3proc
+usr/src/man/man3proc/ps_lgetfpregs.3proc
+usr/src/man/man3proc/ps_lgetxregs.3proc
+usr/src/man/man3proc/ps_lgetxregsize.3proc
+usr/src/man/man3proc/ps_lrolltoaddr.3proc
+usr/src/man/man3proc/ps_lsetfpregs.3proc
+usr/src/man/man3proc/ps_lsetregs.3proc
+usr/src/man/man3proc/ps_lsetxregs.3proc
+usr/src/man/man3proc/ps_lstop.3proc
+usr/src/man/man3proc/ps_pcontinue.3proc
+usr/src/man/man3proc/ps_pdread.3proc
+usr/src/man/man3proc/ps_pdwrite.3proc
+usr/src/man/man3proc/ps_pglobal_sym.3proc
+usr/src/man/man3proc/ps_ptread.3proc
+usr/src/man/man3proc/ps_ptwrite.3proc
+usr/src/man/man3proc/ps_pwrite.3proc
+usr/src/man/man3project/endprojent.3project
+usr/src/man/man3project/fgetprojent.3project
+usr/src/man/man3project/getdefaultproj.3project
+usr/src/man/man3project/getprojbyid.3project
+usr/src/man/man3project/getprojbyname.3project
+usr/src/man/man3project/getprojidbyname.3project
+usr/src/man/man3project/inproj.3project
+usr/src/man/man3project/setprojent.3project
+usr/src/man/man3resolv/dn_comp.3resolv
+usr/src/man/man3resolv/dn_expand.3resolv
+usr/src/man/man3resolv/fp_resstat.3resolv
+usr/src/man/man3resolv/herror.3resolv
+usr/src/man/man3resolv/hstrerror.3resolv
+usr/src/man/man3resolv/res_getservers.3resolv
+usr/src/man/man3resolv/res_hostalias.3resolv
+usr/src/man/man3resolv/res_init.3resolv
+usr/src/man/man3resolv/res_mkquery.3resolv
+usr/src/man/man3resolv/res_nclose.3resolv
+usr/src/man/man3resolv/res_ndestroy.3resolv
+usr/src/man/man3resolv/res_ninit.3resolv
+usr/src/man/man3resolv/res_nmkquery.3resolv
+usr/src/man/man3resolv/res_nquery.3resolv
+usr/src/man/man3resolv/res_nquerydomain.3resolv
+usr/src/man/man3resolv/res_nsearch.3resolv
+usr/src/man/man3resolv/res_nsend.3resolv
+usr/src/man/man3resolv/res_nsendsigned.3resolv
+usr/src/man/man3resolv/res_query.3resolv
+usr/src/man/man3resolv/res_search.3resolv
+usr/src/man/man3resolv/res_send.3resolv
+usr/src/man/man3resolv/res_setservers.3resolv
+usr/src/man/man3rpc/havedisk.3rpc
+usr/src/man/man3rpc/rnusers.3rpc
+usr/src/man/man3rsm/rsm_free_interconnect_topology.3rsm
+usr/src/man/man3rsm/rsm_free_localmemory_handle.3rsm
+usr/src/man/man3rsm/rsm_get_controller_attr.3rsm
+usr/src/man/man3rsm/rsm_intr_signal_wait.3rsm
+usr/src/man/man3rsm/rsm_memseg_export_destroy.3rsm
+usr/src/man/man3rsm/rsm_memseg_export_rebind.3rsm
+usr/src/man/man3rsm/rsm_memseg_export_republish.3rsm
+usr/src/man/man3rsm/rsm_memseg_export_unpublish.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_close_barrier.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_destroy_barrier.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_disconnect.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_get16.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_get32.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_get64.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_get8.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_get_mode.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_getv.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_order_barrier.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_put16.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_put32.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_put64.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_put8.3rsm
+usr/src/man/man3rsm/rsm_memseg_import_unmap.3rsm
+usr/src/man/man3rsm/rsm_memseg_release_pollfd.3rsm
+usr/src/man/man3rsm/rsm_release_controller.3rsm
+usr/src/man/man3sasl/prop_clear.3sasl
+usr/src/man/man3sasl/prop_dispose.3sasl
+usr/src/man/man3sasl/prop_dup.3sasl
+usr/src/man/man3sasl/prop_erase.3sasl
+usr/src/man/man3sasl/prop_format.3sasl
+usr/src/man/man3sasl/prop_get.3sasl
+usr/src/man/man3sasl/prop_getnames.3sasl
+usr/src/man/man3sasl/prop_new.3sasl
+usr/src/man/man3sasl/prop_request.3sasl
+usr/src/man/man3sasl/prop_set.3sasl
+usr/src/man/man3sasl/prop_setvals.3sasl
+usr/src/man/man3sasl/sasl_encodev.3sasl
+usr/src/man/man3scf/scf_count_ranges_destroy.3scf
+usr/src/man/man3scf/scf_entry_add_value.3scf
+usr/src/man/man3scf/scf_entry_destroy.3scf
+usr/src/man/man3scf/scf_entry_destroy_children.3scf
+usr/src/man/man3scf/scf_entry_handle.3scf
+usr/src/man/man3scf/scf_entry_reset.3scf
+usr/src/man/man3scf/scf_handle_bind.3scf
+usr/src/man/man3scf/scf_handle_decorate.3scf
+usr/src/man/man3scf/scf_handle_destroy.3scf
+usr/src/man/man3scf/scf_handle_get_scope.3scf
+usr/src/man/man3scf/scf_handle_unbind.3scf
+usr/src/man/man3scf/scf_instance_add_pg.3scf
+usr/src/man/man3scf/scf_instance_delete.3scf
+usr/src/man/man3scf/scf_instance_destroy.3scf
+usr/src/man/man3scf/scf_instance_get_name.3scf
+usr/src/man/man3scf/scf_instance_get_parent.3scf
+usr/src/man/man3scf/scf_instance_get_pg.3scf
+usr/src/man/man3scf/scf_instance_get_pg_composed.3scf
+usr/src/man/man3scf/scf_instance_get_snapshot.3scf
+usr/src/man/man3scf/scf_instance_handle.3scf
+usr/src/man/man3scf/scf_instance_to_fmri.3scf
+usr/src/man/man3scf/scf_int_ranges_destroy.3scf
+usr/src/man/man3scf/scf_iter_destroy.3scf
+usr/src/man/man3scf/scf_iter_handle.3scf
+usr/src/man/man3scf/scf_iter_handle_scopes.3scf
+usr/src/man/man3scf/scf_iter_instance_pgs.3scf
+usr/src/man/man3scf/scf_iter_instance_pgs_composed.3scf
+usr/src/man/man3scf/scf_iter_instance_pgs_typed.3scf
+usr/src/man/man3scf/scf_iter_instance_pgs_typed_composed.3scf
+usr/src/man/man3scf/scf_iter_instance_snapshots.3scf
+usr/src/man/man3scf/scf_iter_next_instance.3scf
+usr/src/man/man3scf/scf_iter_next_pg.3scf
+usr/src/man/man3scf/scf_iter_next_property.3scf
+usr/src/man/man3scf/scf_iter_next_scope.3scf
+usr/src/man/man3scf/scf_iter_next_service.3scf
+usr/src/man/man3scf/scf_iter_next_snapshot.3scf
+usr/src/man/man3scf/scf_iter_next_value.3scf
+usr/src/man/man3scf/scf_iter_pg_properties.3scf
+usr/src/man/man3scf/scf_iter_property_values.3scf
+usr/src/man/man3scf/scf_iter_reset.3scf
+usr/src/man/man3scf/scf_iter_scope_services.3scf
+usr/src/man/man3scf/scf_iter_service_instances.3scf
+usr/src/man/man3scf/scf_iter_service_pgs.3scf
+usr/src/man/man3scf/scf_iter_service_pgs_typed.3scf
+usr/src/man/man3scf/scf_iter_snaplevel_pgs.3scf
+usr/src/man/man3scf/scf_iter_snaplevel_pgs_typed.3scf
+usr/src/man/man3scf/scf_myname.3scf
+usr/src/man/man3scf/scf_pg_delete.3scf
+usr/src/man/man3scf/scf_pg_destroy.3scf
+usr/src/man/man3scf/scf_pg_get_flags.3scf
+usr/src/man/man3scf/scf_pg_get_name.3scf
+usr/src/man/man3scf/scf_pg_get_parent_instance.3scf
+usr/src/man/man3scf/scf_pg_get_parent_service.3scf
+usr/src/man/man3scf/scf_pg_get_parent_snaplevel.3scf
+usr/src/man/man3scf/scf_pg_get_property.3scf
+usr/src/man/man3scf/scf_pg_get_type.3scf
+usr/src/man/man3scf/scf_pg_get_underlying_pg.3scf
+usr/src/man/man3scf/scf_pg_handle.3scf
+usr/src/man/man3scf/scf_pg_to_fmri.3scf
+usr/src/man/man3scf/scf_pg_update.3scf
+usr/src/man/man3scf/scf_property_destroy.3scf
+usr/src/man/man3scf/scf_property_get_name.3scf
+usr/src/man/man3scf/scf_property_get_value.3scf
+usr/src/man/man3scf/scf_property_handle.3scf
+usr/src/man/man3scf/scf_property_is_type.3scf
+usr/src/man/man3scf/scf_property_to_fmri.3scf
+usr/src/man/man3scf/scf_property_type.3scf
+usr/src/man/man3scf/scf_scope_add_service.3scf
+usr/src/man/man3scf/scf_scope_destroy.3scf
+usr/src/man/man3scf/scf_scope_get_name.3scf
+usr/src/man/man3scf/scf_scope_get_service.3scf
+usr/src/man/man3scf/scf_scope_handle.3scf
+usr/src/man/man3scf/scf_scope_to_fmri.3scf
+usr/src/man/man3scf/scf_service_add_instance.3scf
+usr/src/man/man3scf/scf_service_add_pg.3scf
+usr/src/man/man3scf/scf_service_delete.3scf
+usr/src/man/man3scf/scf_service_destroy.3scf
+usr/src/man/man3scf/scf_service_get_instance.3scf
+usr/src/man/man3scf/scf_service_get_name.3scf
+usr/src/man/man3scf/scf_service_get_parent.3scf
+usr/src/man/man3scf/scf_service_get_pg.3scf
+usr/src/man/man3scf/scf_service_handle.3scf
+usr/src/man/man3scf/scf_service_to_fmri.3scf
+usr/src/man/man3scf/scf_simple_app_props_free.3scf
+usr/src/man/man3scf/scf_simple_app_props_get.3scf
+usr/src/man/man3scf/scf_simple_app_props_next.3scf
+usr/src/man/man3scf/scf_simple_app_props_search.3scf
+usr/src/man/man3scf/scf_simple_prop_free.3scf
+usr/src/man/man3scf/scf_simple_prop_name.3scf
+usr/src/man/man3scf/scf_simple_prop_next_astring.3scf
+usr/src/man/man3scf/scf_simple_prop_next_boolean.3scf
+usr/src/man/man3scf/scf_simple_prop_next_count.3scf
+usr/src/man/man3scf/scf_simple_prop_next_integer.3scf
+usr/src/man/man3scf/scf_simple_prop_next_opaque.3scf
+usr/src/man/man3scf/scf_simple_prop_next_reset.3scf
+usr/src/man/man3scf/scf_simple_prop_next_time.3scf
+usr/src/man/man3scf/scf_simple_prop_next_ustring.3scf
+usr/src/man/man3scf/scf_simple_prop_numvalues.3scf
+usr/src/man/man3scf/scf_simple_prop_pgname.3scf
+usr/src/man/man3scf/scf_simple_prop_type.3scf
+usr/src/man/man3scf/scf_snaplevel_destroy.3scf
+usr/src/man/man3scf/scf_snaplevel_get_instance_name.3scf
+usr/src/man/man3scf/scf_snaplevel_get_next_snaplevel.3scf
+usr/src/man/man3scf/scf_snaplevel_get_parent.3scf
+usr/src/man/man3scf/scf_snaplevel_get_pg.3scf
+usr/src/man/man3scf/scf_snaplevel_get_scope_name.3scf
+usr/src/man/man3scf/scf_snaplevel_get_service_name.3scf
+usr/src/man/man3scf/scf_snaplevel_handle.3scf
+usr/src/man/man3scf/scf_snapshot_destroy.3scf
+usr/src/man/man3scf/scf_snapshot_get_base_snaplevel.3scf
+usr/src/man/man3scf/scf_snapshot_get_name.3scf
+usr/src/man/man3scf/scf_snapshot_get_parent.3scf
+usr/src/man/man3scf/scf_snapshot_handle.3scf
+usr/src/man/man3scf/scf_snapshot_update.3scf
+usr/src/man/man3scf/scf_strerror.3scf
+usr/src/man/man3scf/scf_string_to_type.3scf
+usr/src/man/man3scf/scf_tmpl_error_pg.3scf
+usr/src/man/man3scf/scf_tmpl_error_pg_tmpl.3scf
+usr/src/man/man3scf/scf_tmpl_error_prop.3scf
+usr/src/man/man3scf/scf_tmpl_error_prop_tmpl.3scf
+usr/src/man/man3scf/scf_tmpl_error_source_fmri.3scf
+usr/src/man/man3scf/scf_tmpl_error_type.3scf
+usr/src/man/man3scf/scf_tmpl_error_value.3scf
+usr/src/man/man3scf/scf_tmpl_errors_destroy.3scf
+usr/src/man/man3scf/scf_tmpl_get_by_pg.3scf
+usr/src/man/man3scf/scf_tmpl_get_by_pg_name.3scf
+usr/src/man/man3scf/scf_tmpl_get_by_prop.3scf
+usr/src/man/man3scf/scf_tmpl_iter_pgs.3scf
+usr/src/man/man3scf/scf_tmpl_iter_props.3scf
+usr/src/man/man3scf/scf_tmpl_next_error.3scf
+usr/src/man/man3scf/scf_tmpl_pg_common_name.3scf
+usr/src/man/man3scf/scf_tmpl_pg_description.3scf
+usr/src/man/man3scf/scf_tmpl_pg_destroy.3scf
+usr/src/man/man3scf/scf_tmpl_pg_required.3scf
+usr/src/man/man3scf/scf_tmpl_pg_reset.3scf
+usr/src/man/man3scf/scf_tmpl_pg_target.3scf
+usr/src/man/man3scf/scf_tmpl_pg_type.3scf
+usr/src/man/man3scf/scf_tmpl_prop_cardinality.3scf
+usr/src/man/man3scf/scf_tmpl_prop_common_name.3scf
+usr/src/man/man3scf/scf_tmpl_prop_description.3scf
+usr/src/man/man3scf/scf_tmpl_prop_destroy.3scf
+usr/src/man/man3scf/scf_tmpl_prop_internal_seps.3scf
+usr/src/man/man3scf/scf_tmpl_prop_required.3scf
+usr/src/man/man3scf/scf_tmpl_prop_reset.3scf
+usr/src/man/man3scf/scf_tmpl_prop_type.3scf
+usr/src/man/man3scf/scf_tmpl_prop_units.3scf
+usr/src/man/man3scf/scf_tmpl_prop_visibility.3scf
+usr/src/man/man3scf/scf_tmpl_reset_errors.3scf
+usr/src/man/man3scf/scf_tmpl_strerror.3scf
+usr/src/man/man3scf/scf_tmpl_value_common_name.3scf
+usr/src/man/man3scf/scf_tmpl_value_count_range_choices.3scf
+usr/src/man/man3scf/scf_tmpl_value_count_range_constraints.3scf
+usr/src/man/man3scf/scf_tmpl_value_description.3scf
+usr/src/man/man3scf/scf_tmpl_value_in_constraint.3scf
+usr/src/man/man3scf/scf_tmpl_value_int_range_choices.3scf
+usr/src/man/man3scf/scf_tmpl_value_int_range_constraints.3scf
+usr/src/man/man3scf/scf_tmpl_value_name_choices.3scf
+usr/src/man/man3scf/scf_tmpl_value_name_constraints.3scf
+usr/src/man/man3scf/scf_tmpl_visibility_to_string.3scf
+usr/src/man/man3scf/scf_transaction_commit.3scf
+usr/src/man/man3scf/scf_transaction_destroy.3scf
+usr/src/man/man3scf/scf_transaction_destroy_children.3scf
+usr/src/man/man3scf/scf_transaction_handle.3scf
+usr/src/man/man3scf/scf_transaction_property_change.3scf
+usr/src/man/man3scf/scf_transaction_property_change_type.3scf
+usr/src/man/man3scf/scf_transaction_property_delete.3scf
+usr/src/man/man3scf/scf_transaction_property_new.3scf
+usr/src/man/man3scf/scf_transaction_reset.3scf
+usr/src/man/man3scf/scf_transaction_reset_all.3scf
+usr/src/man/man3scf/scf_transaction_start.3scf
+usr/src/man/man3scf/scf_type_base_type.3scf
+usr/src/man/man3scf/scf_type_to_string.3scf
+usr/src/man/man3scf/scf_value_base_type.3scf
+usr/src/man/man3scf/scf_value_destroy.3scf
+usr/src/man/man3scf/scf_value_get_as_string.3scf
+usr/src/man/man3scf/scf_value_get_as_string_typed.3scf
+usr/src/man/man3scf/scf_value_get_astring.3scf
+usr/src/man/man3scf/scf_value_get_boolean.3scf
+usr/src/man/man3scf/scf_value_get_count.3scf
+usr/src/man/man3scf/scf_value_get_integer.3scf
+usr/src/man/man3scf/scf_value_get_opaque.3scf
+usr/src/man/man3scf/scf_value_get_time.3scf
+usr/src/man/man3scf/scf_value_get_ustring.3scf
+usr/src/man/man3scf/scf_value_handle.3scf
+usr/src/man/man3scf/scf_value_is_type.3scf
+usr/src/man/man3scf/scf_value_reset.3scf
+usr/src/man/man3scf/scf_value_set_astring.3scf
+usr/src/man/man3scf/scf_value_set_boolean.3scf
+usr/src/man/man3scf/scf_value_set_count.3scf
+usr/src/man/man3scf/scf_value_set_from_string.3scf
+usr/src/man/man3scf/scf_value_set_integer.3scf
+usr/src/man/man3scf/scf_value_set_opaque.3scf
+usr/src/man/man3scf/scf_value_set_time.3scf
+usr/src/man/man3scf/scf_value_set_ustring.3scf
+usr/src/man/man3scf/scf_value_type.3scf
+usr/src/man/man3scf/scf_values_destroy.3scf
+usr/src/man/man3scf/smf_degrade_instance.3scf
+usr/src/man/man3scf/smf_disable_instance.3scf
+usr/src/man/man3scf/smf_get_state.3scf
+usr/src/man/man3scf/smf_maintain_instance.3scf
+usr/src/man/man3scf/smf_refresh_instance.3scf
+usr/src/man/man3scf/smf_restart_instance.3scf
+usr/src/man/man3scf/smf_restore_instance.3scf
+usr/src/man/man3sec/acl_fromtext.3sec
+usr/src/man/man3sec/acl_set.3sec
+usr/src/man/man3sec/aclfrommode.3sec
+usr/src/man/man3sec/aclfromtext.3sec
+usr/src/man/man3sec/facl_get.3sec
+usr/src/man/man3sec/facl_set.3sec
+usr/src/man/man3secdb/chkauthattr.3secdb
+usr/src/man/man3secdb/endauthattr.3secdb
+usr/src/man/man3secdb/endexecattr.3secdb
+usr/src/man/man3secdb/endprofattr.3secdb
+usr/src/man/man3secdb/enduserattr.3secdb
+usr/src/man/man3secdb/fgetuserattr.3secdb
+usr/src/man/man3secdb/free_authattr.3secdb
+usr/src/man/man3secdb/free_execattr.3secdb
+usr/src/man/man3secdb/free_profattr.3secdb
+usr/src/man/man3secdb/free_proflist.3secdb
+usr/src/man/man3secdb/free_userattr.3secdb
+usr/src/man/man3secdb/getauthnam.3secdb
+usr/src/man/man3secdb/getexecprof.3secdb
+usr/src/man/man3secdb/getexecuser.3secdb
+usr/src/man/man3secdb/getproflist.3secdb
+usr/src/man/man3secdb/getprofnam.3secdb
+usr/src/man/man3secdb/getusernam.3secdb
+usr/src/man/man3secdb/getuseruid.3secdb
+usr/src/man/man3secdb/match_execattr.3secdb
+usr/src/man/man3secdb/setauthattr.3secdb
+usr/src/man/man3secdb/setexecattr.3secdb
+usr/src/man/man3secdb/setprofattr.3secdb
+usr/src/man/man3secdb/setuserattr.3secdb
+usr/src/man/man3sip/sip_add_accept.3sip
+usr/src/man/man3sip/sip_add_accept_enc.3sip
+usr/src/man/man3sip/sip_add_accept_lang.3sip
+usr/src/man/man3sip/sip_add_alert_info.3sip
+usr/src/man/man3sip/sip_add_allow.3sip
+usr/src/man/man3sip/sip_add_allow_events.3sip
+usr/src/man/man3sip/sip_add_authen_info.3sip
+usr/src/man/man3sip/sip_add_author.3sip
+usr/src/man/man3sip/sip_add_call_info.3sip
+usr/src/man/man3sip/sip_add_callid.3sip
+usr/src/man/man3sip/sip_add_contact.3sip
+usr/src/man/man3sip/sip_add_content.3sip
+usr/src/man/man3sip/sip_add_content_disp.3sip
+usr/src/man/man3sip/sip_add_content_enc.3sip
+usr/src/man/man3sip/sip_add_content_lang.3sip
+usr/src/man/man3sip/sip_add_content_type.3sip
+usr/src/man/man3sip/sip_add_cseq.3sip
+usr/src/man/man3sip/sip_add_date.3sip
+usr/src/man/man3sip/sip_add_error_info.3sip
+usr/src/man/man3sip/sip_add_event.3sip
+usr/src/man/man3sip/sip_add_expires.3sip
+usr/src/man/man3sip/sip_add_in_reply_to.3sip
+usr/src/man/man3sip/sip_add_maxforward.3sip
+usr/src/man/man3sip/sip_add_mime_version.3sip
+usr/src/man/man3sip/sip_add_min_expires.3sip
+usr/src/man/man3sip/sip_add_org.3sip
+usr/src/man/man3sip/sip_add_passertedid.3sip
+usr/src/man/man3sip/sip_add_ppreferredid.3sip
+usr/src/man/man3sip/sip_add_priority.3sip
+usr/src/man/man3sip/sip_add_privacy.3sip
+usr/src/man/man3sip/sip_add_proxy_authen.3sip
+usr/src/man/man3sip/sip_add_proxy_author.3sip
+usr/src/man/man3sip/sip_add_proxy_require.3sip
+usr/src/man/man3sip/sip_add_rack.3sip
+usr/src/man/man3sip/sip_add_record_route.3sip
+usr/src/man/man3sip/sip_add_reply_to.3sip
+usr/src/man/man3sip/sip_add_require.3sip
+usr/src/man/man3sip/sip_add_response_line.3sip
+usr/src/man/man3sip/sip_add_retry_after.3sip
+usr/src/man/man3sip/sip_add_route.3sip
+usr/src/man/man3sip/sip_add_rseq.3sip
+usr/src/man/man3sip/sip_add_server.3sip
+usr/src/man/man3sip/sip_add_subject.3sip
+usr/src/man/man3sip/sip_add_substate.3sip
+usr/src/man/man3sip/sip_add_supported.3sip
+usr/src/man/man3sip/sip_add_to.3sip
+usr/src/man/man3sip/sip_add_tstamp.3sip
+usr/src/man/man3sip/sip_add_unsupported.3sip
+usr/src/man/man3sip/sip_add_user_agent.3sip
+usr/src/man/man3sip/sip_add_via.3sip
+usr/src/man/man3sip/sip_add_warning.3sip
+usr/src/man/man3sip/sip_add_www_authen.3sip
+usr/src/man/man3sip/sip_clear_stale_data.3sip
+usr/src/man/man3sip/sip_conn_destroyed.3sip
+usr/src/man/man3sip/sip_copy_all_headers.3sip
+usr/src/man/man3sip/sip_copy_header.3sip
+usr/src/man/man3sip/sip_copy_header_by_name.3sip
+usr/src/man/man3sip/sip_create_dialog_req_nocontact.3sip
+usr/src/man/man3sip/sip_delete_header.3sip
+usr/src/man/man3sip/sip_delete_header_by_name.3sip
+usr/src/man/man3sip/sip_delete_value.3sip
+usr/src/man/man3sip/sip_disable_counters.3sip
+usr/src/man/man3sip/sip_disable_dialog_logging.3sip
+usr/src/man/man3sip/sip_disable_trans_logging.3sip
+usr/src/man/man3sip/sip_enable_dialog_logging.3sip
+usr/src/man/man3sip/sip_free_msg.3sip
+usr/src/man/man3sip/sip_free_parsed_uri.3sip
+usr/src/man/man3sip/sip_get_accept_enc.3sip
+usr/src/man/man3sip/sip_get_accept_lang.3sip
+usr/src/man/man3sip/sip_get_accept_sub_type.3sip
+usr/src/man/man3sip/sip_get_accept_type.3sip
+usr/src/man/man3sip/sip_get_alert_info_uri.3sip
+usr/src/man/man3sip/sip_get_allow_events.3sip
+usr/src/man/man3sip/sip_get_allow_method.3sip
+usr/src/man/man3sip/sip_get_authen_info.3sip
+usr/src/man/man3sip/sip_get_author_param.3sip
+usr/src/man/man3sip/sip_get_author_scheme.3sip
+usr/src/man/man3sip/sip_get_branchid.3sip
+usr/src/man/man3sip/sip_get_call_info_uri.3sip
+usr/src/man/man3sip/sip_get_callid.3sip
+usr/src/man/man3sip/sip_get_callseq_method.3sip
+usr/src/man/man3sip/sip_get_callseq_num.3sip
+usr/src/man/man3sip/sip_get_contact_uri_str.3sip
+usr/src/man/man3sip/sip_get_content.3sip
+usr/src/man/man3sip/sip_get_content_disp.3sip
+usr/src/man/man3sip/sip_get_content_enc.3sip
+usr/src/man/man3sip/sip_get_content_lang.3sip
+usr/src/man/man3sip/sip_get_content_length.3sip
+usr/src/man/man3sip/sip_get_content_sub_type.3sip
+usr/src/man/man3sip/sip_get_content_type.3sip
+usr/src/man/man3sip/sip_get_counter_value.3sip
+usr/src/man/man3sip/sip_get_date_day.3sip
+usr/src/man/man3sip/sip_get_date_month.3sip
+usr/src/man/man3sip/sip_get_date_time.3sip
+usr/src/man/man3sip/sip_get_date_timezone.3sip
+usr/src/man/man3sip/sip_get_date_wkday.3sip
+usr/src/man/man3sip/sip_get_date_year.3sip
+usr/src/man/man3sip/sip_get_dialog_callid.3sip
+usr/src/man/man3sip/sip_get_dialog_local_contact_uri.3sip
+usr/src/man/man3sip/sip_get_dialog_local_cseq.3sip
+usr/src/man/man3sip/sip_get_dialog_local_tag.3sip
+usr/src/man/man3sip/sip_get_dialog_local_uri.3sip
+usr/src/man/man3sip/sip_get_dialog_method.3sip
+usr/src/man/man3sip/sip_get_dialog_msgcnt.3sip
+usr/src/man/man3sip/sip_get_dialog_remote_cseq.3sip
+usr/src/man/man3sip/sip_get_dialog_remote_tag.3sip
+usr/src/man/man3sip/sip_get_dialog_remote_target_uri.3sip
+usr/src/man/man3sip/sip_get_dialog_remote_uri.3sip
+usr/src/man/man3sip/sip_get_dialog_route_set.3sip
+usr/src/man/man3sip/sip_get_dialog_type.3sip
+usr/src/man/man3sip/sip_get_error_info_uri.3sip
+usr/src/man/man3sip/sip_get_event.3sip
+usr/src/man/man3sip/sip_get_expires.3sip
+usr/src/man/man3sip/sip_get_from_display_name.3sip
+usr/src/man/man3sip/sip_get_from_tag.3sip
+usr/src/man/man3sip/sip_get_from_uri_str.3sip
+usr/src/man/man3sip/sip_get_in_reply_to.3sip
+usr/src/man/man3sip/sip_get_maxforward.3sip
+usr/src/man/man3sip/sip_get_mime_version.3sip
+usr/src/man/man3sip/sip_get_min_expires.3sip
+usr/src/man/man3sip/sip_get_next_value.3sip
+usr/src/man/man3sip/sip_get_org.3sip
+usr/src/man/man3sip/sip_get_params.3sip
+usr/src/man/man3sip/sip_get_passertedid_display_name.3sip
+usr/src/man/man3sip/sip_get_passertedid_uri_str.3sip
+usr/src/man/man3sip/sip_get_ppreferredid_display_name.3sip
+usr/src/man/man3sip/sip_get_ppreferredid_uri_str.3sip
+usr/src/man/man3sip/sip_get_priority.3sip
+usr/src/man/man3sip/sip_get_priv_value.3sip
+usr/src/man/man3sip/sip_get_proxy_authen_param.3sip
+usr/src/man/man3sip/sip_get_proxy_authen_scheme.3sip
+usr/src/man/man3sip/sip_get_proxy_author_param.3sip
+usr/src/man/man3sip/sip_get_proxy_author_scheme.3sip
+usr/src/man/man3sip/sip_get_proxy_require.3sip
+usr/src/man/man3sip/sip_get_rack_cseq_num.3sip
+usr/src/man/man3sip/sip_get_rack_method.3sip
+usr/src/man/man3sip/sip_get_rack_resp_num.3sip
+usr/src/man/man3sip/sip_get_replyto_display_name.3sip
+usr/src/man/man3sip/sip_get_replyto_uri_str.3sip
+usr/src/man/man3sip/sip_get_require.3sip
+usr/src/man/man3sip/sip_get_response_code.3sip
+usr/src/man/man3sip/sip_get_response_phrase.3sip
+usr/src/man/man3sip/sip_get_retry_after_cmts.3sip
+usr/src/man/man3sip/sip_get_retry_after_time.3sip
+usr/src/man/man3sip/sip_get_route_display_name.3sip
+usr/src/man/man3sip/sip_get_route_uri_str.3sip
+usr/src/man/man3sip/sip_get_rseq.3sip
+usr/src/man/man3sip/sip_get_rseq_resp_num.3sip
+usr/src/man/man3sip/sip_get_server.3sip
+usr/src/man/man3sip/sip_get_sip_version.3sip
+usr/src/man/man3sip/sip_get_subject.3sip
+usr/src/man/man3sip/sip_get_substate.3sip
+usr/src/man/man3sip/sip_get_supported.3sip
+usr/src/man/man3sip/sip_get_to_display_name.3sip
+usr/src/man/man3sip/sip_get_to_tag.3sip
+usr/src/man/man3sip/sip_get_to_uri_str.3sip
+usr/src/man/man3sip/sip_get_trans_branchid.3sip
+usr/src/man/man3sip/sip_get_trans_conn_obj.3sip
+usr/src/man/man3sip/sip_get_trans_orig_msg.3sip
+usr/src/man/man3sip/sip_get_trans_resp_msg.3sip
+usr/src/man/man3sip/sip_get_trans_state.3sip
+usr/src/man/man3sip/sip_get_tstamp_delay.3sip
+usr/src/man/man3sip/sip_get_tstamp_value.3sip
+usr/src/man/man3sip/sip_get_unsupported.3sip
+usr/src/man/man3sip/sip_get_uri_errflags.3sip
+usr/src/man/man3sip/sip_get_uri_headers.3sip
+usr/src/man/man3sip/sip_get_uri_host.3sip
+usr/src/man/man3sip/sip_get_uri_opaque.3sip
+usr/src/man/man3sip/sip_get_uri_params.3sip
+usr/src/man/man3sip/sip_get_uri_password.3sip
+usr/src/man/man3sip/sip_get_uri_path.3sip
+usr/src/man/man3sip/sip_get_uri_port.3sip
+usr/src/man/man3sip/sip_get_uri_query.3sip
+usr/src/man/man3sip/sip_get_uri_regname.3sip
+usr/src/man/man3sip/sip_get_uri_scheme.3sip
+usr/src/man/man3sip/sip_get_uri_user.3sip
+usr/src/man/man3sip/sip_get_user_agent.3sip
+usr/src/man/man3sip/sip_get_via_sent_by_host.3sip
+usr/src/man/man3sip/sip_get_via_sent_by_port.3sip
+usr/src/man/man3sip/sip_get_via_sent_protocol_name.3sip
+usr/src/man/man3sip/sip_get_via_sent_protocol_version.3sip
+usr/src/man/man3sip/sip_get_via_sent_transport.3sip
+usr/src/man/man3sip/sip_get_warning_agent.3sip
+usr/src/man/man3sip/sip_get_warning_code.3sip
+usr/src/man/man3sip/sip_get_warning_text.3sip
+usr/src/man/man3sip/sip_get_www_authen_param.3sip
+usr/src/man/man3sip/sip_get_www_authen_scheme.3sip
+usr/src/man/man3sip/sip_hdr_to_str.3sip
+usr/src/man/man3sip/sip_is_dialog_secure.3sip
+usr/src/man/man3sip/sip_is_param_present.3sip
+usr/src/man/man3sip/sip_is_uri_teluser.3sip
+usr/src/man/man3sip/sip_message_is_response.3sip
+usr/src/man/man3sip/sip_release_dialog.3sip
+usr/src/man/man3sip/sip_release_trans.3sip
+usr/src/man/man3sip/sip_reqline_to_str.3sip
+usr/src/man/man3sip/sip_respline_to_str.3sip
+usr/src/man/man3sip/sip_sent_by_to_str.3sip
+usr/src/man/man3sip/sip_unregister_all_sent_by.3sip
+usr/src/man/man3sip/sip_unregister_sent_by.3sip
+usr/src/man/man3sip/sip_uri_errflags_to_str.3sip
+usr/src/man/man3socket/endnetent.3socket
+usr/src/man/man3socket/endprotoent.3socket
+usr/src/man/man3socket/endservent.3socket
+usr/src/man/man3socket/ether_aton.3socket
+usr/src/man/man3socket/ether_hostton.3socket
+usr/src/man/man3socket/ether_line.3socket
+usr/src/man/man3socket/ether_ntoa.3socket
+usr/src/man/man3socket/ether_ntohost.3socket
+usr/src/man/man3socket/freeaddrinfo.3socket
+usr/src/man/man3socket/freehostent.3socket
+usr/src/man/man3socket/gai_strerror.3socket
+usr/src/man/man3socket/getipnodebyaddr.3socket
+usr/src/man/man3socket/getipv4sourcefilter.3socket
+usr/src/man/man3socket/getnameinfo.3socket
+usr/src/man/man3socket/getnetbyaddr.3socket
+usr/src/man/man3socket/getnetbyaddr_r.3socket
+usr/src/man/man3socket/getnetbyname_r.3socket
+usr/src/man/man3socket/getnetent.3socket
+usr/src/man/man3socket/getnetent_r.3socket
+usr/src/man/man3socket/getprotobyname_r.3socket
+usr/src/man/man3socket/getprotobynumber.3socket
+usr/src/man/man3socket/getprotobynumber_r.3socket
+usr/src/man/man3socket/getprotoent.3socket
+usr/src/man/man3socket/getprotoent_r.3socket
+usr/src/man/man3socket/getservbyname_r.3socket
+usr/src/man/man3socket/getservbyport.3socket
+usr/src/man/man3socket/getservbyport_r.3socket
+usr/src/man/man3socket/getservent.3socket
+usr/src/man/man3socket/getservent_r.3socket
+usr/src/man/man3socket/htonl.3socket
+usr/src/man/man3socket/htonll.3socket
+usr/src/man/man3socket/htons.3socket
+usr/src/man/man3socket/if_freenameindex.3socket
+usr/src/man/man3socket/if_indextoname.3socket
+usr/src/man/man3socket/if_nameindex.3socket
+usr/src/man/man3socket/inet6.3socket
+usr/src/man/man3socket/inet6_opt_append.3socket
+usr/src/man/man3socket/inet6_opt_find.3socket
+usr/src/man/man3socket/inet6_opt_finish.3socket
+usr/src/man/man3socket/inet6_opt_get_val.3socket
+usr/src/man/man3socket/inet6_opt_init.3socket
+usr/src/man/man3socket/inet6_opt_next.3socket
+usr/src/man/man3socket/inet6_opt_set_val.3socket
+usr/src/man/man3socket/inet6_rth_add.3socket
+usr/src/man/man3socket/inet6_rth_getaddr.3socket
+usr/src/man/man3socket/inet6_rth_init.3socket
+usr/src/man/man3socket/inet6_rth_reverse.3socket
+usr/src/man/man3socket/inet6_rth_segments.3socket
+usr/src/man/man3socket/inet6_rth_space.3socket
+usr/src/man/man3socket/inet_addr.3socket
+usr/src/man/man3socket/inet_aton.3socket
+usr/src/man/man3socket/inet_lnaof.3socket
+usr/src/man/man3socket/inet_makeaddr.3socket
+usr/src/man/man3socket/inet_netof.3socket
+usr/src/man/man3socket/inet_network.3socket
+usr/src/man/man3socket/inet_ntoa.3socket
+usr/src/man/man3socket/inet_ntop.3socket
+usr/src/man/man3socket/inet_pton.3socket
+usr/src/man/man3socket/ntohl.3socket
+usr/src/man/man3socket/ntohll.3socket
+usr/src/man/man3socket/ntohs.3socket
+usr/src/man/man3socket/rcmd_af.3socket
+usr/src/man/man3socket/recvfrom.3socket
+usr/src/man/man3socket/recvmsg.3socket
+usr/src/man/man3socket/rexec_af.3socket
+usr/src/man/man3socket/rresvport.3socket
+usr/src/man/man3socket/rresvport_af.3socket
+usr/src/man/man3socket/ruserok.3socket
+usr/src/man/man3socket/sctp_freeladdrs.3socket
+usr/src/man/man3socket/sctp_freepaddrs.3socket
+usr/src/man/man3socket/sendmsg.3socket
+usr/src/man/man3socket/sendto.3socket
+usr/src/man/man3socket/setipv4sourcefilter.3socket
+usr/src/man/man3socket/setnetent.3socket
+usr/src/man/man3socket/setprotoent.3socket
+usr/src/man/man3socket/setservent.3socket
+usr/src/man/man3socket/setsockopt.3socket
+usr/src/man/man3socket/setsourcefilter.3socket
+usr/src/man/man3stmf/stmfGetLuProp.3stmf
+usr/src/man/man3stmf/stmfModifyLuByFname.3stmf
+usr/src/man/man3sysevent/sysevent_get_pid.3sysevent
+usr/src/man/man3sysevent/sysevent_get_pub_name.3sysevent
+usr/src/man/man3sysevent/sysevent_get_seq.3sysevent
+usr/src/man/man3sysevent/sysevent_get_size.3sysevent
+usr/src/man/man3sysevent/sysevent_get_subclass_name.3sysevent
+usr/src/man/man3sysevent/sysevent_get_time.3sysevent
+usr/src/man/man3sysevent/sysevent_unbind_handle.3sysevent
+usr/src/man/man3sysevent/sysevent_unsubscribe_event.3sysevent
+usr/src/man/man3tecla/cfc_file_start.3tecla
+usr/src/man/man3tecla/cfc_literal_escapes.3tecla
+usr/src/man/man3tecla/cfc_set_check_fn.3tecla
+usr/src/man/man3tecla/cpl_add_completion.3tecla
+usr/src/man/man3tecla/cpl_check_exe.3tecla
+usr/src/man/man3tecla/cpl_file_completions.3tecla
+usr/src/man/man3tecla/cpl_last_error.3tecla
+usr/src/man/man3tecla/cpl_list_completions.3tecla
+usr/src/man/man3tecla/cpl_recall_matches.3tecla
+usr/src/man/man3tecla/cpl_record_error.3tecla
+usr/src/man/man3tecla/del_CplFileConf.3tecla
+usr/src/man/man3tecla/del_ExpandFile.3tecla
+usr/src/man/man3tecla/del_GetLine.3tecla
+usr/src/man/man3tecla/del_PathCache.3tecla
+usr/src/man/man3tecla/del_PcaPathConf.3tecla
+usr/src/man/man3tecla/del_WordCompletion.3tecla
+usr/src/man/man3tecla/ef_last_error.3tecla
+usr/src/man/man3tecla/ef_list_expansions.3tecla
+usr/src/man/man3tecla/gl_abandon_line.3tecla
+usr/src/man/man3tecla/gl_append_history.3tecla
+usr/src/man/man3tecla/gl_automatic_history.3tecla
+usr/src/man/man3tecla/gl_bind_keyseq.3tecla
+usr/src/man/man3tecla/gl_catch_blocked.3tecla
+usr/src/man/man3tecla/gl_change_terminal.3tecla
+usr/src/man/man3tecla/gl_clear_history.3tecla
+usr/src/man/man3tecla/gl_completion_action.3tecla
+usr/src/man/man3tecla/gl_configure_getline.3tecla
+usr/src/man/man3tecla/gl_customize_completion.3tecla
+usr/src/man/man3tecla/gl_display_text.3tecla
+usr/src/man/man3tecla/gl_echo_mode.3tecla
+usr/src/man/man3tecla/gl_erase_terminal.3tecla
+usr/src/man/man3tecla/gl_error_message.3tecla
+usr/src/man/man3tecla/gl_group_history.3tecla
+usr/src/man/man3tecla/gl_handle_signal.3tecla
+usr/src/man/man3tecla/gl_ignore_signal.3tecla
+usr/src/man/man3tecla/gl_inactivity_timeout.3tecla
+usr/src/man/man3tecla/gl_last_signal.3tecla
+usr/src/man/man3tecla/gl_limit_history.3tecla
+usr/src/man/man3tecla/gl_list_signals.3tecla
+usr/src/man/man3tecla/gl_load_history.3tecla
+usr/src/man/man3tecla/gl_lookup_history.3tecla
+usr/src/man/man3tecla/gl_normal_io.3tecla
+usr/src/man/man3tecla/gl_pending_io.3tecla
+usr/src/man/man3tecla/gl_prompt_style.3tecla
+usr/src/man/man3tecla/gl_query_char.3tecla
+usr/src/man/man3tecla/gl_range_of_history.3tecla
+usr/src/man/man3tecla/gl_raw_io.3tecla
+usr/src/man/man3tecla/gl_read_char.3tecla
+usr/src/man/man3tecla/gl_register_action.3tecla
+usr/src/man/man3tecla/gl_replace_prompt.3tecla
+usr/src/man/man3tecla/gl_resize_history.3tecla
+usr/src/man/man3tecla/gl_return_status.3tecla
+usr/src/man/man3tecla/gl_save_history.3tecla
+usr/src/man/man3tecla/gl_set_term_size.3tecla
+usr/src/man/man3tecla/gl_show_history.3tecla
+usr/src/man/man3tecla/gl_size_of_history.3tecla
+usr/src/man/man3tecla/gl_state_of_history.3tecla
+usr/src/man/man3tecla/gl_terminal_size.3tecla
+usr/src/man/man3tecla/gl_toggle_history.3tecla
+usr/src/man/man3tecla/gl_trap_signal.3tecla
+usr/src/man/man3tecla/gl_tty_signals.3tecla
+usr/src/man/man3tecla/gl_watch_fd.3tecla
+usr/src/man/man3tecla/new_CplFileConf.3tecla
+usr/src/man/man3tecla/new_ExpandFile.3tecla
+usr/src/man/man3tecla/new_GetLine.3tecla
+usr/src/man/man3tecla/new_PathCache.3tecla
+usr/src/man/man3tecla/new_PcaPathConf.3tecla
+usr/src/man/man3tecla/new_WordCompletion.3tecla
+usr/src/man/man3tecla/pca_last_error.3tecla
+usr/src/man/man3tecla/pca_path_completions.3tecla
+usr/src/man/man3tecla/pca_scan_path.3tecla
+usr/src/man/man3tecla/pca_set_check_fn.3tecla
+usr/src/man/man3tecla/ppc_file_start.3tecla
+usr/src/man/man3tecla/ppc_literal_escapes.3tecla
+usr/src/man/man3tnf/TNF_DEBUG.3tnf
+usr/src/man/man3tnf/TNF_DEFINE_RECORD_1.3tnf
+usr/src/man/man3tnf/TNF_DEFINE_RECORD_2.3tnf
+usr/src/man/man3tnf/TNF_DEFINE_RECORD_3.3tnf
+usr/src/man/man3tnf/TNF_DEFINE_RECORD_4.3tnf
+usr/src/man/man3tnf/TNF_DEFINE_RECORD_5.3tnf
+usr/src/man/man3tnf/TNF_PROBE_0.3tnf
+usr/src/man/man3tnf/TNF_PROBE_0_DEBUG.3tnf
+usr/src/man/man3tnf/TNF_PROBE_1.3tnf
+usr/src/man/man3tnf/TNF_PROBE_1_DEBUG.3tnf
+usr/src/man/man3tnf/TNF_PROBE_2.3tnf
+usr/src/man/man3tnf/TNF_PROBE_2_DEBUG.3tnf
+usr/src/man/man3tnf/TNF_PROBE_3.3tnf
+usr/src/man/man3tnf/TNF_PROBE_3_DEBUG.3tnf
+usr/src/man/man3tnf/TNF_PROBE_4.3tnf
+usr/src/man/man3tnf/TNF_PROBE_4_DEBUG.3tnf
+usr/src/man/man3tnf/TNF_PROBE_5.3tnf
+usr/src/man/man3tnf/TNF_PROBE_5_DEBUG.3tnf
+usr/src/man/man3tnf/tnf_process_enable.3tnf
+usr/src/man/man3tnf/tnf_thread_disable.3tnf
+usr/src/man/man3tnf/tnf_thread_enable.3tnf
+usr/src/man/man3tnf/tnfctl_buffer_dealloc.3tnf
+usr/src/man/man3tnf/tnfctl_check_libs.3tnf
+usr/src/man/man3tnf/tnfctl_continue.3tnf
+usr/src/man/man3tnf/tnfctl_exec_open.3tnf
+usr/src/man/man3tnf/tnfctl_filter_list_add.3tnf
+usr/src/man/man3tnf/tnfctl_filter_list_delete.3tnf
+usr/src/man/man3tnf/tnfctl_filter_list_get.3tnf
+usr/src/man/man3tnf/tnfctl_filter_state_set.3tnf
+usr/src/man/man3tnf/tnfctl_probe_apply_ids.3tnf
+usr/src/man/man3tnf/tnfctl_probe_connect.3tnf
+usr/src/man/man3tnf/tnfctl_probe_disable.3tnf
+usr/src/man/man3tnf/tnfctl_probe_disconnect_all.3tnf
+usr/src/man/man3tnf/tnfctl_probe_enable.3tnf
+usr/src/man/man3tnf/tnfctl_probe_trace.3tnf
+usr/src/man/man3tnf/tnfctl_probe_untrace.3tnf
+usr/src/man/man3tsol/Xbcleartos.3tsol
+usr/src/man/man3tsol/Xbsltos.3tsol
+usr/src/man/man3tsol/bcleartoh.3tsol
+usr/src/man/man3tsol/bcleartoh_r.3tsol
+usr/src/man/man3tsol/bcleartos.3tsol
+usr/src/man/man3tsol/bldominates.3tsol
+usr/src/man/man3tsol/blequal.3tsol
+usr/src/man/man3tsol/blinrange.3tsol
+usr/src/man/man3tsol/blmaximum.3tsol
+usr/src/man/man3tsol/blminimum.3tsol
+usr/src/man/man3tsol/blstrictdom.3tsol
+usr/src/man/man3tsol/bltocolor_r.3tsol
+usr/src/man/man3tsol/bsltoh.3tsol
+usr/src/man/man3tsol/bsltoh_r.3tsol
+usr/src/man/man3tsol/bsltos.3tsol
+usr/src/man/man3tsol/getzoneidbylabel.3tsol
+usr/src/man/man3tsol/getzonelabelbyname.3tsol
+usr/src/man/man3tsol/getzonerootbylabel.3tsol
+usr/src/man/man3tsol/getzonerootbyname.3tsol
+usr/src/man/man3tsol/h_alloc.3tsol
+usr/src/man/man3tsol/h_free.3tsol
+usr/src/man/man3tsol/htobclear.3tsol
+usr/src/man/man3tsol/htobsl.3tsol
+usr/src/man/man3tsol/m_label_alloc.3tsol
+usr/src/man/man3tsol/m_label_dup.3tsol
+usr/src/man/man3tsol/m_label_free.3tsol
+usr/src/man/man3tsol/sbcleartos.3tsol
+usr/src/man/man3tsol/sbsltos.3tsol
+usr/src/man/man3tsol/stobclear.3tsol
+usr/src/man/man3tsol/stobsl.3tsol
+usr/src/man/man3uuid/uuid_compare.3uuid
+usr/src/man/man3uuid/uuid_copy.3uuid
+usr/src/man/man3uuid/uuid_generate.3uuid
+usr/src/man/man3uuid/uuid_generate_random.3uuid
+usr/src/man/man3uuid/uuid_generate_time.3uuid
+usr/src/man/man3uuid/uuid_is_null.3uuid
+usr/src/man/man3uuid/uuid_parse.3uuid
+usr/src/man/man3uuid/uuid_time.3uuid
+usr/src/man/man3uuid/uuid_unparse.3uuid
+usr/src/man/man3volmgt/media_setattr.3volmgt
+usr/src/man/man3volmgt/volmgt_symdev.3volmgt
+usr/src/man/man3xcurses/COLORS.3xcurses
+usr/src/man/man3xcurses/COLOR_PAIR.3xcurses
+usr/src/man/man3xcurses/COLOR_PAIRS.3xcurses
+usr/src/man/man3xcurses/PAIR_NUMBER.3xcurses
+usr/src/man/man3xcurses/add_wchstr.3xcurses
+usr/src/man/man3xcurses/addchnstr.3xcurses
+usr/src/man/man3xcurses/addstr.3xcurses
+usr/src/man/man3xcurses/addwstr.3xcurses
+usr/src/man/man3xcurses/attr_off.3xcurses
+usr/src/man/man3xcurses/attr_on.3xcurses
+usr/src/man/man3xcurses/attr_set.3xcurses
+usr/src/man/man3xcurses/attron.3xcurses
+usr/src/man/man3xcurses/attrset.3xcurses
+usr/src/man/man3xcurses/bkgdset.3xcurses
+usr/src/man/man3xcurses/bkgrndset.3xcurses
+usr/src/man/man3xcurses/box.3xcurses
+usr/src/man/man3xcurses/box_set.3xcurses
+usr/src/man/man3xcurses/color_content.3xcurses
+usr/src/man/man3xcurses/color_set.3xcurses
+usr/src/man/man3xcurses/def_shell_mode.3xcurses
+usr/src/man/man3xcurses/erase.3xcurses
+usr/src/man/man3xcurses/erasewchar.3xcurses
+usr/src/man/man3xcurses/flash.3xcurses
+usr/src/man/man3xcurses/get_wstr.3xcurses
+usr/src/man/man3xcurses/getbkgd.3xcurses
+usr/src/man/man3xcurses/getbkgrnd.3xcurses
+usr/src/man/man3xcurses/getmaxyx.3xcurses
+usr/src/man/man3xcurses/getparyx.3xcurses
+usr/src/man/man3xcurses/getstr.3xcurses
+usr/src/man/man3xcurses/getyx.3xcurses
+usr/src/man/man3xcurses/has_colors.3xcurses
+usr/src/man/man3xcurses/has_il.3xcurses
+usr/src/man/man3xcurses/idlok.3xcurses
+usr/src/man/man3xcurses/in_wchstr.3xcurses
+usr/src/man/man3xcurses/inchstr.3xcurses
+usr/src/man/man3xcurses/init_color.3xcurses
+usr/src/man/man3xcurses/init_pair.3xcurses
+usr/src/man/man3xcurses/ins_wstr.3xcurses
+usr/src/man/man3xcurses/insstr.3xcurses
+usr/src/man/man3xcurses/instr.3xcurses
+usr/src/man/man3xcurses/inwstr.3xcurses
+usr/src/man/man3xcurses/is_wintouched.3xcurses
+usr/src/man/man3xcurses/isendwin.3xcurses
+usr/src/man/man3xcurses/key_name.3xcurses
+usr/src/man/man3xcurses/killchar.3xcurses
+usr/src/man/man3xcurses/killwchar.3xcurses
+usr/src/man/man3xcurses/leaveok.3xcurses
+usr/src/man/man3xcurses/mvadd_wch.3xcurses
+usr/src/man/man3xcurses/mvadd_wchnstr.3xcurses
+usr/src/man/man3xcurses/mvadd_wchstr.3xcurses
+usr/src/man/man3xcurses/mvaddch.3xcurses
+usr/src/man/man3xcurses/mvaddchnstr.3xcurses
+usr/src/man/man3xcurses/mvaddchstr.3xcurses
+usr/src/man/man3xcurses/mvaddnstr.3xcurses
+usr/src/man/man3xcurses/mvaddnwstr.3xcurses
+usr/src/man/man3xcurses/mvaddstr.3xcurses
+usr/src/man/man3xcurses/mvaddwstr.3xcurses
+usr/src/man/man3xcurses/mvchgat.3xcurses
+usr/src/man/man3xcurses/mvdelch.3xcurses
+usr/src/man/man3xcurses/mvget_wch.3xcurses
+usr/src/man/man3xcurses/mvget_wstr.3xcurses
+usr/src/man/man3xcurses/mvgetch.3xcurses
+usr/src/man/man3xcurses/mvgetn_wstr.3xcurses
+usr/src/man/man3xcurses/mvgetnstr.3xcurses
+usr/src/man/man3xcurses/mvgetstr.3xcurses
+usr/src/man/man3xcurses/mvhline.3xcurses
+usr/src/man/man3xcurses/mvhline_set.3xcurses
+usr/src/man/man3xcurses/mvin_wch.3xcurses
+usr/src/man/man3xcurses/mvin_wchnstr.3xcurses
+usr/src/man/man3xcurses/mvin_wchstr.3xcurses
+usr/src/man/man3xcurses/mvinch.3xcurses
+usr/src/man/man3xcurses/mvinchnstr.3xcurses
+usr/src/man/man3xcurses/mvinchstr.3xcurses
+usr/src/man/man3xcurses/mvinnstr.3xcurses
+usr/src/man/man3xcurses/mvinnwstr.3xcurses
+usr/src/man/man3xcurses/mvins_nwstr.3xcurses
+usr/src/man/man3xcurses/mvins_wch.3xcurses
+usr/src/man/man3xcurses/mvins_wstr.3xcurses
+usr/src/man/man3xcurses/mvinsch.3xcurses
+usr/src/man/man3xcurses/mvinsnstr.3xcurses
+usr/src/man/man3xcurses/mvinsstr.3xcurses
+usr/src/man/man3xcurses/mvinstr.3xcurses
+usr/src/man/man3xcurses/mvinwstr.3xcurses
+usr/src/man/man3xcurses/mvvline.3xcurses
+usr/src/man/man3xcurses/mvvline_set.3xcurses
+usr/src/man/man3xcurses/mvwadd_wch.3xcurses
+usr/src/man/man3xcurses/mvwadd_wchnstr.3xcurses
+usr/src/man/man3xcurses/mvwadd_wchstr.3xcurses
+usr/src/man/man3xcurses/mvwaddch.3xcurses
+usr/src/man/man3xcurses/mvwaddchnstr.3xcurses
+usr/src/man/man3xcurses/mvwaddchstr.3xcurses
+usr/src/man/man3xcurses/mvwaddnstr.3xcurses
+usr/src/man/man3xcurses/mvwaddnwstr.3xcurses
+usr/src/man/man3xcurses/mvwaddstr.3xcurses
+usr/src/man/man3xcurses/mvwaddwstr.3xcurses
+usr/src/man/man3xcurses/mvwchgat.3xcurses
+usr/src/man/man3xcurses/mvwdelch.3xcurses
+usr/src/man/man3xcurses/mvwget_wch.3xcurses
+usr/src/man/man3xcurses/mvwget_wstr.3xcurses
+usr/src/man/man3xcurses/mvwgetch.3xcurses
+usr/src/man/man3xcurses/mvwgetn_wstr.3xcurses
+usr/src/man/man3xcurses/mvwgetnstr.3xcurses
+usr/src/man/man3xcurses/mvwgetstr.3xcurses
+usr/src/man/man3xcurses/mvwhline.3xcurses
+usr/src/man/man3xcurses/mvwhline_set.3xcurses
+usr/src/man/man3xcurses/mvwin_wch.3xcurses
+usr/src/man/man3xcurses/mvwin_wchnstr.3xcurses
+usr/src/man/man3xcurses/mvwin_wchstr.3xcurses
+usr/src/man/man3xcurses/mvwinch.3xcurses
+usr/src/man/man3xcurses/mvwinchnstr.3xcurses
+usr/src/man/man3xcurses/mvwinchstr.3xcurses
+usr/src/man/man3xcurses/mvwinnstr.3xcurses
+usr/src/man/man3xcurses/mvwinnwstr.3xcurses
+usr/src/man/man3xcurses/mvwins_nwstr.3xcurses
+usr/src/man/man3xcurses/mvwins_wch.3xcurses
+usr/src/man/man3xcurses/mvwins_wstr.3xcurses
+usr/src/man/man3xcurses/mvwinsch.3xcurses
+usr/src/man/man3xcurses/mvwinsnstr.3xcurses
+usr/src/man/man3xcurses/mvwinsstr.3xcurses
+usr/src/man/man3xcurses/mvwinstr.3xcurses
+usr/src/man/man3xcurses/mvwinwstr.3xcurses
+usr/src/man/man3xcurses/mvwprintw.3xcurses
+usr/src/man/man3xcurses/mvwscanw.3xcurses
+usr/src/man/man3xcurses/mvwvline.3xcurses
+usr/src/man/man3xcurses/mvwvline_set.3xcurses
+usr/src/man/man3xcurses/newterm.3xcurses
+usr/src/man/man3xcurses/newwin.3xcurses
+usr/src/man/man3xcurses/nocbreak.3xcurses
+usr/src/man/man3xcurses/noecho.3xcurses
+usr/src/man/man3xcurses/nonl.3xcurses
+usr/src/man/man3xcurses/noraw.3xcurses
+usr/src/man/man3xcurses/overwrite.3xcurses
+usr/src/man/man3xcurses/pair_content.3xcurses
+usr/src/man/man3xcurses/pecho_wchar.3xcurses
+usr/src/man/man3xcurses/pnoutrefresh.3xcurses
+usr/src/man/man3xcurses/prefresh.3xcurses
+usr/src/man/man3xcurses/printw.3xcurses
+usr/src/man/man3xcurses/putwin.3xcurses
+usr/src/man/man3xcurses/qiflush.3xcurses
+usr/src/man/man3xcurses/raw.3xcurses
+usr/src/man/man3xcurses/refresh.3xcurses
+usr/src/man/man3xcurses/reset_prog_mode.3xcurses
+usr/src/man/man3xcurses/reset_shell_mode.3xcurses
+usr/src/man/man3xcurses/restartterm.3xcurses
+usr/src/man/man3xcurses/savetty.3xcurses
+usr/src/man/man3xcurses/scanw.3xcurses
+usr/src/man/man3xcurses/scr_init.3xcurses
+usr/src/man/man3xcurses/scr_restore.3xcurses
+usr/src/man/man3xcurses/scr_set.3xcurses
+usr/src/man/man3xcurses/scroll.3xcurses
+usr/src/man/man3xcurses/scrollok.3xcurses
+usr/src/man/man3xcurses/set_curterm.3xcurses
+usr/src/man/man3xcurses/setscrreg.3xcurses
+usr/src/man/man3xcurses/setupterm.3xcurses
+usr/src/man/man3xcurses/slk_attr_off.3xcurses
+usr/src/man/man3xcurses/slk_attr_on.3xcurses
+usr/src/man/man3xcurses/slk_attr_set.3xcurses
+usr/src/man/man3xcurses/slk_attron.3xcurses
+usr/src/man/man3xcurses/slk_attrset.3xcurses
+usr/src/man/man3xcurses/slk_clear.3xcurses
+usr/src/man/man3xcurses/slk_color.3xcurses
+usr/src/man/man3xcurses/slk_init.3xcurses
+usr/src/man/man3xcurses/slk_label.3xcurses
+usr/src/man/man3xcurses/slk_noutrefresh.3xcurses
+usr/src/man/man3xcurses/slk_refresh.3xcurses
+usr/src/man/man3xcurses/slk_restore.3xcurses
+usr/src/man/man3xcurses/slk_set.3xcurses
+usr/src/man/man3xcurses/slk_touch.3xcurses
+usr/src/man/man3xcurses/slk_wset.3xcurses
+usr/src/man/man3xcurses/standout.3xcurses
+usr/src/man/man3xcurses/start_color.3xcurses
+usr/src/man/man3xcurses/subpad.3xcurses
+usr/src/man/man3xcurses/subwin.3xcurses
+usr/src/man/man3xcurses/term_attrs.3xcurses
+usr/src/man/man3xcurses/tgetflag.3xcurses
+usr/src/man/man3xcurses/tgetnum.3xcurses
+usr/src/man/man3xcurses/tgetstr.3xcurses
+usr/src/man/man3xcurses/tgoto.3xcurses
+usr/src/man/man3xcurses/tigetnum.3xcurses
+usr/src/man/man3xcurses/tigetstr.3xcurses
+usr/src/man/man3xcurses/timeout.3xcurses
+usr/src/man/man3xcurses/touchline.3xcurses
+usr/src/man/man3xcurses/touchwin.3xcurses
+usr/src/man/man3xcurses/tparm.3xcurses
+usr/src/man/man3xcurses/tputs.3xcurses
+usr/src/man/man3xcurses/unget_wch.3xcurses
+usr/src/man/man3xcurses/untouchwin.3xcurses
+usr/src/man/man3xcurses/vid_attr.3xcurses
+usr/src/man/man3xcurses/vid_puts.3xcurses
+usr/src/man/man3xcurses/vidputs.3xcurses
+usr/src/man/man3xcurses/vline.3xcurses
+usr/src/man/man3xcurses/vline_set.3xcurses
+usr/src/man/man3xcurses/wadd_wch.3xcurses
+usr/src/man/man3xcurses/wadd_wchnstr.3xcurses
+usr/src/man/man3xcurses/wadd_wchstr.3xcurses
+usr/src/man/man3xcurses/waddch.3xcurses
+usr/src/man/man3xcurses/waddchnstr.3xcurses
+usr/src/man/man3xcurses/waddchstr.3xcurses
+usr/src/man/man3xcurses/waddnstr.3xcurses
+usr/src/man/man3xcurses/waddnwstr.3xcurses
+usr/src/man/man3xcurses/waddstr.3xcurses
+usr/src/man/man3xcurses/waddwstr.3xcurses
+usr/src/man/man3xcurses/wattr_get.3xcurses
+usr/src/man/man3xcurses/wattr_off.3xcurses
+usr/src/man/man3xcurses/wattr_on.3xcurses
+usr/src/man/man3xcurses/wattr_set.3xcurses
+usr/src/man/man3xcurses/wattroff.3xcurses
+usr/src/man/man3xcurses/wattron.3xcurses
+usr/src/man/man3xcurses/wattrset.3xcurses
+usr/src/man/man3xcurses/wbkgd.3xcurses
+usr/src/man/man3xcurses/wbkgdset.3xcurses
+usr/src/man/man3xcurses/wbkgrnd.3xcurses
+usr/src/man/man3xcurses/wbkgrndset.3xcurses
+usr/src/man/man3xcurses/wborder.3xcurses
+usr/src/man/man3xcurses/wborder_set.3xcurses
+usr/src/man/man3xcurses/wchgat.3xcurses
+usr/src/man/man3xcurses/wclear.3xcurses
+usr/src/man/man3xcurses/wclrtobot.3xcurses
+usr/src/man/man3xcurses/wclrtoeol.3xcurses
+usr/src/man/man3xcurses/wcolor_set.3xcurses
+usr/src/man/man3xcurses/wcursyncup.3xcurses
+usr/src/man/man3xcurses/wdelch.3xcurses
+usr/src/man/man3xcurses/wdeleteln.3xcurses
+usr/src/man/man3xcurses/wecho_wchar.3xcurses
+usr/src/man/man3xcurses/wechochar.3xcurses
+usr/src/man/man3xcurses/werase.3xcurses
+usr/src/man/man3xcurses/wget_wch.3xcurses
+usr/src/man/man3xcurses/wget_wstr.3xcurses
+usr/src/man/man3xcurses/wgetbkgrnd.3xcurses
+usr/src/man/man3xcurses/wgetch.3xcurses
+usr/src/man/man3xcurses/wgetn_wstr.3xcurses
+usr/src/man/man3xcurses/wgetnstr.3xcurses
+usr/src/man/man3xcurses/wgetstr.3xcurses
+usr/src/man/man3xcurses/whline.3xcurses
+usr/src/man/man3xcurses/whline_set.3xcurses
+usr/src/man/man3xcurses/win_wch.3xcurses
+usr/src/man/man3xcurses/win_wchnstr.3xcurses
+usr/src/man/man3xcurses/win_wchstr.3xcurses
+usr/src/man/man3xcurses/winch.3xcurses
+usr/src/man/man3xcurses/winchnstr.3xcurses
+usr/src/man/man3xcurses/winchstr.3xcurses
+usr/src/man/man3xcurses/winnstr.3xcurses
+usr/src/man/man3xcurses/winnwstr.3xcurses
+usr/src/man/man3xcurses/wins_nwstr.3xcurses
+usr/src/man/man3xcurses/wins_wch.3xcurses
+usr/src/man/man3xcurses/wins_wstr.3xcurses
+usr/src/man/man3xcurses/winsch.3xcurses
+usr/src/man/man3xcurses/winsdelln.3xcurses
+usr/src/man/man3xcurses/winsertln.3xcurses
+usr/src/man/man3xcurses/winsnstr.3xcurses
+usr/src/man/man3xcurses/winsstr.3xcurses
+usr/src/man/man3xcurses/winstr.3xcurses
+usr/src/man/man3xcurses/winwstr.3xcurses
+usr/src/man/man3xcurses/wmove.3xcurses
+usr/src/man/man3xcurses/wnoutrefresh.3xcurses
+usr/src/man/man3xcurses/wprintw.3xcurses
+usr/src/man/man3xcurses/wredrawln.3xcurses
+usr/src/man/man3xcurses/wrefresh.3xcurses
+usr/src/man/man3xcurses/wscanw.3xcurses
+usr/src/man/man3xcurses/wscrl.3xcurses
+usr/src/man/man3xcurses/wsetscrreg.3xcurses
+usr/src/man/man3xcurses/wstandend.3xcurses
+usr/src/man/man3xcurses/wstandout.3xcurses
+usr/src/man/man3xcurses/wsyncdown.3xcurses
+usr/src/man/man3xcurses/wsyncup.3xcurses
+usr/src/man/man3xcurses/wtimeout.3xcurses
+usr/src/man/man3xcurses/wtouchln.3xcurses
+usr/src/man/man3xcurses/wvline.3xcurses
+usr/src/man/man3xcurses/wvline_set.3xcurses
+usr/src/man/man3xnet/getaddrinfo.3xnet
+usr/src/man/man3xnet/gethostbyaddr.3xnet
+usr/src/man/man3xnet/gethostbyname.3xnet
+usr/src/man/man3xnet/gethostent.3xnet
+usr/src/man/man3xnet/getnetbyaddr.3xnet
+usr/src/man/man3xnet/getnetbyname.3xnet
+usr/src/man/man3xnet/getnetent.3xnet
+usr/src/man/man3xnet/getprotobyname.3xnet
+usr/src/man/man3xnet/getprotobynumber.3xnet
+usr/src/man/man3xnet/getprotoent.3xnet
+usr/src/man/man3xnet/getservbyname.3xnet
+usr/src/man/man3xnet/getservbyport.3xnet
+usr/src/man/man3xnet/getservent.3xnet
+usr/src/man/man3xnet/htons.3xnet
+usr/src/man/man3xnet/if_freenameindex.3xnet
+usr/src/man/man3xnet/if_indextoname.3xnet
+usr/src/man/man3xnet/if_nameindex.3xnet
+usr/src/man/man3xnet/inet_lnaof.3xnet
+usr/src/man/man3xnet/inet_makeaddr.3xnet
+usr/src/man/man3xnet/inet_netof.3xnet
+usr/src/man/man3xnet/inet_network.3xnet
+usr/src/man/man3xnet/inet_ntoa.3xnet
+usr/src/man/man3xnet/inet_pton.3xnet
+usr/src/man/man3xnet/ntohl.3xnet
+usr/src/man/man3xnet/ntohs.3xnet
+usr/src/man/man3xnet/sethostent.3xnet
+usr/src/man/man3xnet/setnetent.3xnet
+usr/src/man/man3xnet/setprotoent.3xnet
+usr/src/man/man3xnet/setservent.3xnet
+usr/src/man/man4/addresses.4
+usr/src/man/man4/devid_cache.4
+usr/src/man/man4/devname_cache.4
+usr/src/man/man4/dir.4
+usr/src/man/man4/dumpdates.4
+usr/src/man/man4/fbtab.4
+usr/src/man/man4/forward.4
+usr/src/man/man4/fs.4
+usr/src/man/man4/intro.4
+usr/src/man/man4/isa.4
+usr/src/man/man4/md.cf.4
+usr/src/man/man4/mdi_ib_cache.4
+usr/src/man/man4/mdi_scsi_vhci_cache.4
+usr/src/man/man4/pci_unitaddr_persistent.4
+usr/src/man/man4/pcie.4
+usr/src/man/man4/qop.4
+usr/src/man/man4/rhosts.4
+usr/src/man/man4/sendmail.cf.4
+usr/src/man/man4/snapshot_cache.4
+usr/src/man/man4/submit.cf.4
+usr/src/man/man4/volume-defaults.4
+usr/src/man/man4/wtmp.4
+usr/src/man/man4/wtmpx.4
+usr/src/man/man5/ANSI.5
+usr/src/man/man5/C++.5
+usr/src/man/man5/C.5
+usr/src/man/man5/CSI.5
+usr/src/man/man5/ISO.5
+usr/src/man/man5/MT-Level.5
+usr/src/man/man5/POSIX.1.5
+usr/src/man/man5/POSIX.2.5
+usr/src/man/man5/POSIX.5
+usr/src/man/man5/RBAC.5
+usr/src/man/man5/SUS.5
+usr/src/man/man5/SUSv2.5
+usr/src/man/man5/SUSv3.5
+usr/src/man/man5/SVID.5
+usr/src/man/man5/SVID3.5
+usr/src/man/man5/XNS.5
+usr/src/man/man5/XNS4.5
+usr/src/man/man5/XNS5.5
+usr/src/man/man5/XPG.5
+usr/src/man/man5/XPG3.5
+usr/src/man/man5/XPG4.5
+usr/src/man/man5/XPG4v2.5
+usr/src/man/man5/advance.5
+usr/src/man/man5/architecture.5
+usr/src/man/man5/availability.5
+usr/src/man/man5/compile.5
+usr/src/man/man5/intro.5
+usr/src/man/man5/pthreads.5
+usr/src/man/man5/stability.5
+usr/src/man/man5/standard.5
+usr/src/man/man5/step.5
+usr/src/man/man5/teclarc.5
+usr/src/man/man7/intro.7
+usr/src/man/man7d/1394.7d
+usr/src/man/man7d/allkmem.7d
+usr/src/man/man7d/bscbus.7d
+usr/src/man/man7d/fdc.7d
+usr/src/man/man7d/firewire.7d
+usr/src/man/man7d/hwa1480_fw.7d
+usr/src/man/man7d/i2bsc.7d
+usr/src/man/man7d/kmem.7d
+usr/src/man/man7d/lo0.7d
+usr/src/man/man7d/ticots.7d
+usr/src/man/man7d/ticotsord.7d
+usr/src/man/man7d/urandom.7d
+usr/src/man/man7d/usb.7d
+usr/src/man/man7d/uwb.7d
+usr/src/man/man7m/vuid2ps2.7m
+usr/src/man/man7m/vuid3ps2.7m
+usr/src/man/man7m/vuidm3p.7m
+usr/src/man/man7m/vuidm4p.7m
+usr/src/man/man7m/vuidm5p.7m
+usr/src/man/man7p/AH.7p
+usr/src/man/man7p/ARP.7p
+usr/src/man/man7p/ESP.7p
+usr/src/man/man7p/ICMP.7p
+usr/src/man/man7p/IP.7p
+usr/src/man/man7p/RARP.7p
+usr/src/man/man7p/SCTP.7p
+usr/src/man/man7p/TCP.7p
+usr/src/man/man7p/UDP.7p
+usr/src/man/man7p/if.7p
+usr/src/man/man9/Intro.9
+usr/src/man/man9/intro.9
+usr/src/man/man9e/_info.9e
+usr/src/man/man9e/_init.9e
+usr/src/man/man9e/gldm_get_stats.9e
+usr/src/man/man9e/gldm_intr.9e
+usr/src/man/man9e/gldm_ioctl.9e
+usr/src/man/man9e/gldm_reset.9e
+usr/src/man/man9e/gldm_send.9e
+usr/src/man/man9e/gldm_set_mac_addr.9e
+usr/src/man/man9e/gldm_set_multicast.9e
+usr/src/man/man9e/gldm_set_promiscuous.9e
+usr/src/man/man9e/gldm_start.9e
+usr/src/man/man9e/gldm_stop.9e
+usr/src/man/man9e/intro.9e
+usr/src/man/man9e/tran_destroy_pkt.9e
+usr/src/man/man9e/tran_pkt_constructor.9e
+usr/src/man/man9e/tran_pkt_destructor.9e
+usr/src/man/man9e/tran_setcap.9e
+usr/src/man/man9e/tran_teardown_pkt.9e
+usr/src/man/man9e/tran_unquiesce.9e
+usr/src/man/man9f/SIZEOF_PTR.9f
+usr/src/man/man9f/SIZEOF_STRUCT.9f
+usr/src/man/man9f/STRUCT_BUF.9f
+usr/src/man/man9f/STRUCT_FADDR.9f
+usr/src/man/man9f/STRUCT_FGET.9f
+usr/src/man/man9f/STRUCT_FGETP.9f
+usr/src/man/man9f/STRUCT_FSET.9f
+usr/src/man/man9f/STRUCT_FSETP.9f
+usr/src/man/man9f/STRUCT_HANDLE.9f
+usr/src/man/man9f/STRUCT_INIT.9f
+usr/src/man/man9f/STRUCT_SET_HANDLE.9f
+usr/src/man/man9f/STRUCT_SIZE.9f
+usr/src/man/man9f/assert.9f
+usr/src/man/man9f/atomic_add_16.9f
+usr/src/man/man9f/atomic_add_16_nv.9f
+usr/src/man/man9f/atomic_add_32.9f
+usr/src/man/man9f/atomic_add_32_nv.9f
+usr/src/man/man9f/atomic_add_64.9f
+usr/src/man/man9f/atomic_add_64_nv.9f
+usr/src/man/man9f/atomic_add_8.9f
+usr/src/man/man9f/atomic_add_8_nv.9f
+usr/src/man/man9f/atomic_add_char.9f
+usr/src/man/man9f/atomic_add_char_nv.9f
+usr/src/man/man9f/atomic_add_int.9f
+usr/src/man/man9f/atomic_add_int_nv.9f
+usr/src/man/man9f/atomic_add_long.9f
+usr/src/man/man9f/atomic_add_long_nv.9f
+usr/src/man/man9f/atomic_add_ptr.9f
+usr/src/man/man9f/atomic_add_ptr_nv.9f
+usr/src/man/man9f/atomic_add_short.9f
+usr/src/man/man9f/atomic_add_short_nv.9f
+usr/src/man/man9f/atomic_and_16.9f
+usr/src/man/man9f/atomic_and_16_nv.9f
+usr/src/man/man9f/atomic_and_32.9f
+usr/src/man/man9f/atomic_and_32_nv.9f
+usr/src/man/man9f/atomic_and_64.9f
+usr/src/man/man9f/atomic_and_64_nv.9f
+usr/src/man/man9f/atomic_and_8.9f
+usr/src/man/man9f/atomic_and_8_nv.9f
+usr/src/man/man9f/atomic_and_uchar.9f
+usr/src/man/man9f/atomic_and_uchar_nv.9f
+usr/src/man/man9f/atomic_and_uint.9f
+usr/src/man/man9f/atomic_and_uint_nv.9f
+usr/src/man/man9f/atomic_and_ulong.9f
+usr/src/man/man9f/atomic_and_ulong_nv.9f
+usr/src/man/man9f/atomic_and_ushort.9f
+usr/src/man/man9f/atomic_and_ushort_nv.9f
+usr/src/man/man9f/atomic_cas_16.9f
+usr/src/man/man9f/atomic_cas_32.9f
+usr/src/man/man9f/atomic_cas_64.9f
+usr/src/man/man9f/atomic_cas_8.9f
+usr/src/man/man9f/atomic_cas_ptr.9f
+usr/src/man/man9f/atomic_cas_uchar.9f
+usr/src/man/man9f/atomic_cas_uint.9f
+usr/src/man/man9f/atomic_cas_ulong.9f
+usr/src/man/man9f/atomic_cas_ushort.9f
+usr/src/man/man9f/atomic_clear_long_excl.9f
+usr/src/man/man9f/atomic_dec_16.9f
+usr/src/man/man9f/atomic_dec_16_nv.9f
+usr/src/man/man9f/atomic_dec_32.9f
+usr/src/man/man9f/atomic_dec_32_nv.9f
+usr/src/man/man9f/atomic_dec_64.9f
+usr/src/man/man9f/atomic_dec_64_nv.9f
+usr/src/man/man9f/atomic_dec_8.9f
+usr/src/man/man9f/atomic_dec_8_nv.9f
+usr/src/man/man9f/atomic_dec_ptr.9f
+usr/src/man/man9f/atomic_dec_ptr_nv.9f
+usr/src/man/man9f/atomic_dec_uchar.9f
+usr/src/man/man9f/atomic_dec_uchar_nv.9f
+usr/src/man/man9f/atomic_dec_uint.9f
+usr/src/man/man9f/atomic_dec_uint_nv.9f
+usr/src/man/man9f/atomic_dec_ulong.9f
+usr/src/man/man9f/atomic_dec_ulong_nv.9f
+usr/src/man/man9f/atomic_dec_ushort.9f
+usr/src/man/man9f/atomic_dec_ushort_nv.9f
+usr/src/man/man9f/atomic_inc_16.9f
+usr/src/man/man9f/atomic_inc_16_nv.9f
+usr/src/man/man9f/atomic_inc_32.9f
+usr/src/man/man9f/atomic_inc_32_nv.9f
+usr/src/man/man9f/atomic_inc_64.9f
+usr/src/man/man9f/atomic_inc_64_nv.9f
+usr/src/man/man9f/atomic_inc_8.9f
+usr/src/man/man9f/atomic_inc_8_nv.9f
+usr/src/man/man9f/atomic_inc_ptr.9f
+usr/src/man/man9f/atomic_inc_ptr_nv.9f
+usr/src/man/man9f/atomic_inc_uchar.9f
+usr/src/man/man9f/atomic_inc_uchar_nv.9f
+usr/src/man/man9f/atomic_inc_uint.9f
+usr/src/man/man9f/atomic_inc_uint_nv.9f
+usr/src/man/man9f/atomic_inc_ulong.9f
+usr/src/man/man9f/atomic_inc_ulong_nv.9f
+usr/src/man/man9f/atomic_inc_ushort.9f
+usr/src/man/man9f/atomic_inc_ushort_nv.9f
+usr/src/man/man9f/atomic_or_16.9f
+usr/src/man/man9f/atomic_or_16_nv.9f
+usr/src/man/man9f/atomic_or_32.9f
+usr/src/man/man9f/atomic_or_32_nv.9f
+usr/src/man/man9f/atomic_or_64.9f
+usr/src/man/man9f/atomic_or_64_nv.9f
+usr/src/man/man9f/atomic_or_8.9f
+usr/src/man/man9f/atomic_or_8_nv.9f
+usr/src/man/man9f/atomic_or_uchar.9f
+usr/src/man/man9f/atomic_or_uchar_nv.9f
+usr/src/man/man9f/atomic_or_uint.9f
+usr/src/man/man9f/atomic_or_uint_nv.9f
+usr/src/man/man9f/atomic_or_ulong.9f
+usr/src/man/man9f/atomic_or_ulong_nv.9f
+usr/src/man/man9f/atomic_or_ushort.9f
+usr/src/man/man9f/atomic_or_ushort_nv.9f
+usr/src/man/man9f/atomic_set_long_excl.9f
+usr/src/man/man9f/atomic_swap_16.9f
+usr/src/man/man9f/atomic_swap_32.9f
+usr/src/man/man9f/atomic_swap_64.9f
+usr/src/man/man9f/atomic_swap_8.9f
+usr/src/man/man9f/atomic_swap_ptr.9f
+usr/src/man/man9f/atomic_swap_uchar.9f
+usr/src/man/man9f/atomic_swap_uint.9f
+usr/src/man/man9f/atomic_swap_ulong.9f
+usr/src/man/man9f/atomic_swap_ushort.9f
+usr/src/man/man9f/crgetgid.9f
+usr/src/man/man9f/crgetgroups.9f
+usr/src/man/man9f/crgetngroups.9f
+usr/src/man/man9f/crgetrgid.9f
+usr/src/man/man9f/crgetruid.9f
+usr/src/man/man9f/crgetsgid.9f
+usr/src/man/man9f/crgetsuid.9f
+usr/src/man/man9f/crgetuid.9f
+usr/src/man/man9f/crgetzoneid.9f
+usr/src/man/man9f/csx_Get16.9f
+usr/src/man/man9f/csx_Get32.9f
+usr/src/man/man9f/csx_Get64.9f
+usr/src/man/man9f/csx_GetEventMask.9f
+usr/src/man/man9f/csx_GetNextClient.9f
+usr/src/man/man9f/csx_GetNextTuple.9f
+usr/src/man/man9f/csx_Parse_CISTPL_DEVICE_A.9f
+usr/src/man/man9f/csx_Parse_CISTPL_DEVICE_OA.9f
+usr/src/man/man9f/csx_Parse_CISTPL_DEVICE_OC.9f
+usr/src/man/man9f/csx_Parse_CISTPL_JEDEC_A.9f
+usr/src/man/man9f/csx_Parse_CISTPL_LONGLINK_C.9f
+usr/src/man/man9f/csx_Put16.9f
+usr/src/man/man9f/csx_Put32.9f
+usr/src/man/man9f/csx_Put64.9f
+usr/src/man/man9f/csx_ReleaseIO.9f
+usr/src/man/man9f/csx_ReleaseIRQ.9f
+usr/src/man/man9f/csx_ReleaseSocketMask.9f
+usr/src/man/man9f/csx_ReleaseWindow.9f
+usr/src/man/man9f/csx_RemoveDeviceNode.9f
+usr/src/man/man9f/csx_RepGet16.9f
+usr/src/man/man9f/csx_RepGet32.9f
+usr/src/man/man9f/csx_RepGet64.9f
+usr/src/man/man9f/csx_RepPut16.9f
+usr/src/man/man9f/csx_RepPut32.9f
+usr/src/man/man9f/csx_RepPut64.9f
+usr/src/man/man9f/cv_broadcast.9f
+usr/src/man/man9f/cv_destroy.9f
+usr/src/man/man9f/cv_init.9f
+usr/src/man/man9f/cv_reltimedwait.9f
+usr/src/man/man9f/cv_reltimedwait_sig.9f
+usr/src/man/man9f/cv_signal.9f
+usr/src/man/man9f/cv_timedwait.9f
+usr/src/man/man9f/cv_timedwait_sig.9f
+usr/src/man/man9f/cv_wait.9f
+usr/src/man/man9f/cv_wait_sig.9f
+usr/src/man/man9f/ddi_btopr.9f
+usr/src/man/man9f/ddi_cb_unregister.9f
+usr/src/man/man9f/ddi_check_dma_handle.9f
+usr/src/man/man9f/ddi_devid_free.9f
+usr/src/man/man9f/ddi_devid_get.9f
+usr/src/man/man9f/ddi_devid_init.9f
+usr/src/man/man9f/ddi_devid_register.9f
+usr/src/man/man9f/ddi_devid_sizeof.9f
+usr/src/man/man9f/ddi_devid_str_decode.9f
+usr/src/man/man9f/ddi_devid_str_encode.9f
+usr/src/man/man9f/ddi_devid_str_free.9f
+usr/src/man/man9f/ddi_devid_unregister.9f
+usr/src/man/man9f/ddi_devid_valid.9f
+usr/src/man/man9f/ddi_devmap_segmap.9f
+usr/src/man/man9f/ddi_dmae_1stparty.9f
+usr/src/man/man9f/ddi_dmae_alloc.9f
+usr/src/man/man9f/ddi_dmae_disable.9f
+usr/src/man/man9f/ddi_dmae_enable.9f
+usr/src/man/man9f/ddi_dmae_getattr.9f
+usr/src/man/man9f/ddi_dmae_getcnt.9f
+usr/src/man/man9f/ddi_dmae_getlim.9f
+usr/src/man/man9f/ddi_dmae_prog.9f
+usr/src/man/man9f/ddi_dmae_release.9f
+usr/src/man/man9f/ddi_dmae_stop.9f
+usr/src/man/man9f/ddi_exit_critical.9f
+usr/src/man/man9f/ddi_fls.9f
+usr/src/man/man9f/ddi_fm_capable.9f
+usr/src/man/man9f/ddi_fm_dma_err_clear.9f
+usr/src/man/man9f/ddi_fm_dma_err_get.9f
+usr/src/man/man9f/ddi_fm_fini.9f
+usr/src/man/man9f/ddi_fm_handler_unregister.9f
+usr/src/man/man9f/ddi_get16.9f
+usr/src/man/man9f/ddi_get32.9f
+usr/src/man/man9f/ddi_get64.9f
+usr/src/man/man9f/ddi_get_iblock_cookie.9f
+usr/src/man/man9f/ddi_get_lbolt64.9f
+usr/src/man/man9f/ddi_get_name.9f
+usr/src/man/man9f/ddi_get_soft_iblock_cookie.9f
+usr/src/man/man9f/ddi_get_soft_state.9f
+usr/src/man/man9f/ddi_getb.9f
+usr/src/man/man9f/ddi_getl.9f
+usr/src/man/man9f/ddi_getll.9f
+usr/src/man/man9f/ddi_getlongprop.9f
+usr/src/man/man9f/ddi_getlongprop_buf.9f
+usr/src/man/man9f/ddi_getprop.9f
+usr/src/man/man9f/ddi_getproplen.9f
+usr/src/man/man9f/ddi_getw.9f
+usr/src/man/man9f/ddi_intr_block_disable.9f
+usr/src/man/man9f/ddi_intr_block_enable.9f
+usr/src/man/man9f/ddi_intr_clr_mask.9f
+usr/src/man/man9f/ddi_intr_disable.9f
+usr/src/man/man9f/ddi_intr_free.9f
+usr/src/man/man9f/ddi_intr_get_navail.9f
+usr/src/man/man9f/ddi_intr_get_softint_pri.9f
+usr/src/man/man9f/ddi_intr_remove_handler.9f
+usr/src/man/man9f/ddi_intr_remove_softint.9f
+usr/src/man/man9f/ddi_intr_set_cap.9f
+usr/src/man/man9f/ddi_intr_set_pri.9f
+usr/src/man/man9f/ddi_intr_set_softint_pri.9f
+usr/src/man/man9f/ddi_intr_trigger_softint.9f
+usr/src/man/man9f/ddi_io_get16.9f
+usr/src/man/man9f/ddi_io_get32.9f
+usr/src/man/man9f/ddi_io_getb.9f
+usr/src/man/man9f/ddi_io_getl.9f
+usr/src/man/man9f/ddi_io_getw.9f
+usr/src/man/man9f/ddi_io_put16.9f
+usr/src/man/man9f/ddi_io_put32.9f
+usr/src/man/man9f/ddi_io_putb.9f
+usr/src/man/man9f/ddi_io_putl.9f
+usr/src/man/man9f/ddi_io_putw.9f
+usr/src/man/man9f/ddi_io_rep_get16.9f
+usr/src/man/man9f/ddi_io_rep_get32.9f
+usr/src/man/man9f/ddi_io_rep_getb.9f
+usr/src/man/man9f/ddi_io_rep_getl.9f
+usr/src/man/man9f/ddi_io_rep_getw.9f
+usr/src/man/man9f/ddi_io_rep_put16.9f
+usr/src/man/man9f/ddi_io_rep_put32.9f
+usr/src/man/man9f/ddi_io_rep_putb.9f
+usr/src/man/man9f/ddi_io_rep_putl.9f
+usr/src/man/man9f/ddi_io_rep_putw.9f
+usr/src/man/man9f/ddi_iopb_free.9f
+usr/src/man/man9f/ddi_mem_free.9f
+usr/src/man/man9f/ddi_mem_get16.9f
+usr/src/man/man9f/ddi_mem_get32.9f
+usr/src/man/man9f/ddi_mem_get64.9f
+usr/src/man/man9f/ddi_mem_getb.9f
+usr/src/man/man9f/ddi_mem_getl.9f
+usr/src/man/man9f/ddi_mem_getll.9f
+usr/src/man/man9f/ddi_mem_getw.9f
+usr/src/man/man9f/ddi_mem_put16.9f
+usr/src/man/man9f/ddi_mem_put32.9f
+usr/src/man/man9f/ddi_mem_put64.9f
+usr/src/man/man9f/ddi_mem_putb.9f
+usr/src/man/man9f/ddi_mem_putl.9f
+usr/src/man/man9f/ddi_mem_putll.9f
+usr/src/man/man9f/ddi_mem_putw.9f
+usr/src/man/man9f/ddi_mem_rep_get16.9f
+usr/src/man/man9f/ddi_mem_rep_get32.9f
+usr/src/man/man9f/ddi_mem_rep_get64.9f
+usr/src/man/man9f/ddi_mem_rep_getb.9f
+usr/src/man/man9f/ddi_mem_rep_getl.9f
+usr/src/man/man9f/ddi_mem_rep_getll.9f
+usr/src/man/man9f/ddi_mem_rep_getw.9f
+usr/src/man/man9f/ddi_mem_rep_put16.9f
+usr/src/man/man9f/ddi_mem_rep_put32.9f
+usr/src/man/man9f/ddi_mem_rep_put64.9f
+usr/src/man/man9f/ddi_mem_rep_putb.9f
+usr/src/man/man9f/ddi_mem_rep_putl.9f
+usr/src/man/man9f/ddi_mem_rep_putll.9f
+usr/src/man/man9f/ddi_mem_rep_putw.9f
+usr/src/man/man9f/ddi_modclose.9f
+usr/src/man/man9f/ddi_modsym.9f
+usr/src/man/man9f/ddi_peek16.9f
+usr/src/man/man9f/ddi_peek32.9f
+usr/src/man/man9f/ddi_peek64.9f
+usr/src/man/man9f/ddi_peek8.9f
+usr/src/man/man9f/ddi_peekc.9f
+usr/src/man/man9f/ddi_peekd.9f
+usr/src/man/man9f/ddi_peekl.9f
+usr/src/man/man9f/ddi_peeks.9f
+usr/src/man/man9f/ddi_poke16.9f
+usr/src/man/man9f/ddi_poke32.9f
+usr/src/man/man9f/ddi_poke64.9f
+usr/src/man/man9f/ddi_poke8.9f
+usr/src/man/man9f/ddi_pokec.9f
+usr/src/man/man9f/ddi_poked.9f
+usr/src/man/man9f/ddi_pokel.9f
+usr/src/man/man9f/ddi_pokes.9f
+usr/src/man/man9f/ddi_prop_free.9f
+usr/src/man/man9f/ddi_prop_get_int64.9f
+usr/src/man/man9f/ddi_prop_lookup_byte_array.9f
+usr/src/man/man9f/ddi_prop_lookup_int64_array.9f
+usr/src/man/man9f/ddi_prop_lookup_int_array.9f
+usr/src/man/man9f/ddi_prop_lookup_string.9f
+usr/src/man/man9f/ddi_prop_lookup_string_array.9f
+usr/src/man/man9f/ddi_prop_modify.9f
+usr/src/man/man9f/ddi_prop_remove.9f
+usr/src/man/man9f/ddi_prop_remove_all.9f
+usr/src/man/man9f/ddi_prop_undefine.9f
+usr/src/man/man9f/ddi_prop_update_byte_array.9f
+usr/src/man/man9f/ddi_prop_update_int.9f
+usr/src/man/man9f/ddi_prop_update_int64.9f
+usr/src/man/man9f/ddi_prop_update_int64_array.9f
+usr/src/man/man9f/ddi_prop_update_int_array.9f
+usr/src/man/man9f/ddi_prop_update_string.9f
+usr/src/man/man9f/ddi_prop_update_string_array.9f
+usr/src/man/man9f/ddi_ptob.9f
+usr/src/man/man9f/ddi_put16.9f
+usr/src/man/man9f/ddi_put32.9f
+usr/src/man/man9f/ddi_put64.9f
+usr/src/man/man9f/ddi_putb.9f
+usr/src/man/man9f/ddi_putl.9f
+usr/src/man/man9f/ddi_putll.9f
+usr/src/man/man9f/ddi_putw.9f
+usr/src/man/man9f/ddi_remove_intr.9f
+usr/src/man/man9f/ddi_remove_softintr.9f
+usr/src/man/man9f/ddi_rep_get16.9f
+usr/src/man/man9f/ddi_rep_get32.9f
+usr/src/man/man9f/ddi_rep_get64.9f
+usr/src/man/man9f/ddi_rep_getb.9f
+usr/src/man/man9f/ddi_rep_getl.9f
+usr/src/man/man9f/ddi_rep_getll.9f
+usr/src/man/man9f/ddi_rep_getw.9f
+usr/src/man/man9f/ddi_rep_put16.9f
+usr/src/man/man9f/ddi_rep_put32.9f
+usr/src/man/man9f/ddi_rep_put64.9f
+usr/src/man/man9f/ddi_rep_putb.9f
+usr/src/man/man9f/ddi_rep_putl.9f
+usr/src/man/man9f/ddi_rep_putll.9f
+usr/src/man/man9f/ddi_rep_putw.9f
+usr/src/man/man9f/ddi_segmap_setup.9f
+usr/src/man/man9f/ddi_set_driver_private.9f
+usr/src/man/man9f/ddi_soft_state_fini.9f
+usr/src/man/man9f/ddi_soft_state_free.9f
+usr/src/man/man9f/ddi_soft_state_init.9f
+usr/src/man/man9f/ddi_soft_state_zalloc.9f
+usr/src/man/man9f/ddi_strdup.9f
+usr/src/man/man9f/ddi_strtoull.9f
+usr/src/man/man9f/ddi_taskq_create.9f
+usr/src/man/man9f/ddi_taskq_destroy.9f
+usr/src/man/man9f/ddi_taskq_dispatch.9f
+usr/src/man/man9f/ddi_taskq_resume.9f
+usr/src/man/man9f/ddi_taskq_suspend.9f
+usr/src/man/man9f/ddi_taskq_wait.9f
+usr/src/man/man9f/ddi_trigger_softintr.9f
+usr/src/man/man9f/ddi_umem_free.9f
+usr/src/man/man9f/ddi_umem_unlock.9f
+usr/src/man/man9f/ddi_unmap_regs.9f
+usr/src/man/man9f/desballoc.9f
+usr/src/man/man9f/devmap_load.9f
+usr/src/man/man9f/devmap_umem_setup.9f
+usr/src/man/man9f/dlerrorack.9f
+usr/src/man/man9f/dlokack.9f
+usr/src/man/man9f/dlphysaddrack.9f
+usr/src/man/man9f/dluderrorind.9f
+usr/src/man/man9f/free_pktiopb.9f
+usr/src/man/man9f/gld_intr.9f
+usr/src/man/man9f/gld_mac_alloc.9f
+usr/src/man/man9f/gld_mac_free.9f
+usr/src/man/man9f/gld_recv.9f
+usr/src/man/man9f/gld_register.9f
+usr/src/man/man9f/gld_sched.9f
+usr/src/man/man9f/gld_unregister.9f
+usr/src/man/man9f/id32_free.9f
+usr/src/man/man9f/id32_lookup.9f
+usr/src/man/man9f/inl.9f
+usr/src/man/man9f/intro.9f
+usr/src/man/man9f/inw.9f
+usr/src/man/man9f/kmem_cache_alloc.9f
+usr/src/man/man9f/kmem_cache_destroy.9f
+usr/src/man/man9f/kmem_cache_free.9f
+usr/src/man/man9f/kmem_cache_set_move.9f
+usr/src/man/man9f/kmem_free.9f
+usr/src/man/man9f/kmem_zalloc.9f
+usr/src/man/man9f/kstat_named_setstr.9f
+usr/src/man/man9f/kstat_runq_back_to_waitq.9f
+usr/src/man/man9f/kstat_runq_enter.9f
+usr/src/man/man9f/kstat_runq_exit.9f
+usr/src/man/man9f/kstat_waitq_enter.9f
+usr/src/man/man9f/kstat_waitq_exit.9f
+usr/src/man/man9f/kstat_waitq_to_runq.9f
+usr/src/man/man9f/ldi_awrite.9f
+usr/src/man/man9f/ldi_close.9f
+usr/src/man/man9f/ldi_get_devid.9f
+usr/src/man/man9f/ldi_get_minor_name.9f
+usr/src/man/man9f/ldi_get_otyp.9f
+usr/src/man/man9f/ldi_getmsg.9f
+usr/src/man/man9f/ldi_ident_from_dip.9f
+usr/src/man/man9f/ldi_ident_from_stream.9f
+usr/src/man/man9f/ldi_ident_release.9f
+usr/src/man/man9f/ldi_open_by_devid.9f
+usr/src/man/man9f/ldi_open_by_name.9f
+usr/src/man/man9f/ldi_prop_get_int64.9f
+usr/src/man/man9f/ldi_prop_lookup_byte_array.9f
+usr/src/man/man9f/ldi_prop_lookup_int64_array.9f
+usr/src/man/man9f/ldi_prop_lookup_string.9f
+usr/src/man/man9f/ldi_prop_lookup_string_array.9f
+usr/src/man/man9f/ldi_write.9f
+usr/src/man/man9f/list_destroy.9f
+usr/src/man/man9f/list_head.9f
+usr/src/man/man9f/list_insert_after.9f
+usr/src/man/man9f/list_insert_before.9f
+usr/src/man/man9f/list_insert_head.9f
+usr/src/man/man9f/list_insert_tail.9f
+usr/src/man/man9f/list_is_empty.9f
+usr/src/man/man9f/list_link_active.9f
+usr/src/man/man9f/list_link_init.9f
+usr/src/man/man9f/list_link_replace.9f
+usr/src/man/man9f/list_move_tail.9f
+usr/src/man/man9f/list_next.9f
+usr/src/man/man9f/list_prev.9f
+usr/src/man/man9f/list_remove.9f
+usr/src/man/man9f/list_remove_head.9f
+usr/src/man/man9f/list_remove_tail.9f
+usr/src/man/man9f/list_tail.9f
+usr/src/man/man9f/makecom_g0.9f
+usr/src/man/man9f/makecom_g0_s.9f
+usr/src/man/man9f/makecom_g1.9f
+usr/src/man/man9f/makecom_g5.9f
+usr/src/man/man9f/membar_consumer.9f
+usr/src/man/man9f/membar_enter.9f
+usr/src/man/man9f/membar_exit.9f
+usr/src/man/man9f/membar_producer.9f
+usr/src/man/man9f/memcmp.9f
+usr/src/man/man9f/memcpy.9f
+usr/src/man/man9f/memmove.9f
+usr/src/man/man9f/memset.9f
+usr/src/man/man9f/minphys.9f
+usr/src/man/man9f/mod_info.9f
+usr/src/man/man9f/mod_modname.9f
+usr/src/man/man9f/mod_remove.9f
+usr/src/man/man9f/mutex_destroy.9f
+usr/src/man/man9f/mutex_enter.9f
+usr/src/man/man9f/mutex_exit.9f
+usr/src/man/man9f/mutex_init.9f
+usr/src/man/man9f/mutex_owned.9f
+usr/src/man/man9f/mutex_tryenter.9f
+usr/src/man/man9f/net_event_notify_unregister.9f
+usr/src/man/man9f/net_instance_notify_unregister.9f
+usr/src/man/man9f/net_instance_protocol_unregister.9f
+usr/src/man/man9f/numtos.9f
+usr/src/man/man9f/nv_alloc_fini.9f
+usr/src/man/man9f/nv_alloc_init.9f
+usr/src/man/man9f/nvlist_add_boolean_array.9f
+usr/src/man/man9f/nvlist_add_boolean_value.9f
+usr/src/man/man9f/nvlist_add_byte.9f
+usr/src/man/man9f/nvlist_add_byte_array.9f
+usr/src/man/man9f/nvlist_add_int16.9f
+usr/src/man/man9f/nvlist_add_int16_array.9f
+usr/src/man/man9f/nvlist_add_int32.9f
+usr/src/man/man9f/nvlist_add_int32_array.9f
+usr/src/man/man9f/nvlist_add_int64.9f
+usr/src/man/man9f/nvlist_add_int64_array.9f
+usr/src/man/man9f/nvlist_add_int8.9f
+usr/src/man/man9f/nvlist_add_int8_array.9f
+usr/src/man/man9f/nvlist_add_nvlist.9f
+usr/src/man/man9f/nvlist_add_nvlist_array.9f
+usr/src/man/man9f/nvlist_add_nvpair.9f
+usr/src/man/man9f/nvlist_add_string.9f
+usr/src/man/man9f/nvlist_add_string_array.9f
+usr/src/man/man9f/nvlist_add_uint16.9f
+usr/src/man/man9f/nvlist_add_uint16_array.9f
+usr/src/man/man9f/nvlist_add_uint32.9f
+usr/src/man/man9f/nvlist_add_uint32_array.9f
+usr/src/man/man9f/nvlist_add_uint64.9f
+usr/src/man/man9f/nvlist_add_uint64_array.9f
+usr/src/man/man9f/nvlist_add_uint8.9f
+usr/src/man/man9f/nvlist_add_uint8_array.9f
+usr/src/man/man9f/nvlist_dup.9f
+usr/src/man/man9f/nvlist_exists.9f
+usr/src/man/man9f/nvlist_free.9f
+usr/src/man/man9f/nvlist_lookup_boolean_array.9f
+usr/src/man/man9f/nvlist_lookup_boolean_value.9f
+usr/src/man/man9f/nvlist_lookup_byte.9f
+usr/src/man/man9f/nvlist_lookup_byte_array.9f
+usr/src/man/man9f/nvlist_lookup_int16.9f
+usr/src/man/man9f/nvlist_lookup_int16_array.9f
+usr/src/man/man9f/nvlist_lookup_int32.9f
+usr/src/man/man9f/nvlist_lookup_int32_array.9f
+usr/src/man/man9f/nvlist_lookup_int64.9f
+usr/src/man/man9f/nvlist_lookup_int64_array.9f
+usr/src/man/man9f/nvlist_lookup_int8.9f
+usr/src/man/man9f/nvlist_lookup_int8_array.9f
+usr/src/man/man9f/nvlist_lookup_nvlist.9f
+usr/src/man/man9f/nvlist_lookup_nvlist_array.9f
+usr/src/man/man9f/nvlist_lookup_pairs.9f
+usr/src/man/man9f/nvlist_lookup_string.9f
+usr/src/man/man9f/nvlist_lookup_string_array.9f
+usr/src/man/man9f/nvlist_lookup_uint16.9f
+usr/src/man/man9f/nvlist_lookup_uint16_array.9f
+usr/src/man/man9f/nvlist_lookup_uint32.9f
+usr/src/man/man9f/nvlist_lookup_uint32_array.9f
+usr/src/man/man9f/nvlist_lookup_uint64.9f
+usr/src/man/man9f/nvlist_lookup_uint64_array.9f
+usr/src/man/man9f/nvlist_lookup_uint8.9f
+usr/src/man/man9f/nvlist_lookup_uint8_array.9f
+usr/src/man/man9f/nvlist_merge.9f
+usr/src/man/man9f/nvlist_pack.9f
+usr/src/man/man9f/nvlist_remove_all.9f
+usr/src/man/man9f/nvlist_size.9f
+usr/src/man/man9f/nvlist_t.9f
+usr/src/man/man9f/nvlist_unpack.9f
+usr/src/man/man9f/nvlist_xalloc.9f
+usr/src/man/man9f/nvlist_xdup.9f
+usr/src/man/man9f/nvlist_xpack.9f
+usr/src/man/man9f/nvlist_xunpack.9f
+usr/src/man/man9f/nvpair_name.9f
+usr/src/man/man9f/nvpair_type.9f
+usr/src/man/man9f/nvpair_value_boolean_array.9f
+usr/src/man/man9f/nvpair_value_byte_array.9f
+usr/src/man/man9f/nvpair_value_int16.9f
+usr/src/man/man9f/nvpair_value_int16_array.9f
+usr/src/man/man9f/nvpair_value_int32.9f
+usr/src/man/man9f/nvpair_value_int32_array.9f
+usr/src/man/man9f/nvpair_value_int64.9f
+usr/src/man/man9f/nvpair_value_int64_array.9f
+usr/src/man/man9f/nvpair_value_int8.9f
+usr/src/man/man9f/nvpair_value_int8_array.9f
+usr/src/man/man9f/nvpair_value_nvlist.9f
+usr/src/man/man9f/nvpair_value_nvlist_array.9f
+usr/src/man/man9f/nvpair_value_string.9f
+usr/src/man/man9f/nvpair_value_string_array.9f
+usr/src/man/man9f/nvpair_value_uint16.9f
+usr/src/man/man9f/nvpair_value_uint16_array.9f
+usr/src/man/man9f/nvpair_value_uint32.9f
+usr/src/man/man9f/nvpair_value_uint32_array.9f
+usr/src/man/man9f/nvpair_value_uint64.9f
+usr/src/man/man9f/nvpair_value_uint64_array.9f
+usr/src/man/man9f/nvpair_value_uint8.9f
+usr/src/man/man9f/nvpair_value_uint8_array.9f
+usr/src/man/man9f/otherq.9f
+usr/src/man/man9f/outl.9f
+usr/src/man/man9f/outw.9f
+usr/src/man/man9f/pci_config_get16.9f
+usr/src/man/man9f/pci_config_get32.9f
+usr/src/man/man9f/pci_config_get64.9f
+usr/src/man/man9f/pci_config_getb.9f
+usr/src/man/man9f/pci_config_getl.9f
+usr/src/man/man9f/pci_config_getll.9f
+usr/src/man/man9f/pci_config_getw.9f
+usr/src/man/man9f/pci_config_put16.9f
+usr/src/man/man9f/pci_config_put32.9f
+usr/src/man/man9f/pci_config_put64.9f
+usr/src/man/man9f/pci_config_put8.9f
+usr/src/man/man9f/pci_config_putb.9f
+usr/src/man/man9f/pci_config_putl.9f
+usr/src/man/man9f/pci_config_putll.9f
+usr/src/man/man9f/pci_config_putw.9f
+usr/src/man/man9f/pci_config_teardown.9f
+usr/src/man/man9f/pci_ereport_post.9f
+usr/src/man/man9f/pci_ereport_teardown.9f
+usr/src/man/man9f/pci_restore_config_regs.9f
+usr/src/man/man9f/pm_idle_component.9f
+usr/src/man/man9f/pm_lower_power.9f
+usr/src/man/man9f/priv_policy_choice.9f
+usr/src/man/man9f/priv_policy_only.9f
+usr/src/man/man9f/proc_ref.9f
+usr/src/man/man9f/proc_unref.9f
+usr/src/man/man9f/qprocsoff.9f
+usr/src/man/man9f/qwait_sig.9f
+usr/src/man/man9f/rd.9f
+usr/src/man/man9f/repinsb.9f
+usr/src/man/man9f/repinsd.9f
+usr/src/man/man9f/repinsw.9f
+usr/src/man/man9f/repoutsb.9f
+usr/src/man/man9f/repoutsd.9f
+usr/src/man/man9f/repoutsw.9f
+usr/src/man/man9f/rmallocmap_wait.9f
+usr/src/man/man9f/rmfreemap.9f
+usr/src/man/man9f/rw_destroy.9f
+usr/src/man/man9f/rw_downgrade.9f
+usr/src/man/man9f/rw_enter.9f
+usr/src/man/man9f/rw_exit.9f
+usr/src/man/man9f/rw_init.9f
+usr/src/man/man9f/rw_read_locked.9f
+usr/src/man/man9f/rw_tryenter.9f
+usr/src/man/man9f/rw_tryupgrade.9f
+usr/src/man/man9f/samestr.9f
+usr/src/man/man9f/scsi_dmafree.9f
+usr/src/man/man9f/scsi_dname.9f
+usr/src/man/man9f/scsi_hba_attach.9f
+usr/src/man/man9f/scsi_hba_detach.9f
+usr/src/man/man9f/scsi_hba_fini.9f
+usr/src/man/man9f/scsi_hba_pkt_free.9f
+usr/src/man/man9f/scsi_hba_tran_free.9f
+usr/src/man/man9f/scsi_ifsetcap.9f
+usr/src/man/man9f/scsi_mname.9f
+usr/src/man/man9f/scsi_pktfree.9f
+usr/src/man/man9f/scsi_resalloc.9f
+usr/src/man/man9f/scsi_resfree.9f
+usr/src/man/man9f/scsi_rname.9f
+usr/src/man/man9f/scsi_sense_asc.9f
+usr/src/man/man9f/scsi_sense_ascq.9f
+usr/src/man/man9f/scsi_sense_cmdspecific_uint64.9f
+usr/src/man/man9f/scsi_sense_info_uint64.9f
+usr/src/man/man9f/scsi_sname.9f
+usr/src/man/man9f/scsi_unslave.9f
+usr/src/man/man9f/sema_destroy.9f
+usr/src/man/man9f/sema_init.9f
+usr/src/man/man9f/sema_p.9f
+usr/src/man/man9f/sema_p_sig.9f
+usr/src/man/man9f/sema_tryp.9f
+usr/src/man/man9f/sema_v.9f
+usr/src/man/man9f/strcasecmp.9f
+usr/src/man/man9f/strchr.9f
+usr/src/man/man9f/strcmp.9f
+usr/src/man/man9f/strcpy.9f
+usr/src/man/man9f/strdup.9f
+usr/src/man/man9f/strfree.9f
+usr/src/man/man9f/strlcat.9f
+usr/src/man/man9f/strlcpy.9f
+usr/src/man/man9f/strlen.9f
+usr/src/man/man9f/strncasecmp.9f
+usr/src/man/man9f/strncat.9f
+usr/src/man/man9f/strncmp.9f
+usr/src/man/man9f/strncpy.9f
+usr/src/man/man9f/strnlen.9f
+usr/src/man/man9f/strrchr.9f
+usr/src/man/man9f/strspn.9f
+usr/src/man/man9f/taskq_suspended.9f
+usr/src/man/man9f/uconv_u16tou8.9f
+usr/src/man/man9f/uconv_u32tou16.9f
+usr/src/man/man9f/uconv_u32tou8.9f
+usr/src/man/man9f/uconv_u8tou16.9f
+usr/src/man/man9f/uconv_u8tou32.9f
+usr/src/man/man9f/unfreezestr.9f
+usr/src/man/man9f/usb_alloc_bulk_req.9f
+usr/src/man/man9f/usb_alloc_ctrl_req.9f
+usr/src/man/man9f/usb_alloc_intr_req.9f
+usr/src/man/man9f/usb_alloc_isoc_req.9f
+usr/src/man/man9f/usb_client_detach.9f
+usr/src/man/man9f/usb_free_bulk_req.9f
+usr/src/man/man9f/usb_free_ctrl_req.9f
+usr/src/man/man9f/usb_free_descr_tree.9f
+usr/src/man/man9f/usb_free_dev_data.9f
+usr/src/man/man9f/usb_free_intr_req.9f
+usr/src/man/man9f/usb_free_isoc_req.9f
+usr/src/man/man9f/usb_get_if_number.9f
+usr/src/man/man9f/usb_owns_device.9f
+usr/src/man/man9f/usb_pipe_ctrl_xfer_wait.9f
+usr/src/man/man9f/usb_pipe_get_private.9f
+usr/src/man/man9f/usb_pipe_stop_intr_polling.9f
+usr/src/man/man9f/usb_pipe_stop_isoc_polling.9f
+usr/src/man/man9f/usb_print_descr_tree.9f
+usr/src/man/man9f/usb_set_alt_if.9f
+usr/src/man/man9f/usb_set_cfg.9f
+usr/src/man/man9f/usb_unregister_hotplug_cbs.9f
+usr/src/man/man9f/va_copy.9f
+usr/src/man/man9f/va_end.9f
+usr/src/man/man9f/va_start.9f
+usr/src/man/man9f/vcmn_err.9f
+usr/src/man/man9f/wr.9f
+usr/src/man/man9f/zcmn_err.9f
+usr/src/man/man9p/Nblock.9p
+usr/src/man/man9p/blksize.9p
+usr/src/man/man9p/ddi-no-autodetach.9p
+usr/src/man/man9p/device-blksize.9p
+usr/src/man/man9p/device-nblocks.9p
+usr/src/man/man9p/inquiry-product-id.9p
+usr/src/man/man9p/inquiry-revision-id.9p
+usr/src/man/man9p/inquiry-serial-no.9p
+usr/src/man/man9p/inquiry-vendor-id.9p
+usr/src/man/man9s/dblk.9s
+usr/src/man/man9s/ddi_dma_lim.9s
+usr/src/man/man9s/intro.9s
+usr/src/man/man9s/mblk.9s
+usr/src/msg/magic
+usr/src/msg/mailx.help
+usr/src/msg/more.help
+usr/src/msg/priv_names
+usr/src/pkg/license-list
+usr/src/pkg/packages.i386/
+usr/src/psm/stand/bootblks/ufs/i386/installboot
+usr/src/psm/stand/bootblks/ufs/i386/mboot
+usr/src/psm/stand/bootblks/ufs/i386/mboot.exec
+usr/src/tools/aw/aw
+usr/src/tools/codereview/codereview
+usr/src/tools/codesign/findcrypto
+usr/src/tools/codesign/signit
+usr/src/tools/codesign/signproto
+usr/src/tools/cscope-fast/cscope-fast
+usr/src/tools/ctf/cvt/i386/ctfconvert
+usr/src/tools/ctf/cvt/i386/ctfmerge
+usr/src/tools/ctf/dump/i386/ctfdump
+usr/src/tools/ctf/scripts/ctfcvtptbl
+usr/src/tools/ctf/scripts/ctffindmod
+usr/src/tools/ctf/stabs/i386/ctfstabs
+usr/src/tools/cw/cw
+usr/src/tools/elfextract/elfextract
+usr/src/tools/elfsign/elfsign
+usr/src/tools/elfsign/elfsigncmp
+usr/src/tools/env/developer
+usr/src/tools/env/gatekeeper
+usr/src/tools/env/illumos
+usr/src/tools/findunref/exception_list
+usr/src/tools/findunref/findunref
+usr/src/tools/gk/cshrc
+usr/src/tools/gk/gen_make.machines
+usr/src/tools/gk/login
+usr/src/tools/install-i386.out
+usr/src/tools/install.bin/install.bin
+usr/src/tools/lintdump/lintdump
+usr/src/tools/mbh_patch/mbh_patch
+usr/src/tools/ndrgen/ndrgen
+usr/src/tools/ndrgen/ndrgen1
+usr/src/tools/ndrgen/y.tab.c
+usr/src/tools/ndrgen/y.tab.h
+usr/src/tools/pmodes/pmodes
+usr/src/tools/proto/
+usr/src/tools/protocmp/protocmp
+usr/src/tools/protolist/protolist
+usr/src/tools/scripts/Install
+usr/src/tools/scripts/bindrop
+usr/src/tools/scripts/bldenv
+usr/src/tools/scripts/bldenv.1
+usr/src/tools/scripts/bringovercheck
+usr/src/tools/scripts/build_cscope
+usr/src/tools/scripts/cddlchk
+usr/src/tools/scripts/check_rtime
+usr/src/tools/scripts/checkpaths
+usr/src/tools/scripts/checkproto
+usr/src/tools/scripts/copyrightchk
+usr/src/tools/scripts/cryptodrop
+usr/src/tools/scripts/cstyle
+usr/src/tools/scripts/elfcmp
+usr/src/tools/scripts/find_elf
+usr/src/tools/scripts/flg.flp
+usr/src/tools/scripts/genoffsets
+usr/src/tools/scripts/git-active
+usr/src/tools/scripts/hdrchk
+usr/src/tools/scripts/hg-active
+usr/src/tools/scripts/hgsetup
+usr/src/tools/scripts/interface_check
+usr/src/tools/scripts/interface_cmp
+usr/src/tools/scripts/jstyle
+usr/src/tools/scripts/mapfilechk
+usr/src/tools/scripts/mkreadme_osol
+usr/src/tools/scripts/mktpl
+usr/src/tools/scripts/nightly
+usr/src/tools/scripts/onu
+usr/src/tools/scripts/protocmp.terse
+usr/src/tools/scripts/sccscheck
+usr/src/tools/scripts/validate_flg
+usr/src/tools/scripts/validate_paths
+usr/src/tools/scripts/validate_pkg
+usr/src/tools/scripts/wdiff
+usr/src/tools/scripts/webrev
+usr/src/tools/scripts/which_scm
+usr/src/tools/scripts/ws
+usr/src/tools/scripts/wsdiff
+usr/src/tools/scripts/xref
+usr/src/ucbcmd/basename/basename
+usr/src/ucbcmd/biff/biff
+usr/src/ucbcmd/chown/chown
+usr/src/ucbcmd/df/df
+usr/src/ucbcmd/du/du
+usr/src/ucbcmd/echo/echo
+usr/src/ucbcmd/expr/expr
+usr/src/ucbcmd/fastboot/fastboot
+usr/src/ucbcmd/fasthalt/fasthalt
+usr/src/ucbcmd/file/file
+usr/src/ucbcmd/from/from
+usr/src/ucbcmd/groups/groups
+usr/src/ucbcmd/install.d/installcmd
+usr/src/ucbcmd/ln/ln
+usr/src/ucbcmd/ls/ls
+usr/src/ucbcmd/mkstr/mkstr
+usr/src/ucbcmd/printenv/printenv
+usr/src/ucbcmd/rusage/rusage
+usr/src/ucbcmd/sed/sed
+usr/src/ucbcmd/shutdown/shutdown
+usr/src/ucbcmd/stty/stty
+usr/src/ucbcmd/sum/sum
+usr/src/ucbcmd/test/test
+usr/src/ucbcmd/touch/touch
+usr/src/ucbcmd/tr/tr
+usr/src/ucbcmd/tset/tset
+usr/src/ucbcmd/users/users
+usr/src/ucbcmd/vipw/vipw
+usr/src/ucbcmd/whereis/whereis
+usr/src/ucbcmd/whoami/whoami
+usr/src/uts/common/avs/ns/rdc/rdc_prot.h
+usr/src/uts/common/gssapi/gssd_prot.c
+usr/src/uts/common/gssapi/gssd_prot.h
+usr/src/uts/common/gssapi/gssd_xdr.c
+usr/src/uts/common/idmap/idmap_xdr.c
+usr/src/uts/common/io/fibre-channel/fca/qlc/ql_fw_table.c
+usr/src/uts/common/io/lvm/md/meta_basic_xdr.c
+usr/src/uts/common/io/lvm/md/metamed_xdr.c
+usr/src/uts/common/io/usb/clients/hwa1480_fw/i1480/hwa1480_fw
+usr/src/uts/common/os/priv_const.c
+usr/src/uts/common/rpc/key_prot.h
+usr/src/uts/common/rpc/pmap_prot.h
+usr/src/uts/common/rpc/rpc_sztypes.h
+usr/src/uts/common/rpc/rpcb_prot.h
+usr/src/uts/common/rpcsvc/autofs_prot.h
+usr/src/uts/common/rpcsvc/idmap_prot.h
+usr/src/uts/common/rpcsvc/nsm_addr.h
+usr/src/uts/common/rpcsvc/sm_inter.h
+usr/src/uts/common/sys/lvm/md_basic.h
+usr/src/uts/common/sys/lvm/md_mdiox.h
+usr/src/uts/common/sys/lvm/md_mhdx.h
+usr/src/uts/common/sys/lvm/mdmed.h
+usr/src/uts/common/sys/lvm/mdmn_commd.h
+usr/src/uts/common/sys/priv_const.h
+usr/src/uts/common/sys/priv_names.h
+usr/src/uts/common/sys/usb/usbdevs.h
+usr/src/uts/i86pc/cpu/scripts/ao_gendisp
+usr/src/uts/i86pc/io/acpi/drmach_acpi/drmach_err.c
+usr/src/uts/i86pc/io/acpi/drmach_acpi/sbdgenerr
+usr/src/uts/i86pc/io/dr/dr_err.c
+usr/src/uts/i86pc/io/dr/sbdgenerr
+usr/src/uts/i86pc/unix/multiboot
+usr/src/uts/intel/arcfour/arcfour-x86_64.s
+usr/src/uts/intel/genunix/debug32/
+usr/src/uts/intel/genunix/debug64/
+usr/src/uts/intel/ip/ip.symbols.obj64.diff
+usr/src/uts/intel/ip/ip.symbols.obj64.tmp
+usr/src/uts/intel/ip/ip.symbols.obj64.tmp.new
+usr/src/uts/intel/md5/md5_amd64.s
+usr/src/uts/intel/mwlfw/mw88W8363fw
+usr/src/uts/intel/mwlfw/mwlboot
+usr/src/uts/intel/os/priv_names
+usr/src/uts/intel/sha1/sha1-x86_64.s
+usr/src/uts/intel/sha2/sha256-x86_64.s
+usr/src/uts/intel/sha2/sha512-x86_64.s
+usr/src/uts/intel/sockfs/nl7ctokgen.h
+usr/src/uts/intel/uathfw/uathbin
diff --git a/GCC-README.md b/GCC-README.md
new file mode 100644
index 0000000000..012284aef7
--- /dev/null
+++ b/GCC-README.md
@@ -0,0 +1,129 @@
+
+# Illumos GCC 4
+
+## Intro
+
+This is a work in progress that may or may not work (or work well) at any
+given time. If you encounter problems you think are likely my fault, send me
+email describing them in detail.
+
+This has booted to login and done fairly basic work on 32bit and 64bit x86 in
+qemu, VirtualBox (32bit), and a random whitebox Athlon 64. And on a Sun-Fire
+V250 on sun4u. It has been tried nowhere else.
+
+## What you need
+
+### Patched GCC 4.4.4
+
+This is the GCC available at http://github.com/richlowe/gcc on the il-4_4_4
+branch. It is patched in numerous ways, a stock GCC will most certainly not
+work.
+
+I've made binary tarballs available, they assume a `--prefix` of
+`/opt/gcc/4.4.4` (unpack them from `/opt`)
+
+i386: http://richlowe.openindiana.org/~richlowe/il-gcc-444-i386.tar.bz2
+sparc: http://richlowe.openindiana.org/~richlowe/il-gcc-444-sparc.tar.bz2
+
+### Further patch GCC
+
+Unfortunately, we need to bake appropriate runpaths for libstdc++ and libgcc_s
+into the GCC spec, at least at present, so you need to further patch GCC to
+reflect the location in which you're going to install it.
+
+Choose a prefix in which to install GCC (the one you'll give to `configure
+--prefix`), I'm using /opt/gcc/4.4.4.
+
+Now, look at revision a1583073 (`git show a1583073`). In every place that
+changeset added a /usr/sfw/lib path, adding a matching path based on your
+prefix _before_ the SFW path (you need your libcc_s to be found first).
+
+I'm hoping to find a way to avoid doing this, but at present haven't come up
+with one that works in every case.
+
+### Build GCC
+
+I've been using a script to make this easier on myself
+
+```bash
+#!/bin/ksh -e
+VER=$1
+
+if [[ -z $VER ]]; then
+ print -u2 "Usage: build.sh <Version>"
+ exit 2
+fi
+
+export PATH="/opt/dejagnu/bin:/opt/SUNWspro/bin:"
+PATH="$PATH:/usr/gnu/bin:/usr/sfw/bin"
+PATH="$PATH:/usr/bin:/usr/ccs/bin"
+
+export CC=/usr/sfw/bin/gcc
+export CFLAGS="-g -O2"
+
+AS_OPTIONS=""
+if [[ $(mach) == "sparc" ]]; then
+ CFLAGS="$CFLAGS -fkeep-inline-functions"
+ AS_OPTIONS="--without-gnu-as --with-as=/usr/ccs/bin/as"
+else
+ AS_OPTIONS="--with-gnu-as --with-as=/usr/sfw/bin/as"
+fi
+
+export STAGE1_CFLAGS=$CFLAGS
+export CFLAGS_FOR_TARGET=$CFLAGS
+
+GMSGFMT=/usr/gnu/bin/msgfmt \
+../../configure --prefix=/opt/gcc/$VER $AS_OPTIONS \
+ --with-ld=/usr/bin/ld \
+ --without-gnu-ld \
+ --enable-languages="c,c++,objc" \
+ --enable-shared \
+ --with-mpfr-include=/usr/include/mpfr \
+ --with-gmp-include=/usr/include/gmp
+
+gmake -j8 CFLAGS="$CFLAGS" STAGE1_CFLAGS="$CFLAGS" \
+ CFLAGS_FOR_TARGET="$CFLAGS" bootstrap
+```
+
+Then:
+
+```bash
+mkdir -p builds/il-444 && cd builds/il-444
+../../build.sh 4.4.4
+```
+
+If you wish to run the tests, you'll need to install expect, then build and
+install dejagnu and run 'gmake check-gcc'. It's most useful to compare the
+test results of an unpatched build and a patch build at the same GCC revision
+(the gcc-4.4.4 tag, v. the il-4_4_4 branch for instance).
+
+## Build Illumos
+
+As part of this, I've (at least temporarily) adjusted the build infrastruture
+to support building with either version of GCC as either shadow or primary
+compiler. This adds a little complication to building with GCC4
+
+In addition to your normal settings in your env file you should add
+
+```bash
+source ./illumos.sh # Source your normal environment file
+export GCC_ROOT=/opt/gcc/4.4.4; # Where to find GCC4.x
+export CW_GCC_DIR=${GCC_ROOT}/bin; # A temporary hack to allow bootstrap of cw(1)
+export __GNUC=""; # Use GCC as the primary compiler
+export __GNUC4=""; # Use GCC4 specific flags
+```
+
+This should be sufficient to have GCC 4 used as the primary throughout the
+build (check nightly.log, and/or run `mcs -p foo.o` to check individual
+objects.
+
+## Illumos Live is really helpful
+
+A good and convenient way to test stuff is to use Joyent's illumos-live
+(http://github.com/joyent/illumos-live). My fork contains some additional
+changes to make it mildly more convenient if you don't have netbooting
+infrastructure.
+
+Just make sure that the projects/illumos tree is a clone of this branch, edit
+the generated illumos.sh env file as in "Build Illumos" above, and build it
+following their directions.
diff --git a/boot.manifest b/boot.manifest
new file mode 100644
index 0000000000..8f7c05f3a8
--- /dev/null
+++ b/boot.manifest
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
+#
+# This lists the boot-package files that illumos-joyent delivers as part of
+# a build. These are not part of the platform image but rather the bootable
+# image itself.
+#
+d boot 0755 root sys
+d boot/grub 0755 root sys
+d boot/grub/bin 0755 root sys
+f boot/grub/bin/grub 0755 root sys
+f boot/grub/fat_stage1_5 0644 root sys
+f boot/grub/stage1 0644 root sys
+f boot/grub/stage2 0644 root sys
diff --git a/exception_lists/cstyle b/exception_lists/cstyle
index 1c17c99383..0fdbc61b95 100644
--- a/exception_lists/cstyle
+++ b/exception_lists/cstyle
@@ -852,6 +852,16 @@ usr/src/uts/intel/io/acpica/utilities/utstate.c
usr/src/uts/intel/io/acpica/utilities/uttrack.c
usr/src/uts/intel/io/acpica/utilities/utxface.c
usr/src/uts/intel/io/acpica/utilities/utxferror.c
+usr/src/uts/intel/io/vmxnet/buildNumber.h
+usr/src/uts/intel/io/vmxnet/includeCheck.h
+usr/src/uts/intel/io/vmxnet/net.h
+usr/src/uts/intel/io/vmxnet/net_sg.h
+usr/src/uts/intel/io/vmxnet/vm_basic_types.h
+usr/src/uts/intel/io/vmxnet/vm_device_version.h
+usr/src/uts/intel/io/vmxnet/vmnet_def.h
+usr/src/uts/intel/io/vmxnet/vmxnet.c
+usr/src/uts/intel/io/vmxnet/vmxnet2_def.h
+usr/src/uts/intel/io/vmxnet/vmxnet_def.h
usr/src/uts/intel/sys/acpi/acapps.h
usr/src/uts/intel/sys/acpi/accommon.h
usr/src/uts/intel/sys/acpi/acconfig.h
diff --git a/manifest b/manifest
new file mode 100644
index 0000000000..9a5b868272
--- /dev/null
+++ b/manifest
@@ -0,0 +1,19712 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
+#
+# This lists all the files that illumos-joyent delivers as part of a build.
+# Keep this sorted as by LC_ALL=C sort -u -k2.
+#
+s bin=usr/bin
+d boot 0755 root sys
+d boot/acpi 0755 root sys
+d boot/acpi/tables 0755 root sys
+d boot/solaris 0755 root sys
+f boot/solaris/bootenv.rc 0644 root root
+d boot/solaris/devicedb 0755 root sys
+f boot/solaris/devicedb/master 0644 root sys
+d dev 0755 root sys
+s dev/allkmem=../devices/pseudo/mm@0:allkmem
+s dev/arp=../devices/pseudo/arp@0:arp
+s dev/bl=../devices/pseudo/bl@0:bl
+s dev/bpf=../devices/pseudo/bpf@0:bpf
+s dev/bridgectl=../devices/pseudo/clone@0:bridge
+s dev/conslog=../devices/pseudo/log@0:conslog
+s dev/console=../devices/pseudo/cn@0:console
+d dev/cpu 0755 root root
+d dev/cpu/self 0755 root root
+s dev/cpu/self/cpuid=../../../devices/pseudo/cpuid@0:self
+s dev/crypto=../devices/pseudo/crypto@0:crypto
+s dev/cryptoadm=../devices/pseudo/cryptoadm@0:cryptoadm
+s dev/dld=../devices/pseudo/dld@0:ctl
+d dev/dtrace 0755 root root
+d dev/dtrace/provider 0755 root root
+s dev/dtrace/provider/dcpc=../../../devices/pseudo/dcpc@0:dcpc
+s dev/dtrace/provider/fasttrap=../../../devices/pseudo/fasttrap@0:fasttrap
+s dev/dtrace/provider/fbt=../../../devices/pseudo/fbt@0:fbt
+s dev/dtrace/provider/lockstat=../../../devices/pseudo/lockstat@0:lockstat
+s dev/dtrace/provider/profile=../../../devices/pseudo/profile@0:profile
+s dev/dtrace/provider/sdt=../../../devices/pseudo/sdt@0:sdt
+s dev/dtrace/provider/systrace=../../../devices/pseudo/systrace@0:systrace
+s dev/dump=../devices/pseudo/dump@0:dump
+d dev/fd 0555 root root
+s dev/fm=../devices/pseudo/fm@0:fm
+s dev/fssnapctl=../devices/pseudo/fssnap@0:ctl
+s dev/icmp6=../devices/pseudo/icmp6@0:icmp6
+s dev/icmp=../devices/pseudo/icmp@0:icmp
+s dev/igb=../devices/pseudo/clone@0:igb
+s dev/ip6=../devices/pseudo/ip6@0:ip6
+s dev/ip=../devices/pseudo/ip@0:ip
+s dev/ipauth=../devices/pseudo/ipf@0:ipauth
+s dev/ipf=../devices/pseudo/ipf@0:ipf
+s dev/ipl=../devices/pseudo/ipf@0:ipf
+s dev/iplookup=../devices/pseudo/ipf@0:iplookup
+s dev/ipmpstub=../devices/pseudo/dlpistub@0:ipmpstub
+s dev/ipnat=../devices/pseudo/ipf@0:ipnat
+s dev/ipscan=../devices/pseudo/ipf@0:ipscan
+s dev/ipsecah=../devices/pseudo/ipsecah@0:ipsecah
+s dev/ipsecesp=../devices/pseudo/ipsecesp@0:ipsecesp
+s dev/ipstate=../devices/pseudo/ipf@0:ipstate
+s dev/ipsync=../devices/pseudo/ipf@0:ipsync
+s dev/kbd=../devices/pseudo/conskbd@0:kbd
+s dev/keysock=../devices/pseudo/keysock@0:keysock
+s dev/kmdb=../devices/pseudo/kmdb@0:kmdb
+s dev/kmem=../devices/pseudo/mm@0:kmem
+s dev/kssl=../devices/pseudo/kssl@0:kssl
+s dev/kstat=../devices/pseudo/kstat@0:kstat
+s dev/ksyms=../devices/pseudo/ksyms@0:ksyms
+s dev/llc1=../devices/pseudo/clone@0:llc1
+s dev/lo0=../devices/pseudo/ipnet@0:lo0
+s dev/lockstat=../devices/pseudo/lockstat@0:lockstat
+s dev/lofictl=../devices/pseudo/lofi@0:ctl
+s dev/log=../devices/pseudo/log@0:log
+s dev/logindmux=../devices/pseudo/clone@0:logindmux
+s dev/mem=../devices/pseudo/mm@0:mem
+s dev/mouse=../devices/pseudo/consms@0:mouse
+s dev/msglog=../devices/pseudo/sysmsg@0:msglog
+s dev/nsmb=../devices/pseudo/nsmb@0:nsmb
+s dev/null=../devices/pseudo/mm@0:null
+s dev/openprom=../devices/pseudo/openeepr@0:openprom
+s dev/physmem=../devices/pseudo/physmem@0:physmem
+s dev/pm=../devices/pseudo/pm@0:pm
+s dev/poll=../devices/pseudo/poll@0:poll
+s dev/pool=../devices/pseudo/pool@0:pool
+s dev/poolctl=../devices/pseudo/pool@0:poolctl
+s dev/power_button=../devices/pseudo/power@0:power_button
+s dev/ppm=../devices/pseudo/ppm@0:ppm
+s dev/ptmajor=../devices/pseudo/ptm@0:ptmajor
+s dev/ptmx=../devices/pseudo/clone@0:ptm
+s dev/ptyp0=../devices/pseudo/ptc@0:ptyp0
+s dev/ptyp1=../devices/pseudo/ptc@0:ptyp1
+s dev/ptyp2=../devices/pseudo/ptc@0:ptyp2
+s dev/ptyp3=../devices/pseudo/ptc@0:ptyp3
+s dev/ptyp4=../devices/pseudo/ptc@0:ptyp4
+s dev/ptyp5=../devices/pseudo/ptc@0:ptyp5
+s dev/ptyp6=../devices/pseudo/ptc@0:ptyp6
+s dev/ptyp7=../devices/pseudo/ptc@0:ptyp7
+s dev/ptyp8=../devices/pseudo/ptc@0:ptyp8
+s dev/ptyp9=../devices/pseudo/ptc@0:ptyp9
+s dev/ptypa=../devices/pseudo/ptc@0:ptypa
+s dev/ptypb=../devices/pseudo/ptc@0:ptypb
+s dev/ptypc=../devices/pseudo/ptc@0:ptypc
+s dev/ptypd=../devices/pseudo/ptc@0:ptypd
+s dev/ptype=../devices/pseudo/ptc@0:ptype
+s dev/ptypf=../devices/pseudo/ptc@0:ptypf
+s dev/ptyq0=../devices/pseudo/ptc@0:ptyq0
+s dev/ptyq1=../devices/pseudo/ptc@0:ptyq1
+s dev/ptyq2=../devices/pseudo/ptc@0:ptyq2
+s dev/ptyq3=../devices/pseudo/ptc@0:ptyq3
+s dev/ptyq4=../devices/pseudo/ptc@0:ptyq4
+s dev/ptyq5=../devices/pseudo/ptc@0:ptyq5
+s dev/ptyq6=../devices/pseudo/ptc@0:ptyq6
+s dev/ptyq7=../devices/pseudo/ptc@0:ptyq7
+s dev/ptyq8=../devices/pseudo/ptc@0:ptyq8
+s dev/ptyq9=../devices/pseudo/ptc@0:ptyq9
+s dev/ptyqa=../devices/pseudo/ptc@0:ptyqa
+s dev/ptyqb=../devices/pseudo/ptc@0:ptyqb
+s dev/ptyqc=../devices/pseudo/ptc@0:ptyqc
+s dev/ptyqd=../devices/pseudo/ptc@0:ptyqd
+s dev/ptyqe=../devices/pseudo/ptc@0:ptyqe
+s dev/ptyqf=../devices/pseudo/ptc@0:ptyqf
+s dev/ptyr0=../devices/pseudo/ptc@0:ptyr0
+s dev/ptyr1=../devices/pseudo/ptc@0:ptyr1
+s dev/ptyr2=../devices/pseudo/ptc@0:ptyr2
+s dev/ptyr3=../devices/pseudo/ptc@0:ptyr3
+s dev/ptyr4=../devices/pseudo/ptc@0:ptyr4
+s dev/ptyr5=../devices/pseudo/ptc@0:ptyr5
+s dev/ptyr6=../devices/pseudo/ptc@0:ptyr6
+s dev/ptyr7=../devices/pseudo/ptc@0:ptyr7
+s dev/ptyr8=../devices/pseudo/ptc@0:ptyr8
+s dev/ptyr9=../devices/pseudo/ptc@0:ptyr9
+s dev/ptyra=../devices/pseudo/ptc@0:ptyra
+s dev/ptyrb=../devices/pseudo/ptc@0:ptyrb
+s dev/ptyrc=../devices/pseudo/ptc@0:ptyrc
+s dev/ptyrd=../devices/pseudo/ptc@0:ptyrd
+s dev/ptyre=../devices/pseudo/ptc@0:ptyre
+s dev/ptyrf=../devices/pseudo/ptc@0:ptyrf
+s dev/ramdiskctl=../devices/pseudo/ramdisk@1024:ctl
+s dev/random=../devices/pseudo/random@0:random
+s dev/rawip6=../devices/pseudo/icmp6@0:icmp6
+s dev/rawip=../devices/pseudo/icmp@0:icmp
+s dev/rts=../devices/pseudo/rts@0:rts
+d dev/sad 0755 root root
+s dev/sad/admin=../../devices/pseudo/sad@0:admin
+s dev/sad/user=../../devices/pseudo/sad@0:user
+s dev/sdp=../devices/pseudo/sdp@0:sdp
+s dev/smbios=../devices/pseudo/smbios@0:smbios
+s dev/spdsock=../devices/pseudo/spdsock@0:spdsock
+s dev/sppp=../devices/pseudo/clone@0:sppp
+s dev/sppptun=../devices/pseudo/clone@0:sppptun
+s dev/srn=../devices/pseudo/srn@0:srn
+s dev/stderr=fd/2
+s dev/stdin=fd/0
+s dev/stdout=fd/1
+s dev/syscon=../devices/pseudo/cn@0:syscon
+s dev/sysevent=../devices/pseudo/sysevent@0:sysevent
+s dev/sysmsg=../devices/pseudo/sysmsg@0:sysmsg
+s dev/systty=../devices/pseudo/cn@0:systty
+s dev/tcp6=../devices/pseudo/tcp6@0:tcp6
+s dev/tcp=../devices/pseudo/tcp@0:tcp
+s dev/ticlts=../devices/pseudo/tl@0:ticlts
+s dev/ticots=../devices/pseudo/tl@0:ticots
+s dev/ticotsord=../devices/pseudo/tl@0:ticotsord
+s dev/tty=../devices/pseudo/sy@0:tty
+s dev/ttyp0=../devices/pseudo/ptsl@0:ttyp0
+s dev/ttyp1=../devices/pseudo/ptsl@0:ttyp1
+s dev/ttyp2=../devices/pseudo/ptsl@0:ttyp2
+s dev/ttyp3=../devices/pseudo/ptsl@0:ttyp3
+s dev/ttyp4=../devices/pseudo/ptsl@0:ttyp4
+s dev/ttyp5=../devices/pseudo/ptsl@0:ttyp5
+s dev/ttyp6=../devices/pseudo/ptsl@0:ttyp6
+s dev/ttyp7=../devices/pseudo/ptsl@0:ttyp7
+s dev/ttyp8=../devices/pseudo/ptsl@0:ttyp8
+s dev/ttyp9=../devices/pseudo/ptsl@0:ttyp9
+s dev/ttypa=../devices/pseudo/ptsl@0:ttypa
+s dev/ttypb=../devices/pseudo/ptsl@0:ttypb
+s dev/ttypc=../devices/pseudo/ptsl@0:ttypc
+s dev/ttypd=../devices/pseudo/ptsl@0:ttypd
+s dev/ttype=../devices/pseudo/ptsl@0:ttype
+s dev/ttypf=../devices/pseudo/ptsl@0:ttypf
+s dev/ttyq0=../devices/pseudo/ptsl@0:ttyq0
+s dev/ttyq1=../devices/pseudo/ptsl@0:ttyq1
+s dev/ttyq2=../devices/pseudo/ptsl@0:ttyq2
+s dev/ttyq3=../devices/pseudo/ptsl@0:ttyq3
+s dev/ttyq4=../devices/pseudo/ptsl@0:ttyq4
+s dev/ttyq5=../devices/pseudo/ptsl@0:ttyq5
+s dev/ttyq6=../devices/pseudo/ptsl@0:ttyq6
+s dev/ttyq7=../devices/pseudo/ptsl@0:ttyq7
+s dev/ttyq8=../devices/pseudo/ptsl@0:ttyq8
+s dev/ttyq9=../devices/pseudo/ptsl@0:ttyq9
+s dev/ttyqa=../devices/pseudo/ptsl@0:ttyqa
+s dev/ttyqb=../devices/pseudo/ptsl@0:ttyqb
+s dev/ttyqc=../devices/pseudo/ptsl@0:ttyqc
+s dev/ttyqd=../devices/pseudo/ptsl@0:ttyqd
+s dev/ttyqe=../devices/pseudo/ptsl@0:ttyqe
+s dev/ttyqf=../devices/pseudo/ptsl@0:ttyqf
+s dev/ttyr0=../devices/pseudo/ptsl@0:ttyr0
+s dev/ttyr1=../devices/pseudo/ptsl@0:ttyr1
+s dev/ttyr2=../devices/pseudo/ptsl@0:ttyr2
+s dev/ttyr3=../devices/pseudo/ptsl@0:ttyr3
+s dev/ttyr4=../devices/pseudo/ptsl@0:ttyr4
+s dev/ttyr5=../devices/pseudo/ptsl@0:ttyr5
+s dev/ttyr6=../devices/pseudo/ptsl@0:ttyr6
+s dev/ttyr7=../devices/pseudo/ptsl@0:ttyr7
+s dev/ttyr8=../devices/pseudo/ptsl@0:ttyr8
+s dev/ttyr9=../devices/pseudo/ptsl@0:ttyr9
+s dev/ttyra=../devices/pseudo/ptsl@0:ttyra
+s dev/ttyrb=../devices/pseudo/ptsl@0:ttyrb
+s dev/ttyrc=../devices/pseudo/ptsl@0:ttyrc
+s dev/ttyrd=../devices/pseudo/ptsl@0:ttyrd
+s dev/ttyre=../devices/pseudo/ptsl@0:ttyre
+s dev/ttyrf=../devices/pseudo/ptsl@0:ttyrf
+s dev/ucode=../devices/pseudo/ucode@0:ucode
+s dev/udp6=../devices/pseudo/udp6@0:udp6
+s dev/udp=../devices/pseudo/udp@0:udp
+s dev/urandom=../devices/pseudo/random@0:urandom
+s dev/vni=../devices/pseudo/dlpistub@0:vni
+s dev/winlock=../devices/pseudo/winlock@0:winlock
+s dev/wscons=../devices/pseudo/wc@0:wscons
+s dev/zero=../devices/pseudo/mm@0:zero
+s dev/zfs=../devices/pseudo/zfs@0:zfs
+d devices 0755 root sys
+d etc 0755 root sys
+f etc/.login 0644 root sys
+s etc/.syslog_door=../var/run/syslog_door
+s etc/TIMEZONE=default/init
+d etc/acct 0755 adm adm
+f etc/acct/holidays 0644 root bin
+d etc/amd64 0755 root sys
+f etc/auto_home 0644 root bin
+f etc/auto_master 0644 root bin
+d etc/brand 0755 root sys
+d etc/certs 0755 root sys
+d etc/cron.d 0755 root sys
+f etc/cron.d/.proto 0744 root sys
+f etc/cron.d/at.deny 0644 root sys
+f etc/cron.d/cron.deny 0644 root sys
+f etc/cron.d/queuedefs 0644 root sys
+d etc/crypto 0755 root sys
+d etc/crypto/certs 0755 root sys
+d etc/crypto/crls 0755 root sys
+f etc/crypto/kcf.conf 0644 root sys
+f etc/crypto/kmf.conf 0644 root sys
+f etc/dacf.conf 0644 root sys
+d etc/dat 0755 root sys
+f etc/dat/dat.conf 0644 root sys
+f etc/datemsk 0444 root sys
+d etc/default 0755 root sys
+f etc/default/autofs 0644 root sys
+f etc/default/cron 0644 root sys
+f etc/default/devfsadm 0644 root sys
+f etc/default/dhcpagent 0644 root sys
+f etc/default/fs 0644 root sys
+f etc/default/ftp 0644 root sys
+f etc/default/inetinit 0644 root sys
+f etc/default/ipsec 0644 root sys
+f etc/default/keyserv 0644 root sys
+f etc/default/mpathd 0644 root sys
+f etc/default/nfs 0644 root sys
+f etc/default/nfslogd 0644 root sys
+f etc/default/nss 0644 root sys
+f etc/default/power 0644 root sys
+f etc/default/su 0644 root sys
+f etc/default/syslogd 0644 root sys
+f etc/default/tar 0644 root sys
+f etc/default/telnetd 0644 root sys
+f etc/default/utmpd 0644 root sys
+d etc/dev 0755 root sys
+f etc/device.tab 0444 root root
+d etc/devices 0755 root sys
+d etc/devices/dli 0755 root root
+f etc/devlink.tab 0644 root sys
+d etc/dfs 0755 root sys
+f etc/dfs/dfstab 0644 root sys
+f etc/dfs/fstypes 0644 root root
+f etc/dfs/sharetab 0444 root root
+f etc/dgroup.tab 0444 root sys
+d etc/dhcp 0755 root sys
+f etc/dhcp/inittab 0644 root sys
+f etc/dhcp/inittab6 0644 root sys
+d etc/dladm 0755 dladm netadm
+f etc/dladm/datalink.conf 0644 dladm sys
+f etc/dladm/flowadm.conf 0644 dladm netadm
+f etc/dladm/flowprop.conf 0644 dladm netadm
+f etc/dladm/secobj.conf 0660 dladm netadm
+f etc/dumpdates 0664 root sys
+d etc/fm 0755 root sys
+d etc/fm/fmd 0755 root sys
+f etc/format.dat 0644 root sys
+d etc/fs 0755 root sys
+d etc/fs/dev 0755 root sys
+f etc/fs/dev/mount 0555 root bin
+d etc/fs/hsfs 0755 root sys
+f etc/fs/hsfs/mount 0555 root bin
+d etc/fs/nfs 0755 root sys
+f etc/fs/nfs/mount 0555 root bin
+d etc/fs/ufs 0755 root sys
+f etc/fs/ufs/mount 0555 root bin
+d etc/fs/zfs 0755 root sys
+s etc/fs/zfs/mount=../../../sbin/zfs
+s etc/fs/zfs/umount=../../../sbin/zfs
+d etc/gss 0755 root sys
+f etc/gss/gsscred.conf 0644 root sys
+f etc/gss/mech 0644 root sys
+f etc/gss/qop 0644 root sys
+f etc/hba.conf 0644 root bin
+s etc/hosts=inet/hosts
+f etc/ima.conf 0644 root bin
+d etc/inet 0755 root sys
+f etc/inet/datemsk.ndpd 0444 root sys
+f etc/inet/hosts 0644 root sys
+d etc/inet/ike 0755 root sys
+f etc/inet/ike/config.sample 0444 root sys
+d etc/inet/ike/crls 0755 root sys
+d etc/inet/ike/publickeys 0755 root sys
+f etc/inet/inetd.conf 0644 root sys
+f etc/inet/ipaddrsel.conf 0644 root sys
+s etc/inet/ipnodes=hosts
+f etc/inet/ipsecalgs 0644 root sys
+f etc/inet/ipsecinit.sample 0444 root sys
+f etc/inet/netmasks 0644 root sys
+f etc/inet/networks 0644 root sys
+f etc/inet/protocols 0644 root sys
+d etc/inet/secret 0700 root sys
+f etc/inet/secret/ike.preshared 0600 root sys
+d etc/inet/secret/ike.privatekeys 0700 root sys
+f etc/inet/secret/ipseckeys.sample 0600 root sys
+f etc/inet/slp.conf.example 0644 root sys
+s etc/inetd.conf=inet/inetd.conf
+d etc/init.d 0755 root sys
+f etc/init.d/PRESERVE 0744 root sys
+f etc/init.d/README 0644 root sys
+f etc/init.d/acct 0744 root sys
+f etc/init.d/devlinks 0744 root sys
+f etc/init.d/dhcp 0744 root sys
+f etc/init.d/dodatadm.udaplt 0744 root sys
+f etc/init.d/drvconfig 0744 root sys
+f etc/init.d/ldap.client 0744 root sys
+f etc/init.d/nfs.server 0744 root sys
+f etc/init.d/nscd 0744 root sys
+f etc/init.d/pppd 0744 root sys
+f etc/init.d/sendmail 0744 root sys
+f etc/init.d/slpd 0744 root sys
+f etc/init.d/sysetup 0744 root sys
+f etc/init.d/ufs_quota 0744 root sys
+f etc/ioctl.syscon 0644 root sys
+d etc/ipadm 0755 netadm netadm
+f etc/ipadm/ipadm.conf 0644 netadm netadm
+d etc/ipf 0755 root sys
+f etc/ipf/ipf.conf 0644 root sys
+f etc/iu.ap 0644 root sys
+d etc/krb5 0755 root sys
+f etc/krb5/krb5.conf 0644 root sys
+f etc/krb5/warn.conf 0644 root sys
+f etc/ksh.kshrc 0644 root sys
+s etc/log=../var/adm/log
+d etc/logadm.d 0755 root sys
+f etc/logadm.d/fmd.logadm.conf 0444 root sys
+f etc/logindevperm 0644 root sys
+f etc/mach 0644 root sys
+f etc/magic 0444 root bin
+d etc/mail 0755 root sys
+f etc/mail/Mail.rc 0644 root mail
+f etc/mail/aliases 0644 root mail
+d etc/mail/cf 0755 root mail
+f etc/mail/helpfile 0644 root mail
+f etc/mail/local-host-names 0644 root mail
+f etc/mail/mailx.rc 0644 root mail
+s etc/mail/main.cf=sendmail.cf
+f etc/mail/sendmail.cf 0444 root mail
+s etc/mail/sendmail.hf=helpfile
+f etc/mail/submit.cf 0444 root mail
+s etc/mail/subsidiary.cf=sendmail.cf
+f etc/mail/trusted-users 0644 root mail
+f etc/mailcap 0644 root bin
+f etc/mime.types 0644 root bin
+f etc/mnttab 0444 root root
+f etc/mpapi.conf 0644 root bin
+f etc/name_to_sysnum 0644 root sys
+d etc/net 0755 root sys
+d etc/net/ticlts 0755 root sys
+f etc/net/ticlts/hosts 0644 root sys
+f etc/net/ticlts/services 0644 root sys
+d etc/net/ticots 0755 root sys
+f etc/net/ticots/hosts 0644 root sys
+f etc/net/ticots/services 0644 root sys
+d etc/net/ticotsord 0755 root sys
+f etc/net/ticotsord/hosts 0644 root sys
+f etc/net/ticotsord/services 0644 root sys
+f etc/netconfig 0644 root sys
+s etc/netmasks=inet/netmasks
+s etc/networks=inet/networks
+d etc/nfs 0755 root sys
+f etc/nfs/nfslog.conf 0644 root sys
+f etc/nfssec.conf 0644 root sys
+f etc/nscd.conf 0644 root sys
+f etc/nsswitch.ad 0644 root sys
+f etc/nsswitch.dns 0644 root sys
+f etc/nsswitch.files 0644 root sys
+f etc/nsswitch.ldap 0644 root sys
+f etc/nsswitch.nis 0644 root sys
+d etc/opt 0755 root sys
+f etc/pam.conf 0644 root sys
+f etc/power.conf 0644 root sys
+d etc/ppp 0755 root sys
+f etc/ppp/chap-secrets 0600 root sys
+f etc/ppp/myisp-chat.tmpl 0644 root sys
+f etc/ppp/options.tmpl 0644 root sys
+f etc/ppp/options.ttya.tmpl 0644 root sys
+f etc/ppp/pap-secrets 0600 root sys
+d etc/ppp/peers 0755 root sys
+f etc/ppp/peers/myisp.tmpl 0644 root sys
+d etc/ppp/plugins 0755 root sys
+f etc/project 0644 root sys
+s etc/protocols=inet/protocols
+f etc/publickey 0644 root bin
+d etc/rc0.d 0755 root sys
+h etc/rc0.d/K50pppd=etc/init.d/pppd
+d etc/rc1.d 0755 root sys
+h etc/rc1.d/K50pppd=etc/init.d/pppd
+d etc/rc2.d 0755 root sys
+f etc/rc2.d/README 0644 root sys
+f etc/rc2.d/S20sysetup 0744 root sys
+h etc/rc2.d/S47pppd=etc/init.d/pppd
+f etc/rc2.d/S81dodatadm.udaplt 0744 root sys
+f etc/rc2.d/S89PRESERVE 0744 root sys
+d etc/rc3.d 0755 root sys
+f etc/rc3.d/README 0644 root sys
+d etc/rcS.d 0755 root sys
+f etc/rcS.d/README 0644 root sys
+d etc/rcm 0755 root sys
+d etc/rcm/scripts 0755 root sys
+f etc/remote 0644 root bin
+f etc/rpc 0644 root sys
+d etc/rpcsec 0755 root sys
+d etc/saf 0755 root bin
+f etc/saf/_sactab 0644 root sys
+f etc/saf/_sysconfig 0644 root sys
+d etc/saf/zsmon 0755 root sys
+d etc/sasl 0755 root sys
+f etc/sdp.conf 0644 root sys
+d etc/security 0755 root sys
+d etc/security/audit 0755 root sys
+d etc/security/audit/localhost 0755 root sys
+s etc/security/audit/localhost/files=../../../../var/audit
+f etc/security/audit_class 0644 root sys
+f etc/security/audit_event 0644 root sys
+f etc/security/audit_warn 0740 root sys
+f etc/security/auth_attr 0644 root sys
+d etc/security/auth_attr.d 0755 root sys
+f etc/security/auth_attr.d/SUNWcs 0644 root sys
+f etc/security/crypt.conf 0644 root sys
+d etc/security/dev 0755 root sys
+f etc/security/dev/audio 0400 root bin
+f etc/security/dev/fd0 0400 root bin
+f etc/security/dev/sr0 0400 root bin
+f etc/security/dev/st0 0400 root bin
+f etc/security/dev/st1 0400 root bin
+f etc/security/device_policy 0644 root sys
+f etc/security/exec_attr 0644 root sys
+d etc/security/exec_attr.d 0755 root sys
+f etc/security/exec_attr.d/SUNWcs 0644 root sys
+f etc/security/extra_privs 0644 root sys
+f etc/security/kmfpolicy.xml 0644 root bin
+d etc/security/lib 0755 root sys
+f etc/security/lib/audio_clean 0555 root sys
+f etc/security/lib/fd_clean 0555 root sys
+f etc/security/lib/sr_clean 0555 root sys
+f etc/security/lib/st_clean 0555 root sys
+f etc/security/policy.conf 0644 root sys
+f etc/security/priv_names 0644 root sys
+f etc/security/prof_attr 0644 root sys
+d etc/security/prof_attr.d 0755 root sys
+f etc/security/prof_attr.d/SUNWcs 0644 root sys
+s etc/services=inet/services
+d etc/skel 0755 root sys
+f etc/skel/.profile 0644 root other
+f etc/skel/local.cshrc 0644 root sys
+f etc/skel/local.login 0644 root sys
+f etc/skel/local.profile 0644 root sys
+d etc/sock2path.d 0755 root sys
+f etc/sock2path.d/driver%2Fnetwork%2Fbpf 0644 root sys
+f etc/sock2path.d/driver%2Fnetwork%2Fsdp 0644 root sys
+f etc/sock2path.d/system%2Fkernel 0644 root sys
+d etc/ssh 0755 root sys
+f etc/ssh/moduli 0644 root sys
+f etc/ssh/ssh_config 0644 root sys
+s etc/sulogin=../sbin/sulogin
+d etc/svc 0755 root sys
+d etc/svc/volatile 0755 root sys
+d etc/sysconfig 0755 root root
+d etc/sysevent 0755 root sys
+d etc/sysevent/config 0755 root sys
+d etc/sysevent/devfsadm_event_channel 0755 root root
+s etc/termcap=../usr/share/lib/termcap
+d etc/tm 0755 root sys
+f etc/ttydefs 0644 root sys
+f etc/ttysrch 0644 root sys
+d etc/usb 0755 root sys
+f etc/usb/config_map.conf 0644 root sys
+d etc/user_attr.d 0755 root sys
+f etc/user_attr.d/SUNWcs 0644 root sys
+s etc/utmpx=../var/adm/utmpx
+s etc/wtmpx=../var/adm/wtmpx
+d etc/xdg 0755 root sys
+d etc/xdg/autostart 0755 root sys
+d etc/zfs 0755 root sys
+d etc/zones 0755 root sys
+f etc/zones/SUNWblank.xml 0444 root bin
+f etc/zones/index 0644 root sys
+s etc/zprofile=profile
+d kernel 0755 root sys
+d kernel/amd64 0755 root sys
+f kernel/amd64/genunix 0755 root sys
+d kernel/crypto 0755 root sys
+d kernel/crypto/amd64 0755 root sys
+f kernel/crypto/amd64/aes 0755 root sys
+f kernel/crypto/amd64/arcfour 0755 root sys
+f kernel/crypto/amd64/blowfish 0755 root sys
+f kernel/crypto/amd64/des 0755 root sys
+s kernel/crypto/amd64/dprov=../../../kernel/drv/amd64/dprov
+f kernel/crypto/amd64/ecc 0755 root sys
+f kernel/crypto/amd64/md4 0755 root sys
+f kernel/crypto/amd64/md5 0755 root sys
+f kernel/crypto/amd64/rsa 0755 root sys
+f kernel/crypto/amd64/sha1 0755 root sys
+f kernel/crypto/amd64/sha2 0755 root sys
+f kernel/crypto/amd64/swrand 0755 root sys
+d kernel/dacf 0755 root sys
+d kernel/dacf/amd64 0755 root sys
+f kernel/dacf/amd64/net_dacf 0755 root sys
+d kernel/drv 0755 root sys
+f kernel/drv/aac.conf 0644 root sys
+f kernel/drv/acpi_drv.conf 0644 root sys
+f kernel/drv/adpu320.conf 0644 root sys
+f kernel/drv/aggr.conf 0644 root sys
+d kernel/drv/amd64 0755 root sys
+f kernel/drv/amd64/aac 0755 root sys
+f kernel/drv/amd64/acpi_drv 0755 root sys
+f kernel/drv/amd64/adpu320 0755 root sys
+f kernel/drv/amd64/afe 0755 root sys
+f kernel/drv/amd64/aggr 0755 root sys
+f kernel/drv/amd64/ahci 0755 root sys
+f kernel/drv/amd64/amd8111s 0755 root sys
+f kernel/drv/amd64/amr 0755 root sys
+f kernel/drv/amd64/arcmsr 0755 root sys
+f kernel/drv/amd64/arp 0755 root sys
+f kernel/drv/amd64/asy 0755 root sys
+f kernel/drv/amd64/ata 0755 root sys
+f kernel/drv/amd64/atge 0755 root sys
+f kernel/drv/amd64/bcm_sata 0755 root sys
+f kernel/drv/amd64/bfe 0755 root sys
+f kernel/drv/amd64/bge 0755 root sys
+f kernel/drv/amd64/blkdev 0755 root sys
+f kernel/drv/amd64/bnxe 0755 root sys
+f kernel/drv/amd64/bridge 0755 root sys
+f kernel/drv/amd64/chxge 0755 root sys
+f kernel/drv/amd64/clone 0755 root sys
+f kernel/drv/amd64/cmdk 0755 root sys
+f kernel/drv/amd64/cn 0755 root sys
+f kernel/drv/amd64/conskbd 0755 root sys
+f kernel/drv/amd64/consms 0755 root sys
+f kernel/drv/amd64/cpqary3 0755 root sys
+f kernel/drv/amd64/cpuid 0755 root sys
+f kernel/drv/amd64/cpunex 0755 root sys
+f kernel/drv/amd64/crypto 0755 root sys
+f kernel/drv/amd64/cryptoadm 0755 root sys
+f kernel/drv/amd64/cxgbe 0755 root sys
+f kernel/drv/amd64/dcpc 0755 root sys
+f kernel/drv/amd64/devinfo 0755 root sys
+f kernel/drv/amd64/dld 0755 root sys
+f kernel/drv/amd64/dlpistub 0755 root sys
+f kernel/drv/amd64/dmfe 0755 root sys
+f kernel/drv/amd64/dnet 0755 root sys
+f kernel/drv/amd64/dprov 0755 root sys
+f kernel/drv/amd64/dr_sas 0755 root sys
+f kernel/drv/amd64/dtrace 0755 root sys
+f kernel/drv/amd64/e1000g 0755 root sys
+f kernel/drv/amd64/ehci 0755 root sys
+f kernel/drv/amd64/eibnx 0755 root sys
+f kernel/drv/amd64/fasttrap 0755 root sys
+f kernel/drv/amd64/fbt 0755 root sys
+f kernel/drv/amd64/fm 0755 root sys
+f kernel/drv/amd64/fp 0755 root sys
+f kernel/drv/amd64/heci 0755 root sys
+f kernel/drv/amd64/hid 0755 root sys
+f kernel/drv/amd64/hubd 0755 root sys
+f kernel/drv/amd64/hwahc 0755 root sys
+f kernel/drv/amd64/hwarc 0755 root sys
+f kernel/drv/amd64/hxge 0755 root sys
+f kernel/drv/amd64/i8042 0755 root sys
+f kernel/drv/amd64/icmp 0755 root sys
+f kernel/drv/amd64/icmp6 0755 root sys
+f kernel/drv/amd64/igb 0755 root sys
+f kernel/drv/amd64/intel_nb5000 0755 root sys
+f kernel/drv/amd64/intel_nhm 0755 root sys
+f kernel/drv/amd64/intel_nhmex 0755 root sys
+f kernel/drv/amd64/ip 0755 root sys
+f kernel/drv/amd64/ip6 0755 root sys
+f kernel/drv/amd64/ipd 0755 root sys
+f kernel/drv/amd64/ipnet 0755 root sys
+f kernel/drv/amd64/ippctl 0755 root sys
+f kernel/drv/amd64/iprb 0755 root sys
+f kernel/drv/amd64/ipsecah 0755 root sys
+f kernel/drv/amd64/ipsecesp 0755 root sys
+f kernel/drv/amd64/iptun 0755 root sys
+f kernel/drv/amd64/iscsi 0755 root sys
+f kernel/drv/amd64/iscsit 0755 root sys
+f kernel/drv/amd64/iwscn 0755 root sys
+f kernel/drv/amd64/ixgb 0755 root sys
+f kernel/drv/amd64/ixgbe 0755 root sys
+f kernel/drv/amd64/kb8042 0755 root sys
+f kernel/drv/amd64/keysock 0755 root sys
+f kernel/drv/amd64/kmdb 0755 root sys
+f kernel/drv/amd64/kssl 0755 root sys
+f kernel/drv/amd64/llc1 0755 root sys
+f kernel/drv/amd64/lockstat 0755 root sys
+f kernel/drv/amd64/lofi 0755 root sys
+f kernel/drv/amd64/log 0755 root sys
+f kernel/drv/amd64/lsimega 0755 root sys
+f kernel/drv/amd64/marvell88sx 0755 root sys
+f kernel/drv/amd64/mega_sas 0755 root sys
+f kernel/drv/amd64/mm 0755 root sys
+f kernel/drv/amd64/mpt 0755 root sys
+f kernel/drv/amd64/mpt_sas 0755 root sys
+f kernel/drv/amd64/mr_sas 0755 root sys
+f kernel/drv/amd64/myri10ge 0755 root sys
+f kernel/drv/amd64/nge 0755 root sys
+f kernel/drv/amd64/ntxn 0755 root sys
+f kernel/drv/amd64/nulldriver 0755 root sys
+f kernel/drv/amd64/nv_sata 0755 root sys
+f kernel/drv/amd64/nxge 0755 root sys
+f kernel/drv/amd64/oce 0755 root sys
+f kernel/drv/amd64/ohci 0755 root sys
+f kernel/drv/amd64/openeepr 0755 root sys
+f kernel/drv/amd64/options 0755 root sys
+f kernel/drv/amd64/pci_pci 0755 root sys
+f kernel/drv/amd64/pcieb 0755 root sys
+f kernel/drv/amd64/physmem 0755 root sys
+f kernel/drv/amd64/pmcs 0755 root sys
+f kernel/drv/amd64/poll 0755 root sys
+f kernel/drv/amd64/power 0755 root sys
+f kernel/drv/amd64/profile 0755 root sys
+f kernel/drv/amd64/pseudo 0755 root sys
+f kernel/drv/amd64/ptc 0755 root sys
+f kernel/drv/amd64/ptsl 0755 root sys
+f kernel/drv/amd64/qlc 0755 root sys
+f kernel/drv/amd64/qlge 0755 root sys
+f kernel/drv/amd64/ramdisk 0755 root sys
+f kernel/drv/amd64/random 0755 root sys
+f kernel/drv/amd64/rge 0755 root sys
+f kernel/drv/amd64/rtls 0755 root sys
+f kernel/drv/amd64/rts 0755 root sys
+f kernel/drv/amd64/sad 0755 root sys
+f kernel/drv/amd64/scsa2usb 0755 root sys
+f kernel/drv/amd64/scsi_vhci 0755 root sys
+f kernel/drv/amd64/sd 0755 root sys
+f kernel/drv/amd64/sdhost 0755 root sys
+f kernel/drv/amd64/sdt 0755 root sys
+f kernel/drv/amd64/ses 0755 root sys
+f kernel/drv/amd64/sfe 0755 root sys
+f kernel/drv/amd64/sgen 0755 root sys
+f kernel/drv/amd64/si3124 0755 root sys
+f kernel/drv/amd64/simnet 0755 root sys
+f kernel/drv/amd64/smbios 0755 root sys
+f kernel/drv/amd64/softmac 0755 root sys
+f kernel/drv/amd64/spdsock 0755 root sys
+f kernel/drv/amd64/srn 0755 root sys
+f kernel/drv/amd64/st 0755 root sys
+f kernel/drv/amd64/stmf 0755 root sys
+f kernel/drv/amd64/stmf_sbd 0755 root sys
+f kernel/drv/amd64/sy 0755 root sys
+f kernel/drv/amd64/sysevent 0755 root sys
+f kernel/drv/amd64/sysmsg 0755 root sys
+f kernel/drv/amd64/systrace 0755 root sys
+f kernel/drv/amd64/t4nex 0755 root sys
+f kernel/drv/amd64/tcp 0755 root sys
+f kernel/drv/amd64/tcp6 0755 root sys
+f kernel/drv/amd64/tl 0755 root sys
+f kernel/drv/amd64/tzmon 0755 root sys
+f kernel/drv/amd64/ucode 0755 root sys
+f kernel/drv/amd64/udp 0755 root sys
+f kernel/drv/amd64/udp6 0755 root sys
+f kernel/drv/amd64/ugen 0755 root sys
+f kernel/drv/amd64/uhci 0755 root sys
+f kernel/drv/amd64/usb_mid 0755 root sys
+f kernel/drv/amd64/usbecm 0755 root sys
+f kernel/drv/amd64/usbftdi 0755 root sys
+f kernel/drv/amd64/usbsacm 0755 root sys
+f kernel/drv/amd64/usbser_edge 0755 root sys
+f kernel/drv/amd64/usbskel 0755 root sys
+f kernel/drv/amd64/usbsksp 0755 root sys
+f kernel/drv/amd64/usbsprl 0755 root sys
+f kernel/drv/amd64/vgatext 0755 root sys
+f kernel/drv/amd64/vmxnet 0755 root sys
+f kernel/drv/amd64/vnic 0755 root sys
+f kernel/drv/amd64/vr 0755 root sys
+f kernel/drv/amd64/vscan 0755 root sys
+f kernel/drv/amd64/wc 0755 root sys
+f kernel/drv/amd64/xge 0755 root sys
+f kernel/drv/amd64/yge 0755 root sys
+f kernel/drv/amd64/zfs 0755 root sys
+f kernel/drv/amr.conf 0644 root sys
+f kernel/drv/arcmsr.conf 0644 root sys
+f kernel/drv/arp.conf 0644 root sys
+f kernel/drv/asy.conf 0644 root sys
+f kernel/drv/ata.conf 0644 root sys
+f kernel/drv/bge.conf 0644 root sys
+f kernel/drv/bl.conf 0644 root sys
+f kernel/drv/bnx.conf 0644 root sys
+f kernel/drv/bnxe.conf 0644 root sys
+f kernel/drv/bridge.conf 0644 root sys
+f kernel/drv/clone.conf 0644 root sys
+f kernel/drv/cmdk.conf 0644 root sys
+f kernel/drv/cn.conf 0644 root sys
+f kernel/drv/conskbd.conf 0644 root sys
+f kernel/drv/consms.conf 0644 root sys
+f kernel/drv/cpqary3.conf 0644 root sys
+f kernel/drv/cpuid.conf 0644 root sys
+f kernel/drv/crypto.conf 0644 root sys
+f kernel/drv/cryptoadm.conf 0644 root sys
+f kernel/drv/dcpc.conf 0644 root sys
+f kernel/drv/devinfo.conf 0644 root sys
+f kernel/drv/dld.conf 0644 root sys
+f kernel/drv/dlpistub.conf 0644 root sys
+f kernel/drv/dprov.conf 0644 root sys
+f kernel/drv/dr_sas.conf 0644 root sys
+f kernel/drv/dtrace.conf 0644 root sys
+f kernel/drv/e1000g.conf 0644 root sys
+f kernel/drv/ehci.conf 0644 root sys
+f kernel/drv/eibnx.conf 0644 root sys
+f kernel/drv/fasttrap.conf 0644 root sys
+f kernel/drv/fbt.conf 0644 root sys
+f kernel/drv/fm.conf 0644 root sys
+f kernel/drv/fp.conf 0644 root sys
+f kernel/drv/hxge.conf 0644 root sys
+f kernel/drv/icmp.conf 0644 root sys
+f kernel/drv/icmp6.conf 0644 root sys
+f kernel/drv/igb.conf 0644 root sys
+f kernel/drv/intel_nb5000.conf 0644 root sys
+f kernel/drv/intel_nhm.conf 0644 root sys
+f kernel/drv/intel_nhmex.conf 0644 root sys
+f kernel/drv/ip.conf 0644 root sys
+f kernel/drv/ip6.conf 0644 root sys
+f kernel/drv/ipd.conf 0644 root sys
+f kernel/drv/ipnet.conf 0644 root sys
+f kernel/drv/ippctl.conf 0644 root sys
+f kernel/drv/ipsecah.conf 0644 root sys
+f kernel/drv/ipsecesp.conf 0644 root sys
+f kernel/drv/iptun.conf 0644 root sys
+f kernel/drv/iscsi.conf 0644 root sys
+f kernel/drv/iscsit.conf 0644 root sys
+f kernel/drv/iwscn.conf 0644 root sys
+f kernel/drv/ixgbe.conf 0644 root sys
+f kernel/drv/keysock.conf 0644 root sys
+f kernel/drv/kmdb.conf 0644 root sys
+f kernel/drv/kssl.conf 0644 root sys
+f kernel/drv/llc1.conf 0644 root sys
+f kernel/drv/lockstat.conf 0644 root sys
+f kernel/drv/lofi.conf 0644 root sys
+f kernel/drv/log.conf 0644 root sys
+f kernel/drv/lsimega.conf 0644 root sys
+f kernel/drv/mega_sas.conf 0644 root sys
+f kernel/drv/mm.conf 0644 root sys
+f kernel/drv/mpt.conf 0644 root sys
+f kernel/drv/mr_sas.conf 0644 root sys
+f kernel/drv/nge.conf 0644 root sys
+f kernel/drv/ntxn.conf 0644 root sys
+f kernel/drv/nv_sata.conf 0644 root sys
+f kernel/drv/nxge.conf 0644 root sys
+f kernel/drv/ohci.conf 0644 root sys
+f kernel/drv/openeepr.conf 0644 root sys
+f kernel/drv/options.conf 0644 root sys
+f kernel/drv/pcieb.conf 0644 root sys
+f kernel/drv/physmem.conf 0644 root sys
+f kernel/drv/pmcs.conf 0644 root sys
+f kernel/drv/poll.conf 0644 root sys
+f kernel/drv/power.conf 0644 root sys
+f kernel/drv/profile.conf 0644 root sys
+f kernel/drv/pseudo.conf 0644 root sys
+f kernel/drv/ptc.conf 0644 root sys
+f kernel/drv/ptsl.conf 0644 root sys
+f kernel/drv/qlc.conf 0644 root sys
+f kernel/drv/ramdisk.conf 0644 root sys
+f kernel/drv/random.conf 0644 root sys
+f kernel/drv/sad.conf 0644 root sys
+f kernel/drv/scsa2usb.conf 0644 root sys
+f kernel/drv/scsi_vhci.conf 0644 root sys
+f kernel/drv/sdt.conf 0644 root sys
+f kernel/drv/ses.conf 0644 root sys
+f kernel/drv/sgen.conf 0644 root sys
+f kernel/drv/simnet.conf 0644 root sys
+f kernel/drv/smbios.conf 0644 root sys
+f kernel/drv/smp.conf 0644 root sys
+f kernel/drv/softmac.conf 0644 root sys
+f kernel/drv/spdsock.conf 0644 root sys
+f kernel/drv/srn.conf 0644 root sys
+f kernel/drv/st.conf 0644 root sys
+f kernel/drv/stmf.conf 0644 root sys
+f kernel/drv/stmf_sbd.conf 0644 root sys
+f kernel/drv/sy.conf 0644 root sys
+f kernel/drv/sysevent.conf 0644 root sys
+f kernel/drv/sysmsg.conf 0644 root sys
+f kernel/drv/systrace.conf 0644 root sys
+f kernel/drv/tcp.conf 0644 root sys
+f kernel/drv/tcp6.conf 0644 root sys
+f kernel/drv/tl.conf 0644 root sys
+f kernel/drv/tzmon.conf 0644 root sys
+f kernel/drv/ucode.conf 0644 root sys
+f kernel/drv/udp.conf 0644 root sys
+f kernel/drv/udp6.conf 0644 root sys
+f kernel/drv/uhci.conf 0644 root sys
+f kernel/drv/usbftdi.conf 0644 root sys
+f kernel/drv/usbser_edge.conf 0644 root sys
+f kernel/drv/usbskel.conf 0644 root sys
+f kernel/drv/vmxnet.conf 0644 root sys
+f kernel/drv/vnic.conf 0644 root sys
+f kernel/drv/vscan.conf 0644 root sys
+f kernel/drv/wc.conf 0644 root sys
+f kernel/drv/zfs.conf 0644 root sys
+d kernel/dtrace 0755 root sys
+d kernel/dtrace/amd64 0755 root sys
+f kernel/dtrace/amd64/dcpc 0755 root sys
+f kernel/dtrace/amd64/fasttrap 0755 root sys
+f kernel/dtrace/amd64/fbt 0755 root sys
+f kernel/dtrace/amd64/lockstat 0755 root sys
+f kernel/dtrace/amd64/profile 0755 root sys
+f kernel/dtrace/amd64/sdt 0755 root sys
+f kernel/dtrace/amd64/systrace 0755 root sys
+d kernel/exec 0755 root sys
+d kernel/exec/amd64 0755 root sys
+f kernel/exec/amd64/elfexec 0755 root sys
+f kernel/exec/amd64/intpexec 0755 root sys
+d kernel/fs 0755 root sys
+d kernel/fs/amd64 0755 root sys
+f kernel/fs/amd64/autofs 0755 root sys
+f kernel/fs/amd64/ctfs 0755 root sys
+f kernel/fs/amd64/dcfs 0755 root sys
+f kernel/fs/amd64/dev 0755 root sys
+f kernel/fs/amd64/devfs 0755 root sys
+f kernel/fs/amd64/fifofs 0755 root sys
+f kernel/fs/amd64/hsfs 0755 root sys
+f kernel/fs/amd64/hyprlofs 0755 root sys
+f kernel/fs/amd64/lofs 0755 root sys
+f kernel/fs/amd64/lxprocfs 0755 root sys
+f kernel/fs/amd64/mntfs 0755 root sys
+f kernel/fs/amd64/namefs 0755 root sys
+f kernel/fs/amd64/nfs 0755 root sys
+f kernel/fs/amd64/objfs 0755 root sys
+f kernel/fs/amd64/procfs 0755 root sys
+f kernel/fs/amd64/sharefs 0755 root sys
+f kernel/fs/amd64/sockfs 0755 root sys
+f kernel/fs/amd64/specfs 0755 root sys
+f kernel/fs/amd64/tmpfs 0755 root sys
+f kernel/fs/amd64/ufs 0755 root sys
+f kernel/fs/amd64/zfs 0755 root sys
+d kernel/ipp 0755 root sys
+d kernel/ipp/amd64 0755 root sys
+f kernel/ipp/amd64/dlcosmk 0755 root sys
+f kernel/ipp/amd64/dscpmk 0755 root sys
+f kernel/ipp/amd64/flowacct 0755 root sys
+f kernel/ipp/amd64/ipgpc 0755 root sys
+f kernel/ipp/amd64/tokenmt 0755 root sys
+f kernel/ipp/amd64/tswtclmt 0755 root sys
+d kernel/kiconv 0755 root sys
+d kernel/kiconv/amd64 0755 root sys
+f kernel/kiconv/amd64/kiconv_emea 0755 root sys
+f kernel/kiconv/amd64/kiconv_ja 0755 root sys
+f kernel/kiconv/amd64/kiconv_ko 0755 root sys
+f kernel/kiconv/amd64/kiconv_sc 0755 root sys
+f kernel/kiconv/amd64/kiconv_tc 0755 root sys
+d kernel/kmdb 0755 root sys
+d kernel/kmdb/amd64 0755 root sys
+f kernel/kmdb/amd64/arp 0555 root sys
+f kernel/kmdb/amd64/cpc 0555 root sys
+f kernel/kmdb/amd64/cpu.generic 0555 root sys
+f kernel/kmdb/amd64/cpu_ms.AuthenticAMD.15 0555 root sys
+f kernel/kmdb/amd64/crypto 0555 root sys
+f kernel/kmdb/amd64/emlxs 0555 root sys
+f kernel/kmdb/amd64/fctl 0555 root sys
+f kernel/kmdb/amd64/genunix 0555 root sys
+f kernel/kmdb/amd64/hook 0555 root sys
+f kernel/kmdb/amd64/idm 0555 root sys
+f kernel/kmdb/amd64/ii 0555 root sys
+f kernel/kmdb/amd64/ip 0555 root sys
+f kernel/kmdb/amd64/ipc 0555 root sys
+f kernel/kmdb/amd64/ipp 0555 root sys
+f kernel/kmdb/amd64/krtld 0555 root sys
+f kernel/kmdb/amd64/lofs 0555 root sys
+f kernel/kmdb/amd64/logindmux 0555 root sys
+f kernel/kmdb/amd64/mac 0555 root sys
+f kernel/kmdb/amd64/mdb_ds 0555 root sys
+f kernel/kmdb/amd64/mpt 0555 root sys
+f kernel/kmdb/amd64/mpt_sas 0555 root sys
+f kernel/kmdb/amd64/mr_sas 0555 root sys
+f kernel/kmdb/amd64/nca 0555 root sys
+f kernel/kmdb/amd64/neti 0555 root sys
+f kernel/kmdb/amd64/nfs 0555 root sys
+f kernel/kmdb/amd64/nsctl 0555 root sys
+f kernel/kmdb/amd64/ptm 0555 root sys
+f kernel/kmdb/amd64/qlc 0555 root sys
+f kernel/kmdb/amd64/random 0555 root sys
+f kernel/kmdb/amd64/rdc 0555 root sys
+f kernel/kmdb/amd64/s1394 0555 root sys
+f kernel/kmdb/amd64/sata 0555 root sys
+f kernel/kmdb/amd64/scsi_vhci 0555 root sys
+f kernel/kmdb/amd64/sctp 0555 root sys
+f kernel/kmdb/amd64/sd 0555 root sys
+f kernel/kmdb/amd64/sdbc 0555 root sys
+f kernel/kmdb/amd64/sockfs 0555 root sys
+f kernel/kmdb/amd64/specfs 0555 root sys
+f kernel/kmdb/amd64/sppp 0555 root sys
+f kernel/kmdb/amd64/srpt 0555 root sys
+f kernel/kmdb/amd64/stmf 0555 root sys
+f kernel/kmdb/amd64/stmf_sbd 0555 root sys
+f kernel/kmdb/amd64/sv 0555 root sys
+f kernel/kmdb/amd64/ufs 0555 root sys
+f kernel/kmdb/amd64/uhci 0555 root sys
+f kernel/kmdb/amd64/usba 0555 root sys
+f kernel/kmdb/amd64/zfs 0555 root sys
+d kernel/mac 0755 root sys
+d kernel/mac/amd64 0755 root sys
+f kernel/mac/amd64/mac_6to4 0755 root sys
+f kernel/mac/amd64/mac_ether 0755 root sys
+f kernel/mac/amd64/mac_ib 0755 root sys
+f kernel/mac/amd64/mac_ipv4 0755 root sys
+f kernel/mac/amd64/mac_ipv6 0755 root sys
+f kernel/mac/amd64/mac_wifi 0755 root sys
+d kernel/misc 0755 root sys
+d kernel/misc/amd64 0755 root sys
+f kernel/misc/amd64/ac97 0755 root sys
+f kernel/misc/amd64/acpica 0755 root sys
+f kernel/misc/amd64/agpmaster 0755 root sys
+f kernel/misc/amd64/bignum 0755 root sys
+f kernel/misc/amd64/bootdev 0755 root sys
+f kernel/misc/amd64/busra 0755 root sys
+f kernel/misc/amd64/cmlb 0755 root sys
+f kernel/misc/amd64/consconfig 0755 root sys
+f kernel/misc/amd64/ctf 0755 root sys
+f kernel/misc/amd64/dadk 0755 root sys
+f kernel/misc/amd64/dcopy 0755 root sys
+s kernel/misc/amd64/des=../../../kernel/crypto/amd64/des
+f kernel/misc/amd64/dls 0755 root sys
+f kernel/misc/amd64/drm 0755 root sys
+f kernel/misc/amd64/fctl 0755 root sys
+f kernel/misc/amd64/fssnap_if 0755 root sys
+f kernel/misc/amd64/gda 0755 root sys
+f kernel/misc/amd64/gld 0755 root sys
+f kernel/misc/amd64/hidparser 0755 root sys
+f kernel/misc/amd64/hook 0755 root sys
+f kernel/misc/amd64/hpcsvc 0755 root sys
+f kernel/misc/amd64/hwa1480_fw 0755 root sys
+f kernel/misc/amd64/idm 0755 root sys
+f kernel/misc/amd64/idmap 0755 root sys
+f kernel/misc/amd64/iommulib 0755 root sys
+f kernel/misc/amd64/ipc 0755 root sys
+f kernel/misc/amd64/kbtrans 0755 root sys
+f kernel/misc/amd64/kcf 0755 root sys
+f kernel/misc/amd64/kgssapi 0755 root sys
+f kernel/misc/amd64/klmmod 0755 root sys
+f kernel/misc/amd64/klmops 0755 root sys
+f kernel/misc/amd64/kmdbmod 0755 root sys
+f kernel/misc/amd64/ksocket 0755 root sys
+f kernel/misc/amd64/mac 0755 root sys
+f kernel/misc/amd64/md5 0755 root sys
+f kernel/misc/amd64/mii 0755 root sys
+f kernel/misc/amd64/mwlfw 0755 root sys
+f kernel/misc/amd64/net80211 0755 root sys
+f kernel/misc/amd64/neti 0755 root sys
+f kernel/misc/amd64/nfs_dlboot 0755 root sys
+f kernel/misc/amd64/nfssrv 0755 root sys
+f kernel/misc/amd64/pci_autoconfig 0755 root sys
+f kernel/misc/amd64/pcicfg 0755 root sys
+f kernel/misc/amd64/pcie 0755 root sys
+f kernel/misc/amd64/pcihp 0755 root sys
+f kernel/misc/amd64/pcmcia 0755 root sys
+f kernel/misc/amd64/rpcsec 0755 root sys
+f kernel/misc/amd64/rpcsec_gss 0755 root sys
+f kernel/misc/amd64/rsmops 0755 root sys
+f kernel/misc/amd64/s1394 0755 root sys
+f kernel/misc/amd64/sata 0755 root sys
+f kernel/misc/amd64/sbp2 0755 root sys
+f kernel/misc/amd64/scsi 0755 root sys
+f kernel/misc/amd64/sda 0755 root sys
+f kernel/misc/amd64/sha1 0755 root sys
+f kernel/misc/amd64/sha2 0755 root sys
+f kernel/misc/amd64/strategy 0755 root sys
+f kernel/misc/amd64/strplumb 0755 root sys
+f kernel/misc/amd64/tem 0755 root sys
+f kernel/misc/amd64/tlimod 0755 root sys
+f kernel/misc/amd64/usba 0755 root sys
+f kernel/misc/amd64/usba10 0755 root sys
+f kernel/misc/amd64/usbs49_fw 0755 root sys
+f kernel/misc/amd64/usbser 0755 root sys
+d kernel/misc/kgss 0755 root sys
+d kernel/misc/kgss/amd64 0755 root sys
+f kernel/misc/kgss/amd64/kmech_krb5 0755 root sys
+d kernel/misc/pmcs 0755 root sys
+d kernel/misc/pmcs/amd64 0755 root sys
+f kernel/misc/pmcs/amd64/pmcs8001fw 0755 root sys
+d kernel/misc/qlc 0755 root sys
+d kernel/misc/qlc/amd64 0755 root sys
+f kernel/misc/qlc/amd64/qlc_fw_2200 0755 root sys
+f kernel/misc/qlc/amd64/qlc_fw_2300 0755 root sys
+f kernel/misc/qlc/amd64/qlc_fw_2400 0755 root sys
+f kernel/misc/qlc/amd64/qlc_fw_2500 0755 root sys
+f kernel/misc/qlc/amd64/qlc_fw_6322 0755 root sys
+f kernel/misc/qlc/amd64/qlc_fw_8100 0755 root sys
+d kernel/misc/scsi_vhci 0755 root sys
+d kernel/misc/scsi_vhci/amd64 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_emc 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_lsi 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_asym_sun 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_emc 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_sym_hds 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tape 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs 0755 root sys
+f kernel/misc/scsi_vhci/amd64/scsi_vhci_f_tpgs_tape 0755 root sys
+d kernel/sched 0755 root sys
+d kernel/sched/amd64 0755 root sys
+f kernel/sched/amd64/SDC 0755 root sys
+f kernel/sched/amd64/TS 0755 root sys
+f kernel/sched/amd64/TS_DPTBL 0755 root sys
+d kernel/socketmod 0755 root sys
+d kernel/socketmod/amd64 0755 root sys
+h kernel/socketmod/amd64/icmp=kernel/drv/amd64/icmp
+f kernel/socketmod/amd64/ksslf 0755 root sys
+f kernel/socketmod/amd64/rts 0755 root sys
+f kernel/socketmod/amd64/sockrds 0755 root sys
+f kernel/socketmod/amd64/socksctp 0755 root sys
+f kernel/socketmod/amd64/socksdp 0755 root sys
+h kernel/socketmod/amd64/tcp=kernel/drv/amd64/tcp
+f kernel/socketmod/amd64/trill 0755 root sys
+h kernel/socketmod/amd64/udp=kernel/drv/amd64/udp
+d kernel/strmod 0755 root sys
+d kernel/strmod/amd64 0755 root sys
+f kernel/strmod/amd64/arp 0755 root sys
+f kernel/strmod/amd64/bufmod 0755 root sys
+f kernel/strmod/amd64/connld 0755 root sys
+f kernel/strmod/amd64/dedump 0755 root sys
+f kernel/strmod/amd64/drcompat 0755 root sys
+h kernel/strmod/amd64/icmp=kernel/drv/amd64/icmp
+f kernel/strmod/amd64/ip 0755 root sys
+f kernel/strmod/amd64/ipsecah 0755 root sys
+f kernel/strmod/amd64/ipsecesp 0755 root sys
+f kernel/strmod/amd64/keysock 0755 root sys
+f kernel/strmod/amd64/ldterm 0755 root sys
+f kernel/strmod/amd64/nca 0755 root sys
+f kernel/strmod/amd64/pckt 0755 root sys
+f kernel/strmod/amd64/pfmod 0755 root sys
+f kernel/strmod/amd64/pipemod 0755 root sys
+f kernel/strmod/amd64/ptem 0755 root sys
+f kernel/strmod/amd64/redirmod 0755 root sys
+f kernel/strmod/amd64/rpcmod 0755 root sys
+f kernel/strmod/amd64/sdpib 0755 root sys
+h kernel/strmod/amd64/tcp=kernel/drv/amd64/tcp
+f kernel/strmod/amd64/timod 0755 root sys
+f kernel/strmod/amd64/tirdwr 0755 root sys
+f kernel/strmod/amd64/ttcompat 0755 root sys
+h kernel/strmod/amd64/udp=kernel/drv/amd64/udp
+f kernel/strmod/amd64/usb_ah 0755 root sys
+f kernel/strmod/amd64/usbkbm 0755 root sys
+f kernel/strmod/amd64/usbms 0755 root sys
+f kernel/strmod/amd64/usbwcm 0755 root sys
+f kernel/strmod/amd64/vuid2ps2 0755 root sys
+f kernel/strmod/amd64/vuid3ps2 0755 root sys
+f kernel/strmod/amd64/vuidm3p 0755 root sys
+f kernel/strmod/amd64/vuidm4p 0755 root sys
+f kernel/strmod/amd64/vuidm5p 0755 root sys
+d kernel/sys 0755 root sys
+d kernel/sys/amd64 0755 root sys
+f kernel/sys/amd64/autofs 0755 root sys
+f kernel/sys/amd64/c2audit 0755 root sys
+f kernel/sys/amd64/doorfs 0755 root sys
+f kernel/sys/amd64/inst_sync 0755 root sys
+f kernel/sys/amd64/kaio 0755 root sys
+f kernel/sys/amd64/msgsys 0755 root sys
+f kernel/sys/amd64/nfs 0755 root sys
+f kernel/sys/amd64/pipe 0755 root sys
+f kernel/sys/amd64/portfs 0755 root sys
+f kernel/sys/amd64/pset 0755 root sys
+f kernel/sys/amd64/rpcmod 0755 root sys
+f kernel/sys/amd64/semsys 0755 root sys
+f kernel/sys/amd64/shmsys 0755 root sys
+d lib 0755 root bin
+s lib/32=.
+s lib/64=amd64
+d lib/amd64 0755 root bin
+f lib/amd64/c_synonyms.so.1 0755 root bin
+f lib/amd64/ld.so.1 0755 root bin
+f lib/amd64/libMPAPI.so.1 0755 root bin
+s lib/amd64/libMPAPI.so=libMPAPI.so.1
+f lib/amd64/libadm.so.1 0755 root bin
+s lib/amd64/libadm.so=libadm.so.1
+f lib/amd64/libaio.so.1 0755 root bin
+s lib/amd64/libaio.so=libaio.so.1
+f lib/amd64/libavl.so.1 0755 root bin
+s lib/amd64/libavl.so=libavl.so.1
+f lib/amd64/libbsm.so.1 0755 root bin
+s lib/amd64/libbsm.so=libbsm.so.1
+f lib/amd64/libc.so.1 0755 root bin
+s lib/amd64/libc.so=libc.so.1
+f lib/amd64/libc_db.so.1 0755 root bin
+s lib/amd64/libc_db.so=libc_db.so.1
+f lib/amd64/libcmdutils.so.1 0755 root bin
+s lib/amd64/libcmdutils.so=libcmdutils.so.1
+f lib/amd64/libcontract.so.1 0755 root bin
+s lib/amd64/libcontract.so=libcontract.so.1
+f lib/amd64/libcryptoutil.so.1 0755 root bin
+s lib/amd64/libcryptoutil.so=libcryptoutil.so.1
+f lib/amd64/libctf.so.1 0755 root bin
+s lib/amd64/libctf.so=libctf.so.1
+f lib/amd64/libcurses.so.1 0755 root bin
+s lib/amd64/libcurses.so=libcurses.so.1
+f lib/amd64/libdevice.so.1 0755 root bin
+s lib/amd64/libdevice.so=libdevice.so.1
+f lib/amd64/libdevid.so.1 0755 root bin
+s lib/amd64/libdevid.so=libdevid.so.1
+f lib/amd64/libdevinfo.so.1 0755 root bin
+s lib/amd64/libdevinfo.so=libdevinfo.so.1
+f lib/amd64/libdl.so.1 0755 root bin
+s lib/amd64/libdl.so=libdl.so.1
+f lib/amd64/libdladm.so.1 0755 root bin
+s lib/amd64/libdladm.so=libdladm.so.1
+f lib/amd64/libdlpi.so.1 0755 root bin
+s lib/amd64/libdlpi.so=libdlpi.so.1
+f lib/amd64/libdoor.so.1 0755 root bin
+s lib/amd64/libdoor.so=libdoor.so.1
+f lib/amd64/libefi.so.1 0755 root bin
+s lib/amd64/libefi.so=libefi.so.1
+f lib/amd64/libelf.so.1 0755 root bin
+s lib/amd64/libelf.so=libelf.so.1
+f lib/amd64/libfdisk.so.1 0755 root bin
+s lib/amd64/libfdisk.so=libfdisk.so.1
+f lib/amd64/libgen.so.1 0755 root bin
+s lib/amd64/libgen.so=libgen.so.1
+f lib/amd64/libinetutil.so.1 0755 root bin
+s lib/amd64/libinetutil.so=libinetutil.so.1
+f lib/amd64/libintl.so.1 0755 root bin
+s lib/amd64/libintl.so=libintl.so.1
+f lib/amd64/libkmf.so.1 0755 root bin
+s lib/amd64/libkmf.so=libkmf.so.1
+f lib/amd64/libkmfberder.so.1 0755 root bin
+s lib/amd64/libkmfberder.so=libkmfberder.so.1
+f lib/amd64/libkstat.so.1 0755 root bin
+s lib/amd64/libkstat.so=libkstat.so.1
+f lib/amd64/libld.so.4 0755 root bin
+f lib/amd64/liblddbg.so.4 0755 root bin
+f lib/amd64/libmd.so.1 0755 root bin
+s lib/amd64/libmd.so=libmd.so.1
+f lib/amd64/libmd5.so.1 0755 root bin
+s lib/amd64/libmd5.so=libmd5.so.1
+f lib/amd64/libmp.so.2 0755 root bin
+s lib/amd64/libmp.so=libmp.so.2
+f lib/amd64/libmpscsi_vhci.so.1 0755 root bin
+s lib/amd64/libmpscsi_vhci.so=libmpscsi_vhci.so.1
+f lib/amd64/libnsl.so.1 0755 root bin
+s lib/amd64/libnsl.so=libnsl.so.1
+f lib/amd64/libnvpair.so.1 0755 root bin
+s lib/amd64/libnvpair.so=libnvpair.so.1
+f lib/amd64/libpam.so.1 0755 root bin
+s lib/amd64/libpam.so=libpam.so.1
+s lib/amd64/libposix4.so.1=librt.so.1
+s lib/amd64/libposix4.so=libposix4.so.1
+f lib/amd64/libproc.so.1 0755 root bin
+s lib/amd64/libproc.so=libproc.so.1
+f lib/amd64/libpthread.so.1 0755 root bin
+s lib/amd64/libpthread.so=libpthread.so.1
+f lib/amd64/librcm.so.1 0755 root bin
+s lib/amd64/librcm.so=librcm.so.1
+f lib/amd64/libresolv.so.2 0755 root bin
+s lib/amd64/libresolv.so=libresolv.so.2
+f lib/amd64/libresolv_joy.so.2 0755 root bin
+f lib/amd64/librestart.so.1 0755 root bin
+s lib/amd64/librestart.so=librestart.so.1
+f lib/amd64/librpcsvc.so.1 0755 root bin
+s lib/amd64/librpcsvc.so=librpcsvc.so.1
+f lib/amd64/librt.so.1 0755 root bin
+s lib/amd64/librt.so=librt.so.1
+f lib/amd64/librtld.so.1 0755 root bin
+f lib/amd64/librtld_db.so.1 0755 root bin
+s lib/amd64/librtld_db.so=librtld_db.so.1
+f lib/amd64/libscf.so.1 0755 root bin
+s lib/amd64/libscf.so=libscf.so.1
+f lib/amd64/libsec.so.1 0755 root bin
+s lib/amd64/libsec.so=libsec.so.1
+f lib/amd64/libsecdb.so.1 0755 root bin
+s lib/amd64/libsecdb.so=libsecdb.so.1
+f lib/amd64/libsendfile.so.1 0755 root bin
+s lib/amd64/libsendfile.so=libsendfile.so.1
+f lib/amd64/libsmartsshd.so.1 0755 root bin
+s lib/amd64/libsmartsshd.so=libsmartsshd.so.1
+f lib/amd64/libsocket.so.1 0755 root bin
+s lib/amd64/libsocket.so=libsocket.so.1
+f lib/amd64/libsysevent.so.1 0755 root bin
+s lib/amd64/libsysevent.so=libsysevent.so.1
+f lib/amd64/libtermcap.so.1 0755 root bin
+s lib/amd64/libtermcap.so=libtermcap.so.1
+s lib/amd64/libtermlib.so.1=libcurses.so.1
+s lib/amd64/libtermlib.so=libtermlib.so.1
+f lib/amd64/libthread.so.1 0755 root bin
+s lib/amd64/libthread.so=libthread.so.1
+s lib/amd64/libthread_db.so.1=libc_db.so.1
+s lib/amd64/libthread_db.so=libc_db.so.1
+f lib/amd64/libtsnet.so.1 0755 root bin
+s lib/amd64/libtsnet.so=libtsnet.so.1
+f lib/amd64/libtsol.so.2 0755 root bin
+s lib/amd64/libtsol.so=libtsol.so.2
+f lib/amd64/libumem.so.1 0755 root bin
+s lib/amd64/libumem.so=libumem.so.1
+f lib/amd64/libuuid.so.1 0755 root bin
+s lib/amd64/libuuid.so=libuuid.so.1
+f lib/amd64/libuutil.so.1 0755 root bin
+s lib/amd64/libuutil.so=libuutil.so.1
+f lib/amd64/libw.so.1 0755 root bin
+s lib/amd64/libw.so=libw.so.1
+f lib/amd64/libxnet.so.1 0755 root bin
+s lib/amd64/libxnet.so=libxnet.so.1
+f lib/amd64/libzdoor.so.1 0755 root bin
+s lib/amd64/libzdoor.so=libzdoor.so.1
+f lib/amd64/libzfs.so.1 0755 root bin
+s lib/amd64/libzfs.so=libzfs.so.1
+s lib/amd64/libzfs_core.so.1=../../usr/lib/amd64/libzfs_core.so.1
+s lib/amd64/libzfs_core.so=../../usr/lib/amd64/libzfs_core.so
+f lib/amd64/nss_compat.so.1 0755 root bin
+f lib/amd64/nss_dns.so.1 0755 root bin
+f lib/amd64/nss_files.so.1 0755 root bin
+f lib/amd64/nss_nis.so.1 0755 root bin
+f lib/amd64/nss_user.so.1 0755 root bin
+f lib/c_synonyms.so.1 0755 root bin
+d lib/crypto 0755 root bin
+s lib/crypto/32=.
+s lib/crypto/64=amd64
+d lib/crypto/amd64 0755 root bin
+f lib/crypto/amd64/kmf_mapper_cn.so.1 0755 root bin
+f lib/crypto/amd64/kmf_nss.so.1 0755 root bin
+f lib/crypto/amd64/kmf_openssl.so.1 0755 root bin
+f lib/crypto/amd64/kmf_pkcs11.so.1 0755 root bin
+f lib/crypto/kmf_mapper_cn.so.1 0755 root bin
+f lib/crypto/kmf_nss.so.1 0755 root bin
+f lib/crypto/kmf_openssl.so.1 0755 root bin
+f lib/crypto/kmf_pkcs11.so.1 0755 root bin
+d lib/fm 0755 root bin
+d lib/fm/amd64 0755 root bin
+f lib/fm/amd64/libfmevent.so.1 0755 root bin
+s lib/fm/amd64/libfmevent.so=libfmevent.so.1
+f lib/fm/libfmevent.so.1 0755 root bin
+s lib/fm/libfmevent.so=libfmevent.so.1
+d lib/fs 0755 root sys
+d lib/fs/dev 0755 root sys
+h lib/fs/dev/mount=etc/fs/dev/mount
+d lib/fs/hsfs 0755 root sys
+h lib/fs/hsfs/mount=etc/fs/hsfs/mount
+d lib/fs/nfs 0755 root sys
+h lib/fs/nfs/mount=etc/fs/nfs/mount
+d lib/fs/ufs 0755 root sys
+h lib/fs/ufs/mount=etc/fs/ufs/mount
+d lib/fs/zfs 0755 root sys
+h lib/fs/zfs/mount=etc/fs/zfs/mount
+h lib/fs/zfs/umount=etc/fs/zfs/umount
+d lib/inet 0755 root bin
+f lib/inet/in.mpathd 0555 root bin
+f lib/inet/ipmgmtd 0555 root bin
+f lib/inet/netcfgd 0555 root bin
+f lib/inet/nwamd 0555 root bin
+f lib/ld.so.1 0755 root bin
+f lib/libMPAPI.so.1 0755 root bin
+s lib/libMPAPI.so=libMPAPI.so.1
+f lib/libadm.so.1 0755 root bin
+s lib/libadm.so=libadm.so.1
+f lib/libaio.so.1 0755 root bin
+s lib/libaio.so=libaio.so.1
+f lib/libavl.so.1 0755 root bin
+s lib/libavl.so=libavl.so.1
+f lib/libbsm.so.1 0755 root bin
+s lib/libbsm.so=libbsm.so.1
+f lib/libc.so.1 0755 root bin
+s lib/libc.so=libc.so.1
+f lib/libc_db.so.1 0755 root bin
+s lib/libc_db.so=libc_db.so.1
+f lib/libcmdutils.so.1 0755 root bin
+s lib/libcmdutils.so=libcmdutils.so.1
+f lib/libcontract.so.1 0755 root bin
+s lib/libcontract.so=libcontract.so.1
+f lib/libcryptoutil.so.1 0755 root bin
+s lib/libcryptoutil.so=libcryptoutil.so.1
+f lib/libctf.so.1 0755 root bin
+s lib/libctf.so=libctf.so.1
+f lib/libcurses.so.1 0755 root bin
+s lib/libcurses.so=libcurses.so.1
+f lib/libdevice.so.1 0755 root bin
+s lib/libdevice.so=libdevice.so.1
+f lib/libdevid.so.1 0755 root bin
+s lib/libdevid.so=libdevid.so.1
+f lib/libdevinfo.so.1 0755 root bin
+s lib/libdevinfo.so=libdevinfo.so.1
+f lib/libdhcpagent.so.1 0755 root bin
+s lib/libdhcpagent.so=libdhcpagent.so.1
+f lib/libdhcputil.so.1 0755 root bin
+s lib/libdhcputil.so=libdhcputil.so.1
+f lib/libdl.so.1 0755 root bin
+s lib/libdl.so=libdl.so.1
+f lib/libdladm.so.1 0755 root bin
+s lib/libdladm.so=libdladm.so.1
+f lib/libdlpi.so.1 0755 root bin
+s lib/libdlpi.so=libdlpi.so.1
+f lib/libdoor.so.1 0755 root bin
+s lib/libdoor.so=libdoor.so.1
+f lib/libefi.so.1 0755 root bin
+s lib/libefi.so=libefi.so.1
+f lib/libelf.so.1 0755 root bin
+s lib/libelf.so=libelf.so.1
+f lib/libelfsign.so.1 0755 root bin
+s lib/libelfsign.so=libelfsign.so.1
+f lib/libfdisk.so.1 0755 root bin
+s lib/libfdisk.so=libfdisk.so.1
+f lib/libgen.so.1 0755 root bin
+s lib/libgen.so=libgen.so.1
+f lib/libgrubmgmt.so.1 0755 root bin
+s lib/libgrubmgmt.so=libgrubmgmt.so.1
+f lib/libinetutil.so.1 0755 root bin
+s lib/libinetutil.so=libinetutil.so.1
+f lib/libintl.so.1 0755 root bin
+s lib/libintl.so=libintl.so.1
+f lib/libipadm.so.1 0755 root bin
+s lib/libipadm.so=libipadm.so.1
+f lib/libipmp.so.1 0755 root bin
+s lib/libipmp.so=libipmp.so.1
+f lib/libkcfd.so.1 0755 root bin
+s lib/libkcfd.so=libkcfd.so.1
+f lib/libkmf.so.1 0755 root bin
+s lib/libkmf.so=libkmf.so.1
+f lib/libkmfberder.so.1 0755 root bin
+s lib/libkmfberder.so=libkmfberder.so.1
+f lib/libkstat.so.1 0755 root bin
+s lib/libkstat.so=libkstat.so.1
+f lib/libld.so.4 0755 root bin
+f lib/liblddbg.so.4 0755 root bin
+f lib/libmd.so.1 0755 root bin
+s lib/libmd.so=libmd.so.1
+f lib/libmd5.so.1 0755 root bin
+s lib/libmd5.so=libmd5.so.1
+f lib/libmp.so.1 0755 root bin
+f lib/libmp.so.2 0755 root bin
+s lib/libmp.so=libmp.so.2
+f lib/libmpscsi_vhci.so.1 0755 root bin
+s lib/libmpscsi_vhci.so=libmpscsi_vhci.so.1
+f lib/libnsl.so.1 0755 root bin
+s lib/libnsl.so=libnsl.so.1
+f lib/libnvpair.so.1 0755 root bin
+s lib/libnvpair.so=libnvpair.so.1
+f lib/libnwam.so.1 0755 root bin
+s lib/libnwam.so=libnwam.so.1
+f lib/libpam.so.1 0755 root bin
+s lib/libpam.so=libpam.so.1
+s lib/libposix4.so.1=librt.so.1
+s lib/libposix4.so=libposix4.so.1
+f lib/libproc.so.1 0755 root bin
+s lib/libproc.so=libproc.so.1
+f lib/libpthread.so.1 0755 root bin
+s lib/libpthread.so=libpthread.so.1
+f lib/librcm.so.1 0755 root bin
+s lib/librcm.so=librcm.so.1
+f lib/libresolv.so.1 0755 root bin
+f lib/libresolv.so.2 0755 root bin
+s lib/libresolv.so=libresolv.so.2
+f lib/libresolv_joy.so.2 0755 root bin
+f lib/librestart.so.1 0755 root bin
+s lib/librestart.so=librestart.so.1
+f lib/librpcsvc.so.1 0755 root bin
+s lib/librpcsvc.so=librpcsvc.so.1
+f lib/librt.so.1 0755 root bin
+s lib/librt.so=librt.so.1
+f lib/librtld.so.1 0755 root bin
+f lib/librtld_db.so.1 0755 root bin
+s lib/librtld_db.so=librtld_db.so.1
+f lib/libscf.so.1 0755 root bin
+s lib/libscf.so=libscf.so.1
+f lib/libsec.so.1 0755 root bin
+s lib/libsec.so=libsec.so.1
+f lib/libsecdb.so.1 0755 root bin
+s lib/libsecdb.so=libsecdb.so.1
+f lib/libsendfile.so.1 0755 root bin
+s lib/libsendfile.so=libsendfile.so.1
+f lib/libsmartsshd.so.1 0755 root bin
+s lib/libsmartsshd.so=libsmartsshd.so.1
+f lib/libsocket.so.1 0755 root bin
+s lib/libsocket.so=libsocket.so.1
+f lib/libsysevent.so.1 0755 root bin
+s lib/libsysevent.so=libsysevent.so.1
+f lib/libtermcap.so.1 0755 root bin
+s lib/libtermcap.so=libtermcap.so.1
+s lib/libtermlib.so.1=libcurses.so.1
+s lib/libtermlib.so=libtermlib.so.1
+f lib/libthread.so.1 0755 root bin
+s lib/libthread.so=libthread.so.1
+s lib/libthread_db.so.1=libc_db.so.1
+s lib/libthread_db.so=libc_db.so.1
+f lib/libtsnet.so.1 0755 root bin
+s lib/libtsnet.so=libtsnet.so.1
+f lib/libtsol.so.2 0755 root bin
+s lib/libtsol.so=libtsol.so.2
+f lib/libumem.so.1 0755 root bin
+s lib/libumem.so=libumem.so.1
+f lib/libuuid.so.1 0755 root bin
+s lib/libuuid.so=libuuid.so.1
+f lib/libuutil.so.1 0755 root bin
+s lib/libuutil.so=libuutil.so.1
+f lib/libw.so.1 0755 root bin
+s lib/libw.so=libw.so.1
+f lib/libxnet.so.1 0755 root bin
+s lib/libxnet.so=libxnet.so.1
+f lib/libzdoor.so.1 0755 root bin
+s lib/libzdoor.so=libzdoor.so.1
+f lib/libzfs.so.1 0755 root bin
+s lib/libzfs.so=libzfs.so.1
+s lib/libzfs_core.so.1=../usr/lib/libzfs_core.so
+s lib/libzfs_core.so=../usr/lib/libzfs_core.so
+d lib/mpxio 0755 root bin
+f lib/mpxio/stmsboot_util 0555 root bin
+f lib/nss_compat.so.1 0755 root bin
+f lib/nss_dns.so.1 0755 root bin
+f lib/nss_files.so.1 0755 root bin
+f lib/nss_nis.so.1 0755 root bin
+f lib/nss_user.so.1 0755 root bin
+d lib/secure 0755 root bin
+s lib/secure/32=.
+s lib/secure/64=amd64
+d lib/secure/amd64 0755 root bin
+d lib/svc 0755 root bin
+d lib/svc/bin 0755 root bin
+f lib/svc/bin/lsvcrun 0555 root sys
+f lib/svc/bin/mfstscan 0555 root sys
+f lib/svc/bin/restore_repository 0555 root sys
+f lib/svc/bin/sqlite 0555 root sys
+f lib/svc/bin/svc.configd 0555 root sys
+f lib/svc/bin/svc.ipfd 0555 root sys
+f lib/svc/bin/svc.startd 0555 root sys
+d lib/svc/capture 0755 root bin
+d lib/svc/manifest 0755 root sys
+d lib/svc/manifest/application 0755 root sys
+d lib/svc/manifest/application/security 0755 root sys
+d lib/svc/manifest/device 0755 root sys
+d lib/svc/manifest/milestone 0755 root sys
+f lib/svc/manifest/milestone/multi-user-server.xml 0444 root sys
+f lib/svc/manifest/milestone/multi-user.xml 0444 root sys
+f lib/svc/manifest/milestone/name-services.xml 0444 root sys
+f lib/svc/manifest/milestone/network.xml 0444 root sys
+f lib/svc/manifest/milestone/single-user.xml 0444 root sys
+f lib/svc/manifest/milestone/sysconfig.xml 0444 root sys
+d lib/svc/manifest/network 0755 root sys
+f lib/svc/manifest/network/bridge.xml 0444 root sys
+f lib/svc/manifest/network/dlmgmt.xml 0444 root sys
+d lib/svc/manifest/network/dns 0755 root sys
+f lib/svc/manifest/network/dns/client.xml 0444 root sys
+f lib/svc/manifest/network/dns/install.xml 0444 root sys
+f lib/svc/manifest/network/dns/multicast.xml 0444 root sys
+f lib/svc/manifest/network/forwarding.xml 0444 root sys
+f lib/svc/manifest/network/ibd-post-upgrade.xml 0444 root sys
+f lib/svc/manifest/network/inetd-upgrade.xml 0444 root sys
+f lib/svc/manifest/network/inetd.xml 0444 root sys
+d lib/svc/manifest/network/ipsec 0755 root sys
+f lib/svc/manifest/network/ipsec/ike.xml 0444 root sys
+f lib/svc/manifest/network/ipsec/ipsecalgs.xml 0444 root sys
+f lib/svc/manifest/network/ipsec/manual-key.xml 0444 root sys
+f lib/svc/manifest/network/ipsec/policy.xml 0444 root sys
+d lib/svc/manifest/network/iscsi 0755 root sys
+f lib/svc/manifest/network/iscsi/iscsi-initiator.xml 0444 root sys
+f lib/svc/manifest/network/iscsi/iscsi-target.xml 0444 root sys
+f lib/svc/manifest/network/isns_server.xml 0444 root sys
+d lib/svc/manifest/network/ldap 0755 root sys
+f lib/svc/manifest/network/ldap/client.xml 0444 root sys
+f lib/svc/manifest/network/lms.xml 0444 root sys
+d lib/svc/manifest/network/loadbalancer 0755 root sys
+f lib/svc/manifest/network/loadbalancer/ilbd.xml 0444 root sys
+f lib/svc/manifest/network/login.xml 0444 root sys
+f lib/svc/manifest/network/network-initial.xml 0444 root sys
+f lib/svc/manifest/network/network-install.xml 0444 root sys
+f lib/svc/manifest/network/network-ipmgmt.xml 0444 root sys
+f lib/svc/manifest/network/network-ipqos.xml 0444 root sys
+f lib/svc/manifest/network/network-iptun.xml 0444 root sys
+f lib/svc/manifest/network/network-location.xml 0444 root sys
+f lib/svc/manifest/network/network-loopback.xml 0444 root sys
+f lib/svc/manifest/network/network-netmask.xml 0444 root sys
+f lib/svc/manifest/network/network-routing-setup.xml 0444 root sys
+f lib/svc/manifest/network/network-service.xml 0444 root sys
+d lib/svc/manifest/network/nfs 0755 root sys
+f lib/svc/manifest/network/nfs/client.xml 0444 root sys
+f lib/svc/manifest/network/nfs/mapid.xml 0444 root sys
+f lib/svc/manifest/network/nfs/nlockmgr.xml 0444 root sys
+f lib/svc/manifest/network/nfs/server.xml 0444 root sys
+f lib/svc/manifest/network/nfs/status.xml 0444 root sys
+f lib/svc/manifest/network/npiv_config.xml 0444 root sys
+f lib/svc/manifest/network/rarp.xml 0444 root sys
+f lib/svc/manifest/network/rexec.xml 0444 root sys
+d lib/svc/manifest/network/routing 0755 root sys
+f lib/svc/manifest/network/routing/legacy-routing.xml 0444 root sys
+f lib/svc/manifest/network/routing/ndp.xml 0444 root sys
+f lib/svc/manifest/network/routing/rdisc.xml 0444 root sys
+f lib/svc/manifest/network/routing/ripng.xml 0444 root sys
+f lib/svc/manifest/network/routing/route.xml 0444 root sys
+d lib/svc/manifest/network/rpc 0755 root sys
+f lib/svc/manifest/network/rpc/bind.xml 0444 root sys
+f lib/svc/manifest/network/rpc/gss.xml 0444 root sys
+d lib/svc/manifest/network/security 0755 root sys
+f lib/svc/manifest/network/sendmail-client.xml 0444 root sys
+d lib/svc/manifest/network/shares 0755 root sys
+f lib/svc/manifest/network/shares/group.xml 0444 root sys
+f lib/svc/manifest/network/shares/reparsed.xml 0444 root sys
+f lib/svc/manifest/network/shell.xml 0444 root sys
+f lib/svc/manifest/network/slp.xml 0444 root sys
+d lib/svc/manifest/network/smb 0755 root sys
+f lib/svc/manifest/network/smb/client.xml 0444 root sys
+f lib/svc/manifest/network/smb/server.xml 0444 root sys
+f lib/svc/manifest/network/smtp-sendmail.xml 0444 root sys
+f lib/svc/manifest/network/ssh.xml 0444 root sys
+f lib/svc/manifest/network/time.xml 0444 root sys
+f lib/svc/manifest/network/vrrp.xml 0444 root sys
+d lib/svc/manifest/platform 0755 root sys
+d lib/svc/manifest/platform/i86pc 0755 root sys
+f lib/svc/manifest/platform/i86pc/acpihpd.xml 0444 root sys
+d lib/svc/manifest/platform/sun4u 0755 root sys
+d lib/svc/manifest/platform/sun4v 0755 root sys
+d lib/svc/manifest/site 0755 root sys
+d lib/svc/manifest/system 0755 root sys
+f lib/svc/manifest/system/auditset.xml 0444 root sys
+f lib/svc/manifest/system/boot-archive-update.xml 0444 root sys
+f lib/svc/manifest/system/boot-archive.xml 0444 root sys
+f lib/svc/manifest/system/boot-config.xml 0444 root sys
+f lib/svc/manifest/system/consadm.xml 0444 root sys
+f lib/svc/manifest/system/cron.xml 0444 root sys
+f lib/svc/manifest/system/cryptosvc.xml 0444 root sys
+d lib/svc/manifest/system/device 0755 root sys
+f lib/svc/manifest/system/device/allocate.xml 0444 root sys
+f lib/svc/manifest/system/device/devices-local.xml 0444 root sys
+f lib/svc/manifest/system/device/mpxio-upgrade.xml 0444 root sys
+f lib/svc/manifest/system/dumpadm.xml 0444 root sys
+f lib/svc/manifest/system/early-manifest-import.xml 0444 root sys
+f lib/svc/manifest/system/extended-accounting.xml 0444 root sys
+d lib/svc/manifest/system/filesystem 0755 root sys
+f lib/svc/manifest/system/filesystem/autofs.xml 0444 root sys
+f lib/svc/manifest/system/filesystem/local-fs.xml 0444 root sys
+f lib/svc/manifest/system/filesystem/root-fs.xml 0444 root sys
+f lib/svc/manifest/system/filesystem/usr-fs.xml 0444 root sys
+f lib/svc/manifest/system/filesystem/vscan.xml 0444 root sys
+f lib/svc/manifest/system/fmd.xml 0444 root sys
+f lib/svc/manifest/system/hostid.xml 0444 root sys
+f lib/svc/manifest/system/hotplug.xml 0444 root sys
+d lib/svc/manifest/system/ibsrp 0755 root sys
+f lib/svc/manifest/system/ibsrp/target.xml 0444 root sys
+f lib/svc/manifest/system/identity.xml 0444 root sys
+f lib/svc/manifest/system/idmap.xml 0444 root sys
+f lib/svc/manifest/system/intrd.xml 0444 root sys
+f lib/svc/manifest/system/keymap.xml 0444 root sys
+f lib/svc/manifest/system/labeld.xml 0444 root sys
+f lib/svc/manifest/system/logadm-upgrade.xml 0444 root sys
+f lib/svc/manifest/system/manifest-import.xml 0444 root sys
+f lib/svc/manifest/system/name-service-cache.xml 0444 root sys
+f lib/svc/manifest/system/ndmp.xml 0444 root sys
+f lib/svc/manifest/system/nws_ii.xml 0444 root sys
+f lib/svc/manifest/system/nws_rdc.xml 0444 root sys
+f lib/svc/manifest/system/nws_rdcsyncd.xml 0444 root sys
+f lib/svc/manifest/system/nws_scm.xml 0444 root sys
+f lib/svc/manifest/system/nws_sv.xml 0444 root sys
+f lib/svc/manifest/system/pfexecd.xml 0444 root sys
+f lib/svc/manifest/system/picl.xml 0444 root sys
+f lib/svc/manifest/system/poold.xml 0444 root sys
+f lib/svc/manifest/system/pools.xml 0444 root sys
+f lib/svc/manifest/system/power.xml 0444 root sys
+f lib/svc/manifest/system/rbac.xml 0444 root sys
+f lib/svc/manifest/system/rcap.xml 0444 root sys
+f lib/svc/manifest/system/resource-mgmt.xml 0444 root sys
+f lib/svc/manifest/system/rmtmpfiles.xml 0444 root sys
+f lib/svc/manifest/system/sac.xml 0444 root sys
+f lib/svc/manifest/system/sar.xml 0444 root sys
+f lib/svc/manifest/system/scheduler.xml 0444 root sys
+d lib/svc/manifest/system/security 0755 root sys
+f lib/svc/manifest/system/stmf.xml 0444 root sys
+d lib/svc/manifest/system/svc 0755 root sys
+f lib/svc/manifest/system/svc/global.xml 0444 root sys
+f lib/svc/manifest/system/svc/restarter.xml 0444 root sys
+f lib/svc/manifest/system/sysevent.xml 0444 root sys
+f lib/svc/manifest/system/system-log.xml 0444 root sys
+f lib/svc/manifest/system/utmp.xml 0444 root sys
+f lib/svc/manifest/system/vtdaemon.xml 0444 root sys
+f lib/svc/manifest/system/zones.xml 0444 root sys
+d lib/svc/method 0755 root bin
+f lib/svc/method/boot-archive 0555 root bin
+f lib/svc/method/boot-archive-update 0555 root bin
+f lib/svc/method/devices-audio 0555 root bin
+f lib/svc/method/devices-local 0555 root bin
+f lib/svc/method/dns-install 0555 root bin
+f lib/svc/method/fc-fabric 0555 root sys
+f lib/svc/method/fs-local 0555 root bin
+f lib/svc/method/fs-minimal 0555 root bin
+f lib/svc/method/ibd-post-upgrade 0555 root sys
+f lib/svc/method/identity-domain 0555 root bin
+f lib/svc/method/inetd-upgrade 0555 root bin
+f lib/svc/method/iscsi-initiator 0555 root sys
+f lib/svc/method/iscsi-target 0555 root sys
+f lib/svc/method/iscsid 0555 root sys
+f lib/svc/method/keymap 0555 root bin
+f lib/svc/method/ldap-client 0555 root bin
+f lib/svc/method/logadm-upgrade 0555 root bin
+f lib/svc/method/mpxio-upgrade 0555 root bin
+f lib/svc/method/net-init 0555 root bin
+f lib/svc/method/net-install 0555 root bin
+f lib/svc/method/net-ipmgmt 0555 root bin
+f lib/svc/method/net-ipqos 0555 root bin
+f lib/svc/method/net-iptun 0555 root bin
+f lib/svc/method/net-loc 0555 root bin
+f lib/svc/method/net-loopback 0555 root bin
+f lib/svc/method/net-netmask 0555 root bin
+f lib/svc/method/net-routing-setup 0555 root bin
+f lib/svc/method/net-svc 0555 root bin
+f lib/svc/method/nfs-client 0555 root bin
+f lib/svc/method/nfs-server 0555 root sys
+f lib/svc/method/nlockmgr 0555 root bin
+f lib/svc/method/npivconfig 0555 root sys
+f lib/svc/method/rmtmpfiles 0555 root bin
+f lib/svc/method/rpc-bind 0555 root bin
+f lib/svc/method/sendmail-client 0555 root sys
+f lib/svc/method/slp 0555 root sys
+f lib/svc/method/smb-client 0555 root sys
+f lib/svc/method/smtp-sendmail 0555 root sys
+f lib/svc/method/svc-acpihpd 0555 root sys
+f lib/svc/method/svc-allocate 0555 root bin
+f lib/svc/method/svc-auditd 0555 root bin
+f lib/svc/method/svc-auditset 0555 root bin
+f lib/svc/method/svc-autofs 0555 root bin
+f lib/svc/method/svc-boot-config 0555 root bin
+f lib/svc/method/svc-consadm 0555 root bin
+f lib/svc/method/svc-cron 0555 root bin
+f lib/svc/method/svc-dlmgmtd 0555 root bin
+f lib/svc/method/svc-dumpadm 0555 root sys
+f lib/svc/method/svc-fcoei 0555 root sys
+f lib/svc/method/svc-fcoet 0555 root sys
+f lib/svc/method/svc-forwarding 0555 root bin
+f lib/svc/method/svc-ftp 0555 root sys
+f lib/svc/method/svc-hostid 0555 root bin
+f lib/svc/method/svc-hotplug 0555 root bin
+f lib/svc/method/svc-ii 0744 root sys
+f lib/svc/method/svc-intrd 0555 root sys
+f lib/svc/method/svc-labeld 0555 root sys
+f lib/svc/method/svc-legacy-routing 0555 root bin
+f lib/svc/method/svc-lms 0555 root sys
+f lib/svc/method/svc-ndmp 0555 root sys
+f lib/svc/method/svc-ndp 0555 root bin
+f lib/svc/method/svc-nscd 0555 root bin
+f lib/svc/method/svc-poold 0555 root sys
+f lib/svc/method/svc-pools 0555 root sys
+f lib/svc/method/svc-power 0555 root sys
+f lib/svc/method/svc-rbac 0555 root bin
+f lib/svc/method/svc-rdc 0744 root sys
+f lib/svc/method/svc-rdcsyncd 0744 root sys
+f lib/svc/method/svc-rdisc 0555 root bin
+f lib/svc/method/svc-resource-mgmt 0555 root sys
+f lib/svc/method/svc-ripng 0555 root bin
+f lib/svc/method/svc-route 0555 root bin
+f lib/svc/method/svc-scheduler 0555 root sys
+f lib/svc/method/svc-scm 0744 root sys
+f lib/svc/method/svc-sockfilter 0555 root bin
+f lib/svc/method/svc-srpt 0555 root sys
+f lib/svc/method/svc-stmf 0555 root sys
+f lib/svc/method/svc-sv 0744 root sys
+f lib/svc/method/svc-syseventd 0555 root sys
+f lib/svc/method/svc-tnd 0555 root sys
+f lib/svc/method/svc-utmpd 0555 root bin
+f lib/svc/method/svc-vrrp 0555 root sys
+f lib/svc/method/svc-wusb 0555 root sys
+f lib/svc/method/svc-zones 0555 root sys
+f lib/svc/method/system-log 0555 root bin
+f lib/svc/method/vtdaemon 0555 root bin
+f lib/svc/method/yp 0555 root bin
+d lib/svc/monitor 0755 root bin
+d lib/svc/share 0755 root bin
+f lib/svc/share/README 0444 root bin
+f lib/svc/share/fs_include.sh 0444 root bin
+f lib/svc/share/ipf_include.sh 0444 root bin
+f lib/svc/share/mfsthistory 0444 root bin
+f lib/svc/share/net_include.sh 0444 root bin
+f lib/svc/share/routing_include.sh 0444 root bin
+f lib/svc/share/sendmail_include.sh 0444 root sys
+f lib/svc/share/smf_include.sh 0444 root bin
+d mnt 0755 root sys
+d opt 0755 root sys
+d platform 0755 root sys
+d platform/i86pc 0755 root sys
+d platform/i86pc/amd64 0755 root sys
+d platform/i86pc/kernel 0755 root sys
+d platform/i86pc/kernel/amd64 0755 root sys
+f platform/i86pc/kernel/amd64/unix 0755 root sys
+d platform/i86pc/kernel/cpu 0755 root sys
+d platform/i86pc/kernel/cpu/amd64 0755 root sys
+f platform/i86pc/kernel/cpu/amd64/cpu.generic 0755 root sys
+f platform/i86pc/kernel/cpu/amd64/cpu_ms.AuthenticAMD 0755 root sys
+f platform/i86pc/kernel/cpu/amd64/cpu_ms.AuthenticAMD.15 0755 root sys
+f platform/i86pc/kernel/cpu/amd64/cpu_ms.GenuineIntel 0755 root sys
+f platform/i86pc/kernel/cpu/amd64/cpu_ms.GenuineIntel.6.46 0755 root sys
+f platform/i86pc/kernel/cpu/amd64/cpu_ms.GenuineIntel.6.47 0755 root sys
+d platform/i86pc/kernel/dacf 0755 root sys
+d platform/i86pc/kernel/dacf/amd64 0755 root sys
+f platform/i86pc/kernel/dacf/amd64/consconfig_dacf 0755 root sys
+d platform/i86pc/kernel/drv 0755 root sys
+f platform/i86pc/kernel/drv/acpippm.conf 0644 root sys
+d platform/i86pc/kernel/drv/amd64 0755 root sys
+f platform/i86pc/kernel/drv/amd64/acpinex 0755 root sys
+f platform/i86pc/kernel/drv/amd64/acpippm 0755 root sys
+f platform/i86pc/kernel/drv/amd64/amd_iommu 0755 root sys
+f platform/i86pc/kernel/drv/amd64/cpc 0755 root sys
+f platform/i86pc/kernel/drv/amd64/cpudrv 0755 root sys
+f platform/i86pc/kernel/drv/amd64/dr 0755 root sys
+f platform/i86pc/kernel/drv/amd64/fipe 0755 root sys
+f platform/i86pc/kernel/drv/amd64/ioat 0755 root sys
+f platform/i86pc/kernel/drv/amd64/isa 0755 root sys
+f platform/i86pc/kernel/drv/amd64/npe 0755 root sys
+f platform/i86pc/kernel/drv/amd64/pci 0755 root sys
+f platform/i86pc/kernel/drv/amd64/pci-ide 0755 root sys
+f platform/i86pc/kernel/drv/amd64/pit_beep 0755 root sys
+f platform/i86pc/kernel/drv/amd64/ppm 0755 root sys
+f platform/i86pc/kernel/drv/amd64/rootnex 0755 root sys
+f platform/i86pc/kernel/drv/amd64/xsvc 0755 root sys
+f platform/i86pc/kernel/drv/amd_iommu.conf 0644 root sys
+f platform/i86pc/kernel/drv/cpc.conf 0644 root sys
+f platform/i86pc/kernel/drv/dr.conf 0644 root sys
+f platform/i86pc/kernel/drv/fipe.conf 0644 root sys
+f platform/i86pc/kernel/drv/ioat.conf 0644 root sys
+f platform/i86pc/kernel/drv/pci-ide.conf 0644 root sys
+f platform/i86pc/kernel/drv/pit_beep.conf 0644 root sys
+f platform/i86pc/kernel/drv/ppm.conf 0644 root sys
+f platform/i86pc/kernel/drv/rootnex.conf 0644 root sys
+f platform/i86pc/kernel/drv/xsvc.conf 0644 root sys
+d platform/i86pc/kernel/kmdb 0755 root sys
+d platform/i86pc/kernel/kmdb/amd64 0755 root sys
+f platform/i86pc/kernel/kmdb/amd64/apix 0555 root sys
+f platform/i86pc/kernel/kmdb/amd64/pcplusmp 0555 root sys
+f platform/i86pc/kernel/kmdb/amd64/unix 0555 root sys
+f platform/i86pc/kernel/kmdb/amd64/uppc 0555 root sys
+d platform/i86pc/kernel/mach 0755 root sys
+d platform/i86pc/kernel/mach/amd64 0755 root sys
+f platform/i86pc/kernel/mach/amd64/apix 0755 root sys
+f platform/i86pc/kernel/mach/amd64/pcplusmp 0755 root sys
+f platform/i86pc/kernel/mach/amd64/uppc 0755 root sys
+d platform/i86pc/kernel/misc 0755 root sys
+d platform/i86pc/kernel/misc/amd64 0755 root sys
+f platform/i86pc/kernel/misc/amd64/acpidev 0755 root sys
+f platform/i86pc/kernel/misc/amd64/cpr 0755 root sys
+f platform/i86pc/kernel/misc/amd64/drmach_acpi 0755 root sys
+d platform/i86pc/kernel/pcbe 0755 root sys
+d platform/i86pc/kernel/pcbe/amd64 0755 root sys
+f platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.15 0755 root sys
+f platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.5 0755 root sys
+f platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6 0755 root sys
+f platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.15 0755 root sys
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.23=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.26=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.28=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.29=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.30=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.31=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.37=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.44=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.45=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.46=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.47=pcbe.GenuineIntel.6.15
+s platform/i86pc/kernel/pcbe/amd64/pcbe.GenuineIntel.6.58=pcbe.GenuineIntel.6.15
+d platform/i86pc/kernel/sys 0755 root sys
+d platform/i86pc/kernel/sys/amd64 0755 root sys
+f platform/i86pc/kernel/sys/amd64/cpc 0755 root sys
+f platform/i86pc/multiboot 0755 root sys
+d platform/i86pc/ucode 0755 root sys
+f platform/i86pc/ucode/amd-ucode.bin 0444 root sys
+f platform/i86pc/ucode/intel-ucode.txt 0444 root sys
+d proc 0755 root root
+d sbin 0755 root sys
+f sbin/autopush 0555 root bin
+f sbin/biosdev 0555 root bin
+f sbin/bootadm 0555 root bin
+f sbin/cryptoadm 0555 root bin
+f sbin/devprop 0555 root bin
+f sbin/dhcpagent 0555 root bin
+f sbin/dhcpinfo 0555 root bin
+f sbin/dladm 0555 root bin
+f sbin/dlmgmtd 0555 root bin
+f sbin/dlstat 0555 root bin
+f sbin/fdisk 0555 root bin
+f sbin/fiocompress 0555 root bin
+f sbin/flowadm 0555 root bin
+f sbin/flowstat 0555 root bin
+f sbin/hostconfig 0555 root bin
+f sbin/ibd_delete_link 0555 root bin
+f sbin/ibd_upgrade 0555 root bin
+f sbin/ifconfig 0555 root bin
+f sbin/ifparse 0555 root bin
+s sbin/in.mpathd=../lib/inet/in.mpathd
+f sbin/init 0555 root sys
+f sbin/installgrub 0555 root sys
+f sbin/ipadm 0555 root bin
+f sbin/ipmpstat 0555 root bin
+s sbin/jsh=../usr/bin/ksh93
+f sbin/mount 0555 root bin
+f sbin/mountall 0555 root sys
+f sbin/netstrategy 0555 root bin
+s sbin/pfsh=../usr/bin/pfexec
+f sbin/rc0 0744 root sys
+f sbin/rc1 0744 root sys
+f sbin/rc2 0744 root sys
+f sbin/rc3 0744 root sys
+h sbin/rc5=sbin/rc0
+h sbin/rc6=sbin/rc0
+f sbin/rcS 0744 root sys
+f sbin/route 0555 root bin
+f sbin/routeadm 0555 root bin
+s sbin/sh=../usr/bin/i86/ksh93
+f sbin/soconfig 0555 root bin
+f sbin/su.static 0555 root sys
+s sbin/su=../usr/bin/su
+f sbin/sulogin 0555 root bin
+f sbin/svcadm 0555 root bin
+f sbin/swapadd 0744 root sys
+f sbin/sync 0555 root bin
+f sbin/tzreload 0555 root bin
+f sbin/uadmin 0555 root sys
+f sbin/umount 0555 root bin
+f sbin/umountall 0555 root sys
+f sbin/uname 0555 root bin
+f sbin/wusbadm 0555 root bin
+f sbin/zfs 0555 root bin
+f sbin/zonename 0555 root bin
+f sbin/zpool 0555 root bin
+d system 0755 root root
+d system/boot 0755 root root
+d system/contract 0555 root root
+d system/object 0555 root root
+d tmp 1777 root root
+d usr 0755 root sys
+s usr/adm=../var/adm
+d usr/bin 0755 root bin
+h usr/bin/[=usr/bin/alias
+f usr/bin/addbadsec 0555 root bin
+f usr/bin/alias 0555 root bin
+d usr/bin/amd64 0755 root bin
+f usr/bin/amd64/amt 0555 root bin
+f usr/bin/amd64/cputrack 0555 root bin
+f usr/bin/amd64/crle 0555 root bin
+h usr/bin/amd64/decrypt=usr/bin/amd64/encrypt
+h usr/bin/amd64/digest=usr/bin/amd64/mac
+f usr/bin/amd64/elfdump 0555 root bin
+f usr/bin/amd64/elfedit 0555 root bin
+f usr/bin/amd64/elfwrap 0555 root bin
+f usr/bin/amd64/encrypt 0555 root bin
+f usr/bin/amd64/gcore 0555 root bin
+f usr/bin/amd64/ksh93 0555 root bin
+h usr/bin/amd64/ksh=usr/bin/amd64/ksh93
+f usr/bin/amd64/ld 0755 root bin
+f usr/bin/amd64/ldd 0555 root bin
+f usr/bin/amd64/ls 0555 root bin
+f usr/bin/amd64/mac 0555 root bin
+f usr/bin/amd64/mcs 0555 root bin
+f usr/bin/amd64/mdb 0555 root bin
+f usr/bin/amd64/moe 0555 root bin
+f usr/bin/amd64/newtask 4555 root sys
+f usr/bin/amd64/nohup 0555 root bin
+f usr/bin/amd64/pargs 0555 root bin
+f usr/bin/amd64/pcred 0555 root bin
+f usr/bin/amd64/pfiles 0555 root bin
+f usr/bin/amd64/pflags 0555 root bin
+f usr/bin/amd64/pldd 0555 root bin
+f usr/bin/amd64/plgrp 0555 root bin
+f usr/bin/amd64/plimit 0555 root bin
+f usr/bin/amd64/pmadvise 0555 root bin
+f usr/bin/amd64/pmap 0555 root bin
+f usr/bin/amd64/ppgsz 0555 root bin
+f usr/bin/amd64/ppriv 0555 root bin
+f usr/bin/amd64/prctl 0555 root bin
+f usr/bin/amd64/preap 0555 root bin
+f usr/bin/amd64/prstat 0555 root bin
+f usr/bin/amd64/prun 0555 root bin
+f usr/bin/amd64/ps 0555 root bin
+f usr/bin/amd64/psig 0555 root bin
+f usr/bin/amd64/pstack 0555 root bin
+f usr/bin/amd64/pstop 0555 root bin
+f usr/bin/amd64/ptime 0555 root bin
+f usr/bin/amd64/ptree 0555 root bin
+f usr/bin/amd64/pvs 0555 root bin
+f usr/bin/amd64/pwait 0555 root bin
+f usr/bin/amd64/pwdx 0555 root bin
+h usr/bin/amd64/rksh93=usr/bin/amd64/ksh93
+h usr/bin/amd64/rksh=usr/bin/amd64/ksh93
+f usr/bin/amd64/savecore 0555 root bin
+f usr/bin/amd64/setuname 0555 root bin
+f usr/bin/amd64/sort 0555 root bin
+f usr/bin/amd64/strings 0555 root bin
+f usr/bin/amd64/truss 0555 root bin
+h usr/bin/amd64/uptime=usr/bin/amd64/w
+f usr/bin/amd64/w 4555 root bin
+f usr/bin/amt 0555 root bin
+h usr/bin/apropos=usr/bin/man
+f usr/bin/ar 0555 root bin
+f usr/bin/arch 0555 root bin
+f usr/bin/arcstat 0555 root bin
+f usr/bin/asa 0555 root bin
+f usr/bin/at 4755 root sys
+f usr/bin/atq 4755 root sys
+f usr/bin/atrm 4755 root sys
+f usr/bin/auths 0555 root bin
+h usr/bin/awk=usr/bin/nawk
+f usr/bin/banner 0555 root bin
+f usr/bin/bart 0555 root bin
+f usr/bin/basename 0555 root bin
+f usr/bin/batch 0555 root bin
+f usr/bin/bc 0555 root bin
+f usr/bin/bdiff 0755 root bin
+f usr/bin/bfs 0555 root bin
+h usr/bin/bg=usr/bin/alias
+f usr/bin/busstat 0555 root bin
+f usr/bin/cal 0555 root bin
+f usr/bin/calendar 0555 root bin
+f usr/bin/captoinfo 0555 root bin
+f usr/bin/cat 0555 root bin
+h usr/bin/catman=usr/bin/man
+h usr/bin/cd=usr/bin/alias
+f usr/bin/checkeq 0555 root bin
+f usr/bin/checknr 0555 root bin
+f usr/bin/chgrp 0555 root bin
+f usr/bin/chkey 4555 root sys
+f usr/bin/chmod 0555 root bin
+f usr/bin/chown 0555 root bin
+f usr/bin/ckdate 0555 root bin
+f usr/bin/ckgid 0555 root bin
+f usr/bin/ckint 0555 root bin
+f usr/bin/ckitem 0555 root bin
+f usr/bin/ckkeywd 0555 root bin
+f usr/bin/ckpath 0555 root bin
+f usr/bin/ckrange 0555 root bin
+f usr/bin/ckstr 0555 root bin
+h usr/bin/cksum=usr/bin/alias
+f usr/bin/cktime 0555 root bin
+f usr/bin/ckuid 0555 root bin
+f usr/bin/ckyorn 0555 root bin
+f usr/bin/clear 0555 root bin
+h usr/bin/cmp=usr/bin/alias
+f usr/bin/col 0555 root bin
+f usr/bin/column 0555 root bin
+h usr/bin/comm=usr/bin/alias
+h usr/bin/command=usr/bin/alias
+f usr/bin/compress 0555 root bin
+f usr/bin/coreadm 0555 root bin
+f usr/bin/cp 0555 root bin
+f usr/bin/cpio 0555 root bin
+h usr/bin/cputrack=usr/lib/isaexec
+f usr/bin/crle 0555 root bin
+f usr/bin/crontab 4555 root bin
+f usr/bin/crypt 0555 root bin
+f usr/bin/csh 0555 root bin
+f usr/bin/csplit 0555 root bin
+f usr/bin/ctags 0555 root bin
+f usr/bin/ctrun 0555 root bin
+f usr/bin/ctstat 0555 root bin
+f usr/bin/ctwatch 0555 root bin
+h usr/bin/cut=usr/bin/alias
+f usr/bin/date 0555 root bin
+f usr/bin/dc 0555 root bin
+f usr/bin/dd 0555 root bin
+h usr/bin/decrypt=usr/lib/isaexec
+f usr/bin/deroff 0555 root bin
+f usr/bin/devattr 0555 root bin
+f usr/bin/devfree 0555 root bin
+f usr/bin/devreserv 0555 root bin
+s usr/bin/df=../sbin/df
+f usr/bin/diff 0555 root bin
+f usr/bin/diff3 0555 root bin
+f usr/bin/diffmk 0555 root bin
+h usr/bin/digest=usr/lib/isaexec
+f usr/bin/dircmp 0555 root bin
+f usr/bin/dirname 0555 root bin
+f usr/bin/dis 0555 root bin
+f usr/bin/diskscan 0555 root bin
+h usr/bin/dispgid=usr/bin/ckgid
+h usr/bin/dispuid=usr/bin/ckuid
+s usr/bin/dmesg=../sbin/dmesg
+f usr/bin/dns-sd 0555 root bin
+f usr/bin/domainname 0555 root bin
+f usr/bin/dos2unix 0555 root bin
+f usr/bin/du 0555 root bin
+f usr/bin/dump 0555 root bin
+f usr/bin/dumpcs 0555 root bin
+f usr/bin/dumpkeys 0555 root bin
+f usr/bin/echo 0555 root bin
+f usr/bin/ed 0555 root bin
+f usr/bin/edit 0555 root bin
+f usr/bin/egrep 0555 root bin
+f usr/bin/eject 0555 root bin
+h usr/bin/elfdump=usr/lib/isaexec
+f usr/bin/elfedit 0555 root bin
+f usr/bin/elfsign 0555 root bin
+f usr/bin/elfwrap 0555 root bin
+h usr/bin/encrypt=usr/lib/isaexec
+f usr/bin/enhance 0555 root bin
+f usr/bin/env 0555 root bin
+f usr/bin/eqn 0555 root bin
+f usr/bin/expand 0555 root bin
+f usr/bin/expr 0555 root bin
+f usr/bin/exstr 0555 root bin
+f usr/bin/factor 0555 root bin
+f usr/bin/false 0555 root bin
+h usr/bin/fc=usr/bin/alias
+f usr/bin/fdetach 0555 root bin
+f usr/bin/fdformat 4555 root bin
+h usr/bin/fg=usr/bin/alias
+f usr/bin/fgrep 0555 root bin
+f usr/bin/file 0555 root bin
+f usr/bin/filesync 0555 root bin
+f usr/bin/find 0555 root bin
+f usr/bin/fmt 0555 root bin
+f usr/bin/fmtmsg 0555 root bin
+f usr/bin/fold 0555 root bin
+f usr/bin/fsstat 0555 root bin
+f usr/bin/ftp 0555 root bin
+h usr/bin/gcore=usr/lib/isaexec
+f usr/bin/gencat 0555 root bin
+f usr/bin/geniconvtbl 0555 root bin
+f usr/bin/genmsg 0555 root bin
+f usr/bin/getconf 0555 root bin
+f usr/bin/getdev 0555 root bin
+f usr/bin/getdgrp 0555 root bin
+f usr/bin/getent 0555 root bin
+f usr/bin/getfacl 0555 root bin
+f usr/bin/getopt 0555 root bin
+h usr/bin/getopts=usr/bin/alias
+f usr/bin/gettext 0555 root bin
+f usr/bin/gettxt 0555 root bin
+f usr/bin/getvol 0555 root bin
+f usr/bin/grep 0555 root bin
+f usr/bin/groups 0555 root bin
+h usr/bin/hash=usr/bin/alias
+f usr/bin/head 0555 root bin
+f usr/bin/hostid 0555 root bin
+f usr/bin/hostname 0555 root bin
+h usr/bin/i286=usr/bin/sun
+h usr/bin/i386=usr/bin/sun
+h usr/bin/i486=usr/bin/sun
+d usr/bin/i86 0755 root bin
+f usr/bin/i86/ksh93 0555 root bin
+f usr/bin/i86/mdb 0555 root bin
+h usr/bin/i86pc=usr/bin/sun
+f usr/bin/iconv 0555 root bin
+f usr/bin/id 0555 root bin
+f usr/bin/infocmp 0555 root bin
+f usr/bin/iostat 0555 root bin
+f usr/bin/ipcrm 0555 root bin
+f usr/bin/ipcs 0555 root bin
+f usr/bin/isainfo 0555 root bin
+f usr/bin/isalist 0555 root bin
+h usr/bin/jobs=usr/bin/alias
+h usr/bin/join=usr/bin/alias
+s usr/bin/jsh=ksh93
+f usr/bin/kbd 0555 root bin
+f usr/bin/kdestroy 0555 root bin
+f usr/bin/keylogin 0555 root bin
+f usr/bin/keylogout 0555 root bin
+h usr/bin/kill=usr/bin/alias
+f usr/bin/kinit 0555 root bin
+f usr/bin/klist 0555 root bin
+f usr/bin/kmfcfg 0555 root bin
+f usr/bin/kpasswd 0555 root bin
+f usr/bin/krb5-config 0555 root bin
+h usr/bin/ksh93=usr/lib/isaexec
+h usr/bin/ksh=usr/lib/isaexec
+f usr/bin/kstat 0555 root bin
+f usr/bin/ktutil 0555 root bin
+f usr/bin/kvmstat 0555 root bin
+f usr/bin/last 0555 root bin
+f usr/bin/lastcomm 0555 root bin
+f usr/bin/ld 0755 root bin
+f usr/bin/ldapadd 0555 root bin
+f usr/bin/ldapdelete 0555 root bin
+f usr/bin/ldaplist 0555 root bin
+h usr/bin/ldapmodify=usr/bin/ldapadd
+f usr/bin/ldapmodrdn 0555 root bin
+f usr/bin/ldapsearch 0555 root bin
+f usr/bin/ldd 0555 root bin
+f usr/bin/lgrpinfo 0555 root bin
+f usr/bin/line 0555 root bin
+f usr/bin/listdgrp 0555 root bin
+f usr/bin/listusers 0555 root bin
+h usr/bin/ln=usr/bin/cp
+f usr/bin/loadkeys 0555 root bin
+f usr/bin/locale 0555 root bin
+f usr/bin/logger 0555 root bin
+f usr/bin/login 4555 root bin
+f usr/bin/logins 0750 root bin
+h usr/bin/logname=usr/bin/alias
+f usr/bin/look 0755 root bin
+f usr/bin/lorder 0555 root bin
+# We want ls to be the 32bit binary (not a link to isaexec) so we don't blow
+# out memory sorting entries - we just die if we need too much memory. This
+# also matches the setup on a stock solaris box.
+f usr/bin/ls 0555 root bin
+f usr/bin/m4 0555 root bin
+f usr/bin/m68k 0555 root bin
+h usr/bin/mac=usr/lib/isaexec
+f usr/bin/mach 0555 root bin
+f usr/bin/mail 2511 root mail
+f usr/bin/mailx 2511 root mail
+f usr/bin/makedev 0555 root bin
+f usr/bin/man 0555 root bin
+f usr/bin/mcs 0555 root bin
+h usr/bin/mdb=usr/lib/isaexec
+f usr/bin/mesg 0555 root bin
+f usr/bin/mkdir 0555 root bin
+f usr/bin/mkfifo 0555 root bin
+f usr/bin/mkmsgs 0555 root root
+f usr/bin/mkpwdict 0555 root bin
+f usr/bin/mktemp 0555 root bin
+f usr/bin/moe 0555 root bin
+f usr/bin/more 0555 root bin
+f usr/bin/mpstat 0555 root bin
+f usr/bin/msgfmt 0555 root bin
+f usr/bin/mt 0555 root bin
+h usr/bin/mv=usr/bin/cp
+f usr/bin/nawk 0555 root bin
+f usr/bin/nc 0555 root bin
+f usr/bin/neqn 0555 root bin
+f usr/bin/netstat 0555 root bin
+f usr/bin/newform 0555 root bin
+f usr/bin/newgrp 4755 root sys
+f usr/bin/news 0555 root bin
+h usr/bin/newtask=usr/lib/isaexec
+f usr/bin/nfsstat 0555 root bin
+f usr/bin/nice 0555 root bin
+f usr/bin/nicstat 0555 root bin
+f usr/bin/nl 0555 root bin
+f usr/bin/nm 0555 root bin
+h usr/bin/nohup=usr/lib/isaexec
+f usr/bin/nroff 0555 root bin
+f usr/bin/od 0555 root bin
+f usr/bin/on 0555 root bin
+f usr/bin/optisa 0555 root bin
+f usr/bin/pack 0555 root bin
+h usr/bin/page=usr/bin/more
+f usr/bin/pagesize 0555 root bin
+h usr/bin/pargs=usr/lib/isaexec
+f usr/bin/passwd 6555 root sys
+h usr/bin/paste=usr/bin/alias
+f usr/bin/pathchk 0555 root bin
+f usr/bin/pax 0555 root bin
+s usr/bin/pcat=unpack
+h usr/bin/pcred=usr/lib/isaexec
+s usr/bin/perl=/opt/local/bin/perl
+h usr/bin/pfbash=usr/bin/pfexec
+h usr/bin/pfcsh=usr/bin/pfexec
+f usr/bin/pfexec 0555 root bin
+h usr/bin/pfiles=usr/lib/isaexec
+h usr/bin/pfksh93=usr/bin/pfexec
+h usr/bin/pfksh=usr/bin/pfexec
+h usr/bin/pflags=usr/lib/isaexec
+h usr/bin/pfrksh93=usr/bin/pfexec
+h usr/bin/pfrksh=usr/bin/pfexec
+h usr/bin/pfsh=usr/bin/pfexec
+h usr/bin/pftcsh=usr/bin/pfexec
+h usr/bin/pfzsh=usr/bin/pfexec
+f usr/bin/pg 0555 root bin
+f usr/bin/pginfo 0555 root bin
+f usr/bin/pgrep 0555 root bin
+f usr/bin/pgstat 0555 root bin
+f usr/bin/pkgtrans 0555 root bin
+h usr/bin/pkill=usr/bin/pgrep
+f usr/bin/pktool 0555 root bin
+h usr/bin/pldd=usr/lib/isaexec
+h usr/bin/plgrp=usr/lib/isaexec
+h usr/bin/plimit=usr/lib/isaexec
+h usr/bin/pmadvise=usr/lib/isaexec
+h usr/bin/pmap=usr/lib/isaexec
+f usr/bin/poolstat 0555 root bin
+h usr/bin/ppgsz=usr/lib/isaexec
+h usr/bin/ppriv=usr/lib/isaexec
+f usr/bin/pr 0555 root bin
+h usr/bin/prctl=usr/lib/isaexec
+h usr/bin/preap=usr/lib/isaexec
+h usr/bin/print=usr/bin/alias
+f usr/bin/printf 0555 root bin
+f usr/bin/priocntl 0555 root bin
+f usr/bin/profiles 0555 root bin
+f usr/bin/projects 0555 root bin
+h usr/bin/prstat=usr/lib/isaexec
+h usr/bin/prun=usr/lib/isaexec
+h usr/bin/ps=usr/lib/isaexec
+h usr/bin/psig=usr/lib/isaexec
+h usr/bin/pstack=usr/lib/isaexec
+h usr/bin/pstop=usr/lib/isaexec
+h usr/bin/ptime=usr/lib/isaexec
+h usr/bin/ptree=usr/lib/isaexec
+f usr/bin/putdev 0555 root bin
+f usr/bin/putdgrp 0555 root bin
+f usr/bin/pvs 0555 root bin
+h usr/bin/pwait=usr/lib/isaexec
+s usr/bin/pwconv=../sbin/pwconv
+f usr/bin/pwd 0555 root bin
+h usr/bin/pwdx=usr/lib/isaexec
+f usr/bin/rcapstat 0555 root bin
+f usr/bin/rcp 4555 root bin
+f usr/bin/rdate 0555 root bin
+f usr/bin/rdist 4555 root bin
+h usr/bin/read=usr/bin/alias
+f usr/bin/red 0555 root bin
+f usr/bin/refer 0555 root bin
+f usr/bin/regcmp 0555 root bin
+s usr/bin/remsh=rsh
+f usr/bin/renice 0555 root bin
+h usr/bin/rev=usr/bin/alias
+h usr/bin/rksh93=usr/lib/isaexec
+h usr/bin/rksh=usr/lib/isaexec
+f usr/bin/rlogin 4555 root bin
+f usr/bin/rm 0555 root bin
+s usr/bin/rmail=mail
+f usr/bin/rmdir 0555 root bin
+f usr/bin/rmformat 0555 root bin
+f usr/bin/roles 0555 root bin
+f usr/bin/rpcinfo 0555 root bin
+f usr/bin/rsh 4555 root bin
+f usr/bin/runat 0555 root bin
+f usr/bin/rup 0555 root bin
+f usr/bin/ruptime 0555 root bin
+f usr/bin/rusers 0555 root bin
+h usr/bin/savecore=usr/lib/isaexec
+f usr/bin/scp 0555 root bin
+f usr/bin/script 0555 root bin
+f usr/bin/sdiff 0555 root bin
+f usr/bin/sed 0555 root bin
+f usr/bin/setfacl 0555 root bin
+f usr/bin/setpgrp 0555 root sys
+h usr/bin/settime=usr/bin/touch
+h usr/bin/setuname=usr/lib/isaexec
+f usr/bin/sftp 0555 root bin
+s usr/bin/sh=ksh93
+f usr/bin/shcomp 0555 root bin
+f usr/bin/size 0555 root bin
+h usr/bin/sleep=usr/bin/alias
+f usr/bin/smbutil 0555 root bin
+f usr/bin/soelim 0555 root bin
+h usr/bin/sort=usr/lib/isaexec
+f usr/bin/sotruss 0755 root bin
+h usr/bin/sparc=usr/bin/sun
+f usr/bin/spell 0555 root bin
+f usr/bin/split 0555 root bin
+f usr/bin/srchtxt 0555 root bin
+f usr/bin/ssh 0555 root bin
+f usr/bin/ssh-add 0555 root bin
+f usr/bin/ssh-agent 0555 root bin
+f usr/bin/ssh-keygen 0555 root bin
+f usr/bin/ssh-keyscan 0555 root bin
+s usr/bin/strace=../sbin/strace
+f usr/bin/strchg 0555 root root
+s usr/bin/strclean=../sbin/strclean
+f usr/bin/strconf 0555 root root
+s usr/bin/strerr=../sbin/strerr
+h usr/bin/strings=usr/lib/isaexec
+f usr/bin/strip 0555 root bin
+f usr/bin/stty 0555 root bin
+f usr/bin/su 4555 root sys
+h usr/bin/sum=usr/bin/alias
+f usr/bin/sun 0555 root bin
+h usr/bin/sun2=usr/bin/sun
+h usr/bin/sun3=usr/bin/sun
+h usr/bin/sun3x=usr/bin/sun
+h usr/bin/sun4=usr/bin/sun
+h usr/bin/sun4c=usr/bin/sun
+h usr/bin/sun4d=usr/bin/sun
+h usr/bin/sun4e=usr/bin/sun
+h usr/bin/sun4m=usr/bin/sun
+f usr/bin/svcprop 0555 root bin
+f usr/bin/svcs 0555 root bin
+s usr/bin/sync=../../sbin/sync
+f usr/bin/ta 0555 root bin
+f usr/bin/tabs 0555 root bin
+f usr/bin/tail 0555 root bin
+s usr/bin/tar=../sbin/tar
+f usr/bin/tbl 0555 root bin
+f usr/bin/tcopy 0555 root bin
+h usr/bin/tee=usr/bin/alias
+f usr/bin/telnet 0555 root bin
+h usr/bin/test=usr/bin/alias
+f usr/bin/tic 0555 root bin
+f usr/bin/time 0555 root bin
+f usr/bin/timex 0555 root bin
+f usr/bin/tip 4511 uucp bin
+f usr/bin/touch 0555 root bin
+f usr/bin/tput 0555 root bin
+f usr/bin/tr 0555 root bin
+f usr/bin/troff 0555 root bin
+f usr/bin/true 0555 root bin
+h usr/bin/truss=usr/lib/isaexec
+f usr/bin/tsort 0555 root bin
+f usr/bin/tty 0555 root bin
+h usr/bin/type=usr/bin/alias
+f usr/bin/tzselect 0555 root bin
+f usr/bin/ul 0555 root bin
+h usr/bin/ulimit=usr/bin/alias
+h usr/bin/umask=usr/bin/alias
+h usr/bin/unalias=usr/bin/alias
+s usr/bin/uname=../../sbin/uname
+f usr/bin/uncompress 0555 root bin
+f usr/bin/unexpand 0555 root bin
+h usr/bin/uniq=usr/bin/alias
+f usr/bin/units 0555 root bin
+f usr/bin/unix2dos 0555 root bin
+f usr/bin/unpack 0555 root bin
+h usr/bin/uptime=usr/lib/isaexec
+f usr/bin/userattr 0555 root bin
+f usr/bin/uudecode 0555 root uucp
+f usr/bin/uuencode 0555 root uucp
+h usr/bin/vedit=usr/bin/edit
+f usr/bin/vfsstat 0555 root bin
+f usr/bin/vgrind 0555 root bin
+f usr/bin/vmstat 0555 root bin
+h usr/bin/w=usr/lib/isaexec
+h usr/bin/wait=usr/bin/alias
+h usr/bin/wc=usr/bin/alias
+h usr/bin/whatis=usr/bin/man
+f usr/bin/which 0555 root bin
+f usr/bin/who 0555 root bin
+f usr/bin/whocalls 0755 root bin
+f usr/bin/whois 0555 root bin
+f usr/bin/wracct 0555 root bin
+f usr/bin/write 2555 root tty
+s usr/bin/wtf=man
+f usr/bin/xargs 0555 root bin
+f usr/bin/xgettext 0555 root bin
+f usr/bin/xstr 0555 root bin
+f usr/bin/yes 0555 root bin
+f usr/bin/ypcat 0555 root other
+f usr/bin/ypmatch 0555 root other
+f usr/bin/yppasswd 0555 root bin
+f usr/bin/ypwhich 0555 root other
+f usr/bin/zcat 0555 root bin
+f usr/bin/ziostat 0555 root bin
+s usr/bin/zonename=../../sbin/zonename
+d usr/ccs 0755 root bin
+d usr/ccs/bin 0755 root bin
+d usr/ccs/bin/amd64 0755 root bin
+s usr/ccs/bin/amd64/ld=../../../bin/amd64/ld
+s usr/ccs/bin/ar=../../bin/ar
+s usr/ccs/bin/ld=../../bin/ld
+s usr/ccs/bin/m4=../../bin/m4
+s usr/ccs/bin/regcmp=../../bin/regcmp
+d usr/ccs/lib 0755 root bin
+d usr/ccs/lib/amd64 0755 root bin
+s usr/ccs/lib/amd64/libcurses.so.1=../../../../lib/amd64/libcurses.so.1
+s usr/ccs/lib/amd64/libform.so.1=../../../lib/amd64/libform.so.1
+s usr/ccs/lib/amd64/libgen.so.1=../../../../lib/amd64/libgen.so.1
+s usr/ccs/lib/amd64/libl.so.1=../../../lib/amd64/libl.so.1
+s usr/ccs/lib/amd64/libmalloc.so.1=../../../lib/amd64/libmalloc.so.1
+s usr/ccs/lib/amd64/libmenu.so.1=../../../lib/amd64/libmenu.so.1
+s usr/ccs/lib/amd64/libpanel.so.1=../../../lib/amd64/libpanel.so.1
+s usr/ccs/lib/amd64/libtermcap.so.1=../../../../lib/amd64/libtermcap.so.1
+s usr/ccs/lib/amd64/libtermlib.so.1=../../../../lib/amd64/libcurses.so.1
+s usr/ccs/lib/amd64/liby.so.1=../../../lib/amd64/liby.so.1
+s usr/ccs/lib/libcurses.so.1=../../../lib/libcurses.so.1
+s usr/ccs/lib/libform.so.1=../../lib/libform.so.1
+s usr/ccs/lib/libgen.so.1=../../../lib/libgen.so.1
+s usr/ccs/lib/libl.so.1=../../lib/libl.so.1
+s usr/ccs/lib/libmalloc.so.1=../../lib/libmalloc.so.1
+s usr/ccs/lib/libmenu.so.1=../../lib/libmenu.so.1
+s usr/ccs/lib/libpanel.so.1=../../lib/libpanel.so.1
+s usr/ccs/lib/libtermcap.so.1=../../../lib/libtermcap.so.1
+s usr/ccs/lib/libtermlib.so.1=../../../lib/libcurses.so.1
+s usr/ccs/lib/liby.so.1=../../lib/liby.so.1
+s usr/ccs/lib/link_audit=../../lib/link_audit
+s usr/dict=share/lib/dict
+d usr/gnu 0755 root bin
+d usr/gnu/bin 0755 root bin
+d usr/gnu/lib 0755 root bin
+d usr/gnu/share 0755 root sys
+d usr/gnu/share/man 0755 root bin
+d usr/gnu/share/man/man1 0755 root bin
+d usr/gnu/share/man/man3 0755 root bin
+d usr/gnu/share/man/man5 0755 root bin
+d usr/gnu/share/man/man7 0755 root bin
+d usr/has 0755 root bin
+d usr/has/man 0755 root bin
+d usr/has/man/man1has 0755 root bin
+f usr/has/man/man1has/edit.1has 0444 root bin
+f usr/has/man/man1has/vi.1has 0444 root bin
+d usr/include 0755 root bin
+f usr/include/aclutils.h 0644 root bin
+f usr/include/aio.h 0644 root bin
+f usr/include/alloca.h 0644 root bin
+d usr/include/amd64 0755 root bin
+d usr/include/amd64/sys 0755 root bin
+f usr/include/amd64/sys/kdi_regs.h 0644 root bin
+f usr/include/amd64/sys/privmregs.h 0644 root bin
+f usr/include/amd64/sys/privregs.h 0644 root bin
+f usr/include/apptrace.h 0644 root bin
+f usr/include/apptrace_impl.h 0644 root bin
+f usr/include/ar.h 0644 root bin
+f usr/include/archives.h 0644 root bin
+d usr/include/arpa 0755 root bin
+f usr/include/arpa/ftp.h 0644 root bin
+f usr/include/arpa/inet.h 0644 root bin
+f usr/include/arpa/nameser.h 0644 root bin
+f usr/include/arpa/nameser_compat.h 0644 root bin
+f usr/include/arpa/telnet.h 0644 root bin
+f usr/include/arpa/tftp.h 0644 root bin
+d usr/include/asm 0755 root bin
+f usr/include/asm/atomic.h 0644 root bin
+f usr/include/asm/bitmap.h 0644 root bin
+f usr/include/asm/byteorder.h 0644 root bin
+f usr/include/asm/clock.h 0644 root bin
+f usr/include/asm/cpu.h 0644 root bin
+f usr/include/asm/cpuvar.h 0644 root bin
+f usr/include/asm/htable.h 0644 root bin
+f usr/include/asm/mmu.h 0644 root bin
+f usr/include/asm/sunddi.h 0644 root bin
+f usr/include/asm/thread.h 0644 root bin
+f usr/include/assert.h 0644 root bin
+d usr/include/ast 0755 root bin
+f usr/include/ast/align.h 0644 root bin
+f usr/include/ast/ast.h 0644 root bin
+f usr/include/ast/ast_botch.h 0644 root bin
+f usr/include/ast/ast_ccode.h 0644 root bin
+f usr/include/ast/ast_common.h 0644 root bin
+f usr/include/ast/ast_dir.h 0644 root bin
+f usr/include/ast/ast_dirent.h 0644 root bin
+f usr/include/ast/ast_fcntl.h 0644 root bin
+f usr/include/ast/ast_float.h 0644 root bin
+f usr/include/ast/ast_fs.h 0644 root bin
+f usr/include/ast/ast_getopt.h 0644 root bin
+f usr/include/ast/ast_iconv.h 0644 root bin
+f usr/include/ast/ast_lib.h 0644 root bin
+f usr/include/ast/ast_limits.h 0644 root bin
+f usr/include/ast/ast_map.h 0644 root bin
+f usr/include/ast/ast_mmap.h 0644 root bin
+f usr/include/ast/ast_mode.h 0644 root bin
+f usr/include/ast/ast_namval.h 0644 root bin
+f usr/include/ast/ast_ndbm.h 0644 root bin
+f usr/include/ast/ast_nl_types.h 0644 root bin
+f usr/include/ast/ast_param.h 0644 root bin
+f usr/include/ast/ast_standards.h 0644 root bin
+f usr/include/ast/ast_std.h 0644 root bin
+f usr/include/ast/ast_stdio.h 0644 root bin
+f usr/include/ast/ast_sys.h 0644 root bin
+f usr/include/ast/ast_time.h 0644 root bin
+f usr/include/ast/ast_tty.h 0644 root bin
+f usr/include/ast/ast_version.h 0644 root bin
+f usr/include/ast/ast_vfork.h 0644 root bin
+f usr/include/ast/ast_wait.h 0644 root bin
+f usr/include/ast/ast_wchar.h 0644 root bin
+f usr/include/ast/ast_windows.h 0644 root bin
+f usr/include/ast/bytesex.h 0644 root bin
+f usr/include/ast/ccode.h 0644 root bin
+f usr/include/ast/cdt.h 0644 root bin
+f usr/include/ast/cmd.h 0644 root bin
+f usr/include/ast/cmdext.h 0644 root bin
+f usr/include/ast/debug.h 0644 root bin
+f usr/include/ast/dirent.h 0644 root bin
+f usr/include/ast/dlldefs.h 0644 root bin
+f usr/include/ast/dt.h 0644 root bin
+f usr/include/ast/endian.h 0644 root bin
+f usr/include/ast/error.h 0644 root bin
+f usr/include/ast/find.h 0644 root bin
+f usr/include/ast/fnmatch.h 0644 root bin
+f usr/include/ast/fnv.h 0644 root bin
+f usr/include/ast/fs3d.h 0644 root bin
+f usr/include/ast/fts.h 0644 root bin
+f usr/include/ast/ftw.h 0644 root bin
+f usr/include/ast/ftwalk.h 0644 root bin
+f usr/include/ast/getopt.h 0644 root bin
+f usr/include/ast/glob.h 0644 root bin
+f usr/include/ast/hash.h 0644 root bin
+f usr/include/ast/hashkey.h 0644 root bin
+f usr/include/ast/hashpart.h 0644 root bin
+f usr/include/ast/history.h 0644 root bin
+f usr/include/ast/iconv.h 0644 root bin
+f usr/include/ast/ip6.h 0644 root bin
+f usr/include/ast/lc.h 0644 root bin
+f usr/include/ast/ls.h 0644 root bin
+f usr/include/ast/magic.h 0644 root bin
+f usr/include/ast/magicid.h 0644 root bin
+f usr/include/ast/mc.h 0644 root bin
+f usr/include/ast/mime.h 0644 root bin
+f usr/include/ast/mnt.h 0644 root bin
+f usr/include/ast/modecanon.h 0644 root bin
+f usr/include/ast/modex.h 0644 root bin
+f usr/include/ast/namval.h 0644 root bin
+f usr/include/ast/nl_types.h 0644 root bin
+f usr/include/ast/nval.h 0644 root bin
+f usr/include/ast/option.h 0644 root bin
+f usr/include/ast/pp.h 0644 root bin
+f usr/include/ast/ppkey.h 0644 root bin
+f usr/include/ast/preroot.h 0644 root bin
+f usr/include/ast/proc.h 0644 root bin
+f usr/include/ast/prototyped.h 0644 root bin
+f usr/include/ast/re_comp.h 0644 root bin
+f usr/include/ast/recfmt.h 0644 root bin
+f usr/include/ast/regex.h 0644 root bin
+f usr/include/ast/regexp.h 0644 root bin
+f usr/include/ast/sfdisc.h 0644 root bin
+f usr/include/ast/sfio.h 0644 root bin
+f usr/include/ast/sfio_s.h 0644 root bin
+f usr/include/ast/sfio_t.h 0644 root bin
+f usr/include/ast/shcmd.h 0644 root bin
+f usr/include/ast/shell.h 0644 root bin
+f usr/include/ast/sig.h 0644 root bin
+f usr/include/ast/stack.h 0644 root bin
+f usr/include/ast/stak.h 0644 root bin
+f usr/include/ast/stdio.h 0644 root bin
+f usr/include/ast/stk.h 0644 root bin
+f usr/include/ast/sum.h 0644 root bin
+f usr/include/ast/swap.h 0644 root bin
+f usr/include/ast/tar.h 0644 root bin
+f usr/include/ast/times.h 0644 root bin
+f usr/include/ast/tm.h 0644 root bin
+f usr/include/ast/tmx.h 0644 root bin
+f usr/include/ast/tok.h 0644 root bin
+f usr/include/ast/tv.h 0644 root bin
+f usr/include/ast/usage.h 0644 root bin
+f usr/include/ast/vdb.h 0644 root bin
+f usr/include/ast/vecargs.h 0644 root bin
+f usr/include/ast/vmalloc.h 0644 root bin
+f usr/include/ast/wait.h 0644 root bin
+f usr/include/ast/wchar.h 0644 root bin
+f usr/include/ast/wordexp.h 0644 root bin
+f usr/include/atomic.h 0644 root bin
+f usr/include/attr.h 0644 root bin
+d usr/include/audio 0755 root bin
+f usr/include/audio/au.h 0644 root bin
+f usr/include/auth_attr.h 0644 root bin
+f usr/include/auth_list.h 0644 root bin
+f usr/include/boot_http.h 0644 root bin
+f usr/include/bootinfo.h 0644 root bin
+f usr/include/bootlog.h 0644 root bin
+d usr/include/bsm 0755 root bin
+f usr/include/bsm/adt.h 0644 root bin
+f usr/include/bsm/adt_event.h 0644 root bin
+f usr/include/bsm/audit.h 0644 root bin
+f usr/include/bsm/audit_door_infc.h 0644 root bin
+f usr/include/bsm/audit_kernel.h 0644 root bin
+f usr/include/bsm/audit_kevents.h 0644 root bin
+f usr/include/bsm/audit_private.h 0644 root bin
+f usr/include/bsm/audit_record.h 0644 root bin
+f usr/include/bsm/audit_uevents.h 0644 root bin
+f usr/include/bsm/devalloc.h 0644 root bin
+f usr/include/bsm/devices.h 0644 root bin
+f usr/include/bsm/libbsm.h 0644 root bin
+f usr/include/config_admin.h 0644 root bin
+f usr/include/cpio.h 0644 root bin
+f usr/include/crypt.h 0644 root bin
+f usr/include/cryptoutil.h 0644 root bin
+f usr/include/ctype.h 0644 root bin
+f usr/include/curses.h 0644 root bin
+d usr/include/dat 0755 root bin
+f usr/include/dat/dat.h 0644 root bin
+f usr/include/dat/dat_error.h 0644 root bin
+f usr/include/dat/dat_platform_specific.h 0644 root bin
+f usr/include/dat/dat_redirection.h 0644 root bin
+f usr/include/dat/dat_registry.h 0644 root bin
+f usr/include/dat/dat_vendor_specific.h 0644 root bin
+f usr/include/dat/udat.h 0644 root bin
+f usr/include/dat/udat_config.h 0644 root bin
+f usr/include/dat/udat_redirection.h 0644 root bin
+f usr/include/dat/udat_vendor_specific.h 0644 root bin
+f usr/include/deflt.h 0644 root bin
+d usr/include/des 0755 root bin
+f usr/include/des/des.h 0644 root bin
+f usr/include/des/desdata.h 0644 root bin
+f usr/include/des/softdes.h 0644 root bin
+f usr/include/device_info.h 0644 root bin
+f usr/include/devid.h 0644 root bin
+f usr/include/devmgmt.h 0644 root bin
+f usr/include/devpoll.h 0644 root bin
+f usr/include/dhcp_hostconf.h 0644 root bin
+f usr/include/dhcp_impl.h 0644 root bin
+f usr/include/dhcp_inittab.h 0644 root bin
+f usr/include/dhcp_stable.h 0644 root bin
+f usr/include/dhcp_svc_confkey.h 0644 root bin
+f usr/include/dhcp_svc_confopt.h 0644 root bin
+f usr/include/dhcp_svc_private.h 0644 root bin
+f usr/include/dhcp_svc_public.h 0644 root bin
+f usr/include/dhcp_symbol.h 0644 root bin
+f usr/include/dhcp_symbol_common.h 0644 root bin
+f usr/include/dhcpagent_ipc.h 0644 root bin
+f usr/include/dhcpagent_util.h 0644 root bin
+f usr/include/dhcpmsg.h 0644 root bin
+f usr/include/dial.h 0644 root bin
+f usr/include/directory.h 0644 root bin
+f usr/include/dirent.h 0644 root bin
+f usr/include/dlfcn.h 0644 root bin
+f usr/include/dns_sd.h 0644 root bin
+f usr/include/door.h 0644 root bin
+f usr/include/dtrace.h 0644 root bin
+f usr/include/elf.h 0644 root bin
+f usr/include/err.h 0644 root bin
+f usr/include/errfp.h 0644 root bin
+f usr/include/errno.h 0644 root bin
+f usr/include/eti.h 0644 root bin
+f usr/include/euc.h 0644 root bin
+f usr/include/exacct.h 0644 root bin
+f usr/include/exacct_impl.h 0644 root bin
+f usr/include/exec_attr.h 0644 root bin
+f usr/include/execinfo.h 0644 root bin
+f usr/include/fatal.h 0644 root bin
+f usr/include/fcntl.h 0644 root bin
+f usr/include/float.h 0644 root bin
+d usr/include/fm 0755 root bin
+f usr/include/fm/diagcode.h 0644 root bin
+f usr/include/fm/fmd_adm.h 0644 root bin
+f usr/include/fm/fmd_agent.h 0644 root bin
+f usr/include/fm/fmd_api.h 0644 root bin
+f usr/include/fm/fmd_fmri.h 0644 root bin
+f usr/include/fm/fmd_log.h 0644 root bin
+f usr/include/fm/fmd_msg.h 0644 root bin
+f usr/include/fm/fmd_snmp.h 0644 root bin
+f usr/include/fm/libdiskstatus.h 0644 root bin
+f usr/include/fm/libfmevent.h 0644 root bin
+f usr/include/fm/libfmevent_ruleset.h 0644 root bin
+f usr/include/fm/libseslog.h 0644 root bin
+f usr/include/fm/libtopo.h 0644 root bin
+f usr/include/fm/topo_hc.h 0644 root bin
+f usr/include/fm/topo_list.h 0644 root bin
+f usr/include/fm/topo_method.h 0644 root bin
+f usr/include/fm/topo_mod.h 0644 root bin
+f usr/include/fmtmsg.h 0644 root bin
+f usr/include/fnmatch.h 0644 root bin
+f usr/include/form.h 0644 root bin
+f usr/include/ftw.h 0644 root bin
+d usr/include/fwflash 0755 root bin
+f usr/include/fwflash/fwflash.h 0644 root bin
+f usr/include/gelf.h 0644 root bin
+f usr/include/getopt.h 0644 root bin
+f usr/include/getwidth.h 0644 root bin
+f usr/include/getxby_door.h 0644 root bin
+f usr/include/glob.h 0644 root bin
+f usr/include/grp.h 0644 root bin
+d usr/include/gssapi 0755 root bin
+f usr/include/gssapi/gssapi.h 0644 root bin
+f usr/include/gssapi/gssapi_ext.h 0644 root bin
+f usr/include/hbaapi.h 0644 root bin
+d usr/include/ia32 0755 root bin
+d usr/include/ia32/sys 0755 root bin
+f usr/include/ia32/sys/asm_linkage.h 0644 root bin
+f usr/include/ia32/sys/kdi_regs.h 0644 root bin
+f usr/include/ia32/sys/machtypes.h 0644 root bin
+f usr/include/ia32/sys/privmregs.h 0644 root bin
+f usr/include/ia32/sys/privregs.h 0644 root bin
+f usr/include/ia32/sys/psw.h 0644 root bin
+f usr/include/ia32/sys/pte.h 0644 root bin
+f usr/include/ia32/sys/reg.h 0644 root bin
+f usr/include/ia32/sys/stack.h 0644 root bin
+f usr/include/ia32/sys/trap.h 0644 root bin
+f usr/include/ia32/sys/traptrace.h 0644 root bin
+f usr/include/iconv.h 0644 root bin
+f usr/include/idmap.h 0644 root bin
+f usr/include/ieeefp.h 0644 root bin
+f usr/include/ifaddrs.h 0644 root bin
+f usr/include/ikedoor.h 0644 root bin
+f usr/include/ima.h 0644 root bin
+d usr/include/inet 0755 root bin
+f usr/include/inet/arp.h 0644 root bin
+f usr/include/inet/common.h 0644 root bin
+f usr/include/inet/ip.h 0644 root bin
+f usr/include/inet/ip2mac.h 0644 root bin
+f usr/include/inet/ip2mac_impl.h 0644 root bin
+f usr/include/inet/ip6.h 0644 root bin
+f usr/include/inet/ip6_asp.h 0644 root bin
+f usr/include/inet/ip_arp.h 0644 root bin
+f usr/include/inet/ip_ftable.h 0644 root bin
+f usr/include/inet/ip_if.h 0644 root bin
+f usr/include/inet/ip_impl.h 0644 root bin
+f usr/include/inet/ip_ire.h 0644 root bin
+f usr/include/inet/ip_multi.h 0644 root bin
+f usr/include/inet/ip_ndp.h 0644 root bin
+f usr/include/inet/ip_netinfo.h 0644 root bin
+f usr/include/inet/ip_rts.h 0644 root bin
+f usr/include/inet/ip_stack.h 0644 root bin
+f usr/include/inet/ipclassifier.h 0644 root bin
+f usr/include/inet/ipdrop.h 0644 root bin
+f usr/include/inet/ipnet.h 0644 root bin
+f usr/include/inet/ipp_common.h 0644 root bin
+f usr/include/inet/ipsec_impl.h 0644 root bin
+f usr/include/inet/ipsec_info.h 0644 root bin
+f usr/include/inet/ipsecah.h 0644 root bin
+f usr/include/inet/ipsecesp.h 0644 root bin
+f usr/include/inet/iptun.h 0644 root bin
+f usr/include/inet/keysock.h 0644 root bin
+d usr/include/inet/kssl 0755 root bin
+f usr/include/inet/kssl/kssl.h 0644 root bin
+f usr/include/inet/kssl/ksslapi.h 0644 root bin
+f usr/include/inet/kssl/ksslimpl.h 0644 root bin
+f usr/include/inet/kssl/ksslproto.h 0644 root bin
+f usr/include/inet/led.h 0644 root bin
+f usr/include/inet/mi.h 0644 root bin
+f usr/include/inet/mib2.h 0644 root bin
+d usr/include/inet/nca 0755 root bin
+f usr/include/inet/nca/nca.h 0644 root bin
+f usr/include/inet/nca/ncadoorhdr.h 0644 root bin
+f usr/include/inet/nca/ncaio.h 0644 root bin
+f usr/include/inet/nca/ncakmem.h 0644 root bin
+f usr/include/inet/nca/ncalogd.h 0644 root bin
+f usr/include/inet/nca/ncandd.h 0644 root bin
+f usr/include/inet/nd.h 0644 root bin
+f usr/include/inet/optcom.h 0644 root bin
+f usr/include/inet/rawip_impl.h 0644 root bin
+f usr/include/inet/sadb.h 0644 root bin
+f usr/include/inet/sctp_itf.h 0644 root bin
+f usr/include/inet/snmpcom.h 0644 root bin
+f usr/include/inet/tcp.h 0644 root bin
+f usr/include/inet/tcp_impl.h 0644 root bin
+f usr/include/inet/tcp_sack.h 0644 root bin
+f usr/include/inet/tcp_stack.h 0644 root bin
+f usr/include/inet/tcp_stats.h 0644 root bin
+f usr/include/inet/tunables.h 0644 root bin
+f usr/include/inet/udp_impl.h 0644 root bin
+f usr/include/inet/wifi_ioctl.h 0644 root bin
+f usr/include/inetsvc.h 0644 root bin
+f usr/include/instzones_api.h 0644 root bin
+f usr/include/inttypes.h 0644 root bin
+f usr/include/ipadm_ipmgmt.h 0644 root bin
+f usr/include/ipadm_ndpd.h 0644 root bin
+f usr/include/ipmp.h 0644 root bin
+f usr/include/ipmp_admin.h 0644 root bin
+f usr/include/ipmp_mpathd.h 0644 root bin
+f usr/include/ipmp_query.h 0644 root bin
+f usr/include/ipmp_query_impl.h 0644 root bin
+d usr/include/ipp 0755 root bin
+d usr/include/ipp/dlcosmk 0755 root bin
+f usr/include/ipp/dlcosmk/dlcosmk.h 0644 root bin
+d usr/include/ipp/dscpmk 0755 root bin
+f usr/include/ipp/dscpmk/dscpmk.h 0644 root bin
+d usr/include/ipp/flowacct 0755 root bin
+f usr/include/ipp/flowacct/flowacct.h 0644 root bin
+d usr/include/ipp/ipgpc 0755 root bin
+f usr/include/ipp/ipgpc/ipgpc.h 0644 root bin
+f usr/include/ipp/ipp.h 0644 root bin
+f usr/include/ipp/ipp_config.h 0644 root bin
+f usr/include/ipp/ipp_impl.h 0644 root bin
+f usr/include/ipp/ippctl.h 0644 root bin
+d usr/include/ipp/meters 0755 root bin
+f usr/include/ipp/meters/meter.h 0644 root bin
+f usr/include/ipsec_util.h 0644 root bin
+d usr/include/iso 0755 root bin
+s usr/include/iso/assert_iso.h=../assert.h
+f usr/include/iso/ctype_c99.h 0644 root bin
+f usr/include/iso/ctype_iso.h 0644 root bin
+s usr/include/iso/errno_iso.h=../errno.h
+s usr/include/iso/float_iso.h=../float.h
+s usr/include/iso/iso646_iso.h=../iso646.h
+f usr/include/iso/limits_iso.h 0644 root bin
+f usr/include/iso/locale_iso.h 0644 root bin
+f usr/include/iso/setjmp_iso.h 0644 root bin
+f usr/include/iso/signal_iso.h 0644 root bin
+f usr/include/iso/stdarg_c99.h 0644 root bin
+f usr/include/iso/stdarg_iso.h 0644 root bin
+f usr/include/iso/stddef_iso.h 0644 root bin
+f usr/include/iso/stdio_c99.h 0644 root bin
+f usr/include/iso/stdio_iso.h 0644 root bin
+f usr/include/iso/stdlib_c99.h 0644 root bin
+f usr/include/iso/stdlib_iso.h 0644 root bin
+f usr/include/iso/string_iso.h 0644 root bin
+f usr/include/iso/time_iso.h 0644 root bin
+f usr/include/iso/wchar_c99.h 0644 root bin
+f usr/include/iso/wchar_iso.h 0644 root bin
+f usr/include/iso/wctype_c99.h 0644 root bin
+f usr/include/iso/wctype_iso.h 0644 root bin
+f usr/include/iso646.h 0644 root bin
+d usr/include/kerberosv5 0755 root bin
+f usr/include/kerberosv5/com_err.h 0644 root bin
+f usr/include/kerberosv5/krb5.h 0644 root bin
+f usr/include/kerberosv5/mit-sipb-copyright.h 0644 root bin
+f usr/include/kerberosv5/mit_copyright.h 0644 root bin
+f usr/include/klpd.h 0644 root bin
+f usr/include/kmfapi.h 0644 root bin
+f usr/include/kmftypes.h 0644 root bin
+f usr/include/kstat.h 0644 root bin
+f usr/include/kvm.h 0644 root bin
+f usr/include/langinfo.h 0644 root bin
+f usr/include/lastlog.h 0644 root bin
+f usr/include/lber.h 0644 root bin
+f usr/include/ldap.h 0644 root bin
+f usr/include/libbe.h 0644 root bin
+f usr/include/libbe_priv.h 0644 root bin
+f usr/include/libbrand.h 0644 root bin
+f usr/include/libcmdutils.h 0644 root bin
+f usr/include/libcontract.h 0644 root bin
+f usr/include/libcontract_priv.h 0644 root bin
+f usr/include/libcpc.h 0644 root bin
+f usr/include/libctf.h 0644 root bin
+f usr/include/libdevice.h 0644 root bin
+f usr/include/libdevinfo.h 0644 root bin
+f usr/include/libdisasm.h 0644 root bin
+f usr/include/libdiskmgt.h 0644 root bin
+f usr/include/libdladm.h 0644 root bin
+f usr/include/libdladm_impl.h 0644 root bin
+f usr/include/libdlaggr.h 0644 root bin
+f usr/include/libdlbridge.h 0644 root bin
+f usr/include/libdlether.h 0644 root bin
+f usr/include/libdlflow.h 0644 root bin
+f usr/include/libdlflow_impl.h 0644 root bin
+f usr/include/libdlib.h 0644 root bin
+f usr/include/libdliptun.h 0644 root bin
+f usr/include/libdllink.h 0644 root bin
+f usr/include/libdlmgmt.h 0644 root bin
+f usr/include/libdlpi.h 0644 root bin
+f usr/include/libdlsim.h 0644 root bin
+f usr/include/libdlstat.h 0644 root bin
+f usr/include/libdlvlan.h 0644 root bin
+f usr/include/libdlvnic.h 0644 root bin
+f usr/include/libdlwlan.h 0644 root bin
+f usr/include/libdlwlan_impl.h 0644 root bin
+f usr/include/libelf.h 0644 root bin
+f usr/include/libelfsign.h 0644 root bin
+f usr/include/libfcoe.h 0644 root bin
+f usr/include/libfdisk.h 0644 root bin
+f usr/include/libfstyp.h 0644 root bin
+f usr/include/libfstyp_module.h 0644 root bin
+f usr/include/libgen.h 0644 root bin
+f usr/include/libgrubmgmt.h 0644 root bin
+f usr/include/libilb.h 0644 root bin
+f usr/include/libinetutil.h 0644 root bin
+f usr/include/libintl.h 0644 root bin
+f usr/include/libipadm.h 0644 root bin
+f usr/include/libipd.h 0644 root bin
+f usr/include/libipmi.h 0644 root bin
+f usr/include/libipp.h 0644 root bin
+f usr/include/libiscsit.h 0644 root bin
+f usr/include/libmail.h 0644 root bin
+d usr/include/libmilter 0755 root bin
+f usr/include/libmilter/README 0644 root bin
+f usr/include/libmilter/mfapi.h 0644 root bin
+f usr/include/libmilter/mfdef.h 0644 root bin
+f usr/include/libndmp.h 0644 root bin
+f usr/include/libnvpair.h 0644 root bin
+f usr/include/libnwam.h 0644 root bin
+f usr/include/libnwam_priv.h 0644 root bin
+f usr/include/libpctx.h 0644 root bin
+f usr/include/libproc.h 0644 root bin
+f usr/include/librcm.h 0644 root bin
+f usr/include/librcm_event.h 0644 root bin
+f usr/include/librcm_impl.h 0644 root bin
+f usr/include/librestart.h 0644 root bin
+f usr/include/librestart_priv.h 0644 root bin
+f usr/include/libscf.h 0644 root bin
+f usr/include/libscf_priv.h 0644 root bin
+f usr/include/libshare.h 0644 root bin
+f usr/include/libshare_impl.h 0644 root bin
+f usr/include/libsocket_priv.h 0644 root bin
+f usr/include/libsrpt.h 0644 root bin
+f usr/include/libstmf.h 0644 root bin
+f usr/include/libstmfproxy.h 0644 root bin
+f usr/include/libsun_ima.h 0644 root bin
+f usr/include/libsysevent.h 0644 root bin
+f usr/include/libsysevent_impl.h 0644 root bin
+f usr/include/libtecla.h 0644 root bin
+f usr/include/libuutil.h 0644 root bin
+f usr/include/libuutil_impl.h 0644 root bin
+f usr/include/libvrrpadm.h 0644 root bin
+f usr/include/libvscan.h 0644 root bin
+f usr/include/libw.h 0644 root bin
+f usr/include/libzfs.h 0644 root bin
+f usr/include/libzfs_core.h 0644 root bin
+f usr/include/libzfs_jni_dataset.h 0644 root bin
+f usr/include/libzfs_jni_disk.h 0644 root bin
+f usr/include/libzfs_jni_diskmgt.h 0644 root bin
+f usr/include/libzfs_jni_ipool.h 0644 root bin
+f usr/include/libzfs_jni_main.h 0644 root bin
+f usr/include/libzfs_jni_pool.h 0644 root bin
+f usr/include/libzfs_jni_property.h 0644 root bin
+f usr/include/libzfs_jni_util.h 0644 root bin
+f usr/include/libzonecfg.h 0644 root bin
+f usr/include/libzoneinfo.h 0644 root bin
+f usr/include/limits.h 0644 root bin
+f usr/include/linenum.h 0644 root bin
+f usr/include/link.h 0644 root bin
+f usr/include/listen.h 0644 root bin
+f usr/include/locale.h 0644 root bin
+f usr/include/macros.h 0644 root bin
+f usr/include/maillock.h 0644 root bin
+f usr/include/malloc.h 0644 root bin
+f usr/include/md4.h 0644 root bin
+f usr/include/md5.h 0644 root bin
+f usr/include/mdiox.h 0644 root bin
+f usr/include/mdmn_changelog.h 0644 root bin
+f usr/include/memory.h 0644 root bin
+f usr/include/menu.h 0644 root bin
+f usr/include/mhdx.h 0644 root bin
+f usr/include/mon.h 0644 root bin
+f usr/include/monetary.h 0644 root bin
+f usr/include/mp.h 0644 root bin
+f usr/include/mpapi-sun.h 0644 root bin
+f usr/include/mpapi.h 0644 root bin
+f usr/include/mqueue.h 0644 root bin
+f usr/include/mtmalloc.h 0644 root bin
+f usr/include/nan.h 0644 root bin
+f usr/include/ndbm.h 0644 root bin
+f usr/include/ndpd.h 0644 root bin
+d usr/include/net 0755 root bin
+f usr/include/net/af.h 0644 root bin
+f usr/include/net/bpf.h 0644 root bin
+f usr/include/net/bpfdesc.h 0644 root bin
+f usr/include/net/bridge.h 0644 root bin
+f usr/include/net/bridge_impl.h 0644 root bin
+f usr/include/net/dlt.h 0644 root bin
+f usr/include/net/if.h 0644 root bin
+f usr/include/net/if_arp.h 0644 root bin
+f usr/include/net/if_dl.h 0644 root bin
+f usr/include/net/if_types.h 0644 root bin
+f usr/include/net/pfkeyv2.h 0644 root bin
+f usr/include/net/pfpolicy.h 0644 root bin
+f usr/include/net/ppp-comp.h 0644 root bin
+f usr/include/net/ppp_defs.h 0644 root bin
+f usr/include/net/pppio.h 0644 root bin
+f usr/include/net/pppoe.h 0644 root bin
+f usr/include/net/radix.h 0644 root bin
+f usr/include/net/route.h 0644 root bin
+f usr/include/net/simnet.h 0644 root bin
+f usr/include/net/sppptun.h 0644 root bin
+f usr/include/net/trill.h 0644 root bin
+f usr/include/net/vjcompress.h 0644 root bin
+f usr/include/net/wpa.h 0644 root bin
+f usr/include/netboot_paths.h 0644 root bin
+f usr/include/netconfig.h 0644 root bin
+f usr/include/netdb.h 0644 root bin
+f usr/include/netdir.h 0644 root bin
+d usr/include/netinet 0755 root bin
+f usr/include/netinet/arp.h 0644 root bin
+f usr/include/netinet/dhcp.h 0644 root bin
+f usr/include/netinet/dhcp6.h 0644 root bin
+f usr/include/netinet/icmp6.h 0644 root bin
+f usr/include/netinet/icmp_var.h 0644 root bin
+f usr/include/netinet/if_ether.h 0644 root bin
+f usr/include/netinet/igmp.h 0644 root bin
+f usr/include/netinet/igmp_var.h 0644 root bin
+f usr/include/netinet/in.h 0644 root bin
+f usr/include/netinet/in_pcb.h 0644 root bin
+f usr/include/netinet/in_systm.h 0644 root bin
+f usr/include/netinet/in_var.h 0644 root bin
+f usr/include/netinet/inetutil.h 0644 root bin
+f usr/include/netinet/ip.h 0644 root bin
+f usr/include/netinet/ip6.h 0644 root bin
+f usr/include/netinet/ip_auth.h 0644 root bin
+f usr/include/netinet/ip_compat.h 0644 root bin
+f usr/include/netinet/ip_fil.h 0644 root bin
+f usr/include/netinet/ip_frag.h 0644 root bin
+f usr/include/netinet/ip_htable.h 0644 root bin
+f usr/include/netinet/ip_icmp.h 0644 root bin
+f usr/include/netinet/ip_lookup.h 0644 root bin
+f usr/include/netinet/ip_mroute.h 0644 root bin
+f usr/include/netinet/ip_nat.h 0644 root bin
+f usr/include/netinet/ip_pool.h 0644 root bin
+f usr/include/netinet/ip_proxy.h 0644 root bin
+f usr/include/netinet/ip_state.h 0644 root bin
+f usr/include/netinet/ip_var.h 0644 root bin
+f usr/include/netinet/ipf_stack.h 0644 root bin
+f usr/include/netinet/ipl.h 0644 root bin
+f usr/include/netinet/pim.h 0644 root bin
+f usr/include/netinet/sctp.h 0644 root bin
+f usr/include/netinet/tcp.h 0644 root bin
+f usr/include/netinet/tcp_debug.h 0644 root bin
+f usr/include/netinet/tcp_fsm.h 0644 root bin
+f usr/include/netinet/tcp_seq.h 0644 root bin
+f usr/include/netinet/tcp_timer.h 0644 root bin
+f usr/include/netinet/tcp_var.h 0644 root bin
+f usr/include/netinet/tcpip.h 0644 root bin
+f usr/include/netinet/udp.h 0644 root bin
+f usr/include/netinet/udp_var.h 0644 root bin
+f usr/include/netinet/vrrp.h 0644 root bin
+d usr/include/netpacket 0755 root bin
+f usr/include/netpacket/packet.h 0644 root bin
+d usr/include/netsmb 0755 root bin
+f usr/include/netsmb/smbfs_acl.h 0644 root bin
+f usr/include/netsmb/smbfs_api.h 0644 root bin
+d usr/include/nfs 0755 root bin
+f usr/include/nfs/auth.h 0644 root bin
+f usr/include/nfs/export.h 0644 root bin
+f usr/include/nfs/lm.h 0644 root bin
+f usr/include/nfs/mapid.h 0644 root bin
+f usr/include/nfs/mount.h 0644 root bin
+f usr/include/nfs/nfs.h 0644 root bin
+f usr/include/nfs/nfs4.h 0644 root bin
+f usr/include/nfs/nfs4_attr.h 0644 root bin
+f usr/include/nfs/nfs4_clnt.h 0644 root bin
+f usr/include/nfs/nfs4_db_impl.h 0644 root bin
+f usr/include/nfs/nfs4_idmap_impl.h 0644 root bin
+f usr/include/nfs/nfs4_kprot.h 0644 root bin
+f usr/include/nfs/nfs_acl.h 0644 root bin
+f usr/include/nfs/nfs_clnt.h 0644 root bin
+f usr/include/nfs/nfs_cmd.h 0644 root bin
+f usr/include/nfs/nfs_log.h 0644 root bin
+f usr/include/nfs/nfs_sec.h 0644 root bin
+f usr/include/nfs/nfsid_map.h 0644 root bin
+f usr/include/nfs/nfssys.h 0644 root bin
+f usr/include/nfs/rnode.h 0644 root bin
+f usr/include/nfs/rnode4.h 0644 root bin
+f usr/include/nl_types.h 0644 root bin
+f usr/include/nlist.h 0644 root bin
+f usr/include/note.h 0644 root bin
+f usr/include/nsctl.h 0644 root bin
+f usr/include/nss.h 0644 root bin
+f usr/include/nss_common.h 0644 root bin
+f usr/include/nss_dbdefs.h 0644 root bin
+f usr/include/nss_netdir.h 0644 root bin
+f usr/include/nsswitch.h 0644 root bin
+f usr/include/nvfru.h 0644 root bin
+f usr/include/ofmt.h 0644 root bin
+f usr/include/p12access.h 0644 root bin
+f usr/include/p12aux.h 0644 root bin
+f usr/include/p12err.h 0644 root bin
+f usr/include/panel.h 0644 root bin
+f usr/include/parseURL.h 0644 root bin
+d usr/include/parted 0755 root bin
+f usr/include/parted/constraint.h 0644 root bin
+f usr/include/parted/crc32.h 0644 root bin
+f usr/include/parted/debug.h 0644 root bin
+f usr/include/parted/device.h 0644 root bin
+f usr/include/parted/disk.h 0644 root bin
+f usr/include/parted/endian.h 0644 root bin
+f usr/include/parted/exception.h 0644 root bin
+f usr/include/parted/filesys.h 0644 root bin
+f usr/include/parted/geom.h 0644 root bin
+f usr/include/parted/natmath.h 0644 root bin
+f usr/include/parted/parted.h 0644 root bin
+f usr/include/parted/solaris.h 0644 root bin
+f usr/include/parted/timer.h 0644 root bin
+f usr/include/parted/unit.h 0644 root bin
+f usr/include/passwdutil.h 0644 root bin
+f usr/include/pcsample.h 0644 root bin
+f usr/include/pfmt.h 0644 root bin
+f usr/include/picl.h 0644 root bin
+f usr/include/picltree.h 0644 root bin
+f usr/include/pkgdev.h 0644 root bin
+f usr/include/pkginfo.h 0644 root bin
+f usr/include/pkglocs.h 0644 root bin
+f usr/include/pkgstrct.h 0644 root bin
+f usr/include/pkgtrans.h 0644 root bin
+f usr/include/poll.h 0644 root bin
+f usr/include/pool.h 0644 root bin
+f usr/include/port.h 0644 root bin
+f usr/include/priv.h 0644 root bin
+f usr/include/priv_utils.h 0644 root bin
+f usr/include/proc_service.h 0644 root bin
+f usr/include/procfs.h 0644 root bin
+f usr/include/prof.h 0644 root bin
+f usr/include/prof_attr.h 0644 root bin
+f usr/include/project.h 0644 root bin
+d usr/include/protocols 0755 root bin
+f usr/include/protocols/dumprestore.h 0644 root bin
+f usr/include/protocols/ripngd.h 0644 root bin
+f usr/include/protocols/routed.h 0644 root bin
+f usr/include/protocols/rwhod.h 0644 root bin
+f usr/include/protocols/timed.h 0644 root bin
+f usr/include/pthread.h 0644 root bin
+f usr/include/pw.h 0644 root bin
+f usr/include/pwd.h 0644 root bin
+f usr/include/raidcfg.h 0644 root bin
+f usr/include/raidcfg_spi.h 0644 root bin
+f usr/include/rcm_module.h 0644 root bin
+f usr/include/rctl.h 0644 root bin
+f usr/include/re_comp.h 0644 root bin
+f usr/include/regex.h 0644 root bin
+f usr/include/regexp.h 0644 root bin
+f usr/include/regexpr.h 0644 root bin
+f usr/include/resolv.h 0644 root bin
+f usr/include/rje.h 0644 root bin
+f usr/include/rp_plugin.h 0644 root bin
+d usr/include/rpc 0755 root bin
+f usr/include/rpc/auth.h 0644 root bin
+f usr/include/rpc/auth_des.h 0644 root bin
+f usr/include/rpc/auth_sys.h 0644 root bin
+f usr/include/rpc/auth_unix.h 0644 root bin
+f usr/include/rpc/bootparam.h 0644 root bin
+f usr/include/rpc/clnt.h 0644 root bin
+f usr/include/rpc/clnt_soc.h 0644 root bin
+f usr/include/rpc/clnt_stat.h 0644 root bin
+f usr/include/rpc/des_crypt.h 0644 root bin
+f usr/include/rpc/key_prot.h 0644 root bin
+f usr/include/rpc/nettype.h 0644 root bin
+f usr/include/rpc/pmap_clnt.h 0644 root bin
+f usr/include/rpc/pmap_prot.h 0644 root bin
+f usr/include/rpc/pmap_prot.x 0644 root bin
+f usr/include/rpc/pmap_rmt.h 0644 root bin
+f usr/include/rpc/raw.h 0644 root bin
+f usr/include/rpc/rpc.h 0644 root bin
+f usr/include/rpc/rpc_com.h 0644 root bin
+f usr/include/rpc/rpc_msg.h 0644 root bin
+f usr/include/rpc/rpc_rdma.h 0644 root bin
+f usr/include/rpc/rpc_sztypes.h 0644 root bin
+f usr/include/rpc/rpcb_clnt.h 0644 root bin
+f usr/include/rpc/rpcb_prot.h 0644 root bin
+f usr/include/rpc/rpcb_prot.x 0644 root bin
+f usr/include/rpc/rpcent.h 0644 root bin
+f usr/include/rpc/rpcsec_gss.h 0644 root bin
+f usr/include/rpc/rpcsys.h 0644 root bin
+f usr/include/rpc/svc.h 0644 root bin
+f usr/include/rpc/svc_auth.h 0644 root bin
+f usr/include/rpc/svc_mt.h 0644 root bin
+f usr/include/rpc/svc_soc.h 0644 root bin
+f usr/include/rpc/types.h 0644 root bin
+f usr/include/rpc/xdr.h 0644 root bin
+d usr/include/rpcsvc 0755 root bin
+f usr/include/rpcsvc/autofs_prot.h 0644 root bin
+f usr/include/rpcsvc/autofs_prot.x 0644 root bin
+f usr/include/rpcsvc/bootparam.h 0644 root bin
+f usr/include/rpcsvc/bootparam_prot.h 0644 root bin
+f usr/include/rpcsvc/bootparam_prot.x 0644 root bin
+f usr/include/rpcsvc/daemon_utils.h 0644 root bin
+f usr/include/rpcsvc/dbm.h 0644 root bin
+f usr/include/rpcsvc/idmap_prot.h 0644 root bin
+f usr/include/rpcsvc/idmap_prot.x 0644 root bin
+f usr/include/rpcsvc/key_prot.x 0644 root bin
+f usr/include/rpcsvc/mount.h 0644 root bin
+f usr/include/rpcsvc/mount.x 0644 root bin
+f usr/include/rpcsvc/nfs4_prot.h 0644 root bin
+f usr/include/rpcsvc/nfs4_prot.x 0644 root bin
+f usr/include/rpcsvc/nfs_acl.h 0644 root bin
+f usr/include/rpcsvc/nfs_acl.x 0644 root bin
+f usr/include/rpcsvc/nfs_prot.h 0644 root bin
+f usr/include/rpcsvc/nfs_prot.x 0644 root bin
+f usr/include/rpcsvc/nis.h 0644 root bin
+f usr/include/rpcsvc/nis.x 0644 root bin
+f usr/include/rpcsvc/nis_db.h 0644 root bin
+f usr/include/rpcsvc/nis_object.x 0644 root bin
+f usr/include/rpcsvc/nislib.h 0644 root bin
+f usr/include/rpcsvc/nlm_prot.h 0644 root bin
+f usr/include/rpcsvc/nlm_prot.x 0644 root bin
+f usr/include/rpcsvc/nsm_addr.h 0644 root bin
+f usr/include/rpcsvc/nsm_addr.x 0644 root bin
+f usr/include/rpcsvc/rex.h 0644 root bin
+f usr/include/rpcsvc/rex.x 0644 root bin
+f usr/include/rpcsvc/rpc_sztypes.h 0644 root bin
+f usr/include/rpcsvc/rpc_sztypes.x 0644 root bin
+f usr/include/rpcsvc/rquota.h 0644 root bin
+f usr/include/rpcsvc/rquota.x 0644 root bin
+f usr/include/rpcsvc/rstat.h 0644 root bin
+f usr/include/rpcsvc/rstat.x 0644 root bin
+f usr/include/rpcsvc/rusers.h 0644 root bin
+f usr/include/rpcsvc/rusers.x 0644 root bin
+f usr/include/rpcsvc/rwall.h 0644 root bin
+f usr/include/rpcsvc/rwall.x 0644 root bin
+f usr/include/rpcsvc/sm_inter.h 0644 root bin
+f usr/include/rpcsvc/sm_inter.x 0644 root bin
+f usr/include/rpcsvc/spray.h 0644 root bin
+f usr/include/rpcsvc/spray.x 0644 root bin
+f usr/include/rpcsvc/svc_dg_priv.h 0644 root bin
+f usr/include/rpcsvc/ufs_prot.h 0644 root bin
+f usr/include/rpcsvc/ufs_prot.x 0644 root bin
+f usr/include/rpcsvc/yp.x 0644 root bin
+f usr/include/rpcsvc/yp_prot.h 0644 root bin
+f usr/include/rpcsvc/ypclnt.h 0644 root bin
+f usr/include/rpcsvc/yppasswd.h 0644 root bin
+f usr/include/rpcsvc/ypupd.h 0644 root bin
+f usr/include/rsmapi.h 0644 root bin
+f usr/include/rtld_db.h 0644 root bin
+f usr/include/s_string.h 0644 root bin
+f usr/include/sac.h 0644 root bin
+d usr/include/sasl 0755 root bin
+f usr/include/sasl/prop.h 0644 root bin
+f usr/include/sasl/sasl.h 0644 root bin
+f usr/include/sasl/saslplug.h 0644 root bin
+f usr/include/sasl/saslutil.h 0644 root bin
+f usr/include/scfutil.h 0644 root bin
+f usr/include/sched.h 0644 root bin
+f usr/include/schedctl.h 0644 root bin
+d usr/include/scsi 0755 root bin
+f usr/include/scsi/libscsi.h 0644 root bin
+f usr/include/scsi/libses.h 0644 root bin
+f usr/include/scsi/libses_plugin.h 0644 root bin
+f usr/include/scsi/libsmp.h 0644 root bin
+f usr/include/scsi/libsmp_plugin.h 0644 root bin
+d usr/include/scsi/plugins 0755 root bin
+d usr/include/scsi/plugins/ses 0755 root bin
+d usr/include/scsi/plugins/ses/framework 0755 root bin
+f usr/include/scsi/plugins/ses/framework/libses.h 0644 root bin
+f usr/include/scsi/plugins/ses/framework/ses2.h 0644 root bin
+f usr/include/scsi/plugins/ses/framework/ses2_impl.h 0644 root bin
+d usr/include/scsi/plugins/ses/vendor 0755 root bin
+f usr/include/scsi/plugins/ses/vendor/sun.h 0644 root bin
+f usr/include/scsi/plugins/ses/vendor/sun_impl.h 0644 root bin
+d usr/include/scsi/plugins/smp 0755 root bin
+d usr/include/scsi/plugins/smp/engine 0755 root bin
+d usr/include/scsi/plugins/smp/framework 0755 root bin
+f usr/include/sdp.h 0644 root bin
+f usr/include/sdssc.h 0644 root bin
+f usr/include/search.h 0644 root bin
+f usr/include/secdb.h 0644 root bin
+d usr/include/security 0755 root bin
+f usr/include/security/auditd.h 0644 root bin
+f usr/include/security/cryptoki.h 0644 root bin
+f usr/include/security/pam_appl.h 0644 root bin
+f usr/include/security/pam_impl.h 0644 root bin
+f usr/include/security/pam_modules.h 0644 root bin
+f usr/include/security/pkcs11.h 0644 root bin
+f usr/include/security/pkcs11f.h 0644 root bin
+f usr/include/security/pkcs11t.h 0644 root bin
+f usr/include/semaphore.h 0644 root bin
+f usr/include/setjmp.h 0644 root bin
+f usr/include/sgtty.h 0644 root bin
+f usr/include/sha1.h 0644 root bin
+f usr/include/sha2.h 0644 root bin
+f usr/include/shadow.h 0644 root bin
+d usr/include/sharefs 0755 root bin
+f usr/include/sharefs/share.h 0644 root bin
+f usr/include/sharefs/sharefs.h 0644 root bin
+f usr/include/sharefs/sharetab.h 0644 root bin
+f usr/include/siginfo.h 0644 root bin
+f usr/include/signal.h 0644 root bin
+f usr/include/sip.h 0644 root bin
+f usr/include/slp.h 0644 root bin
+d usr/include/smb 0755 root bin
+f usr/include/smb/doserror.h 0644 root bin
+f usr/include/smb/lmerr.h 0644 root bin
+f usr/include/smb/nterror.h 0644 root bin
+f usr/include/smb/ntstatus.h 0644 root bin
+f usr/include/smbios.h 0644 root bin
+d usr/include/smbsrv 0755 root bin
+f usr/include/smbsrv/alloc.h 0644 root bin
+f usr/include/smbsrv/cp_unicode.h 0644 root bin
+f usr/include/smbsrv/cp_usascii.h 0644 root bin
+f usr/include/smbsrv/hash_table.h 0644 root bin
+f usr/include/smbsrv/libmlrpc.h 0644 root bin
+f usr/include/smbsrv/libmlsvc.h 0644 root bin
+f usr/include/smbsrv/libsmb.h 0644 root bin
+f usr/include/smbsrv/libsmbns.h 0644 root bin
+f usr/include/smbsrv/mac_cifs.h 0644 root bin
+f usr/include/smbsrv/mailslot.h 0644 root bin
+f usr/include/smbsrv/mbuf.h 0644 root bin
+f usr/include/smbsrv/msgbuf.h 0644 root bin
+d usr/include/smbsrv/ndl 0755 root bin
+f usr/include/smbsrv/ndl/dssetup.ndl 0644 root bin
+f usr/include/smbsrv/ndl/eventlog.ndl 0644 root bin
+f usr/include/smbsrv/ndl/llsrpc.ndl 0644 root bin
+f usr/include/smbsrv/ndl/lsarpc.ndl 0644 root bin
+f usr/include/smbsrv/ndl/msgsvc.ndl 0644 root bin
+f usr/include/smbsrv/ndl/ndrtypes.ndl 0644 root bin
+f usr/include/smbsrv/ndl/netdfs.ndl 0644 root bin
+f usr/include/smbsrv/ndl/netlogon.ndl 0644 root bin
+f usr/include/smbsrv/ndl/rpcpdu.ndl 0644 root bin
+f usr/include/smbsrv/ndl/samrpc.ndl 0644 root bin
+f usr/include/smbsrv/ndl/security.ndl 0644 root bin
+f usr/include/smbsrv/ndl/spoolss.ndl 0644 root bin
+f usr/include/smbsrv/ndl/srvsvc.ndl 0644 root bin
+f usr/include/smbsrv/ndl/svcctl.ndl 0644 root bin
+f usr/include/smbsrv/ndl/winreg.ndl 0644 root bin
+f usr/include/smbsrv/ndr.h 0644 root bin
+f usr/include/smbsrv/netbios.h 0644 root bin
+f usr/include/smbsrv/netrauth.h 0644 root bin
+f usr/include/smbsrv/nmpipes.h 0644 root bin
+f usr/include/smbsrv/ntaccess.h 0644 root bin
+f usr/include/smbsrv/ntifs.h 0644 root bin
+f usr/include/smbsrv/ntlocale.h 0644 root bin
+f usr/include/smbsrv/smb.h 0644 root bin
+f usr/include/smbsrv/smb_dfs.h 0644 root bin
+f usr/include/smbsrv/smb_door.h 0644 root bin
+f usr/include/smbsrv/smb_fsops.h 0644 root bin
+f usr/include/smbsrv/smb_idmap.h 0644 root bin
+f usr/include/smbsrv/smb_inet.h 0644 root bin
+f usr/include/smbsrv/smb_ioctl.h 0644 root bin
+f usr/include/smbsrv/smb_kproto.h 0644 root bin
+f usr/include/smbsrv/smb_kstat.h 0644 root bin
+f usr/include/smbsrv/smb_ktypes.h 0644 root bin
+f usr/include/smbsrv/smb_privilege.h 0644 root bin
+f usr/include/smbsrv/smb_share.h 0644 root bin
+f usr/include/smbsrv/smb_sid.h 0644 root bin
+f usr/include/smbsrv/smb_token.h 0644 root bin
+f usr/include/smbsrv/smb_vops.h 0644 root bin
+f usr/include/smbsrv/smb_xdr.h 0644 root bin
+f usr/include/smbsrv/smbinfo.h 0644 root bin
+f usr/include/smbsrv/string.h 0644 root bin
+f usr/include/smbsrv/svrapi.h 0644 root bin
+f usr/include/smbsrv/winioctl.h 0644 root bin
+f usr/include/smbsrv/winsvc.h 0644 root bin
+f usr/include/smbsrv/wintypes.h 0644 root bin
+f usr/include/smhbaapi.h 0644 root bin
+f usr/include/spawn.h 0644 root bin
+d usr/include/sqlite 0755 root bin
+f usr/include/sqlite/sqlite-misc.h 0644 root bin
+f usr/include/sqlite/sqlite.h 0644 root bin
+f usr/include/stack_unwind.h 0644 root bin
+f usr/include/stdarg.h 0644 root bin
+f usr/include/stdbool.h 0644 root bin
+f usr/include/stddef.h 0644 root bin
+f usr/include/stdint.h 0644 root bin
+f usr/include/stdio.h 0644 root bin
+f usr/include/stdio_ext.h 0644 root bin
+f usr/include/stdio_impl.h 0644 root bin
+f usr/include/stdio_tag.h 0644 root bin
+f usr/include/stdlib.h 0644 root bin
+f usr/include/storclass.h 0644 root bin
+f usr/include/stp_bpdu.h 0644 root bin
+f usr/include/stp_in.h 0644 root bin
+f usr/include/stp_vectors.h 0644 root bin
+f usr/include/string.h 0644 root bin
+f usr/include/strings.h 0644 root bin
+f usr/include/stropts.h 0644 root bin
+f usr/include/syms.h 0644 root bin
+f usr/include/synch.h 0644 root bin
+d usr/include/sys 0755 root bin
+d usr/include/sys/1394 0755 root bin
+f usr/include/sys/1394/cmd1394.h 0644 root bin
+f usr/include/sys/1394/id1394.h 0644 root bin
+f usr/include/sys/1394/ieee1212.h 0644 root bin
+f usr/include/sys/1394/ieee1394.h 0644 root bin
+f usr/include/sys/1394/ixl1394.h 0644 root bin
+f usr/include/sys/1394/s1394_impl.h 0644 root bin
+f usr/include/sys/1394/t1394.h 0644 root bin
+f usr/include/sys/acct.h 0644 root bin
+f usr/include/sys/acctctl.h 0644 root bin
+f usr/include/sys/acl.h 0644 root bin
+f usr/include/sys/acl_impl.h 0644 root bin
+f usr/include/sys/acpi_drv.h 0644 root bin
+f usr/include/sys/aggr.h 0644 root bin
+f usr/include/sys/aggr_impl.h 0644 root bin
+d usr/include/sys/agp 0755 root bin
+f usr/include/sys/agp/agpamd64gart_io.h 0644 root bin
+f usr/include/sys/agp/agpdefs.h 0644 root bin
+f usr/include/sys/agp/agpgart_impl.h 0644 root bin
+f usr/include/sys/agp/agpmaster_io.h 0644 root bin
+f usr/include/sys/agp/agptarget_io.h 0644 root bin
+f usr/include/sys/agpgart.h 0644 root bin
+f usr/include/sys/aio.h 0644 root bin
+f usr/include/sys/aio_impl.h 0644 root bin
+f usr/include/sys/aio_req.h 0644 root bin
+f usr/include/sys/aiocb.h 0644 root bin
+f usr/include/sys/archsystm.h 0644 root bin
+f usr/include/sys/ascii.h 0644 root bin
+f usr/include/sys/asm_linkage.h 0644 root bin
+f usr/include/sys/asy.h 0644 root bin
+f usr/include/sys/asynch.h 0644 root bin
+f usr/include/sys/atomic.h 0644 root bin
+f usr/include/sys/attr.h 0644 root bin
+d usr/include/sys/audio 0755 root bin
+f usr/include/sys/audio.h 0644 root bin
+f usr/include/sys/audio/ac97.h 0644 root bin
+f usr/include/sys/audio/audio_common.h 0644 root bin
+f usr/include/sys/audio/audio_driver.h 0644 root bin
+f usr/include/sys/audio/audio_oss.h 0644 root bin
+f usr/include/sys/audio/g711.h 0644 root bin
+f usr/include/sys/audioio.h 0644 root bin
+f usr/include/sys/autoconf.h 0644 root bin
+f usr/include/sys/auxv.h 0644 root bin
+f usr/include/sys/auxv_386.h 0644 root bin
+f usr/include/sys/auxv_SPARC.h 0644 root bin
+d usr/include/sys/av 0755 root bin
+f usr/include/sys/av/iec61883.h 0644 root bin
+f usr/include/sys/avintr.h 0644 root bin
+f usr/include/sys/avl.h 0644 root bin
+f usr/include/sys/avl_impl.h 0644 root bin
+f usr/include/sys/bitmap.h 0644 root bin
+f usr/include/sys/bitset.h 0644 root bin
+f usr/include/sys/bl.h 0644 root bin
+f usr/include/sys/blkdev.h 0644 root bin
+f usr/include/sys/bofi.h 0644 root bin
+f usr/include/sys/bofi_impl.h 0644 root bin
+f usr/include/sys/bootconf.h 0644 root bin
+f usr/include/sys/bootregs.h 0644 root bin
+f usr/include/sys/bootstat.h 0644 root bin
+f usr/include/sys/bootsvcs.h 0644 root bin
+f usr/include/sys/bpp_io.h 0644 root bin
+f usr/include/sys/brand.h 0644 root bin
+f usr/include/sys/buf.h 0644 root bin
+f usr/include/sys/bufmod.h 0644 root bin
+f usr/include/sys/bustypes.h 0644 root bin
+f usr/include/sys/byteorder.h 0644 root bin
+f usr/include/sys/callb.h 0644 root bin
+f usr/include/sys/callo.h 0644 root bin
+f usr/include/sys/cap_util.h 0644 root bin
+f usr/include/sys/ccompile.h 0644 root bin
+f usr/include/sys/cdio.h 0644 root bin
+f usr/include/sys/cis.h 0644 root bin
+f usr/include/sys/cis_handlers.h 0644 root bin
+f usr/include/sys/cis_protos.h 0644 root bin
+f usr/include/sys/cladm.h 0644 root bin
+f usr/include/sys/class.h 0644 root bin
+f usr/include/sys/clconf.h 0644 root bin
+f usr/include/sys/clock_impl.h 0644 root bin
+f usr/include/sys/cmlb.h 0644 root bin
+f usr/include/sys/cmn_err.h 0644 root bin
+f usr/include/sys/compress.h 0644 root bin
+f usr/include/sys/condvar.h 0644 root bin
+f usr/include/sys/condvar_impl.h 0644 root bin
+f usr/include/sys/conf.h 0644 root bin
+f usr/include/sys/consdev.h 0644 root bin
+f usr/include/sys/console.h 0644 root bin
+f usr/include/sys/consplat.h 0644 root bin
+d usr/include/sys/contract 0755 root bin
+f usr/include/sys/contract.h 0644 root bin
+f usr/include/sys/contract/device.h 0644 root bin
+f usr/include/sys/contract/device_impl.h 0644 root bin
+f usr/include/sys/contract/process.h 0644 root bin
+f usr/include/sys/contract/process_impl.h 0644 root bin
+f usr/include/sys/contract_impl.h 0644 root bin
+f usr/include/sys/controlregs.h 0644 root bin
+f usr/include/sys/copyops.h 0644 root bin
+f usr/include/sys/core.h 0644 root bin
+f usr/include/sys/corectl.h 0644 root bin
+f usr/include/sys/cpc_impl.h 0644 root bin
+f usr/include/sys/cpc_pcbe.h 0644 root bin
+f usr/include/sys/cpr.h 0644 root bin
+f usr/include/sys/cpu.h 0644 root bin
+f usr/include/sys/cpucaps.h 0644 root bin
+f usr/include/sys/cpucaps_impl.h 0644 root bin
+f usr/include/sys/cpupart.h 0644 root bin
+f usr/include/sys/cpuvar.h 0644 root bin
+f usr/include/sys/crc32.h 0644 root bin
+f usr/include/sys/cred.h 0644 root bin
+f usr/include/sys/cred_impl.h 0644 root bin
+f usr/include/sys/crtctl.h 0644 root bin
+f usr/include/sys/cryptmod.h 0644 root bin
+d usr/include/sys/crypto 0755 root bin
+f usr/include/sys/crypto/api.h 0644 root bin
+f usr/include/sys/crypto/common.h 0644 root bin
+f usr/include/sys/crypto/elfsign.h 0644 root bin
+f usr/include/sys/crypto/impl.h 0644 root bin
+f usr/include/sys/crypto/ioctl.h 0644 root bin
+f usr/include/sys/crypto/ioctladmin.h 0644 root bin
+f usr/include/sys/crypto/ops_impl.h 0644 root bin
+f usr/include/sys/crypto/sched_impl.h 0644 root bin
+f usr/include/sys/crypto/spi.h 0644 root bin
+f usr/include/sys/cs.h 0644 root bin
+f usr/include/sys/cs_priv.h 0644 root bin
+f usr/include/sys/cs_strings.h 0644 root bin
+f usr/include/sys/cs_stubs.h 0644 root bin
+f usr/include/sys/cs_types.h 0644 root bin
+f usr/include/sys/csiioctl.h 0644 root bin
+f usr/include/sys/ctf.h 0644 root bin
+f usr/include/sys/ctf_api.h 0644 root bin
+f usr/include/sys/ctfs.h 0644 root bin
+f usr/include/sys/ctfs_impl.h 0644 root bin
+f usr/include/sys/ctype.h 0644 root bin
+f usr/include/sys/cyclic.h 0644 root bin
+f usr/include/sys/cyclic_impl.h 0644 root bin
+f usr/include/sys/dacf.h 0644 root bin
+f usr/include/sys/dacf_impl.h 0644 root bin
+f usr/include/sys/damap.h 0644 root bin
+f usr/include/sys/damap_impl.h 0644 root bin
+f usr/include/sys/dc_ki.h 0644 root bin
+d usr/include/sys/dcam 0755 root bin
+f usr/include/sys/dcam/dcam1394_io.h 0644 root bin
+f usr/include/sys/ddi.h 0644 root bin
+f usr/include/sys/ddi_hp.h 0644 root bin
+f usr/include/sys/ddi_hp_impl.h 0644 root bin
+f usr/include/sys/ddi_impldefs.h 0644 root bin
+f usr/include/sys/ddi_implfuncs.h 0644 root bin
+f usr/include/sys/ddi_intr.h 0644 root bin
+f usr/include/sys/ddi_intr_impl.h 0644 root bin
+f usr/include/sys/ddi_isa.h 0644 root bin
+f usr/include/sys/ddi_obsolete.h 0644 root bin
+f usr/include/sys/ddi_periodic.h 0644 root bin
+f usr/include/sys/ddidevmap.h 0644 root bin
+f usr/include/sys/ddidmareq.h 0644 root bin
+f usr/include/sys/ddifm.h 0644 root bin
+f usr/include/sys/ddifm_impl.h 0644 root bin
+f usr/include/sys/ddimapreq.h 0644 root bin
+f usr/include/sys/ddipropdefs.h 0644 root bin
+f usr/include/sys/dditypes.h 0644 root bin
+f usr/include/sys/debug.h 0644 root bin
+f usr/include/sys/debugreg.h 0644 root bin
+f usr/include/sys/des.h 0644 root bin
+f usr/include/sys/devcache.h 0644 root bin
+f usr/include/sys/devcache_impl.h 0644 root bin
+f usr/include/sys/devctl.h 0644 root bin
+f usr/include/sys/devfm.h 0644 root bin
+f usr/include/sys/devid_cache.h 0644 root bin
+f usr/include/sys/devinfo_impl.h 0644 root bin
+f usr/include/sys/devops.h 0644 root bin
+f usr/include/sys/devpolicy.h 0644 root bin
+f usr/include/sys/devpoll.h 0644 root bin
+f usr/include/sys/dirent.h 0644 root bin
+f usr/include/sys/disp.h 0644 root bin
+f usr/include/sys/dkbad.h 0644 root bin
+f usr/include/sys/dkio.h 0644 root bin
+f usr/include/sys/dklabel.h 0644 root bin
+d usr/include/sys/dktp 0755 root bin
+f usr/include/sys/dktp/altsctr.h 0644 root bin
+f usr/include/sys/dktp/bbh.h 0644 root bin
+f usr/include/sys/dktp/cm.h 0644 root bin
+f usr/include/sys/dktp/cmdev.h 0644 root bin
+f usr/include/sys/dktp/cmdk.h 0644 root bin
+f usr/include/sys/dktp/cmpkt.h 0644 root bin
+f usr/include/sys/dktp/controller.h 0644 root bin
+f usr/include/sys/dktp/dadev.h 0644 root bin
+f usr/include/sys/dktp/dadk.h 0644 root bin
+f usr/include/sys/dktp/dadkio.h 0644 root bin
+f usr/include/sys/dktp/fctypes.h 0644 root bin
+f usr/include/sys/dktp/fdisk.h 0644 root bin
+f usr/include/sys/dktp/flowctrl.h 0644 root bin
+f usr/include/sys/dktp/gda.h 0644 root bin
+f usr/include/sys/dktp/quetypes.h 0644 root bin
+f usr/include/sys/dktp/queue.h 0644 root bin
+f usr/include/sys/dktp/tgcom.h 0644 root bin
+f usr/include/sys/dktp/tgdk.h 0644 root bin
+f usr/include/sys/dl.h 0644 root bin
+f usr/include/sys/dld.h 0644 root bin
+f usr/include/sys/dld_impl.h 0644 root bin
+f usr/include/sys/dld_ioc.h 0644 root bin
+f usr/include/sys/dlpi.h 0644 root bin
+f usr/include/sys/dls.h 0644 root bin
+f usr/include/sys/dls_impl.h 0644 root bin
+f usr/include/sys/dls_mgmt.h 0644 root bin
+f usr/include/sys/dma_engine.h 0644 root bin
+f usr/include/sys/dma_i8237A.h 0644 root bin
+f usr/include/sys/dnlc.h 0644 root bin
+f usr/include/sys/door.h 0644 root bin
+f usr/include/sys/door_data.h 0644 root bin
+f usr/include/sys/door_impl.h 0644 root bin
+f usr/include/sys/dtrace.h 0644 root bin
+f usr/include/sys/dtrace_impl.h 0644 root bin
+f usr/include/sys/dumpadm.h 0644 root bin
+f usr/include/sys/dumphdr.h 0644 root bin
+f usr/include/sys/ecppio.h 0644 root bin
+f usr/include/sys/ecppreg.h 0644 root bin
+f usr/include/sys/ecppsys.h 0644 root bin
+f usr/include/sys/ecppvar.h 0644 root bin
+f usr/include/sys/efi_partition.h 0644 root bin
+f usr/include/sys/elf.h 0644 root bin
+f usr/include/sys/elf_386.h 0644 root bin
+f usr/include/sys/elf_SPARC.h 0644 root bin
+f usr/include/sys/elf_amd64.h 0644 root bin
+f usr/include/sys/elf_notes.h 0644 root bin
+f usr/include/sys/elftypes.h 0644 root bin
+f usr/include/sys/emul64.h 0644 root bin
+f usr/include/sys/emul64cmd.h 0644 root bin
+f usr/include/sys/emul64var.h 0644 root bin
+f usr/include/sys/epm.h 0644 root bin
+f usr/include/sys/errno.h 0644 root bin
+f usr/include/sys/errorq.h 0644 root bin
+f usr/include/sys/errorq_impl.h 0644 root bin
+f usr/include/sys/esunddi.h 0644 root bin
+f usr/include/sys/ethernet.h 0644 root bin
+f usr/include/sys/euc.h 0644 root bin
+f usr/include/sys/eucioctl.h 0644 root bin
+f usr/include/sys/exacct.h 0644 root bin
+f usr/include/sys/exacct_catalog.h 0644 root bin
+f usr/include/sys/exacct_impl.h 0644 root bin
+f usr/include/sys/exec.h 0644 root bin
+f usr/include/sys/exechdr.h 0644 root bin
+f usr/include/sys/extdirent.h 0644 root bin
+f usr/include/sys/fasttrap.h 0644 root bin
+f usr/include/sys/fasttrap_impl.h 0644 root bin
+f usr/include/sys/fasttrap_isa.h 0644 root bin
+f usr/include/sys/fault.h 0644 root bin
+f usr/include/sys/fbio.h 0644 root bin
+f usr/include/sys/fbuf.h 0644 root bin
+d usr/include/sys/fc4 0755 root bin
+f usr/include/sys/fc4/fc.h 0644 root bin
+f usr/include/sys/fc4/fc_transport.h 0644 root bin
+f usr/include/sys/fc4/fcal.h 0644 root bin
+f usr/include/sys/fc4/fcal_linkapp.h 0644 root bin
+f usr/include/sys/fc4/fcal_transport.h 0644 root bin
+f usr/include/sys/fc4/fcio.h 0644 root bin
+f usr/include/sys/fc4/fcp.h 0644 root bin
+f usr/include/sys/fc4/linkapp.h 0644 root bin
+f usr/include/sys/fcntl.h 0644 root bin
+f usr/include/sys/fct.h 0644 root bin
+f usr/include/sys/fct_defines.h 0644 root bin
+f usr/include/sys/fctio.h 0644 root bin
+f usr/include/sys/fd_debug.h 0644 root bin
+f usr/include/sys/fdbuffer.h 0644 root bin
+f usr/include/sys/fdc.h 0644 root bin
+f usr/include/sys/fdio.h 0644 root bin
+f usr/include/sys/fdmedia.h 0644 root bin
+f usr/include/sys/feature_tests.h 0644 root bin
+f usr/include/sys/fem.h 0644 root bin
+d usr/include/sys/fibre-channel 0755 root bin
+f usr/include/sys/fibre-channel/fc.h 0644 root bin
+f usr/include/sys/fibre-channel/fc_appif.h 0644 root bin
+f usr/include/sys/fibre-channel/fc_types.h 0644 root bin
+f usr/include/sys/fibre-channel/fcio.h 0644 root bin
+d usr/include/sys/fibre-channel/impl 0755 root bin
+f usr/include/sys/fibre-channel/impl/fc_error.h 0644 root bin
+f usr/include/sys/fibre-channel/impl/fcph.h 0644 root bin
+d usr/include/sys/fibre-channel/ulp 0755 root bin
+f usr/include/sys/fibre-channel/ulp/fcp_util.h 0644 root bin
+f usr/include/sys/fibre-channel/ulp/fcsm.h 0644 root bin
+f usr/include/sys/file.h 0644 root bin
+f usr/include/sys/filio.h 0644 root bin
+f usr/include/sys/flock.h 0644 root bin
+f usr/include/sys/flock_impl.h 0644 root bin
+d usr/include/sys/fm 0755 root bin
+d usr/include/sys/fm/cpu 0755 root bin
+d usr/include/sys/fm/fs 0755 root bin
+f usr/include/sys/fm/fs/zfs.h 0644 root bin
+d usr/include/sys/fm/io 0755 root bin
+f usr/include/sys/fm/io/ddi.h 0644 root bin
+f usr/include/sys/fm/io/disk.h 0644 root bin
+f usr/include/sys/fm/io/opl_mc_fm.h 0644 root bin
+f usr/include/sys/fm/io/pci.h 0644 root bin
+f usr/include/sys/fm/io/scsi.h 0644 root bin
+f usr/include/sys/fm/io/sun4upci.h 0644 root bin
+f usr/include/sys/fm/protocol.h 0644 root bin
+f usr/include/sys/fm/util.h 0644 root bin
+f usr/include/sys/fork.h 0644 root bin
+f usr/include/sys/fp.h 0644 root bin
+f usr/include/sys/frame.h 0644 root bin
+d usr/include/sys/fs 0755 root bin
+f usr/include/sys/fs/autofs.h 0644 root bin
+f usr/include/sys/fs/cachefs_dir.h 0644 root bin
+f usr/include/sys/fs/cachefs_dlog.h 0644 root bin
+f usr/include/sys/fs/cachefs_filegrp.h 0644 root bin
+f usr/include/sys/fs/cachefs_fs.h 0644 root bin
+f usr/include/sys/fs/cachefs_fscache.h 0644 root bin
+f usr/include/sys/fs/cachefs_ioctl.h 0644 root bin
+f usr/include/sys/fs/cachefs_log.h 0644 root bin
+f usr/include/sys/fs/decomp.h 0644 root bin
+f usr/include/sys/fs/dv_node.h 0644 root bin
+f usr/include/sys/fs/fifonode.h 0644 root bin
+f usr/include/sys/fs/hsfs_isospec.h 0644 root bin
+f usr/include/sys/fs/hsfs_node.h 0644 root bin
+f usr/include/sys/fs/hsfs_rrip.h 0644 root bin
+f usr/include/sys/fs/hsfs_spec.h 0644 root bin
+f usr/include/sys/fs/hsfs_susp.h 0644 root bin
+f usr/include/sys/fs/hyprlofs.h 0644 root bin
+f usr/include/sys/fs/hyprlofs_info.h 0644 root bin
+f usr/include/sys/fs/lofs_info.h 0644 root bin
+f usr/include/sys/fs/lofs_node.h 0644 root bin
+f usr/include/sys/fs/mntdata.h 0644 root bin
+f usr/include/sys/fs/namenode.h 0644 root bin
+f usr/include/sys/fs/pc_dir.h 0644 root bin
+f usr/include/sys/fs/pc_fs.h 0644 root bin
+f usr/include/sys/fs/pc_label.h 0644 root bin
+f usr/include/sys/fs/pc_node.h 0644 root bin
+f usr/include/sys/fs/pxfs_ki.h 0644 root bin
+f usr/include/sys/fs/sdev_impl.h 0644 root bin
+f usr/include/sys/fs/snode.h 0644 root bin
+f usr/include/sys/fs/swapnode.h 0644 root bin
+f usr/include/sys/fs/tmp.h 0644 root bin
+f usr/include/sys/fs/tmpnode.h 0644 root bin
+f usr/include/sys/fs/udf_inode.h 0644 root bin
+f usr/include/sys/fs/udf_volume.h 0644 root bin
+f usr/include/sys/fs/ufs_acl.h 0644 root bin
+f usr/include/sys/fs/ufs_bio.h 0644 root bin
+f usr/include/sys/fs/ufs_filio.h 0644 root bin
+f usr/include/sys/fs/ufs_fs.h 0644 root bin
+f usr/include/sys/fs/ufs_fsdir.h 0644 root bin
+f usr/include/sys/fs/ufs_inode.h 0644 root bin
+f usr/include/sys/fs/ufs_lockfs.h 0644 root bin
+f usr/include/sys/fs/ufs_log.h 0644 root bin
+f usr/include/sys/fs/ufs_mount.h 0644 root bin
+f usr/include/sys/fs/ufs_panic.h 0644 root bin
+f usr/include/sys/fs/ufs_prot.h 0644 root bin
+f usr/include/sys/fs/ufs_quota.h 0644 root bin
+f usr/include/sys/fs/ufs_snap.h 0644 root bin
+f usr/include/sys/fs/ufs_trans.h 0644 root bin
+f usr/include/sys/fs/zfs.h 0644 root bin
+f usr/include/sys/fs/zut.h 0644 root bin
+f usr/include/sys/fs_reparse.h 0644 root bin
+f usr/include/sys/fs_subr.h 0644 root bin
+f usr/include/sys/fsid.h 0644 root bin
+f usr/include/sys/fss.h 0644 root bin
+f usr/include/sys/fssnap.h 0644 root bin
+f usr/include/sys/fssnap_if.h 0644 root bin
+f usr/include/sys/fsspriocntl.h 0644 root bin
+f usr/include/sys/fstyp.h 0644 root bin
+f usr/include/sys/ftrace.h 0644 root bin
+f usr/include/sys/fx.h 0644 root bin
+f usr/include/sys/fxpriocntl.h 0644 root bin
+f usr/include/sys/gfs.h 0644 root bin
+f usr/include/sys/gld.h 0644 root bin
+f usr/include/sys/gldpriv.h 0644 root bin
+f usr/include/sys/group.h 0644 root bin
+f usr/include/sys/hdio.h 0644 root bin
+f usr/include/sys/hook.h 0644 root bin
+f usr/include/sys/hook_event.h 0644 root bin
+f usr/include/sys/hook_impl.h 0644 root bin
+d usr/include/sys/hotplug 0755 root bin
+f usr/include/sys/hotplug/hpcsvc.h 0644 root bin
+f usr/include/sys/hotplug/hpctrl.h 0644 root bin
+d usr/include/sys/hotplug/pci 0755 root bin
+f usr/include/sys/hotplug/pci/pcicfg.h 0644 root bin
+f usr/include/sys/hotplug/pci/pcihp.h 0644 root bin
+f usr/include/sys/hwconf.h 0644 root bin
+f usr/include/sys/hypervisor.h 0644 root bin
+f usr/include/sys/i8272A.h 0644 root bin
+f usr/include/sys/ia.h 0644 root bin
+f usr/include/sys/iapriocntl.h 0644 root bin
+d usr/include/sys/ib 0755 root bin
+d usr/include/sys/ib/adapters 0755 root bin
+d usr/include/sys/ib/adapters/hermon 0755 root bin
+f usr/include/sys/ib/adapters/hermon/hermon_ioctl.h 0644 root bin
+f usr/include/sys/ib/adapters/mlnx_umap.h 0644 root bin
+d usr/include/sys/ib/adapters/tavor 0755 root bin
+f usr/include/sys/ib/adapters/tavor/tavor_ioctl.h 0644 root bin
+d usr/include/sys/ib/clients 0755 root bin
+d usr/include/sys/ib/clients/ibd 0755 root bin
+f usr/include/sys/ib/clients/ibd/ibd.h 0644 root bin
+d usr/include/sys/ib/clients/of 0755 root bin
+f usr/include/sys/ib/clients/of/ofa_solaris.h 0644 root bin
+f usr/include/sys/ib/clients/of/ofed_kernel.h 0644 root bin
+d usr/include/sys/ib/clients/of/rdma 0755 root bin
+f usr/include/sys/ib/clients/of/rdma/ib_addr.h 0644 root bin
+f usr/include/sys/ib/clients/of/rdma/ib_user_mad.h 0644 root bin
+f usr/include/sys/ib/clients/of/rdma/ib_user_sa.h 0644 root bin
+f usr/include/sys/ib/clients/of/rdma/ib_user_verbs.h 0644 root bin
+f usr/include/sys/ib/clients/of/rdma/ib_verbs.h 0644 root bin
+f usr/include/sys/ib/clients/of/rdma/rdma_cm.h 0644 root bin
+f usr/include/sys/ib/clients/of/rdma/rdma_user_cm.h 0644 root bin
+d usr/include/sys/ib/clients/of/sol_ofs 0755 root bin
+f usr/include/sys/ib/clients/of/sol_ofs/sol_cma.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_ofs/sol_ib_cma.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_ofs/sol_kverb_impl.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_ofs/sol_ofs_common.h 0644 root bin
+d usr/include/sys/ib/clients/of/sol_ucma 0755 root bin
+f usr/include/sys/ib/clients/of/sol_ucma/sol_rdma_user_cm.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_ucma/sol_ucma.h 0644 root bin
+d usr/include/sys/ib/clients/of/sol_umad 0755 root bin
+f usr/include/sys/ib/clients/of/sol_umad/sol_umad.h 0644 root bin
+d usr/include/sys/ib/clients/of/sol_uverbs 0755 root bin
+f usr/include/sys/ib/clients/of/sol_uverbs/sol_uverbs.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_uverbs/sol_uverbs2ucma.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_uverbs/sol_uverbs_comp.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_uverbs/sol_uverbs_event.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_uverbs/sol_uverbs_hca.h 0644 root bin
+f usr/include/sys/ib/clients/of/sol_uverbs/sol_uverbs_qp.h 0644 root bin
+f usr/include/sys/ib/ib_pkt_hdrs.h 0644 root bin
+f usr/include/sys/ib/ib_types.h 0644 root bin
+d usr/include/sys/ib/ibnex 0755 root bin
+f usr/include/sys/ib/ibnex/ibnex_devctl.h 0644 root bin
+d usr/include/sys/ib/ibtl 0755 root bin
+f usr/include/sys/ib/ibtl/ibci.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibti.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibti_cm.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibti_common.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibtl_ci_types.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibtl_status.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibtl_types.h 0644 root bin
+f usr/include/sys/ib/ibtl/ibvti.h 0644 root bin
+d usr/include/sys/ib/ibtl/impl 0755 root bin
+f usr/include/sys/ib/ibtl/impl/ibtl_util.h 0644 root bin
+d usr/include/sys/ib/mgt 0755 root bin
+f usr/include/sys/ib/mgt/ib_dm_attr.h 0644 root bin
+f usr/include/sys/ib/mgt/ib_mad.h 0644 root bin
+d usr/include/sys/ib/mgt/ibmf 0755 root bin
+f usr/include/sys/ib/mgt/ibmf/ibmf.h 0644 root bin
+f usr/include/sys/ib/mgt/ibmf/ibmf_msg.h 0644 root bin
+f usr/include/sys/ib/mgt/ibmf/ibmf_saa.h 0644 root bin
+f usr/include/sys/ib/mgt/ibmf/ibmf_utils.h 0644 root bin
+f usr/include/sys/ib/mgt/sa_recs.h 0644 root bin
+f usr/include/sys/ib/mgt/sm_attr.h 0644 root bin
+f usr/include/sys/ibpart.h 0644 root bin
+f usr/include/sys/id32.h 0644 root bin
+f usr/include/sys/id_space.h 0644 root bin
+d usr/include/sys/idm 0755 root bin
+f usr/include/sys/idm/idm.h 0644 root bin
+f usr/include/sys/idm/idm_conn_sm.h 0644 root bin
+f usr/include/sys/idm/idm_impl.h 0644 root bin
+f usr/include/sys/idm/idm_so.h 0644 root bin
+f usr/include/sys/idm/idm_text.h 0644 root bin
+f usr/include/sys/idm/idm_transport.h 0644 root bin
+f usr/include/sys/idmap.h 0644 root bin
+f usr/include/sys/inline.h 0644 root bin
+f usr/include/sys/instance.h 0644 root bin
+f usr/include/sys/int_const.h 0644 root bin
+f usr/include/sys/int_fmtio.h 0644 root bin
+f usr/include/sys/int_limits.h 0644 root bin
+f usr/include/sys/int_types.h 0644 root bin
+f usr/include/sys/inttypes.h 0644 root bin
+f usr/include/sys/ioccom.h 0644 root bin
+f usr/include/sys/ioctl.h 0644 root bin
+f usr/include/sys/iommulib.h 0644 root bin
+f usr/include/sys/ipc.h 0644 root bin
+f usr/include/sys/ipc_impl.h 0644 root bin
+f usr/include/sys/ipc_rctl.h 0644 root bin
+f usr/include/sys/ipmi.h 0644 root bin
+f usr/include/sys/isa_defs.h 0644 root bin
+f usr/include/sys/iscsi_authclient.h 0644 root bin
+f usr/include/sys/iscsi_authclientglue.h 0644 root bin
+f usr/include/sys/iscsi_protocol.h 0644 root bin
+d usr/include/sys/iscsit 0755 root bin
+f usr/include/sys/iscsit/chap.h 0644 root bin
+f usr/include/sys/iscsit/iscsi_if.h 0644 root bin
+f usr/include/sys/iscsit/iscsit_common.h 0644 root bin
+f usr/include/sys/iscsit/isns_protocol.h 0644 root bin
+f usr/include/sys/iscsit/radius_packet.h 0644 root bin
+f usr/include/sys/iscsit/radius_protocol.h 0644 root bin
+d usr/include/sys/iso 0755 root bin
+f usr/include/sys/iso/signal_iso.h 0644 root bin
+f usr/include/sys/jioctl.h 0644 root bin
+f usr/include/sys/kbd.h 0644 root bin
+f usr/include/sys/kbdreg.h 0644 root bin
+f usr/include/sys/kbio.h 0644 root bin
+f usr/include/sys/kcpc.h 0644 root bin
+f usr/include/sys/kd.h 0644 root bin
+f usr/include/sys/kdi.h 0644 root bin
+f usr/include/sys/kdi_impl.h 0644 root bin
+f usr/include/sys/kdi_machimpl.h 0644 root bin
+f usr/include/sys/kdi_regs.h 0644 root bin
+f usr/include/sys/kiconv.h 0644 root bin
+f usr/include/sys/kiconv_big5_utf8.h 0644 root bin
+f usr/include/sys/kiconv_cck_common.h 0644 root bin
+f usr/include/sys/kiconv_cp950hkscs_utf8.h 0644 root bin
+f usr/include/sys/kiconv_emea1.h 0644 root bin
+f usr/include/sys/kiconv_emea2.h 0644 root bin
+f usr/include/sys/kiconv_euckr_utf8.h 0644 root bin
+f usr/include/sys/kiconv_euctw_utf8.h 0644 root bin
+f usr/include/sys/kiconv_gb18030_utf8.h 0644 root bin
+f usr/include/sys/kiconv_gb2312_utf8.h 0644 root bin
+f usr/include/sys/kiconv_hkscs_utf8.h 0644 root bin
+f usr/include/sys/kiconv_ja.h 0644 root bin
+f usr/include/sys/kiconv_ja_jis_to_unicode.h 0644 root bin
+f usr/include/sys/kiconv_ja_unicode_to_jis.h 0644 root bin
+f usr/include/sys/kiconv_ko.h 0644 root bin
+f usr/include/sys/kiconv_latin1.h 0644 root bin
+f usr/include/sys/kiconv_sc.h 0644 root bin
+f usr/include/sys/kiconv_tc.h 0644 root bin
+f usr/include/sys/kiconv_uhc_utf8.h 0644 root bin
+f usr/include/sys/kiconv_utf8_big5.h 0644 root bin
+f usr/include/sys/kiconv_utf8_cp950hkscs.h 0644 root bin
+f usr/include/sys/kiconv_utf8_euckr.h 0644 root bin
+f usr/include/sys/kiconv_utf8_euctw.h 0644 root bin
+f usr/include/sys/kiconv_utf8_gb18030.h 0644 root bin
+f usr/include/sys/kiconv_utf8_gb2312.h 0644 root bin
+f usr/include/sys/kiconv_utf8_hkscs.h 0644 root bin
+f usr/include/sys/kiconv_utf8_uhc.h 0644 root bin
+f usr/include/sys/kidmap.h 0644 root bin
+f usr/include/sys/klpd.h 0644 root bin
+f usr/include/sys/klwp.h 0644 root bin
+f usr/include/sys/kmdb.h 0644 root bin
+f usr/include/sys/kmem.h 0644 root bin
+f usr/include/sys/kmem_impl.h 0644 root bin
+f usr/include/sys/kobj.h 0644 root bin
+f usr/include/sys/kobj_impl.h 0644 root bin
+f usr/include/sys/ksocket.h 0644 root bin
+f usr/include/sys/kstat.h 0644 root bin
+f usr/include/sys/kstr.h 0644 root bin
+f usr/include/sys/ksyms.h 0644 root bin
+f usr/include/sys/ksynch.h 0644 root bin
+f usr/include/sys/lc_core.h 0644 root bin
+f usr/include/sys/ldterm.h 0644 root bin
+f usr/include/sys/lgrp.h 0644 root bin
+f usr/include/sys/lgrp_user.h 0644 root bin
+f usr/include/sys/libc_kernel.h 0644 root bin
+f usr/include/sys/libdevid.h 0644 root bin
+f usr/include/sys/link.h 0644 root bin
+f usr/include/sys/list.h 0644 root bin
+f usr/include/sys/list_impl.h 0644 root bin
+f usr/include/sys/llc1.h 0644 root bin
+f usr/include/sys/loadavg.h 0644 root bin
+f usr/include/sys/localedef.h 0644 root bin
+f usr/include/sys/lock.h 0644 root bin
+f usr/include/sys/lockfs.h 0644 root bin
+f usr/include/sys/lockstat.h 0644 root bin
+f usr/include/sys/lofi.h 0644 root bin
+f usr/include/sys/log.h 0644 root bin
+f usr/include/sys/logindmux.h 0644 root bin
+f usr/include/sys/logindmux_impl.h 0644 root bin
+f usr/include/sys/lpif.h 0644 root bin
+d usr/include/sys/lvm 0755 root bin
+f usr/include/sys/lvm/md_basic.h 0644 root bin
+f usr/include/sys/lvm/md_convert.h 0644 root bin
+f usr/include/sys/lvm/md_crc.h 0644 root bin
+f usr/include/sys/lvm/md_hotspares.h 0644 root bin
+f usr/include/sys/lvm/md_mddb.h 0644 root bin
+f usr/include/sys/lvm/md_mdiox.h 0644 root bin
+f usr/include/sys/lvm/md_mhdx.h 0644 root bin
+f usr/include/sys/lvm/md_mirror.h 0644 root bin
+f usr/include/sys/lvm/md_mirror_shared.h 0644 root bin
+f usr/include/sys/lvm/md_names.h 0644 root bin
+f usr/include/sys/lvm/md_notify.h 0644 root bin
+f usr/include/sys/lvm/md_raid.h 0644 root bin
+f usr/include/sys/lvm/md_rename.h 0644 root bin
+f usr/include/sys/lvm/md_sp.h 0644 root bin
+f usr/include/sys/lvm/md_stripe.h 0644 root bin
+f usr/include/sys/lvm/md_trans.h 0644 root bin
+f usr/include/sys/lvm/mdio.h 0644 root bin
+f usr/include/sys/lvm/mdmed.h 0644 root bin
+f usr/include/sys/lvm/mdmn_commd.h 0644 root bin
+f usr/include/sys/lvm/mdvar.h 0644 root bin
+f usr/include/sys/lwp.h 0644 root bin
+f usr/include/sys/lwp_timer_impl.h 0644 root bin
+f usr/include/sys/lwp_upimutex_impl.h 0644 root bin
+f usr/include/sys/mac.h 0644 root bin
+f usr/include/sys/mac_client.h 0644 root bin
+f usr/include/sys/mac_client_impl.h 0644 root bin
+f usr/include/sys/mac_ether.h 0644 root bin
+f usr/include/sys/mac_flow.h 0644 root bin
+f usr/include/sys/mac_flow_impl.h 0644 root bin
+f usr/include/sys/mac_impl.h 0644 root bin
+f usr/include/sys/mac_provider.h 0644 root bin
+f usr/include/sys/mac_soft_ring.h 0644 root bin
+f usr/include/sys/mac_stat.h 0644 root bin
+f usr/include/sys/machelf.h 0644 root bin
+f usr/include/sys/machlock.h 0644 root bin
+f usr/include/sys/machsig.h 0644 root bin
+f usr/include/sys/machtypes.h 0644 root bin
+f usr/include/sys/map.h 0644 root bin
+f usr/include/sys/mc.h 0644 root bin
+f usr/include/sys/mc_amd.h 0644 root bin
+f usr/include/sys/mc_intel.h 0644 root bin
+f usr/include/sys/mca_amd.h 0644 root bin
+f usr/include/sys/mca_x86.h 0644 root bin
+f usr/include/sys/md4.h 0644 root bin
+f usr/include/sys/md5.h 0644 root bin
+f usr/include/sys/md5_consts.h 0644 root bin
+f usr/include/sys/mdb_modapi.h 0644 root bin
+f usr/include/sys/mdi_impldefs.h 0644 root bin
+f usr/include/sys/mem.h 0644 root bin
+f usr/include/sys/mem_config.h 0644 root bin
+f usr/include/sys/memlist.h 0644 root bin
+f usr/include/sys/mhd.h 0644 root bin
+f usr/include/sys/mii.h 0644 root bin
+f usr/include/sys/miiregs.h 0644 root bin
+f usr/include/sys/mixer.h 0644 root bin
+f usr/include/sys/mkdev.h 0644 root bin
+f usr/include/sys/mman.h 0644 root bin
+f usr/include/sys/mmapobj.h 0644 root bin
+f usr/include/sys/mntent.h 0644 root bin
+f usr/include/sys/mntio.h 0644 root bin
+f usr/include/sys/mnttab.h 0644 root bin
+f usr/include/sys/modctl.h 0644 root bin
+f usr/include/sys/mode.h 0644 root bin
+f usr/include/sys/model.h 0644 root bin
+f usr/include/sys/modhash.h 0644 root bin
+f usr/include/sys/modhash_impl.h 0644 root bin
+f usr/include/sys/mount.h 0644 root bin
+f usr/include/sys/mouse.h 0644 root bin
+f usr/include/sys/msacct.h 0644 root bin
+f usr/include/sys/msg.h 0644 root bin
+f usr/include/sys/msg_impl.h 0644 root bin
+f usr/include/sys/msio.h 0644 root bin
+f usr/include/sys/msreg.h 0644 root bin
+f usr/include/sys/mtio.h 0644 root bin
+f usr/include/sys/multidata.h 0644 root bin
+f usr/include/sys/multidata_impl.h 0644 root bin
+f usr/include/sys/mutex.h 0644 root bin
+f usr/include/sys/mutex_impl.h 0644 root bin
+f usr/include/sys/nbmlock.h 0644 root bin
+d usr/include/sys/ncall 0755 root bin
+f usr/include/sys/ncall/ncall.h 0644 root bin
+f usr/include/sys/ncall/ncall_module.h 0644 root bin
+f usr/include/sys/ndi_impldefs.h 0644 root bin
+f usr/include/sys/ndifm.h 0644 root bin
+f usr/include/sys/net80211.h 0644 root bin
+f usr/include/sys/net80211_crypto.h 0644 root bin
+f usr/include/sys/net80211_ht.h 0644 root bin
+f usr/include/sys/net80211_proto.h 0644 root bin
+f usr/include/sys/netconfig.h 0644 root bin
+f usr/include/sys/neti.h 0644 root bin
+f usr/include/sys/netstack.h 0644 root bin
+f usr/include/sys/nexusdefs.h 0644 root bin
+f usr/include/sys/note.h 0644 root bin
+f usr/include/sys/nsc_ddi.h 0644 root bin
+f usr/include/sys/nsc_thread.h 0644 root bin
+d usr/include/sys/nsctl 0755 root bin
+f usr/include/sys/nsctl/cfg.h 0644 root bin
+f usr/include/sys/nsctl/cfg_cluster.h 0644 root bin
+f usr/include/sys/nsctl/cfg_impl.h 0644 root bin
+f usr/include/sys/nsctl/cfg_lockd.h 0644 root bin
+f usr/include/sys/nsctl/contract.h 0644 root bin
+f usr/include/sys/nsctl/dsw.h 0644 root bin
+f usr/include/sys/nsctl/dsw_dev.h 0644 root bin
+f usr/include/sys/nsctl/librdc.h 0644 root bin
+f usr/include/sys/nsctl/model.h 0644 root bin
+f usr/include/sys/nsctl/ncall_inter.h 0644 root bin
+f usr/include/sys/nsctl/nsc_dev.h 0644 root bin
+f usr/include/sys/nsctl/nsc_disk.h 0644 root bin
+f usr/include/sys/nsctl/nsc_gen.h 0644 root bin
+f usr/include/sys/nsctl/nsc_hash.h 0644 root bin
+f usr/include/sys/nsctl/nsc_ioctl.h 0644 root bin
+f usr/include/sys/nsctl/nsc_mem.h 0644 root bin
+f usr/include/sys/nsctl/nsc_power.h 0644 root bin
+f usr/include/sys/nsctl/nsc_rmspin.h 0644 root bin
+f usr/include/sys/nsctl/nsctl.h 0644 root bin
+f usr/include/sys/nsctl/nsctl_inter.h 0644 root bin
+f usr/include/sys/nsctl/nsvers.h 0644 root bin
+f usr/include/sys/nsctl/rdc.h 0644 root bin
+f usr/include/sys/nsctl/rdc_bitmap.h 0644 root bin
+f usr/include/sys/nsctl/rdc_diskq.h 0644 root bin
+f usr/include/sys/nsctl/rdc_io.h 0644 root bin
+f usr/include/sys/nsctl/rdc_ioctl.h 0644 root bin
+f usr/include/sys/nsctl/rdc_prot.h 0644 root bin
+f usr/include/sys/nsctl/rdcerr.h 0644 root bin
+f usr/include/sys/nsctl/rdcrules.h 0644 root bin
+f usr/include/sys/nsctl/safestore.h 0644 root bin
+f usr/include/sys/nsctl/sd_bcache.h 0644 root bin
+f usr/include/sys/nsctl/sd_cache.h 0644 root bin
+f usr/include/sys/nsctl/sd_conf.h 0644 root bin
+f usr/include/sys/nsctl/sd_hash.h 0644 root bin
+f usr/include/sys/nsctl/sd_pcu.h 0644 root bin
+f usr/include/sys/nsctl/sd_trace.h 0644 root bin
+f usr/include/sys/nsctl/sdbc_ioctl.h 0644 root bin
+f usr/include/sys/nsctl/sv.h 0644 root bin
+f usr/include/sys/nsctl/sv_efi.h 0644 root bin
+f usr/include/sys/nsctl/sv_impl.h 0644 root bin
+f usr/include/sys/nskernd.h 0644 root bin
+f usr/include/sys/nvpair.h 0644 root bin
+f usr/include/sys/nvpair_impl.h 0644 root bin
+f usr/include/sys/objfs.h 0644 root bin
+f usr/include/sys/objfs_impl.h 0644 root bin
+f usr/include/sys/obpdefs.h 0644 root bin
+f usr/include/sys/old_procfs.h 0644 root bin
+f usr/include/sys/ontrap.h 0644 root bin
+f usr/include/sys/open.h 0644 root bin
+f usr/include/sys/openpromio.h 0644 root bin
+f usr/include/sys/panic.h 0644 root bin
+f usr/include/sys/param.h 0644 root bin
+f usr/include/sys/pathconf.h 0644 root bin
+f usr/include/sys/pathname.h 0644 root bin
+f usr/include/sys/pattr.h 0644 root bin
+f usr/include/sys/pbio.h 0644 root bin
+f usr/include/sys/pcb.h 0644 root bin
+f usr/include/sys/pccard.h 0644 root bin
+f usr/include/sys/pci.h 0644 root bin
+f usr/include/sys/pci_impl.h 0644 root bin
+f usr/include/sys/pci_tools.h 0644 root bin
+f usr/include/sys/pcic_reg.h 0644 root bin
+f usr/include/sys/pcic_var.h 0644 root bin
+f usr/include/sys/pcie.h 0644 root bin
+f usr/include/sys/pcmcia.h 0644 root bin
+f usr/include/sys/pctypes.h 0644 root bin
+f usr/include/sys/pfmod.h 0644 root bin
+f usr/include/sys/pg.h 0644 root bin
+f usr/include/sys/pghw.h 0644 root bin
+f usr/include/sys/physmem.h 0644 root bin
+f usr/include/sys/pic.h 0644 root bin
+f usr/include/sys/pit.h 0644 root bin
+f usr/include/sys/pkp_hash.h 0644 root bin
+f usr/include/sys/pm.h 0644 root bin
+f usr/include/sys/pmem.h 0644 root bin
+f usr/include/sys/policy.h 0644 root bin
+f usr/include/sys/poll.h 0644 root bin
+f usr/include/sys/poll_impl.h 0644 root bin
+f usr/include/sys/pool.h 0644 root bin
+f usr/include/sys/pool_impl.h 0644 root bin
+f usr/include/sys/pool_pset.h 0644 root bin
+f usr/include/sys/port.h 0644 root bin
+f usr/include/sys/port_impl.h 0644 root bin
+f usr/include/sys/port_kernel.h 0644 root bin
+f usr/include/sys/portif.h 0644 root bin
+f usr/include/sys/ppmio.h 0644 root bin
+f usr/include/sys/pppt_ic_if.h 0644 root bin
+f usr/include/sys/pppt_ioctl.h 0644 root bin
+f usr/include/sys/priocntl.h 0644 root bin
+f usr/include/sys/priv.h 0644 root bin
+f usr/include/sys/priv_const.h 0644 root bin
+f usr/include/sys/priv_impl.h 0644 root bin
+f usr/include/sys/priv_names.h 0644 root bin
+f usr/include/sys/privmregs.h 0644 root bin
+f usr/include/sys/privregs.h 0644 root bin
+f usr/include/sys/prnio.h 0644 root bin
+d usr/include/sys/proc 0755 root bin
+f usr/include/sys/proc.h 0644 root bin
+f usr/include/sys/proc/prdata.h 0644 root bin
+f usr/include/sys/processor.h 0644 root bin
+f usr/include/sys/procfs.h 0644 root bin
+f usr/include/sys/procfs_isa.h 0644 root bin
+f usr/include/sys/procset.h 0644 root bin
+f usr/include/sys/project.h 0644 root bin
+f usr/include/sys/prom_emul.h 0644 root bin
+f usr/include/sys/prom_isa.h 0644 root bin
+f usr/include/sys/prom_plat.h 0644 root bin
+f usr/include/sys/promif.h 0644 root bin
+f usr/include/sys/promimpl.h 0644 root bin
+f usr/include/sys/protosw.h 0644 root bin
+f usr/include/sys/prsystm.h 0644 root bin
+f usr/include/sys/pset.h 0644 root bin
+f usr/include/sys/pshot.h 0644 root bin
+f usr/include/sys/psw.h 0644 root bin
+f usr/include/sys/pte.h 0644 root bin
+f usr/include/sys/ptem.h 0644 root bin
+f usr/include/sys/ptms.h 0644 root bin
+f usr/include/sys/ptyvar.h 0644 root bin
+f usr/include/sys/queue.h 0644 root bin
+f usr/include/sys/raidioctl.h 0644 root bin
+f usr/include/sys/ramdisk.h 0644 root bin
+f usr/include/sys/random.h 0644 root bin
+f usr/include/sys/rctl.h 0644 root bin
+f usr/include/sys/rctl_impl.h 0644 root bin
+f usr/include/sys/rds.h 0644 root bin
+f usr/include/sys/reboot.h 0644 root bin
+f usr/include/sys/refstr.h 0644 root bin
+f usr/include/sys/refstr_impl.h 0644 root bin
+f usr/include/sys/reg.h 0644 root bin
+f usr/include/sys/regset.h 0644 root bin
+f usr/include/sys/resource.h 0644 root bin
+f usr/include/sys/rlioctl.h 0644 root bin
+d usr/include/sys/rsm 0755 root bin
+f usr/include/sys/rsm/rsm.h 0644 root bin
+f usr/include/sys/rsm/rsm_common.h 0644 root bin
+f usr/include/sys/rsm/rsmapi_common.h 0644 root bin
+f usr/include/sys/rsm/rsmka_path_int.h 0644 root bin
+f usr/include/sys/rsm/rsmndi.h 0644 root bin
+f usr/include/sys/rsm/rsmpi.h 0644 root bin
+f usr/include/sys/rsm/rsmpi_driver.h 0644 root bin
+f usr/include/sys/rt.h 0644 root bin
+f usr/include/sys/rtc.h 0644 root bin
+f usr/include/sys/rtpriocntl.h 0644 root bin
+f usr/include/sys/rwlock.h 0644 root bin
+f usr/include/sys/rwlock_impl.h 0644 root bin
+f usr/include/sys/rwstlock.h 0644 root bin
+f usr/include/sys/sad.h 0644 root bin
+d usr/include/sys/sata 0755 root bin
+f usr/include/sys/sata/sata_cfgadm.h 0644 root bin
+f usr/include/sys/sata/sata_defs.h 0644 root bin
+f usr/include/sys/sata/sata_hba.h 0644 root bin
+f usr/include/sys/schedctl.h 0644 root bin
+d usr/include/sys/scsi 0755 root bin
+d usr/include/sys/scsi/adapters 0755 root bin
+f usr/include/sys/scsi/adapters/iscsi_door.h 0644 root bin
+f usr/include/sys/scsi/adapters/iscsi_if.h 0644 root bin
+f usr/include/sys/scsi/adapters/mpapi_impl.h 0644 root bin
+f usr/include/sys/scsi/adapters/mpapi_scsi_vhci.h 0644 root bin
+f usr/include/sys/scsi/adapters/scsi_vhci.h 0644 root bin
+d usr/include/sys/scsi/conf 0755 root bin
+f usr/include/sys/scsi/conf/autoconf.h 0644 root bin
+f usr/include/sys/scsi/conf/device.h 0644 root bin
+d usr/include/sys/scsi/generic 0755 root bin
+f usr/include/sys/scsi/generic/commands.h 0644 root bin
+f usr/include/sys/scsi/generic/dad_mode.h 0644 root bin
+f usr/include/sys/scsi/generic/inquiry.h 0644 root bin
+f usr/include/sys/scsi/generic/message.h 0644 root bin
+f usr/include/sys/scsi/generic/mode.h 0644 root bin
+f usr/include/sys/scsi/generic/persist.h 0644 root bin
+f usr/include/sys/scsi/generic/sense.h 0644 root bin
+f usr/include/sys/scsi/generic/sff_frames.h 0644 root bin
+f usr/include/sys/scsi/generic/smp_frames.h 0644 root bin
+f usr/include/sys/scsi/generic/status.h 0644 root bin
+d usr/include/sys/scsi/impl 0755 root bin
+f usr/include/sys/scsi/impl/commands.h 0644 root bin
+f usr/include/sys/scsi/impl/inquiry.h 0644 root bin
+f usr/include/sys/scsi/impl/mode.h 0644 root bin
+f usr/include/sys/scsi/impl/scsi_reset_notify.h 0644 root bin
+f usr/include/sys/scsi/impl/scsi_sas.h 0644 root bin
+f usr/include/sys/scsi/impl/sense.h 0644 root bin
+f usr/include/sys/scsi/impl/services.h 0644 root bin
+f usr/include/sys/scsi/impl/smp_transport.h 0644 root bin
+f usr/include/sys/scsi/impl/spc3_types.h 0644 root bin
+f usr/include/sys/scsi/impl/status.h 0644 root bin
+f usr/include/sys/scsi/impl/transport.h 0644 root bin
+f usr/include/sys/scsi/impl/types.h 0644 root bin
+f usr/include/sys/scsi/impl/uscsi.h 0644 root bin
+f usr/include/sys/scsi/impl/usmp.h 0644 root bin
+f usr/include/sys/scsi/scsi.h 0644 root bin
+f usr/include/sys/scsi/scsi_address.h 0644 root bin
+f usr/include/sys/scsi/scsi_ctl.h 0644 root bin
+f usr/include/sys/scsi/scsi_fm.h 0644 root bin
+f usr/include/sys/scsi/scsi_params.h 0644 root bin
+f usr/include/sys/scsi/scsi_pkt.h 0644 root bin
+f usr/include/sys/scsi/scsi_resource.h 0644 root bin
+f usr/include/sys/scsi/scsi_types.h 0644 root bin
+f usr/include/sys/scsi/scsi_watch.h 0644 root bin
+d usr/include/sys/scsi/targets 0755 root bin
+f usr/include/sys/scsi/targets/sddef.h 0644 root bin
+f usr/include/sys/scsi/targets/ses.h 0644 root bin
+f usr/include/sys/scsi/targets/sesio.h 0644 root bin
+f usr/include/sys/scsi/targets/sgendef.h 0644 root bin
+f usr/include/sys/scsi/targets/smp.h 0644 root bin
+f usr/include/sys/scsi/targets/stdef.h 0644 root bin
+d usr/include/sys/sdcard 0755 root bin
+f usr/include/sys/sdcard/sda.h 0644 root bin
+f usr/include/sys/sdcard/sda_impl.h 0644 root bin
+f usr/include/sys/sdcard/sda_ioctl.h 0644 root bin
+f usr/include/sys/sdt.h 0644 root bin
+f usr/include/sys/segment.h 0644 root bin
+f usr/include/sys/segments.h 0644 root bin
+f usr/include/sys/select.h 0644 root bin
+f usr/include/sys/sem.h 0644 root bin
+f usr/include/sys/sem_impl.h 0644 root bin
+f usr/include/sys/sema_impl.h 0644 root bin
+f usr/include/sys/semaphore.h 0644 root bin
+f usr/include/sys/sendfile.h 0644 root bin
+f usr/include/sys/ser_sync.h 0644 root bin
+f usr/include/sys/serializer.h 0644 root bin
+f usr/include/sys/session.h 0644 root bin
+f usr/include/sys/sha1.h 0644 root bin
+f usr/include/sys/sha1_consts.h 0644 root bin
+f usr/include/sys/sha2.h 0644 root bin
+f usr/include/sys/sha2_consts.h 0644 root bin
+f usr/include/sys/share.h 0644 root bin
+f usr/include/sys/shm.h 0644 root bin
+f usr/include/sys/shm_impl.h 0644 root bin
+f usr/include/sys/sid.h 0644 root bin
+f usr/include/sys/siginfo.h 0644 root bin
+f usr/include/sys/signal.h 0644 root bin
+f usr/include/sys/sleepq.h 0644 root bin
+f usr/include/sys/smbios.h 0644 root bin
+f usr/include/sys/smbios_impl.h 0644 root bin
+f usr/include/sys/smedia.h 0644 root bin
+f usr/include/sys/sobject.h 0644 root bin
+f usr/include/sys/socket.h 0644 root bin
+f usr/include/sys/socket_impl.h 0644 root bin
+f usr/include/sys/socket_proto.h 0644 root bin
+f usr/include/sys/socketvar.h 0644 root bin
+f usr/include/sys/sockfilter.h 0644 root bin
+f usr/include/sys/sockio.h 0644 root bin
+f usr/include/sys/soundcard.h 0644 root bin
+f usr/include/sys/spl.h 0644 root bin
+f usr/include/sys/squeue.h 0644 root bin
+f usr/include/sys/squeue_impl.h 0644 root bin
+f usr/include/sys/srn.h 0644 root bin
+f usr/include/sys/sservice.h 0644 root bin
+f usr/include/sys/stack.h 0644 root bin
+f usr/include/sys/stat.h 0644 root bin
+f usr/include/sys/stat_impl.h 0644 root bin
+f usr/include/sys/statfs.h 0644 root bin
+f usr/include/sys/statvfs.h 0644 root bin
+f usr/include/sys/stdbool.h 0644 root bin
+f usr/include/sys/stdint.h 0644 root bin
+f usr/include/sys/stermio.h 0644 root bin
+f usr/include/sys/stmf.h 0644 root bin
+f usr/include/sys/stmf_defines.h 0644 root bin
+f usr/include/sys/stmf_ioctl.h 0644 root bin
+f usr/include/sys/stmf_sbd_ioctl.h 0644 root bin
+f usr/include/sys/stream.h 0644 root bin
+f usr/include/sys/strft.h 0644 root bin
+f usr/include/sys/strlog.h 0644 root bin
+f usr/include/sys/strmdep.h 0644 root bin
+f usr/include/sys/stropts.h 0644 root bin
+f usr/include/sys/strredir.h 0644 root bin
+f usr/include/sys/strstat.h 0644 root bin
+f usr/include/sys/strsubr.h 0644 root bin
+f usr/include/sys/strsun.h 0644 root bin
+f usr/include/sys/strtty.h 0644 root bin
+f usr/include/sys/sunddi.h 0644 root bin
+f usr/include/sys/sunldi.h 0644 root bin
+f usr/include/sys/sunldi_impl.h 0644 root bin
+f usr/include/sys/sunmdi.h 0644 root bin
+f usr/include/sys/sunndi.h 0644 root bin
+f usr/include/sys/sunos_dhcp_class.h 0644 root bin
+f usr/include/sys/sunpm.h 0644 root bin
+f usr/include/sys/suntpi.h 0644 root bin
+f usr/include/sys/suntty.h 0644 root bin
+f usr/include/sys/swap.h 0644 root bin
+f usr/include/sys/synch.h 0644 root bin
+f usr/include/sys/synch32.h 0644 root bin
+f usr/include/sys/syscall.h 0644 root bin
+f usr/include/sys/sysconf.h 0644 root bin
+f usr/include/sys/sysconfig.h 0644 root bin
+f usr/include/sys/sysconfig_impl.h 0644 root bin
+f usr/include/sys/sysdc.h 0644 root bin
+f usr/include/sys/sysdc_impl.h 0644 root bin
+d usr/include/sys/sysevent 0755 root bin
+f usr/include/sys/sysevent.h 0644 root bin
+f usr/include/sys/sysevent/ap_driver.h 0644 root bin
+f usr/include/sys/sysevent/dev.h 0644 root bin
+f usr/include/sys/sysevent/domain.h 0644 root bin
+f usr/include/sys/sysevent/dr.h 0644 root bin
+f usr/include/sys/sysevent/env.h 0644 root bin
+f usr/include/sys/sysevent/eventdefs.h 0644 root bin
+f usr/include/sys/sysevent/ipmp.h 0644 root bin
+f usr/include/sys/sysevent/pwrctl.h 0644 root bin
+f usr/include/sys/sysevent/svm.h 0644 root bin
+f usr/include/sys/sysevent/vrrp.h 0644 root bin
+f usr/include/sys/sysevent_impl.h 0644 root bin
+f usr/include/sys/sysi86.h 0644 root bin
+f usr/include/sys/sysinfo.h 0644 root bin
+f usr/include/sys/syslog.h 0644 root bin
+f usr/include/sys/sysmacros.h 0644 root bin
+f usr/include/sys/sysmsg_impl.h 0644 root bin
+f usr/include/sys/systeminfo.h 0644 root bin
+f usr/include/sys/systm.h 0644 root bin
+f usr/include/sys/t_kuser.h 0644 root bin
+f usr/include/sys/t_lock.h 0644 root bin
+f usr/include/sys/task.h 0644 root bin
+f usr/include/sys/taskq.h 0644 root bin
+f usr/include/sys/taskq_impl.h 0644 root bin
+f usr/include/sys/telioctl.h 0644 root bin
+f usr/include/sys/termio.h 0644 root bin
+f usr/include/sys/termios.h 0644 root bin
+f usr/include/sys/termiox.h 0644 root bin
+f usr/include/sys/thread.h 0644 root bin
+f usr/include/sys/ticlts.h 0644 root bin
+f usr/include/sys/ticots.h 0644 root bin
+f usr/include/sys/ticotsord.h 0644 root bin
+f usr/include/sys/tihdr.h 0644 root bin
+f usr/include/sys/time.h 0644 root bin
+f usr/include/sys/time_impl.h 0644 root bin
+f usr/include/sys/time_std_impl.h 0644 root bin
+f usr/include/sys/timeb.h 0644 root bin
+f usr/include/sys/timer.h 0644 root bin
+f usr/include/sys/times.h 0644 root bin
+f usr/include/sys/timex.h 0644 root bin
+f usr/include/sys/timod.h 0644 root bin
+f usr/include/sys/tirdwr.h 0644 root bin
+f usr/include/sys/tiuser.h 0644 root bin
+f usr/include/sys/tl.h 0644 root bin
+f usr/include/sys/tnf.h 0644 root bin
+f usr/include/sys/tnf_com.h 0644 root bin
+f usr/include/sys/tnf_probe.h 0644 root bin
+f usr/include/sys/tnf_writer.h 0644 root bin
+f usr/include/sys/todio.h 0644 root bin
+f usr/include/sys/tpicommon.h 0644 root bin
+f usr/include/sys/trap.h 0644 root bin
+f usr/include/sys/traptrace.h 0644 root bin
+f usr/include/sys/ts.h 0644 root bin
+d usr/include/sys/tsol 0755 root bin
+f usr/include/sys/tsol/label.h 0644 root bin
+f usr/include/sys/tsol/label_macro.h 0644 root bin
+f usr/include/sys/tsol/priv.h 0644 root bin
+f usr/include/sys/tsol/tndb.h 0644 root bin
+f usr/include/sys/tsol/tsyscall.h 0644 root bin
+f usr/include/sys/tspriocntl.h 0644 root bin
+f usr/include/sys/tss.h 0644 root bin
+f usr/include/sys/ttcompat.h 0644 root bin
+f usr/include/sys/ttold.h 0644 root bin
+f usr/include/sys/tty.h 0644 root bin
+f usr/include/sys/ttychars.h 0644 root bin
+f usr/include/sys/ttydev.h 0644 root bin
+f usr/include/sys/tuneable.h 0644 root bin
+f usr/include/sys/turnstile.h 0644 root bin
+f usr/include/sys/types.h 0644 root bin
+f usr/include/sys/types32.h 0644 root bin
+f usr/include/sys/tzfile.h 0644 root bin
+f usr/include/sys/u8_textprep.h 0644 root bin
+f usr/include/sys/u8_textprep_data.h 0644 root bin
+f usr/include/sys/uadmin.h 0644 root bin
+f usr/include/sys/ucode.h 0644 root bin
+f usr/include/sys/ucontext.h 0644 root bin
+f usr/include/sys/ucred.h 0644 root bin
+f usr/include/sys/uio.h 0644 root bin
+f usr/include/sys/ulimit.h 0644 root bin
+f usr/include/sys/un.h 0644 root bin
+d usr/include/sys/unistat 0755 root bin
+f usr/include/sys/unistat/spcs_dtrinkets.h 0644 root bin
+f usr/include/sys/unistat/spcs_errors.h 0644 root bin
+f usr/include/sys/unistat/spcs_etext.h 0644 root bin
+f usr/include/sys/unistat/spcs_etrinkets.h 0644 root bin
+f usr/include/sys/unistat/spcs_s.h 0644 root bin
+f usr/include/sys/unistat/spcs_s_impl.h 0644 root bin
+f usr/include/sys/unistat/spcs_s_k.h 0644 root bin
+f usr/include/sys/unistat/spcs_s_u.h 0644 root bin
+f usr/include/sys/unistd.h 0644 root bin
+d usr/include/sys/usb 0755 root bin
+d usr/include/sys/usb/clients 0755 root bin
+d usr/include/sys/usb/clients/audio 0755 root bin
+f usr/include/sys/usb/clients/audio/usb_audio.h 0644 root bin
+d usr/include/sys/usb/clients/hid 0755 root bin
+f usr/include/sys/usb/clients/hid/hid.h 0644 root bin
+d usr/include/sys/usb/clients/hwarc 0755 root bin
+f usr/include/sys/usb/clients/hwarc/hwarc.h 0644 root bin
+d usr/include/sys/usb/clients/mass_storage 0755 root bin
+f usr/include/sys/usb/clients/mass_storage/usb_bulkonly.h 0644 root bin
+f usr/include/sys/usb/clients/mass_storage/usb_cbi.h 0644 root bin
+d usr/include/sys/usb/clients/printer 0755 root bin
+f usr/include/sys/usb/clients/printer/usb_printer.h 0644 root bin
+d usr/include/sys/usb/clients/ugen 0755 root bin
+f usr/include/sys/usb/clients/ugen/usb_ugen.h 0644 root bin
+d usr/include/sys/usb/clients/usbcdc 0755 root bin
+f usr/include/sys/usb/clients/usbcdc/usb_cdc.h 0644 root bin
+d usr/include/sys/usb/clients/usbinput 0755 root bin
+d usr/include/sys/usb/clients/usbinput/usbwcm 0755 root bin
+f usr/include/sys/usb/clients/usbinput/usbwcm/usbwcm.h 0644 root bin
+d usr/include/sys/usb/clients/video 0755 root bin
+d usr/include/sys/usb/clients/video/usbvc 0755 root bin
+f usr/include/sys/usb/clients/video/usbvc/usbvc.h 0644 root bin
+d usr/include/sys/usb/hubd 0755 root bin
+f usr/include/sys/usb/hubd/hub.h 0644 root bin
+f usr/include/sys/usb/hubd/hubd_impl.h 0644 root bin
+f usr/include/sys/usb/usba.h 0644 root bin
+f usr/include/sys/usb/usbai.h 0644 root bin
+f usr/include/sys/usb/usbdevs.h 0644 root bin
+f usr/include/sys/user.h 0644 root bin
+f usr/include/sys/ustat.h 0644 root bin
+f usr/include/sys/utime.h 0644 root bin
+f usr/include/sys/utrap.h 0644 root bin
+f usr/include/sys/utsname.h 0644 root bin
+f usr/include/sys/utssys.h 0644 root bin
+f usr/include/sys/uuid.h 0644 root bin
+d usr/include/sys/uwb 0755 root bin
+f usr/include/sys/uwb/uwb.h 0644 root bin
+d usr/include/sys/uwb/uwba 0755 root bin
+f usr/include/sys/uwb/uwba/uwba.h 0644 root bin
+f usr/include/sys/uwb/uwbai.h 0644 root bin
+f usr/include/sys/va_impl.h 0644 root bin
+f usr/include/sys/va_list.h 0644 root bin
+f usr/include/sys/var.h 0644 root bin
+f usr/include/sys/varargs.h 0644 root bin
+f usr/include/sys/vfs.h 0644 root bin
+f usr/include/sys/vfs_opreg.h 0644 root bin
+f usr/include/sys/vfstab.h 0644 root bin
+f usr/include/sys/vgareg.h 0644 root bin
+f usr/include/sys/videodev2.h 0644 root bin
+f usr/include/sys/visual_io.h 0644 root bin
+f usr/include/sys/vlan.h 0644 root bin
+f usr/include/sys/vm.h 0644 root bin
+f usr/include/sys/vm_usage.h 0644 root bin
+f usr/include/sys/vmem.h 0644 root bin
+f usr/include/sys/vmem_impl.h 0644 root bin
+f usr/include/sys/vmem_impl_user.h 0644 root bin
+f usr/include/sys/vmparam.h 0644 root bin
+f usr/include/sys/vmsystm.h 0644 root bin
+f usr/include/sys/vnic.h 0644 root bin
+f usr/include/sys/vnic_impl.h 0644 root bin
+f usr/include/sys/vnode.h 0644 root bin
+f usr/include/sys/vscan.h 0644 root bin
+f usr/include/sys/vt.h 0644 root bin
+f usr/include/sys/vtdaemon.h 0644 root bin
+f usr/include/sys/vtoc.h 0644 root bin
+f usr/include/sys/vtrace.h 0644 root bin
+f usr/include/sys/vuid_event.h 0644 root bin
+f usr/include/sys/vuid_queue.h 0644 root bin
+f usr/include/sys/vuid_state.h 0644 root bin
+f usr/include/sys/vuid_store.h 0644 root bin
+f usr/include/sys/vuid_wheel.h 0644 root bin
+f usr/include/sys/wait.h 0644 root bin
+f usr/include/sys/waitq.h 0644 root bin
+f usr/include/sys/wanboot_impl.h 0644 root bin
+f usr/include/sys/watchpoint.h 0644 root bin
+f usr/include/sys/winlockio.h 0644 root bin
+f usr/include/sys/x86_archext.h 0644 root bin
+f usr/include/sys/xen_errno.h 0644 root bin
+f usr/include/sys/xti_inet.h 0644 root bin
+f usr/include/sys/xti_osi.h 0644 root bin
+f usr/include/sys/xti_xtiopt.h 0644 root bin
+f usr/include/sys/zcons.h 0644 root bin
+f usr/include/sys/zmod.h 0644 root bin
+f usr/include/sys/zone.h 0644 root bin
+f usr/include/sysexits.h 0644 root bin
+f usr/include/syslog.h 0644 root bin
+f usr/include/tar.h 0644 root bin
+f usr/include/tcpd.h 0644 root bin
+f usr/include/term.h 0644 root bin
+f usr/include/termio.h 0644 root bin
+f usr/include/termios.h 0644 root bin
+f usr/include/thread.h 0644 root bin
+f usr/include/thread_db.h 0644 root bin
+f usr/include/time.h 0644 root bin
+f usr/include/tiuser.h 0644 root bin
+d usr/include/tnf 0755 root bin
+f usr/include/tnf/com.h 0644 root bin
+f usr/include/tnf/probe.h 0644 root bin
+f usr/include/tnf/tnf.h 0644 root bin
+f usr/include/tnf/tnfctl.h 0644 root bin
+f usr/include/tnf/writer.h 0644 root bin
+d usr/include/tsol 0755 root bin
+f usr/include/tsol/label.h 0644 root bin
+f usr/include/tzfile.h 0644 root bin
+f usr/include/ucontext.h 0644 root bin
+f usr/include/ucred.h 0644 root bin
+f usr/include/uid_stp.h 0644 root bin
+f usr/include/ulimit.h 0644 root bin
+f usr/include/umem.h 0644 root bin
+f usr/include/umem_impl.h 0644 root bin
+f usr/include/unctrl.h 0644 root bin
+f usr/include/unistd.h 0644 root bin
+f usr/include/user_attr.h 0644 root bin
+f usr/include/userdefs.h 0644 root bin
+f usr/include/ustat.h 0644 root bin
+f usr/include/utility.h 0644 root bin
+f usr/include/utime.h 0644 root bin
+f usr/include/utmp.h 0644 root bin
+f usr/include/utmpx.h 0644 root bin
+d usr/include/uuid 0755 root bin
+f usr/include/uuid/uuid.h 0644 root bin
+f usr/include/valtools.h 0644 root bin
+f usr/include/values.h 0644 root bin
+f usr/include/varargs.h 0644 root bin
+d usr/include/vm 0755 root bin
+f usr/include/vm/anon.h 0644 root bin
+f usr/include/vm/as.h 0644 root bin
+f usr/include/vm/faultcode.h 0644 root bin
+f usr/include/vm/hat.h 0644 root bin
+f usr/include/vm/kpm.h 0644 root bin
+f usr/include/vm/page.h 0644 root bin
+f usr/include/vm/pvn.h 0644 root bin
+f usr/include/vm/rm.h 0644 root bin
+f usr/include/vm/seg.h 0644 root bin
+f usr/include/vm/seg_dev.h 0644 root bin
+f usr/include/vm/seg_enum.h 0644 root bin
+f usr/include/vm/seg_kmem.h 0644 root bin
+f usr/include/vm/seg_kp.h 0644 root bin
+f usr/include/vm/seg_kpm.h 0644 root bin
+f usr/include/vm/seg_map.h 0644 root bin
+f usr/include/vm/seg_spt.h 0644 root bin
+f usr/include/vm/seg_vn.h 0644 root bin
+f usr/include/vm/vpage.h 0644 root bin
+f usr/include/vm/vpm.h 0644 root bin
+f usr/include/volmgt.h 0644 root bin
+f usr/include/wait.h 0644 root bin
+d usr/include/wanboot 0755 root bin
+f usr/include/wanboot/key_util.h 0644 root bin
+f usr/include/wanboot/key_xdr.h 0644 root bin
+f usr/include/wanboot/wbio.h 0644 root bin
+f usr/include/wanboot_conf.h 0644 root bin
+f usr/include/wanbootutil.h 0644 root bin
+f usr/include/wchar.h 0644 root bin
+f usr/include/wchar_impl.h 0644 root bin
+f usr/include/wctype.h 0644 root bin
+f usr/include/widec.h 0644 root bin
+f usr/include/wordexp.h 0644 root bin
+f usr/include/xti.h 0644 root bin
+f usr/include/xti_inet.h 0644 root bin
+f usr/include/zdoor.h 0644 root bin
+f usr/include/zone.h 0644 root bin
+d usr/kernel 0755 root sys
+d usr/kernel/brand 0755 root sys
+d usr/kernel/brand/amd64 0755 root sys
+f usr/kernel/brand/amd64/sngl_brand 0755 root sys
+d usr/kernel/drv 0755 root sys
+d usr/kernel/drv/amd64 0755 root sys
+f usr/kernel/drv/amd64/bpf 0755 root sys
+f usr/kernel/drv/amd64/dump 0755 root sys
+f usr/kernel/drv/amd64/fssnap 0755 root sys
+f usr/kernel/drv/amd64/ipf 0755 root sys
+f usr/kernel/drv/amd64/ipmi 0755 root sys
+f usr/kernel/drv/amd64/kstat 0755 root sys
+f usr/kernel/drv/amd64/ksyms 0755 root sys
+f usr/kernel/drv/amd64/logindmux 0755 root sys
+f usr/kernel/drv/amd64/nsmb 0755 root sys
+f usr/kernel/drv/amd64/pm 0755 root sys
+f usr/kernel/drv/amd64/pool 0755 root sys
+f usr/kernel/drv/amd64/ptm 0755 root sys
+f usr/kernel/drv/amd64/pts 0755 root sys
+f usr/kernel/drv/amd64/smbsrv 0755 root sys
+f usr/kernel/drv/amd64/sppp 0755 root sys
+f usr/kernel/drv/amd64/sppptun 0755 root sys
+f usr/kernel/drv/amd64/zcons 0755 root sys
+f usr/kernel/drv/bpf.conf 0644 root sys
+f usr/kernel/drv/dump.conf 0644 root sys
+f usr/kernel/drv/fssnap.conf 0644 root sys
+f usr/kernel/drv/ipf.conf 0644 root sys
+f usr/kernel/drv/ipmi.conf 0644 root sys
+f usr/kernel/drv/kstat.conf 0644 root sys
+f usr/kernel/drv/ksyms.conf 0644 root sys
+f usr/kernel/drv/logindmux.conf 0644 root sys
+f usr/kernel/drv/nsmb.conf 0644 root sys
+f usr/kernel/drv/pm.conf 0644 root sys
+f usr/kernel/drv/pool.conf 0644 root sys
+f usr/kernel/drv/ptm.conf 0644 root sys
+f usr/kernel/drv/pts.conf 0644 root sys
+f usr/kernel/drv/smbsrv.conf 0644 root sys
+f usr/kernel/drv/sppp.conf 0644 root sys
+f usr/kernel/drv/sppptun.conf 0644 root sys
+d usr/kernel/fs 0755 root sys
+d usr/kernel/fs/amd64 0755 root sys
+f usr/kernel/fs/amd64/fdfs 0755 root sys
+f usr/kernel/fs/amd64/pcfs 0755 root sys
+f usr/kernel/fs/amd64/smbfs 0755 root sys
+d usr/kernel/kmdb 0755 root sys
+d usr/kernel/kmdb/amd64 0755 root sys
+f usr/kernel/kmdb/amd64/smbfs 0555 root sys
+f usr/kernel/kmdb/amd64/smbsrv 0555 root sys
+d usr/kernel/sched 0755 root sys
+d usr/kernel/sched/amd64 0755 root sys
+f usr/kernel/sched/amd64/FSS 0755 root sys
+f usr/kernel/sched/amd64/FX 0755 root sys
+f usr/kernel/sched/amd64/FX_DPTBL 0755 root sys
+f usr/kernel/sched/amd64/RT 0755 root sys
+f usr/kernel/sched/amd64/RT_DPTBL 0755 root sys
+d usr/kernel/socketmod 0755 root sys
+d usr/kernel/socketmod/amd64 0755 root sys
+f usr/kernel/socketmod/amd64/sockpfp 0755 root sys
+d usr/kernel/sys 0755 root sys
+d usr/kernel/sys/amd64 0755 root sys
+f usr/kernel/sys/amd64/acctctl 0755 root sys
+f usr/kernel/sys/amd64/exacctsys 0755 root sys
+f usr/kernel/sys/amd64/sysacct 0755 root sys
+d usr/kvm 0755 root bin
+f usr/kvm/README 0644 root sys
+d usr/lib 0755 root bin
+f usr/lib/0@0.so.1 0755 root bin
+s usr/lib/32=.
+s usr/lib/64=amd64
+d usr/lib/abi 0755 root bin
+d usr/lib/abi/amd64 0755 root bin
+f usr/lib/abi/amd64/apptrace.so.1 0755 root bin
+d usr/lib/abi/appcert 0755 root bin
+f usr/lib/abi/appcert/AppcertUtil.pm 0555 root bin
+f usr/lib/abi/appcert/abi_index 0555 root bin
+f usr/lib/abi/appcert/etc.alt 0444 root bin
+f usr/lib/abi/appcert/etc.scoped 0444 root bin
+f usr/lib/abi/appcert/etc.tweaks 0444 root bin
+f usr/lib/abi/appcert/etc.warn 0444 root bin
+f usr/lib/abi/appcert/static_prof 0555 root bin
+f usr/lib/abi/appcert/symcheck 0555 root bin
+f usr/lib/abi/appcert/symprof 0555 root bin
+f usr/lib/abi/appcert/symreport 0555 root bin
+f usr/lib/abi/apptrace.so.1 0755 root bin
+f usr/lib/abi/spec2map 0755 root bin
+f usr/lib/abi/spec2trace 0755 root bin
+d usr/lib/acct 0755 root bin
+f usr/lib/acct/acctcms 0555 root bin
+f usr/lib/acct/acctcon 0555 root bin
+f usr/lib/acct/acctcon1 0555 root bin
+f usr/lib/acct/acctcon2 0555 root bin
+f usr/lib/acct/acctdisk 0555 root bin
+f usr/lib/acct/acctdusg 0555 root bin
+f usr/lib/acct/acctmerg 0555 root bin
+f usr/lib/acct/accton 4755 root bin
+f usr/lib/acct/acctprc 0555 root bin
+f usr/lib/acct/acctprc1 0555 root bin
+f usr/lib/acct/acctprc2 0555 root bin
+f usr/lib/acct/acctwtmp 0555 root bin
+f usr/lib/acct/chargefee 0555 root bin
+f usr/lib/acct/ckpacct 0555 root bin
+f usr/lib/acct/closewtmp 0555 root bin
+f usr/lib/acct/dodisk 0555 root bin
+f usr/lib/acct/fwtmp 0555 root bin
+f usr/lib/acct/lastlogin 0555 root bin
+f usr/lib/acct/monacct 0555 root bin
+f usr/lib/acct/nulladm 0555 root bin
+f usr/lib/acct/prctmp 0555 root bin
+f usr/lib/acct/prdaily 0555 root bin
+f usr/lib/acct/prtacct 0555 root bin
+f usr/lib/acct/ptecms.awk 0555 root bin
+f usr/lib/acct/ptelus.awk 0555 root bin
+f usr/lib/acct/remove 0555 root bin
+f usr/lib/acct/runacct 0555 root bin
+f usr/lib/acct/shutacct 0555 root bin
+f usr/lib/acct/startup 0555 root bin
+f usr/lib/acct/turnacct 0555 root bin
+f usr/lib/acct/utmp2wtmp 0555 root bin
+f usr/lib/acct/wtmpfix 0555 root bin
+d usr/lib/adb 0755 root sys
+f usr/lib/adb/adbgen 0755 root sys
+f usr/lib/adb/adbgen1 0755 root sys
+f usr/lib/adb/adbgen3 0755 root sys
+f usr/lib/adb/adbgen4 0755 root sys
+f usr/lib/adb/adbsub.o 0644 root sys
+d usr/lib/adb/amd64 0755 root sys
+f usr/lib/adb/amd64/adbsub.o 0644 root sys
+d usr/lib/amd64 0755 root bin
+f usr/lib/amd64/0@0.so.1 0755 root bin
+f usr/lib/amd64/crt1.o 0644 root bin
+f usr/lib/amd64/crti.o 0644 root bin
+f usr/lib/amd64/crtn.o 0644 root bin
+f usr/lib/amd64/gcrt1.o 0644 root bin
+d usr/lib/amd64/gss 0755 root bin
+f usr/lib/amd64/gss/dh1024-0.so.1 0755 root bin
+s usr/lib/amd64/gss/dh1024-0.so=dh1024-0.so.1
+f usr/lib/amd64/gss/dh640-0.so.1 0755 root bin
+s usr/lib/amd64/gss/dh640-0.so=dh640-0.so.1
+s usr/lib/amd64/gss/libmech_krb5.so=mech_krb5.so.1
+f usr/lib/amd64/gss/mech_dh.so.1 0755 root bin
+s usr/lib/amd64/gss/mech_dh.so=mech_dh.so.1
+f usr/lib/amd64/gss/mech_krb5.so.1 0755 root bin
+s usr/lib/amd64/gss/mech_krb5.so=mech_krb5.so.1
+f usr/lib/amd64/gss/mech_spnego.so.1 0755 root bin
+s usr/lib/amd64/ld.so.1=../../../lib/amd64/ld.so.1
+f usr/lib/amd64/lddstub 0555 root bin
+f usr/lib/amd64/libHBAAPI.so.1 0755 root bin
+s usr/lib/amd64/libHBAAPI.so=libHBAAPI.so.1
+s usr/lib/amd64/libMPAPI.so.1=../../../lib/amd64/libMPAPI.so.1
+s usr/lib/amd64/libMPAPI.so=../../../lib/amd64/libMPAPI.so.1
+f usr/lib/amd64/libSMHBAAPI.so.1 0755 root bin
+s usr/lib/amd64/libSMHBAAPI.so=libSMHBAAPI.so.1
+s usr/lib/amd64/libadm.so.1=../../../lib/amd64/libadm.so.1
+s usr/lib/amd64/libadm.so=../../../lib/amd64/libadm.so.1
+f usr/lib/amd64/libadt_jni.so.1 0755 root bin
+s usr/lib/amd64/libadt_jni.so=libadt_jni.so.1
+f usr/lib/amd64/libadutils.so.1 0755 root bin
+s usr/lib/amd64/libadutils.so=libadutils.so.1
+s usr/lib/amd64/libaio.so.1=../../../lib/amd64/libaio.so.1
+s usr/lib/amd64/libaio.so=../../../lib/amd64/libaio.so.1
+f usr/lib/amd64/libast.so.1 0755 root bin
+s usr/lib/amd64/libast.so=libast.so.1
+s usr/lib/amd64/libavl.so.1=../../../lib/amd64/libavl.so.1
+s usr/lib/amd64/libavl.so=../../../lib/amd64/libavl.so.1
+f usr/lib/amd64/libbrand.so.1 0755 root bin
+s usr/lib/amd64/libbrand.so=libbrand.so.1
+f usr/lib/amd64/libbsdmalloc.so.1 0755 root bin
+s usr/lib/amd64/libbsdmalloc.so=libbsdmalloc.so.1
+s usr/lib/amd64/libbsm.so.1=../../../lib/amd64/libbsm.so.1
+s usr/lib/amd64/libbsm.so=../../../lib/amd64/libbsm.so.1
+s usr/lib/amd64/libc.so.1=../../../lib/amd64/libc.so.1
+s usr/lib/amd64/libc.so=../../../lib/amd64/libc.so.1
+s usr/lib/amd64/libc_db.so.1=../../../lib/amd64/libc_db.so.1
+s usr/lib/amd64/libc_db.so=../../../lib/amd64/libc_db.so.1
+f usr/lib/amd64/libcfgadm.so.1 0755 root bin
+s usr/lib/amd64/libcfgadm.so=libcfgadm.so.1
+f usr/lib/amd64/libcmd.so.1 0755 root bin
+s usr/lib/amd64/libcmd.so=libcmd.so.1
+s usr/lib/amd64/libcmdutils.so.1=../../../lib/amd64/libcmdutils.so.1
+s usr/lib/amd64/libcmdutils.so=../../../lib/amd64/libcmdutils.so.1
+f usr/lib/amd64/libcommputil.so.1 0755 root bin
+s usr/lib/amd64/libcommputil.so=libcommputil.so.1
+s usr/lib/amd64/libcontract.so.1=../../../lib/amd64/libcontract.so.1
+s usr/lib/amd64/libcontract.so=../../../lib/amd64/libcontract.so.1
+f usr/lib/amd64/libcpc.so.1 0755 root bin
+s usr/lib/amd64/libcpc.so=libcpc.so.1
+f usr/lib/amd64/libcrle.so.1 0755 root bin
+f usr/lib/amd64/libcrypt.so.1 0755 root bin
+s usr/lib/amd64/libcrypt.so=libcrypt.so.1
+s usr/lib/amd64/libcrypt_d.so.1=libcrypt.so.1
+s usr/lib/amd64/libcrypt_d.so=libcrypt.so
+s usr/lib/amd64/libcrypt_i.so.1=libcrypt.so.1
+s usr/lib/amd64/libcrypt_i.so=libcrypt.so
+s usr/lib/amd64/libcryptoutil.so.1=../../../lib/amd64/libcryptoutil.so.1
+s usr/lib/amd64/libcryptoutil.so=../../../lib/amd64/libcryptoutil.so.1
+s usr/lib/amd64/libctf.so.1=../../../lib/amd64/libctf.so.1
+s usr/lib/amd64/libctf.so=../../../lib/amd64/libctf.so.1
+s usr/lib/amd64/libcurses.so.1=../../../lib/amd64/libcurses.so.1
+s usr/lib/amd64/libcurses.so=../../../lib/amd64/libcurses.so.1
+f usr/lib/amd64/libdat.so.1 0755 root bin
+s usr/lib/amd64/libdat.so=libdat.so.1
+s usr/lib/amd64/libdevice.so.1=../../../lib/amd64/libdevice.so.1
+s usr/lib/amd64/libdevice.so=../../../lib/amd64/libdevice.so.1
+s usr/lib/amd64/libdevid.so.1=../../../lib/amd64/libdevid.so.1
+s usr/lib/amd64/libdevid.so=../../../lib/amd64/libdevid.so.1
+s usr/lib/amd64/libdevinfo.so.1=../../../lib/amd64/libdevinfo.so.1
+s usr/lib/amd64/libdevinfo.so=../../../lib/amd64/libdevinfo.so.1
+f usr/lib/amd64/libdisasm.so.1 0755 root bin
+s usr/lib/amd64/libdisasm.so=libdisasm.so.1
+f usr/lib/amd64/libdiskmgt.so.1 0755 root bin
+s usr/lib/amd64/libdiskmgt.so=libdiskmgt.so.1
+s usr/lib/amd64/libdl.so.1=../../../lib/amd64/libdl.so.1
+s usr/lib/amd64/libdl.so=../../../lib/amd64/libdl.so.1
+s usr/lib/amd64/libdladm.so.1=../../../lib/amd64/libdladm.so.1
+s usr/lib/amd64/libdladm.so=../../../lib/amd64/libdladm.so.1
+f usr/lib/amd64/libdll.so.1 0755 root bin
+s usr/lib/amd64/libdll.so=libdll.so.1
+s usr/lib/amd64/libdlpi.so.1=../../../lib/amd64/libdlpi.so.1
+s usr/lib/amd64/libdlpi.so=../../../lib/amd64/libdlpi.so.1
+f usr/lib/amd64/libdns_sd.so.1 0755 root bin
+s usr/lib/amd64/libdns_sd.so=libdns_sd.so.1
+s usr/lib/amd64/libdoor.so.1=../../../lib/amd64/libdoor.so.1
+s usr/lib/amd64/libdoor.so=../../../lib/amd64/libdoor.so.1
+f usr/lib/amd64/libdtrace.so.1 0755 root bin
+s usr/lib/amd64/libdtrace.so=libdtrace.so.1
+f usr/lib/amd64/libdtrace_jni.so.1 0755 root bin
+s usr/lib/amd64/libdtrace_jni.so=libdtrace_jni.so.1
+s usr/lib/amd64/libefi.so.1=../../../lib/amd64/libefi.so.1
+s usr/lib/amd64/libefi.so=../../../lib/amd64/libefi.so.1
+s usr/lib/amd64/libelf.so.1=../../../lib/amd64/libelf.so.1
+s usr/lib/amd64/libelf.so=../../../lib/amd64/libelf.so.1
+f usr/lib/amd64/libexacct.so.1 0755 root bin
+s usr/lib/amd64/libexacct.so=libexacct.so.1
+f usr/lib/amd64/libfcoe.so.1 0755 root bin
+s usr/lib/amd64/libfcoe.so=libfcoe.so.1
+s usr/lib/amd64/libfdisk.so.1=../../../lib/amd64/libfdisk.so.1
+s usr/lib/amd64/libfdisk.so=../../../lib/amd64/libfdisk.so.1
+f usr/lib/amd64/libform.so.1 0755 root bin
+s usr/lib/amd64/libform.so=libform.so.1
+f usr/lib/amd64/libfru.so.1 0755 root bin
+s usr/lib/amd64/libfru.so=libfru.so.1
+f usr/lib/amd64/libfruraw.so.1 0755 root bin
+s usr/lib/amd64/libfruraw.so=libfruraw.so.1
+f usr/lib/amd64/libfrureg.so.1 0755 root bin
+s usr/lib/amd64/libfrureg.so=libfrureg.so.1
+f usr/lib/amd64/libfruutils.so.1 0755 root bin
+s usr/lib/amd64/libfruutils.so=libfruutils.so.1
+s usr/lib/amd64/libgen.so.1=../../../lib/amd64/libgen.so.1
+s usr/lib/amd64/libgen.so=../../../lib/amd64/libgen.so.1
+f usr/lib/amd64/libgss.so.1 0755 root bin
+s usr/lib/amd64/libgss.so=libgss.so.1
+f usr/lib/amd64/libhotplug.so.1 0755 root bin
+s usr/lib/amd64/libhotplug.so=libhotplug.so.1
+f usr/lib/amd64/libidmap.so.1 0755 root bin
+s usr/lib/amd64/libidmap.so=libidmap.so.1
+f usr/lib/amd64/libike.so.1 0755 root bin
+s usr/lib/amd64/libike.so=libike.so.1
+f usr/lib/amd64/libilb.so.1 0755 root bin
+s usr/lib/amd64/libilb.so=libilb.so.1
+f usr/lib/amd64/libima.so.1 0755 root bin
+s usr/lib/amd64/libima.so=libima.so.1
+s usr/lib/amd64/libinetutil.so.1=../../../lib/amd64/libinetutil.so.1
+s usr/lib/amd64/libinetutil.so=../../../lib/amd64/libinetutil.so.1
+s usr/lib/amd64/libintl.so.1=../../../lib/amd64/libintl.so.1
+s usr/lib/amd64/libintl.so=../../../lib/amd64/libintl.so.1
+f usr/lib/amd64/libipd.so.1 0755 root bin
+s usr/lib/amd64/libipd.so=libipd.so.1
+f usr/lib/amd64/libipmi.so.1 0755 root bin
+s usr/lib/amd64/libipmi.so=libipmi.so.1
+f usr/lib/amd64/libipp.so.1 0755 root bin
+s usr/lib/amd64/libipp.so=libipp.so.1
+f usr/lib/amd64/libipsecutil.so.1 0755 root bin
+s usr/lib/amd64/libipsecutil.so=libipsecutil.so.1
+f usr/lib/amd64/libiscsit.so.1 0755 root bin
+s usr/lib/amd64/libiscsit.so=libiscsit.so.1
+f usr/lib/amd64/libjdns_sd.so.1 0755 root bin
+s usr/lib/amd64/libjdns_sd.so=libjdns_sd.so.1
+s usr/lib/amd64/libkmfberder.so.1=../../../lib/amd64/libkmfberder.so.1
+s usr/lib/amd64/libkmfberder.so=../../../lib/amd64/libkmfberder.so.1
+f usr/lib/amd64/libkrb5.so.1 0755 root bin
+s usr/lib/amd64/libkrb5.so=libkrb5.so.1
+s usr/lib/amd64/libkstat.so.1=../../../lib/amd64/libkstat.so.1
+s usr/lib/amd64/libkstat.so=../../../lib/amd64/libkstat.so.1
+f usr/lib/amd64/libkvm.so.1 0755 root bin
+s usr/lib/amd64/libkvm.so=libkvm.so.1
+f usr/lib/amd64/libl.so.1 0755 root bin
+s usr/lib/amd64/libl.so=libl.so.1
+f usr/lib/amd64/libldap.so.5 0755 root bin
+s usr/lib/amd64/libldap.so=libldap.so.5
+s usr/lib/amd64/liblddbg.so.4=../../../lib/amd64/liblddbg.so.4
+f usr/lib/amd64/libldstab.so.1 0755 root bin
+f usr/lib/amd64/liblgrp.so.1 0755 root bin
+s usr/lib/amd64/liblgrp.so=liblgrp.so.1
+f usr/lib/amd64/liblm.so.1 0755 root bin
+s usr/lib/amd64/liblm.so=liblm.so.1
+f usr/lib/amd64/libmail.so.1 0755 root bin
+s usr/lib/amd64/libmail.so=libmail.so.1
+f usr/lib/amd64/libmalloc.so.1 0755 root bin
+s usr/lib/amd64/libmalloc.so=libmalloc.so.1
+f usr/lib/amd64/libmapmalloc.so.1 0755 root bin
+s usr/lib/amd64/libmapmalloc.so=libmapmalloc.so.1
+s usr/lib/amd64/libmd.so.1=../../../lib/amd64/libmd.so.1
+s usr/lib/amd64/libmd.so=../../../lib/amd64/libmd.so.1
+s usr/lib/amd64/libmd5.so.1=../../../lib/amd64/libmd5.so.1
+s usr/lib/amd64/libmd5.so=../../../lib/amd64/libmd5.so.1
+s usr/lib/amd64/libmech_krb5.so=gss/mech_krb5.so
+f usr/lib/amd64/libmenu.so.1 0755 root bin
+s usr/lib/amd64/libmenu.so=libmenu.so.1
+s usr/lib/amd64/libmp.so.2=../../../lib/amd64/libmp.so.2
+s usr/lib/amd64/libmp.so=../../../lib/amd64/libmp.so.2
+s usr/lib/amd64/libmpscsi_vhci.so.1=../../../lib/amd64/libmpscsi_vhci.so.1
+s usr/lib/amd64/libmpscsi_vhci.so=../../../lib/amd64/libmpscsi_vhci.so.1
+f usr/lib/amd64/libmtmalloc.so.1 0755 root bin
+s usr/lib/amd64/libmtmalloc.so=libmtmalloc.so.1
+f usr/lib/amd64/libndmp.so.1 0755 root bin
+s usr/lib/amd64/libndmp.so=libndmp.so.1
+f usr/lib/amd64/libnls.so.1 0755 root bin
+s usr/lib/amd64/libnls.so=libnls.so.1
+s usr/lib/amd64/libnsl.so.1=../../../lib/amd64/libnsl.so.1
+s usr/lib/amd64/libnsl.so=../../../lib/amd64/libnsl.so.1
+f usr/lib/amd64/libnvfru.so.1 0755 root bin
+s usr/lib/amd64/libnvfru.so=libnvfru.so.1
+s usr/lib/amd64/libnvpair.so.1=../../../lib/amd64/libnvpair.so.1
+s usr/lib/amd64/libnvpair.so=../../../lib/amd64/libnvpair.so.1
+s usr/lib/amd64/libpam.so.1=../../../lib/amd64/libpam.so.1
+s usr/lib/amd64/libpam.so=../../../lib/amd64/libpam.so.1
+f usr/lib/amd64/libpanel.so.1 0755 root bin
+s usr/lib/amd64/libpanel.so=libpanel.so.1
+f usr/lib/amd64/libpcidb.so.1 0755 root bin
+f usr/lib/amd64/libpctx.so.1 0755 root bin
+s usr/lib/amd64/libpctx.so=libpctx.so.1
+f usr/lib/amd64/libpicl.so.1 0755 root bin
+s usr/lib/amd64/libpicl.so=libpicl.so.1
+f usr/lib/amd64/libpkcs11.so.1 0755 root bin
+s usr/lib/amd64/libpkcs11.so=libpkcs11.so.1
+f usr/lib/amd64/libpool.so.1 0755 root bin
+s usr/lib/amd64/libpool.so=libpool.so.1
+s usr/lib/amd64/libposix4.so.1=../../../lib/amd64/librt.so.1
+s usr/lib/amd64/libposix4.so=../../../lib/amd64/librt.so.1
+s usr/lib/amd64/libproc.so.1=../../../lib/amd64/libproc.so.1
+s usr/lib/amd64/libproc.so=../../../lib/amd64/libproc.so.1
+f usr/lib/amd64/libproject.so.1 0755 root bin
+s usr/lib/amd64/libproject.so=libproject.so.1
+s usr/lib/amd64/libpthread.so.1=../../../lib/amd64/libpthread.so.1
+s usr/lib/amd64/libpthread.so=../../../lib/amd64/libpthread.so.1
+f usr/lib/amd64/libraidcfg.so.1 0755 root bin
+s usr/lib/amd64/libraidcfg.so=libraidcfg.so.1
+s usr/lib/amd64/librcm.so.1=../../../lib/amd64/librcm.so.1
+s usr/lib/amd64/librcm.so=../../../lib/amd64/librcm.so.1
+f usr/lib/amd64/libreparse.so.1 0755 root bin
+s usr/lib/amd64/libreparse.so=libreparse.so.1
+s usr/lib/amd64/libresolv.so.2=../../../lib/amd64/libresolv.so.2
+s usr/lib/amd64/libresolv.so=../../../lib/amd64/libresolv.so.2
+s usr/lib/amd64/libresolv_joy.so.2=../../../lib/amd64/libresolv_joy.so.2
+s usr/lib/amd64/librestart.so.1=../../../lib/amd64/librestart.so.1
+s usr/lib/amd64/librestart.so=../../../lib/amd64/librestart.so.1
+s usr/lib/amd64/librpcsvc.so.1=../../../lib/amd64/librpcsvc.so.1
+s usr/lib/amd64/librpcsvc.so=../../../lib/amd64/librpcsvc.so.1
+f usr/lib/amd64/librsm.so.2 0755 root bin
+s usr/lib/amd64/librsm.so=librsm.so.2
+s usr/lib/amd64/librt.so.1=../../../lib/amd64/librt.so.1
+s usr/lib/amd64/librt.so=../../../lib/amd64/librt.so.1
+s usr/lib/amd64/librtld.so.1=../../../lib/amd64/librtld.so.1
+s usr/lib/amd64/librtld_db.so.1=../../../lib/amd64/librtld_db.so.1
+s usr/lib/amd64/librtld_db.so=../../../lib/amd64/librtld_db.so.1
+f usr/lib/amd64/libsasl.so.1 0755 root bin
+s usr/lib/amd64/libsasl.so=libsasl.so.1
+f usr/lib/amd64/libsaveargs.so.1 0755 root bin
+s usr/lib/amd64/libsaveargs.so=libsaveargs.so.1
+s usr/lib/amd64/libscf.so.1=../../../lib/amd64/libscf.so.1
+s usr/lib/amd64/libscf.so=../../../lib/amd64/libscf.so.1
+f usr/lib/amd64/libsched.so.1 0755 root bin
+s usr/lib/amd64/libsched.so=libsched.so.1
+f usr/lib/amd64/libsctp.so.1 0755 root bin
+s usr/lib/amd64/libsctp.so=libsctp.so.1
+s usr/lib/amd64/libsec.so.1=../../../lib/amd64/libsec.so.1
+s usr/lib/amd64/libsec.so=../../../lib/amd64/libsec.so.1
+s usr/lib/amd64/libsecdb.so.1=../../../lib/amd64/libsecdb.so.1
+s usr/lib/amd64/libsecdb.so=../../../lib/amd64/libsecdb.so.1
+s usr/lib/amd64/libsendfile.so.1=../../../lib/amd64/libsendfile.so.1
+s usr/lib/amd64/libsendfile.so=../../../lib/amd64/libsendfile.so.1
+f usr/lib/amd64/libshare.so.1 0755 root bin
+s usr/lib/amd64/libshare.so=libshare.so.1
+f usr/lib/amd64/libshell.so.1 0755 root bin
+s usr/lib/amd64/libshell.so=libshell.so.1
+f usr/lib/amd64/libsip.so.1 0755 root bin
+s usr/lib/amd64/libsip.so=libsip.so.1
+f usr/lib/amd64/libsldap.so.1 0755 root bin
+s usr/lib/amd64/libsldap.so=libsldap.so.1
+f usr/lib/amd64/libslp.so.1 0755 root bin
+s usr/lib/amd64/libslp.so=libslp.so.1
+s usr/lib/amd64/libsmartsshd.so.1=../../../lib/amd64/libsmartsshd.so.1
+s usr/lib/amd64/libsmartsshd.so=../../../lib/amd64/libsmartsshd.so.1
+f usr/lib/amd64/libsmbfs.so.1 0755 root bin
+s usr/lib/amd64/libsmbfs.so=libsmbfs.so.1
+f usr/lib/amd64/libsmbios.so.1 0755 root bin
+s usr/lib/amd64/libsmbios.so=libsmbios.so.1
+f usr/lib/amd64/libsmedia.so.1 0755 root bin
+s usr/lib/amd64/libsmedia.so=libsmedia.so.1
+s usr/lib/amd64/libsocket.so.1=../../../lib/amd64/libsocket.so.1
+s usr/lib/amd64/libsocket.so=../../../lib/amd64/libsocket.so.1
+f usr/lib/amd64/libsoftcrypto.so.1 0755 root bin
+s usr/lib/amd64/libsoftcrypto.so=libsoftcrypto.so.1
+f usr/lib/amd64/libsrpt.so.1 0755 root bin
+s usr/lib/amd64/libsrpt.so=libsrpt.so.1
+f usr/lib/amd64/libstanddisasm.so 0644 root bin
+f usr/lib/amd64/libstmf.so.1 0755 root bin
+s usr/lib/amd64/libstmf.so=libstmf.so.1
+f usr/lib/amd64/libstmfproxy.so.1 0755 root bin
+s usr/lib/amd64/libstmfproxy.so=libstmfproxy.so.1
+f usr/lib/amd64/libsum.so.1 0755 root bin
+s usr/lib/amd64/libsum.so=libsum.so.1
+f usr/lib/amd64/libsun_fc.so.1 0755 root bin
+s usr/lib/amd64/libsun_fc.so=libsun_fc.so.1
+f usr/lib/amd64/libsun_ima.so.1 0755 root bin
+s usr/lib/amd64/libsun_ima.so=libsun_ima.so.1
+f usr/lib/amd64/libsun_sas.so.1 0755 root bin
+s usr/lib/amd64/libsun_sas.so=libsun_sas.so.1
+s usr/lib/amd64/libsysevent.so.1=../../../lib/amd64/libsysevent.so.1
+s usr/lib/amd64/libsysevent.so=../../../lib/amd64/libsysevent.so.1
+f usr/lib/amd64/libtecla.so.1 0755 root bin
+s usr/lib/amd64/libtecla.so=libtecla.so.1
+s usr/lib/amd64/libtermcap.so.1=../../../lib/amd64/libtermcap.so.1
+s usr/lib/amd64/libtermcap.so=../../../lib/amd64/libtermcap.so.1
+s usr/lib/amd64/libtermlib.so.1=../../../lib/amd64/libcurses.so.1
+s usr/lib/amd64/libtermlib.so=../../../lib/amd64/libcurses.so.1
+s usr/lib/amd64/libthread.so.1=../../../lib/amd64/libthread.so.1
+s usr/lib/amd64/libthread.so=../../../lib/amd64/libthread.so.1
+s usr/lib/amd64/libthread_db.so.1=../../../lib/amd64/libc_db.so.1
+s usr/lib/amd64/libthread_db.so=../../../lib/amd64/libc_db.so.1
+f usr/lib/amd64/libtnfctl.so.1 0755 root bin
+s usr/lib/amd64/libtnfctl.so=libtnfctl.so.1
+f usr/lib/amd64/libtnfprobe.so.1 0755 root bin
+s usr/lib/amd64/libtnfprobe.so=libtnfprobe.so.1
+s usr/lib/amd64/libtsnet.so.1=../../../lib/amd64/libtsnet.so.1
+s usr/lib/amd64/libtsnet.so=../../../lib/amd64/libtsnet.so.1
+s usr/lib/amd64/libtsol.so.2=../../../lib/amd64/libtsol.so.2
+s usr/lib/amd64/libtsol.so=../../../lib/amd64/libtsol.so.2
+s usr/lib/amd64/libumem.so.1=../../../lib/amd64/libumem.so.1
+s usr/lib/amd64/libumem.so=../../../lib/amd64/libumem.so.1
+s usr/lib/amd64/libuuid.so.1=../../../lib/amd64/libuuid.so.1
+s usr/lib/amd64/libuuid.so=../../../lib/amd64/libuuid.so.1
+s usr/lib/amd64/libuutil.so.1=../../../lib/amd64/libuutil.so.1
+s usr/lib/amd64/libuutil.so=../../../lib/amd64/libuutil.so.1
+f usr/lib/amd64/libvolmgt.so.1 0755 root bin
+s usr/lib/amd64/libvolmgt.so=libvolmgt.so.1
+f usr/lib/amd64/libvrrpadm.so.1 0755 root bin
+s usr/lib/amd64/libvrrpadm.so=libvrrpadm.so.1
+s usr/lib/amd64/libw.so.1=../../../lib/amd64/libw.so.1
+s usr/lib/amd64/libw.so=../../../lib/amd64/libw.so.1
+f usr/lib/amd64/libwrap.so.1.0 0755 root bin
+s usr/lib/amd64/libwrap.so.1=libwrap.so.1.0
+s usr/lib/amd64/libwrap.so=libwrap.so.1.0
+s usr/lib/amd64/libxnet.so.1=../../../lib/amd64/libxnet.so.1
+s usr/lib/amd64/libxnet.so=../../../lib/amd64/libxnet.so.1
+f usr/lib/amd64/liby.so.1 0755 root bin
+s usr/lib/amd64/liby.so=liby.so.1
+s usr/lib/amd64/libzdoor.so.1=../../../lib/amd64/libzdoor.so.1
+s usr/lib/amd64/libzdoor.so=../../../lib/amd64/libzdoor.so.1
+s usr/lib/amd64/libzfs.so.1=../../../lib/amd64/libzfs.so.1
+s usr/lib/amd64/libzfs.so=../../../lib/amd64/libzfs.so.1
+f usr/lib/amd64/libzfs_core.so.1 755 root bin
+s usr/lib/amd64/libzfs_core.so=libzfs_core.so.1
+f usr/lib/amd64/libzfs_jni.so.1 0755 root bin
+s usr/lib/amd64/libzfs_jni.so=libzfs_jni.so.1
+f usr/lib/amd64/libzonecfg.so.1 0755 root bin
+s usr/lib/amd64/libzonecfg.so=libzonecfg.so.1
+f usr/lib/amd64/libzpool.so.1 0755 root bin
+s usr/lib/amd64/libzpool.so=libzpool.so.1
+f usr/lib/amd64/madv.so.1 0755 root bin
+f usr/lib/amd64/mpss.so.1 0755 root bin
+f usr/lib/amd64/ncad_addr.so.1 0755 root bin
+s usr/lib/amd64/ncad_addr.so=ncad_addr.so.1
+f usr/lib/amd64/nss_ad.so.1 0755 root bin
+s usr/lib/amd64/nss_compat.so.1=../../../lib/amd64/nss_compat.so.1
+s usr/lib/amd64/nss_dns.so.1=../../../lib/amd64/nss_dns.so.1
+s usr/lib/amd64/nss_files.so.1=../../../lib/amd64/nss_files.so.1
+f usr/lib/amd64/nss_ldap.so.1 0755 root bin
+f usr/lib/amd64/nss_mdns.so.1 0755 root bin
+s usr/lib/amd64/nss_nis.so.1=../../../lib/amd64/nss_nis.so.1
+s usr/lib/amd64/nss_user.so.1=../../../lib/amd64/nss_user.so.1
+f usr/lib/amd64/passwdutil.so.1 0755 root bin
+d usr/lib/amd64/pkgconfig 0755 root other
+f usr/lib/amd64/rpcsec.so.1 0755 root bin
+s usr/lib/amd64/rpcsec.so=rpcsec.so.1
+f usr/lib/amd64/sngl_brand.so.1 0755 root bin
+f usr/lib/amd64/straddr.so.2 0755 root bin
+s usr/lib/amd64/straddr.so=straddr.so.2
+f usr/lib/amd64/udapl_tavor.so.1 0755 root bin
+f usr/lib/amd64/values-Xa.o 0644 root bin
+f usr/lib/amd64/values-Xc.o 0644 root bin
+f usr/lib/amd64/values-Xs.o 0644 root bin
+f usr/lib/amd64/values-Xt.o 0644 root bin
+f usr/lib/amd64/values-xpg4.o 0644 root bin
+f usr/lib/amd64/values-xpg6.o 0644 root bin
+f usr/lib/amd64/watchmalloc.so.1 0755 root bin
+d usr/lib/audit 0755 root bin
+f usr/lib/audit/audit_record_attr 0444 root bin
+d usr/lib/autofs 0755 root sys
+f usr/lib/autofs/automountd 0555 root bin
+d usr/lib/brand 0755 root bin
+d usr/lib/brand/shared 0755 root sys
+f usr/lib/brand/shared/common.ksh 0444 root bin
+f usr/lib/brand/shared/query 0755 root bin
+f usr/lib/brand/shared/uninstall.ksh 0444 root bin
+d usr/lib/brand/sngl 0755 root bin
+f usr/lib/brand/sngl/config.xml 0444 root bin
+f usr/lib/brand/sngl/ld.sys.config 0444 root bin
+f usr/lib/brand/sngl/ld.sys64.config 0444 root bin
+f usr/lib/brand/sngl/platform.xml 0444 root bin
+f usr/lib/brand/sngl/sinstall 0755 root bin
+f usr/lib/bridged 0555 root bin
+f usr/lib/calprog 0555 root bin
+d usr/lib/cfgadm 0755 root bin
+d usr/lib/cfgadm/amd64 0755 root bin
+f usr/lib/cfgadm/amd64/fp.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/fp.so=fp.so.1
+f usr/lib/cfgadm/amd64/ib.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/ib.so=ib.so.1
+f usr/lib/cfgadm/amd64/pci.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/pci.so=pci.so.1
+f usr/lib/cfgadm/amd64/sata.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/sata.so=sata.so.1
+f usr/lib/cfgadm/amd64/scsi.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/scsi.so=scsi.so.1
+f usr/lib/cfgadm/amd64/shp.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/shp.so=shp.so.1
+f usr/lib/cfgadm/amd64/usb.so.1 0755 root bin
+s usr/lib/cfgadm/amd64/usb.so=usb.so.1
+f usr/lib/cfgadm/fp.so.1 0755 root bin
+s usr/lib/cfgadm/fp.so=fp.so.1
+f usr/lib/cfgadm/ib.so.1 0755 root bin
+s usr/lib/cfgadm/ib.so=ib.so.1
+f usr/lib/cfgadm/pci.so.1 0755 root bin
+s usr/lib/cfgadm/pci.so=pci.so.1
+f usr/lib/cfgadm/sata.so.1 0755 root bin
+s usr/lib/cfgadm/sata.so=sata.so.1
+f usr/lib/cfgadm/scsi.so.1 0755 root bin
+s usr/lib/cfgadm/scsi.so=scsi.so.1
+f usr/lib/cfgadm/shp.so.1 0755 root bin
+s usr/lib/cfgadm/shp.so=shp.so.1
+f usr/lib/cfgadm/usb.so.1 0755 root bin
+s usr/lib/cfgadm/usb.so=usb.so.1
+d usr/lib/class 0755 root bin
+d usr/lib/class/FSS 0755 root bin
+f usr/lib/class/FSS/FSSdispadmin 0555 root bin
+f usr/lib/class/FSS/FSSpriocntl 0555 root bin
+d usr/lib/class/FX 0755 root bin
+f usr/lib/class/FX/FXdispadmin 0555 root bin
+f usr/lib/class/FX/FXpriocntl 0555 root bin
+d usr/lib/class/IA 0755 root bin
+f usr/lib/class/IA/IAdispadmin 0555 root bin
+f usr/lib/class/IA/IApriocntl 0555 root bin
+d usr/lib/class/RT 0755 root bin
+f usr/lib/class/RT/RTdispadmin 0555 root bin
+f usr/lib/class/RT/RTpriocntl 0555 root bin
+d usr/lib/class/SDC 0755 root bin
+f usr/lib/class/SDC/SDCdispadmin 0555 root bin
+f usr/lib/class/SDC/SDCpriocntl 0555 root bin
+d usr/lib/class/TS 0755 root bin
+f usr/lib/class/TS/TSdispadmin 0555 root bin
+f usr/lib/class/TS/TSpriocntl 0555 root bin
+s usr/lib/cron=../../etc/cron.d
+f usr/lib/crt1.o 0644 root bin
+f usr/lib/crti.o 0644 root bin
+f usr/lib/crtn.o 0644 root bin
+d usr/lib/crypto 0755 root bin
+f usr/lib/cryptpass 0555 root bin
+d usr/lib/devfsadm 0755 root sys
+s usr/lib/devfsadm/devfsadmd=../../sbin/devfsadm
+d usr/lib/devfsadm/linkmod 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_audio_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_cfg_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_dcam1394_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_disk_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_dtrace_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_fssnap_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_ieee1394_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_lofi_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_misc_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_misc_link_i386.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_port_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_ramdisk_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_sgen_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_smp_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_tape_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_usb_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_vscan_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_xen_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_zfs_link.so 0755 root sys
+f usr/lib/devfsadm/linkmod/SUNW_zut_link.so 0755 root sys
+f usr/lib/diff3prog 0555 root bin
+f usr/lib/diffh 0555 root bin
+f usr/lib/dscfglockd 0555 root bin
+d usr/lib/dtrace 0755 root bin
+d usr/lib/dtrace/64 0755 root bin
+f usr/lib/dtrace/64/drti.o 0644 root bin
+f usr/lib/dtrace/64/libdtrace_forceload.so 0644 root bin
+f usr/lib/dtrace/drti.o 0644 root bin
+f usr/lib/dtrace/errno.d 0644 root bin
+f usr/lib/dtrace/fc.d 0644 root bin
+f usr/lib/dtrace/io.d 0644 root bin
+f usr/lib/dtrace/ip.d 0644 root bin
+f usr/lib/dtrace/iscsit.d 0644 root bin
+f usr/lib/dtrace/libdtrace_forceload.so 0644 root bin
+f usr/lib/dtrace/net.d 0644 root bin
+f usr/lib/dtrace/nfs.d 0644 root bin
+f usr/lib/dtrace/procfs.d 0644 root bin
+f usr/lib/dtrace/regs.d 0644 root bin
+f usr/lib/dtrace/sched.d 0644 root bin
+f usr/lib/dtrace/scsi.d 0644 root bin
+f usr/lib/dtrace/signal.d 0644 root bin
+f usr/lib/dtrace/srp.d 0644 root bin
+f usr/lib/dtrace/sysevent.d 0644 root bin
+f usr/lib/dtrace/tcp.d 0644 root bin
+f usr/lib/dtrace/udp.d 0644 root bin
+f usr/lib/dtrace/unistd.d 0644 root bin
+d usr/lib/elfedit 0755 root bin
+s usr/lib/elfedit/32=.
+s usr/lib/elfedit/64=amd64
+d usr/lib/elfedit/amd64 0755 root bin
+f usr/lib/elfedit/amd64/cap.so 0755 root bin
+f usr/lib/elfedit/amd64/dyn.so 0755 root bin
+f usr/lib/elfedit/amd64/ehdr.so 0755 root bin
+f usr/lib/elfedit/amd64/phdr.so 0755 root bin
+f usr/lib/elfedit/amd64/shdr.so 0755 root bin
+f usr/lib/elfedit/amd64/str.so 0755 root bin
+f usr/lib/elfedit/amd64/sym.so 0755 root bin
+f usr/lib/elfedit/amd64/syminfo.so 0755 root bin
+f usr/lib/elfedit/cap.so 0755 root bin
+f usr/lib/elfedit/dyn.so 0755 root bin
+f usr/lib/elfedit/ehdr.so 0755 root bin
+f usr/lib/elfedit/phdr.so 0755 root bin
+f usr/lib/elfedit/shdr.so 0755 root bin
+f usr/lib/elfedit/str.so 0755 root bin
+f usr/lib/elfedit/sym.so 0755 root bin
+f usr/lib/elfedit/syminfo.so 0755 root bin
+s usr/lib/embedded_su=../bin/su
+f usr/lib/expreserve 0555 root bin
+f usr/lib/exrecover 0555 root bin
+f usr/lib/extendedFILE.so.1 0755 root bin
+d usr/lib/fm 0755 root bin
+d usr/lib/fm/amd64 0755 root bin
+f usr/lib/fm/amd64/libdiagcode.so.1 0755 root bin
+s usr/lib/fm/amd64/libdiagcode.so=libdiagcode.so.1
+f usr/lib/fm/amd64/libdiskstatus.so.1 0755 root bin
+s usr/lib/fm/amd64/libdiskstatus.so=libdiskstatus.so.1
+f usr/lib/fm/amd64/libfmd_adm.so.1 0755 root bin
+s usr/lib/fm/amd64/libfmd_adm.so=libfmd_adm.so.1
+f usr/lib/fm/amd64/libfmd_agent.so.1 0755 root bin
+s usr/lib/fm/amd64/libfmd_agent.so=libfmd_agent.so.1
+f usr/lib/fm/amd64/libfmd_log.so.1 0755 root bin
+s usr/lib/fm/amd64/libfmd_log.so=libfmd_log.so.1
+f usr/lib/fm/amd64/libfmd_msg.so.1 0755 root bin
+s usr/lib/fm/amd64/libfmd_msg.so=libfmd_msg.so.1
+s usr/lib/fm/amd64/libfmevent.so.1=../../../../lib/fm/amd64/libfmevent.so.1
+s usr/lib/fm/amd64/libfmevent.so=../../../../lib/fm/amd64/libfmevent.so.1
+f usr/lib/fm/amd64/libfmnotify.so.1 0755 root bin
+s usr/lib/fm/amd64/libfmnotify.so=libfmnotify.so.1
+f usr/lib/fm/amd64/libseslog.so.1 0755 root bin
+s usr/lib/fm/amd64/libseslog.so=libseslog.so.1
+f usr/lib/fm/amd64/libtopo.so.1 0755 root bin
+s usr/lib/fm/amd64/libtopo.so=libtopo.so.1
+f usr/lib/fm/buildcode 0555 root bin
+f usr/lib/fm/bustcode 0555 root bin
+d usr/lib/fm/dict 0755 root bin
+f usr/lib/fm/dict/AMD.dict 0444 root bin
+f usr/lib/fm/dict/DISK.dict 0444 root bin
+f usr/lib/fm/dict/FMD.dict 0444 root bin
+f usr/lib/fm/dict/FMNOTIFY.dict 0444 root bin
+f usr/lib/fm/dict/GMCA.dict 0444 root bin
+f usr/lib/fm/dict/INTEL.dict 0444 root bin
+f usr/lib/fm/dict/NXGE.dict 0444 root bin
+f usr/lib/fm/dict/PCI.dict 0444 root bin
+f usr/lib/fm/dict/PCIEX.dict 0444 root bin
+f usr/lib/fm/dict/SCA1000.dict 0444 root bin
+f usr/lib/fm/dict/SCA500.dict 0444 root bin
+f usr/lib/fm/dict/SENSOR.dict 0444 root bin
+f usr/lib/fm/dict/SMF.dict 0444 root bin
+f usr/lib/fm/dict/STORAGE.dict 0444 root bin
+f usr/lib/fm/dict/SUNOS.dict 0444 root bin
+f usr/lib/fm/dict/TEST.dict 0444 root bin
+f usr/lib/fm/dict/ZFS.dict 0444 root bin
+f usr/lib/fm/dictck 0555 root bin
+d usr/lib/fm/eft 0755 root bin
+f usr/lib/fm/eft/disk.eft 0444 root bin
+f usr/lib/fm/eft/neptune_xaui.eft 0444 root bin
+f usr/lib/fm/eft/neptune_xfp.eft 0444 root bin
+f usr/lib/fm/eft/pci.eft 0444 root bin
+f usr/lib/fm/eft/pciex.eft 0444 root bin
+f usr/lib/fm/eft/pciexrc.eft 0444 root bin
+f usr/lib/fm/eft/sca1000.eft 0444 root bin
+f usr/lib/fm/eft/sca500.eft 0444 root bin
+f usr/lib/fm/eft/sensor.eft 0444 root bin
+f usr/lib/fm/eft/storage.eft 0444 root bin
+f usr/lib/fm/eftinfo 0555 root bin
+f usr/lib/fm/esc 0555 root bin
+d usr/lib/fm/fmd 0755 root bin
+f usr/lib/fm/fmd/fmd 0555 root bin
+f usr/lib/fm/fmd/fminject 0555 root bin
+f usr/lib/fm/fmd/fmsim 0555 root bin
+f usr/lib/fm/fmd/fmtopo 0555 root bin
+f usr/lib/fm/fmd/ipmitopo 0555 root bin
+d usr/lib/fm/fmd/plugins 0755 root bin
+f usr/lib/fm/fmd/plugins/cpumem-retire.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/cpumem-retire.so 0555 root bin
+f usr/lib/fm/fmd/plugins/disk-lights.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/disk-lights.so 0555 root bin
+f usr/lib/fm/fmd/plugins/disk-monitor.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/disk-monitor.so 0555 root bin
+f usr/lib/fm/fmd/plugins/disk-transport.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/disk-transport.so 0555 root bin
+f usr/lib/fm/fmd/plugins/eft.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/eft.so 0555 root bin
+f usr/lib/fm/fmd/plugins/ext-event-transport.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/ext-event-transport.so 0555 root bin
+f usr/lib/fm/fmd/plugins/fabric-xlate.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/fabric-xlate.so 0555 root bin
+f usr/lib/fm/fmd/plugins/fdd-msg.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/fdd-msg.so 0555 root bin
+f usr/lib/fm/fmd/plugins/io-retire.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/io-retire.so 0555 root bin
+f usr/lib/fm/fmd/plugins/ip-transport.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/ip-transport.so 0555 root bin
+f usr/lib/fm/fmd/plugins/sensor-transport.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/sensor-transport.so 0555 root bin
+f usr/lib/fm/fmd/plugins/ses-log-transport.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/ses-log-transport.so 0555 root bin
+f usr/lib/fm/fmd/plugins/software-diagnosis.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/software-diagnosis.so 0555 root bin
+f usr/lib/fm/fmd/plugins/software-response.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/software-response.so 0555 root bin
+f usr/lib/fm/fmd/plugins/sp-monitor.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/sp-monitor.so 0555 root bin
+f usr/lib/fm/fmd/plugins/syslog-msgs.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/syslog-msgs.so 0555 root bin
+f usr/lib/fm/fmd/plugins/zfs-diagnosis.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/zfs-diagnosis.so 0555 root bin
+f usr/lib/fm/fmd/plugins/zfs-retire.conf 0644 root bin
+f usr/lib/fm/fmd/plugins/zfs-retire.so 0555 root bin
+d usr/lib/fm/fmd/schemes 0755 root bin
+d usr/lib/fm/fmd/schemes/amd64 0755 root bin
+f usr/lib/fm/fmd/schemes/amd64/cpu.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/dev.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/fmd.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/hc.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/legacy-hc.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/mem.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/mod.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/pkg.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/svc.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/sw.so 0555 root bin
+f usr/lib/fm/fmd/schemes/amd64/zfs.so 0555 root bin
+f usr/lib/fm/fmd/schemes/cpu.so 0555 root bin
+f usr/lib/fm/fmd/schemes/dev.so 0555 root bin
+f usr/lib/fm/fmd/schemes/fmd.so 0555 root bin
+f usr/lib/fm/fmd/schemes/hc.so 0555 root bin
+f usr/lib/fm/fmd/schemes/legacy-hc.so 0555 root bin
+f usr/lib/fm/fmd/schemes/mem.so 0555 root bin
+f usr/lib/fm/fmd/schemes/mod.so 0555 root bin
+f usr/lib/fm/fmd/schemes/pkg.so 0555 root bin
+f usr/lib/fm/fmd/schemes/svc.so 0555 root bin
+f usr/lib/fm/fmd/schemes/sw.so 0555 root bin
+f usr/lib/fm/fmd/schemes/zfs.so 0555 root bin
+f usr/lib/fm/libdiagcode.so.1 0755 root bin
+s usr/lib/fm/libdiagcode.so=libdiagcode.so.1
+f usr/lib/fm/libdiskstatus.so.1 0755 root bin
+s usr/lib/fm/libdiskstatus.so=libdiskstatus.so.1
+f usr/lib/fm/libfmd_adm.so.1 0755 root bin
+s usr/lib/fm/libfmd_adm.so=libfmd_adm.so.1
+f usr/lib/fm/libfmd_agent.so.1 0755 root bin
+s usr/lib/fm/libfmd_agent.so=libfmd_agent.so.1
+f usr/lib/fm/libfmd_log.so.1 0755 root bin
+s usr/lib/fm/libfmd_log.so=libfmd_log.so.1
+f usr/lib/fm/libfmd_msg.so.1 0755 root bin
+s usr/lib/fm/libfmd_msg.so=libfmd_msg.so.1
+s usr/lib/fm/libfmevent.so.1=../../../lib/fm/libfmevent.so.1
+s usr/lib/fm/libfmevent.so=../../../lib/fm/libfmevent.so.1
+f usr/lib/fm/libfmnotify.so.1 0755 root bin
+s usr/lib/fm/libfmnotify.so=libfmnotify.so.1
+f usr/lib/fm/libseslog.so.1 0755 root bin
+s usr/lib/fm/libseslog.so=libseslog.so.1
+f usr/lib/fm/libtopo.so.1 0755 root bin
+s usr/lib/fm/libtopo.so=libtopo.so.1
+d usr/lib/fm/notify 0755 root bin
+f usr/lib/fm/notify/process_msg_template.sh 0555 root bin
+f usr/lib/fm/notify/smtp-notify 0555 root bin
+d usr/lib/fm/topo 0755 root bin
+d usr/lib/fm/topo/maps 0755 root bin
+f usr/lib/fm/topo/maps/xfp-hc-topology.xml 0444 root bin
+d usr/lib/fm/topo/plugins 0755 root bin
+f usr/lib/fm/topo/plugins/disk.so 0555 root bin
+f usr/lib/fm/topo/plugins/fac_prov_ipmi.so 0555 root bin
+f usr/lib/fm/topo/plugins/fac_prov_mptsas.so 0555 root bin
+f usr/lib/fm/topo/plugins/ipmi.so 0555 root bin
+f usr/lib/fm/topo/plugins/ses.so 0555 root bin
+f usr/lib/fm/topo/plugins/xfp.so 0555 root bin
+d usr/lib/fs 0755 root sys
+d usr/lib/fs/autofs 0755 root sys
+d usr/lib/fs/autofs/amd64 0755 root sys
+f usr/lib/fs/autofs/amd64/libshare_autofs.so.1 0755 root bin
+s usr/lib/fs/autofs/amd64/libshare_autofs.so=libshare_autofs.so.1
+f usr/lib/fs/autofs/automount 0555 root bin
+f usr/lib/fs/autofs/dfshares 0555 root bin
+f usr/lib/fs/autofs/libshare_autofs.so.1 0755 root bin
+s usr/lib/fs/autofs/libshare_autofs.so=libshare_autofs.so.1
+f usr/lib/fs/autofs/mount 0555 root bin
+f usr/lib/fs/autofs/share 0555 root bin
+f usr/lib/fs/autofs/unshare 0555 root bin
+d usr/lib/fs/ctfs 0755 root sys
+f usr/lib/fs/ctfs/mount 0555 root bin
+d usr/lib/fs/dev 0755 root sys
+s usr/lib/fs/dev/mount=../../../../etc/fs/dev/mount
+d usr/lib/fs/fd 0755 root sys
+f usr/lib/fs/fd/mount 0555 root bin
+d usr/lib/fs/hsfs 0755 root sys
+f usr/lib/fs/hsfs/fstyp.so.1 0555 root bin
+h usr/lib/fs/hsfs/fstyp=usr/sbin/fstyp
+f usr/lib/fs/hsfs/labelit 0555 root bin
+s usr/lib/fs/hsfs/mount=../../../../etc/fs/hsfs/mount
+d usr/lib/fs/hyprlofs 0755 root sys
+f usr/lib/fs/hyprlofs/hlcfg 0555 root bin
+f usr/lib/fs/hyprlofs/mount 0555 root bin
+d usr/lib/fs/lofs 0755 root sys
+f usr/lib/fs/lofs/mount 0555 root bin
+d usr/lib/fs/lxproc 0755 root sys
+f usr/lib/fs/lxproc/mount 0555 root bin
+d usr/lib/fs/mntfs 0755 root sys
+f usr/lib/fs/mntfs/mount 0555 root bin
+d usr/lib/fs/nfs 0755 root sys
+d usr/lib/fs/nfs/amd64 0755 root sys
+f usr/lib/fs/nfs/amd64/libshare_nfs.so.1 0755 root sys
+s usr/lib/fs/nfs/amd64/libshare_nfs.so=libshare_nfs.so.1
+f usr/lib/fs/nfs/dfmounts 0555 root bin
+h usr/lib/fs/nfs/dfshares=usr/lib/fs/nfs/dfmounts
+f usr/lib/fs/nfs/libshare_nfs.so.1 0755 root sys
+s usr/lib/fs/nfs/libshare_nfs.so=libshare_nfs.so.1
+s usr/lib/fs/nfs/mount=../../../../etc/fs/nfs/mount
+f usr/lib/fs/nfs/nfsfind 0555 root sys
+f usr/lib/fs/nfs/showmount 0555 root bin
+f usr/lib/fs/nfs/umount 0555 root bin
+d usr/lib/fs/objfs 0755 root sys
+f usr/lib/fs/objfs/mount 0555 root bin
+d usr/lib/fs/pcfs 0755 root sys
+f usr/lib/fs/pcfs/fsck 0555 root bin
+f usr/lib/fs/pcfs/fstyp.so.1 0555 root bin
+h usr/lib/fs/pcfs/fstyp=usr/sbin/fstyp
+f usr/lib/fs/pcfs/mkfs 0555 root bin
+f usr/lib/fs/pcfs/mount 0555 root bin
+d usr/lib/fs/proc 0755 root sys
+f usr/lib/fs/proc/mount 0555 root bin
+d usr/lib/fs/sharefs 0755 root sys
+f usr/lib/fs/sharefs/mount 0555 root bin
+d usr/lib/fs/smb 0755 root sys
+d usr/lib/fs/smb/amd64 0755 root sys
+f usr/lib/fs/smb/amd64/libshare_smb.so.1 0755 root sys
+f usr/lib/fs/smb/libshare_smb.so.1 0755 root sys
+d usr/lib/fs/smbfs 0755 root sys
+d usr/lib/fs/smbfs/amd64 0755 root sys
+f usr/lib/fs/smbfs/amd64/libshare_smbfs.so.1 0755 root sys
+s usr/lib/fs/smbfs/amd64/libshare_smbfs.so=libshare_smbfs.so.1
+f usr/lib/fs/smbfs/dfshares 0555 root bin
+f usr/lib/fs/smbfs/libshare_smbfs.so.1 0755 root sys
+s usr/lib/fs/smbfs/libshare_smbfs.so=libshare_smbfs.so.1
+f usr/lib/fs/smbfs/mount 0555 root bin
+f usr/lib/fs/smbfs/share 0555 root bin
+f usr/lib/fs/smbfs/umount 0555 root bin
+f usr/lib/fs/smbfs/unshare 0555 root bin
+d usr/lib/fs/tmpfs 0755 root sys
+f usr/lib/fs/tmpfs/mount 0555 root bin
+d usr/lib/fs/ufs 0755 root sys
+f usr/lib/fs/ufs/clri 0555 root bin
+f usr/lib/fs/ufs/dcopy 0555 root bin
+f usr/lib/fs/ufs/df 0555 root bin
+f usr/lib/fs/ufs/edquota 0555 root bin
+f usr/lib/fs/ufs/ff 0555 root bin
+f usr/lib/fs/ufs/fsck 0555 root bin
+f usr/lib/fs/ufs/fsckall 0555 root bin
+f usr/lib/fs/ufs/fsdb 0555 root bin
+f usr/lib/fs/ufs/fsirand 0555 root bin
+f usr/lib/fs/ufs/fssnap 0555 root bin
+f usr/lib/fs/ufs/fstyp.so.1 0555 root bin
+h usr/lib/fs/ufs/fstyp=usr/sbin/fstyp
+f usr/lib/fs/ufs/labelit 0555 root bin
+f usr/lib/fs/ufs/lockfs 0555 root bin
+f usr/lib/fs/ufs/mboot 0444 root sys
+f usr/lib/fs/ufs/mkfs 0555 root bin
+s usr/lib/fs/ufs/mount=../../../../etc/fs/ufs/mount
+f usr/lib/fs/ufs/ncheck 0555 root bin
+f usr/lib/fs/ufs/newfs 0555 root bin
+f usr/lib/fs/ufs/quot 0555 root bin
+f usr/lib/fs/ufs/quota 4555 root bin
+f usr/lib/fs/ufs/quotacheck 0555 root bin
+f usr/lib/fs/ufs/quotaoff 0555 root bin
+f usr/lib/fs/ufs/quotaon 0555 root bin
+f usr/lib/fs/ufs/repquota 0555 root bin
+f usr/lib/fs/ufs/tunefs 0555 root bin
+f usr/lib/fs/ufs/ufsdump 4555 root bin
+f usr/lib/fs/ufs/ufsrestore 4555 root bin
+f usr/lib/fs/ufs/volcopy 0555 root bin
+d usr/lib/fs/zfs 0755 root sys
+f usr/lib/fs/zfs/bootinstall 0555 root bin
+f usr/lib/fs/zfs/fstyp.so.1 0555 root bin
+h usr/lib/fs/zfs/fstyp=usr/sbin/fstyp
+s usr/lib/fs/zfs/mount=../../../../sbin/zfs
+s usr/lib/fs/zfs/umount=../../../../sbin/zfs
+d usr/lib/fwflash 0755 root bin
+d usr/lib/fwflash/identify 0755 root bin
+f usr/lib/fwflash/identify/hermon.so 0755 root bin
+f usr/lib/fwflash/identify/sd.so 0755 root bin
+f usr/lib/fwflash/identify/ses.so 0755 root bin
+s usr/lib/fwflash/identify/sgen.so=ses.so
+f usr/lib/fwflash/identify/tavor.so 0755 root bin
+d usr/lib/fwflash/verify 0755 root bin
+f usr/lib/fwflash/verify/hermon-MELLANOX.so 0755 root bin
+f usr/lib/fwflash/verify/sd-GENERIC.so 0755 root bin
+s usr/lib/fwflash/verify/ses-LSILOGIC.so=ses-SUN.so
+f usr/lib/fwflash/verify/ses-SUN.so 0755 root bin
+s usr/lib/fwflash/verify/sgen-LSILOGIC.so=ses-SUN.so
+s usr/lib/fwflash/verify/sgen-SUN.so=ses-SUN.so
+f usr/lib/fwflash/verify/tavor-MELLANOX.so 0755 root bin
+f usr/lib/gcrt1.o 0644 root bin
+f usr/lib/getNAME 0555 root bin
+f usr/lib/getoptcvt 0555 root bin
+f usr/lib/gmsgfmt 0555 root bin
+d usr/lib/gss 0755 root bin
+f usr/lib/gss/dh1024-0.so.1 0755 root bin
+s usr/lib/gss/dh1024-0.so=dh1024-0.so.1
+f usr/lib/gss/dh640-0.so.1 0755 root bin
+s usr/lib/gss/dh640-0.so=dh640-0.so.1
+f usr/lib/gss/gsscred_clean 0744 root sys
+f usr/lib/gss/gssd 0555 root bin
+s usr/lib/gss/libmech_krb5.so=mech_krb5.so.1
+f usr/lib/gss/mech_dh.so.1 0755 root bin
+s usr/lib/gss/mech_dh.so=mech_dh.so.1
+f usr/lib/gss/mech_krb5.so.1 0755 root bin
+s usr/lib/gss/mech_krb5.so=mech_krb5.so.1
+f usr/lib/gss/mech_spnego.so.1 0755 root bin
+d usr/lib/help 0755 root bin
+d usr/lib/help/auths 0755 root bin
+d usr/lib/help/auths/locale 0755 root bin
+f usr/lib/help/auths/locale/AllSolAuthsHeader.html 0444 root bin
+f usr/lib/help/auths/locale/AuditHeader.html 0444 root bin
+f usr/lib/help/auths/locale/AuthJobsAdmin.html 0444 root bin
+f usr/lib/help/auths/locale/AuthJobsUser.html 0444 root bin
+f usr/lib/help/auths/locale/AuthProfmgrAssign.html 0444 root bin
+f usr/lib/help/auths/locale/AuthProfmgrDelegate.html 0444 root bin
+f usr/lib/help/auths/locale/AuthProfmgrExecattrWrite.html 0444 root bin
+f usr/lib/help/auths/locale/AuthProfmgrRead.html 0444 root bin
+f usr/lib/help/auths/locale/AuthProfmgrWrite.html 0444 root bin
+f usr/lib/help/auths/locale/AuthReadNDMP.html 0444 root bin
+f usr/lib/help/auths/locale/AuthReadSMB.html 0444 root bin
+f usr/lib/help/auths/locale/AuthRoleAssign.html 0444 root bin
+f usr/lib/help/auths/locale/AuthRoleDelegate.html 0444 root bin
+f usr/lib/help/auths/locale/AuthRoleWrite.html 0444 root bin
+f usr/lib/help/auths/locale/BindStates.html 0444 root bin
+d usr/lib/help/auths/locale/C 0755 root bin
+f usr/lib/help/auths/locale/C/AllSolAuthsHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuditHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthJobsAdmin.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthJobsUser.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthProfmgrAssign.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthProfmgrDelegate.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthProfmgrExecattrWrite.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthProfmgrRead.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthProfmgrWrite.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthReadNDMP.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthReadSMB.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthRoleAssign.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthRoleDelegate.html 0444 root bin
+f usr/lib/help/auths/locale/C/AuthRoleWrite.html 0444 root bin
+f usr/lib/help/auths/locale/C/BindStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/DevAllocHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/DevAllocate.html 0444 root bin
+f usr/lib/help/auths/locale/C/DevCDRW.html 0444 root bin
+f usr/lib/help/auths/locale/C/DevConfig.html 0444 root bin
+f usr/lib/help/auths/locale/C/DevGrant.html 0444 root bin
+f usr/lib/help/auths/locale/C/DevRevoke.html 0444 root bin
+f usr/lib/help/auths/locale/C/DhcpmgrHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/DhcpmgrWrite.html 0444 root bin
+f usr/lib/help/auths/locale/C/FileChown.html 0444 root bin
+f usr/lib/help/auths/locale/C/FileHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/FileOwner.html 0444 root bin
+f usr/lib/help/auths/locale/C/HotplugHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/HotplugModify.html 0444 root bin
+f usr/lib/help/auths/locale/C/IdmapRules.html 0444 root bin
+f usr/lib/help/auths/locale/C/JobHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/JobsGrant.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelFileDowngrade.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelFileUpgrade.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelPrint.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelRange.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelServer.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelWinDowngrade.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelWinNoView.html 0444 root bin
+f usr/lib/help/auths/locale/C/LabelWinUpgrade.html 0444 root bin
+f usr/lib/help/auths/locale/C/LinkSecurity.html 0444 root bin
+f usr/lib/help/auths/locale/C/LoginEnable.html 0444 root bin
+f usr/lib/help/auths/locale/C/LoginHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/LoginRemote.html 0444 root bin
+f usr/lib/help/auths/locale/C/MailHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/MailQueue.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkAutoconfRead.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkAutoconfSelect.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkAutoconfWlan.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkAutoconfWrite.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkILBconf.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkILBenable.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkInterfaceConfig.html 0444 root bin
+f usr/lib/help/auths/locale/C/NetworkVRRP.html 0444 root bin
+f usr/lib/help/auths/locale/C/PriAdmin.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintAdmin.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintCancel.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintList.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintNoBanner.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintPs.html 0444 root bin
+f usr/lib/help/auths/locale/C/PrintUnlabeled.html 0444 root bin
+f usr/lib/help/auths/locale/C/ProfmgrHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/RoleHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfAllocate.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfAutofsStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfCoreadmStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfCronStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfExAcctFlowStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfExAcctNetStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfExAcctProcessStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfExAcctTaskStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfILBStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfIPsecStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfIdmapStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfInetdStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfLocationStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfMDNSStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfManageAudit.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfManageHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfManageHotplug.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfManageZFSSnap.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfModifyAppl.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfModifyDepend.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfModifyFramework.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfModifyHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfModifyMethod.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfNADDStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfNDMPStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfNWAMStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfNscdStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfPowerStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfReparseStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfRoutingStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfSMBFSStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfSMBStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfSendmailStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfSshStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfSyslogStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfVRRPStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueAudit.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueCoreadm.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueExAcctFlow.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueExAcctNet.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueExAcctProcess.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueExAcctTask.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueFirewall.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueIPsec.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueIdmap.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueInetd.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueMDNS.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueNADD.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueNDMP.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueNWAM.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueRouting.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueSMB.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueVscan.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfValueVt.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfVscanStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfVtStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SmfWpaStates.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysCpuPowerMgmt.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysDate.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysMaintenance.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysPowerMgmtBrightness.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysPowerMgmtHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysPowerMgmtSuspend.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysPowerMgmtSuspendtoDisk.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysPowerMgmtSuspendtoRAM.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysShutdown.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysSyseventRead.html 0444 root bin
+f usr/lib/help/auths/locale/C/SysSyseventWrite.html 0444 root bin
+f usr/lib/help/auths/locale/C/TNDaemon.html 0444 root bin
+f usr/lib/help/auths/locale/C/TNctl.html 0444 root bin
+f usr/lib/help/auths/locale/C/ValueTND.html 0444 root bin
+f usr/lib/help/auths/locale/C/WifiConfig.html 0444 root bin
+f usr/lib/help/auths/locale/C/WifiWep.html 0444 root bin
+f usr/lib/help/auths/locale/C/ZoneCloneFrom.html 0444 root bin
+f usr/lib/help/auths/locale/C/ZoneHeader.html 0444 root bin
+f usr/lib/help/auths/locale/C/ZoneLogin.html 0444 root bin
+f usr/lib/help/auths/locale/C/ZoneManage.html 0444 root bin
+f usr/lib/help/auths/locale/DevAllocHeader.html 0444 root bin
+f usr/lib/help/auths/locale/DevAllocate.html 0444 root bin
+f usr/lib/help/auths/locale/DevCDRW.html 0444 root bin
+f usr/lib/help/auths/locale/DevConfig.html 0444 root bin
+f usr/lib/help/auths/locale/DevGrant.html 0444 root bin
+f usr/lib/help/auths/locale/DevRevoke.html 0444 root bin
+f usr/lib/help/auths/locale/DhcpmgrHeader.html 0444 root bin
+f usr/lib/help/auths/locale/DhcpmgrWrite.html 0444 root bin
+f usr/lib/help/auths/locale/FileChown.html 0444 root bin
+f usr/lib/help/auths/locale/FileHeader.html 0444 root bin
+f usr/lib/help/auths/locale/FileOwner.html 0444 root bin
+f usr/lib/help/auths/locale/HotplugHeader.html 0444 root bin
+f usr/lib/help/auths/locale/HotplugModify.html 0444 root bin
+f usr/lib/help/auths/locale/IdmapRules.html 0444 root bin
+f usr/lib/help/auths/locale/JobHeader.html 0444 root bin
+f usr/lib/help/auths/locale/JobsGrant.html 0444 root bin
+f usr/lib/help/auths/locale/LabelFileDowngrade.html 0444 root bin
+f usr/lib/help/auths/locale/LabelFileUpgrade.html 0444 root bin
+f usr/lib/help/auths/locale/LabelHeader.html 0444 root bin
+f usr/lib/help/auths/locale/LabelPrint.html 0444 root bin
+f usr/lib/help/auths/locale/LabelRange.html 0444 root bin
+f usr/lib/help/auths/locale/LabelServer.html 0444 root bin
+f usr/lib/help/auths/locale/LabelWinDowngrade.html 0444 root bin
+f usr/lib/help/auths/locale/LabelWinNoView.html 0444 root bin
+f usr/lib/help/auths/locale/LabelWinUpgrade.html 0444 root bin
+f usr/lib/help/auths/locale/LinkSecurity.html 0444 root bin
+f usr/lib/help/auths/locale/LoginEnable.html 0444 root bin
+f usr/lib/help/auths/locale/LoginHeader.html 0444 root bin
+f usr/lib/help/auths/locale/LoginRemote.html 0444 root bin
+f usr/lib/help/auths/locale/MailHeader.html 0444 root bin
+f usr/lib/help/auths/locale/MailQueue.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkAutoconfRead.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkAutoconfSelect.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkAutoconfWlan.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkAutoconfWrite.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkHeader.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkILBconf.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkILBenable.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkInterfaceConfig.html 0444 root bin
+f usr/lib/help/auths/locale/NetworkVRRP.html 0444 root bin
+f usr/lib/help/auths/locale/PriAdmin.html 0444 root bin
+f usr/lib/help/auths/locale/PrintAdmin.html 0444 root bin
+f usr/lib/help/auths/locale/PrintCancel.html 0444 root bin
+f usr/lib/help/auths/locale/PrintHeader.html 0444 root bin
+f usr/lib/help/auths/locale/PrintList.html 0444 root bin
+f usr/lib/help/auths/locale/PrintNoBanner.html 0444 root bin
+f usr/lib/help/auths/locale/PrintPs.html 0444 root bin
+f usr/lib/help/auths/locale/PrintUnlabeled.html 0444 root bin
+f usr/lib/help/auths/locale/ProfmgrHeader.html 0444 root bin
+f usr/lib/help/auths/locale/RoleHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SmfAllocate.html 0444 root bin
+f usr/lib/help/auths/locale/SmfAutofsStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfCoreadmStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfCronStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfExAcctFlowStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfExAcctNetStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfExAcctProcessStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfExAcctTaskStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SmfILBStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfIPsecStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfIdmapStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfInetdStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfLocationStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfMDNSStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfManageAudit.html 0444 root bin
+f usr/lib/help/auths/locale/SmfManageHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SmfManageHotplug.html 0444 root bin
+f usr/lib/help/auths/locale/SmfManageZFSSnap.html 0444 root bin
+f usr/lib/help/auths/locale/SmfModifyAppl.html 0444 root bin
+f usr/lib/help/auths/locale/SmfModifyDepend.html 0444 root bin
+f usr/lib/help/auths/locale/SmfModifyFramework.html 0444 root bin
+f usr/lib/help/auths/locale/SmfModifyHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SmfModifyMethod.html 0444 root bin
+f usr/lib/help/auths/locale/SmfNADDStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfNDMPStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfNWAMStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfNscdStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfPowerStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfReparseStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfRoutingStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfSMBFSStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfSMBStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfSendmailStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfSshStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfSyslogStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfVRRPStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueAudit.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueCoreadm.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueExAcctFlow.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueExAcctNet.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueExAcctProcess.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueExAcctTask.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueFirewall.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueIPsec.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueIdmap.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueInetd.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueMDNS.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueNADD.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueNDMP.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueNWAM.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueRouting.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueSMB.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueVscan.html 0444 root bin
+f usr/lib/help/auths/locale/SmfValueVt.html 0444 root bin
+f usr/lib/help/auths/locale/SmfVscanStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfVtStates.html 0444 root bin
+f usr/lib/help/auths/locale/SmfWpaStates.html 0444 root bin
+f usr/lib/help/auths/locale/SysCpuPowerMgmt.html 0444 root bin
+f usr/lib/help/auths/locale/SysDate.html 0444 root bin
+f usr/lib/help/auths/locale/SysHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SysMaintenance.html 0444 root bin
+f usr/lib/help/auths/locale/SysPowerMgmtBrightness.html 0444 root bin
+f usr/lib/help/auths/locale/SysPowerMgmtHeader.html 0444 root bin
+f usr/lib/help/auths/locale/SysPowerMgmtSuspend.html 0444 root bin
+f usr/lib/help/auths/locale/SysPowerMgmtSuspendtoDisk.html 0444 root bin
+f usr/lib/help/auths/locale/SysPowerMgmtSuspendtoRAM.html 0444 root bin
+f usr/lib/help/auths/locale/SysShutdown.html 0444 root bin
+f usr/lib/help/auths/locale/SysSyseventRead.html 0444 root bin
+f usr/lib/help/auths/locale/SysSyseventWrite.html 0444 root bin
+f usr/lib/help/auths/locale/TNDaemon.html 0444 root bin
+f usr/lib/help/auths/locale/TNctl.html 0444 root bin
+f usr/lib/help/auths/locale/ValueTND.html 0444 root bin
+f usr/lib/help/auths/locale/WifiConfig.html 0444 root bin
+f usr/lib/help/auths/locale/WifiWep.html 0444 root bin
+f usr/lib/help/auths/locale/ZoneCloneFrom.html 0444 root bin
+f usr/lib/help/auths/locale/ZoneHeader.html 0444 root bin
+f usr/lib/help/auths/locale/ZoneLogin.html 0444 root bin
+f usr/lib/help/auths/locale/ZoneManage.html 0444 root bin
+d usr/lib/help/profiles 0755 root bin
+d usr/lib/help/profiles/locale 0755 root bin
+d usr/lib/help/profiles/locale/C 0755 root bin
+f usr/lib/help/profiles/locale/C/RtAcctadm.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtAll.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtAuditCfg.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtAuditCtrl.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtAuditReview.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtCPUPowerManagement.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtConsUser.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtContractObserver.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtCronMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtCryptoMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtDHCPMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtDatAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtDefault.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtDeviceMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtDeviceSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtExAcctFlow.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtExAcctNet.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtExAcctProcess.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtExAcctTask.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtFTPMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtFileSysMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtFileSysSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtHotplugMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtIPFilterMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtIdmapMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtIdmapNameRulesMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtInetdMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtInfoSec.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtKerberosClntMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtKerberosSrvrMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtLogMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtMailMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtMaintAndRepair.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtMediaBkup.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtMediaCtlg.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtMediaRestore.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNDMPMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNameServiceAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNameServiceSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetAutoconfAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetAutoconfUser.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetILB.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetIPsec.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetLinkSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetObservability.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetVRRP.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetWifiMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtNetWifiSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtObAccessMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtObjectLabelMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtOperator.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtOutsideAccred.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtPriAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtPrntAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtProcManagement.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtReparseMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtReservedProfile.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtRightsDelegate.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSMBFSMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSMBMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSoftwareInstall.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysEvMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysPowerMgmt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysPowerMgmtBrightness.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysPowerMgmtSuspend.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysPowerMgmtSuspendtoDisk.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtSysPowerMgmtSuspendtoRAM.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtUserMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtUserSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtVscanMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtZFSFileSysMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtZFSStorageMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtZoneMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/C/RtZoneSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/RtAcctadm.html 0444 root bin
+f usr/lib/help/profiles/locale/RtAll.html 0444 root bin
+f usr/lib/help/profiles/locale/RtAuditCfg.html 0444 root bin
+f usr/lib/help/profiles/locale/RtAuditCtrl.html 0444 root bin
+f usr/lib/help/profiles/locale/RtAuditReview.html 0444 root bin
+f usr/lib/help/profiles/locale/RtCPUPowerManagement.html 0444 root bin
+f usr/lib/help/profiles/locale/RtConsUser.html 0444 root bin
+f usr/lib/help/profiles/locale/RtContractObserver.html 0444 root bin
+f usr/lib/help/profiles/locale/RtCronMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtCryptoMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtDHCPMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtDatAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/RtDefault.html 0444 root bin
+f usr/lib/help/profiles/locale/RtDeviceMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtDeviceSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/RtExAcctFlow.html 0444 root bin
+f usr/lib/help/profiles/locale/RtExAcctNet.html 0444 root bin
+f usr/lib/help/profiles/locale/RtExAcctProcess.html 0444 root bin
+f usr/lib/help/profiles/locale/RtExAcctTask.html 0444 root bin
+f usr/lib/help/profiles/locale/RtFTPMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtFileSysMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtFileSysSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/RtHotplugMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtIPFilterMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtIdmapMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtIdmapNameRulesMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtInetdMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtInfoSec.html 0444 root bin
+f usr/lib/help/profiles/locale/RtKerberosClntMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtKerberosSrvrMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtLogMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtMailMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtMaintAndRepair.html 0444 root bin
+f usr/lib/help/profiles/locale/RtMediaBkup.html 0444 root bin
+f usr/lib/help/profiles/locale/RtMediaCtlg.html 0444 root bin
+f usr/lib/help/profiles/locale/RtMediaRestore.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNDMPMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNameServiceAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNameServiceSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetAutoconfAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetAutoconfUser.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetILB.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetIPsec.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetLinkSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetObservability.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetVRRP.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetWifiMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtNetWifiSecure.html 0444 root bin
+f usr/lib/help/profiles/locale/RtObAccessMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtObjectLabelMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtOperator.html 0444 root bin
+f usr/lib/help/profiles/locale/RtOutsideAccred.html 0444 root bin
+f usr/lib/help/profiles/locale/RtPriAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/RtPrntAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/RtProcManagement.html 0444 root bin
+f usr/lib/help/profiles/locale/RtReparseMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtReservedProfile.html 0444 root bin
+f usr/lib/help/profiles/locale/RtRightsDelegate.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSMBFSMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSMBMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSoftwareInstall.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysAdmin.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysEvMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysPowerMgmt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysPowerMgmtBrightness.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysPowerMgmtSuspend.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysPowerMgmtSuspendtoDisk.html 0444 root bin
+f usr/lib/help/profiles/locale/RtSysPowerMgmtSuspendtoRAM.html 0444 root bin
+f usr/lib/help/profiles/locale/RtUserMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtUserSecurity.html 0444 root bin
+f usr/lib/help/profiles/locale/RtVscanMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtZFSFileSysMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtZFSStorageMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtZoneMngmnt.html 0444 root bin
+f usr/lib/help/profiles/locale/RtZoneSecurity.html 0444 root bin
+f usr/lib/hotplugd 0555 root bin
+f usr/lib/idmapd 0555 root bin
+d usr/lib/inet 0755 root bin
+d usr/lib/inet/amd64 0755 root bin
+f usr/lib/inet/amd64/in.iked 0555 root bin
+f usr/lib/inet/certdb 0555 root bin
+f usr/lib/inet/certlocal 0555 root bin
+f usr/lib/inet/certrldb 0555 root bin
+d usr/lib/inet/dhcp 0755 root bin
+d usr/lib/inet/dhcp/nsu 0755 root bin
+f usr/lib/inet/dhcp/nsu/rfc2136.so.1 0755 root bin
+d usr/lib/inet/dhcp/svc 0755 root bin
+f usr/lib/inet/dhcp/svc/ds_SUNWbinfiles.so.1 0755 root bin
+s usr/lib/inet/dhcp/svc/ds_SUNWbinfiles.so=ds_SUNWbinfiles.so.1
+f usr/lib/inet/dhcp/svc/ds_SUNWfiles.so.0 0755 root bin
+f usr/lib/inet/dhcp/svc/ds_SUNWfiles.so.1 0755 root bin
+s usr/lib/inet/dhcp/svc/ds_SUNWfiles.so=ds_SUNWfiles.so.1
+f usr/lib/inet/dsvclockd 0555 root bin
+d usr/lib/inet/i86 0755 root bin
+d usr/lib/inet/ilb 0755 root bin
+f usr/lib/inet/ilb/ilb_probe 0555 root bin
+f usr/lib/inet/ilbd 0555 root bin
+f usr/lib/inet/in.chargend 0555 root bin
+f usr/lib/inet/in.daytimed 0555 root bin
+f usr/lib/inet/in.dhcpd 0555 root bin
+f usr/lib/inet/in.discardd 0555 root bin
+f usr/lib/inet/in.echod 0555 root bin
+h usr/lib/inet/in.iked=usr/lib/isaexec
+s usr/lib/inet/in.mpathd=../../../lib/inet/in.mpathd
+f usr/lib/inet/in.ndpd 0555 root bin
+f usr/lib/inet/in.ripngd 0555 root bin
+f usr/lib/inet/in.timed 0555 root bin
+f usr/lib/inet/inetd 0555 root bin
+f usr/lib/inet/mdnsd 0555 root bin
+f usr/lib/inet/ncaconfd 0555 root bin
+d usr/lib/inet/ppp 0755 root bin
+f usr/lib/inet/ppp/minconn.so 0544 root bin
+f usr/lib/inet/ppp/passprompt.so 0544 root bin
+f usr/lib/inet/ppp/pppoe.so 0544 root bin
+f usr/lib/inet/pppoec 0555 root bin
+f usr/lib/inet/pppoed 0555 root bin
+f usr/lib/inet/slpd 0555 root bin
+f usr/lib/inet/vrrpd 0555 root bin
+f usr/lib/inet/wpad 0555 root bin
+f usr/lib/intrd 0555 root bin
+d usr/lib/ipf 0755 root bin
+f usr/lib/ipf/IPFILTER.LICENCE 0644 root bin
+d usr/lib/ipf/amd64 0755 root sys
+f usr/lib/ipf/amd64/ipftest 0555 root bin
+d usr/lib/ipf/i86 0755 root sys
+h usr/lib/ipf/ipftest=usr/lib/isaexec
+d usr/lib/ipqosconf 0755 root bin
+f usr/lib/ipqosconf/dlcosmk.types 0444 root bin
+f usr/lib/ipqosconf/dscpmk.types 0444 root bin
+f usr/lib/ipqosconf/flowacct.types 0444 root bin
+f usr/lib/ipqosconf/ipgpc.types 0444 root bin
+f usr/lib/ipqosconf/tokenmt.types 0444 root bin
+f usr/lib/ipqosconf/tswtclmt.types 0444 root bin
+f usr/lib/isaexec 0555 root bin
+d usr/lib/krb5 0755 root bin
+f usr/lib/krb5/README.db2 0444 root bin
+d usr/lib/krb5/amd64 0755 root bin
+f usr/lib/krb5/amd64/libkadm5clnt.so.1 0755 root bin
+s usr/lib/krb5/amd64/libkadm5clnt.so=libkadm5clnt.so.1
+f usr/lib/krb5/db2.so.1 0755 root bin
+s usr/lib/krb5/db2.so=db2.so.1
+f usr/lib/krb5/kadmind 0500 root bin
+f usr/lib/krb5/kconf 0555 root bin
+f usr/lib/krb5/kdyndns 0555 root bin
+f usr/lib/krb5/kldap.so.1 0755 root bin
+s usr/lib/krb5/kldap.so=kldap.so.1
+f usr/lib/krb5/klookup 0555 root bin
+f usr/lib/krb5/kprop 0555 root bin
+f usr/lib/krb5/kprop_script 0555 root bin
+f usr/lib/krb5/kpropd 0555 root bin
+f usr/lib/krb5/krb5kdc 0500 root bin
+f usr/lib/krb5/ksetpw 0555 root bin
+f usr/lib/krb5/ksmb 0555 root bin
+f usr/lib/krb5/ktkt_warnd 0555 root bin
+f usr/lib/krb5/libdb2.so.1 0755 root bin
+s usr/lib/krb5/libdb2.so=libdb2.so.1
+f usr/lib/krb5/libdyn.so.1 0755 root bin
+s usr/lib/krb5/libdyn.so=libdyn.so.1
+f usr/lib/krb5/libkadm5clnt.so.1 0755 root bin
+s usr/lib/krb5/libkadm5clnt.so=libkadm5clnt.so.1
+f usr/lib/krb5/libkadm5srv.so.1 0755 root bin
+s usr/lib/krb5/libkadm5srv.so=libkadm5srv.so.1
+f usr/lib/krb5/libkdb.so.1 0755 root bin
+s usr/lib/krb5/libkdb.so=libkdb.so.1
+f usr/lib/krb5/libkdb_ldap.so.1 0755 root bin
+s usr/lib/krb5/libkdb_ldap.so=libkdb_ldap.so.1
+f usr/lib/krb5/libss.so.1 0755 root bin
+s usr/lib/krb5/libss.so=libss.so.1
+d usr/lib/krb5/plugins 0755 root bin
+d usr/lib/krb5/plugins/preauth 0755 root bin
+f usr/lib/krb5/plugins/preauth/pkinit.so.1 0755 root bin
+s usr/lib/krb5/plugins/preauth/pkinit.so=pkinit.so.1
+f usr/lib/kssladm 0555 root bin
+f usr/lib/labeld 0555 root bin
+d usr/lib/ld 0755 root bin
+s usr/lib/ld.so.1=../../lib/ld.so.1
+d usr/lib/ld/amd64 0755 root bin
+s usr/lib/ld/amd64/map.above4G=../map.above4G
+s usr/lib/ld/amd64/map.below4G=../map.below4G
+s usr/lib/ld/amd64/map.default=../map.default
+f usr/lib/ld/map.above4G 0444 root bin
+f usr/lib/ld/map.below4G 0444 root bin
+f usr/lib/ld/map.bssalign 0444 root bin
+f usr/lib/ld/map.default 0444 root bin
+f usr/lib/ld/map.execdata 0444 root bin
+f usr/lib/ld/map.filter 0444 root bin
+f usr/lib/ld/map.noexbss 0444 root bin
+f usr/lib/ld/map.noexdata 0444 root bin
+f usr/lib/ld/map.noexstk 0444 root bin
+f usr/lib/ld/map.pagealign 0444 root bin
+d usr/lib/ldap 0755 root bin
+f usr/lib/ldap/idsconfig 0555 root bin
+f usr/lib/ldap/ldap_cachemgr 0555 root bin
+f usr/lib/lddstub 0555 root bin
+f usr/lib/lib.b 0444 root bin
+f usr/lib/libHBAAPI.so.1 0755 root bin
+s usr/lib/libHBAAPI.so=libHBAAPI.so.1
+s usr/lib/libMPAPI.so.1=../../lib/libMPAPI.so.1
+s usr/lib/libMPAPI.so=../../lib/libMPAPI.so.1
+f usr/lib/libSMHBAAPI.so.1 0755 root bin
+s usr/lib/libSMHBAAPI.so=libSMHBAAPI.so.1
+s usr/lib/libadm.so.1=../../lib/libadm.so.1
+s usr/lib/libadm.so=../../lib/libadm.so.1
+f usr/lib/libadt_jni.so.1 0755 root bin
+s usr/lib/libadt_jni.so=libadt_jni.so.1
+f usr/lib/libadutils.so.1 0755 root bin
+s usr/lib/libadutils.so=libadutils.so.1
+s usr/lib/libaio.so.1=../../lib/libaio.so.1
+s usr/lib/libaio.so=../../lib/libaio.so.1
+f usr/lib/libast.so.1 0755 root bin
+s usr/lib/libast.so=libast.so.1
+s usr/lib/libavl.so.1=../../lib/libavl.so.1
+s usr/lib/libavl.so=../../lib/libavl.so.1
+f usr/lib/libbe.so.1 0755 root bin
+s usr/lib/libbe.so=libbe.so.1
+f usr/lib/libbrand.so.1 0755 root bin
+s usr/lib/libbrand.so=libbrand.so.1
+f usr/lib/libbsdmalloc.so.1 0755 root bin
+s usr/lib/libbsdmalloc.so=libbsdmalloc.so.1
+s usr/lib/libbsm.so.1=../../lib/libbsm.so.1
+s usr/lib/libbsm.so=../../lib/libbsm.so.1
+d usr/lib/libc 0755 root bin
+s usr/lib/libc.so.1=../../lib/libc.so.1
+s usr/lib/libc.so=../../lib/libc.so.1
+f usr/lib/libc/libc_hwcap1.so.1 0755 root bin
+f usr/lib/libc/libc_hwcap2.so.1 0755 root bin
+f usr/lib/libc/libc_hwcap3.so.1 0755 root bin
+s usr/lib/libc_db.so.1=../../lib/libc_db.so.1
+s usr/lib/libc_db.so=../../lib/libc_db.so.1
+f usr/lib/libcfgadm.so.1 0755 root bin
+s usr/lib/libcfgadm.so=libcfgadm.so.1
+f usr/lib/libcmd.so.1 0755 root bin
+s usr/lib/libcmd.so=libcmd.so.1
+s usr/lib/libcmdutils.so.1=../../lib/libcmdutils.so.1
+s usr/lib/libcmdutils.so=../../lib/libcmdutils.so.1
+f usr/lib/libcommputil.so.1 0755 root bin
+s usr/lib/libcommputil.so=libcommputil.so.1
+s usr/lib/libcontract.so.1=../../lib/libcontract.so.1
+s usr/lib/libcontract.so=../../lib/libcontract.so.1
+f usr/lib/libcpc.so.1 0755 root bin
+s usr/lib/libcpc.so=libcpc.so.1
+f usr/lib/libcrle.so.1 0755 root bin
+f usr/lib/libcrypt.so.1 0755 root bin
+s usr/lib/libcrypt.so=libcrypt.so.1
+s usr/lib/libcrypt_d.so.1=libcrypt.so.1
+s usr/lib/libcrypt_d.so=libcrypt.so
+s usr/lib/libcrypt_i.so.1=libcrypt.so.1
+s usr/lib/libcrypt_i.so=libcrypt.so
+s usr/lib/libcryptoutil.so.1=../../lib/libcryptoutil.so.1
+s usr/lib/libcryptoutil.so=../../lib/libcryptoutil.so.1
+s usr/lib/libctf.so.1=../../lib/libctf.so.1
+s usr/lib/libctf.so=../../lib/libctf.so.1
+s usr/lib/libcurses.so.1=../../lib/libcurses.so.1
+s usr/lib/libcurses.so=../../lib/libcurses.so.1
+f usr/lib/libdat.so.1 0755 root bin
+s usr/lib/libdat.so=libdat.so.1
+s usr/lib/libdevice.so.1=../../lib/libdevice.so.1
+s usr/lib/libdevice.so=../../lib/libdevice.so.1
+s usr/lib/libdevid.so.1=../../lib/libdevid.so.1
+s usr/lib/libdevid.so=../../lib/libdevid.so.1
+s usr/lib/libdevinfo.so.1=../../lib/libdevinfo.so.1
+s usr/lib/libdevinfo.so=../../lib/libdevinfo.so.1
+s usr/lib/libdhcpagent.so.1=../../lib/libdhcpagent.so.1
+s usr/lib/libdhcpagent.so=../../lib/libdhcpagent.so.1
+f usr/lib/libdhcpsvc.so.1 0755 root bin
+s usr/lib/libdhcpsvc.so=libdhcpsvc.so.1
+s usr/lib/libdhcputil.so.1=../../lib/libdhcputil.so.1
+s usr/lib/libdhcputil.so=../../lib/libdhcputil.so.1
+f usr/lib/libdisasm.so.1 0755 root bin
+s usr/lib/libdisasm.so=libdisasm.so.1
+f usr/lib/libdiskmgt.so.1 0755 root bin
+s usr/lib/libdiskmgt.so=libdiskmgt.so.1
+s usr/lib/libdl.so.1=../../lib/libdl.so.1
+s usr/lib/libdl.so=../../lib/libdl.so.1
+s usr/lib/libdladm.so.1=../../lib/libdladm.so.1
+s usr/lib/libdladm.so=../../lib/libdladm.so.1
+f usr/lib/libdll.so.1 0755 root bin
+s usr/lib/libdll.so=libdll.so.1
+s usr/lib/libdlpi.so.1=../../lib/libdlpi.so.1
+s usr/lib/libdlpi.so=../../lib/libdlpi.so.1
+f usr/lib/libdns_sd.so.1 0755 root bin
+s usr/lib/libdns_sd.so=libdns_sd.so.1
+s usr/lib/libdoor.so.1=../../lib/libdoor.so.1
+s usr/lib/libdoor.so=../../lib/libdoor.so.1
+f usr/lib/libdscfg.so.1 0755 root bin
+s usr/lib/libdscfg.so=libdscfg.so.1
+f usr/lib/libdtrace.so.1 0755 root bin
+s usr/lib/libdtrace.so=libdtrace.so.1
+f usr/lib/libdtrace_jni.so.1 0755 root bin
+s usr/lib/libdtrace_jni.so=libdtrace_jni.so.1
+s usr/lib/libefi.so.1=../../lib/libefi.so.1
+s usr/lib/libefi.so=../../lib/libefi.so.1
+s usr/lib/libelf.so.1=../../lib/libelf.so.1
+s usr/lib/libelf.so=../../lib/libelf.so.1
+s usr/lib/libelfsign.so.1=../../lib/libelfsign.so.1
+s usr/lib/libelfsign.so=../../lib/libelfsign.so.1
+f usr/lib/libexacct.so.1 0755 root bin
+s usr/lib/libexacct.so=libexacct.so.1
+f usr/lib/libfcoe.so.1 0755 root bin
+s usr/lib/libfcoe.so=libfcoe.so.1
+s usr/lib/libfdisk.so.1=../../lib/libfdisk.so.1
+s usr/lib/libfdisk.so=../../lib/libfdisk.so.1
+f usr/lib/libform.so.1 0755 root bin
+s usr/lib/libform.so=libform.so.1
+f usr/lib/libfru.so.1 0755 root bin
+s usr/lib/libfru.so=libfru.so.1
+f usr/lib/libfruraw.so.1 0755 root bin
+s usr/lib/libfruraw.so=libfruraw.so.1
+f usr/lib/libfrureg.so.1 0755 root bin
+s usr/lib/libfrureg.so=libfrureg.so.1
+f usr/lib/libfruutils.so.1 0755 root bin
+s usr/lib/libfruutils.so=libfruutils.so.1
+f usr/lib/libfsmgt.so.1 0755 root bin
+s usr/lib/libfsmgt.so=libfsmgt.so.1
+f usr/lib/libfstyp.so.1 0755 root bin
+s usr/lib/libfstyp.so=libfstyp.so.1
+s usr/lib/libgen.so.1=../../lib/libgen.so.1
+s usr/lib/libgen.so=../../lib/libgen.so.1
+s usr/lib/libgrubmgmt.so.1=../../lib/libgrubmgmt.so.1
+s usr/lib/libgrubmgmt.so=../../lib/libgrubmgmt.so.1
+f usr/lib/libgss.so.1 0755 root bin
+s usr/lib/libgss.so=libgss.so.1
+f usr/lib/libhotplug.so.1 0755 root bin
+s usr/lib/libhotplug.so=libhotplug.so.1
+f usr/lib/libidmap.so.1 0755 root bin
+s usr/lib/libidmap.so=libidmap.so.1
+f usr/lib/libike.so.1 0755 root bin
+s usr/lib/libike.so=libike.so.1
+f usr/lib/libilb.so.1 0755 root bin
+s usr/lib/libilb.so=libilb.so.1
+f usr/lib/libima.so.1 0755 root bin
+s usr/lib/libima.so=libima.so.1
+f usr/lib/libinetsvc.so.1 0755 root bin
+s usr/lib/libinetsvc.so=libinetsvc.so.1
+s usr/lib/libinetutil.so.1=../../lib/libinetutil.so.1
+s usr/lib/libinetutil.so=../../lib/libinetutil.so.1
+f usr/lib/libinstzones.so.1 0755 root bin
+s usr/lib/libinstzones.so=libinstzones.so.1
+s usr/lib/libintl.so.1=../../lib/libintl.so.1
+s usr/lib/libintl.so=../../lib/libintl.so.1
+s usr/lib/libipadm.so.1=../../lib/libipadm.so.1
+s usr/lib/libipadm.so=../../lib/libipadm.so.1
+f usr/lib/libipd.so.1 0755 root bin
+s usr/lib/libipd.so=libipd.so.1
+f usr/lib/libipmi.so.1 0755 root bin
+s usr/lib/libipmi.so=libipmi.so.1
+s usr/lib/libipmp.so.1=../../lib/libipmp.so.1
+s usr/lib/libipmp.so=../../lib/libipmp.so.1
+f usr/lib/libipp.so.1 0755 root bin
+s usr/lib/libipp.so=libipp.so.1
+f usr/lib/libipsecutil.so.1 0755 root bin
+s usr/lib/libipsecutil.so=libipsecutil.so.1
+f usr/lib/libiscsit.so.1 0755 root bin
+s usr/lib/libiscsit.so=libiscsit.so.1
+f usr/lib/libjdns_sd.so.1 0755 root bin
+s usr/lib/libjdns_sd.so=libjdns_sd.so.1
+s usr/lib/libkcfd.so.1=../../lib/libkcfd.so.1
+s usr/lib/libkcfd.so=../../lib/libkcfd.so.1
+s usr/lib/libkmf.so.1=../../lib/libkmf.so.1
+s usr/lib/libkmf.so=../../lib/libkmf.so.1
+s usr/lib/libkmfberder.so.1=../../lib/libkmfberder.so.1
+s usr/lib/libkmfberder.so=../../lib/libkmfberder.so.1
+f usr/lib/libkrb5.so.1 0755 root bin
+s usr/lib/libkrb5.so=libkrb5.so.1
+s usr/lib/libkstat.so.1=../../lib/libkstat.so.1
+s usr/lib/libkstat.so=../../lib/libkstat.so.1
+f usr/lib/libkvm.so.1 0755 root bin
+s usr/lib/libkvm.so=libkvm.so.1
+f usr/lib/libl.so.1 0755 root bin
+s usr/lib/libl.so=libl.so.1
+f usr/lib/libldap.so.5 0755 root bin
+s usr/lib/libldap.so=libldap.so.5
+s usr/lib/liblddbg.so.4=../../lib/liblddbg.so.4
+f usr/lib/libldstab.so.1 0755 root bin
+f usr/lib/liblgrp.so.1 0755 root bin
+s usr/lib/liblgrp.so=liblgrp.so.1
+f usr/lib/liblm.so.1 0755 root bin
+s usr/lib/liblm.so=liblm.so.1
+f usr/lib/libmail.so.1 0755 root bin
+s usr/lib/libmail.so=libmail.so.1
+f usr/lib/libmalloc.so.1 0755 root bin
+s usr/lib/libmalloc.so=libmalloc.so.1
+f usr/lib/libmapmalloc.so.1 0755 root bin
+s usr/lib/libmapmalloc.so=libmapmalloc.so.1
+s usr/lib/libmd.so.1=../../lib/libmd.so.1
+s usr/lib/libmd.so=../../lib/libmd.so.1
+s usr/lib/libmd5.so.1=../../lib/libmd5.so.1
+s usr/lib/libmd5.so=../../lib/libmd5.so.1
+s usr/lib/libmech_krb5.so=gss/mech_krb5.so
+f usr/lib/libmenu.so.1 0755 root bin
+s usr/lib/libmenu.so=libmenu.so.1
+f usr/lib/libmilter.so.1 0755 root bin
+s usr/lib/libmilter.so=libmilter.so.1
+s usr/lib/libmp.so.1=../../lib/libmp.so.1
+s usr/lib/libmp.so.2=../../lib/libmp.so.2
+s usr/lib/libmp.so=../../lib/libmp.so.2
+s usr/lib/libmpscsi_vhci.so.1=../../lib/libmpscsi_vhci.so.1
+s usr/lib/libmpscsi_vhci.so=../../lib/libmpscsi_vhci.so.1
+f usr/lib/libmtmalloc.so.1 0755 root bin
+s usr/lib/libmtmalloc.so=libmtmalloc.so.1
+f usr/lib/libndmp.so.1 0755 root bin
+s usr/lib/libndmp.so=libndmp.so.1
+f usr/lib/libnisdb.so.2 0755 root bin
+s usr/lib/libnisdb.so=libnisdb.so.2
+f usr/lib/libnls.so.1 0755 root bin
+s usr/lib/libnls.so=libnls.so.1
+f usr/lib/libnsctl.so.1 0755 root bin
+s usr/lib/libnsctl.so=libnsctl.so.1
+s usr/lib/libnsl.so.1=../../lib/libnsl.so.1
+s usr/lib/libnsl.so=../../lib/libnsl.so.1
+f usr/lib/libntfs.so.10 0755 root bin
+s usr/lib/libntfs.so=libntfs.so.10
+f usr/lib/libnvfru.so.1 0755 root bin
+s usr/lib/libnvfru.so=libnvfru.so.1
+s usr/lib/libnvpair.so.1=../../lib/libnvpair.so.1
+s usr/lib/libnvpair.so=../../lib/libnvpair.so.1
+s usr/lib/libnwam.so.1=../../lib/libnwam.so.1
+s usr/lib/libnwam.so=../../lib/libnwam.so.1
+d usr/lib/libp 0755 root bin
+s usr/lib/libp/32=.
+s usr/lib/libp/64=amd64
+d usr/lib/libp/amd64 0755 root bin
+s usr/lib/libp/amd64/libc.so.1=../../../../lib/amd64/libc.so.1
+s usr/lib/libp/libc.so.1=../../../lib/libc.so.1
+s usr/lib/libpam.so.1=../../lib/libpam.so.1
+s usr/lib/libpam.so=../../lib/libpam.so.1
+f usr/lib/libpanel.so.1 0755 root bin
+s usr/lib/libpanel.so=libpanel.so.1
+f usr/lib/libparted.so.8 0755 root bin
+s usr/lib/libparted.so=libparted.so.8
+f usr/lib/libpcidb.so.1 0755 root bin
+f usr/lib/libpctx.so.1 0755 root bin
+s usr/lib/libpctx.so=libpctx.so.1
+f usr/lib/libpicl.so.1 0755 root bin
+s usr/lib/libpicl.so=libpicl.so.1
+f usr/lib/libpicld_pluginutil.so.1 0755 root bin
+s usr/lib/libpicld_pluginutil.so=libpicld_pluginutil.so.1
+f usr/lib/libpicltree.so.1 0755 root bin
+s usr/lib/libpicltree.so=libpicltree.so.1
+f usr/lib/libpkcs11.so.1 0755 root bin
+s usr/lib/libpkcs11.so=libpkcs11.so.1
+f usr/lib/libpkg.so.1 0755 root bin
+s usr/lib/libpkg.so=libpkg.so.1
+f usr/lib/libpool.so.1 0755 root bin
+s usr/lib/libpool.so=libpool.so.1
+s usr/lib/libposix4.so.1=../../lib/librt.so.1
+s usr/lib/libposix4.so=../../lib/librt.so.1
+f usr/lib/libpp.so.1 0755 root bin
+s usr/lib/libpp.so=libpp.so.1
+s usr/lib/libproc.so.1=../../lib/libproc.so.1
+s usr/lib/libproc.so=../../lib/libproc.so.1
+f usr/lib/libproject.so.1 0755 root bin
+s usr/lib/libproject.so=libproject.so.1
+s usr/lib/libpthread.so.1=../../lib/libpthread.so.1
+s usr/lib/libpthread.so=../../lib/libpthread.so.1
+f usr/lib/libraidcfg.so.1 0755 root bin
+s usr/lib/libraidcfg.so=libraidcfg.so.1
+s usr/lib/librcm.so.1=../../lib/librcm.so.1
+s usr/lib/librcm.so=../../lib/librcm.so.1
+f usr/lib/librdc.so.1 0755 root bin
+s usr/lib/librdc.so=librdc.so.1
+f usr/lib/libreparse.so.1 0755 root bin
+s usr/lib/libreparse.so=libreparse.so.1
+s usr/lib/libresolv.so.1=../../lib/libresolv.so.1
+s usr/lib/libresolv.so.2=../../lib/libresolv.so.2
+s usr/lib/libresolv.so=../../lib/libresolv.so.2
+s usr/lib/libresolv_joy.so.2=../../lib/libresolv_joy.so.2
+s usr/lib/librestart.so.1=../../lib/librestart.so.1
+s usr/lib/librestart.so=../../lib/librestart.so.1
+s usr/lib/librpcsvc.so.1=../../lib/librpcsvc.so.1
+s usr/lib/librpcsvc.so=../../lib/librpcsvc.so.1
+f usr/lib/librsm.so.2 0755 root bin
+s usr/lib/librsm.so=librsm.so.2
+f usr/lib/librstp.so.1 0755 root bin
+s usr/lib/librstp.so=librstp.so.1
+s usr/lib/librt.so.1=../../lib/librt.so.1
+s usr/lib/librt.so=../../lib/librt.so.1
+s usr/lib/librtld.so.1=../../lib/librtld.so.1
+s usr/lib/librtld_db.so.1=../../lib/librtld_db.so.1
+s usr/lib/librtld_db.so=../../lib/librtld_db.so.1
+f usr/lib/libsasl.so.1 0755 root bin
+s usr/lib/libsasl.so=libsasl.so.1
+s usr/lib/libscf.so.1=../../lib/libscf.so.1
+s usr/lib/libscf.so=../../lib/libscf.so.1
+f usr/lib/libsched.so.1 0755 root bin
+s usr/lib/libsched.so=libsched.so.1
+f usr/lib/libsctp.so.1 0755 root bin
+s usr/lib/libsctp.so=libsctp.so.1
+s usr/lib/libsec.so.1=../../lib/libsec.so.1
+s usr/lib/libsec.so=../../lib/libsec.so.1
+s usr/lib/libsecdb.so.1=../../lib/libsecdb.so.1
+s usr/lib/libsecdb.so=../../lib/libsecdb.so.1
+s usr/lib/libsendfile.so.1=../../lib/libsendfile.so.1
+s usr/lib/libsendfile.so=../../lib/libsendfile.so.1
+f usr/lib/libshare.so.1 0755 root bin
+s usr/lib/libshare.so=libshare.so.1
+f usr/lib/libshell.so.1 0755 root bin
+s usr/lib/libshell.so=libshell.so.1
+f usr/lib/libsip.so.1 0755 root bin
+s usr/lib/libsip.so=libsip.so.1
+f usr/lib/libsldap.so.1 0755 root bin
+s usr/lib/libsldap.so=libsldap.so.1
+f usr/lib/libslp.so.1 0755 root bin
+s usr/lib/libslp.so=libslp.so.1
+s usr/lib/libsmartsshd.so.1=../../lib/libsmartsshd.so.1
+s usr/lib/libsmartsshd.so=../../lib/libsmartsshd.so.1
+f usr/lib/libsmbfs.so.1 0755 root bin
+s usr/lib/libsmbfs.so=libsmbfs.so.1
+f usr/lib/libsmbios.so.1 0755 root bin
+s usr/lib/libsmbios.so=libsmbios.so.1
+f usr/lib/libsmedia.so.1 0755 root bin
+s usr/lib/libsmedia.so=libsmedia.so.1
+s usr/lib/libsocket.so.1=../../lib/libsocket.so.1
+s usr/lib/libsocket.so=../../lib/libsocket.so.1
+f usr/lib/libsoftcrypto.so.1 0755 root bin
+s usr/lib/libsoftcrypto.so=libsoftcrypto.so.1
+f usr/lib/libsqlite-native.o 0644 root bin
+f usr/lib/libsqlite.o 0644 root bin
+f usr/lib/libsrpt.so.1 0755 root bin
+s usr/lib/libsrpt.so=libsrpt.so.1
+f usr/lib/libstanddisasm.so 0644 root bin
+f usr/lib/libstmf.so.1 0755 root bin
+s usr/lib/libstmf.so=libstmf.so.1
+f usr/lib/libstmfproxy.so.1 0755 root bin
+s usr/lib/libstmfproxy.so=libstmfproxy.so.1
+f usr/lib/libsum.so.1 0755 root bin
+s usr/lib/libsum.so=libsum.so.1
+f usr/lib/libsun_fc.so.1 0755 root bin
+s usr/lib/libsun_fc.so=libsun_fc.so.1
+f usr/lib/libsun_ima.so.1 0755 root bin
+s usr/lib/libsun_ima.so=libsun_ima.so.1
+f usr/lib/libsun_sas.so.1 0755 root bin
+s usr/lib/libsun_sas.so=libsun_sas.so.1
+f usr/lib/libsys.so.1 0755 root bin
+s usr/lib/libsys.so=libsys.so.1
+s usr/lib/libsysevent.so.1=../../lib/libsysevent.so.1
+s usr/lib/libsysevent.so=../../lib/libsysevent.so.1
+f usr/lib/libtecla.so.1 0755 root bin
+s usr/lib/libtecla.so=libtecla.so.1
+s usr/lib/libtermcap.so.1=../../lib/libtermcap.so.1
+s usr/lib/libtermcap.so=../../lib/libtermcap.so.1
+s usr/lib/libtermlib.so.1=../../lib/libcurses.so.1
+s usr/lib/libtermlib.so=../../lib/libcurses.so.1
+s usr/lib/libthread.so.1=../../lib/libthread.so.1
+s usr/lib/libthread.so=../../lib/libthread.so.1
+s usr/lib/libthread_db.so.1=../../lib/libc_db.so.1
+s usr/lib/libthread_db.so=../../lib/libc_db.so.1
+f usr/lib/libtnf.so.1 0755 root bin
+s usr/lib/libtnf.so=libtnf.so.1
+f usr/lib/libtnfctl.so.1 0755 root bin
+s usr/lib/libtnfctl.so=libtnfctl.so.1
+f usr/lib/libtnfprobe.so.1 0755 root bin
+s usr/lib/libtnfprobe.so=libtnfprobe.so.1
+s usr/lib/libtsnet.so.1=../../lib/libtsnet.so.1
+s usr/lib/libtsnet.so=../../lib/libtsnet.so.1
+s usr/lib/libtsol.so.2=../../lib/libtsol.so.2
+s usr/lib/libtsol.so=../../lib/libtsol.so.2
+s usr/lib/libumem.so.1=../../lib/libumem.so.1
+s usr/lib/libumem.so=../../lib/libumem.so.1
+f usr/lib/libunistat.so.1 0755 root bin
+s usr/lib/libunistat.so=libunistat.so.1
+s usr/lib/libuuid.so.1=../../lib/libuuid.so.1
+s usr/lib/libuuid.so=../../lib/libuuid.so.1
+s usr/lib/libuutil.so.1=../../lib/libuutil.so.1
+s usr/lib/libuutil.so=../../lib/libuutil.so.1
+f usr/lib/libvolmgt.so.1 0755 root bin
+s usr/lib/libvolmgt.so=libvolmgt.so.1
+f usr/lib/libvrrpadm.so.1 0755 root bin
+s usr/lib/libvrrpadm.so=libvrrpadm.so.1
+s usr/lib/libw.so.1=../../lib/libw.so.1
+s usr/lib/libw.so=../../lib/libw.so.1
+f usr/lib/libwanboot.so.1 0755 root bin
+s usr/lib/libwanboot.so=libwanboot.so.1
+f usr/lib/libwrap.so.1.0 0755 root bin
+s usr/lib/libwrap.so.1=libwrap.so.1.0
+s usr/lib/libwrap.so=libwrap.so.1.0
+s usr/lib/libxnet.so.1=../../lib/libxnet.so.1
+s usr/lib/libxnet.so=../../lib/libxnet.so.1
+f usr/lib/liby.so.1 0755 root bin
+s usr/lib/liby.so=liby.so.1
+s usr/lib/libzdoor.so.1=../../lib/libzdoor.so.1
+s usr/lib/libzdoor.so=../../lib/libzdoor.so.1
+s usr/lib/libzfs.so.1=../../lib/libzfs.so.1
+s usr/lib/libzfs.so=../../lib/libzfs.so.1
+f usr/lib/libzfs_core.so.1 755 root bin
+s usr/lib/libzfs_core.so=libzfs_core.so.1
+f usr/lib/libzfs_jni.so.1 0755 root bin
+s usr/lib/libzfs_jni.so=libzfs_jni.so.1
+f usr/lib/libzonecfg.so.1 0755 root bin
+s usr/lib/libzonecfg.so=libzonecfg.so.1
+f usr/lib/libzoneinfo.so.1 0755 root bin
+s usr/lib/libzoneinfo.so=libzoneinfo.so.1
+f usr/lib/libzpool.so.1 0755 root bin
+s usr/lib/libzpool.so=libzpool.so.1
+d usr/lib/link_audit 0755 root bin
+s usr/lib/link_audit/32=.
+s usr/lib/link_audit/64=amd64
+d usr/lib/link_audit/amd64 0755 root bin
+f usr/lib/link_audit/amd64/ldprof.so.1 0755 root bin
+f usr/lib/link_audit/amd64/truss.so.1 0755 root bin
+f usr/lib/link_audit/amd64/who.so.1 0755 root bin
+f usr/lib/link_audit/ldprof.so.1 0755 root bin
+f usr/lib/link_audit/truss.so.1 0755 root bin
+f usr/lib/link_audit/who.so.1 0755 root bin
+f usr/lib/lms 0555 root bin
+d usr/lib/locale 0755 root bin
+d usr/lib/locale/C 0755 root bin
+d usr/lib/locale/C/LC_COLLATE 0755 root bin
+d usr/lib/locale/C/LC_CTYPE 0755 root bin
+d usr/lib/locale/C/LC_MESSAGES 0755 root bin
+d usr/lib/locale/C/LC_MONETARY 0755 root bin
+d usr/lib/locale/C/LC_NUMERIC 0755 root bin
+d usr/lib/locale/C/LC_TIME 0755 root bin
+f usr/lib/locale/C/LC_TIME/SUNW_OST_OSCMD.po 0644 root bin
+s usr/lib/locale/POSIX=C
+d usr/lib/locale/af_ZA.UTF-8 0755 root bin
+d usr/lib/locale/af_ZA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/af_ZA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/af_ZA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/af_ZA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/af_ZA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/af_ZA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/af_ZA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/af_ZA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/af_ZA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/af_ZA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/af_ZA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/af_ZA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_AE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_AE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_AE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_AE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_AE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_AE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_AE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_BH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_BH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_BH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_BH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_BH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_BH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_BH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_DZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_DZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_DZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_DZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_DZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_DZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_DZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_EG.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_EG.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_EG.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_EG.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_EG.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_EG.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_EG.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_IQ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_IQ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_IQ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_IQ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_IQ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_IQ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_IQ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_JO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_JO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_JO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_JO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_JO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_JO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_JO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_KW.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_KW.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_KW.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_KW.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_KW.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_KW.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_KW.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_LB.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_LB.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_LB.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_LB.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_LB.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LB.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_LB.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_LY.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_LY.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_LY.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_LY.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_LY.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_LY.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_LY.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_MA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_MA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_MA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_MA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_MA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_MA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_MA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_OM.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_OM.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_OM.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_OM.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_OM.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_OM.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_OM.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_QA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_QA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_QA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_QA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_QA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_QA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_QA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_SA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_SA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_SA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_SA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_SA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_SA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_SA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_TN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_TN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_TN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_TN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_TN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_TN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_TN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ar_YE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ar_YE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ar_YE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ar_YE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ar_YE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ar_YE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ar_YE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/as_IN.UTF-8 0755 root bin
+d usr/lib/locale/as_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/as_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/as_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/as_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/as_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/as_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/as_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/as_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/as_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/as_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/as_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/as_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/az_AZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/az_AZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/az_AZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/az_AZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/az_AZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/az_AZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/az_AZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/be_BY.UTF-8 0755 root bin
+d usr/lib/locale/be_BY.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/be_BY.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/be_BY.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/be_BY.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/be_BY.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/be_BY.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/be_BY.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/be_BY.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/be_BY.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/be_BY.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/be_BY.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/be_BY.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5/LC_COLLATE 0755 root bin
+f usr/lib/locale/bg_BG.ISO8859-5/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5/LC_CTYPE 0755 root bin
+f usr/lib/locale/bg_BG.ISO8859-5/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bg_BG.ISO8859-5/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5/LC_MONETARY 0755 root bin
+f usr/lib/locale/bg_BG.ISO8859-5/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bg_BG.ISO8859-5/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.ISO8859-5/LC_TIME 0755 root bin
+f usr/lib/locale/bg_BG.ISO8859-5/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/bg_BG.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/bg_BG.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bg_BG.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/bg_BG.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bg_BG.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bg_BG.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/bg_BG.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/bn_BD.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/bn_BD.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bn_BD.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/bn_BD.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bn_BD.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_BD.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/bn_BD.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/bn_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/bn_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bn_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/bn_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bn_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bn_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/bn_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/bo_CN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/bo_CN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bo_CN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/bo_CN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bo_CN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_CN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/bo_CN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/bo_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/bo_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bo_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/bo_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bo_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bo_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/bo_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/bs_BA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/bs_BA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/bs_BA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/bs_BA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/bs_BA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/bs_BA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/bs_BA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/ca_ES.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/ca_ES.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ca_ES.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/ca_ES.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ca_ES.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/ca_ES.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ca_ES.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ca_ES.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ca_ES.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ca_ES.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ca_ES.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ca_ES.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ca_ES.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2/LC_COLLATE 0755 root bin
+f usr/lib/locale/cs_CZ.ISO8859-2/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2/LC_CTYPE 0755 root bin
+f usr/lib/locale/cs_CZ.ISO8859-2/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2/LC_MESSAGES 0755 root bin
+f usr/lib/locale/cs_CZ.ISO8859-2/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2/LC_MONETARY 0755 root bin
+f usr/lib/locale/cs_CZ.ISO8859-2/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2/LC_NUMERIC 0755 root bin
+f usr/lib/locale/cs_CZ.ISO8859-2/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.ISO8859-2/LC_TIME 0755 root bin
+f usr/lib/locale/cs_CZ.ISO8859-2/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/cs_CZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/cs_CZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/cs_CZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/cs_CZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/cs_CZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/cs_CZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/cs_CZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/da_DK.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.UTF-8 0755 root bin
+d usr/lib/locale/da_DK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/da_DK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/da_DK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/da_DK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/da_DK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/da_DK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/da_DK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/da_DK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_AT.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_AT.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_AT.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_AT.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_AT.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/de_AT.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.UTF-8 0755 root bin
+d usr/lib/locale/de_AT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_AT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_AT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_AT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_AT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_AT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_AT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/de_AT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_BE.UTF-8 0755 root bin
+d usr/lib/locale/de_BE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_BE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_BE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_BE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_BE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_BE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_BE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_BE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_BE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_BE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_BE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/de_BE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_CH.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_CH.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_CH.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_CH.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_CH.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/de_CH.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.UTF-8 0755 root bin
+d usr/lib/locale/de_CH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_CH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_CH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_CH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_CH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_CH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_CH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/de_CH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-1 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-1/LC_COLLATE 0755 root bin
+h usr/lib/locale/de_DE.ISO8859-1/LC_COLLATE/LCL_DATA=usr/lib/locale/de_CH.ISO8859-1/LC_COLLATE/LCL_DATA
+d usr/lib/locale/de_DE.ISO8859-1/LC_CTYPE 0755 root bin
+h usr/lib/locale/de_DE.ISO8859-1/LC_CTYPE/LCL_DATA=usr/lib/locale/da_DK.ISO8859-1/LC_CTYPE/LCL_DATA
+d usr/lib/locale/de_DE.ISO8859-1/LC_MESSAGES 0755 root bin
+h usr/lib/locale/de_DE.ISO8859-1/LC_MESSAGES/LCL_DATA=usr/lib/locale/de_AT.ISO8859-15/LC_MESSAGES/LCL_DATA
+d usr/lib/locale/de_DE.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/de_DE.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.UTF-8 0755 root bin
+d usr/lib/locale/de_DE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_DE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_DE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_DE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_DE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_DE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_DE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/de_DE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LI.UTF-8 0755 root bin
+d usr/lib/locale/de_LI.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_LI.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LI.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_LI.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LI.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_LI.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LI.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_LI.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LI.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_LI.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LI.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/de_LI.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LU.UTF-8 0755 root bin
+d usr/lib/locale/de_LU.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/de_LU.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LU.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/de_LU.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LU.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/de_LU.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LU.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/de_LU.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LU.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/de_LU.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/de_LU.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/de_LU.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/el_CY.UTF-8 0755 root bin
+d usr/lib/locale/el_CY.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/el_CY.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/el_CY.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/el_CY.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/el_CY.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/el_CY.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/el_CY.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/el_CY.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/el_CY.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/el_CY.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/el_CY.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/el_CY.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7/LC_COLLATE 0755 root bin
+f usr/lib/locale/el_GR.ISO8859-7/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7/LC_CTYPE 0755 root bin
+f usr/lib/locale/el_GR.ISO8859-7/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7/LC_MESSAGES 0755 root bin
+f usr/lib/locale/el_GR.ISO8859-7/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7/LC_MONETARY 0755 root bin
+f usr/lib/locale/el_GR.ISO8859-7/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7/LC_NUMERIC 0755 root bin
+f usr/lib/locale/el_GR.ISO8859-7/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.ISO8859-7/LC_TIME 0755 root bin
+f usr/lib/locale/el_GR.ISO8859-7/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.UTF-8 0755 root bin
+d usr/lib/locale/el_GR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/el_GR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/el_GR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/el_GR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/el_GR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/el_GR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/el_GR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/el_GR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_AU.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_AU.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_AU.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_AU.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_AU.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/en_AU.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.UTF-8 0755 root bin
+d usr/lib/locale/en_AU.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_AU.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_AU.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_AU.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_AU.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_AU.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_AU.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_AU.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BW.UTF-8 0755 root bin
+d usr/lib/locale/en_BW.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_BW.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BW.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_BW.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BW.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_BW.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BW.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_BW.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BW.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_BW.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BW.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_BW.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_BZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_BZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_BZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_BZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_BZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_BZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_BZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_CA.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_CA.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_CA.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_CA.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_CA.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/en_CA.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.UTF-8 0755 root bin
+d usr/lib/locale/en_CA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_CA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_CA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_CA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_CA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_CA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_CA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_CA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/en_GB.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.UTF-8 0755 root bin
+d usr/lib/locale/en_GB.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_GB.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_GB.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_GB.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_GB.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_GB.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_GB.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_GB.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_HK.UTF-8 0755 root bin
+d usr/lib/locale/en_HK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_HK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_HK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_HK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_HK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_HK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_HK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_HK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_HK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_HK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_HK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_HK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_IE.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_IE.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_IE.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_IE.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_IE.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/en_IE.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.UTF-8 0755 root bin
+d usr/lib/locale/en_IE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_IE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_IE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_IE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_IE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_IE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_IE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IN.UTF-8 0755 root bin
+d usr/lib/locale/en_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_JM.UTF-8 0755 root bin
+d usr/lib/locale/en_JM.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_JM.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_JM.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_JM.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_JM.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_JM.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_JM.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_JM.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_JM.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_JM.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_JM.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_JM.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MH.UTF-8 0755 root bin
+d usr/lib/locale/en_MH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_MH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_MH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_MH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_MH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_MH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_MH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MT.UTF-8 0755 root bin
+d usr/lib/locale/en_MT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_MT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_MT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_MT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_MT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_MT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_MT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_MT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NA.UTF-8 0755 root bin
+d usr/lib/locale/en_NA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_NA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_NA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_NA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_NA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_NA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_NA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_NZ.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_NZ.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_NZ.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_NZ.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_NZ.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/en_NZ.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_NZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_NZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_NZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_NZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_NZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_NZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_NZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PH.UTF-8 0755 root bin
+d usr/lib/locale/en_PH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_PH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_PH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_PH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_PH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_PH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_PH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PK.UTF-8 0755 root bin
+d usr/lib/locale/en_PK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_PK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_PK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_PK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_PK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_PK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_PK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_PK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_SG.UTF-8 0755 root bin
+d usr/lib/locale/en_SG.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_SG.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_SG.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_SG.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_SG.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_SG.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_SG.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_SG.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_SG.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_SG.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_SG.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_SG.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_TT.UTF-8 0755 root bin
+d usr/lib/locale/en_TT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_TT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_TT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_TT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_TT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_TT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_TT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_TT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_TT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_TT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_TT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_TT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-1 0755 root bin
+d usr/lib/locale/en_US.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_US.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_US.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_US.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_US.ISO8859-1/LC_MONETARY/LCL_DATA 0444 root bin
+d usr/lib/locale/en_US.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_US.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/en_US.ISO8859-1/LC_TIME/LCL_DATA 0444 root bin
+d usr/lib/locale/en_US.ISO8859-15 0755 root bin
+d usr/lib/locale/en_US.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_US.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_US.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_US.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_US.ISO8859-15/LC_MONETARY/LCL_DATA 0444 root bin
+d usr/lib/locale/en_US.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_US.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/en_US.ISO8859-15/LC_TIME/LCL_DATA 0444 root bin
+d usr/lib/locale/en_US.UTF-8 0755 root bin
+d usr/lib/locale/en_US.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_US.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_US.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_US.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_US.UTF-8/LC_MONETARY/LCL_DATA 0444 root bin
+d usr/lib/locale/en_US.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_US.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_US.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_US.UTF-8/LC_TIME/LCL_DATA 0444 root bin
+d usr/lib/locale/en_ZA.UTF-8 0755 root bin
+d usr/lib/locale/en_ZA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_ZA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_ZA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_ZA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_ZA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_ZA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_ZA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/en_ZW.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/en_ZW.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/en_ZW.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/en_ZW.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/en_ZW.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/en_ZW.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/en_ZW.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_AR.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_AR.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_AR.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_AR.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_AR.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_AR.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.UTF-8 0755 root bin
+d usr/lib/locale/es_AR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_AR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_AR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_AR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_AR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_AR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_AR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_AR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_BO.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_BO.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_BO.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_BO.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_BO.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_BO.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.UTF-8 0755 root bin
+d usr/lib/locale/es_BO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_BO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_BO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_BO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_BO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_BO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_BO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_BO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_CL.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_CL.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_CL.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_CL.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_CL.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_CL.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.UTF-8 0755 root bin
+d usr/lib/locale/es_CL.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_CL.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_CL.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_CL.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_CL.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_CL.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CL.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_CL.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_CO.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_CO.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_CO.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_CO.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_CO.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_CO.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.UTF-8 0755 root bin
+d usr/lib/locale/es_CO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_CO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_CO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_CO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_CO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_CO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_CO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CR.UTF-8 0755 root bin
+d usr/lib/locale/es_CR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_CR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_CR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_CR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_CR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_CR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_CR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_CR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_DO.UTF-8 0755 root bin
+d usr/lib/locale/es_DO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_DO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_DO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_DO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_DO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_DO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_DO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_DO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_DO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_DO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_DO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_DO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_EC.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_EC.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_EC.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_EC.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_EC.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_EC.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.UTF-8 0755 root bin
+d usr/lib/locale/es_EC.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_EC.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_EC.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_EC.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_EC.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_EC.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_EC.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_EC.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-1 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-1/LC_CTYPE 0755 root bin
+h usr/lib/locale/es_ES.ISO8859-1/LC_CTYPE/LCL_DATA=usr/lib/locale/da_DK.ISO8859-1/LC_CTYPE/LCL_DATA
+d usr/lib/locale/es_ES.ISO8859-1/LC_MESSAGES 0755 root bin
+h usr/lib/locale/es_ES.ISO8859-1/LC_MESSAGES/LCL_DATA=usr/lib/locale/es_AR.ISO8859-1/LC_MESSAGES/LCL_DATA
+d usr/lib/locale/es_ES.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/es_ES.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.UTF-8 0755 root bin
+d usr/lib/locale/es_ES.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_ES.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_ES.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_ES.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_ES.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_ES.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_ES.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_ES.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_GQ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_GQ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_GQ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_GQ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_GQ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GQ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_GQ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_GT.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_GT.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_GT.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_GT.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_GT.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_GT.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.UTF-8 0755 root bin
+d usr/lib/locale/es_GT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_GT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_GT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_GT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_GT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_GT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_GT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_GT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_HN.UTF-8 0755 root bin
+d usr/lib/locale/es_HN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_HN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_HN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_HN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_HN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_HN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_HN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_HN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_HN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_HN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_HN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_HN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_MX.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_MX.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_MX.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_MX.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_MX.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_MX.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.UTF-8 0755 root bin
+d usr/lib/locale/es_MX.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_MX.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_MX.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_MX.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_MX.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_MX.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_MX.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_MX.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_NI.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_NI.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_NI.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_NI.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_NI.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_NI.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.UTF-8 0755 root bin
+d usr/lib/locale/es_NI.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_NI.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_NI.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_NI.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_NI.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_NI.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_NI.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_NI.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_PA.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_PA.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_PA.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_PA.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_PA.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_PA.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.UTF-8 0755 root bin
+d usr/lib/locale/es_PA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_PA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_PA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_PA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_PA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_PA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_PA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_PE.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_PE.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_PE.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_PE.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_PE.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_PE.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.UTF-8 0755 root bin
+d usr/lib/locale/es_PE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_PE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_PE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_PE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_PE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_PE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_PE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PR.UTF-8 0755 root bin
+d usr/lib/locale/es_PR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_PR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_PR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_PR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_PR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_PR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_PR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PY.UTF-8 0755 root bin
+d usr/lib/locale/es_PY.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_PY.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PY.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_PY.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PY.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_PY.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PY.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_PY.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PY.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_PY.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_PY.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_PY.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_SV.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_SV.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_SV.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_SV.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_SV.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_SV.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.UTF-8 0755 root bin
+d usr/lib/locale/es_SV.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_SV.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_SV.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_SV.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_SV.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_SV.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_SV.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_SV.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_US.UTF-8 0755 root bin
+d usr/lib/locale/es_US.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_US.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_US.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_US.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_US.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_US.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_US.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_US.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_US.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_US.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_US.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_US.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_UY.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_UY.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_UY.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_UY.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_UY.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_UY.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.UTF-8 0755 root bin
+d usr/lib/locale/es_UY.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_UY.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_UY.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_UY.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_UY.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_UY.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_UY.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_UY.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_VE.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_VE.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_VE.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_VE.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_VE.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/es_VE.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.UTF-8 0755 root bin
+d usr/lib/locale/es_VE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/es_VE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/es_VE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/es_VE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/es_VE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/es_VE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/es_VE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/es_VE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/et_EE.UTF-8 0755 root bin
+d usr/lib/locale/et_EE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/et_EE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/et_EE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/et_EE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/et_EE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/et_EE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/et_EE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/et_EE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/et_EE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/et_EE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/et_EE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/et_EE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/fi_FI.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/fi_FI.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fi_FI.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/fi_FI.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fi_FI.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/fi_FI.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fi_FI.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fi_FI.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fi_FI.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fi_FI.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fi_FI.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fi_FI.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fi_FI.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fil_PH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fil_PH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fil_PH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fil_PH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fil_PH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fil_PH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fil_PH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_BE.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_BE.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_BE.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_BE.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_BE.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/fr_BE.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_BE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_BE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_BE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_BE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_BE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_BE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_BE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_CA.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_CA.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_CA.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_CA.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_CA.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/fr_CA.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_CA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_CA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_CA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_CA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_CA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_CA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_CF.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_CF.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_CF.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_CF.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_CF.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CF.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_CF.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_CH.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_CH.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_CH.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_CH.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_CH.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/fr_CH.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_CH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_CH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_CH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_CH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_CH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_CH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_CH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-1 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-1/LC_COLLATE 0755 root bin
+h usr/lib/locale/fr_FR.ISO8859-1/LC_COLLATE/LCL_DATA=usr/lib/locale/fr_CH.ISO8859-1/LC_COLLATE/LCL_DATA
+d usr/lib/locale/fr_FR.ISO8859-1/LC_CTYPE 0755 root bin
+h usr/lib/locale/fr_FR.ISO8859-1/LC_CTYPE/LCL_DATA=usr/lib/locale/da_DK.ISO8859-1/LC_CTYPE/LCL_DATA
+d usr/lib/locale/fr_FR.ISO8859-1/LC_MESSAGES 0755 root bin
+h usr/lib/locale/fr_FR.ISO8859-1/LC_MESSAGES/LCL_DATA=usr/lib/locale/fr_BE.ISO8859-15/LC_MESSAGES/LCL_DATA
+d usr/lib/locale/fr_FR.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-1/LC_NUMERIC 0755 root bin
+h usr/lib/locale/fr_FR.ISO8859-1/LC_NUMERIC/LCL_DATA=usr/lib/locale/bg_BG.ISO8859-5/LC_NUMERIC/LCL_DATA
+d usr/lib/locale/fr_FR.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/fr_FR.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_FR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_FR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_FR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_FR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_FR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_FR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_FR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_GN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_GN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_GN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_GN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_GN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_GN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_GN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_LU.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_LU.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_LU.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_LU.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_LU.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_LU.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_LU.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_MC.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_MC.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_MC.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_MC.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_MC.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MC.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_MC.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_MG.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_MG.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_MG.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_MG.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_MG.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_MG.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_MG.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_ML.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_ML.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_ML.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_ML.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_ML.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_ML.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_ML.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_NE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_NE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_NE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_NE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_NE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_NE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_NE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/fr_SN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/fr_SN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/fr_SN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/fr_SN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/fr_SN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/fr_SN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/fr_SN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ga_IE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ga_IE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ga_IE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ga_IE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ga_IE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ga_IE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ga_IE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/gu_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/gu_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/gu_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/gu_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/gu_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/gu_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/gu_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/he_IL.UTF-8 0755 root bin
+d usr/lib/locale/he_IL.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/he_IL.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/he_IL.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/he_IL.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/he_IL.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/he_IL.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/he_IL.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/he_IL.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/he_IL.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/he_IL.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/he_IL.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/he_IL.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/hi_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/hi_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/hi_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/hi_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/hi_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/hi_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/hi_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2/LC_COLLATE 0755 root bin
+f usr/lib/locale/hr_HR.ISO8859-2/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2/LC_CTYPE 0755 root bin
+f usr/lib/locale/hr_HR.ISO8859-2/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2/LC_MESSAGES 0755 root bin
+f usr/lib/locale/hr_HR.ISO8859-2/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2/LC_MONETARY 0755 root bin
+f usr/lib/locale/hr_HR.ISO8859-2/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2/LC_NUMERIC 0755 root bin
+f usr/lib/locale/hr_HR.ISO8859-2/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.ISO8859-2/LC_TIME 0755 root bin
+f usr/lib/locale/hr_HR.ISO8859-2/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/hr_HR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/hr_HR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/hr_HR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/hr_HR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/hr_HR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/hr_HR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/hr_HR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2/LC_COLLATE 0755 root bin
+f usr/lib/locale/hu_HU.ISO8859-2/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2/LC_CTYPE 0755 root bin
+f usr/lib/locale/hu_HU.ISO8859-2/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2/LC_MESSAGES 0755 root bin
+f usr/lib/locale/hu_HU.ISO8859-2/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2/LC_MONETARY 0755 root bin
+f usr/lib/locale/hu_HU.ISO8859-2/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2/LC_NUMERIC 0755 root bin
+f usr/lib/locale/hu_HU.ISO8859-2/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.ISO8859-2/LC_TIME 0755 root bin
+f usr/lib/locale/hu_HU.ISO8859-2/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/hu_HU.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/hu_HU.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/hu_HU.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/hu_HU.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/hu_HU.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/hu_HU.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/hu_HU.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/hy_AM.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/hy_AM.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/hy_AM.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/hy_AM.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/hy_AM.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/hy_AM.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/hy_AM.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/id_ID.UTF-8 0755 root bin
+d usr/lib/locale/id_ID.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/id_ID.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/id_ID.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/id_ID.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/id_ID.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/id_ID.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/id_ID.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/id_ID.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/id_ID.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/id_ID.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/id_ID.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/id_ID.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ii_CN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ii_CN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ii_CN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ii_CN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ii_CN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ii_CN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ii_CN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/is_IS.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/is_IS.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/is_IS.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/is_IS.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/is_IS.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/is_IS.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.UTF-8 0755 root bin
+d usr/lib/locale/is_IS.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/is_IS.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/is_IS.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/is_IS.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/is_IS.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/is_IS.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/is_IS.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/is_IS.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/it_CH.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/it_CH.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/it_CH.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/it_CH.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/it_CH.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/it_CH.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.UTF-8 0755 root bin
+d usr/lib/locale/it_CH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/it_CH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/it_CH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/it_CH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/it_CH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/it_CH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/it_CH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/it_CH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-1 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-1/LC_CTYPE 0755 root bin
+h usr/lib/locale/it_IT.ISO8859-1/LC_CTYPE/LCL_DATA=usr/lib/locale/da_DK.ISO8859-1/LC_CTYPE/LCL_DATA
+d usr/lib/locale/it_IT.ISO8859-1/LC_MESSAGES 0755 root bin
+h usr/lib/locale/it_IT.ISO8859-1/LC_MESSAGES/LCL_DATA=usr/lib/locale/it_CH.ISO8859-1/LC_MESSAGES/LCL_DATA
+d usr/lib/locale/it_IT.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/it_IT.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.UTF-8 0755 root bin
+d usr/lib/locale/it_IT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/it_IT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/it_IT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/it_IT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/it_IT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/it_IT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/it_IT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/it_IT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ja_JP.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ja_JP.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ja_JP.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ja_JP.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ja_JP.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ja_JP.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ja_JP.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ka_GE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ka_GE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ka_GE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ka_GE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ka_GE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ka_GE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ka_GE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/kk_KZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/kk_KZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/kk_KZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/kk_KZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/kk_KZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/kk_KZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/kk_KZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/km_KH.UTF-8 0755 root bin
+d usr/lib/locale/km_KH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/km_KH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/km_KH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/km_KH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/km_KH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/km_KH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/km_KH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/km_KH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/km_KH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/km_KH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/km_KH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/km_KH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/kn_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/kn_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/kn_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/kn_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/kn_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/kn_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/kn_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ko_KR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ko_KR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ko_KR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ko_KR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ko_KR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ko_KR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ko_KR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/kok_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/kok_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/kok_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/kok_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/kok_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/kok_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/kok_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13/LC_COLLATE 0755 root bin
+f usr/lib/locale/lt_LT.ISO8859-13/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13/LC_CTYPE 0755 root bin
+f usr/lib/locale/lt_LT.ISO8859-13/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13/LC_MESSAGES 0755 root bin
+f usr/lib/locale/lt_LT.ISO8859-13/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13/LC_MONETARY 0755 root bin
+f usr/lib/locale/lt_LT.ISO8859-13/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13/LC_NUMERIC 0755 root bin
+f usr/lib/locale/lt_LT.ISO8859-13/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.ISO8859-13/LC_TIME 0755 root bin
+f usr/lib/locale/lt_LT.ISO8859-13/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/lt_LT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/lt_LT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/lt_LT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/lt_LT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/lt_LT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/lt_LT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/lt_LT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13/LC_COLLATE 0755 root bin
+f usr/lib/locale/lv_LV.ISO8859-13/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13/LC_CTYPE 0755 root bin
+f usr/lib/locale/lv_LV.ISO8859-13/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13/LC_MESSAGES 0755 root bin
+f usr/lib/locale/lv_LV.ISO8859-13/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13/LC_MONETARY 0755 root bin
+f usr/lib/locale/lv_LV.ISO8859-13/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13/LC_NUMERIC 0755 root bin
+f usr/lib/locale/lv_LV.ISO8859-13/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.ISO8859-13/LC_TIME 0755 root bin
+f usr/lib/locale/lv_LV.ISO8859-13/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/lv_LV.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/lv_LV.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/lv_LV.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/lv_LV.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/lv_LV.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/lv_LV.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/lv_LV.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5/LC_COLLATE 0755 root bin
+f usr/lib/locale/mk_MK.ISO8859-5/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5/LC_CTYPE 0755 root bin
+f usr/lib/locale/mk_MK.ISO8859-5/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5/LC_MESSAGES 0755 root bin
+f usr/lib/locale/mk_MK.ISO8859-5/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5/LC_MONETARY 0755 root bin
+f usr/lib/locale/mk_MK.ISO8859-5/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5/LC_NUMERIC 0755 root bin
+f usr/lib/locale/mk_MK.ISO8859-5/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.ISO8859-5/LC_TIME 0755 root bin
+f usr/lib/locale/mk_MK.ISO8859-5/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/mk_MK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/mk_MK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/mk_MK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/mk_MK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/mk_MK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/mk_MK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/mk_MK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ml_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ml_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ml_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ml_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ml_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ml_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ml_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/mn_CN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/mn_CN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/mn_CN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/mn_CN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/mn_CN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_CN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/mn_CN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/mn_MN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/mn_MN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/mn_MN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/mn_MN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/mn_MN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/mn_MN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/mn_MN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/mr_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/mr_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/mr_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/mr_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/mr_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/mr_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/mr_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ms_MY.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ms_MY.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ms_MY.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ms_MY.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ms_MY.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ms_MY.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ms_MY.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/mt_MT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/mt_MT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/mt_MT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/mt_MT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/mt_MT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/mt_MT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/mt_MT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/nb_NO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/nb_NO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/nb_NO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/nb_NO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/nb_NO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/nb_NO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/nb_NO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ne_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ne_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ne_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ne_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ne_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ne_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ne_NP.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ne_NP.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ne_NP.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ne_NP.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ne_NP.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ne_NP.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ne_NP.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/nl_BE.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/nl_BE.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/nl_BE.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/nl_BE.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/nl_BE.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/nl_BE.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/nl_BE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/nl_BE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/nl_BE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/nl_BE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/nl_BE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_BE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/nl_BE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/nl_NL.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/nl_NL.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/nl_NL.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/nl_NL.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/nl_NL.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/nl_NL.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/nl_NL.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/nl_NL.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/nl_NL.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/nl_NL.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/nl_NL.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/nl_NL.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/nl_NL.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/nn_NO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/nn_NO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/nn_NO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/nn_NO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/nn_NO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/nn_NO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/nn_NO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/or_IN.UTF-8 0755 root bin
+d usr/lib/locale/or_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/or_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/or_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/or_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/or_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/or_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/or_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/or_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/or_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/or_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/or_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/or_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pa_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pa_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pa_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pa_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pa_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pa_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pa_PK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pa_PK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pa_PK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pa_PK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pa_PK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pa_PK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pa_PK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2/LC_COLLATE 0755 root bin
+f usr/lib/locale/pl_PL.ISO8859-2/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2/LC_CTYPE 0755 root bin
+f usr/lib/locale/pl_PL.ISO8859-2/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pl_PL.ISO8859-2/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2/LC_MONETARY 0755 root bin
+f usr/lib/locale/pl_PL.ISO8859-2/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pl_PL.ISO8859-2/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.ISO8859-2/LC_TIME 0755 root bin
+f usr/lib/locale/pl_PL.ISO8859-2/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pl_PL.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pl_PL.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pl_PL.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pl_PL.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pl_PL.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pl_PL.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pl_PL.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pt_BR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pt_BR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pt_BR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pt_BR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pt_BR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_BR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pt_BR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pt_GW.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pt_GW.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pt_GW.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pt_GW.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pt_GW.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_GW.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pt_GW.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pt_MZ.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pt_MZ.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pt_MZ.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pt_MZ.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pt_MZ.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_MZ.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pt_MZ.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/pt_PT.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/pt_PT.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pt_PT.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/pt_PT.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pt_PT.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/pt_PT.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/pt_PT.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/pt_PT.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/pt_PT.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/pt_PT.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/pt_PT.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/pt_PT.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/pt_PT.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ro_MD.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ro_MD.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ro_MD.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ro_MD.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ro_MD.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_MD.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ro_MD.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ro_RO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ro_RO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ro_RO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ro_RO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ro_RO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ro_RO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ro_RO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ru_MD.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ru_MD.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ru_MD.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ru_MD.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ru_MD.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_MD.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ru_MD.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5/LC_COLLATE 0755 root bin
+f usr/lib/locale/ru_RU.ISO8859-5/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5/LC_CTYPE 0755 root bin
+f usr/lib/locale/ru_RU.ISO8859-5/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ru_RU.ISO8859-5/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5/LC_MONETARY 0755 root bin
+f usr/lib/locale/ru_RU.ISO8859-5/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ru_RU.ISO8859-5/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.ISO8859-5/LC_TIME 0755 root bin
+f usr/lib/locale/ru_RU.ISO8859-5/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R/LC_COLLATE 0755 root bin
+f usr/lib/locale/ru_RU.KOI8-R/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R/LC_CTYPE 0755 root bin
+f usr/lib/locale/ru_RU.KOI8-R/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ru_RU.KOI8-R/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R/LC_MONETARY 0755 root bin
+f usr/lib/locale/ru_RU.KOI8-R/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ru_RU.KOI8-R/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.KOI8-R/LC_TIME 0755 root bin
+f usr/lib/locale/ru_RU.KOI8-R/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ru_RU.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ru_RU.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ru_RU.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ru_RU.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ru_RU.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_RU.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ru_RU.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ru_UA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ru_UA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ru_UA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ru_UA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ru_UA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ru_UA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ru_UA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sa_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sa_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sa_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sa_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sa_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sa_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sa_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/si_LK.UTF-8 0755 root bin
+d usr/lib/locale/si_LK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/si_LK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/si_LK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/si_LK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/si_LK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/si_LK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/si_LK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/si_LK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/si_LK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/si_LK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/si_LK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/si_LK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sk_SK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sk_SK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sk_SK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sk_SK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sk_SK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sk_SK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sk_SK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sl_SI.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sl_SI.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sl_SI.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sl_SI.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sl_SI.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sl_SI.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sl_SI.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2/LC_COLLATE 0755 root bin
+f usr/lib/locale/sq_AL.ISO8859-2/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2/LC_CTYPE 0755 root bin
+f usr/lib/locale/sq_AL.ISO8859-2/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sq_AL.ISO8859-2/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2/LC_MONETARY 0755 root bin
+f usr/lib/locale/sq_AL.ISO8859-2/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sq_AL.ISO8859-2/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.ISO8859-2/LC_TIME 0755 root bin
+f usr/lib/locale/sq_AL.ISO8859-2/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sq_AL.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sq_AL.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sq_AL.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sq_AL.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sq_AL.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sq_AL.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sq_AL.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sr_BA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sr_BA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sr_BA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sr_BA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sr_BA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_BA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sr_BA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sr_ME.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sr_ME.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sr_ME.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sr_ME.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sr_ME.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_ME.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sr_ME.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sr_RS.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sr_RS.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sr_RS.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sr_RS.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sr_RS.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sr_RS.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sr_RS.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/sv_FI.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/sv_FI.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sv_FI.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/sv_FI.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sv_FI.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/sv_FI.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sv_FI.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sv_FI.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sv_FI.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sv_FI.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sv_FI.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_FI.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sv_FI.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1/LC_COLLATE 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-1/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1/LC_CTYPE 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-1/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-1/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1/LC_MONETARY 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-1/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-1/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-1/LC_TIME 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-1/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15/LC_COLLATE 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-15/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15/LC_CTYPE 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-15/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-15/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15/LC_MONETARY 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-15/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-15/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.ISO8859-15/LC_TIME 0755 root bin
+f usr/lib/locale/sv_SE.ISO8859-15/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/sv_SE.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/sv_SE.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/sv_SE.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/sv_SE.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/sv_SE.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/sv_SE.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/sv_SE.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ta_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ta_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ta_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ta_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ta_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ta_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ta_LK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ta_LK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ta_LK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ta_LK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ta_LK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ta_LK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ta_LK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/te_IN.UTF-8 0755 root bin
+d usr/lib/locale/te_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/te_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/te_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/te_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/te_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/te_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/te_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/te_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/te_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/te_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/te_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/te_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11/LC_COLLATE 0755 root bin
+f usr/lib/locale/th_TH.ISO8859-11/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11/LC_CTYPE 0755 root bin
+f usr/lib/locale/th_TH.ISO8859-11/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11/LC_MESSAGES 0755 root bin
+f usr/lib/locale/th_TH.ISO8859-11/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11/LC_MONETARY 0755 root bin
+f usr/lib/locale/th_TH.ISO8859-11/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11/LC_NUMERIC 0755 root bin
+f usr/lib/locale/th_TH.ISO8859-11/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.ISO8859-11/LC_TIME 0755 root bin
+f usr/lib/locale/th_TH.ISO8859-11/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.UTF-8 0755 root bin
+d usr/lib/locale/th_TH.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/th_TH.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/th_TH.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/th_TH.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/th_TH.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/th_TH.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/th_TH.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/th_TH.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9/LC_COLLATE 0755 root bin
+f usr/lib/locale/tr_TR.ISO8859-9/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9/LC_CTYPE 0755 root bin
+f usr/lib/locale/tr_TR.ISO8859-9/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9/LC_MESSAGES 0755 root bin
+f usr/lib/locale/tr_TR.ISO8859-9/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9/LC_MONETARY 0755 root bin
+f usr/lib/locale/tr_TR.ISO8859-9/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9/LC_NUMERIC 0755 root bin
+f usr/lib/locale/tr_TR.ISO8859-9/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.ISO8859-9/LC_TIME 0755 root bin
+f usr/lib/locale/tr_TR.ISO8859-9/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/tr_TR.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/tr_TR.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/tr_TR.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/tr_TR.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/tr_TR.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/tr_TR.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/tr_TR.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ug_CN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ug_CN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ug_CN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ug_CN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ug_CN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ug_CN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ug_CN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/uk_UA.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/uk_UA.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/uk_UA.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/uk_UA.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/uk_UA.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/uk_UA.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/uk_UA.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ur_IN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ur_IN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ur_IN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ur_IN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ur_IN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_IN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ur_IN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/ur_PK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/ur_PK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/ur_PK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/ur_PK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/ur_PK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/ur_PK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/ur_PK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/vi_VN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/vi_VN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/vi_VN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/vi_VN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/vi_VN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/vi_VN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/vi_VN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.GB18030 0755 root bin
+d usr/lib/locale/zh_CN.GB18030/LC_COLLATE 0755 root bin
+f usr/lib/locale/zh_CN.GB18030/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.GB18030/LC_CTYPE 0755 root bin
+f usr/lib/locale/zh_CN.GB18030/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.GB18030/LC_MESSAGES 0755 root bin
+f usr/lib/locale/zh_CN.GB18030/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.GB18030/LC_MONETARY 0755 root bin
+f usr/lib/locale/zh_CN.GB18030/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.GB18030/LC_NUMERIC 0755 root bin
+f usr/lib/locale/zh_CN.GB18030/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.GB18030/LC_TIME 0755 root bin
+f usr/lib/locale/zh_CN.GB18030/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/zh_CN.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/zh_CN.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/zh_CN.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/zh_CN.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/zh_CN.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_CN.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/zh_CN.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/zh_HK.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/zh_HK.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/zh_HK.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/zh_HK.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/zh_HK.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_HK.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/zh_HK.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/zh_MO.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/zh_MO.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/zh_MO.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/zh_MO.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/zh_MO.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_MO.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/zh_MO.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/zh_SG.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/zh_SG.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/zh_SG.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/zh_SG.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/zh_SG.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_SG.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/zh_SG.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8/LC_COLLATE 0755 root bin
+f usr/lib/locale/zh_TW.UTF-8/LC_COLLATE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8/LC_CTYPE 0755 root bin
+f usr/lib/locale/zh_TW.UTF-8/LC_CTYPE/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8/LC_MESSAGES 0755 root bin
+f usr/lib/locale/zh_TW.UTF-8/LC_MESSAGES/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8/LC_MONETARY 0755 root bin
+f usr/lib/locale/zh_TW.UTF-8/LC_MONETARY/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8/LC_NUMERIC 0755 root bin
+f usr/lib/locale/zh_TW.UTF-8/LC_NUMERIC/LCL_DATA 0755 root bin
+d usr/lib/locale/zh_TW.UTF-8/LC_TIME 0755 root bin
+f usr/lib/locale/zh_TW.UTF-8/LC_TIME/LCL_DATA 0755 root bin
+d usr/lib/localedef 0755 root bin
+d usr/lib/localedef/src 0755 root bin
+f usr/lib/lslabels 0555 root bin
+d usr/lib/lwp 0755 root bin
+s usr/lib/lwp/32=.
+s usr/lib/lwp/64=amd64
+d usr/lib/lwp/amd64 0755 root bin
+s usr/lib/lwp/amd64/libthread.so.1=../../amd64/libthread.so.1
+s usr/lib/lwp/amd64/libthread_db.so.1=../../amd64/libthread_db.so.1
+s usr/lib/lwp/libthread.so.1=../libthread.so.1
+s usr/lib/lwp/libthread_db.so.1=../libthread_db.so.1
+f usr/lib/madv.so.1 0755 root bin
+f usr/lib/mail.local 0555 root bin
+f usr/lib/makekey 0555 root bin
+f usr/lib/makewhatis 0555 root bin
+d usr/lib/mdb 0755 root sys
+d usr/lib/mdb/kvm 0755 root sys
+d usr/lib/mdb/kvm/amd64 0755 root sys
+f usr/lib/mdb/kvm/amd64/arp.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/cpc.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/cpu.generic.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/cpu_ms.AuthenticAMD.15.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/crypto.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/dtrace.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/emlxs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/fcip.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/fcp.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/fctl.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/genunix.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/hook.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/idm.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/ii.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/ip.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/ipc.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/ipp.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/krtld.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/lofs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/logindmux.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/mac.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/md.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/mdb_kb.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/mdb_ks.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/mpt.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/mpt_sas.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/mr_sas.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/nca.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/neti.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/nfs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/nsctl.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/nsmb.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/pmcs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/ptm.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/qlc.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/random.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/rdc.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/s1394.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sata.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/scsi_vhci.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sctp.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sd.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sdbc.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/smbfs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/smbsrv.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sockfs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/specfs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sppp.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/srpt.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/stmf.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/stmf_sbd.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/sv.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/ufs.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/uhci.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/usba.so 0555 root sys
+f usr/lib/mdb/kvm/amd64/zfs.so 0555 root sys
+f usr/lib/mdb/kvm/arp.so 0555 root sys
+f usr/lib/mdb/kvm/cpc.so 0555 root sys
+f usr/lib/mdb/kvm/cpu.generic.so 0555 root sys
+f usr/lib/mdb/kvm/cpu_ms.AuthenticAMD.15.so 0555 root sys
+f usr/lib/mdb/kvm/crypto.so 0555 root sys
+f usr/lib/mdb/kvm/dtrace.so 0555 root sys
+f usr/lib/mdb/kvm/emlxs.so 0555 root sys
+f usr/lib/mdb/kvm/fcip.so 0555 root sys
+f usr/lib/mdb/kvm/fcp.so 0555 root sys
+f usr/lib/mdb/kvm/fctl.so 0555 root sys
+f usr/lib/mdb/kvm/genunix.so 0555 root sys
+f usr/lib/mdb/kvm/hook.so 0555 root sys
+f usr/lib/mdb/kvm/idm.so 0555 root sys
+f usr/lib/mdb/kvm/ii.so 0555 root sys
+f usr/lib/mdb/kvm/ip.so 0555 root sys
+f usr/lib/mdb/kvm/ipc.so 0555 root sys
+f usr/lib/mdb/kvm/ipp.so 0555 root sys
+f usr/lib/mdb/kvm/krtld.so 0555 root sys
+f usr/lib/mdb/kvm/lofs.so 0555 root sys
+f usr/lib/mdb/kvm/logindmux.so 0555 root sys
+f usr/lib/mdb/kvm/mac.so 0555 root sys
+f usr/lib/mdb/kvm/md.so 0555 root sys
+f usr/lib/mdb/kvm/mdb_kb.so 0555 root sys
+f usr/lib/mdb/kvm/mdb_ks.so 0555 root sys
+f usr/lib/mdb/kvm/mpt.so 0555 root sys
+f usr/lib/mdb/kvm/mpt_sas.so 0555 root sys
+f usr/lib/mdb/kvm/mr_sas.so 0555 root sys
+f usr/lib/mdb/kvm/nca.so 0555 root sys
+f usr/lib/mdb/kvm/neti.so 0555 root sys
+f usr/lib/mdb/kvm/nfs.so 0555 root sys
+f usr/lib/mdb/kvm/nsctl.so 0555 root sys
+f usr/lib/mdb/kvm/nsmb.so 0555 root sys
+f usr/lib/mdb/kvm/pmcs.so 0555 root sys
+f usr/lib/mdb/kvm/ptm.so 0555 root sys
+f usr/lib/mdb/kvm/qlc.so 0555 root sys
+f usr/lib/mdb/kvm/random.so 0555 root sys
+f usr/lib/mdb/kvm/rdc.so 0555 root sys
+f usr/lib/mdb/kvm/s1394.so 0555 root sys
+f usr/lib/mdb/kvm/sata.so 0555 root sys
+f usr/lib/mdb/kvm/scsi_vhci.so 0555 root sys
+f usr/lib/mdb/kvm/sctp.so 0555 root sys
+f usr/lib/mdb/kvm/sd.so 0555 root sys
+f usr/lib/mdb/kvm/sdbc.so 0555 root sys
+f usr/lib/mdb/kvm/smbfs.so 0555 root sys
+f usr/lib/mdb/kvm/smbsrv.so 0555 root sys
+f usr/lib/mdb/kvm/sockfs.so 0555 root sys
+f usr/lib/mdb/kvm/specfs.so 0555 root sys
+f usr/lib/mdb/kvm/sppp.so 0555 root sys
+f usr/lib/mdb/kvm/srpt.so 0555 root sys
+f usr/lib/mdb/kvm/stmf.so 0555 root sys
+f usr/lib/mdb/kvm/stmf_sbd.so 0555 root sys
+f usr/lib/mdb/kvm/sv.so 0555 root sys
+f usr/lib/mdb/kvm/ufs.so 0555 root sys
+f usr/lib/mdb/kvm/uhci.so 0555 root sys
+f usr/lib/mdb/kvm/usba.so 0555 root sys
+f usr/lib/mdb/kvm/zfs.so 0555 root sys
+d usr/lib/mdb/proc 0755 root sys
+d usr/lib/mdb/proc/amd64 0755 root sys
+f usr/lib/mdb/proc/amd64/ld.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libavl.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libc.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libcmdutils.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libnvpair.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libproc.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libpython2.6.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libsysevent.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libtopo.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libumem.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libuutil.so 0555 root sys
+f usr/lib/mdb/proc/amd64/libzpool.so 0555 root sys
+f usr/lib/mdb/proc/amd64/mdb_ds.so 0555 root sys
+f usr/lib/mdb/proc/amd64/mdb_test.so 0555 root sys
+f usr/lib/mdb/proc/amd64/v8.so 0555 root sys
+f usr/lib/mdb/proc/eft.so 0555 root sys
+f usr/lib/mdb/proc/fmd.so 0555 root sys
+f usr/lib/mdb/proc/ld.so 0555 root sys
+f usr/lib/mdb/proc/libavl.so 0555 root sys
+f usr/lib/mdb/proc/libc.so 0555 root sys
+f usr/lib/mdb/proc/libcmdutils.so 0555 root sys
+f usr/lib/mdb/proc/libnvpair.so 0555 root sys
+f usr/lib/mdb/proc/libproc.so 0555 root sys
+f usr/lib/mdb/proc/libpython2.6.so 0555 root sys
+f usr/lib/mdb/proc/libsysevent.so 0555 root sys
+f usr/lib/mdb/proc/libtopo.so 0555 root sys
+f usr/lib/mdb/proc/libumem.so 0555 root sys
+f usr/lib/mdb/proc/libuutil.so 0555 root sys
+f usr/lib/mdb/proc/libzpool.so 0555 root sys
+f usr/lib/mdb/proc/mdb_ds.so 0555 root sys
+f usr/lib/mdb/proc/mdb_test.so 0555 root sys
+f usr/lib/mdb/proc/svc.configd.so 0555 root sys
+f usr/lib/mdb/proc/svc.startd.so 0555 root sys
+f usr/lib/mdb/proc/v8.so 0555 root sys
+d usr/lib/mdb/raw 0755 root sys
+d usr/lib/mdb/raw/amd64 0755 root sys
+f usr/lib/mdb/raw/amd64/dof.so 0555 root sys
+f usr/lib/mdb/raw/dof.so 0555 root sys
+f usr/lib/more.help 0644 root bin
+f usr/lib/mpss.so.1 0755 root bin
+f usr/lib/ncad_addr.so.1 0755 root bin
+s usr/lib/ncad_addr.so=ncad_addr.so.1
+f usr/lib/ncalladm 0555 root bin
+d usr/lib/ndmp 0755 root bin
+f usr/lib/ndmp/ndmpd 0555 root bin
+d usr/lib/netsvc 0755 root sys
+d usr/lib/netsvc/nis 0755 root sys
+d usr/lib/netsvc/rstat 0755 root sys
+f usr/lib/netsvc/rstat/rpc.rstatd 0555 root sys
+d usr/lib/netsvc/rusers 0755 root sys
+f usr/lib/netsvc/rusers/rpc.rusersd 0555 root sys
+d usr/lib/netsvc/rwall 0755 root sys
+f usr/lib/netsvc/rwall/rpc.rwalld 0555 root sys
+d usr/lib/netsvc/spray 0755 root sys
+f usr/lib/netsvc/spray/rpc.sprayd 0555 root sys
+d usr/lib/netsvc/yp 0755 root bin
+f usr/lib/netsvc/yp/inityp2l 0555 root sys
+f usr/lib/netsvc/yp/mkalias 0555 root sys
+f usr/lib/netsvc/yp/multi 0555 root sys
+f usr/lib/netsvc/yp/multi.awk 0555 root sys
+f usr/lib/netsvc/yp/rpc.yppasswdd 0555 root sys
+f usr/lib/netsvc/yp/rpc.ypupdated 0555 root sys
+f usr/lib/netsvc/yp/stdethers 0555 root sys
+f usr/lib/netsvc/yp/stdhosts 0555 root sys
+f usr/lib/netsvc/yp/udpublickey 0555 root sys
+f usr/lib/netsvc/yp/ypbind 0555 root bin
+f usr/lib/netsvc/yp/ypmap2src 0555 root sys
+f usr/lib/netsvc/yp/yppush 0555 root sys
+f usr/lib/netsvc/yp/ypserv 0555 root sys
+f usr/lib/netsvc/yp/ypstart 0555 root bin
+f usr/lib/netsvc/yp/ypstop 0555 root bin
+f usr/lib/netsvc/yp/ypxfr 0555 root bin
+f usr/lib/netsvc/yp/ypxfr_1perday 0555 root sys
+f usr/lib/netsvc/yp/ypxfr_1perhour 0555 root sys
+f usr/lib/netsvc/yp/ypxfr_2perday 0555 root sys
+f usr/lib/netsvc/yp/ypxfrd 0555 root sys
+f usr/lib/newsyslog 0555 root sys
+d usr/lib/nfs 0755 root sys
+f usr/lib/nfs/libmapid.so.1 0755 root bin
+s usr/lib/nfs/libmapid.so=libmapid.so.1
+f usr/lib/nfs/lockd 0555 root bin
+f usr/lib/nfs/mountd 0555 root bin
+f usr/lib/nfs/nfs4cbd 0555 root bin
+f usr/lib/nfs/nfsd 0555 root bin
+f usr/lib/nfs/nfslogd 0555 root bin
+f usr/lib/nfs/nfsmapid 0555 root bin
+f usr/lib/nfs/rquotad 0555 root bin
+f usr/lib/nfs/statd 0555 root bin
+f usr/lib/nskernd 0555 root bin
+f usr/lib/nss_ad.so.1 0755 root bin
+s usr/lib/nss_compat.so.1=../../lib/nss_compat.so.1
+s usr/lib/nss_dns.so.1=../../lib/nss_dns.so.1
+s usr/lib/nss_files.so.1=../../lib/nss_files.so.1
+f usr/lib/nss_ldap.so.1 0755 root bin
+f usr/lib/nss_mdns.so.1 0755 root bin
+s usr/lib/nss_nis.so.1=../../lib/nss_nis.so.1
+s usr/lib/nss_user.so.1=../../lib/nss_user.so.1
+f usr/lib/passmgmt 0555 root sys
+f usr/lib/passwdutil.so.1 0755 root bin
+d usr/lib/pci 0755 root bin
+f usr/lib/pci/pcidr 0555 root bin
+f usr/lib/pci/pcidr_plugin.so 0755 root bin
+f usr/lib/pfexecd 0555 root bin
+d usr/lib/picl 0755 root sys
+f usr/lib/picl/picld 0555 root sys
+d usr/lib/picl/plugins 0755 root sys
+f usr/lib/picl/plugins/fru_container.conf 0644 root sys
+f usr/lib/picl/plugins/libpicldevtree.so.1 0755 root sys
+s usr/lib/picl/plugins/libpicldevtree.so=libpicldevtree.so.1
+f usr/lib/picl/plugins/libpiclevent.so.1 0755 root sys
+s usr/lib/picl/plugins/libpiclevent.so=libpiclevent.so.1
+f usr/lib/picl/plugins/libpiclfrutree.so.1 0755 root sys
+s usr/lib/picl/plugins/libpiclfrutree.so=libpiclfrutree.so.1
+f usr/lib/picl/plugins/libpiclmemcfg.so.1 0755 root sys
+s usr/lib/picl/plugins/libpiclmemcfg.so=libpiclmemcfg.so.1
+d usr/lib/pkgconfig 0755 root bin
+f usr/lib/platexec 0555 root bin
+d usr/lib/pool 0755 root bin
+f usr/lib/pool/libjkstat.so.1 0755 root bin
+s usr/lib/pool/libjkstat.so=libjkstat.so.1
+f usr/lib/pool/libjlgrp.so.1 0755 root bin
+s usr/lib/pool/libjlgrp.so=libjlgrp.so.1
+f usr/lib/pool/libjpool.so.1 0755 root bin
+s usr/lib/pool/libjpool.so=libjpool.so.1
+f usr/lib/pool/libjsyslog.so.1 0755 root bin
+s usr/lib/pool/libjsyslog.so=libjsyslog.so.1
+f usr/lib/pool/poold 0555 root bin
+f usr/lib/pool/poold.properties 0444 root bin
+d usr/lib/power 0755 root bin
+f usr/lib/power/powerd 0555 root bin
+d usr/lib/raidcfg 0755 root bin
+d usr/lib/raidcfg/amd64 0755 root bin
+f usr/lib/raidcfg/amd64/mpt.so.1 0755 root bin
+f usr/lib/raidcfg/mpt.so.1 0755 root bin
+d usr/lib/rcap 0755 root bin
+d usr/lib/rcap/amd64 0755 root bin
+f usr/lib/rcap/amd64/rcapd 0555 root bin
+d usr/lib/rcap/i86 0755 root bin
+h usr/lib/rcap/rcapd=usr/lib/isaexec
+d usr/lib/rcm 0755 root bin
+d usr/lib/rcm/modules 0755 root bin
+f usr/lib/rcm/modules/SUNW_aggr_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_bridge_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_cluster_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_dump_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_filesys_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_ibpart_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_ip_anon_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_ip_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_mpxio_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_network_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_pool_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_swap_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_vlan_rcm.so 0555 root bin
+f usr/lib/rcm/modules/SUNW_vnic_rcm.so 0555 root bin
+f usr/lib/rcm/rcm_daemon 0555 root bin
+d usr/lib/rcm/scripts 0755 root bin
+f usr/lib/rcm/scripts/SUNW,ibsdpu.sh 0555 root bin
+f usr/lib/rcm/scripts/SUNW,rdsv3u.sh 0555 root bin
+d usr/lib/refer 0755 root bin
+f usr/lib/refer/hunt 0555 root bin
+f usr/lib/refer/inv 0555 root bin
+f usr/lib/refer/mkey 0555 root bin
+d usr/lib/refer/papers 0755 root bin
+f usr/lib/refer/papers/Rbstjissue 0644 root bin
+f usr/lib/refer/papers/Rv7man 0644 root bin
+f usr/lib/refer/papers/runinv 0755 root bin
+d usr/lib/reparse 0755 root bin
+d usr/lib/reparse/amd64 0755 root bin
+f usr/lib/reparse/amd64/libnfs_basic.so.1 0755 root bin
+s usr/lib/reparse/amd64/libnfs_basic.so=libnfs_basic.so.1
+f usr/lib/reparse/amd64/libreparse_smb.so.1 0755 root bin
+s usr/lib/reparse/amd64/libreparse_smb.so=libreparse_smb.so.1
+f usr/lib/reparse/libnfs_basic.so.1 0755 root bin
+s usr/lib/reparse/libnfs_basic.so=libnfs_basic.so.1
+f usr/lib/reparse/libreparse_smb.so.1 0755 root bin
+s usr/lib/reparse/libreparse_smb.so=libreparse_smb.so.1
+f usr/lib/reparse/reparsed 0555 root sys
+f usr/lib/rpcsec.so.1 0755 root bin
+s usr/lib/rpcsec.so=rpcsec.so.1
+s usr/lib/rsh=../bin/ksh93
+d usr/lib/sa 0755 root bin
+f usr/lib/sa/sa1 0555 root bin
+f usr/lib/sa/sa2 0555 root bin
+f usr/lib/sa/sadc 0555 root bin
+d usr/lib/saf 0755 root bin
+f usr/lib/saf/listen 0755 root sys
+f usr/lib/saf/nlps_server 0755 root sys
+f usr/lib/saf/sac 0555 root sys
+f usr/lib/saf/ttymon 0555 root sys
+d usr/lib/sasl 0755 root bin
+d usr/lib/sasl/amd64 0755 root bin
+f usr/lib/sasl/amd64/crammd5.so.1 0755 root bin
+f usr/lib/sasl/amd64/digestmd5.so.1 0755 root bin
+f usr/lib/sasl/amd64/gssapi.so.1 0755 root bin
+f usr/lib/sasl/amd64/plain.so.1 0755 root bin
+f usr/lib/sasl/crammd5.so.1 0755 root bin
+f usr/lib/sasl/digestmd5.so.1 0755 root bin
+f usr/lib/sasl/gssapi.so.1 0755 root bin
+f usr/lib/sasl/plain.so.1 0755 root bin
+d usr/lib/scsi 0755 root bin
+d usr/lib/scsi/amd64 0755 root bin
+f usr/lib/scsi/amd64/libscsi.so.1 0755 root bin
+s usr/lib/scsi/amd64/libscsi.so=libscsi.so.1
+f usr/lib/scsi/amd64/libses.so.1 0755 root bin
+s usr/lib/scsi/amd64/libses.so=libses.so.1
+f usr/lib/scsi/amd64/libsmp.so.1 0755 root bin
+s usr/lib/scsi/amd64/libsmp.so=libsmp.so.1
+f usr/lib/scsi/libscsi.so.1 0755 root bin
+s usr/lib/scsi/libscsi.so=libscsi.so.1
+f usr/lib/scsi/libses.so.1 0755 root bin
+s usr/lib/scsi/libses.so=libses.so.1
+f usr/lib/scsi/libsmp.so.1 0755 root bin
+s usr/lib/scsi/libsmp.so=libsmp.so.1
+d usr/lib/scsi/plugins 0755 root bin
+d usr/lib/scsi/plugins/scsi 0755 root bin
+d usr/lib/scsi/plugins/scsi/engines 0755 root bin
+d usr/lib/scsi/plugins/scsi/engines/amd64 0755 root bin
+f usr/lib/scsi/plugins/scsi/engines/amd64/uscsi.so 0755 root bin
+f usr/lib/scsi/plugins/scsi/engines/uscsi.so 0755 root bin
+d usr/lib/scsi/plugins/ses 0755 root bin
+d usr/lib/scsi/plugins/ses/framework 0755 root bin
+d usr/lib/scsi/plugins/ses/framework/amd64 0755 root bin
+f usr/lib/scsi/plugins/ses/framework/amd64/libses.so 0755 root bin
+f usr/lib/scsi/plugins/ses/framework/amd64/ses2.so 0755 root bin
+f usr/lib/scsi/plugins/ses/framework/libses.so 0755 root bin
+f usr/lib/scsi/plugins/ses/framework/ses2.so 0755 root bin
+d usr/lib/scsi/plugins/ses/vendor 0755 root bin
+f usr/lib/scsi/plugins/ses/vendor/LSILOGIC-SASX28-A.0.so 0755 root bin
+s usr/lib/scsi/plugins/ses/vendor/LSILOGIC-SASX28-A.1.so=LSILOGIC-SASX28-A.0.so
+s usr/lib/scsi/plugins/ses/vendor/SUN-Storage-J4200.so=SUN-Storage-J4400.so
+f usr/lib/scsi/plugins/ses/vendor/SUN-Storage-J4400.so 0755 root bin
+f usr/lib/scsi/plugins/ses/vendor/SUN-Storage-J4500.so 0755 root bin
+f usr/lib/scsi/plugins/ses/vendor/SUN.so 0755 root bin
+d usr/lib/scsi/plugins/ses/vendor/amd64 0755 root bin
+f usr/lib/scsi/plugins/ses/vendor/amd64/LSILOGIC-SASX28-A.0.so 0755 root bin
+s usr/lib/scsi/plugins/ses/vendor/amd64/LSILOGIC-SASX28-A.1.so=LSILOGIC-SASX28-A.0.so
+s usr/lib/scsi/plugins/ses/vendor/amd64/SUN-Storage-J4200.so=SUN-Storage-J4400.so
+f usr/lib/scsi/plugins/ses/vendor/amd64/SUN-Storage-J4400.so 0755 root bin
+f usr/lib/scsi/plugins/ses/vendor/amd64/SUN-Storage-J4500.so 0755 root bin
+f usr/lib/scsi/plugins/ses/vendor/amd64/SUN.so 0755 root bin
+d usr/lib/scsi/plugins/smp 0755 root bin
+d usr/lib/scsi/plugins/smp/engine 0755 root bin
+d usr/lib/scsi/plugins/smp/engine/amd64 0755 root bin
+f usr/lib/scsi/plugins/smp/engine/amd64/usmp.so 0755 root bin
+f usr/lib/scsi/plugins/smp/engine/usmp.so 0755 root bin
+d usr/lib/scsi/plugins/smp/framework 0755 root bin
+d usr/lib/scsi/plugins/smp/framework/amd64 0755 root bin
+f usr/lib/scsi/plugins/smp/framework/amd64/sas2.so 0755 root bin
+f usr/lib/scsi/plugins/smp/framework/sas2.so 0755 root bin
+f usr/lib/scsi/sestopo 0555 root bin
+f usr/lib/scsi/smp 0555 root bin
+d usr/lib/secure 0755 root bin
+s usr/lib/secure/32=.
+s usr/lib/secure/64=amd64
+d usr/lib/secure/amd64 0755 root bin
+d usr/lib/security 0755 root bin
+s usr/lib/security/64=amd64
+d usr/lib/security/amd64 0755 root bin
+f usr/lib/security/amd64/crypt_bsdbf.so.1 0755 root bin
+s usr/lib/security/amd64/crypt_bsdbf.so=crypt_bsdbf.so.1
+f usr/lib/security/amd64/crypt_bsdmd5.so.1 0755 root bin
+s usr/lib/security/amd64/crypt_bsdmd5.so=crypt_bsdmd5.so.1
+f usr/lib/security/amd64/crypt_sha256.so.1 0755 root bin
+s usr/lib/security/amd64/crypt_sha256.so=crypt_sha256.so.1
+f usr/lib/security/amd64/crypt_sha512.so.1 0755 root bin
+s usr/lib/security/amd64/crypt_sha512.so=crypt_sha512.so.1
+f usr/lib/security/amd64/crypt_sunmd5.so.1 0755 root bin
+s usr/lib/security/amd64/crypt_sunmd5.so=crypt_sunmd5.so.1
+f usr/lib/security/amd64/pam_allow.so.1 0755 root bin
+s usr/lib/security/amd64/pam_allow.so=pam_allow.so.1
+f usr/lib/security/amd64/pam_authtok_check.so.1 0755 root bin
+s usr/lib/security/amd64/pam_authtok_check.so=pam_authtok_check.so.1
+f usr/lib/security/amd64/pam_authtok_get.so.1 0755 root bin
+s usr/lib/security/amd64/pam_authtok_get.so=pam_authtok_get.so.1
+f usr/lib/security/amd64/pam_authtok_store.so.1 0755 root bin
+s usr/lib/security/amd64/pam_authtok_store.so=pam_authtok_store.so.1
+f usr/lib/security/amd64/pam_deny.so.1 0755 root bin
+s usr/lib/security/amd64/pam_deny.so=pam_deny.so.1
+f usr/lib/security/amd64/pam_dhkeys.so.1 0755 root bin
+s usr/lib/security/amd64/pam_dhkeys.so=pam_dhkeys.so.1
+f usr/lib/security/amd64/pam_dial_auth.so.1 0755 root bin
+s usr/lib/security/amd64/pam_dial_auth.so=pam_dial_auth.so.1
+f usr/lib/security/amd64/pam_krb5.so.1 0755 root bin
+s usr/lib/security/amd64/pam_krb5.so=pam_krb5.so.1
+f usr/lib/security/amd64/pam_krb5_migrate.so.1 0755 root bin
+s usr/lib/security/amd64/pam_krb5_migrate.so=pam_krb5_migrate.so.1
+f usr/lib/security/amd64/pam_ldap.so.1 0755 root bin
+s usr/lib/security/amd64/pam_ldap.so=pam_ldap.so.1
+f usr/lib/security/amd64/pam_list.so.1 0755 root bin
+s usr/lib/security/amd64/pam_list.so=pam_list.so.1
+f usr/lib/security/amd64/pam_passwd_auth.so.1 0755 root bin
+s usr/lib/security/amd64/pam_passwd_auth.so=pam_passwd_auth.so.1
+f usr/lib/security/amd64/pam_rhosts_auth.so.1 0755 root bin
+s usr/lib/security/amd64/pam_rhosts_auth.so=pam_rhosts_auth.so.1
+f usr/lib/security/amd64/pam_roles.so.1 0755 root bin
+s usr/lib/security/amd64/pam_roles.so=pam_roles.so.1
+f usr/lib/security/amd64/pam_sample.so.1 0755 root bin
+s usr/lib/security/amd64/pam_sample.so=pam_sample.so.1
+f usr/lib/security/amd64/pam_smbfs_login.so.1 0755 root bin
+s usr/lib/security/amd64/pam_smbfs_login.so=pam_smbfs_login.so.1
+f usr/lib/security/amd64/pam_unix_account.so.1 0755 root bin
+s usr/lib/security/amd64/pam_unix_account.so=pam_unix_account.so.1
+f usr/lib/security/amd64/pam_unix_auth.so.1 0755 root bin
+s usr/lib/security/amd64/pam_unix_auth.so=pam_unix_auth.so.1
+f usr/lib/security/amd64/pam_unix_cred.so.1 0755 root bin
+s usr/lib/security/amd64/pam_unix_cred.so=pam_unix_cred.so.1
+f usr/lib/security/amd64/pam_unix_session.so.1 0755 root bin
+s usr/lib/security/amd64/pam_unix_session.so=pam_unix_session.so.1
+f usr/lib/security/amd64/pkcs11_kernel.so.1 0755 root bin
+s usr/lib/security/amd64/pkcs11_kernel.so=pkcs11_kernel.so.1
+f usr/lib/security/amd64/pkcs11_softtoken.so.1 0755 root bin
+s usr/lib/security/amd64/pkcs11_softtoken.so=pkcs11_softtoken.so.1
+f usr/lib/security/audit_binfile.so.1 0755 root bin
+s usr/lib/security/audit_binfile.so=audit_binfile.so.1
+f usr/lib/security/audit_remote.so.1 0755 root bin
+s usr/lib/security/audit_remote.so=audit_remote.so.1
+f usr/lib/security/audit_syslog.so.1 0755 root bin
+s usr/lib/security/audit_syslog.so=audit_syslog.so.1
+f usr/lib/security/crypt_bsdbf.so.1 0755 root bin
+s usr/lib/security/crypt_bsdbf.so=crypt_bsdbf.so.1
+f usr/lib/security/crypt_bsdmd5.so.1 0755 root bin
+s usr/lib/security/crypt_bsdmd5.so=crypt_bsdmd5.so.1
+f usr/lib/security/crypt_sha256.so.1 0755 root bin
+s usr/lib/security/crypt_sha256.so=crypt_sha256.so.1
+f usr/lib/security/crypt_sha512.so.1 0755 root bin
+s usr/lib/security/crypt_sha512.so=crypt_sha512.so.1
+f usr/lib/security/crypt_sunmd5.so.1 0755 root bin
+s usr/lib/security/crypt_sunmd5.so=crypt_sunmd5.so.1
+f usr/lib/security/pam_allow.so.1 0755 root bin
+s usr/lib/security/pam_allow.so=pam_allow.so.1
+f usr/lib/security/pam_authtok_check.so.1 0755 root bin
+s usr/lib/security/pam_authtok_check.so=pam_authtok_check.so.1
+f usr/lib/security/pam_authtok_get.so.1 0755 root bin
+s usr/lib/security/pam_authtok_get.so=pam_authtok_get.so.1
+f usr/lib/security/pam_authtok_store.so.1 0755 root bin
+s usr/lib/security/pam_authtok_store.so=pam_authtok_store.so.1
+f usr/lib/security/pam_deny.so.1 0755 root bin
+s usr/lib/security/pam_deny.so=pam_deny.so.1
+f usr/lib/security/pam_dhkeys.so.1 0755 root bin
+s usr/lib/security/pam_dhkeys.so=pam_dhkeys.so.1
+f usr/lib/security/pam_dial_auth.so.1 0755 root bin
+s usr/lib/security/pam_dial_auth.so=pam_dial_auth.so.1
+f usr/lib/security/pam_krb5.so.1 0755 root bin
+s usr/lib/security/pam_krb5.so=pam_krb5.so.1
+f usr/lib/security/pam_krb5_first 0444 root bin
+f usr/lib/security/pam_krb5_migrate.so.1 0755 root bin
+s usr/lib/security/pam_krb5_migrate.so=pam_krb5_migrate.so.1
+f usr/lib/security/pam_krb5_only 0444 root bin
+f usr/lib/security/pam_krb5_optional 0444 root bin
+f usr/lib/security/pam_ldap.so.1 0755 root bin
+s usr/lib/security/pam_ldap.so=pam_ldap.so.1
+f usr/lib/security/pam_list.so.1 0755 root bin
+s usr/lib/security/pam_list.so=pam_list.so.1
+f usr/lib/security/pam_passwd_auth.so.1 0755 root bin
+s usr/lib/security/pam_passwd_auth.so=pam_passwd_auth.so.1
+f usr/lib/security/pam_rhosts_auth.so.1 0755 root bin
+s usr/lib/security/pam_rhosts_auth.so=pam_rhosts_auth.so.1
+f usr/lib/security/pam_roles.so.1 0755 root bin
+s usr/lib/security/pam_roles.so=pam_roles.so.1
+f usr/lib/security/pam_sample.so.1 0755 root bin
+s usr/lib/security/pam_sample.so=pam_sample.so.1
+f usr/lib/security/pam_smb_passwd.so.1 0755 root bin
+s usr/lib/security/pam_smb_passwd.so=pam_smb_passwd.so.1
+f usr/lib/security/pam_smbfs_login.so.1 0755 root bin
+s usr/lib/security/pam_smbfs_login.so=pam_smbfs_login.so.1
+f usr/lib/security/pam_unix_account.so.1 0755 root bin
+s usr/lib/security/pam_unix_account.so=pam_unix_account.so.1
+f usr/lib/security/pam_unix_auth.so.1 0755 root bin
+s usr/lib/security/pam_unix_auth.so=pam_unix_auth.so.1
+f usr/lib/security/pam_unix_cred.so.1 0755 root bin
+s usr/lib/security/pam_unix_cred.so=pam_unix_cred.so.1
+f usr/lib/security/pam_unix_session.so.1 0755 root bin
+s usr/lib/security/pam_unix_session.so=pam_unix_session.so.1
+f usr/lib/security/pkcs11_kernel.so.1 0755 root bin
+s usr/lib/security/pkcs11_kernel.so=pkcs11_kernel.so.1
+f usr/lib/security/pkcs11_softtoken.so.1 0755 root bin
+s usr/lib/security/pkcs11_softtoken.so=pkcs11_softtoken.so.1
+f usr/lib/sendmail 2555 root smmsp
+f usr/lib/servinfo 0555 root bin
+f usr/lib/set_keyboard_layout 0555 root bin
+d usr/lib/smbfs 0755 root bin
+f usr/lib/smbfs/smbiod 0555 root bin
+f usr/lib/smbfs/smbiod-svc 0555 root bin
+d usr/lib/smbsrv 0755 root bin
+d usr/lib/smbsrv/amd64 0755 root bin
+f usr/lib/smbsrv/amd64/libmlrpc.so.1 0755 root bin
+s usr/lib/smbsrv/amd64/libmlrpc.so=libmlrpc.so.1
+f usr/lib/smbsrv/amd64/libmlsvc.so.1 0755 root bin
+s usr/lib/smbsrv/amd64/libmlsvc.so=libmlsvc.so.1
+f usr/lib/smbsrv/amd64/libsmb.so.1 0755 root bin
+s usr/lib/smbsrv/amd64/libsmb.so=libsmb.so.1
+f usr/lib/smbsrv/amd64/libsmbns.so.1 0755 root bin
+s usr/lib/smbsrv/amd64/libsmbns.so=libsmbns.so.1
+d usr/lib/smbsrv/dtrace 0755 root bin
+f usr/lib/smbsrv/libmlrpc.so.1 0755 root bin
+s usr/lib/smbsrv/libmlrpc.so=libmlrpc.so.1
+f usr/lib/smbsrv/libmlsvc.so.1 0755 root bin
+s usr/lib/smbsrv/libmlsvc.so=libmlsvc.so.1
+f usr/lib/smbsrv/libsmb.so.1 0755 root bin
+s usr/lib/smbsrv/libsmb.so=libsmb.so.1
+f usr/lib/smbsrv/libsmbns.so.1 0755 root bin
+s usr/lib/smbsrv/libsmbns.so=libsmbns.so.1
+f usr/lib/smbsrv/libsqlite.so.1 0755 root bin
+s usr/lib/smbsrv/libsqlite.so=libsqlite.so.1
+f usr/lib/smbsrv/smbd 0755 root bin
+d usr/lib/smedia 0755 root bin
+d usr/lib/smedia/amd64 0755 root bin
+f usr/lib/smedia/amd64/sm_blkdev.so.1 0555 root bin
+f usr/lib/smedia/amd64/sm_fd.so.1 0555 root bin
+f usr/lib/smedia/amd64/sm_scsi.so.1 0555 root bin
+f usr/lib/smedia/rpc.smserverd 0555 root bin
+f usr/lib/smedia/sm_blkdev.so.1 0555 root bin
+f usr/lib/smedia/sm_fd.so.1 0555 root bin
+f usr/lib/smedia/sm_scsi.so.1 0555 root bin
+f usr/lib/smrsh 0555 root bin
+f usr/lib/sndrd 0555 root bin
+f usr/lib/sndrsyncd 0555 root bin
+f usr/lib/sngl_brand.so.1 0755 root bin
+d usr/lib/snmp 0755 root bin
+d usr/lib/spell 0755 root bin
+f usr/lib/spell/compress 0555 root bin
+f usr/lib/spell/hashcheck 0555 root bin
+f usr/lib/spell/hashmake 0555 root bin
+f usr/lib/spell/hlista 0644 root bin
+f usr/lib/spell/hlistb 0644 root bin
+f usr/lib/spell/hstop 0644 root bin
+f usr/lib/spell/spellin 0555 root bin
+f usr/lib/spell/spellprog 0555 root bin
+d usr/lib/ssh 0755 root bin
+f usr/lib/ssh/sftp-server 0555 root bin
+f usr/lib/ssh/ssh-askpass 0555 root bin
+f usr/lib/ssh/ssh-http-proxy-connect 0555 root bin
+f usr/lib/ssh/ssh-keysign 4555 root bin
+f usr/lib/ssh/ssh-socks5-proxy-connect 0555 root bin
+f usr/lib/ssh/sshd 0555 root bin
+f usr/lib/straddr.so.2 0755 root bin
+s usr/lib/straddr.so=straddr.so.2
+s usr/lib/sunw,rcp=../bin/rcp
+d usr/lib/sysevent 0755 root bin
+d usr/lib/sysevent/modules 0755 root bin
+f usr/lib/sysevent/modules/datalink_mod.so 0755 root bin
+f usr/lib/sysevent/modules/devfsadmd_mod.so 0755 root bin
+f usr/lib/sysevent/modules/picl_slm.so 0755 root bin
+f usr/lib/sysevent/modules/sysevent_conf_mod.so 0755 root bin
+f usr/lib/sysevent/modules/sysevent_reg_mod.so 0755 root bin
+f usr/lib/sysevent/modules/zfs_mod.so 0755 root bin
+f usr/lib/sysevent/syseventconfd 0555 root bin
+f usr/lib/sysevent/syseventd 0555 root bin
+s usr/lib/tabset=../share/lib/tabset
+f usr/lib/th_script 0555 root bin
+s usr/lib/tmac=../share/lib/tmac
+f usr/lib/udapl_tavor.so.1 0755 root bin
+f usr/lib/utmp_update 4555 root bin
+f usr/lib/utmpd 0555 root bin
+f usr/lib/values-Xa.o 0644 root bin
+f usr/lib/values-Xc.o 0644 root bin
+f usr/lib/values-Xs.o 0644 root bin
+f usr/lib/values-Xt.o 0644 root bin
+f usr/lib/values-xpg4.o 0644 root bin
+f usr/lib/values-xpg6.o 0644 root bin
+f usr/lib/vfontedpr 0555 root bin
+f usr/lib/vgrindefs 0444 root bin
+d usr/lib/vscan 0755 root bin
+f usr/lib/vscan/libvscan.so.1 0755 root bin
+s usr/lib/vscan/libvscan.so=libvscan.so.1
+f usr/lib/vscan/vscand 0555 root bin
+f usr/lib/vtdaemon 0555 root bin
+f usr/lib/vtinfo 0555 root bin
+f usr/lib/vtxlock 0555 root bin
+f usr/lib/watchmalloc.so.1 0755 root bin
+s usr/lib/wusbd=../../sbin/wusbadm
+d usr/lib/zfs 0755 root bin
+f usr/lib/zfs/availdevs 0555 root bin
+d usr/lib/zones 0755 root bin
+d usr/lib/zones/amd64 0755 root bin
+f usr/lib/zones/amd64/zoneadmd 0555 root bin
+d usr/lib/zones/i86 0755 root bin
+h usr/lib/zones/zoneadmd=usr/lib/isaexec
+f usr/lib/zones/zoneshare 0555 root bin
+f usr/lib/zones/zoneunshare 0555 root bin
+d usr/libexec 07555 root bin
+d usr/local 0755 root root
+s usr/mail=../var/mail
+s usr/man=share/man
+d usr/net 0755 root sys
+d usr/net/nls 0755 root sys
+s usr/net/nls/listen=../../lib/saf/listen
+s usr/net/nls/nlps_server=../../lib/saf/nlps_server
+d usr/net/servers 0755 root sys
+s usr/news=../var/news
+d usr/perl5 0755 root bin
+d usr/perl5/5.12 0755 root bin
+d usr/perl5/5.12/bin 0755 root bin
+f usr/perl5/5.12/bin/perlgcc 0555 root bin
+d usr/perl5/5.12/lib 0755 root bin
+d usr/perl5/5.12/lib/Sun 0755 root bin
+d usr/perl5/5.12/lib/Sun/Solaris 0755 root bin
+d usr/perl5/5.12/lib/Sun/Solaris/BSM 0755 root bin
+f usr/perl5/5.12/lib/Sun/Solaris/BSM/_BSMparse.pm 0444 root bin
+d usr/perl5/5.12/lib/Sun/Solaris/PerlGcc 0755 root bin
+f usr/perl5/5.12/lib/Sun/Solaris/PerlGcc/Config.pm 0444 root bin
+f usr/perl5/5.12/lib/Sun/Solaris/Pg.pm 0444 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/Sun 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Exacct 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Exacct.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Exacct/Catalog.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Exacct/File.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Exacct/Object.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Intrs.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Kstat.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Lgrp.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Privilege.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Project.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Task.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Ucred.pm 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/Sun/Solaris/Utils.pm 0444 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/BSM 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/BSM/_BSMparse 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Catalog 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Catalog/Catalog.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Catalog/Catalog.so 0555 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Exacct.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Exacct.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/File 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/File/File.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/File/File.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Object 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Object/Object.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Exacct/Object/Object.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Intrs 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Intrs/Intrs.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Intrs/Intrs.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Kstat 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Kstat/Kstat.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Kstat/Kstat.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Lgrp 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Lgrp/Lgrp.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Lgrp/Lgrp.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/PerlGcc 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Pg 0755 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Privilege 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Privilege/Privilege.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Privilege/Privilege.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Project 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Project/Project.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Project/Project.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Task 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Task/Task.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Task/Task.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Ucred 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Ucred/Ucred.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Ucred/Ucred.so 0555 root bin
+d usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Utils 0755 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Utils/Utils.bs 0444 root bin
+f usr/perl5/5.12/lib/i86pc-solaris-64int/auto/Sun/Solaris/Utils/Utils.so 0555 root bin
+d usr/platform 0755 root sys
+d usr/platform/i86pc 0755 root sys
+d usr/platform/i86pc/lib 0755 root sys
+d usr/platform/i86pc/lib/fm 0755 root sys
+d usr/platform/i86pc/lib/fm/eft 0755 root sys
+f usr/platform/i86pc/lib/fm/eft/amd64.eft 0444 root sys
+f usr/platform/i86pc/lib/fm/eft/gcpu.eft 0444 root sys
+f usr/platform/i86pc/lib/fm/eft/gcpu_amd.eft 0444 root sys
+f usr/platform/i86pc/lib/fm/eft/intel.eft 0444 root sys
+d usr/platform/i86pc/lib/fm/topo 0755 root sys
+d usr/platform/i86pc/lib/fm/topo/maps 0755 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/Joyent-Compute-Platform-1101-disk-hc-topology.xml 0444 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/chassis-hc-topology.xml 0444 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/chip-hc-topology.xml 0444 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/fan-hc-topology.xml 0444 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/i86pc-hc-topology.xml 0444 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/i86pc-legacy-hc-topology.xml 0444 root sys
+f usr/platform/i86pc/lib/fm/topo/maps/psu-hc-topology.xml 0444 root sys
+d usr/platform/i86pc/lib/fm/topo/plugins 0755 root sys
+f usr/platform/i86pc/lib/fm/topo/plugins/chip.so 0555 root sys
+f usr/platform/i86pc/lib/fm/topo/plugins/hostbridge.so 0555 root sys
+f usr/platform/i86pc/lib/fm/topo/plugins/pcibus.so 0555 root sys
+f usr/platform/i86pc/lib/fm/topo/plugins/x86pi.so 0555 root sys
+d usr/platform/i86pc/lib/mdb 0755 root sys
+d usr/platform/i86pc/lib/mdb/kvm 0755 root sys
+d usr/platform/i86pc/lib/mdb/kvm/amd64 0755 root sys
+f usr/platform/i86pc/lib/mdb/kvm/amd64/apix.so 0555 root sys
+f usr/platform/i86pc/lib/mdb/kvm/amd64/pcplusmp.so 0555 root sys
+f usr/platform/i86pc/lib/mdb/kvm/amd64/unix.so 0555 root sys
+f usr/platform/i86pc/lib/mdb/kvm/amd64/uppc.so 0555 root sys
+s usr/preserve=../var/preserve
+d usr/proc 0755 root bin
+d usr/proc/bin 0755 root bin
+s usr/proc/bin/pcred=../../bin/pcred
+s usr/proc/bin/pfiles=../../bin/pfiles
+s usr/proc/bin/pflags=../../bin/pflags
+s usr/proc/bin/pldd=../../bin/pldd
+s usr/proc/bin/pmap=../../bin/pmap
+s usr/proc/bin/prun=../../bin/prun
+s usr/proc/bin/psig=../../bin/psig
+s usr/proc/bin/pstack=../../bin/pstack
+s usr/proc/bin/pstop=../../bin/pstop
+s usr/proc/bin/ptime=../../bin/ptime
+s usr/proc/bin/ptree=../../bin/ptree
+s usr/proc/bin/pwait=../../bin/pwait
+s usr/proc/bin/pwdx=../../bin/pwdx
+s usr/pub=share/lib/pub
+d usr/sadm 0755 root bin
+d usr/sadm/bin 0755 root bin
+h usr/sadm/bin/dispgid=usr/bin/ckgid
+h usr/sadm/bin/dispuid=usr/bin/ckuid
+h usr/sadm/bin/errange=usr/bin/ckrange
+h usr/sadm/bin/errdate=usr/bin/ckdate
+h usr/sadm/bin/errgid=usr/bin/ckgid
+h usr/sadm/bin/errint=usr/bin/ckint
+h usr/sadm/bin/erritem=usr/bin/ckitem
+h usr/sadm/bin/errpath=usr/bin/ckpath
+h usr/sadm/bin/errstr=usr/bin/ckstr
+h usr/sadm/bin/errtime=usr/bin/cktime
+h usr/sadm/bin/erruid=usr/bin/ckuid
+h usr/sadm/bin/erryorn=usr/bin/ckyorn
+h usr/sadm/bin/helpdate=usr/bin/ckdate
+h usr/sadm/bin/helpgid=usr/bin/ckgid
+h usr/sadm/bin/helpint=usr/bin/ckint
+h usr/sadm/bin/helpitem=usr/bin/ckitem
+h usr/sadm/bin/helppath=usr/bin/ckpath
+h usr/sadm/bin/helprange=usr/bin/ckrange
+h usr/sadm/bin/helpstr=usr/bin/ckstr
+h usr/sadm/bin/helptime=usr/bin/cktime
+h usr/sadm/bin/helpuid=usr/bin/ckuid
+h usr/sadm/bin/helpyorn=usr/bin/ckyorn
+f usr/sadm/bin/puttext 0555 root bin
+h usr/sadm/bin/valdate=usr/bin/ckdate
+h usr/sadm/bin/valgid=usr/bin/ckgid
+h usr/sadm/bin/valint=usr/bin/ckint
+h usr/sadm/bin/valpath=usr/bin/ckpath
+h usr/sadm/bin/valrange=usr/bin/ckrange
+h usr/sadm/bin/valstr=usr/bin/ckstr
+h usr/sadm/bin/valtime=usr/bin/cktime
+h usr/sadm/bin/valuid=usr/bin/ckuid
+h usr/sadm/bin/valyorn=usr/bin/ckyorn
+d usr/sadm/install 0755 root bin
+d usr/sadm/install/scripts 0755 root bin
+f usr/sadm/install/scripts/i.ipsecalgs 0555 root sys
+f usr/sadm/install/scripts/i.kcfconf 0555 root sys
+f usr/sadm/install/scripts/i.kmfconf 0555 root sys
+f usr/sadm/install/scripts/i.manifest 0555 root sys
+f usr/sadm/install/scripts/i.pkcs11conf 0555 root sys
+f usr/sadm/install/scripts/i.rbac 0555 root sys
+f usr/sadm/install/scripts/r.ipsecalgs 0555 root sys
+f usr/sadm/install/scripts/r.kcfconf 0555 root sys
+f usr/sadm/install/scripts/r.kmfconf 0555 root sys
+f usr/sadm/install/scripts/r.manifest 0555 root sys
+f usr/sadm/install/scripts/r.pkcs11conf 0555 root sys
+f usr/sadm/install/scripts/r.rbac 0555 root sys
+d usr/sadm/sysadm 0755 root bin
+d usr/sadm/sysadm/add-ons 0755 root bin
+d usr/sadm/sysadm/bin 0755 root bin
+f usr/sadm/ugdates 0444 root bin
+d usr/sbin 0755 root bin
+f usr/sbin/6to4relay 0555 root bin
+f usr/sbin/acctadm 0555 root bin
+h usr/sbin/add_drv=usr/lib/isaexec
+f usr/sbin/allocate 4555 root bin
+d usr/sbin/amd64 0755 root bin
+f usr/sbin/amd64/add_drv 0555 root sys
+f usr/sbin/amd64/dtrace 0555 root bin
+f usr/sbin/amd64/intrstat 0555 root bin
+f usr/sbin/amd64/ipf 0555 root bin
+f usr/sbin/amd64/ipfs 0555 root bin
+f usr/sbin/amd64/ipfstat 0555 root bin
+f usr/sbin/amd64/ipmon 0555 root bin
+f usr/sbin/amd64/ipnat 0555 root bin
+f usr/sbin/amd64/ippool 0555 root bin
+f usr/sbin/amd64/lockstat 0555 root bin
+f usr/sbin/amd64/modinfo 0555 root sys
+f usr/sbin/amd64/modload 0555 root sys
+f usr/sbin/amd64/modunload 0555 root sys
+f usr/sbin/amd64/pbind 0555 root sys
+f usr/sbin/amd64/plockstat 0555 root bin
+f usr/sbin/amd64/prtconf 2555 root sys
+f usr/sbin/amd64/psrset 0555 root sys
+f usr/sbin/amd64/rem_drv 0555 root sys
+f usr/sbin/amd64/swap 2555 root sys
+f usr/sbin/amd64/sysdef 2555 root sys
+f usr/sbin/amd64/update_drv 0555 root sys
+f usr/sbin/amd64/whodo 4555 root bin
+f usr/sbin/amd64/zdb 0555 root bin
+f usr/sbin/arp 0555 root bin
+f usr/sbin/audit 0555 root bin
+f usr/sbin/auditconfig 0555 root bin
+f usr/sbin/auditd 0555 root bin
+f usr/sbin/auditrecord 0555 root bin
+f usr/sbin/auditreduce 0555 root bin
+f usr/sbin/auditstat 0555 root bin
+h usr/sbin/audlinks=usr/sbin/devfsadm
+s usr/sbin/automount=../lib/fs/autofs/automount
+s usr/sbin/autopush=../../sbin/autopush
+f usr/sbin/cfgadm 0555 root bin
+f usr/sbin/check-hostname 0555 root mail
+f usr/sbin/check-permissions 0555 root mail
+f usr/sbin/chk_encodings 0555 root sys
+f usr/sbin/chroot 0555 root bin
+f usr/sbin/clear_locks 0555 root bin
+f usr/sbin/clinfo 0555 root bin
+f usr/sbin/clri 0555 root bin
+f usr/sbin/consadm 0555 root sys
+f usr/sbin/consadmd 0555 root sys
+f usr/sbin/cpustat 0555 root bin
+f usr/sbin/cron 0555 root sys
+s usr/sbin/cryptoadm=../../sbin/cryptoadm
+s usr/sbin/dcopy=clri
+h usr/sbin/deallocate=usr/sbin/allocate
+f usr/sbin/devfsadm 0755 root sys
+f usr/sbin/devinfo 0555 root bin
+h usr/sbin/devlinks=usr/sbin/devfsadm
+s usr/sbin/devnm=df
+f usr/sbin/df 0555 root bin
+f usr/sbin/dfmounts 0555 root bin
+h usr/sbin/dfshares=usr/sbin/dfmounts
+h usr/sbin/disks=usr/sbin/devfsadm
+f usr/sbin/dispadmin 0555 root bin
+s usr/sbin/dladm=../../sbin/dladm
+s usr/sbin/dlstat=../../sbin/dlstat
+f usr/sbin/dmesg 0555 root bin
+f usr/sbin/dminfo 0555 root bin
+h usr/sbin/drvconfig=usr/sbin/devfsadm
+h usr/sbin/dtrace=usr/lib/isaexec
+f usr/sbin/dumpadm 0555 root bin
+f usr/sbin/editmap 0555 root bin
+s usr/sbin/edquota=../lib/fs/ufs/edquota
+f usr/sbin/eeprom 2555 root sys
+f usr/sbin/etrn 0555 root bin
+f usr/sbin/exportfs 0555 root bin
+f usr/sbin/fcadm 0555 root bin
+h usr/sbin/fcinfo=usr/sbin/fcadm
+s usr/sbin/fdisk=../../sbin/fdisk
+f usr/sbin/ff 0555 root bin
+s usr/sbin/fiocompress=../../sbin/fiocompress
+s usr/sbin/flowadm=../../sbin/flowadm
+s usr/sbin/flowstat=../../sbin/flowstat
+f usr/sbin/fmadm 0555 root bin
+f usr/sbin/fmdump 0555 root bin
+f usr/sbin/fmstat 0555 root bin
+f usr/sbin/fmthard 0555 root sys
+f usr/sbin/format 0555 root bin
+f usr/sbin/fsck 0555 root bin
+s usr/sbin/fsdb=clri
+s usr/sbin/fsirand=../lib/fs/ufs/fsirand
+s usr/sbin/fssnap=clri
+f usr/sbin/fstyp 0555 root sys
+f usr/sbin/ftpaddhost 0555 root bin
+f usr/sbin/ftpconfig 0555 root bin
+f usr/sbin/ftpcount 0555 root bin
+f usr/sbin/ftprestart 0555 root bin
+f usr/sbin/ftpshut 0555 root bin
+h usr/sbin/ftpwho=usr/sbin/ftpcount
+f usr/sbin/fuser 0555 root bin
+f usr/sbin/fwflash 0555 root bin
+f usr/sbin/getdevpolicy 0555 root sys
+f usr/sbin/getmajor 0755 root sys
+f usr/sbin/gettable 0555 root bin
+f usr/sbin/groupadd 0555 root sys
+f usr/sbin/groupdel 0555 root sys
+f usr/sbin/groupmod 0555 root sys
+f usr/sbin/grpck 0555 root bin
+f usr/sbin/grub 0555 root bin
+f usr/sbin/gsscred 0555 root sys
+f usr/sbin/halt 0755 root bin
+s usr/sbin/hostconfig=../../sbin/hostconfig
+f usr/sbin/hotplug 0555 root bin
+f usr/sbin/htable 0555 root bin
+d usr/sbin/i86 0755 root bin
+f usr/sbin/idmap 0555 root bin
+f usr/sbin/if_mpadm 0555 root bin
+s usr/sbin/ifconfig=../../sbin/ifconfig
+f usr/sbin/ikeadm 0555 root bin
+f usr/sbin/ikecert 0555 root bin
+f usr/sbin/ilbadm 0555 root bin
+f usr/sbin/in.comsat 0555 root bin
+f usr/sbin/in.fingerd 0555 root bin
+f usr/sbin/in.ftpd 0555 root bin
+f usr/sbin/in.rdisc 0555 root bin
+f usr/sbin/in.rexecd 0555 root bin
+f usr/sbin/in.rlogind 0555 root bin
+f usr/sbin/in.routed 0555 root bin
+f usr/sbin/in.rshd 0555 root bin
+f usr/sbin/in.rwhod 0555 root bin
+f usr/sbin/in.talkd 0555 root bin
+f usr/sbin/in.telnetd 0555 root bin
+f usr/sbin/in.tftpd 0555 root bin
+f usr/sbin/inetadm 0555 root bin
+f usr/sbin/inetconv 0555 root bin
+s usr/sbin/inetd=../lib/inet/inetd
+s usr/sbin/init=../../sbin/init
+f usr/sbin/install 0555 root bin
+f usr/sbin/installboot 0555 root sys
+s usr/sbin/installgrub=../../sbin/installgrub
+h usr/sbin/intrstat=usr/lib/isaexec
+f usr/sbin/ipaddrsel 0555 root bin
+s usr/sbin/ipadm=../../sbin/ipadm
+f usr/sbin/ipdadm 0555 root bin
+h usr/sbin/ipf=usr/lib/isaexec
+h usr/sbin/ipfs=usr/lib/isaexec
+h usr/sbin/ipfstat=usr/lib/isaexec
+h usr/sbin/ipmon=usr/lib/isaexec
+s usr/sbin/ipmpstat=../../sbin/ipmpstat
+h usr/sbin/ipnat=usr/lib/isaexec
+h usr/sbin/ippool=usr/lib/isaexec
+f usr/sbin/ipsecalgs 0555 root bin
+f usr/sbin/ipsecconf 0555 root bin
+f usr/sbin/ipseckey 0555 root bin
+f usr/sbin/iscsiadm 0555 root bin
+f usr/sbin/itadm 0555 root bin
+f usr/sbin/keyserv 0555 root sys
+f usr/sbin/killall 0555 root bin
+f usr/sbin/ksslcfg 0555 root bin
+s usr/sbin/labelit=clri
+f usr/sbin/ldapaddent 0555 root bin
+f usr/sbin/ldapclient 0555 root bin
+f usr/sbin/link 0555 root bin
+h usr/sbin/list_devices=usr/sbin/allocate
+f usr/sbin/locator 0555 root bin
+s usr/sbin/lockfs=../lib/fs/ufs/lockfs
+h usr/sbin/lockstat=usr/lib/isaexec
+f usr/sbin/lofiadm 0555 root bin
+f usr/sbin/logadm 0555 root bin
+f usr/sbin/makedbm 0555 root bin
+f usr/sbin/makemap 0555 root bin
+f usr/sbin/mkdevalloc 0555 root bin
+h usr/sbin/mkdevmaps=usr/sbin/mkdevalloc
+f usr/sbin/mkfile 0555 root bin
+s usr/sbin/mkfs=clri
+f usr/sbin/mknod 0555 root bin
+h usr/sbin/modinfo=usr/lib/isaexec
+h usr/sbin/modload=usr/lib/isaexec
+h usr/sbin/modunload=usr/lib/isaexec
+s usr/sbin/mount=../../sbin/mount
+f usr/sbin/mountall 0555 root sys
+f usr/sbin/mpathadm 0555 root bin
+f usr/sbin/msgid 0555 root bin
+f usr/sbin/mvdir 0555 root bin
+s usr/sbin/ncheck=ff
+f usr/sbin/ndd 0555 root bin
+s usr/sbin/newaliases=../lib/sendmail
+s usr/sbin/newfs=../lib/fs/ufs/newfs
+f usr/sbin/newkey 0555 root sys
+f usr/sbin/nfsref 0555 root bin
+f usr/sbin/nlsadmin 0755 root adm
+f usr/sbin/nscd 0555 root bin
+f usr/sbin/nwamadm 0555 root bin
+f usr/sbin/nwamcfg 0555 root bin
+h usr/sbin/pbind=usr/lib/isaexec
+f usr/sbin/pcitool 0555 root bin
+f usr/sbin/ping 4555 root bin
+h usr/sbin/plockstat=usr/lib/isaexec
+f usr/sbin/pmadm 0555 root sys
+f usr/sbin/pmconfig 4555 root bin
+f usr/sbin/pooladm 0555 root bin
+f usr/sbin/poolbind 0555 root bin
+f usr/sbin/poolcfg 0555 root bin
+h usr/sbin/ports=usr/sbin/devfsadm
+h usr/sbin/poweroff=usr/sbin/halt
+f usr/sbin/praudit 0555 root bin
+f usr/sbin/privatepw 0555 root bin
+f usr/sbin/projadd 0555 root sys
+f usr/sbin/projdel 0555 root sys
+f usr/sbin/projmod 0555 root sys
+h usr/sbin/prtconf=usr/lib/isaexec
+f usr/sbin/prtdiag 2755 root sys
+f usr/sbin/prtpicl 0755 root bin
+f usr/sbin/prtvtoc 0555 root sys
+f usr/sbin/psradm 0555 root sys
+f usr/sbin/psrinfo 0555 root sys
+h usr/sbin/psrset=usr/lib/isaexec
+f usr/sbin/pwck 0555 root bin
+f usr/sbin/pwconv 0555 root sys
+s usr/sbin/quot=../lib/fs/ufs/quot
+s usr/sbin/quota=../lib/fs/ufs/quota
+s usr/sbin/quotacheck=../lib/fs/ufs/quotacheck
+s usr/sbin/quotaoff=../lib/fs/ufs/quotaoff
+s usr/sbin/quotaon=../lib/fs/ufs/quotaon
+f usr/sbin/raidctl 0555 root bin
+f usr/sbin/ramdiskadm 0555 root bin
+f usr/sbin/rcapadm 0555 root bin
+f usr/sbin/rctladm 0555 root bin
+h usr/sbin/reboot=usr/sbin/halt
+h usr/sbin/rem_drv=usr/lib/isaexec
+s usr/sbin/repquota=../lib/fs/ufs/repquota
+f usr/sbin/rmt 0555 root bin
+f usr/sbin/roleadd 0555 root sys
+f usr/sbin/roledel 0555 root sys
+f usr/sbin/rolemod 0555 root sys
+s usr/sbin/route=../../sbin/route
+s usr/sbin/routeadm=../../sbin/routeadm
+f usr/sbin/rpc.rexd 0555 root bin
+f usr/sbin/rpcbind 0555 root bin
+f usr/sbin/rtc 0555 root bin
+f usr/sbin/rtquery 0555 root bin
+f usr/sbin/rwall 0555 root bin
+f usr/sbin/sacadm 4755 root sys
+f usr/sbin/safe_finger 0555 root bin
+f usr/sbin/sbdadm 0555 root bin
+s usr/sbin/sendmail=../lib/sendmail
+f usr/sbin/setmnt 0555 root bin
+h usr/sbin/share=usr/sbin/sharemgr
+f usr/sbin/shareall 0555 root bin
+f usr/sbin/sharectl 0555 root bin
+f usr/sbin/sharemgr 0555 root bin
+s usr/sbin/showmount=../lib/fs/nfs/showmount
+f usr/sbin/shutdown 0755 root sys
+f usr/sbin/smbadm 0555 root bin
+f usr/sbin/smbios 0555 root bin
+f usr/sbin/smbstat 0555 root bin
+f usr/sbin/snoop 0555 root bin
+f usr/sbin/sppptun 0555 root bin
+f usr/sbin/spray 0555 root bin
+f usr/sbin/stmfadm 0555 root bin
+f usr/sbin/stmsboot 0555 root bin
+f usr/sbin/strace 0555 root sys
+f usr/sbin/strclean 0555 root sys
+f usr/sbin/strerr 0555 root sys
+f usr/sbin/sttydefs 0755 root sys
+s usr/sbin/svcadm=../../sbin/svcadm
+f usr/sbin/svccfg 0555 root bin
+h usr/sbin/swap=usr/lib/isaexec
+s usr/sbin/sync=../../sbin/sync
+f usr/sbin/syncinit 0555 root bin
+f usr/sbin/syncloop 0555 root bin
+f usr/sbin/syncstat 0555 root bin
+h usr/sbin/sysdef=usr/lib/isaexec
+f usr/sbin/syseventadm 0555 root sys
+f usr/sbin/sysidpm 0755 root sys
+f usr/sbin/syslogd 0555 root sys
+h usr/sbin/tapes=usr/sbin/devfsadm
+f usr/sbin/tar 0555 root bin
+f usr/sbin/tcpd 0555 root bin
+f usr/sbin/tcpdchk 0555 root bin
+f usr/sbin/tcpdmatch 0555 root bin
+f usr/sbin/traceroute 4555 root bin
+h usr/sbin/trapstat=usr/lib/platexec
+f usr/sbin/try-from 0555 root bin
+f usr/sbin/ttyadm 0755 root sys
+s usr/sbin/tunefs=../lib/fs/ufs/tunefs
+s usr/sbin/tzreload=../../sbin/tzreload
+s usr/sbin/uadmin=../../sbin/uadmin
+f usr/sbin/ucodeadm 0555 root bin
+s usr/sbin/ufsdump=../lib/fs/ufs/ufsdump
+s usr/sbin/ufsrestore=../lib/fs/ufs/ufsrestore
+s usr/sbin/umount=../../sbin/umount
+f usr/sbin/umountall 0555 root sys
+f usr/sbin/unlink 0555 root bin
+h usr/sbin/unshare=usr/sbin/sharemgr
+f usr/sbin/unshareall 0555 root bin
+h usr/sbin/update_drv=usr/lib/isaexec
+h usr/sbin/useradd=usr/sbin/roleadd
+h usr/sbin/userdel=usr/sbin/roledel
+h usr/sbin/usermod=usr/sbin/rolemod
+f usr/sbin/volcopy 0555 root bin
+f usr/sbin/vrrpadm 0555 root bin
+f usr/sbin/wall 2555 root tty
+h usr/sbin/whodo=usr/lib/isaexec
+s usr/sbin/wusbadm=../../sbin/wusbadm
+f usr/sbin/ypalias 0555 root bin
+f usr/sbin/ypinit 0555 root bin
+f usr/sbin/yppoll 0555 root bin
+f usr/sbin/ypset 0555 root bin
+h usr/sbin/zdb=usr/lib/isaexec
+f usr/sbin/zdump 0555 root bin
+s usr/sbin/zfs=../../sbin/zfs
+f usr/sbin/zic 0555 root bin
+f usr/sbin/zlogin 0555 root bin
+f usr/sbin/zoneadm 0555 root bin
+f usr/sbin/zonecfg 0555 root bin
+s usr/sbin/zpool=../../sbin/zpool
+f usr/sbin/zstreamdump 0555 root bin
+d usr/sfw 0755 root bin
+d usr/sfw/bin 0755 root bin
+d usr/sfw/bin/amd64 0755 root bin
+d usr/share 0755 root sys
+d usr/share/hwdata 0755 root sys
+f usr/share/hwdata/pci.ids 0444 root bin
+d usr/share/lib 0755 root sys
+d usr/share/lib/dict 0755 root bin
+f usr/share/lib/dict/words 0444 root bin
+d usr/share/lib/idn 0755 root sys
+d usr/share/lib/java 0755 root sys
+d usr/share/lib/keytables 0755 root bin
+d usr/share/lib/keytables/type_6 0755 root bin
+f usr/share/lib/keytables/type_6/albania 0444 root bin
+f usr/share/lib/keytables/type_6/arabia 0444 root bin
+f usr/share/lib/keytables/type_6/belarus 0444 root bin
+f usr/share/lib/keytables/type_6/belgium 0444 root bin
+f usr/share/lib/keytables/type_6/brazil 0444 root bin
+f usr/share/lib/keytables/type_6/bulgaria 0444 root bin
+f usr/share/lib/keytables/type_6/canadian_bilingual 0444 root bin
+f usr/share/lib/keytables/type_6/canadian_french 0444 root bin
+f usr/share/lib/keytables/type_6/croatia 0444 root bin
+f usr/share/lib/keytables/type_6/czech 0444 root bin
+f usr/share/lib/keytables/type_6/denmark 0444 root bin
+f usr/share/lib/keytables/type_6/dvorak 0444 root bin
+f usr/share/lib/keytables/type_6/estonia 0444 root bin
+f usr/share/lib/keytables/type_6/finnish 0444 root bin
+f usr/share/lib/keytables/type_6/france 0444 root bin
+f usr/share/lib/keytables/type_6/germany 0444 root bin
+f usr/share/lib/keytables/type_6/greece 0444 root bin
+f usr/share/lib/keytables/type_6/hungary 0444 root bin
+f usr/share/lib/keytables/type_6/iceland 0444 root bin
+f usr/share/lib/keytables/type_6/italy 0444 root bin
+f usr/share/lib/keytables/type_6/japan 0444 root bin
+f usr/share/lib/keytables/type_6/kbd_layouts 0444 root bin
+f usr/share/lib/keytables/type_6/korea 0444 root bin
+f usr/share/lib/keytables/type_6/latinamerica 0444 root bin
+f usr/share/lib/keytables/type_6/latvia 0444 root bin
+h usr/share/lib/keytables/type_6/layout_00=usr/share/lib/keytables/type_6/us
+h usr/share/lib/keytables/type_6/layout_01=usr/share/lib/keytables/type_6/arabia
+h usr/share/lib/keytables/type_6/layout_02=usr/share/lib/keytables/type_6/belgium
+h usr/share/lib/keytables/type_6/layout_03=usr/share/lib/keytables/type_6/canadian_bilingual
+h usr/share/lib/keytables/type_6/layout_04=usr/share/lib/keytables/type_6/canadian_french
+h usr/share/lib/keytables/type_6/layout_05=usr/share/lib/keytables/type_6/czech
+h usr/share/lib/keytables/type_6/layout_06=usr/share/lib/keytables/type_6/denmark
+h usr/share/lib/keytables/type_6/layout_07=usr/share/lib/keytables/type_6/finnish
+h usr/share/lib/keytables/type_6/layout_08=usr/share/lib/keytables/type_6/france
+h usr/share/lib/keytables/type_6/layout_09=usr/share/lib/keytables/type_6/germany
+h usr/share/lib/keytables/type_6/layout_0a=usr/share/lib/keytables/type_6/greece
+h usr/share/lib/keytables/type_6/layout_0c=usr/share/lib/keytables/type_6/hungary
+h usr/share/lib/keytables/type_6/layout_0e=usr/share/lib/keytables/type_6/italy
+h usr/share/lib/keytables/type_6/layout_0f=usr/share/lib/keytables/type_6/japan
+h usr/share/lib/keytables/type_6/layout_100=usr/share/lib/keytables/type_6/slovenia
+h usr/share/lib/keytables/type_6/layout_101=usr/share/lib/keytables/type_6/serbiaandmontenegro
+h usr/share/lib/keytables/type_6/layout_102=usr/share/lib/keytables/type_6/iceland
+h usr/share/lib/keytables/type_6/layout_103=usr/share/lib/keytables/type_6/croatia
+h usr/share/lib/keytables/type_6/layout_104=usr/share/lib/keytables/type_6/bulgaria
+h usr/share/lib/keytables/type_6/layout_105=usr/share/lib/keytables/type_6/belarus
+h usr/share/lib/keytables/type_6/layout_106=usr/share/lib/keytables/type_6/maltaus
+h usr/share/lib/keytables/type_6/layout_107=usr/share/lib/keytables/type_6/maltauk
+h usr/share/lib/keytables/type_6/layout_108=usr/share/lib/keytables/type_6/albania
+h usr/share/lib/keytables/type_6/layout_109=usr/share/lib/keytables/type_6/lithuania
+h usr/share/lib/keytables/type_6/layout_10=usr/share/lib/keytables/type_6/korea
+h usr/share/lib/keytables/type_6/layout_10a=usr/share/lib/keytables/type_6/latvia
+h usr/share/lib/keytables/type_6/layout_10b=usr/share/lib/keytables/type_6/macedonia
+h usr/share/lib/keytables/type_6/layout_10f=usr/share/lib/keytables/type_6/japan
+h usr/share/lib/keytables/type_6/layout_110=usr/share/lib/keytables/type_6/brazil
+h usr/share/lib/keytables/type_6/layout_111=usr/share/lib/keytables/type_6/dvorak
+h usr/share/lib/keytables/type_6/layout_112=usr/share/lib/keytables/type_6/estonia
+h usr/share/lib/keytables/type_6/layout_113=usr/share/lib/keytables/type_6/romania
+h usr/share/lib/keytables/type_6/layout_11=usr/share/lib/keytables/type_6/latinamerica
+h usr/share/lib/keytables/type_6/layout_12=usr/share/lib/keytables/type_6/netherlands
+h usr/share/lib/keytables/type_6/layout_13=usr/share/lib/keytables/type_6/norway
+h usr/share/lib/keytables/type_6/layout_15=usr/share/lib/keytables/type_6/poland
+h usr/share/lib/keytables/type_6/layout_16=usr/share/lib/keytables/type_6/portugal
+h usr/share/lib/keytables/type_6/layout_17=usr/share/lib/keytables/type_6/russia
+h usr/share/lib/keytables/type_6/layout_18=usr/share/lib/keytables/type_6/slovakia
+h usr/share/lib/keytables/type_6/layout_19=usr/share/lib/keytables/type_6/spain
+h usr/share/lib/keytables/type_6/layout_1a=usr/share/lib/keytables/type_6/sweden
+h usr/share/lib/keytables/type_6/layout_1b=usr/share/lib/keytables/type_6/swiss_french
+h usr/share/lib/keytables/type_6/layout_1c=usr/share/lib/keytables/type_6/swiss_german
+h usr/share/lib/keytables/type_6/layout_1e=usr/share/lib/keytables/type_6/traditional_chinese
+h usr/share/lib/keytables/type_6/layout_1f=usr/share/lib/keytables/type_6/turkeyq
+h usr/share/lib/keytables/type_6/layout_20=usr/share/lib/keytables/type_6/uk
+h usr/share/lib/keytables/type_6/layout_21=usr/share/lib/keytables/type_6/us
+h usr/share/lib/keytables/type_6/layout_23=usr/share/lib/keytables/type_6/turkeyf
+f usr/share/lib/keytables/type_6/lithuania 0444 root bin
+f usr/share/lib/keytables/type_6/macedonia 0444 root bin
+f usr/share/lib/keytables/type_6/maltauk 0444 root bin
+f usr/share/lib/keytables/type_6/maltaus 0444 root bin
+f usr/share/lib/keytables/type_6/netherlands 0444 root bin
+f usr/share/lib/keytables/type_6/norway 0444 root bin
+f usr/share/lib/keytables/type_6/poland 0444 root bin
+f usr/share/lib/keytables/type_6/portugal 0444 root bin
+f usr/share/lib/keytables/type_6/reset 0444 root bin
+f usr/share/lib/keytables/type_6/romania 0444 root bin
+f usr/share/lib/keytables/type_6/russia 0444 root bin
+f usr/share/lib/keytables/type_6/serbiaandmontenegro 0444 root bin
+f usr/share/lib/keytables/type_6/slovakia 0444 root bin
+f usr/share/lib/keytables/type_6/slovenia 0444 root bin
+f usr/share/lib/keytables/type_6/spain 0444 root bin
+f usr/share/lib/keytables/type_6/sweden 0444 root bin
+f usr/share/lib/keytables/type_6/swiss_french 0444 root bin
+f usr/share/lib/keytables/type_6/swiss_german 0444 root bin
+f usr/share/lib/keytables/type_6/traditional_chinese 0444 root bin
+f usr/share/lib/keytables/type_6/turkeyf 0444 root bin
+f usr/share/lib/keytables/type_6/turkeyq 0444 root bin
+f usr/share/lib/keytables/type_6/uk 0444 root bin
+f usr/share/lib/keytables/type_6/us 0444 root bin
+d usr/share/lib/mailx 0755 root bin
+d usr/share/lib/nterm 0755 root bin
+f usr/share/lib/nterm/tab.2631 0644 root bin
+f usr/share/lib/nterm/tab.2631-c 0644 root bin
+f usr/share/lib/nterm/tab.2631-e 0644 root bin
+f usr/share/lib/nterm/tab.300 0644 root bin
+f usr/share/lib/nterm/tab.300-12 0644 root bin
+f usr/share/lib/nterm/tab.300S 0644 root bin
+f usr/share/lib/nterm/tab.300S-12 0644 root bin
+f usr/share/lib/nterm/tab.300s 0644 root bin
+f usr/share/lib/nterm/tab.300s-12 0644 root bin
+f usr/share/lib/nterm/tab.37 0644 root bin
+f usr/share/lib/nterm/tab.382 0644 root bin
+f usr/share/lib/nterm/tab.4000A 0644 root bin
+f usr/share/lib/nterm/tab.4000a 0644 root bin
+f usr/share/lib/nterm/tab.450 0644 root bin
+f usr/share/lib/nterm/tab.450-12 0644 root bin
+f usr/share/lib/nterm/tab.832 0644 root bin
+f usr/share/lib/nterm/tab.8510 0644 root bin
+f usr/share/lib/nterm/tab.X 0644 root bin
+f usr/share/lib/nterm/tab.lp 0644 root bin
+f usr/share/lib/nterm/tab.tn300 0644 root bin
+d usr/share/lib/pub 0755 root bin
+f usr/share/lib/pub/ascii 0644 root bin
+f usr/share/lib/pub/eqnchar 0644 root bin
+f usr/share/lib/pub/greek 0644 root bin
+f usr/share/lib/pub/iso 0644 root bin
+d usr/share/lib/sgml 0755 root bin
+d usr/share/lib/tabset 0755 root bin
+f usr/share/lib/tabset/3101 0644 root bin
+f usr/share/lib/tabset/beehive 0644 root bin
+f usr/share/lib/tabset/hds 0644 root bin
+f usr/share/lib/tabset/hds3 0644 root bin
+f usr/share/lib/tabset/std 0644 root bin
+f usr/share/lib/tabset/stdcrt 0644 root bin
+f usr/share/lib/tabset/teleray 0644 root bin
+f usr/share/lib/tabset/vt100 0644 root bin
+f usr/share/lib/tabset/wyse-adds 0644 root bin
+f usr/share/lib/tabset/xerox1720 0644 root bin
+f usr/share/lib/termcap 0644 root bin
+d usr/share/lib/terminfo 0755 root bin
+d usr/share/lib/terminfo/3 0755 root bin
+f usr/share/lib/terminfo/3/386at 0644 root bin
+d usr/share/lib/terminfo/A 0755 root bin
+d usr/share/lib/terminfo/a 0755 root bin
+f usr/share/lib/terminfo/a/ansi 0644 root bin
+f usr/share/lib/terminfo/a/ansi+arrows 0644 root bin
+f usr/share/lib/terminfo/a/at386 0644 root bin
+d usr/share/lib/terminfo/s 0755 root bin
+f usr/share/lib/terminfo/s/screen 0644 root bin
+f usr/share/lib/terminfo/s/screen-256color 0644 root bin
+f usr/share/lib/terminfo/s/screen-w 0644 root bin
+f usr/share/lib/terminfo/s/sun 0644 root bin
+f usr/share/lib/terminfo/s/sun-color 0644 root bin
+d usr/share/lib/terminfo/u 0755 root bin
+f usr/share/lib/terminfo/u/unknown 0644 root bin
+d usr/share/lib/terminfo/v 0755 root bin
+f usr/share/lib/terminfo/v/vt100 0644 root bin
+f usr/share/lib/terminfo/v/vt220 0644 root bin
+d usr/share/lib/terminfo/x 0755 root bin
+f usr/share/lib/terminfo/x/xterm 0644 root bin
+f usr/share/lib/terminfo/x/xterm-256color 0644 root bin
+f usr/share/lib/terminfo/x/xterm-color 0644 root bin
+f usr/share/lib/terminfo/x/xtermc 0644 root bin
+f usr/share/lib/terminfo/x/xtermm 0644 root bin
+f usr/share/lib/terminfo/x/xterms 0644 root bin
+d usr/share/lib/tmac 0755 root bin
+f usr/share/lib/tmac/acm.me 0644 root bin
+f usr/share/lib/tmac/an 0644 root bin
+f usr/share/lib/tmac/ansun 0644 root bin
+f usr/share/lib/tmac/ansun.tbl 0644 root bin
+f usr/share/lib/tmac/bib 0644 root bin
+f usr/share/lib/tmac/chars.me 0644 root bin
+f usr/share/lib/tmac/deltext.me 0644 root bin
+f usr/share/lib/tmac/e 0644 root bin
+f usr/share/lib/tmac/eqn.me 0644 root bin
+f usr/share/lib/tmac/float.me 0644 root bin
+f usr/share/lib/tmac/footnote.me 0644 root bin
+f usr/share/lib/tmac/index.me 0644 root bin
+f usr/share/lib/tmac/local.me 0644 root bin
+f usr/share/lib/tmac/m 0644 root bin
+f usr/share/lib/tmac/mmn 0644 root bin
+f usr/share/lib/tmac/mmt 0644 root bin
+f usr/share/lib/tmac/ms.acc 0644 root bin
+f usr/share/lib/tmac/ms.cov 0644 root bin
+f usr/share/lib/tmac/ms.eqn 0644 root bin
+f usr/share/lib/tmac/ms.ref 0644 root bin
+f usr/share/lib/tmac/ms.tbl 0644 root bin
+f usr/share/lib/tmac/ms.ths 0644 root bin
+f usr/share/lib/tmac/ms.toc 0644 root bin
+f usr/share/lib/tmac/null.me 0644 root bin
+f usr/share/lib/tmac/refer.me 0644 root bin
+f usr/share/lib/tmac/s 0644 root bin
+f usr/share/lib/tmac/sh.me 0644 root bin
+f usr/share/lib/tmac/tbl.me 0644 root bin
+f usr/share/lib/tmac/thesis.me 0644 root bin
+f usr/share/lib/tmac/tmac.bib 0644 root bin
+f usr/share/lib/tmac/tmac.vgrind 0644 root bin
+f usr/share/lib/tmac/tz.map 0644 root bin
+f usr/share/lib/tmac/v 0644 root bin
+f usr/share/lib/tmac/vgrind 0644 root bin
+f usr/share/lib/unittab 0444 root bin
+d usr/share/lib/xml 0755 root sys
+d usr/share/lib/xml/dtd 0755 root sys
+f usr/share/lib/xml/dtd/adt_record.dtd.1 0444 root bin
+f usr/share/lib/xml/dtd/brand.dtd.1 0644 root bin
+f usr/share/lib/xml/dtd/kmfpolicy.dtd 0444 root bin
+f usr/share/lib/xml/dtd/rm_pool.dtd.1 0444 root bin
+f usr/share/lib/xml/dtd/service_bundle.dtd.1 0444 root sys
+f usr/share/lib/xml/dtd/topology.dtd.1 0444 root bin
+f usr/share/lib/xml/dtd/zone_platform.dtd.1 0644 root bin
+f usr/share/lib/xml/dtd/zonecfg.dtd.1 0444 root bin
+d usr/share/lib/xml/style 0755 root sys
+f usr/share/lib/xml/style/adt_record.xsl.1 0444 root bin
+d usr/share/lib/zoneinfo 0755 root bin
+d usr/share/lib/zoneinfo/Africa 0755 root bin
+f usr/share/lib/zoneinfo/Africa/Abidjan 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Accra 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Addis_Ababa 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Algiers 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Asmara 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Asmera 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Bamako 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Bangui 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Banjul 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Bissau 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Blantyre 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Brazzaville 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Bujumbura 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Cairo 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Casablanca 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Ceuta 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Conakry 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Dakar 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Dar_es_Salaam 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Djibouti 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Douala 0644 root bin
+f usr/share/lib/zoneinfo/Africa/El_Aaiun 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Freetown 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Gaborone 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Harare 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Johannesburg 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Juba 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Kampala 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Khartoum 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Kigali 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Kinshasa 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Lagos 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Libreville 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Lome 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Luanda 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Lubumbashi 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Lusaka 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Malabo 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Maputo 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Maseru 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Mbabane 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Mogadishu 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Monrovia 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Nairobi 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Ndjamena 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Niamey 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Nouakchott 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Ouagadougou 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Porto-Novo 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Sao_Tome 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Timbuktu 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Tripoli 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Tunis 0644 root bin
+f usr/share/lib/zoneinfo/Africa/Windhoek 0644 root bin
+d usr/share/lib/zoneinfo/America 0755 root bin
+h usr/share/lib/zoneinfo/America/Adak=usr/share/lib/zoneinfo/US/Aleutian
+f usr/share/lib/zoneinfo/America/Anchorage 0644 root bin
+f usr/share/lib/zoneinfo/America/Anguilla 0644 root bin
+f usr/share/lib/zoneinfo/America/Antigua 0644 root bin
+f usr/share/lib/zoneinfo/America/Araguaina 0644 root bin
+d usr/share/lib/zoneinfo/America/Argentina 0755 root bin
+f usr/share/lib/zoneinfo/America/Argentina/Buenos_Aires 0644 root bin
+h usr/share/lib/zoneinfo/America/Argentina/Catamarca=usr/share/lib/zoneinfo/America/Catamarca
+h usr/share/lib/zoneinfo/America/Argentina/ComodRivadavia=usr/share/lib/zoneinfo/America/Catamarca
+h usr/share/lib/zoneinfo/America/Argentina/Cordoba=usr/share/lib/zoneinfo/America/Cordoba
+f usr/share/lib/zoneinfo/America/Argentina/Jujuy 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/La_Rioja 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/Mendoza 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/Rio_Gallegos 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/Salta 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/San_Juan 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/San_Luis 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/Tucuman 0644 root bin
+f usr/share/lib/zoneinfo/America/Argentina/Ushuaia 0644 root bin
+f usr/share/lib/zoneinfo/America/Aruba 0644 root bin
+f usr/share/lib/zoneinfo/America/Asuncion 0644 root bin
+f usr/share/lib/zoneinfo/America/Atikokan 0644 root bin
+h usr/share/lib/zoneinfo/America/Atka=usr/share/lib/zoneinfo/US/Aleutian
+f usr/share/lib/zoneinfo/America/Bahia 0644 root bin
+f usr/share/lib/zoneinfo/America/Bahia_Banderas 0644 root bin
+f usr/share/lib/zoneinfo/America/Barbados 0644 root bin
+f usr/share/lib/zoneinfo/America/Belem 0644 root bin
+f usr/share/lib/zoneinfo/America/Belize 0644 root bin
+f usr/share/lib/zoneinfo/America/Blanc-Sablon 0644 root bin
+f usr/share/lib/zoneinfo/America/Boa_Vista 0644 root bin
+f usr/share/lib/zoneinfo/America/Bogota 0644 root bin
+f usr/share/lib/zoneinfo/America/Boise 0644 root bin
+f usr/share/lib/zoneinfo/America/Buenos_Aires 0644 root bin
+f usr/share/lib/zoneinfo/America/Cambridge_Bay 0644 root bin
+f usr/share/lib/zoneinfo/America/Campo_Grande 0644 root bin
+f usr/share/lib/zoneinfo/America/Cancun 0644 root bin
+f usr/share/lib/zoneinfo/America/Caracas 0644 root bin
+f usr/share/lib/zoneinfo/America/Catamarca 0644 root bin
+f usr/share/lib/zoneinfo/America/Cayenne 0644 root bin
+f usr/share/lib/zoneinfo/America/Cayman 0644 root bin
+f usr/share/lib/zoneinfo/America/Chicago 0644 root bin
+f usr/share/lib/zoneinfo/America/Chihuahua 0644 root bin
+f usr/share/lib/zoneinfo/America/Coral_Harbour 0644 root bin
+f usr/share/lib/zoneinfo/America/Cordoba 0644 root bin
+f usr/share/lib/zoneinfo/America/Costa_Rica 0644 root bin
+f usr/share/lib/zoneinfo/America/Cuiaba 0644 root bin
+f usr/share/lib/zoneinfo/America/Curacao 0644 root bin
+f usr/share/lib/zoneinfo/America/Danmarkshavn 0644 root bin
+f usr/share/lib/zoneinfo/America/Dawson 0644 root bin
+f usr/share/lib/zoneinfo/America/Dawson_Creek 0644 root bin
+h usr/share/lib/zoneinfo/America/Denver=usr/share/lib/zoneinfo/US/Mountain
+f usr/share/lib/zoneinfo/America/Detroit 0644 root bin
+f usr/share/lib/zoneinfo/America/Dominica 0644 root bin
+f usr/share/lib/zoneinfo/America/Edmonton 0644 root bin
+f usr/share/lib/zoneinfo/America/Eirunepe 0644 root bin
+f usr/share/lib/zoneinfo/America/El_Salvador 0644 root bin
+h usr/share/lib/zoneinfo/America/Ensenada=usr/share/lib/zoneinfo/America/Tijuana
+h usr/share/lib/zoneinfo/America/Fort_Wayne=usr/share/lib/zoneinfo/US/East-Indiana
+f usr/share/lib/zoneinfo/America/Fortaleza 0644 root bin
+f usr/share/lib/zoneinfo/America/Glace_Bay 0644 root bin
+f usr/share/lib/zoneinfo/America/Godthab 0644 root bin
+f usr/share/lib/zoneinfo/America/Goose_Bay 0644 root bin
+f usr/share/lib/zoneinfo/America/Grand_Turk 0644 root bin
+f usr/share/lib/zoneinfo/America/Grenada 0644 root bin
+f usr/share/lib/zoneinfo/America/Guadeloupe 0644 root bin
+f usr/share/lib/zoneinfo/America/Guatemala 0644 root bin
+f usr/share/lib/zoneinfo/America/Guayaquil 0644 root bin
+f usr/share/lib/zoneinfo/America/Guyana 0644 root bin
+f usr/share/lib/zoneinfo/America/Halifax 0644 root bin
+f usr/share/lib/zoneinfo/America/Havana 0644 root bin
+f usr/share/lib/zoneinfo/America/Hermosillo 0644 root bin
+d usr/share/lib/zoneinfo/America/Indiana 0755 root bin
+h usr/share/lib/zoneinfo/America/Indiana/Indianapolis=usr/share/lib/zoneinfo/US/East-Indiana
+h usr/share/lib/zoneinfo/America/Indiana/Knox=usr/share/lib/zoneinfo/America/Knox_IN
+f usr/share/lib/zoneinfo/America/Indiana/Marengo 0644 root bin
+f usr/share/lib/zoneinfo/America/Indiana/Petersburg 0644 root bin
+f usr/share/lib/zoneinfo/America/Indiana/Tell_City 0644 root bin
+f usr/share/lib/zoneinfo/America/Indiana/Vevay 0644 root bin
+f usr/share/lib/zoneinfo/America/Indiana/Vincennes 0644 root bin
+f usr/share/lib/zoneinfo/America/Indiana/Winamac 0644 root bin
+h usr/share/lib/zoneinfo/America/Indianapolis=usr/share/lib/zoneinfo/US/East-Indiana
+f usr/share/lib/zoneinfo/America/Inuvik 0644 root bin
+f usr/share/lib/zoneinfo/America/Iqaluit 0644 root bin
+f usr/share/lib/zoneinfo/America/Jamaica 0644 root bin
+f usr/share/lib/zoneinfo/America/Jujuy 0644 root bin
+f usr/share/lib/zoneinfo/America/Juneau 0644 root bin
+d usr/share/lib/zoneinfo/America/Kentucky 0755 root bin
+f usr/share/lib/zoneinfo/America/Kentucky/Louisville 0644 root bin
+f usr/share/lib/zoneinfo/America/Kentucky/Monticello 0644 root bin
+f usr/share/lib/zoneinfo/America/Knox_IN 0644 root bin
+h usr/share/lib/zoneinfo/America/Kralendijk=usr/share/lib/zoneinfo/America/Curacao
+f usr/share/lib/zoneinfo/America/La_Paz 0644 root bin
+f usr/share/lib/zoneinfo/America/Lima 0644 root bin
+h usr/share/lib/zoneinfo/America/Los_Angeles=usr/share/lib/zoneinfo/US/Pacific
+f usr/share/lib/zoneinfo/America/Louisville 0644 root bin
+h usr/share/lib/zoneinfo/America/Lower_Princes=usr/share/lib/zoneinfo/America/Curacao
+f usr/share/lib/zoneinfo/America/Maceio 0644 root bin
+f usr/share/lib/zoneinfo/America/Managua 0644 root bin
+f usr/share/lib/zoneinfo/America/Manaus 0644 root bin
+h usr/share/lib/zoneinfo/America/Marigot=usr/share/lib/zoneinfo/America/Guadeloupe
+f usr/share/lib/zoneinfo/America/Martinique 0644 root bin
+f usr/share/lib/zoneinfo/America/Matamoros 0644 root bin
+f usr/share/lib/zoneinfo/America/Mazatlan 0644 root bin
+f usr/share/lib/zoneinfo/America/Mendoza 0644 root bin
+f usr/share/lib/zoneinfo/America/Menominee 0644 root bin
+f usr/share/lib/zoneinfo/America/Merida 0644 root bin
+f usr/share/lib/zoneinfo/America/Metlakatla 0644 root bin
+f usr/share/lib/zoneinfo/America/Mexico_City 0644 root bin
+f usr/share/lib/zoneinfo/America/Miquelon 0644 root bin
+f usr/share/lib/zoneinfo/America/Moncton 0644 root bin
+f usr/share/lib/zoneinfo/America/Monterrey 0644 root bin
+f usr/share/lib/zoneinfo/America/Montevideo 0644 root bin
+f usr/share/lib/zoneinfo/America/Montreal 0644 root bin
+f usr/share/lib/zoneinfo/America/Montserrat 0644 root bin
+f usr/share/lib/zoneinfo/America/Nassau 0644 root bin
+f usr/share/lib/zoneinfo/America/New_York 0644 root bin
+f usr/share/lib/zoneinfo/America/Nipigon 0644 root bin
+f usr/share/lib/zoneinfo/America/Nome 0644 root bin
+f usr/share/lib/zoneinfo/America/Noronha 0644 root bin
+d usr/share/lib/zoneinfo/America/North_Dakota 0755 root bin
+f usr/share/lib/zoneinfo/America/North_Dakota/Beulah 0644 root bin
+f usr/share/lib/zoneinfo/America/North_Dakota/Center 0644 root bin
+f usr/share/lib/zoneinfo/America/North_Dakota/New_Salem 0644 root bin
+f usr/share/lib/zoneinfo/America/Ojinaga 0644 root bin
+f usr/share/lib/zoneinfo/America/Panama 0644 root bin
+f usr/share/lib/zoneinfo/America/Pangnirtung 0644 root bin
+f usr/share/lib/zoneinfo/America/Paramaribo 0644 root bin
+f usr/share/lib/zoneinfo/America/Phoenix 0644 root bin
+f usr/share/lib/zoneinfo/America/Port-au-Prince 0644 root bin
+f usr/share/lib/zoneinfo/America/Port_of_Spain 0644 root bin
+h usr/share/lib/zoneinfo/America/Porto_Acre=usr/share/lib/zoneinfo/Brazil/Acre
+f usr/share/lib/zoneinfo/America/Porto_Velho 0644 root bin
+f usr/share/lib/zoneinfo/America/Puerto_Rico 0644 root bin
+f usr/share/lib/zoneinfo/America/Rainy_River 0644 root bin
+f usr/share/lib/zoneinfo/America/Rankin_Inlet 0644 root bin
+f usr/share/lib/zoneinfo/America/Recife 0644 root bin
+h usr/share/lib/zoneinfo/America/Regina=usr/share/lib/zoneinfo/Canada/Saskatchewan
+f usr/share/lib/zoneinfo/America/Resolute 0644 root bin
+h usr/share/lib/zoneinfo/America/Rio_Branco=usr/share/lib/zoneinfo/Brazil/Acre
+h usr/share/lib/zoneinfo/America/Rosario=usr/share/lib/zoneinfo/America/Cordoba
+f usr/share/lib/zoneinfo/America/Santa_Isabel 0644 root bin
+f usr/share/lib/zoneinfo/America/Santarem 0644 root bin
+f usr/share/lib/zoneinfo/America/Santiago 0644 root bin
+f usr/share/lib/zoneinfo/America/Santo_Domingo 0644 root bin
+f usr/share/lib/zoneinfo/America/Sao_Paulo 0644 root bin
+f usr/share/lib/zoneinfo/America/Scoresbysund 0644 root bin
+h usr/share/lib/zoneinfo/America/Shiprock=usr/share/lib/zoneinfo/US/Mountain
+f usr/share/lib/zoneinfo/America/Sitka 0644 root bin
+h usr/share/lib/zoneinfo/America/St_Barthelemy=usr/share/lib/zoneinfo/America/Guadeloupe
+f usr/share/lib/zoneinfo/America/St_Johns 0644 root bin
+f usr/share/lib/zoneinfo/America/St_Kitts 0644 root bin
+f usr/share/lib/zoneinfo/America/St_Lucia 0644 root bin
+f usr/share/lib/zoneinfo/America/St_Thomas 0644 root bin
+f usr/share/lib/zoneinfo/America/St_Vincent 0644 root bin
+f usr/share/lib/zoneinfo/America/Swift_Current 0644 root bin
+f usr/share/lib/zoneinfo/America/Tegucigalpa 0644 root bin
+f usr/share/lib/zoneinfo/America/Thule 0644 root bin
+f usr/share/lib/zoneinfo/America/Thunder_Bay 0644 root bin
+f usr/share/lib/zoneinfo/America/Tijuana 0644 root bin
+f usr/share/lib/zoneinfo/America/Toronto 0644 root bin
+f usr/share/lib/zoneinfo/America/Tortola 0644 root bin
+f usr/share/lib/zoneinfo/America/Vancouver 0644 root bin
+f usr/share/lib/zoneinfo/America/Virgin 0644 root bin
+f usr/share/lib/zoneinfo/America/Whitehorse 0644 root bin
+f usr/share/lib/zoneinfo/America/Winnipeg 0644 root bin
+f usr/share/lib/zoneinfo/America/Yakutat 0644 root bin
+f usr/share/lib/zoneinfo/America/Yellowknife 0644 root bin
+d usr/share/lib/zoneinfo/Antarctica 0755 root bin
+f usr/share/lib/zoneinfo/Antarctica/Casey 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Davis 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/DumontDUrville 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Macquarie 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Mawson 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/McMurdo 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Palmer 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Rothera 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/South_Pole 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Syowa 0644 root bin
+f usr/share/lib/zoneinfo/Antarctica/Vostok 0644 root bin
+d usr/share/lib/zoneinfo/Arctic 0755 root bin
+h usr/share/lib/zoneinfo/Arctic/Longyearbyen=usr/share/lib/zoneinfo/Europe/Oslo
+d usr/share/lib/zoneinfo/Asia 0755 root bin
+f usr/share/lib/zoneinfo/Asia/Aden 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Almaty 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Amman 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Anadyr 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Aqtau 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Aqtobe 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Ashgabat 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Ashkhabad 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Baghdad 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Bahrain 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Baku 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Bangkok 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Beirut 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Bishkek 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Brunei 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Calcutta 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Choibalsan 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Chongqing 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Chungking 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Colombo 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Dacca 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Damascus 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Dhaka 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Dili 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Dubai 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Dushanbe 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Gaza 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Harbin 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Hebron 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Ho_Chi_Minh 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Hong_Kong 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Hovd 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Irkutsk 0644 root bin
+h usr/share/lib/zoneinfo/Asia/Istanbul=usr/share/lib/zoneinfo/Turkey
+f usr/share/lib/zoneinfo/Asia/Jakarta 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Jayapura 0644 root bin
+h usr/share/lib/zoneinfo/Asia/Jerusalem=usr/share/lib/zoneinfo/Israel
+f usr/share/lib/zoneinfo/Asia/Kabul 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kamchatka 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Karachi 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kashgar 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kathmandu 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Katmandu 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kolkata 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Krasnoyarsk 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kuala_Lumpur 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kuching 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Kuwait 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Macao 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Macau 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Magadan 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Makassar 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Manila 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Muscat 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Nicosia 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Novokuznetsk 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Novosibirsk 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Omsk 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Oral 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Phnom_Penh 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Pontianak 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Pyongyang 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Qatar 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Qyzylorda 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Rangoon 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Riyadh 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Riyadh87 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Riyadh88 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Riyadh89 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Saigon 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Sakhalin 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Samarkand 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Seoul 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Shanghai 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Singapore 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Taipei 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Tashkent 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Tbilisi 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Tehran 0644 root bin
+h usr/share/lib/zoneinfo/Asia/Tel_Aviv=usr/share/lib/zoneinfo/Israel
+f usr/share/lib/zoneinfo/Asia/Thimbu 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Thimphu 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Tokyo 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Ujung_Pandang 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Ulaanbaatar 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Ulan_Bator 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Urumqi 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Vientiane 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Vladivostok 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Yakutsk 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Yekaterinburg 0644 root bin
+f usr/share/lib/zoneinfo/Asia/Yerevan 0644 root bin
+d usr/share/lib/zoneinfo/Atlantic 0755 root bin
+f usr/share/lib/zoneinfo/Atlantic/Azores 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Bermuda 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Canary 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Cape_Verde 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Faeroe 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Faroe 0644 root bin
+h usr/share/lib/zoneinfo/Atlantic/Jan_Mayen=usr/share/lib/zoneinfo/Europe/Oslo
+f usr/share/lib/zoneinfo/Atlantic/Madeira 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Reykjavik 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/South_Georgia 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/St_Helena 0644 root bin
+f usr/share/lib/zoneinfo/Atlantic/Stanley 0644 root bin
+d usr/share/lib/zoneinfo/Australia 0755 root bin
+f usr/share/lib/zoneinfo/Australia/ACT 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Adelaide 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Brisbane 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Broken_Hill 0644 root bin
+h usr/share/lib/zoneinfo/Australia/Canberra=usr/share/lib/zoneinfo/Australia/ACT
+f usr/share/lib/zoneinfo/Australia/Currie 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Darwin 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Eucla 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Hobart 0644 root bin
+f usr/share/lib/zoneinfo/Australia/LHI 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Lindeman 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Lord_Howe 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Melbourne 0644 root bin
+h usr/share/lib/zoneinfo/Australia/NSW=usr/share/lib/zoneinfo/Australia/ACT
+f usr/share/lib/zoneinfo/Australia/North 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Perth 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Queensland 0644 root bin
+f usr/share/lib/zoneinfo/Australia/South 0644 root bin
+h usr/share/lib/zoneinfo/Australia/Sydney=usr/share/lib/zoneinfo/Australia/ACT
+f usr/share/lib/zoneinfo/Australia/Tasmania 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Victoria 0644 root bin
+f usr/share/lib/zoneinfo/Australia/West 0644 root bin
+f usr/share/lib/zoneinfo/Australia/Yancowinna 0644 root bin
+d usr/share/lib/zoneinfo/Brazil 0755 root bin
+f usr/share/lib/zoneinfo/Brazil/Acre 0644 root bin
+f usr/share/lib/zoneinfo/Brazil/DeNoronha 0644 root bin
+f usr/share/lib/zoneinfo/Brazil/East 0644 root bin
+f usr/share/lib/zoneinfo/Brazil/West 0644 root bin
+f usr/share/lib/zoneinfo/CET 0644 root bin
+f usr/share/lib/zoneinfo/CST6CDT 0644 root bin
+d usr/share/lib/zoneinfo/Canada 0755 root bin
+f usr/share/lib/zoneinfo/Canada/Atlantic 0644 root bin
+f usr/share/lib/zoneinfo/Canada/Central 0644 root bin
+h usr/share/lib/zoneinfo/Canada/East-Saskatchewan=usr/share/lib/zoneinfo/Canada/Saskatchewan
+f usr/share/lib/zoneinfo/Canada/Eastern 0644 root bin
+f usr/share/lib/zoneinfo/Canada/Mountain 0644 root bin
+f usr/share/lib/zoneinfo/Canada/Newfoundland 0644 root bin
+f usr/share/lib/zoneinfo/Canada/Pacific 0644 root bin
+f usr/share/lib/zoneinfo/Canada/Saskatchewan 0644 root bin
+f usr/share/lib/zoneinfo/Canada/Yukon 0644 root bin
+d usr/share/lib/zoneinfo/Chile 0755 root bin
+f usr/share/lib/zoneinfo/Chile/Continental 0644 root bin
+f usr/share/lib/zoneinfo/Chile/EasterIsland 0644 root bin
+f usr/share/lib/zoneinfo/Cuba 0644 root bin
+f usr/share/lib/zoneinfo/EET 0644 root bin
+f usr/share/lib/zoneinfo/EST 0644 root bin
+f usr/share/lib/zoneinfo/EST5EDT 0644 root bin
+f usr/share/lib/zoneinfo/Egypt 0644 root bin
+f usr/share/lib/zoneinfo/Eire 0644 root bin
+d usr/share/lib/zoneinfo/Etc 0755 root bin
+h usr/share/lib/zoneinfo/Etc/GMT+0=usr/share/lib/zoneinfo/GMT
+f usr/share/lib/zoneinfo/Etc/GMT+1 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+10 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+11 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+12 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+2 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+3 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+4 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+5 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+6 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+7 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+8 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT+9 0644 root bin
+h usr/share/lib/zoneinfo/Etc/GMT-0=usr/share/lib/zoneinfo/GMT
+f usr/share/lib/zoneinfo/Etc/GMT-1 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-10 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-11 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-12 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-13 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-14 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-2 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-3 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-4 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-5 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-6 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-7 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-8 0644 root bin
+f usr/share/lib/zoneinfo/Etc/GMT-9 0644 root bin
+h usr/share/lib/zoneinfo/Etc/GMT0=usr/share/lib/zoneinfo/GMT
+h usr/share/lib/zoneinfo/Etc/GMT=usr/share/lib/zoneinfo/GMT
+h usr/share/lib/zoneinfo/Etc/Greenwich=usr/share/lib/zoneinfo/GMT
+f usr/share/lib/zoneinfo/Etc/UCT 0644 root bin
+h usr/share/lib/zoneinfo/Etc/UTC=usr/share/lib/zoneinfo/UTC
+h usr/share/lib/zoneinfo/Etc/Universal=usr/share/lib/zoneinfo/UTC
+h usr/share/lib/zoneinfo/Etc/Zulu=usr/share/lib/zoneinfo/UTC
+d usr/share/lib/zoneinfo/Europe 0755 root bin
+f usr/share/lib/zoneinfo/Europe/Amsterdam 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Andorra 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Athens 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Belfast=usr/share/lib/zoneinfo/GB
+f usr/share/lib/zoneinfo/Europe/Belgrade 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Berlin 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Bratislava 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Brussels 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Bucharest 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Budapest 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Chisinau 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Copenhagen 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Dublin 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Gibraltar 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Guernsey=usr/share/lib/zoneinfo/GB
+f usr/share/lib/zoneinfo/Europe/Helsinki 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Isle_of_Man=usr/share/lib/zoneinfo/GB
+h usr/share/lib/zoneinfo/Europe/Istanbul=usr/share/lib/zoneinfo/Turkey
+h usr/share/lib/zoneinfo/Europe/Jersey=usr/share/lib/zoneinfo/GB
+f usr/share/lib/zoneinfo/Europe/Kaliningrad 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Kiev 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Lisbon 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Ljubljana=usr/share/lib/zoneinfo/Europe/Belgrade
+h usr/share/lib/zoneinfo/Europe/London=usr/share/lib/zoneinfo/GB
+f usr/share/lib/zoneinfo/Europe/Luxembourg 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Madrid 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Malta 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Mariehamn 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Minsk 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Monaco 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Moscow 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Nicosia 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Oslo 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Paris 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Podgorica=usr/share/lib/zoneinfo/Europe/Belgrade
+f usr/share/lib/zoneinfo/Europe/Prague 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Riga 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Rome 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Samara 0644 root bin
+h usr/share/lib/zoneinfo/Europe/San_Marino=usr/share/lib/zoneinfo/Europe/Rome
+h usr/share/lib/zoneinfo/Europe/Sarajevo=usr/share/lib/zoneinfo/Europe/Belgrade
+f usr/share/lib/zoneinfo/Europe/Simferopol 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Skopje=usr/share/lib/zoneinfo/Europe/Belgrade
+f usr/share/lib/zoneinfo/Europe/Sofia 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Stockholm 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Tallinn 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Tirane 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Tiraspol 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Uzhgorod 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Vaduz 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Vatican=usr/share/lib/zoneinfo/Europe/Rome
+f usr/share/lib/zoneinfo/Europe/Vienna 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Vilnius 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Volgograd 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Warsaw 0644 root bin
+h usr/share/lib/zoneinfo/Europe/Zagreb=usr/share/lib/zoneinfo/Europe/Belgrade
+f usr/share/lib/zoneinfo/Europe/Zaporozhye 0644 root bin
+f usr/share/lib/zoneinfo/Europe/Zurich 0644 root bin
+f usr/share/lib/zoneinfo/Factory 0644 root bin
+f usr/share/lib/zoneinfo/GB 0644 root bin
+h usr/share/lib/zoneinfo/GB-Eire=usr/share/lib/zoneinfo/GB
+f usr/share/lib/zoneinfo/GMT 0644 root bin
+h usr/share/lib/zoneinfo/GMT+0=usr/share/lib/zoneinfo/GMT
+h usr/share/lib/zoneinfo/GMT-0=usr/share/lib/zoneinfo/GMT
+h usr/share/lib/zoneinfo/GMT0=usr/share/lib/zoneinfo/GMT
+h usr/share/lib/zoneinfo/Greenwich=usr/share/lib/zoneinfo/GMT
+f usr/share/lib/zoneinfo/HST 0644 root bin
+f usr/share/lib/zoneinfo/Hongkong 0644 root bin
+f usr/share/lib/zoneinfo/Iceland 0644 root bin
+d usr/share/lib/zoneinfo/Indian 0755 root bin
+f usr/share/lib/zoneinfo/Indian/Antananarivo 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Chagos 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Christmas 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Cocos 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Comoro 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Kerguelen 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Mahe 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Maldives 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Mauritius 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Mayotte 0644 root bin
+f usr/share/lib/zoneinfo/Indian/Reunion 0644 root bin
+f usr/share/lib/zoneinfo/Iran 0644 root bin
+f usr/share/lib/zoneinfo/Israel 0644 root bin
+f usr/share/lib/zoneinfo/Jamaica 0644 root bin
+f usr/share/lib/zoneinfo/Japan 0644 root bin
+f usr/share/lib/zoneinfo/Kwajalein 0644 root bin
+f usr/share/lib/zoneinfo/Libya 0644 root bin
+f usr/share/lib/zoneinfo/MET 0644 root bin
+f usr/share/lib/zoneinfo/MST 0644 root bin
+f usr/share/lib/zoneinfo/MST7MDT 0644 root bin
+d usr/share/lib/zoneinfo/Mexico 0755 root bin
+h usr/share/lib/zoneinfo/Mexico/BajaNorte=usr/share/lib/zoneinfo/America/Tijuana
+f usr/share/lib/zoneinfo/Mexico/BajaSur 0644 root bin
+f usr/share/lib/zoneinfo/Mexico/General 0644 root bin
+d usr/share/lib/zoneinfo/Mideast 0755 root bin
+f usr/share/lib/zoneinfo/Mideast/Riyadh87 0644 root bin
+f usr/share/lib/zoneinfo/Mideast/Riyadh88 0644 root bin
+f usr/share/lib/zoneinfo/Mideast/Riyadh89 0644 root bin
+f usr/share/lib/zoneinfo/NZ 0644 root bin
+f usr/share/lib/zoneinfo/NZ-CHAT 0644 root bin
+h usr/share/lib/zoneinfo/Navajo=usr/share/lib/zoneinfo/US/Mountain
+f usr/share/lib/zoneinfo/PRC 0644 root bin
+f usr/share/lib/zoneinfo/PST8PDT 0644 root bin
+d usr/share/lib/zoneinfo/Pacific 0755 root bin
+f usr/share/lib/zoneinfo/Pacific/Apia 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Auckland 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Chatham 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Chuuk 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Easter 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Efate 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Enderbury 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Fakaofo 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Fiji 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Funafuti 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Galapagos 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Gambier 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Guadalcanal 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Guam 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Honolulu 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Johnston 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Kiritimati 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Kosrae 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Kwajalein 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Majuro 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Marquesas 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Midway 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Nauru 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Niue 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Norfolk 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Noumea 0644 root bin
+h usr/share/lib/zoneinfo/Pacific/Pago_Pago=usr/share/lib/zoneinfo/US/Samoa
+f usr/share/lib/zoneinfo/Pacific/Palau 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Pitcairn 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Pohnpei 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Ponape 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Port_Moresby 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Rarotonga 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Saipan 0644 root bin
+h usr/share/lib/zoneinfo/Pacific/Samoa=usr/share/lib/zoneinfo/US/Samoa
+f usr/share/lib/zoneinfo/Pacific/Tahiti 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Tarawa 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Tongatapu 0644 root bin
+h usr/share/lib/zoneinfo/Pacific/Truk=usr/share/lib/zoneinfo/Pacific/Chuuk
+f usr/share/lib/zoneinfo/Pacific/Wake 0644 root bin
+f usr/share/lib/zoneinfo/Pacific/Wallis 0644 root bin
+h usr/share/lib/zoneinfo/Pacific/Yap=usr/share/lib/zoneinfo/Pacific/Chuuk
+f usr/share/lib/zoneinfo/Poland 0644 root bin
+f usr/share/lib/zoneinfo/Portugal 0644 root bin
+h usr/share/lib/zoneinfo/ROC=usr/share/lib/zoneinfo/Asia/Taipei
+f usr/share/lib/zoneinfo/ROK 0644 root bin
+f usr/share/lib/zoneinfo/Singapore 0644 root bin
+f usr/share/lib/zoneinfo/Turkey 0644 root bin
+f usr/share/lib/zoneinfo/UCT 0644 root bin
+d usr/share/lib/zoneinfo/US 0755 root bin
+f usr/share/lib/zoneinfo/US/Alaska 0644 root bin
+f usr/share/lib/zoneinfo/US/Aleutian 0644 root bin
+f usr/share/lib/zoneinfo/US/Arizona 0644 root bin
+f usr/share/lib/zoneinfo/US/Central 0644 root bin
+f usr/share/lib/zoneinfo/US/East-Indiana 0644 root bin
+f usr/share/lib/zoneinfo/US/Eastern 0644 root bin
+f usr/share/lib/zoneinfo/US/Hawaii 0644 root bin
+h usr/share/lib/zoneinfo/US/Indiana-Starke=usr/share/lib/zoneinfo/America/Knox_IN
+f usr/share/lib/zoneinfo/US/Michigan 0644 root bin
+f usr/share/lib/zoneinfo/US/Mountain 0644 root bin
+f usr/share/lib/zoneinfo/US/Pacific 0644 root bin
+h usr/share/lib/zoneinfo/US/Pacific-New=usr/share/lib/zoneinfo/US/Pacific
+f usr/share/lib/zoneinfo/US/Samoa 0644 root bin
+f usr/share/lib/zoneinfo/UTC 0644 root bin
+h usr/share/lib/zoneinfo/Universal=usr/share/lib/zoneinfo/UTC
+f usr/share/lib/zoneinfo/W-SU 0644 root bin
+f usr/share/lib/zoneinfo/WET 0644 root bin
+h usr/share/lib/zoneinfo/Zulu=usr/share/lib/zoneinfo/UTC
+s usr/share/lib/zoneinfo/posixrules=US/Eastern
+d usr/share/lib/zoneinfo/src 0755 root bin
+f usr/share/lib/zoneinfo/src/README 0644 root bin
+f usr/share/lib/zoneinfo/src/africa 0644 root bin
+f usr/share/lib/zoneinfo/src/antarctica 0644 root bin
+f usr/share/lib/zoneinfo/src/asia 0644 root bin
+f usr/share/lib/zoneinfo/src/australasia 0644 root bin
+f usr/share/lib/zoneinfo/src/backward 0644 root bin
+f usr/share/lib/zoneinfo/src/etcetera 0644 root bin
+f usr/share/lib/zoneinfo/src/europe 0644 root bin
+f usr/share/lib/zoneinfo/src/factory 0644 root bin
+f usr/share/lib/zoneinfo/src/northamerica 0644 root bin
+f usr/share/lib/zoneinfo/src/pacificnew 0644 root bin
+f usr/share/lib/zoneinfo/src/solar87 0644 root bin
+f usr/share/lib/zoneinfo/src/solar88 0644 root bin
+f usr/share/lib/zoneinfo/src/solar89 0644 root bin
+f usr/share/lib/zoneinfo/src/southamerica 0644 root bin
+f usr/share/lib/zoneinfo/src/systemv 0644 root bin
+d usr/share/lib/zoneinfo/tab 0755 root bin
+f usr/share/lib/zoneinfo/tab/continent.tab 0644 root bin
+f usr/share/lib/zoneinfo/tab/country.tab 0644 root bin
+f usr/share/lib/zoneinfo/tab/zone_sun.tab 0644 root bin
+d usr/share/locale 0755 root other
+d usr/share/locale/C 0755 root bin
+d usr/share/locale/C/LC_MESSAGES 0755 root bin
+d usr/share/man 0755 root bin
+d usr/share/man/cat1 0755 root bin
+d usr/share/man/cat1m 0755 root bin
+d usr/share/man/cat5 0755 root bin
+d usr/share/man/man1 0755 root bin
+f usr/share/man/man1/Intro.1 0444 root bin
+f usr/share/man/man1/alias.1 0444 root bin
+f usr/share/man/man1/allocate.1 0444 root bin
+f usr/share/man/man1/amt.1 0444 root bin
+f usr/share/man/man1/apropos.1 0444 root bin
+f usr/share/man/man1/ar.1 0444 root bin
+f usr/share/man/man1/arch.1 0444 root bin
+f usr/share/man/man1/asa.1 0444 root bin
+f usr/share/man/man1/at.1 0444 root bin
+f usr/share/man/man1/atq.1 0444 root bin
+f usr/share/man/man1/atrm.1 0444 root bin
+f usr/share/man/man1/auths.1 0444 root bin
+s usr/share/man/man1/awk.1=nawk.1
+f usr/share/man/man1/banner.1 0444 root bin
+f usr/share/man/man1/basename.1 0444 root bin
+s usr/share/man/man1/batch.1=at.1
+f usr/share/man/man1/bc.1 0444 root bin
+f usr/share/man/man1/bdiff.1 0444 root bin
+f usr/share/man/man1/bfs.1 0444 root bin
+s usr/share/man/man1/bg.1=jobs.1
+f usr/share/man/man1/cal.1 0444 root bin
+f usr/share/man/man1/calendar.1 0444 root bin
+f usr/share/man/man1/cat.1 0444 root bin
+f usr/share/man/man1/cd.1 0444 root bin
+s usr/share/man/man1/checkeq.1=eqn.1
+f usr/share/man/man1/checknr.1 0444 root bin
+f usr/share/man/man1/chgrp.1 0444 root bin
+f usr/share/man/man1/chkey.1 0444 root bin
+f usr/share/man/man1/chmod.1 0444 root bin
+f usr/share/man/man1/chown.1 0444 root bin
+f usr/share/man/man1/ckdate.1 0444 root bin
+f usr/share/man/man1/ckgid.1 0444 root bin
+f usr/share/man/man1/ckint.1 0444 root bin
+f usr/share/man/man1/ckitem.1 0444 root bin
+f usr/share/man/man1/ckkeywd.1 0444 root bin
+f usr/share/man/man1/ckpath.1 0444 root bin
+f usr/share/man/man1/ckrange.1 0444 root bin
+f usr/share/man/man1/ckstr.1 0444 root bin
+f usr/share/man/man1/cksum.1 0444 root bin
+f usr/share/man/man1/cktime.1 0444 root bin
+f usr/share/man/man1/ckuid.1 0444 root bin
+f usr/share/man/man1/ckyorn.1 0444 root bin
+f usr/share/man/man1/clear.1 0444 root bin
+f usr/share/man/man1/cmp.1 0444 root bin
+f usr/share/man/man1/col.1 0444 root bin
+f usr/share/man/man1/column.1 0444 root bin
+f usr/share/man/man1/comm.1 0444 root bin
+f usr/share/man/man1/command.1 0444 root bin
+f usr/share/man/man1/compress.1 0444 root bin
+f usr/share/man/man1/cp.1 0444 root bin
+f usr/share/man/man1/cpio.1 0444 root bin
+f usr/share/man/man1/cputrack.1 0444 root bin
+f usr/share/man/man1/crle.1 0444 root bin
+f usr/share/man/man1/crontab.1 0444 root bin
+f usr/share/man/man1/crypt.1 0444 root bin
+f usr/share/man/man1/csh.1 0444 root bin
+f usr/share/man/man1/csplit.1 0444 root bin
+f usr/share/man/man1/ctags.1 0444 root bin
+f usr/share/man/man1/ctrun.1 0444 root bin
+f usr/share/man/man1/ctstat.1 0444 root bin
+f usr/share/man/man1/ctwatch.1 0444 root bin
+f usr/share/man/man1/cut.1 0444 root bin
+f usr/share/man/man1/date.1 0444 root bin
+f usr/share/man/man1/dc.1 0444 root bin
+f usr/share/man/man1/deallocate.1 0444 root bin
+s usr/share/man/man1/decrypt.1=encrypt.1
+f usr/share/man/man1/deroff.1 0444 root bin
+f usr/share/man/man1/dhcpinfo.1 0444 root bin
+f usr/share/man/man1/diff.1 0444 root bin
+f usr/share/man/man1/diff3.1 0444 root bin
+f usr/share/man/man1/diffmk.1 0444 root bin
+f usr/share/man/man1/digest.1 0444 root bin
+f usr/share/man/man1/dircmp.1 0444 root bin
+s usr/share/man/man1/dirname.1=basename.1
+f usr/share/man/man1/dis.1 0444 root bin
+f usr/share/man/man1/dispgid.1 0444 root bin
+f usr/share/man/man1/dispuid.1 0444 root bin
+f usr/share/man/man1/dos2unix.1 0444 root bin
+f usr/share/man/man1/du.1 0444 root bin
+f usr/share/man/man1/dump.1 0444 root bin
+f usr/share/man/man1/dumpcs.1 0444 root bin
+s usr/share/man/man1/dumpkeys.1=loadkeys.1
+f usr/share/man/man1/echo.1 0444 root bin
+f usr/share/man/man1/ed.1 0444 root bin
+s usr/share/man/man1/edit.1=../../../has/man/man1has/edit.1has
+f usr/share/man/man1/egrep.1 0444 root bin
+f usr/share/man/man1/eject.1 0444 root bin
+f usr/share/man/man1/elfdump.1 0444 root bin
+f usr/share/man/man1/elfedit.1 0444 root bin
+f usr/share/man/man1/elfsign.1 0444 root bin
+f usr/share/man/man1/elfwrap.1 0444 root bin
+f usr/share/man/man1/encrypt.1 0444 root bin
+f usr/share/man/man1/enhance.1 0444 root bin
+f usr/share/man/man1/env.1 0444 root bin
+f usr/share/man/man1/eqn.1 0444 root bin
+s usr/share/man/man1/errange.1=ckrange.1
+s usr/share/man/man1/errdate.1=ckdate.1
+s usr/share/man/man1/errgid.1=ckgid.1
+s usr/share/man/man1/errint.1=ckint.1
+s usr/share/man/man1/erritem.1=ckitem.1
+s usr/share/man/man1/errpath.1=ckpath.1
+s usr/share/man/man1/errstr.1=ckstr.1
+s usr/share/man/man1/errtime.1=cktime.1
+s usr/share/man/man1/erruid.1=ckuid.1
+s usr/share/man/man1/erryorn.1=ckyorn.1
+f usr/share/man/man1/expand.1 0444 root bin
+f usr/share/man/man1/expr.1 0444 root bin
+f usr/share/man/man1/exstr.1 0444 root bin
+f usr/share/man/man1/factor.1 0444 root bin
+s usr/share/man/man1/false.1=true.1
+s usr/share/man/man1/fc.1=history.1
+f usr/share/man/man1/fdformat.1 0444 root bin
+s usr/share/man/man1/fg.1=jobs.1
+f usr/share/man/man1/fgrep.1 0444 root bin
+f usr/share/man/man1/file.1 0444 root bin
+f usr/share/man/man1/filesync.1 0444 root bin
+f usr/share/man/man1/find.1 0444 root bin
+f usr/share/man/man1/fmt.1 0444 root bin
+f usr/share/man/man1/fmtmsg.1 0444 root bin
+f usr/share/man/man1/fold.1 0444 root bin
+f usr/share/man/man1/ftp.1 0444 root bin
+f usr/share/man/man1/ftpcount.1 0444 root bin
+f usr/share/man/man1/ftpwho.1 0444 root bin
+f usr/share/man/man1/gcore.1 0444 root bin
+f usr/share/man/man1/gencat.1 0444 root bin
+f usr/share/man/man1/genmsg.1 0444 root bin
+f usr/share/man/man1/getconf.1 0444 root bin
+f usr/share/man/man1/getfacl.1 0444 root bin
+f usr/share/man/man1/getopt.1 0444 root bin
+f usr/share/man/man1/getoptcvt.1 0444 root bin
+f usr/share/man/man1/getopts.1 0444 root bin
+f usr/share/man/man1/gettext.1 0444 root bin
+f usr/share/man/man1/gettxt.1 0444 root bin
+f usr/share/man/man1/grep.1 0444 root bin
+f usr/share/man/man1/groups.1 0444 root bin
+f usr/share/man/man1/hash.1 0444 root bin
+f usr/share/man/man1/head.1 0444 root bin
+s usr/share/man/man1/helpdate.1=ckdate.1
+s usr/share/man/man1/helpgid.1=ckgid.1
+s usr/share/man/man1/helpint.1=ckint.1
+s usr/share/man/man1/helpitem.1=ckitem.1
+s usr/share/man/man1/helppath.1=ckpath.1
+s usr/share/man/man1/helprange.1=ckrange.1
+s usr/share/man/man1/helpstr.1=ckstr.1
+s usr/share/man/man1/helptime.1=cktime.1
+s usr/share/man/man1/helpuid.1=ckuid.1
+s usr/share/man/man1/helpyorn.1=ckyorn.1
+f usr/share/man/man1/history.1 0444 root bin
+f usr/share/man/man1/hostid.1 0444 root bin
+f usr/share/man/man1/hostname.1 0444 root bin
+s usr/share/man/man1/i286.1=machid.1
+s usr/share/man/man1/i386.1=machid.1
+s usr/share/man/man1/i486.1=machid.1
+f usr/share/man/man1/iconv.1 0444 root bin
+s usr/share/man/man1/intro.1=Intro.1
+f usr/share/man/man1/ipcrm.1 0444 root bin
+f usr/share/man/man1/ipcs.1 0444 root bin
+f usr/share/man/man1/isainfo.1 0444 root bin
+f usr/share/man/man1/isalist.1 0444 root bin
+f usr/share/man/man1/jobs.1 0444 root bin
+f usr/share/man/man1/join.1 0444 root bin
+s usr/share/man/man1/jsh.1=ksh93.1
+f usr/share/man/man1/kbd.1 0444 root bin
+f usr/share/man/man1/kdestroy.1 0444 root bin
+f usr/share/man/man1/keylogin.1 0444 root bin
+f usr/share/man/man1/keylogout.1 0444 root bin
+f usr/share/man/man1/kill.1 0444 root bin
+f usr/share/man/man1/kinit.1 0444 root bin
+f usr/share/man/man1/klist.1 0444 root bin
+f usr/share/man/man1/kmdb.1 0444 root bin
+f usr/share/man/man1/kmfcfg.1 0444 root bin
+f usr/share/man/man1/kpasswd.1 0444 root bin
+f usr/share/man/man1/krb5-config.1 0444 root bin
+s usr/share/man/man1/ksh.1=ksh93.1
+f usr/share/man/man1/ksh93.1 0444 root bin
+f usr/share/man/man1/ktutil.1 0444 root bin
+f usr/share/man/man1/last.1 0444 root bin
+f usr/share/man/man1/lastcomm.1 0444 root bin
+f usr/share/man/man1/ld.1 0444 root bin
+f usr/share/man/man1/ld.so.1.1 0444 root bin
+f usr/share/man/man1/ldap.1 0444 root bin
+s usr/share/man/man1/ldapadd.1=ldapmodify.1
+f usr/share/man/man1/ldapdelete.1 0444 root bin
+f usr/share/man/man1/ldaplist.1 0444 root bin
+f usr/share/man/man1/ldapmodify.1 0444 root bin
+f usr/share/man/man1/ldapmodrdn.1 0444 root bin
+f usr/share/man/man1/ldapsearch.1 0444 root bin
+f usr/share/man/man1/ldd.1 0444 root bin
+f usr/share/man/man1/lgrpinfo.1 0444 root bin
+f usr/share/man/man1/limit.1 0444 root bin
+f usr/share/man/man1/line.1 0444 root bin
+f usr/share/man/man1/list_devices.1 0444 root bin
+f usr/share/man/man1/listusers.1 0444 root bin
+f usr/share/man/man1/ln.1 0444 root bin
+f usr/share/man/man1/loadkeys.1 0444 root bin
+f usr/share/man/man1/locale.1 0444 root bin
+f usr/share/man/man1/localedef.1 0444 root bin
+f usr/share/man/man1/logger.1 0444 root bin
+f usr/share/man/man1/login.1 0444 root bin
+f usr/share/man/man1/logname.1 0444 root bin
+f usr/share/man/man1/look.1 0444 root bin
+f usr/share/man/man1/lorder.1 0444 root bin
+f usr/share/man/man1/ls.1 0444 root bin
+f usr/share/man/man1/m4.1 0444 root bin
+f usr/share/man/man1/mac.1 0444 root bin
+f usr/share/man/man1/mach.1 0444 root bin
+f usr/share/man/man1/machid.1 0444 root bin
+f usr/share/man/man1/mail.1 0444 root bin
+f usr/share/man/man1/mailcompat.1 0444 root bin
+f usr/share/man/man1/mailq.1 0444 root bin
+f usr/share/man/man1/mailstats.1 0444 root bin
+f usr/share/man/man1/mailx.1 0444 root bin
+f usr/share/man/man1/makekey.1 0444 root bin
+f usr/share/man/man1/man.1 0444 root bin
+f usr/share/man/man1/mconnect.1 0444 root bin
+f usr/share/man/man1/mcs.1 0444 root bin
+f usr/share/man/man1/mdb.1 0444 root bin
+f usr/share/man/man1/mesg.1 0444 root bin
+f usr/share/man/man1/mkdir.1 0444 root bin
+f usr/share/man/man1/mkmsgs.1 0444 root bin
+f usr/share/man/man1/mktemp.1 0444 root bin
+f usr/share/man/man1/moe.1 0444 root bin
+f usr/share/man/man1/more.1 0444 root bin
+f usr/share/man/man1/mpss.so.1.1 0444 root bin
+f usr/share/man/man1/msgfmt.1 0444 root bin
+f usr/share/man/man1/mt.1 0444 root bin
+f usr/share/man/man1/mv.1 0444 root bin
+f usr/share/man/man1/nawk.1 0444 root bin
+f usr/share/man/man1/nc.1 0444 root bin
+s usr/share/man/man1/neqn.1=eqn.1
+f usr/share/man/man1/newform.1 0444 root bin
+f usr/share/man/man1/newgrp.1 0444 root bin
+f usr/share/man/man1/news.1 0444 root bin
+f usr/share/man/man1/newtask.1 0444 root bin
+f usr/share/man/man1/nice.1 0444 root bin
+f usr/share/man/man1/nl.1 0444 root bin
+f usr/share/man/man1/nm.1 0444 root bin
+f usr/share/man/man1/nohup.1 0444 root bin
+f usr/share/man/man1/nroff.1 0444 root bin
+f usr/share/man/man1/od.1 0444 root bin
+f usr/share/man/man1/on.1 0444 root bin
+f usr/share/man/man1/optisa.1 0444 root bin
+f usr/share/man/man1/pack.1 0444 root bin
+s usr/share/man/man1/page.1=more.1
+f usr/share/man/man1/pagesize.1 0444 root bin
+f usr/share/man/man1/pargs.1 0444 root bin
+f usr/share/man/man1/passwd.1 0444 root bin
+f usr/share/man/man1/paste.1 0444 root bin
+f usr/share/man/man1/pathchk.1 0444 root bin
+f usr/share/man/man1/pax.1 0444 root bin
+s usr/share/man/man1/pcat.1=pack.1
+s usr/share/man/man1/pcred.1=proc.1
+s usr/share/man/man1/pfcsh.1=pfexec.1
+f usr/share/man/man1/pfexec.1 0444 root bin
+s usr/share/man/man1/pfiles.1=proc.1
+s usr/share/man/man1/pfksh.1=pfexec.1
+s usr/share/man/man1/pflags.1=proc.1
+s usr/share/man/man1/pfsh.1=pfexec.1
+f usr/share/man/man1/pg.1 0444 root bin
+f usr/share/man/man1/pgrep.1 0444 root bin
+f usr/share/man/man1/pkgtrans.1 0444 root bin
+s usr/share/man/man1/pkill.1=pgrep.1
+f usr/share/man/man1/pktool.1 0444 root bin
+s usr/share/man/man1/pldd.1=proc.1
+f usr/share/man/man1/plgrp.1 0444 root bin
+f usr/share/man/man1/plimit.1 0444 root bin
+f usr/share/man/man1/pmadvise.1 0444 root bin
+f usr/share/man/man1/pmap.1 0444 root bin
+f usr/share/man/man1/ppgsz.1 0444 root bin
+f usr/share/man/man1/ppriv.1 0444 root bin
+f usr/share/man/man1/pr.1 0444 root bin
+f usr/share/man/man1/praliases.1 0444 root bin
+f usr/share/man/man1/prctl.1 0444 root bin
+f usr/share/man/man1/preap.1 0444 root bin
+f usr/share/man/man1/print.1 0444 root bin
+f usr/share/man/man1/printf.1 0444 root bin
+f usr/share/man/man1/priocntl.1 0444 root bin
+f usr/share/man/man1/proc.1 0444 root bin
+f usr/share/man/man1/profiles.1 0444 root bin
+f usr/share/man/man1/projects.1 0444 root bin
+s usr/share/man/man1/prun.1=proc.1
+f usr/share/man/man1/ps.1 0444 root bin
+s usr/share/man/man1/psig.1=proc.1
+s usr/share/man/man1/pstack.1=proc.1
+s usr/share/man/man1/pstop.1=proc.1
+s usr/share/man/man1/ptime.1=proc.1
+f usr/share/man/man1/ptree.1 0444 root bin
+f usr/share/man/man1/pvs.1 0444 root bin
+s usr/share/man/man1/pwait.1=proc.1
+f usr/share/man/man1/pwd.1 0444 root bin
+s usr/share/man/man1/pwdx.1=proc.1
+f usr/share/man/man1/rcapstat.1 0444 root bin
+f usr/share/man/man1/rcp.1 0444 root bin
+f usr/share/man/man1/rdist.1 0444 root bin
+f usr/share/man/man1/read.1 0444 root bin
+s usr/share/man/man1/red.1=ed.1
+f usr/share/man/man1/refer.1 0444 root bin
+f usr/share/man/man1/regcmp.1 0444 root bin
+s usr/share/man/man1/remote_shell.1=rsh.1
+s usr/share/man/man1/remsh.1=rsh.1
+f usr/share/man/man1/renice.1 0444 root bin
+f usr/share/man/man1/rev.1 0444 root bin
+s usr/share/man/man1/rksh.1=ksh93.1
+s usr/share/man/man1/rksh93.1=ksh93.1
+f usr/share/man/man1/rlogin.1 0444 root bin
+f usr/share/man/man1/rm.1 0444 root bin
+s usr/share/man/man1/rmail.1=mail.1
+s usr/share/man/man1/rmdir.1=rm.1
+f usr/share/man/man1/rmformat.1 044 root bin
+f usr/share/man/man1/roles.1 0444 root bin
+f usr/share/man/man1/rsh.1 0444 root bin
+f usr/share/man/man1/runat.1 0444 root bin
+f usr/share/man/man1/rup.1 0444 root bin
+f usr/share/man/man1/ruptime.1 0444 root bin
+f usr/share/man/man1/rusers.1 0444 root bin
+f usr/share/man/man1/scp.1 0444 root bin
+f usr/share/man/man1/script.1 0444 root bin
+f usr/share/man/man1/sdiff.1 0444 root bin
+f usr/share/man/man1/sed.1 0444 root bin
+f usr/share/man/man1/setfacl.1 0444 root bin
+f usr/share/man/man1/setpgrp.1 0444 root bin
+s usr/share/man/man1/settime.1=touch.1
+f usr/share/man/man1/sftp.1 0444 root bin
+s usr/share/man/man1/sh.1=ksh93.1
+f usr/share/man/man1/shcomp.1 0444 root bin
+f usr/share/man/man1/size.1 044 root bin
+f usr/share/man/man1/sleep.1 0444 root bin
+f usr/share/man/man1/smbutil.1 0444 root bin
+f usr/share/man/man1/soelim.1 0444 root bin
+f usr/share/man/man1/sort.1 0444 root bin
+f usr/share/man/man1/sotruss.1 0444 root bin
+s usr/share/man/man1/sparc.1=machid.1
+f usr/share/man/man1/spell.1 0444 root bin
+f usr/share/man/man1/split.1 0444 root bin
+f usr/share/man/man1/srchtxt.1 0444 root bin
+f usr/share/man/man1/ssh-add.1 0444 root bin
+f usr/share/man/man1/ssh-agent.1 0444 root bin
+f usr/share/man/man1/ssh-http-proxy-connect.1 0444 root bin
+f usr/share/man/man1/ssh-keygen.1 0444 root bin
+f usr/share/man/man1/ssh-keyscan.1 0444 root bin
+f usr/share/man/man1/ssh-socks5-proxy-connect.1 0444 root bin
+f usr/share/man/man1/ssh.1 0444 root bin
+f usr/share/man/man1/strchg.1 0444 root bin
+s usr/share/man/man1/strconf.1=strchg.1
+f usr/share/man/man1/strings.1 0444 root bin
+f usr/share/man/man1/strip.1 044 root bin
+f usr/share/man/man1/stty.1 0444 root bin
+f usr/share/man/man1/sum.1 0444 root bin
+s usr/share/man/man1/sun.1=machid.1
+f usr/share/man/man1/svcprop.1 0444 root bin
+f usr/share/man/man1/svcs.1 0444 root bin
+f usr/share/man/man1/tabs.1 0444 root bin
+f usr/share/man/man1/tail.1 0444 root bin
+f usr/share/man/man1/tar.1 0444 root bin
+f usr/share/man/man1/tbl.1 0444 root bin
+f usr/share/man/man1/tcopy.1 0444 root bin
+f usr/share/man/man1/tee.1 0444 root bin
+f usr/share/man/man1/telnet.1 0444 root bin
+f usr/share/man/man1/test.1 0444 root bin
+f usr/share/man/man1/time.1 0444 root bin
+f usr/share/man/man1/timex.1 044 root bin
+f usr/share/man/man1/tip.1 0444 root bin
+f usr/share/man/man1/touch.1 0444 root bin
+f usr/share/man/man1/tput.1 0444 root bin
+f usr/share/man/man1/tr.1 0444 root bin
+f usr/share/man/man1/troff.1 0444 root bin
+f usr/share/man/man1/true.1 0444 root bin
+f usr/share/man/man1/truss.1 0444 root bin
+f usr/share/man/man1/tsort.1 0444 root bin
+f usr/share/man/man1/tty.1 0444 root bin
+f usr/share/man/man1/type.1 0444 root bin
+f usr/share/man/man1/ul.1 0444 root bin
+s usr/share/man/man1/ulimit.1=limit.1
+f usr/share/man/man1/umask.1 0444 root bin
+s usr/share/man/man1/unalias.1=alias.1
+f usr/share/man/man1/uname.1 0444 root bin
+s usr/share/man/man1/uncompress.1=compress.1
+s usr/share/man/man1/unexpand.1=expand.1
+f usr/share/man/man1/uniq.1 0444 root bin
+f usr/share/man/man1/units.1 0444 root bin
+f usr/share/man/man1/unix2dos.1 0444 root bin
+s usr/share/man/man1/unpack.1=pack.1
+f usr/share/man/man1/uptime.1 0444 root bin
+f usr/share/man/man1/vacation.1 0444 root bin
+s usr/share/man/man1/valdate.1=ckdate.1
+s usr/share/man/man1/valgid.1=ckgid.1
+s usr/share/man/man1/valint.1=ckint.1
+s usr/share/man/man1/valpath.1=ckpath.1
+s usr/share/man/man1/valrange.1=ckrange.1
+s usr/share/man/man1/valstr.1=ckstr.1
+s usr/share/man/man1/valtime.1=cktime.1
+s usr/share/man/man1/valuid.1=ckuid.1
+s usr/share/man/man1/valyorn.1=ckyorn.1
+s usr/share/man/man1/vedit.1=../../../has/man/man1has/vi.1has
+f usr/share/man/man1/vgrind.1 0444 root bin
+f usr/share/man/man1/w.1 0444 root bin
+f usr/share/man/man1/wait.1 0444 root bin
+f usr/share/man/man1/wc.1 0444 root bin
+f usr/share/man/man1/whatis.1 0444 root bin
+f usr/share/man/man1/which.1 0444 root bin
+f usr/share/man/man1/who.1 0444 root bin
+f usr/share/man/man1/whocalls.1 0444 root bin
+f usr/share/man/man1/whois.1 0444 root bin
+f usr/share/man/man1/write.1 0444 root bin
+f usr/share/man/man1/xargs.1 0444 root bin
+f usr/share/man/man1/xgettext.1 0444 root bin
+f usr/share/man/man1/xstr.1 0444 root bin
+f usr/share/man/man1/yes.1 0444 root bin
+f usr/share/man/man1/ypcat.1 0444 root bin
+f usr/share/man/man1/ypmatch.1 0444 root bin
+f usr/share/man/man1/yppasswd.1 0444 root bin
+f usr/share/man/man1/ypwhich.1 0444 root bin
+s usr/share/man/man1/zcat.1=compress.1
+f usr/share/man/man1/zlogin.1 0444 root bin
+f usr/share/man/man1/zonename.1 0444 root bin
+d usr/share/man/man1b 0755 root bin
+f usr/share/man/man1b/df.1b 0444 root bin
+f usr/share/man/man1b/ps.1b 0444 root bin
+f usr/share/man/man1b/shutdown.1b 0444 root bin
+f usr/share/man/man1b/touch.1b 0444 root bin
+d usr/share/man/man1c 0755 root bin
+s usr/share/man/man1c/uudecode.1c=uuencode.1c
+f usr/share/man/man1c/uuencode.1c 044 root bin
+d usr/share/man/man1m 0755 root bin
+f usr/share/man/man1m/6to4relay.1m 0444 root bin
+f usr/share/man/man1m/Intro.1m 0444 root bin
+f usr/share/man/man1m/acctadm.1m 0444 root bin
+f usr/share/man/man1m/add_drv.1m 0444 root bin
+f usr/share/man/man1m/addbadsec.1m 0444 root bin
+f usr/share/man/man1m/arp.1m 0444 root bin
+f usr/share/man/man1m/audit.1m 0444 root bin
+f usr/share/man/man1m/audit_warn.1m 0444 root bin
+f usr/share/man/man1m/auditconfig.1m 0444 root bin
+f usr/share/man/man1m/auditd.1m 0444 root bin
+f usr/share/man/man1m/auditrecord.1m 0444 root bin
+f usr/share/man/man1m/auditreduce.1m 0444 root bin
+f usr/share/man/man1m/auditstat.1m 0444 root bin
+f usr/share/man/man1m/automount.1m 0444 root bin
+f usr/share/man/man1m/automountd.1m 0444 root bin
+f usr/share/man/man1m/autopush.1m 0444 root bin
+f usr/share/man/man1m/bart.1m 0444 root bin
+f usr/share/man/man1m/bootadm.1m 0444 root bin
+f usr/share/man/man1m/busstat.1m 0444 root bin
+f usr/share/man/man1m/captoinfo.1m 0444 root bin
+f usr/share/man/man1m/catman.1m 0444 root bin
+f usr/share/man/man1m/cfgadm.1m 0444 root bin
+f usr/share/man/man1m/cfgadm_fp.1m 0444 root bin
+f usr/share/man/man1m/cfgadm_pci.1m 0444 root bin
+f usr/share/man/man1m/cfgadm_sata.1m 0444 root bin
+f usr/share/man/man1m/cfgadm_scsi.1m 0444 root bin
+f usr/share/man/man1m/cfgadm_usb.1m 0444 root bin
+f usr/share/man/man1m/check-hostname.1m 0444 root bin
+f usr/share/man/man1m/check-permissions.1m 0444 root bin
+f usr/share/man/man1m/chroot.1m 0444 root bin
+f usr/share/man/man1m/clear_locks.1m 0444 root bin
+f usr/share/man/man1m/clinfo.1m 0444 root bin
+f usr/share/man/man1m/clri.1m 0444 root bin
+f usr/share/man/man1m/consadm.1m 0444 root bin
+f usr/share/man/man1m/coreadm.1m 0444 root bin
+f usr/share/man/man1m/cpustat.1m 0444 root bin
+f usr/share/man/man1m/cron.1m 0444 root bin
+f usr/share/man/man1m/cryptoadm.1m 0444 root bin
+s usr/share/man/man1m/dcopy.1m=clri.1m
+f usr/share/man/man1m/dd.1m 0444 root bin
+f usr/share/man/man1m/devattr.1m 0444 root bin
+f usr/share/man/man1m/devfree.1m 0444 root bin
+f usr/share/man/man1m/devfsadm.1m 0444 root bin
+s usr/share/man/man1m/devfsadmd.1m=devfsadm.1m
+f usr/share/man/man1m/devinfo.1m 0444 root bin
+f usr/share/man/man1m/devlinks.1m 0444 root bin
+f usr/share/man/man1m/devnm.1m 0444 root bin
+f usr/share/man/man1m/devprop.1m 0444 root bin
+f usr/share/man/man1m/devreserv.1m 0444 root bin
+f usr/share/man/man1m/df.1m 0444 root bin
+f usr/share/man/man1m/df_ufs.1m 0444 root bin
+f usr/share/man/man1m/dfmounts.1m 0444 root bin
+f usr/share/man/man1m/dfmounts_nfs.1m 0444 root bin
+f usr/share/man/man1m/dfshares.1m 0444 root bin
+f usr/share/man/man1m/dfshares_nfs.1m 0444 root bin
+f usr/share/man/man1m/dhcpagent.1m 0444 root bin
+f usr/share/man/man1m/disks.1m 0444 root bin
+f usr/share/man/man1m/diskscan.1m 0444 root bin
+f usr/share/man/man1m/dispadmin.1m 0444 root bin
+f usr/share/man/man1m/dladm.1m 0444 root bin
+f usr/share/man/man1m/dlmgmtd.1m 0444 root bin
+f usr/share/man/man1m/dmesg.1m 0444 root bin
+f usr/share/man/man1m/dminfo.1m 0444 root bin
+f usr/share/man/man1m/dns-sd.1m 0444 root bin
+f usr/share/man/man1m/domainname.1m 0444 root bin
+f usr/share/man/man1m/drvconfig.1m 0444 root bin
+f usr/share/man/man1m/dtrace.1m 0444 root bin
+f usr/share/man/man1m/dumpadm.1m 0444 root bin
+f usr/share/man/man1m/editmap.1m 0444 root bin
+f usr/share/man/man1m/edquota.1m 0444 root bin
+f usr/share/man/man1m/eeprom.1m 0444 root bin
+f usr/share/man/man1m/embedded_su.1m 0444 root bin
+f usr/share/man/man1m/etrn.1m 0444 root bin
+s usr/share/man/man1m/fcadm.1m=fcinfo.1m
+f usr/share/man/man1m/fcinfo.1m 0444 root bin
+f usr/share/man/man1m/fdetach.1m 0444 root bin
+f usr/share/man/man1m/fdisk.1m 0444 root bin
+f usr/share/man/man1m/ff.1m 0444 root bin
+f usr/share/man/man1m/ff_ufs.1m 0444 root bin
+f usr/share/man/man1m/fiocompress.1m 0444 root bin
+f usr/share/man/man1m/flowadm.1m 0444 root bin
+f usr/share/man/man1m/fmadm.1m 0444 root bin
+f usr/share/man/man1m/fmd.1m 0444 root bin
+f usr/share/man/man1m/fmdump.1m 0444 root bin
+f usr/share/man/man1m/fmstat.1m 0444 root bin
+f usr/share/man/man1m/fmthard.1m 0444 root bin
+f usr/share/man/man1m/format.1m 0444 root bin
+f usr/share/man/man1m/fsck.1m 0444 root bin
+f usr/share/man/man1m/fsck_ufs.1m 0444 root bin
+f usr/share/man/man1m/fsdb.1m 0444 root bin
+f usr/share/man/man1m/fsdb_ufs.1m 0444 root bin
+f usr/share/man/man1m/fsirand.1m 0444 root bin
+f usr/share/man/man1m/fssnap.1m 0444 root bin
+f usr/share/man/man1m/fssnap_ufs.1m 0444 root bin
+f usr/share/man/man1m/fsstat.1m 0444 root bin
+f usr/share/man/man1m/fstyp.1m 0444 root bin
+f usr/share/man/man1m/ftpaddhost.1m 0444 root bin
+f usr/share/man/man1m/ftpconfig.1m 0444 root bin
+s usr/share/man/man1m/ftpd.1m=in.ftpd.1m
+f usr/share/man/man1m/ftprestart.1m 0444 root bin
+f usr/share/man/man1m/ftpshut.1m 0444 root bin
+f usr/share/man/man1m/fuser.1m 0444 root bin
+f usr/share/man/man1m/fwflash.1m 0444 root bin
+f usr/share/man/man1m/getdev.1m 0444 root bin
+f usr/share/man/man1m/getdevpolicy.1m 0444 root bin
+f usr/share/man/man1m/getdgrp.1m 0444 root bin
+f usr/share/man/man1m/getent.1m 0444 root bin
+f usr/share/man/man1m/gettable.1m 0444 root bin
+f usr/share/man/man1m/getty.1m 0444 root bin
+f usr/share/man/man1m/getvol.1m 0444 root bin
+f usr/share/man/man1m/groupadd.1m 0444 root bin
+f usr/share/man/man1m/groupdel.1m 0444 root bin
+f usr/share/man/man1m/groupmod.1m 0444 root bin
+s usr/share/man/man1m/grpck.1m=pwck.1m
+f usr/share/man/man1m/gsscred.1m 0444 root bin
+f usr/share/man/man1m/gssd.1m 0444 root bin
+f usr/share/man/man1m/halt.1m 0444 root bin
+f usr/share/man/man1m/hostconfig.1m 0444 root bin
+f usr/share/man/man1m/htable.1m 0444 root bin
+f usr/share/man/man1m/id.1m 0444 root bin
+f usr/share/man/man1m/idmap.1m 0444 root bin
+f usr/share/man/man1m/idmapd.1m 0444 root bin
+f usr/share/man/man1m/if_mpadm.1m 0444 root bin
+f usr/share/man/man1m/ifconfig.1m 0444 root bin
+f usr/share/man/man1m/ifparse.1m 0444 root bin
+f usr/share/man/man1m/ikeadm.1m 0444 root bin
+f usr/share/man/man1m/ikecert.1m 0444 root bin
+f usr/share/man/man1m/in.ftpd.1m 0444 root bin
+f usr/share/man/man1m/in.iked.1m 0444 root bin
+f usr/share/man/man1m/in.mpathd.1m 0444 root bin
+f usr/share/man/man1m/in.ndpd.1m 0444 root bin
+f usr/share/man/man1m/in.rdisc.1m 0444 root bin
+f usr/share/man/man1m/in.ripngd.1m 0444 root bin
+f usr/share/man/man1m/in.routed.1m 0444 root bin
+f usr/share/man/man1m/inetadm.1m 0444 root bin
+f usr/share/man/man1m/inetconv.1m 0444 root bin
+f usr/share/man/man1m/inetd.1m 0444 root bin
+f usr/share/man/man1m/infocmp.1m 0444 root bin
+f usr/share/man/man1m/init.1m 0444 root bin
+f usr/share/man/man1m/install.1m 0444 root bin
+f usr/share/man/man1m/installgrub.1m 0444 root bin
+f usr/share/man/man1m/intrd.1m 0444 root bin
+s usr/share/man/man1m/intro.1m=Intro.1m
+f usr/share/man/man1m/intrstat.1m 0444 root bin
+f usr/share/man/man1m/iostat.1m 0444 root bin
+f usr/share/man/man1m/ipaddrsel.1m 0444 root bin
+f usr/share/man/man1m/ipadm.1m 0444 root bin
+f usr/share/man/man1m/ipdadm.1m 0444 root bin
+f usr/share/man/man1m/ipf.1m 0444 root bin
+f usr/share/man/man1m/ipfs.1m 0444 root bin
+f usr/share/man/man1m/ipfstat.1m 0444 root bin
+f usr/share/man/man1m/ipmon.1m 0444 root bin
+f usr/share/man/man1m/ipmpstat.1m 0444 root bin
+f usr/share/man/man1m/ipnat.1m 0444 root bin
+f usr/share/man/man1m/ippool.1m 0444 root bin
+f usr/share/man/man1m/ipqosconf.1m 0444 root bin
+f usr/share/man/man1m/ipsecalgs.1m 0444 root bin
+f usr/share/man/man1m/ipsecconf.1m 0444 root bin
+f usr/share/man/man1m/ipseckey.1m 0444 root bin
+f usr/share/man/man1m/iscsiadm.1m 0444 root bin
+f usr/share/man/man1m/itadm.1m 0444 root bin
+f usr/share/man/man1m/kernel.1m 0444 root bin
+f usr/share/man/man1m/keyserv.1m 0444 root bin
+f usr/share/man/man1m/killall.1m 0444 root bin
+f usr/share/man/man1m/ksslcfg.1m 0444 root bin
+f usr/share/man/man1m/kstat.1m 0444 root bin
+f usr/share/man/man1m/labelit.1m 0444 root bin
+f usr/share/man/man1m/labelit_hsfs.1m 0444 root bin
+f usr/share/man/man1m/labelit_ufs.1m 0444 root bin
+f usr/share/man/man1m/ldap_cachemgr.1m 0444 root bin
+f usr/share/man/man1m/ldapaddent.1m 0444 root bin
+f usr/share/man/man1m/ldapclient.1m 0444 root bin
+f usr/share/man/man1m/link.1m 0444 root bin
+f usr/share/man/man1m/listdgrp.1m 0444 root bin
+f usr/share/man/man1m/listen.1m 0444 root bin
+f usr/share/man/man1m/lms.1m 0444 root bin
+f usr/share/man/man1m/locator.1m 0444 root bin
+f usr/share/man/man1m/lockfs.1m 0444 root bin
+f usr/share/man/man1m/lockstat.1m 0444 root bin
+f usr/share/man/man1m/lofiadm.1m 0444 root bin
+f usr/share/man/man1m/logadm.1m 0444 root bin
+f usr/share/man/man1m/logins.1m 0444 root bin
+f usr/share/man/man1m/mail.local.1m 0444 root bin
+f usr/share/man/man1m/makedbm.1m 0444 root bin
+f usr/share/man/man1m/makemap.1m 0444 root bin
+f usr/share/man/man1m/mkdevalloc.1m 0444 root bin
+f usr/share/man/man1m/mkdevmaps.1m 0444 root bin
+f usr/share/man/man1m/mkfifo.1m 0444 root bin
+f usr/share/man/man1m/mkfile.1m 0444 root bin
+f usr/share/man/man1m/mkfs.1m 0444 root bin
+f usr/share/man/man1m/mkfs_pcfs.1m 0444 root bin
+f usr/share/man/man1m/mkfs_udfs.1m 0444 root bin
+f usr/share/man/man1m/mkfs_ufs.1m 0444 root bin
+f usr/share/man/man1m/mknod.1m 0444 root bin
+f usr/share/man/man1m/mkpwdict.1m 0444 root bin
+f usr/share/man/man1m/modinfo.1m 0444 root bin
+f usr/share/man/man1m/modload.1m 0444 root bin
+f usr/share/man/man1m/modunload.1m 0444 root bin
+f usr/share/man/man1m/mount.1m 0444 root bin
+f usr/share/man/man1m/mount_hsfs.1m 0444 root bin
+f usr/share/man/man1m/mount_nfs.1m 0444 root bin
+f usr/share/man/man1m/mount_pcfs.1m 0444 root bin
+f usr/share/man/man1m/mount_smbfs.1m 0444 root bin
+f usr/share/man/man1m/mount_tmpfs.1m 0444 root bin
+f usr/share/man/man1m/mount_udfs.1m 0444 root bin
+f usr/share/man/man1m/mount_ufs.1m 0444 root bin
+f usr/share/man/man1m/mountall.1m 0444 root bin
+f usr/share/man/man1m/mountd.1m 0444 root bin
+f usr/share/man/man1m/mpathadm.1m 0444 root bin
+f usr/share/man/man1m/mpstat.1m 0444 root bin
+f usr/share/man/man1m/msgid.1m 0444 root bin
+f usr/share/man/man1m/mvdir.1m 0444 root bin
+f usr/share/man/man1m/ncheck.1m 0444 root bin
+f usr/share/man/man1m/ncheck_ufs.1m 0444 root bin
+f usr/share/man/man1m/ndd.1m 0444 root bin
+f usr/share/man/man1m/netstat.1m 0444 root bin
+f usr/share/man/man1m/netstrategy.1m 0444 root bin
+f usr/share/man/man1m/newaliases.1m 0444 root bin
+f usr/share/man/man1m/newfs.1m 0444 root bin
+f usr/share/man/man1m/newkey.1m 0444 root bin
+f usr/share/man/man1m/nfsd.1m 0444 root bin
+f usr/share/man/man1m/nfslogd.1m 0444 root bin
+f usr/share/man/man1m/nfsstat.1m 0444 root bin
+f usr/share/man/man1m/nlsadmin.1m 0444 root bin
+f usr/share/man/man1m/nscd.1m 0444 root bin
+f usr/share/man/man1m/nwamd.1m 0444 root bin
+f usr/share/man/man1m/passmgmt.1m 0444 root bin
+f usr/share/man/man1m/pbind.1m 0444 root bin
+f usr/share/man/man1m/picld.1m 0444 root bin
+f usr/share/man/man1m/ping.1m 0444 root bin
+f usr/share/man/man1m/plockstat.1m 0444 root bin
+f usr/share/man/man1m/pmadm.1m 0444 root bin
+f usr/share/man/man1m/pmconfig.1m 0444 root bin
+f usr/share/man/man1m/pooladm.1m 0444 root bin
+f usr/share/man/man1m/poolbind.1m 0444 root bin
+f usr/share/man/man1m/poolcfg.1m 0444 root bin
+f usr/share/man/man1m/poold.1m 0444 root bin
+f usr/share/man/man1m/poolstat.1m 0444 root bin
+f usr/share/man/man1m/ports.1m 0444 root bin
+s usr/share/man/man1m/poweroff.1m=halt.1m
+f usr/share/man/man1m/praudit.1m 0444 root bin
+f usr/share/man/man1m/projadd.1m 0444 root bin
+f usr/share/man/man1m/projdel.1m 0444 root bin
+f usr/share/man/man1m/projmod.1m 0444 root bin
+f usr/share/man/man1m/prstat.1m 0444 root bin
+f usr/share/man/man1m/prtconf.1m 0444 root bin
+f usr/share/man/man1m/prtdiag.1m 0444 root bin
+f usr/share/man/man1m/prtpicl.1m 0444 root bin
+f usr/share/man/man1m/prtvtoc.1m 0444 root bin
+f usr/share/man/man1m/psradm.1m 0444 root bin
+f usr/share/man/man1m/psrinfo.1m 0444 root bin
+f usr/share/man/man1m/psrset.1m 0444 root bin
+f usr/share/man/man1m/putdev.1m 0444 root bin
+f usr/share/man/man1m/putdgrp.1m 0444 root bin
+f usr/share/man/man1m/pwck.1m 0444 root bin
+f usr/share/man/man1m/pwconv.1m 0444 root bin
+f usr/share/man/man1m/quot.1m 0444 root bin
+f usr/share/man/man1m/quota.1m 0444 root bin
+f usr/share/man/man1m/quotacheck.1m 0444 root bin
+s usr/share/man/man1m/quotaoff.1m=quotaon.1m
+f usr/share/man/man1m/quotaon.1m 0444 root bin
+f usr/share/man/man1m/raidctl.1m 0444 root bin
+f usr/share/man/man1m/ramdiskadm.1m 0444 root bin
+f usr/share/man/man1m/rcapadm.1m 0444 root bin
+f usr/share/man/man1m/rcapd.1m 0444 root bin
+f usr/share/man/man1m/rctladm.1m 0444 root bin
+f usr/share/man/man1m/rdate.1m 0444 root bin
+s usr/share/man/man1m/rdisc.1m=in.rdisc.1m
+f usr/share/man/man1m/reboot.1m 0444 root bin
+f usr/share/man/man1m/rem_drv.1m 0444 root bin
+f usr/share/man/man1m/repquota.1m 0444 root bin
+s usr/share/man/man1m/restricted_shell.1m=rsh.1m
+f usr/share/man/man1m/rmt.1m 0444 root bin
+f usr/share/man/man1m/roleadd.1m 0444 root bin
+f usr/share/man/man1m/roledel.1m 0444 root bin
+f usr/share/man/man1m/rolemod.1m 0444 root bin
+f usr/share/man/man1m/route.1m 0444 root bin
+f usr/share/man/man1m/routeadm.1m 0444 root bin
+s usr/share/man/man1m/routed.1m=in.routed.1m
+f usr/share/man/man1m/rpc.rexd.1m 0444 root bin
+f usr/share/man/man1m/rpcbind.1m 0444 root bin
+f usr/share/man/man1m/rpcinfo.1m 0444 root bin
+f usr/share/man/man1m/rquotad.1m 0444 root bin
+f usr/share/man/man1m/rsh.1m 0444 root bin
+f usr/share/man/man1m/rtc.1m 0444 root bin
+f usr/share/man/man1m/rtquery.1m 0444 root bin
+f usr/share/man/man1m/rwall.1m 0444 root bin
+f usr/share/man/man1m/sac.1m 0444 root bin
+f usr/share/man/man1m/sacadm.1m 0444 root bin
+f usr/share/man/man1m/saf.1m 0444 root bin
+f usr/share/man/man1m/sasinfo.1m 0444 root bin
+f usr/share/man/man1m/savecore.1m 0444 root bin
+f usr/share/man/man1m/sbdadm.1m 0444 root bin
+f usr/share/man/man1m/sendmail.1m 0444 root bin
+f usr/share/man/man1m/setuname.1m 0444 root bin
+f usr/share/man/man1m/sftp-server.1m 0444 root bin
+f usr/share/man/man1m/share.1m 0444 root bin
+f usr/share/man/man1m/share_nfs.1m 0444 root bin
+f usr/share/man/man1m/shareall.1m 0444 root bin
+f usr/share/man/man1m/sharectl.1m 0444 root bin
+f usr/share/man/man1m/sharemgr.1m 0444 root bin
+f usr/share/man/man1m/showmount.1m 0444 root bin
+f usr/share/man/man1m/shutdown.1m 0444 root bin
+f usr/share/man/man1m/slpd.1m 0444 root bin
+f usr/share/man/man1m/smbadm.1m 0444 root bin
+f usr/share/man/man1m/smbd.1m 0444 root bin
+f usr/share/man/man1m/smbiod.1m 0444 root bin
+f usr/share/man/man1m/smbios.1m 0444 root bin
+f usr/share/man/man1m/smbstat.1m 0444 root bin
+f usr/share/man/man1m/smrsh.1m 0444 root bin
+f usr/share/man/man1m/snoop.1m 0444 root bin
+f usr/share/man/man1m/soconfig.1m 0444 root bin
+f usr/share/man/man1m/sppptun.1m 0444 root bin
+f usr/share/man/man1m/spray.1m 0444 root bin
+f usr/share/man/man1m/ssh-keysign.1m 0444 root bin
+f usr/share/man/man1m/sshd.1m 0444 root bin
+f usr/share/man/man1m/stmfadm.1m 0444 root bin
+f usr/share/man/man1m/stmsboot.1m 0444 root bin
+f usr/share/man/man1m/strace.1m 0444 root bin
+f usr/share/man/man1m/strclean.1m 0444 root bin
+f usr/share/man/man1m/strerr.1m 0444 root bin
+f usr/share/man/man1m/sttydefs.1m 0444 root bin
+f usr/share/man/man1m/su.1m 0444 root bin
+f usr/share/man/man1m/sulogin.1m 0444 root bin
+f usr/share/man/man1m/svc.configd.1m 044 root bin
+f usr/share/man/man1m/svc.ipfd.1m 044 root bin
+f usr/share/man/man1m/svc.startd.1m 044 root bin
+f usr/share/man/man1m/svcadm.1m 0444 root bin
+f usr/share/man/man1m/svccfg.1m 0444 root bin
+f usr/share/man/man1m/swap.1m 0444 root bin
+f usr/share/man/man1m/sync.1m 0444 root bin
+f usr/share/man/man1m/syncinit.1m 0444 root bin
+f usr/share/man/man1m/syncloop.1m 0444 root bin
+f usr/share/man/man1m/syncstat.1m 0444 root bin
+f usr/share/man/man1m/sysdef.1m 0444 root bin
+f usr/share/man/man1m/syseventadm.1m 0444 root bin
+f usr/share/man/man1m/syseventconfd.1m 0444 root bin
+f usr/share/man/man1m/syseventd.1m 0444 root bin
+f usr/share/man/man1m/syslogd.1m 0444 root bin
+f usr/share/man/man1m/tapes.1m 0444 root bin
+f usr/share/man/man1m/tcpd.1m 0444 root bin
+f usr/share/man/man1m/tcpdchk.1m 0444 root bin
+f usr/share/man/man1m/tcpdmatch.1m 0444 root bin
+f usr/share/man/man1m/tic.1m 0444 root bin
+f usr/share/man/man1m/traceroute.1m 0444 root bin
+f usr/share/man/man1m/trapstat.1m 0444 root bin
+f usr/share/man/man1m/ttyadm.1m 0444 root bin
+f usr/share/man/man1m/ttymon.1m 0444 root bin
+f usr/share/man/man1m/tunefs.1m 0444 root bin
+f usr/share/man/man1m/tzselect.1m 0444 root bin
+f usr/share/man/man1m/uadmin.1m 0444 root bin
+f usr/share/man/man1m/ucodeadm.1m 0444 root bin
+f usr/share/man/man1m/ufsdump.1m 0444 root bin
+f usr/share/man/man1m/ufsrestore.1m 0444 root bin
+s usr/share/man/man1m/umount.1m=mount.1m
+s usr/share/man/man1m/umount_smbfs.1m=mount_smbfs.1m
+s usr/share/man/man1m/umountall.1m=mountall.1m
+s usr/share/man/man1m/unlink.1m=link.1m
+f usr/share/man/man1m/unshare.1m 0444 root bin
+f usr/share/man/man1m/unshare_nfs.1m 0444 root bin
+s usr/share/man/man1m/unshareall.1m=shareall.1m
+f usr/share/man/man1m/update_drv.1m 0444 root bin
+f usr/share/man/man1m/useradd.1m 0444 root bin
+f usr/share/man/man1m/userdel.1m 0444 root bin
+f usr/share/man/man1m/usermod.1m 0444 root bin
+f usr/share/man/man1m/utmpd.1m 0444 root bin
+f usr/share/man/man1m/vmstat.1m 0444 root bin
+f usr/share/man/man1m/volcopy.1m 0444 root bin
+f usr/share/man/man1m/volcopy_ufs.1m 0444 root bin
+f usr/share/man/man1m/wall.1m 0444 root bin
+f usr/share/man/man1m/whodo.1m 0444 root bin
+f usr/share/man/man1m/wracct.1m 0444 root bin
+f usr/share/man/man1m/wusbadm.1m 0444 root bin
+f usr/share/man/man1m/ypinit.1m 0444 root bin
+f usr/share/man/man1m/yppoll.1m 0444 root bin
+f usr/share/man/man1m/ypset.1m 0444 root bin
+f usr/share/man/man1m/zdb.1m 0444 root bin
+f usr/share/man/man1m/zdump.1m 0444 root bin
+f usr/share/man/man1m/zfs.1m 0444 root bin
+f usr/share/man/man1m/zic.1m 0444 root bin
+f usr/share/man/man1m/zoneadm.1m 0444 root bin
+f usr/share/man/man1m/zoneadmd.1m 0444 root bin
+f usr/share/man/man1m/zonecfg.1m 0444 root bin
+f usr/share/man/man1m/zpool.1m 0444 root bin
+f usr/share/man/man1m/zstreamdump.1m 0444 root bin
+d usr/share/man/man2 0755 root bin
+f usr/share/man/man2/Intro.2 0444 root bin
+s usr/share/man/man2/_Exit.2=exit.2
+s usr/share/man/man2/_exit.2=exit.2
+s usr/share/man/man2/_lwp_cond_broadcast.2=_lwp_cond_signal.2
+s usr/share/man/man2/_lwp_cond_reltimedwait.2=_lwp_cond_wait.2
+f usr/share/man/man2/_lwp_cond_signal.2 0444 root bin
+s usr/share/man/man2/_lwp_cond_timedwait.2=_lwp_cond_wait.2
+f usr/share/man/man2/_lwp_cond_wait.2 0444 root bin
+s usr/share/man/man2/_lwp_continue.2=_lwp_suspend.2
+f usr/share/man/man2/_lwp_info.2 0444 root bin
+f usr/share/man/man2/_lwp_kill.2 0444 root bin
+f usr/share/man/man2/_lwp_mutex_lock.2 0444 root bin
+s usr/share/man/man2/_lwp_mutex_trylock.2=_lwp_mutex_lock.2
+s usr/share/man/man2/_lwp_mutex_unlock.2=_lwp_mutex_lock.2
+f usr/share/man/man2/_lwp_self.2 0444 root bin
+s usr/share/man/man2/_lwp_sema_init.2=_lwp_sema_wait.2
+s usr/share/man/man2/_lwp_sema_post.2=_lwp_sema_wait.2
+s usr/share/man/man2/_lwp_sema_trywait.2=_lwp_sema_wait.2
+f usr/share/man/man2/_lwp_sema_wait.2 0444 root bin
+f usr/share/man/man2/_lwp_suspend.2 0444 root bin
+f usr/share/man/man2/access.2 0444 root bin
+f usr/share/man/man2/acct.2 0444 root bin
+f usr/share/man/man2/acl.2 0444 root bin
+f usr/share/man/man2/adjtime.2 0444 root bin
+f usr/share/man/man2/alarm.2 0444 root bin
+f usr/share/man/man2/audit.2 0444 root bin
+f usr/share/man/man2/auditon.2 0444 root bin
+f usr/share/man/man2/brk.2 0444 root bin
+f usr/share/man/man2/chdir.2 0444 root bin
+f usr/share/man/man2/chmod.2 0444 root bin
+f usr/share/man/man2/chown.2 0444 root bin
+f usr/share/man/man2/chroot.2 0444 root bin
+f usr/share/man/man2/close.2 0444 root bin
+f usr/share/man/man2/creat.2 0444 root bin
+f usr/share/man/man2/dup.2 0444 root bin
+f usr/share/man/man2/exec.2 0444 root bin
+s usr/share/man/man2/execl.2=exec.2
+s usr/share/man/man2/execle.2=exec.2
+s usr/share/man/man2/execlp.2=exec.2
+s usr/share/man/man2/execv.2=exec.2
+s usr/share/man/man2/execve.2=exec.2
+s usr/share/man/man2/execvp.2=exec.2
+f usr/share/man/man2/exit.2 0444 root bin
+s usr/share/man/man2/faccessat.2=access.2
+s usr/share/man/man2/facl.2=acl.2
+s usr/share/man/man2/fchdir.2=chdir.2
+s usr/share/man/man2/fchmod.2=chmod.2
+s usr/share/man/man2/fchown.2=chown.2
+s usr/share/man/man2/fchownat.2=chown.2
+s usr/share/man/man2/fchroot.2=chroot.2
+f usr/share/man/man2/fcntl.2 0444 root bin
+f usr/share/man/man2/fork.2 0444 root bin
+s usr/share/man/man2/fork1.2=fork.2
+s usr/share/man/man2/forkall.2=fork.2
+s usr/share/man/man2/forkallx.2=fork.2
+s usr/share/man/man2/forkx.2=fork.2
+f usr/share/man/man2/fpathconf.2 0444 root bin
+s usr/share/man/man2/fstat.2=stat.2
+s usr/share/man/man2/fstatat.2=stat.2
+s usr/share/man/man2/fstatvfs.2=statvfs.2
+s usr/share/man/man2/futimesat.2=utimes.2
+f usr/share/man/man2/getacct.2 0444 root bin
+f usr/share/man/man2/getaudit.2 0444 root bin
+s usr/share/man/man2/getaudit_addr.2=getaudit.2
+f usr/share/man/man2/getauid.2 0444 root bin
+f usr/share/man/man2/getcontext.2 0444 root bin
+f usr/share/man/man2/getdents.2 0444 root bin
+s usr/share/man/man2/getegid.2=getuid.2
+s usr/share/man/man2/geteuid.2=getuid.2
+s usr/share/man/man2/getgid.2=getuid.2
+f usr/share/man/man2/getgroups.2 0444 root bin
+f usr/share/man/man2/getisax.2 0444 root bin
+f usr/share/man/man2/getitimer.2 0444 root bin
+f usr/share/man/man2/getmsg.2 0444 root bin
+f usr/share/man/man2/getpflags.2 0444 root bin
+s usr/share/man/man2/getpgid.2=getpid.2
+s usr/share/man/man2/getpgrp.2=getpid.2
+f usr/share/man/man2/getpid.2 0444 root bin
+s usr/share/man/man2/getpmsg.2=getmsg.2
+s usr/share/man/man2/getppid.2=getpid.2
+f usr/share/man/man2/getppriv.2 0444 root bin
+s usr/share/man/man2/getprojid.2=settaskid.2
+s usr/share/man/man2/getrctl.2=setrctl.2
+f usr/share/man/man2/getrlimit.2 0444 root bin
+f usr/share/man/man2/getsid.2 0444 root bin
+s usr/share/man/man2/gettaskid.2=settaskid.2
+f usr/share/man/man2/getuid.2 0444 root bin
+f usr/share/man/man2/getustack.2 0444 root bin
+s usr/share/man/man2/intro.2=Intro.2
+f usr/share/man/man2/ioctl.2 0444 root bin
+f usr/share/man/man2/issetugid.2 0444 root bin
+f usr/share/man/man2/kill.2 0444 root bin
+s usr/share/man/man2/lchown.2=chown.2
+f usr/share/man/man2/link.2 0444 root bin
+f usr/share/man/man2/llseek.2 0444 root bin
+f usr/share/man/man2/lseek.2 0444 root bin
+s usr/share/man/man2/lstat.2=stat.2
+f usr/share/man/man2/memcntl.2 0444 root bin
+f usr/share/man/man2/meminfo.2 0444 root bin
+f usr/share/man/man2/mincore.2 0444 root bin
+f usr/share/man/man2/mkdir.2 0444 root bin
+f usr/share/man/man2/mknod.2 0444 root bin
+f usr/share/man/man2/mmap.2 0444 root bin
+f usr/share/man/man2/mmapobj.2 0444 root bin
+f usr/share/man/man2/mount.2 0444 root bin
+f usr/share/man/man2/mprotect.2 0444 root bin
+f usr/share/man/man2/msgctl.2 0444 root bin
+f usr/share/man/man2/msgget.2 0444 root bin
+f usr/share/man/man2/msgids.2 0444 root bin
+f usr/share/man/man2/msgrcv.2 0444 root bin
+f usr/share/man/man2/msgsnap.2 0444 root bin
+f usr/share/man/man2/msgsnd.2 0444 root bin
+f usr/share/man/man2/munmap.2 0444 root bin
+f usr/share/man/man2/nice.2 0444 root bin
+f usr/share/man/man2/ntp_adjtime.2 0444 root bin
+f usr/share/man/man2/ntp_gettime.2 0444 root bin
+f usr/share/man/man2/open.2 0444 root bin
+s usr/share/man/man2/openat.2=open.2
+f usr/share/man/man2/p_online.2 0444 root bin
+s usr/share/man/man2/pathconf.2=fpathconf.2
+f usr/share/man/man2/pause.2 0444 root bin
+f usr/share/man/man2/pcsample.2 0444 root bin
+f usr/share/man/man2/pipe.2 0444 root bin
+s usr/share/man/man2/pipe2.2=pipe.2
+f usr/share/man/man2/poll.2 0444 root bin
+s usr/share/man/man2/pread.2=read.2
+f usr/share/man/man2/priocntl.2 0444 root bin
+f usr/share/man/man2/priocntlset.2 0444 root bin
+f usr/share/man/man2/processor_bind.2 0444 root bin
+f usr/share/man/man2/processor_info.2 0444 root bin
+f usr/share/man/man2/profil.2 0444 root bin
+s usr/share/man/man2/pset_assign.2=pset_create.2
+f usr/share/man/man2/pset_bind.2 0444 root bin
+f usr/share/man/man2/pset_create.2 0444 root bin
+s usr/share/man/man2/pset_destroy.2=pset_create.2
+s usr/share/man/man2/pset_getattr.2=pset_setattr.2
+f usr/share/man/man2/pset_info.2 0444 root bin
+f usr/share/man/man2/pset_list.2 0444 root bin
+f usr/share/man/man2/pset_setattr.2 0444 root bin
+s usr/share/man/man2/putacct.2=getacct.2
+f usr/share/man/man2/putmsg.2 0444 root bin
+s usr/share/man/man2/putpmsg.2=putmsg.2
+s usr/share/man/man2/pwrite.2=write.2
+f usr/share/man/man2/read.2 0444 root bin
+f usr/share/man/man2/readlink.2 0444 root bin
+s usr/share/man/man2/readv.2=read.2
+f usr/share/man/man2/rename.2 0444 root bin
+s usr/share/man/man2/renameat.2=rename.2
+f usr/share/man/man2/resolvepath.2 0444 root bin
+f usr/share/man/man2/rmdir.2 0444 root bin
+s usr/share/man/man2/sbrk.2=brk.2
+f usr/share/man/man2/semctl.2 0444 root bin
+f usr/share/man/man2/semget.2 0444 root bin
+f usr/share/man/man2/semids.2 0444 root bin
+f usr/share/man/man2/semop.2 0444 root bin
+s usr/share/man/man2/semtimedop.2=semop.2
+s usr/share/man/man2/setaudit.2=getaudit.2
+s usr/share/man/man2/setaudit_addr.2=getaudit.2
+s usr/share/man/man2/setauid.2=getauid.2
+s usr/share/man/man2/setcontext.2=getcontext.2
+s usr/share/man/man2/setegid.2=setuid.2
+s usr/share/man/man2/seteuid.2=setuid.2
+s usr/share/man/man2/setgid.2=setuid.2
+s usr/share/man/man2/setgroups.2=getgroups.2
+s usr/share/man/man2/setitimer.2=getitimer.2
+s usr/share/man/man2/setpflags.2=getpflags.2
+f usr/share/man/man2/setpgid.2 0444 root bin
+f usr/share/man/man2/setpgrp.2 0444 root bin
+s usr/share/man/man2/setppriv.2=getppriv.2
+f usr/share/man/man2/setrctl.2 0444 root bin
+f usr/share/man/man2/setregid.2 0444 root bin
+f usr/share/man/man2/setreuid.2 0444 root bin
+s usr/share/man/man2/setrlimit.2=getrlimit.2
+f usr/share/man/man2/setsid.2 0444 root bin
+f usr/share/man/man2/settaskid.2 0444 root bin
+f usr/share/man/man2/setuid.2 0444 root bin
+s usr/share/man/man2/setustack.2=getustack.2
+s usr/share/man/man2/shmat.2=shmop.2
+f usr/share/man/man2/shmctl.2 0444 root bin
+s usr/share/man/man2/shmdt.2=shmop.2
+f usr/share/man/man2/shmget.2 0444 root bin
+f usr/share/man/man2/shmids.2 0444 root bin
+f usr/share/man/man2/shmop.2 0444 root bin
+f usr/share/man/man2/sigaction.2 0444 root bin
+f usr/share/man/man2/sigaltstack.2 0444 root bin
+f usr/share/man/man2/sigpending.2 0444 root bin
+f usr/share/man/man2/sigprocmask.2 0444 root bin
+f usr/share/man/man2/sigsend.2 0444 root bin
+s usr/share/man/man2/sigsendset.2=sigsend.2
+f usr/share/man/man2/sigsuspend.2 0444 root bin
+f usr/share/man/man2/sigwait.2 0444 root bin
+f usr/share/man/man2/stat.2 0444 root bin
+f usr/share/man/man2/statvfs.2 0444 root bin
+f usr/share/man/man2/stime.2 0444 root bin
+f usr/share/man/man2/swapctl.2 0444 root bin
+f usr/share/man/man2/symlink.2 0444 root bin
+f usr/share/man/man2/sync.2 0444 root bin
+f usr/share/man/man2/sysfs.2 0444 root bin
+f usr/share/man/man2/sysinfo.2 0444 root bin
+f usr/share/man/man2/time.2 0444 root bin
+f usr/share/man/man2/times.2 0444 root bin
+f usr/share/man/man2/uadmin.2 0444 root bin
+f usr/share/man/man2/ulimit.2 0444 root bin
+f usr/share/man/man2/umask.2 0444 root bin
+f usr/share/man/man2/umount.2 0444 root bin
+s usr/share/man/man2/umount2.2=umount.2
+f usr/share/man/man2/uname.2 0444 root bin
+f usr/share/man/man2/unlink.2 0444 root bin
+s usr/share/man/man2/unlinkat.2=unlink.2
+f usr/share/man/man2/ustat.2 0444 root bin
+f usr/share/man/man2/utime.2 0444 root bin
+f usr/share/man/man2/utimes.2 0444 root bin
+f usr/share/man/man2/uucopy.2 0444 root bin
+f usr/share/man/man2/vfork.2 0444 root bin
+s usr/share/man/man2/vforkx.2=vfork.2
+f usr/share/man/man2/vhangup.2 0444 root bin
+f usr/share/man/man2/waitid.2 0444 root bin
+s usr/share/man/man2/wracct.2=getacct.2
+f usr/share/man/man2/write.2 0444 root bin
+s usr/share/man/man2/writev.2=write.2
+f usr/share/man/man2/yield.2 0444 root bin
+d usr/share/man/man3 0755 root bin
+f usr/share/man/man3/Intro.3 0444 root bin
+f usr/share/man/man3/hosts_access.3 0444 root bin
+s usr/share/man/man3/intro.3=Intro.3
+s usr/share/man/man3/libwrap.3=hosts_access.3
+d usr/share/man/man3bsm 0755 root bin
+s usr/share/man/man3bsm/au_close.3bsm=au_open.3bsm
+f usr/share/man/man3bsm/au_open.3bsm 0444 root bin
+f usr/share/man/man3bsm/au_preselect.3bsm 0444 root bin
+f usr/share/man/man3bsm/au_to.3bsm 0444 root bin
+s usr/share/man/man3bsm/au_to_arg.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_arg32.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_arg64.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_attr.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_cmd.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_data.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_groups.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_in_addr.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_ipc.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_iport.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_me.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_newgroups.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_opaque.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_path.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_process.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_process_ex.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_return.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_return32.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_return64.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_socket.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_subject.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_subject_ex.3bsm=au_to.3bsm
+s usr/share/man/man3bsm/au_to_text.3bsm=au_to.3bsm
+f usr/share/man/man3bsm/au_user_mask.3bsm 0444 root bin
+s usr/share/man/man3bsm/au_write.3bsm=au_open.3bsm
+s usr/share/man/man3bsm/endac.3bsm=getacinfo.3bsm
+s usr/share/man/man3bsm/endauclass.3bsm=getauclassent.3bsm
+s usr/share/man/man3bsm/endauevent.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/endauuser.3bsm=getauusernam.3bsm
+s usr/share/man/man3bsm/endddent.3bsm=getddent.3bsm
+s usr/share/man/man3bsm/getacdir.3bsm=getacinfo.3bsm
+s usr/share/man/man3bsm/getacflg.3bsm=getacinfo.3bsm
+f usr/share/man/man3bsm/getacinfo.3bsm 0444 root bin
+s usr/share/man/man3bsm/getacmin.3bsm=getacinfo.3bsm
+s usr/share/man/man3bsm/getacna.3bsm=getacinfo.3bsm
+f usr/share/man/man3bsm/getauclassent.3bsm 0444 root bin
+s usr/share/man/man3bsm/getauclassent_r.3bsm=getauclassent.3bsm
+s usr/share/man/man3bsm/getauclassnam.3bsm=getauclassent.3bsm
+s usr/share/man/man3bsm/getauclassnam_r.3bsm=getauclassent.3bsm
+f usr/share/man/man3bsm/getauditflags.3bsm 0444 root bin
+s usr/share/man/man3bsm/getauditflagsbin.3bsm=getauditflags.3bsm
+s usr/share/man/man3bsm/getauditflagschar.3bsm=getauditflags.3bsm
+f usr/share/man/man3bsm/getauevent.3bsm 0444 root bin
+s usr/share/man/man3bsm/getauevent_r.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/getauevnam.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/getauevnam_r.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/getauevnonam.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/getauevnum.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/getauevnum_r.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/getauuserent.3bsm=getauusernam.3bsm
+s usr/share/man/man3bsm/getauuserent_r.3bsm=getauusernam.3bsm
+f usr/share/man/man3bsm/getauusernam.3bsm 0444 root bin
+s usr/share/man/man3bsm/getauusernam_r.3bsm=getauusernam.3bsm
+f usr/share/man/man3bsm/getddent.3bsm 0444 root bin
+s usr/share/man/man3bsm/getddnam.3bsm=getddent.3bsm
+f usr/share/man/man3bsm/getfauditflags.3bsm 0444 root bin
+s usr/share/man/man3bsm/setac.3bsm=getacinfo.3bsm
+s usr/share/man/man3bsm/setauclass.3bsm=getauclassent.3bsm
+s usr/share/man/man3bsm/setauevent.3bsm=getauevent.3bsm
+s usr/share/man/man3bsm/setauuser.3bsm=getauusernam.3bsm
+s usr/share/man/man3bsm/setddent.3bsm=getddent.3bsm
+s usr/share/man/man3bsm/setddfile.3bsm=getddent.3bsm
+d usr/share/man/man3c 0755 root bin
+s usr/share/man/man3c/FD_CLR.3c=select.3c
+s usr/share/man/man3c/FD_ISSET.3c=select.3c
+s usr/share/man/man3c/FD_SET.3c=select.3c
+s usr/share/man/man3c/FD_ZERO.3c=select.3c
+f usr/share/man/man3c/__fbufsize.3c 0444 root bin
+s usr/share/man/man3c/__flbf.3c=__fbufsize.3c
+s usr/share/man/man3c/__fpending.3c=__fbufsize.3c
+s usr/share/man/man3c/__fpurge.3c=__fbufsize.3c
+s usr/share/man/man3c/__freadable.3c=__fbufsize.3c
+s usr/share/man/man3c/__freading.3c=__fbufsize.3c
+s usr/share/man/man3c/__fsetlocking.3c=__fbufsize.3c
+s usr/share/man/man3c/__fwritable.3c=__fbufsize.3c
+s usr/share/man/man3c/__fwriting.3c=__fbufsize.3c
+s usr/share/man/man3c/_edata.3c=end.3c
+s usr/share/man/man3c/_end.3c=end.3c
+s usr/share/man/man3c/_etext.3c=end.3c
+s usr/share/man/man3c/_exithandle.3c=exit.3c
+s usr/share/man/man3c/_flushlbf.3c=__fbufsize.3c
+f usr/share/man/man3c/_longjmp.3c 0444 root bin
+s usr/share/man/man3c/_setjmp.3c=_longjmp.3c
+f usr/share/man/man3c/_stack_grow.3c 0444 root bin
+f usr/share/man/man3c/a64l.3c 0444 root bin
+f usr/share/man/man3c/abort.3c 0444 root bin
+f usr/share/man/man3c/abs.3c 0444 root bin
+s usr/share/man/man3c/addrtosymstr.3c=walkcontext.3c
+f usr/share/man/man3c/addsev.3c 0444 root bin
+f usr/share/man/man3c/addseverity.3c 0444 root bin
+f usr/share/man/man3c/aio_cancel.3c 0444 root bin
+f usr/share/man/man3c/aio_error.3c 0444 root bin
+f usr/share/man/man3c/aio_fsync.3c 0444 root bin
+f usr/share/man/man3c/aio_read.3c 0444 root bin
+f usr/share/man/man3c/aio_return.3c 0444 root bin
+f usr/share/man/man3c/aio_suspend.3c 0444 root bin
+f usr/share/man/man3c/aio_waitn.3c 0444 root bin
+f usr/share/man/man3c/aio_write.3c 0444 root bin
+f usr/share/man/man3c/aiocancel.3c 0444 root bin
+f usr/share/man/man3c/aioread.3c 0444 root bin
+f usr/share/man/man3c/aiowait.3c 0444 root bin
+s usr/share/man/man3c/aiowrite.3c=aioread.3c
+s usr/share/man/man3c/alloca.3c=malloc.3c
+s usr/share/man/man3c/alphasort.3c=scandir.3c
+s usr/share/man/man3c/ascftime.3c=strftime.3c
+s usr/share/man/man3c/asctime.3c=ctime.3c
+s usr/share/man/man3c/asctime_r.3c=ctime.3c
+s usr/share/man/man3c/asprintf.3c=printf.3c
+f usr/share/man/man3c/assert.3c 0444 root bin
+f usr/share/man/man3c/atexit.3c 0444 root bin
+s usr/share/man/man3c/atof.3c=strtod.3c
+s usr/share/man/man3c/atoi.3c=strtol.3c
+s usr/share/man/man3c/atol.3c=strtol.3c
+s usr/share/man/man3c/atoll.3c=strtol.3c
+f usr/share/man/man3c/atomic_add.3c 0444 root bin
+s usr/share/man/man3c/atomic_add_16.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_16_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_32.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_32_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_64.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_64_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_8.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_8_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_char.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_char_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_int.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_int_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_long.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_long_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_ptr.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_ptr_nv.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_short.3c=atomic_add.3c
+s usr/share/man/man3c/atomic_add_short_nv.3c=atomic_add.3c
+f usr/share/man/man3c/atomic_and.3c 0444 root bin
+s usr/share/man/man3c/atomic_and_16.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_16_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_32.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_32_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_64.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_64_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_8.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_8_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_uchar.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_uchar_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_uint.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_uint_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_ulong.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_ulong_nv.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_ushort.3c=atomic_and.3c
+s usr/share/man/man3c/atomic_and_ushort_nv.3c=atomic_and.3c
+f usr/share/man/man3c/atomic_bits.3c 0444 root bin
+f usr/share/man/man3c/atomic_cas.3c 0444 root bin
+s usr/share/man/man3c/atomic_cas_16.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_32.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_64.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_8.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_ptr.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_uchar.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_uint.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_ulong.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_cas_ushort.3c=atomic_cas.3c
+s usr/share/man/man3c/atomic_clear_long_excl.3c=atomic_bits.3c
+f usr/share/man/man3c/atomic_dec.3c 0444 root bin
+s usr/share/man/man3c/atomic_dec_16.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_16_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_32.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_32_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_64.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_64_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_8.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_8_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_ptr.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_ptr_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_uchar.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_uchar_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_uint.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_uint_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_ulong.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_ulong_nv.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_ushort.3c=atomic_dec.3c
+s usr/share/man/man3c/atomic_dec_ushort_nv.3c=atomic_dec.3c
+f usr/share/man/man3c/atomic_inc.3c 0444 root bin
+s usr/share/man/man3c/atomic_inc_16.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_16_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_32.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_32_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_64.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_64_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_8.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_8_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_ptr.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_ptr_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_uchar.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_uchar_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_uint.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_uint_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_ulong.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_ulong_nv.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_ushort.3c=atomic_inc.3c
+s usr/share/man/man3c/atomic_inc_ushort_nv.3c=atomic_inc.3c
+f usr/share/man/man3c/atomic_ops.3c 0444 root bin
+f usr/share/man/man3c/atomic_or.3c 0444 root bin
+s usr/share/man/man3c/atomic_or_16.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_16_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_32.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_32_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_64.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_64_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_8.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_8_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_uchar.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_uchar_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_uint.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_uint_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_ulong.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_ulong_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_ushort.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_or_ushort_nv.3c=atomic_or.3c
+s usr/share/man/man3c/atomic_set_long_excl.3c=atomic_bits.3c
+f usr/share/man/man3c/atomic_swap.3c 0444 root bin
+s usr/share/man/man3c/atomic_swap_16.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_32.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_64.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_8.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_ptr.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_uchar.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_uint.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_ulong.3c=atomic_swap.3c
+s usr/share/man/man3c/atomic_swap_ushort.3c=atomic_swap.3c
+f usr/share/man/man3c/attropen.3c 0444 root bin
+s usr/share/man/man3c/backtrace.3c=walkcontext.3c
+s usr/share/man/man3c/backtrace_symbols.3c=walkcontext.3c
+s usr/share/man/man3c/backtrace_symbols_fd.3c=walkcontext.3c
+f usr/share/man/man3c/basename.3c 0444 root bin
+s usr/share/man/man3c/bcmp.3c=bstring.3c
+s usr/share/man/man3c/bcopy.3c=bstring.3c
+s usr/share/man/man3c/bind_textdomain_codeset.3c=gettext.3c
+s usr/share/man/man3c/bindtextdomain.3c=gettext.3c
+f usr/share/man/man3c/bsd_signal.3c 0444 root bin
+f usr/share/man/man3c/bsearch.3c 0444 root bin
+f usr/share/man/man3c/bstring.3c 0444 root bin
+f usr/share/man/man3c/btowc.3c 0444 root bin
+s usr/share/man/man3c/bzero.3c=bstring.3c
+s usr/share/man/man3c/calloc.3c=malloc.3c
+s usr/share/man/man3c/catclose.3c=catopen.3c
+f usr/share/man/man3c/catgets.3c 0444 root bin
+f usr/share/man/man3c/catopen.3c 0444 root bin
+f usr/share/man/man3c/cfgetispeed.3c 0444 root bin
+s usr/share/man/man3c/cfgetospeed.3c=cfgetispeed.3c
+f usr/share/man/man3c/cfsetispeed.3c 0444 root bin
+s usr/share/man/man3c/cfsetospeed.3c=cfsetispeed.3c
+s usr/share/man/man3c/cftime.3c=strftime.3c
+s usr/share/man/man3c/clearerr.3c=ferror.3c
+f usr/share/man/man3c/clock.3c 0444 root bin
+s usr/share/man/man3c/clock_getres.3c=clock_settime.3c
+s usr/share/man/man3c/clock_gettime.3c=clock_settime.3c
+f usr/share/man/man3c/clock_nanosleep.3c 0444 root bin
+f usr/share/man/man3c/clock_settime.3c 0444 root bin
+f usr/share/man/man3c/closedir.3c 0444 root bin
+f usr/share/man/man3c/closefrom.3c 0444 root bin
+s usr/share/man/man3c/closelog.3c=syslog.3c
+s usr/share/man/man3c/cond_broadcast.3c=cond_init.3c
+s usr/share/man/man3c/cond_destroy.3c=cond_init.3c
+f usr/share/man/man3c/cond_init.3c 0444 root bin
+s usr/share/man/man3c/cond_reltimedwait.3c=cond_init.3c
+s usr/share/man/man3c/cond_signal.3c=cond_init.3c
+s usr/share/man/man3c/cond_timedwait.3c=cond_init.3c
+s usr/share/man/man3c/cond_wait.3c=cond_init.3c
+f usr/share/man/man3c/confstr.3c 0444 root bin
+f usr/share/man/man3c/crypt.3c 0444 root bin
+f usr/share/man/man3c/crypt_genhash_impl.3c 0444 root bin
+f usr/share/man/man3c/crypt_gensalt.3c 0444 root bin
+f usr/share/man/man3c/crypt_gensalt_impl.3c 0444 root bin
+f usr/share/man/man3c/cset.3c 0444 root bin
+s usr/share/man/man3c/csetcol.3c=cset.3c
+s usr/share/man/man3c/csetlen.3c=cset.3c
+s usr/share/man/man3c/csetno.3c=cset.3c
+f usr/share/man/man3c/ctermid.3c 0444 root bin
+s usr/share/man/man3c/ctermid_r.3c=ctermid.3c
+f usr/share/man/man3c/ctime.3c 0444 root bin
+s usr/share/man/man3c/ctime_r.3c=ctime.3c
+f usr/share/man/man3c/ctype.3c 0444 root bin
+f usr/share/man/man3c/cuserid.3c 0444 root bin
+f usr/share/man/man3c/daemon.3c 0444 root bin
+s usr/share/man/man3c/dbm_clearerr.3c=ndbm.3c
+s usr/share/man/man3c/dbm_close.3c=ndbm.3c
+s usr/share/man/man3c/dbm_delete.3c=ndbm.3c
+s usr/share/man/man3c/dbm_error.3c=ndbm.3c
+s usr/share/man/man3c/dbm_fetch.3c=ndbm.3c
+s usr/share/man/man3c/dbm_firstkey.3c=ndbm.3c
+s usr/share/man/man3c/dbm_nextkey.3c=ndbm.3c
+s usr/share/man/man3c/dbm_open.3c=ndbm.3c
+s usr/share/man/man3c/dbm_store.3c=ndbm.3c
+s usr/share/man/man3c/dcgettext.3c=gettext.3c
+s usr/share/man/man3c/dcngettext.3c=gettext.3c
+s usr/share/man/man3c/decimal_to_double.3c=decimal_to_floating.3c
+s usr/share/man/man3c/decimal_to_extended.3c=decimal_to_floating.3c
+f usr/share/man/man3c/decimal_to_floating.3c 0444 root bin
+s usr/share/man/man3c/decimal_to_quadruple.3c=decimal_to_floating.3c
+s usr/share/man/man3c/decimal_to_single.3c=decimal_to_floating.3c
+s usr/share/man/man3c/dgettext.3c=gettext.3c
+f usr/share/man/man3c/difftime.3c 0444 root bin
+f usr/share/man/man3c/directio.3c 0444 root bin
+f usr/share/man/man3c/dirfd.3c 0444 root bin
+f usr/share/man/man3c/dirname.3c 0444 root bin
+f usr/share/man/man3c/div.3c 0444 root bin
+f usr/share/man/man3c/dladdr.3c 0444 root bin
+s usr/share/man/man3c/dladdr1.3c=dladdr.3c
+f usr/share/man/man3c/dlclose.3c 0444 root bin
+f usr/share/man/man3c/dldump.3c 0444 root bin
+f usr/share/man/man3c/dlerror.3c 0444 root bin
+f usr/share/man/man3c/dlinfo.3c 0444 root bin
+s usr/share/man/man3c/dlmopen.3c=dlopen.3c
+f usr/share/man/man3c/dlopen.3c 0444 root bin
+f usr/share/man/man3c/dlsym.3c 0444 root bin
+s usr/share/man/man3c/dngettext.3c=gettext.3c
+f usr/share/man/man3c/door_bind.3c 0444 root bin
+f usr/share/man/man3c/door_call.3c 0444 root bin
+f usr/share/man/man3c/door_create.3c 0444 root bin
+f usr/share/man/man3c/door_cred.3c 0444 root bin
+f usr/share/man/man3c/door_getparam.3c 0444 root bin
+f usr/share/man/man3c/door_info.3c 0444 root bin
+f usr/share/man/man3c/door_return.3c 0444 root bin
+f usr/share/man/man3c/door_revoke.3c 0444 root bin
+f usr/share/man/man3c/door_server_create.3c 0444 root bin
+s usr/share/man/man3c/door_setparam.3c=door_getparam.3c
+f usr/share/man/man3c/door_ucred.3c 0444 root bin
+s usr/share/man/man3c/door_unbind.3c=door_bind.3c
+s usr/share/man/man3c/double_to_decimal.3c=floating_to_decimal.3c
+f usr/share/man/man3c/drand48.3c 0444 root bin
+f usr/share/man/man3c/dup2.3c 0444 root bin
+s usr/share/man/man3c/dup3.3c=dup2.3c
+f usr/share/man/man3c/econvert.3c 0444 root bin
+f usr/share/man/man3c/ecvt.3c 0444 root bin
+s usr/share/man/man3c/edata.3c=end.3c
+f usr/share/man/man3c/enable_extended_FILE_stdio.3c 0444 root bin
+f usr/share/man/man3c/encrypt.3c 0444 root bin
+f usr/share/man/man3c/end.3c 0444 root bin
+s usr/share/man/man3c/endgrent.3c=getgrnam.3c
+s usr/share/man/man3c/endnetgrent.3c=getnetgrent.3c
+s usr/share/man/man3c/endpwent.3c=getpwnam.3c
+s usr/share/man/man3c/endspent.3c=getspnam.3c
+s usr/share/man/man3c/endusershell.3c=getusershell.3c
+s usr/share/man/man3c/endutent.3c=getutent.3c
+s usr/share/man/man3c/endutxent.3c=getutxent.3c
+s usr/share/man/man3c/erand48.3c=drand48.3c
+f usr/share/man/man3c/err.3c 0444 root bin
+s usr/share/man/man3c/errno.3c=perror.3c
+s usr/share/man/man3c/errx.3c=err.3c
+s usr/share/man/man3c/etext.3c=end.3c
+s usr/share/man/man3c/euccol.3c=euclen.3c
+f usr/share/man/man3c/euclen.3c 0444 root bin
+s usr/share/man/man3c/eucscol.3c=euclen.3c
+f usr/share/man/man3c/exit.3c 0444 root bin
+s usr/share/man/man3c/extended_to_decimal.3c=floating_to_decimal.3c
+f usr/share/man/man3c/fattach.3c 0444 root bin
+f usr/share/man/man3c/fclose.3c 0444 root bin
+s usr/share/man/man3c/fconvert.3c=econvert.3c
+s usr/share/man/man3c/fcvt.3c=ecvt.3c
+f usr/share/man/man3c/fdatasync.3c 0444 root bin
+f usr/share/man/man3c/fdetach.3c 0444 root bin
+f usr/share/man/man3c/fdopen.3c 0444 root bin
+s usr/share/man/man3c/fdopendir.3c=opendir.3c
+s usr/share/man/man3c/fdwalk.3c=closefrom.3c
+s usr/share/man/man3c/feof.3c=ferror.3c
+f usr/share/man/man3c/ferror.3c 0444 root bin
+f usr/share/man/man3c/fflush.3c 0444 root bin
+f usr/share/man/man3c/ffs.3c 0444 root bin
+f usr/share/man/man3c/fgetattr.3c 0444 root bin
+f usr/share/man/man3c/fgetc.3c 0444 root bin
+s usr/share/man/man3c/fgetgrent.3c=getgrnam.3c
+s usr/share/man/man3c/fgetgrent_r.3c=getgrnam.3c
+f usr/share/man/man3c/fgetpos.3c 0444 root bin
+s usr/share/man/man3c/fgetpwent.3c=getpwnam.3c
+s usr/share/man/man3c/fgetpwent_r.3c=getpwnam.3c
+s usr/share/man/man3c/fgets.3c=gets.3c
+s usr/share/man/man3c/fgetspent.3c=getspnam.3c
+s usr/share/man/man3c/fgetspent_r.3c=getspnam.3c
+f usr/share/man/man3c/fgetwc.3c 0444 root bin
+s usr/share/man/man3c/fgetws.3c=getws.3c
+s usr/share/man/man3c/file_to_decimal.3c=string_to_decimal.3c
+s usr/share/man/man3c/fileno.3c=ferror.3c
+s usr/share/man/man3c/finite.3c=isnand.3c
+f usr/share/man/man3c/floating_to_decimal.3c 0444 root bin
+f usr/share/man/man3c/flockfile.3c 0444 root bin
+f usr/share/man/man3c/fmtmsg.3c 0444 root bin
+f usr/share/man/man3c/fnmatch.3c 0444 root bin
+f usr/share/man/man3c/fopen.3c 0444 root bin
+s usr/share/man/man3c/fpclass.3c=isnand.3c
+s usr/share/man/man3c/fpgetmask.3c=fpgetround.3c
+f usr/share/man/man3c/fpgetround.3c 0444 root bin
+s usr/share/man/man3c/fpgetsticky.3c=fpgetround.3c
+s usr/share/man/man3c/fprintf.3c=printf.3c
+s usr/share/man/man3c/fpsetmask.3c=fpgetround.3c
+s usr/share/man/man3c/fpsetround.3c=fpgetround.3c
+s usr/share/man/man3c/fpsetsticky.3c=fpgetround.3c
+f usr/share/man/man3c/fputc.3c 0444 root bin
+s usr/share/man/man3c/fputs.3c=puts.3c
+f usr/share/man/man3c/fputwc.3c 0444 root bin
+f usr/share/man/man3c/fputws.3c 0444 root bin
+f usr/share/man/man3c/fread.3c 0444 root bin
+s usr/share/man/man3c/free.3c=malloc.3c
+f usr/share/man/man3c/freopen.3c 0444 root bin
+s usr/share/man/man3c/fscanf.3c=scanf.3c
+f usr/share/man/man3c/fseek.3c 0444 root bin
+s usr/share/man/man3c/fseeko.3c=fseek.3c
+s usr/share/man/man3c/fsetattr.3c=fgetattr.3c
+f usr/share/man/man3c/fsetpos.3c 0444 root bin
+f usr/share/man/man3c/fsync.3c 0444 root bin
+f usr/share/man/man3c/ftell.3c 0444 root bin
+s usr/share/man/man3c/ftello.3c=ftell.3c
+f usr/share/man/man3c/ftime.3c 0444 root bin
+f usr/share/man/man3c/ftok.3c 0444 root bin
+s usr/share/man/man3c/ftruncate.3c=truncate.3c
+s usr/share/man/man3c/ftrylockfile.3c=flockfile.3c
+f usr/share/man/man3c/ftw.3c 0444 root bin
+s usr/share/man/man3c/func_to_decimal.3c=string_to_decimal.3c
+s usr/share/man/man3c/funlockfile.3c=flockfile.3c
+f usr/share/man/man3c/fwide.3c 0444 root bin
+f usr/share/man/man3c/fwprintf.3c 0444 root bin
+f usr/share/man/man3c/fwrite.3c 0444 root bin
+f usr/share/man/man3c/fwscanf.3c 0444 root bin
+s usr/share/man/man3c/gconvert.3c=econvert.3c
+s usr/share/man/man3c/gcvt.3c=ecvt.3c
+s usr/share/man/man3c/getattrat.3c=fgetattr.3c
+s usr/share/man/man3c/getc.3c=fgetc.3c
+s usr/share/man/man3c/getc_unlocked.3c=fgetc.3c
+s usr/share/man/man3c/getchar.3c=fgetc.3c
+s usr/share/man/man3c/getchar_unlocked.3c=fgetc.3c
+f usr/share/man/man3c/getcpuid.3c 0444 root bin
+f usr/share/man/man3c/getcwd.3c 0444 root bin
+f usr/share/man/man3c/getdate.3c 0444 root bin
+s usr/share/man/man3c/getdelim.3c=getline.3c
+f usr/share/man/man3c/getdtablesize.3c 0444 root bin
+f usr/share/man/man3c/getenv.3c 0444 root bin
+f usr/share/man/man3c/getexecname.3c 0444 root bin
+s usr/share/man/man3c/getextmntent.3c=getmntent.3c
+s usr/share/man/man3c/getgrent.3c=getgrnam.3c
+s usr/share/man/man3c/getgrent_r.3c=getgrnam.3c
+s usr/share/man/man3c/getgrgid.3c=getgrnam.3c
+s usr/share/man/man3c/getgrgid_r.3c=getgrnam.3c
+f usr/share/man/man3c/getgrnam.3c 0444 root bin
+s usr/share/man/man3c/getgrnam_r.3c=getgrnam.3c
+s usr/share/man/man3c/gethomelgroup.3c=getcpuid.3c
+f usr/share/man/man3c/gethostid.3c 0444 root bin
+f usr/share/man/man3c/gethostname.3c 0444 root bin
+f usr/share/man/man3c/gethrtime.3c 0444 root bin
+s usr/share/man/man3c/gethrvtime.3c=gethrtime.3c
+f usr/share/man/man3c/getline.3c 0444 root bin
+f usr/share/man/man3c/getloadavg.3c 0444 root bin
+f usr/share/man/man3c/getlogin.3c 0444 root bin
+s usr/share/man/man3c/getlogin_r.3c=getlogin.3c
+s usr/share/man/man3c/getmntany.3c=getmntent.3c
+f usr/share/man/man3c/getmntent.3c 0444 root bin
+f usr/share/man/man3c/getnetgrent.3c 0444 root bin
+s usr/share/man/man3c/getnetgrent_r.3c=getnetgrent.3c
+f usr/share/man/man3c/getopt.3c 0444 root bin
+f usr/share/man/man3c/getpagesize.3c 0444 root bin
+f usr/share/man/man3c/getpagesizes.3c 0444 root bin
+f usr/share/man/man3c/getpass.3c 0444 root bin
+s usr/share/man/man3c/getpassphrase.3c=getpass.3c
+f usr/share/man/man3c/getpeerucred.3c 0444 root bin
+f usr/share/man/man3c/getpriority.3c 0444 root bin
+f usr/share/man/man3c/getpw.3c 0444 root bin
+s usr/share/man/man3c/getpwent.3c=getpwnam.3c
+s usr/share/man/man3c/getpwent_r.3c=getpwnam.3c
+f usr/share/man/man3c/getpwnam.3c 0444 root bin
+s usr/share/man/man3c/getpwnam_r.3c=getpwnam.3c
+s usr/share/man/man3c/getpwuid.3c=getpwnam.3c
+s usr/share/man/man3c/getpwuid_r.3c=getpwnam.3c
+f usr/share/man/man3c/getrusage.3c 0444 root bin
+f usr/share/man/man3c/gets.3c 0444 root bin
+s usr/share/man/man3c/getspent.3c=getspnam.3c
+s usr/share/man/man3c/getspent_r.3c=getspnam.3c
+f usr/share/man/man3c/getspnam.3c 0444 root bin
+s usr/share/man/man3c/getspnam_r.3c=getspnam.3c
+f usr/share/man/man3c/getsubopt.3c 0444 root bin
+f usr/share/man/man3c/gettext.3c 0444 root bin
+f usr/share/man/man3c/gettimeofday.3c 0444 root bin
+f usr/share/man/man3c/gettxt.3c 0444 root bin
+f usr/share/man/man3c/getusershell.3c 0444 root bin
+f usr/share/man/man3c/getutent.3c 0444 root bin
+s usr/share/man/man3c/getutid.3c=getutent.3c
+s usr/share/man/man3c/getutline.3c=getutent.3c
+s usr/share/man/man3c/getutmp.3c=getutxent.3c
+s usr/share/man/man3c/getutmpx.3c=getutxent.3c
+f usr/share/man/man3c/getutxent.3c 0444 root bin
+s usr/share/man/man3c/getutxid.3c=getutxent.3c
+s usr/share/man/man3c/getutxline.3c=getutxent.3c
+s usr/share/man/man3c/getvfsany.3c=getvfsent.3c
+f usr/share/man/man3c/getvfsent.3c 0444 root bin
+s usr/share/man/man3c/getvfsfile.3c=getvfsent.3c
+s usr/share/man/man3c/getvfsspec.3c=getvfsent.3c
+s usr/share/man/man3c/getw.3c=fgetc.3c
+f usr/share/man/man3c/getwc.3c 0444 root bin
+f usr/share/man/man3c/getwchar.3c 0444 root bin
+f usr/share/man/man3c/getwd.3c 0444 root bin
+f usr/share/man/man3c/getwidth.3c 0444 root bin
+f usr/share/man/man3c/getws.3c 0444 root bin
+f usr/share/man/man3c/getzoneid.3c 0444 root bin
+s usr/share/man/man3c/getzoneidbyname.3c=getzoneid.3c
+s usr/share/man/man3c/getzonenamebyid.3c=getzoneid.3c
+f usr/share/man/man3c/glob.3c 0444 root bin
+s usr/share/man/man3c/globfree.3c=glob.3c
+s usr/share/man/man3c/gmtime.3c=ctime.3c
+s usr/share/man/man3c/gmtime_r.3c=ctime.3c
+f usr/share/man/man3c/grantpt.3c 0444 root bin
+s usr/share/man/man3c/gsignal.3c=ssignal.3c
+s usr/share/man/man3c/hasmntopt.3c=getmntent.3c
+s usr/share/man/man3c/hcreate.3c=hsearch.3c
+s usr/share/man/man3c/hdestroy.3c=hsearch.3c
+f usr/share/man/man3c/hsearch.3c 0444 root bin
+f usr/share/man/man3c/iconv.3c 0444 root bin
+f usr/share/man/man3c/iconv_close.3c 0444 root bin
+f usr/share/man/man3c/iconv_open.3c 0444 root bin
+f usr/share/man/man3c/imaxabs.3c 0444 root bin
+f usr/share/man/man3c/imaxdiv.3c 0444 root bin
+f usr/share/man/man3c/index.3c 0444 root bin
+f usr/share/man/man3c/initgroups.3c 0444 root bin
+s usr/share/man/man3c/initstate.3c=random.3c
+s usr/share/man/man3c/innetgr.3c=getnetgrent.3c
+f usr/share/man/man3c/insque.3c 0444 root bin
+f usr/share/man/man3c/is_system_labeled.3c 0444 root bin
+f usr/share/man/man3c/isaexec.3c 0444 root bin
+s usr/share/man/man3c/isalnum.3c=ctype.3c
+s usr/share/man/man3c/isalpha.3c=ctype.3c
+s usr/share/man/man3c/isascii.3c=ctype.3c
+f usr/share/man/man3c/isastream.3c 0444 root bin
+f usr/share/man/man3c/isatty.3c 0444 root bin
+s usr/share/man/man3c/isblank.3c=ctype.3c
+s usr/share/man/man3c/iscntrl.3c=ctype.3c
+s usr/share/man/man3c/isdigit.3c=ctype.3c
+s usr/share/man/man3c/isenglish.3c=iswalpha.3c
+s usr/share/man/man3c/isgraph.3c=ctype.3c
+s usr/share/man/man3c/isideogram.3c=iswalpha.3c
+s usr/share/man/man3c/islower.3c=ctype.3c
+f usr/share/man/man3c/isnand.3c 0444 root bin
+s usr/share/man/man3c/isnanf.3c=isnand.3c
+s usr/share/man/man3c/isnumber.3c=iswalpha.3c
+s usr/share/man/man3c/isphonogram.3c=iswalpha.3c
+s usr/share/man/man3c/isprint.3c=ctype.3c
+s usr/share/man/man3c/ispunct.3c=ctype.3c
+s usr/share/man/man3c/isspace.3c=ctype.3c
+s usr/share/man/man3c/isspecial.3c=iswalpha.3c
+s usr/share/man/man3c/isupper.3c=ctype.3c
+s usr/share/man/man3c/iswalnum.3c=iswalpha.3c
+f usr/share/man/man3c/iswalpha.3c 0444 root bin
+s usr/share/man/man3c/iswascii.3c=iswalpha.3c
+s usr/share/man/man3c/iswblank.3c=iswalpha.3c
+s usr/share/man/man3c/iswcntrl.3c=iswalpha.3c
+f usr/share/man/man3c/iswctype.3c 0444 root bin
+s usr/share/man/man3c/iswdigit.3c=iswalpha.3c
+s usr/share/man/man3c/iswgraph.3c=iswalpha.3c
+s usr/share/man/man3c/iswlower.3c=iswalpha.3c
+s usr/share/man/man3c/iswprint.3c=iswalpha.3c
+s usr/share/man/man3c/iswpunct.3c=iswalpha.3c
+s usr/share/man/man3c/iswspace.3c=iswalpha.3c
+s usr/share/man/man3c/iswupper.3c=iswalpha.3c
+s usr/share/man/man3c/iswxdigit.3c=iswalpha.3c
+s usr/share/man/man3c/isxdigit.3c=ctype.3c
+s usr/share/man/man3c/jrand48.3c=drand48.3c
+f usr/share/man/man3c/killpg.3c 0444 root bin
+s usr/share/man/man3c/l64a.3c=a64l.3c
+s usr/share/man/man3c/labs.3c=abs.3c
+f usr/share/man/man3c/lckpwdf.3c 0444 root bin
+s usr/share/man/man3c/lcong48.3c=drand48.3c
+s usr/share/man/man3c/ldiv.3c=div.3c
+s usr/share/man/man3c/lfind.3c=lsearch.3c
+f usr/share/man/man3c/lfmt.3c 0444 root bin
+f usr/share/man/man3c/lio_listio.3c 0444 root bin
+s usr/share/man/man3c/llabs.3c=abs.3c
+s usr/share/man/man3c/lldiv.3c=div.3c
+s usr/share/man/man3c/lltostr.3c=strtol.3c
+f usr/share/man/man3c/localeconv.3c 0444 root bin
+s usr/share/man/man3c/localtime.3c=ctime.3c
+s usr/share/man/man3c/localtime_r.3c=ctime.3c
+f usr/share/man/man3c/lockf.3c 0444 root bin
+s usr/share/man/man3c/longjmp.3c=setjmp.3c
+s usr/share/man/man3c/lrand48.3c=drand48.3c
+f usr/share/man/man3c/lsearch.3c 0444 root bin
+f usr/share/man/man3c/madvise.3c 0444 root bin
+s usr/share/man/man3c/major.3c=makedev.3c
+f usr/share/man/man3c/makecontext.3c 0444 root bin
+f usr/share/man/man3c/makedev.3c 0444 root bin
+f usr/share/man/man3c/malloc.3c 0444 root bin
+f usr/share/man/man3c/mblen.3c 0444 root bin
+f usr/share/man/man3c/mbrlen.3c 0444 root bin
+f usr/share/man/man3c/mbrtowc.3c 0444 root bin
+f usr/share/man/man3c/mbsinit.3c 0444 root bin
+f usr/share/man/man3c/mbsrtowcs.3c 0444 root bin
+f usr/share/man/man3c/mbtowc.3c 0444 root bin
+s usr/share/man/man3c/memalign.3c=malloc.3c
+s usr/share/man/man3c/membar_consumer.3c=membar_ops.3c
+s usr/share/man/man3c/membar_enter.3c=membar_ops.3c
+s usr/share/man/man3c/membar_exit.3c=membar_ops.3c
+f usr/share/man/man3c/membar_ops.3c 0444 root bin
+s usr/share/man/man3c/membar_producer.3c=membar_ops.3c
+s usr/share/man/man3c/memccpy.3c=memory.3c
+s usr/share/man/man3c/memchr.3c=memory.3c
+s usr/share/man/man3c/memcmp.3c=memory.3c
+s usr/share/man/man3c/memcpy.3c=memory.3c
+s usr/share/man/man3c/memmove.3c=memory.3c
+f usr/share/man/man3c/memory.3c 0444 root bin
+s usr/share/man/man3c/memset.3c=memory.3c
+s usr/share/man/man3c/minor.3c=makedev.3c
+s usr/share/man/man3c/mkdtemp.3c=mkstemp.3c
+f usr/share/man/man3c/mkfifo.3c 0444 root bin
+s usr/share/man/man3c/mkostemp.3c=mkstemp.3c
+s usr/share/man/man3c/mkostemps.3c=mkstemp.3c
+f usr/share/man/man3c/mkstemp.3c 0444 root bin
+s usr/share/man/man3c/mkstemps.3c=mkstemp.3c
+f usr/share/man/man3c/mktemp.3c 0444 root bin
+f usr/share/man/man3c/mktime.3c 0444 root bin
+f usr/share/man/man3c/mlock.3c 0444 root bin
+f usr/share/man/man3c/mlockall.3c 0444 root bin
+f usr/share/man/man3c/monitor.3c 0444 root bin
+f usr/share/man/man3c/mq_close.3c 0444 root bin
+f usr/share/man/man3c/mq_getattr.3c 0444 root bin
+f usr/share/man/man3c/mq_notify.3c 0444 root bin
+f usr/share/man/man3c/mq_open.3c 0444 root bin
+f usr/share/man/man3c/mq_receive.3c 0444 root bin
+s usr/share/man/man3c/mq_reltimedreceive_np.3c=mq_receive.3c
+s usr/share/man/man3c/mq_reltimedsend_np.3c=mq_send.3c
+f usr/share/man/man3c/mq_send.3c 0444 root bin
+f usr/share/man/man3c/mq_setattr.3c 0444 root bin
+s usr/share/man/man3c/mq_timedreceive.3c=mq_receive.3c
+s usr/share/man/man3c/mq_timedsend.3c=mq_send.3c
+f usr/share/man/man3c/mq_unlink.3c 0444 root bin
+s usr/share/man/man3c/mrand48.3c=drand48.3c
+f usr/share/man/man3c/msync.3c 0444 root bin
+s usr/share/man/man3c/munlock.3c=mlock.3c
+s usr/share/man/man3c/munlockall.3c=mlockall.3c
+s usr/share/man/man3c/mutex_consistent.3c=mutex_init.3c
+s usr/share/man/man3c/mutex_destroy.3c=mutex_init.3c
+f usr/share/man/man3c/mutex_init.3c 0444 root bin
+s usr/share/man/man3c/mutex_lock.3c=mutex_init.3c
+s usr/share/man/man3c/mutex_trylock.3c=mutex_init.3c
+s usr/share/man/man3c/mutex_unlock.3c=mutex_init.3c
+f usr/share/man/man3c/nanosleep.3c 0444 root bin
+f usr/share/man/man3c/ndbm.3c 0444 root bin
+s usr/share/man/man3c/nftw.3c=ftw.3c
+s usr/share/man/man3c/ngettext.3c=gettext.3c
+f usr/share/man/man3c/nl_langinfo.3c 0444 root bin
+s usr/share/man/man3c/nrand48.3c=drand48.3c
+f usr/share/man/man3c/offsetof.3c 0444 root bin
+f usr/share/man/man3c/opendir.3c 0444 root bin
+s usr/share/man/man3c/openlog.3c=syslog.3c
+s usr/share/man/man3c/pclose.3c=popen.3c
+f usr/share/man/man3c/perror.3c 0444 root bin
+f usr/share/man/man3c/pfmt.3c 0444 root bin
+f usr/share/man/man3c/plock.3c 0444 root bin
+f usr/share/man/man3c/popen.3c 0444 root bin
+f usr/share/man/man3c/port_alert.3c 0444 root bin
+f usr/share/man/man3c/port_associate.3c 0444 root bin
+f usr/share/man/man3c/port_create.3c 0444 root bin
+s usr/share/man/man3c/port_dissociate.3c=port_associate.3c
+f usr/share/man/man3c/port_get.3c 0444 root bin
+s usr/share/man/man3c/port_getn.3c=port_get.3c
+f usr/share/man/man3c/port_send.3c 0444 root bin
+s usr/share/man/man3c/port_sendn.3c=port_send.3c
+f usr/share/man/man3c/posix_fadvise.3c 0444 root bin
+f usr/share/man/man3c/posix_fallocate.3c 0444 root bin
+f usr/share/man/man3c/posix_madvise.3c 0444 root bin
+f usr/share/man/man3c/posix_memalign.3c 0444 root bin
+f usr/share/man/man3c/posix_openpt.3c 0444 root bin
+f usr/share/man/man3c/posix_spawn.3c 0444 root bin
+f usr/share/man/man3c/posix_spawn_file_actions_addclose.3c 0444 root bin
+f usr/share/man/man3c/posix_spawn_file_actions_addclosefrom_np.3c 0444 root bin
+f usr/share/man/man3c/posix_spawn_file_actions_adddup2.3c 0444 root bin
+s usr/share/man/man3c/posix_spawn_file_actions_addopen.3c=posix_spawn_file_actions_addclose.3c
+f usr/share/man/man3c/posix_spawn_file_actions_destroy.3c 0444 root bin
+s usr/share/man/man3c/posix_spawn_file_actions_init.3c=posix_spawn_file_actions_destroy.3c
+f usr/share/man/man3c/posix_spawn_pipe_np.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_destroy.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getflags.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getpgroup.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getschedparam.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getschedpolicy.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getsigdefault.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getsigignore_np.3c 0444 root bin
+f usr/share/man/man3c/posix_spawnattr_getsigmask.3c 0444 root bin
+s usr/share/man/man3c/posix_spawnattr_init.3c=posix_spawnattr_destroy.3c
+s usr/share/man/man3c/posix_spawnattr_setflags.3c=posix_spawnattr_getflags.3c
+s usr/share/man/man3c/posix_spawnattr_setpgroup.3c=posix_spawnattr_getpgroup.3c
+s usr/share/man/man3c/posix_spawnattr_setschedparam.3c=posix_spawnattr_getschedparam.3c
+s usr/share/man/man3c/posix_spawnattr_setschedpolicy.3c=posix_spawnattr_getschedpolicy.3c
+s usr/share/man/man3c/posix_spawnattr_setsigdefault.3c=posix_spawnattr_getsigdefault.3c
+s usr/share/man/man3c/posix_spawnattr_setsigignore_np.3c=posix_spawnattr_getsigignore_np.3c
+s usr/share/man/man3c/posix_spawnattr_setsigmask.3c=posix_spawnattr_getsigmask.3c
+s usr/share/man/man3c/posix_spawnp.3c=posix_spawn.3c
+f usr/share/man/man3c/printf.3c 0444 root bin
+s usr/share/man/man3c/printstack.3c=walkcontext.3c
+f usr/share/man/man3c/priv_addset.3c 0444 root bin
+s usr/share/man/man3c/priv_allocset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_basicset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_copyset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_delset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_emptyset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_fillset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_freeset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_getbyname.3c=priv_str_to_set.3c
+s usr/share/man/man3c/priv_getbynum.3c=priv_str_to_set.3c
+s usr/share/man/man3c/priv_getsetbyname.3c=priv_str_to_set.3c
+s usr/share/man/man3c/priv_getsetbynum.3c=priv_str_to_set.3c
+s usr/share/man/man3c/priv_gettext.3c=priv_str_to_set.3c
+s usr/share/man/man3c/priv_ineffect.3c=priv_set.3c
+s usr/share/man/man3c/priv_intersect.3c=priv_addset.3c
+s usr/share/man/man3c/priv_inverse.3c=priv_addset.3c
+s usr/share/man/man3c/priv_isemptyset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_isequalset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_isfullset.3c=priv_addset.3c
+s usr/share/man/man3c/priv_ismember.3c=priv_addset.3c
+s usr/share/man/man3c/priv_issubset.3c=priv_addset.3c
+f usr/share/man/man3c/priv_set.3c 0444 root bin
+s usr/share/man/man3c/priv_set_to_str.3c=priv_str_to_set.3c
+f usr/share/man/man3c/priv_str_to_set.3c 0444 root bin
+s usr/share/man/man3c/priv_union.3c=priv_addset.3c
+s usr/share/man/man3c/pselect.3c=select.3c
+f usr/share/man/man3c/pset_getloadavg.3c 0444 root bin
+s usr/share/man/man3c/psiginfo.3c=psignal.3c
+f usr/share/man/man3c/psignal.3c 0444 root bin
+f usr/share/man/man3c/pthread_atfork.3c 0444 root bin
+s usr/share/man/man3c/pthread_attr_destroy.3c=pthread_attr_init.3c
+f usr/share/man/man3c/pthread_attr_getdetachstate.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getguardsize.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getinheritsched.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getschedparam.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getschedpolicy.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getscope.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getstack.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getstackaddr.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_getstacksize.3c 0444 root bin
+f usr/share/man/man3c/pthread_attr_init.3c 0444 root bin
+s usr/share/man/man3c/pthread_attr_setdetachstate.3c=pthread_attr_getdetachstate.3c
+s usr/share/man/man3c/pthread_attr_setguardsize.3c=pthread_attr_getguardsize.3c
+s usr/share/man/man3c/pthread_attr_setinheritsched.3c=pthread_attr_getinheritsched.3c
+s usr/share/man/man3c/pthread_attr_setschedparam.3c=pthread_attr_getschedparam.3c
+s usr/share/man/man3c/pthread_attr_setschedpolicy.3c=pthread_attr_getschedpolicy.3c
+s usr/share/man/man3c/pthread_attr_setscope.3c=pthread_attr_getscope.3c
+s usr/share/man/man3c/pthread_attr_setstack.3c=pthread_attr_getstack.3c
+s usr/share/man/man3c/pthread_attr_setstackaddr.3c=pthread_attr_getstackaddr.3c
+s usr/share/man/man3c/pthread_attr_setstacksize.3c=pthread_attr_getstacksize.3c
+f usr/share/man/man3c/pthread_barrier_destroy.3c 0444 root bin
+s usr/share/man/man3c/pthread_barrier_init.3c=pthread_barrier_destroy.3c
+f usr/share/man/man3c/pthread_barrier_wait.3c 0444 root bin
+f usr/share/man/man3c/pthread_barrierattr_destroy.3c 0444 root bin
+f usr/share/man/man3c/pthread_barrierattr_getpshared.3c 0444 root bin
+s usr/share/man/man3c/pthread_barrierattr_init.3c=pthread_barrierattr_destroy.3c
+s usr/share/man/man3c/pthread_barrierattr_setpshared.3c=pthread_barrierattr_getpshared.3c
+f usr/share/man/man3c/pthread_cancel.3c 0444 root bin
+f usr/share/man/man3c/pthread_cleanup_pop.3c 0444 root bin
+f usr/share/man/man3c/pthread_cleanup_push.3c 0444 root bin
+s usr/share/man/man3c/pthread_cond_broadcast.3c=pthread_cond_signal.3c
+s usr/share/man/man3c/pthread_cond_destroy.3c=pthread_cond_init.3c
+f usr/share/man/man3c/pthread_cond_init.3c 0444 root bin
+s usr/share/man/man3c/pthread_cond_reltimedwait_np.3c=pthread_cond_wait.3c
+f usr/share/man/man3c/pthread_cond_signal.3c 0444 root bin
+s usr/share/man/man3c/pthread_cond_timedwait.3c=pthread_cond_wait.3c
+f usr/share/man/man3c/pthread_cond_wait.3c 0444 root bin
+s usr/share/man/man3c/pthread_condattr_destroy.3c=pthread_condattr_init.3c
+f usr/share/man/man3c/pthread_condattr_getclock.3c 0444 root bin
+f usr/share/man/man3c/pthread_condattr_getpshared.3c 0444 root bin
+f usr/share/man/man3c/pthread_condattr_init.3c 0444 root bin
+s usr/share/man/man3c/pthread_condattr_setclock.3c=pthread_condattr_getclock.3c
+s usr/share/man/man3c/pthread_condattr_setpshared.3c=pthread_condattr_getpshared.3c
+f usr/share/man/man3c/pthread_create.3c 0444 root bin
+f usr/share/man/man3c/pthread_detach.3c 0444 root bin
+f usr/share/man/man3c/pthread_equal.3c 0444 root bin
+f usr/share/man/man3c/pthread_exit.3c 0444 root bin
+f usr/share/man/man3c/pthread_getconcurrency.3c 0444 root bin
+f usr/share/man/man3c/pthread_getschedparam.3c 0444 root bin
+f usr/share/man/man3c/pthread_getspecific.3c 0444 root bin
+f usr/share/man/man3c/pthread_join.3c 0444 root bin
+f usr/share/man/man3c/pthread_key_create.3c 0444 root bin
+s usr/share/man/man3c/pthread_key_create_once_np.3c=pthread_key_create.3c
+f usr/share/man/man3c/pthread_key_delete.3c 0444 root bin
+f usr/share/man/man3c/pthread_kill.3c 0444 root bin
+s usr/share/man/man3c/pthread_mutex_destroy.3c=pthread_mutex_init.3c
+f usr/share/man/man3c/pthread_mutex_getprioceiling.3c 0444 root bin
+f usr/share/man/man3c/pthread_mutex_init.3c 0444 root bin
+f usr/share/man/man3c/pthread_mutex_lock.3c 0444 root bin
+s usr/share/man/man3c/pthread_mutex_reltimedlock_np.3c=pthread_mutex_timedlock.3c
+s usr/share/man/man3c/pthread_mutex_setprioceiling.3c=pthread_mutex_getprioceiling.3c
+f usr/share/man/man3c/pthread_mutex_timedlock.3c 0444 root bin
+s usr/share/man/man3c/pthread_mutex_trylock.3c=pthread_mutex_lock.3c
+s usr/share/man/man3c/pthread_mutex_unlock.3c=pthread_mutex_lock.3c
+s usr/share/man/man3c/pthread_mutexattr_destroy.3c=pthread_mutexattr_init.3c
+f usr/share/man/man3c/pthread_mutexattr_getprioceiling.3c 0444 root bin
+f usr/share/man/man3c/pthread_mutexattr_getprotocol.3c 0444 root bin
+f usr/share/man/man3c/pthread_mutexattr_getpshared.3c 0444 root bin
+f usr/share/man/man3c/pthread_mutexattr_gettype.3c 0444 root bin
+f usr/share/man/man3c/pthread_mutexattr_init.3c 0444 root bin
+s usr/share/man/man3c/pthread_mutexattr_setprioceiling.3c=pthread_mutexattr_getprioceiling.3c
+s usr/share/man/man3c/pthread_mutexattr_setprotocol.3c=pthread_mutexattr_getprotocol.3c
+s usr/share/man/man3c/pthread_mutexattr_setpshared.3c=pthread_mutexattr_getpshared.3c
+s usr/share/man/man3c/pthread_mutexattr_settype.3c=pthread_mutexattr_gettype.3c
+f usr/share/man/man3c/pthread_once.3c 0444 root bin
+s usr/share/man/man3c/pthread_rwlock_destroy.3c=pthread_rwlock_init.3c
+f usr/share/man/man3c/pthread_rwlock_init.3c 0444 root bin
+f usr/share/man/man3c/pthread_rwlock_rdlock.3c 0444 root bin
+s usr/share/man/man3c/pthread_rwlock_reltimedrdlock_np.3c=pthread_rwlock_timedrdlock.3c
+s usr/share/man/man3c/pthread_rwlock_reltimedwrlock_np.3c=pthread_rwlock_timedwrlock.3c
+f usr/share/man/man3c/pthread_rwlock_timedrdlock.3c 0444 root bin
+f usr/share/man/man3c/pthread_rwlock_timedwrlock.3c 0444 root bin
+s usr/share/man/man3c/pthread_rwlock_tryrdlock.3c=pthread_rwlock_rdlock.3c
+s usr/share/man/man3c/pthread_rwlock_trywrlock.3c=pthread_rwlock_wrlock.3c
+f usr/share/man/man3c/pthread_rwlock_unlock.3c 0444 root bin
+f usr/share/man/man3c/pthread_rwlock_wrlock.3c 0444 root bin
+s usr/share/man/man3c/pthread_rwlockattr_destroy.3c=pthread_rwlockattr_init.3c
+f usr/share/man/man3c/pthread_rwlockattr_getpshared.3c 0444 root bin
+f usr/share/man/man3c/pthread_rwlockattr_init.3c 0444 root bin
+s usr/share/man/man3c/pthread_rwlockattr_setpshared.3c=pthread_rwlockattr_getpshared.3c
+f usr/share/man/man3c/pthread_self.3c 0444 root bin
+f usr/share/man/man3c/pthread_setcancelstate.3c 0444 root bin
+f usr/share/man/man3c/pthread_setcanceltype.3c 0444 root bin
+s usr/share/man/man3c/pthread_setconcurrency.3c=pthread_getconcurrency.3c
+s usr/share/man/man3c/pthread_setschedparam.3c=pthread_getschedparam.3c
+f usr/share/man/man3c/pthread_setschedprio.3c 0444 root bin
+s usr/share/man/man3c/pthread_setspecific.3c=pthread_getspecific.3c
+f usr/share/man/man3c/pthread_sigmask.3c 0444 root bin
+f usr/share/man/man3c/pthread_spin_destroy.3c 0444 root bin
+s usr/share/man/man3c/pthread_spin_init.3c=pthread_spin_destroy.3c
+f usr/share/man/man3c/pthread_spin_lock.3c 0444 root bin
+s usr/share/man/man3c/pthread_spin_trylock.3c=pthread_spin_lock.3c
+f usr/share/man/man3c/pthread_spin_unlock.3c 0444 root bin
+f usr/share/man/man3c/pthread_testcancel.3c 0444 root bin
+f usr/share/man/man3c/ptrace.3c 0444 root bin
+f usr/share/man/man3c/ptsname.3c 0444 root bin
+s usr/share/man/man3c/putc.3c=fputc.3c
+s usr/share/man/man3c/putc_unlocked.3c=fputc.3c
+s usr/share/man/man3c/putchar.3c=fputc.3c
+s usr/share/man/man3c/putchar_unlocked.3c=fputc.3c
+f usr/share/man/man3c/putenv.3c 0444 root bin
+s usr/share/man/man3c/putmntent.3c=getmntent.3c
+f usr/share/man/man3c/putpwent.3c 0444 root bin
+f usr/share/man/man3c/puts.3c 0444 root bin
+f usr/share/man/man3c/putspent.3c 0444 root bin
+s usr/share/man/man3c/pututline.3c=getutent.3c
+s usr/share/man/man3c/pututxline.3c=getutxent.3c
+s usr/share/man/man3c/putw.3c=fputc.3c
+s usr/share/man/man3c/putwc.3c=fputwc.3c
+s usr/share/man/man3c/putwchar.3c=fputwc.3c
+f usr/share/man/man3c/putws.3c 0444 root bin
+s usr/share/man/man3c/qeconvert.3c=econvert.3c
+s usr/share/man/man3c/qfconvert.3c=econvert.3c
+s usr/share/man/man3c/qgconvert.3c=econvert.3c
+f usr/share/man/man3c/qsort.3c 0444 root bin
+s usr/share/man/man3c/quadruple_to_decimal.3c=floating_to_decimal.3c
+f usr/share/man/man3c/raise.3c 0444 root bin
+f usr/share/man/man3c/rand.3c 0444 root bin
+s usr/share/man/man3c/rand_r.3c=rand.3c
+f usr/share/man/man3c/random.3c 0444 root bin
+f usr/share/man/man3c/rctl_walk.3c 0444 root bin
+s usr/share/man/man3c/rctlblk_get_enforced_value.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_firing_time.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_global_action.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_global_flags.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_local_action.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_local_flags.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_privilege.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_recipient_pid.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_get_value.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_set_local_action.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_set_local_flags.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_set_privilege.3c=rctlblk_set_value.3c
+s usr/share/man/man3c/rctlblk_set_recipient_pid.3c=rctlblk_set_value.3c
+f usr/share/man/man3c/rctlblk_set_value.3c 0444 root bin
+s usr/share/man/man3c/rctlblk_size.3c=rctlblk_set_value.3c
+f usr/share/man/man3c/re_comp.3c 0444 root bin
+s usr/share/man/man3c/re_exec.3c=re_comp.3c
+f usr/share/man/man3c/readdir.3c 0444 root bin
+s usr/share/man/man3c/readdir_r.3c=readdir.3c
+s usr/share/man/man3c/realloc.3c=malloc.3c
+f usr/share/man/man3c/realpath.3c 0444 root bin
+f usr/share/man/man3c/reboot.3c 0444 root bin
+f usr/share/man/man3c/regcmp.3c 0444 root bin
+f usr/share/man/man3c/regcomp.3c 0444 root bin
+s usr/share/man/man3c/regerror.3c=regcomp.3c
+s usr/share/man/man3c/regex.3c=regcmp.3c
+s usr/share/man/man3c/regexec.3c=regcomp.3c
+s usr/share/man/man3c/regfree.3c=regcomp.3c
+f usr/share/man/man3c/remove.3c 0444 root bin
+s usr/share/man/man3c/remque.3c=insque.3c
+s usr/share/man/man3c/resetmnttab.3c=getmntent.3c
+f usr/share/man/man3c/rewind.3c 0444 root bin
+f usr/share/man/man3c/rewinddir.3c 0444 root bin
+s usr/share/man/man3c/rindex.3c=index.3c
+s usr/share/man/man3c/rw_rdlock.3c=rwlock.3c
+s usr/share/man/man3c/rw_tryrdlock.3c=rwlock.3c
+s usr/share/man/man3c/rw_trywrlock.3c=rwlock.3c
+s usr/share/man/man3c/rw_unlock.3c=rwlock.3c
+s usr/share/man/man3c/rw_wrlock.3c=rwlock.3c
+f usr/share/man/man3c/rwlock.3c 0444 root bin
+s usr/share/man/man3c/rwlock_destroy.3c=rwlock.3c
+s usr/share/man/man3c/rwlock_init.3c=rwlock.3c
+f usr/share/man/man3c/scandir.3c 0444 root bin
+f usr/share/man/man3c/scanf.3c 0444 root bin
+f usr/share/man/man3c/sched_get_priority_max.3c 0444 root bin
+s usr/share/man/man3c/sched_get_priority_min.3c=sched_get_priority_max.3c
+f usr/share/man/man3c/sched_getparam.3c 0444 root bin
+f usr/share/man/man3c/sched_getscheduler.3c 0444 root bin
+f usr/share/man/man3c/sched_rr_get_interval.3c 0444 root bin
+f usr/share/man/man3c/sched_setparam.3c 0444 root bin
+f usr/share/man/man3c/sched_setscheduler.3c 0444 root bin
+f usr/share/man/man3c/sched_yield.3c 0444 root bin
+s usr/share/man/man3c/schedctl_exit.3c=schedctl_init.3c
+f usr/share/man/man3c/schedctl_init.3c 0444 root bin
+s usr/share/man/man3c/schedctl_lookup.3c=schedctl_init.3c
+s usr/share/man/man3c/schedctl_start.3c=schedctl_init.3c
+s usr/share/man/man3c/schedctl_stop.3c=schedctl_init.3c
+s usr/share/man/man3c/seconvert.3c=econvert.3c
+s usr/share/man/man3c/seed48.3c=drand48.3c
+f usr/share/man/man3c/seekdir.3c 0444 root bin
+f usr/share/man/man3c/select.3c 0444 root bin
+f usr/share/man/man3c/sem_close.3c 0444 root bin
+f usr/share/man/man3c/sem_destroy.3c 0444 root bin
+f usr/share/man/man3c/sem_getvalue.3c 0444 root bin
+f usr/share/man/man3c/sem_init.3c 0444 root bin
+f usr/share/man/man3c/sem_open.3c 0444 root bin
+f usr/share/man/man3c/sem_post.3c 0444 root bin
+s usr/share/man/man3c/sem_reltimedwait_np.3c=sem_timedwait.3c
+f usr/share/man/man3c/sem_timedwait.3c 0444 root bin
+s usr/share/man/man3c/sem_trywait.3c=sem_wait.3c
+f usr/share/man/man3c/sem_unlink.3c 0444 root bin
+f usr/share/man/man3c/sem_wait.3c 0444 root bin
+s usr/share/man/man3c/sema_destroy.3c=semaphore.3c
+s usr/share/man/man3c/sema_init.3c=semaphore.3c
+s usr/share/man/man3c/sema_post.3c=semaphore.3c
+s usr/share/man/man3c/sema_trywait.3c=semaphore.3c
+s usr/share/man/man3c/sema_wait.3c=semaphore.3c
+f usr/share/man/man3c/semaphore.3c 0444 root bin
+s usr/share/man/man3c/setattrat.3c=fgetattr.3c
+f usr/share/man/man3c/setbuf.3c 0444 root bin
+f usr/share/man/man3c/setbuffer.3c 0444 root bin
+f usr/share/man/man3c/setcat.3c 0444 root bin
+f usr/share/man/man3c/setenv.3c 0444 root bin
+s usr/share/man/man3c/setgrent.3c=getgrnam.3c
+s usr/share/man/man3c/sethostname.3c=gethostname.3c
+f usr/share/man/man3c/setjmp.3c 0444 root bin
+f usr/share/man/man3c/setkey.3c 0444 root bin
+f usr/share/man/man3c/setlabel.3c 0444 root bin
+s usr/share/man/man3c/setlinebuf.3c=setbuffer.3c
+f usr/share/man/man3c/setlocale.3c 0444 root bin
+s usr/share/man/man3c/setlogmask.3c=syslog.3c
+s usr/share/man/man3c/setnetgrent.3c=getnetgrent.3c
+s usr/share/man/man3c/setpriority.3c=getpriority.3c
+s usr/share/man/man3c/setpwent.3c=getpwnam.3c
+s usr/share/man/man3c/setspent.3c=getspnam.3c
+s usr/share/man/man3c/setstate.3c=random.3c
+s usr/share/man/man3c/settimeofday.3c=gettimeofday.3c
+s usr/share/man/man3c/setusershell.3c=getusershell.3c
+s usr/share/man/man3c/setutent.3c=getutent.3c
+s usr/share/man/man3c/setutxent.3c=getutxent.3c
+s usr/share/man/man3c/setvbuf.3c=setbuf.3c
+s usr/share/man/man3c/sfconvert.3c=econvert.3c
+s usr/share/man/man3c/sgconvert.3c=econvert.3c
+f usr/share/man/man3c/shm_open.3c 0444 root bin
+f usr/share/man/man3c/shm_unlink.3c 0444 root bin
+s usr/share/man/man3c/sig2str.3c=str2sig.3c
+s usr/share/man/man3c/sigaddset.3c=sigsetops.3c
+s usr/share/man/man3c/sigdelset.3c=sigsetops.3c
+s usr/share/man/man3c/sigemptyset.3c=sigsetops.3c
+s usr/share/man/man3c/sigfillset.3c=sigsetops.3c
+f usr/share/man/man3c/sigfpe.3c 0444 root bin
+s usr/share/man/man3c/sighold.3c=signal.3c
+s usr/share/man/man3c/sigignore.3c=signal.3c
+f usr/share/man/man3c/siginterrupt.3c 0444 root bin
+s usr/share/man/man3c/sigismember.3c=sigsetops.3c
+s usr/share/man/man3c/siglongjmp.3c=setjmp.3c
+f usr/share/man/man3c/signal.3c 0444 root bin
+s usr/share/man/man3c/sigpause.3c=signal.3c
+f usr/share/man/man3c/sigqueue.3c 0444 root bin
+s usr/share/man/man3c/sigrelse.3c=signal.3c
+s usr/share/man/man3c/sigset.3c=signal.3c
+s usr/share/man/man3c/sigsetjmp.3c=setjmp.3c
+f usr/share/man/man3c/sigsetops.3c 0444 root bin
+f usr/share/man/man3c/sigstack.3c 0444 root bin
+s usr/share/man/man3c/sigtimedwait.3c=sigwaitinfo.3c
+f usr/share/man/man3c/sigwaitinfo.3c 0444 root bin
+s usr/share/man/man3c/single_to_decimal.3c=floating_to_decimal.3c
+f usr/share/man/man3c/sleep.3c 0444 root bin
+s usr/share/man/man3c/snprintf.3c=printf.3c
+s usr/share/man/man3c/sprintf.3c=printf.3c
+s usr/share/man/man3c/srand.3c=rand.3c
+s usr/share/man/man3c/srand48.3c=drand48.3c
+s usr/share/man/man3c/srandom.3c=random.3c
+s usr/share/man/man3c/sscanf.3c=scanf.3c
+f usr/share/man/man3c/ssignal.3c 0444 root bin
+f usr/share/man/man3c/stack_getbounds.3c 0444 root bin
+f usr/share/man/man3c/stack_inbounds.3c 0444 root bin
+f usr/share/man/man3c/stack_setbounds.3c 0444 root bin
+f usr/share/man/man3c/stack_violation.3c 0444 root bin
+s usr/share/man/man3c/stderr.3c=stdio.3c
+s usr/share/man/man3c/stdin.3c=stdio.3c
+f usr/share/man/man3c/stdio.3c 0444 root bin
+s usr/share/man/man3c/stdout.3c=stdio.3c
+f usr/share/man/man3c/str2sig.3c 0444 root bin
+s usr/share/man/man3c/strcasecmp.3c=string.3c
+s usr/share/man/man3c/strcat.3c=string.3c
+s usr/share/man/man3c/strchr.3c=string.3c
+s usr/share/man/man3c/strcmp.3c=string.3c
+f usr/share/man/man3c/strcoll.3c 0444 root bin
+s usr/share/man/man3c/strcpy.3c=string.3c
+s usr/share/man/man3c/strcspn.3c=string.3c
+s usr/share/man/man3c/strdup.3c=string.3c
+f usr/share/man/man3c/strerror.3c 0444 root bin
+s usr/share/man/man3c/strerror_r.3c=strerror.3c
+f usr/share/man/man3c/strftime.3c 0444 root bin
+f usr/share/man/man3c/string.3c 0444 root bin
+f usr/share/man/man3c/string_to_decimal.3c 0444 root bin
+s usr/share/man/man3c/strlcat.3c=string.3c
+s usr/share/man/man3c/strlcpy.3c=string.3c
+s usr/share/man/man3c/strlen.3c=string.3c
+s usr/share/man/man3c/strncasecmp.3c=string.3c
+s usr/share/man/man3c/strncat.3c=string.3c
+s usr/share/man/man3c/strncmp.3c=string.3c
+s usr/share/man/man3c/strncpy.3c=string.3c
+s usr/share/man/man3c/strnlen.3c=string.3c
+s usr/share/man/man3c/strpbrk.3c=string.3c
+f usr/share/man/man3c/strptime.3c 0444 root bin
+s usr/share/man/man3c/strrchr.3c=string.3c
+s usr/share/man/man3c/strsep.3c=string.3c
+f usr/share/man/man3c/strsignal.3c 0444 root bin
+s usr/share/man/man3c/strspn.3c=string.3c
+s usr/share/man/man3c/strstr.3c=string.3c
+f usr/share/man/man3c/strtod.3c 0444 root bin
+s usr/share/man/man3c/strtof.3c=strtod.3c
+f usr/share/man/man3c/strtoimax.3c 0444 root bin
+s usr/share/man/man3c/strtok.3c=string.3c
+s usr/share/man/man3c/strtok_r.3c=string.3c
+f usr/share/man/man3c/strtol.3c 0444 root bin
+s usr/share/man/man3c/strtold.3c=strtod.3c
+s usr/share/man/man3c/strtoll.3c=strtol.3c
+f usr/share/man/man3c/strtoul.3c 0444 root bin
+s usr/share/man/man3c/strtoull.3c=strtoul.3c
+s usr/share/man/man3c/strtoumax.3c=strtoimax.3c
+f usr/share/man/man3c/strtows.3c 0444 root bin
+f usr/share/man/man3c/strxfrm.3c 0444 root bin
+f usr/share/man/man3c/swab.3c 0444 root bin
+s usr/share/man/man3c/swapcontext.3c=makecontext.3c
+s usr/share/man/man3c/swprintf.3c=fwprintf.3c
+s usr/share/man/man3c/swscanf.3c=fwscanf.3c
+f usr/share/man/man3c/sync_instruction_memory.3c 0444 root bin
+f usr/share/man/man3c/sysconf.3c 0444 root bin
+f usr/share/man/man3c/syslog.3c 0444 root bin
+f usr/share/man/man3c/system.3c 0444 root bin
+f usr/share/man/man3c/tcdrain.3c 0444 root bin
+f usr/share/man/man3c/tcflow.3c 0444 root bin
+f usr/share/man/man3c/tcflush.3c 0444 root bin
+f usr/share/man/man3c/tcgetattr.3c 0444 root bin
+f usr/share/man/man3c/tcgetpgrp.3c 0444 root bin
+f usr/share/man/man3c/tcgetsid.3c 0444 root bin
+f usr/share/man/man3c/tcsendbreak.3c 0444 root bin
+f usr/share/man/man3c/tcsetattr.3c 0444 root bin
+f usr/share/man/man3c/tcsetpgrp.3c 0444 root bin
+s usr/share/man/man3c/tdelete.3c=tsearch.3c
+f usr/share/man/man3c/tell.3c 0444 root bin
+f usr/share/man/man3c/telldir.3c 0444 root bin
+s usr/share/man/man3c/tempnam.3c=tmpnam.3c
+f usr/share/man/man3c/termios.3c 0444 root bin
+s usr/share/man/man3c/textdomain.3c=gettext.3c
+s usr/share/man/man3c/tfind.3c=tsearch.3c
+s usr/share/man/man3c/thr_continue.3c=thr_suspend.3c
+f usr/share/man/man3c/thr_create.3c 0444 root bin
+f usr/share/man/man3c/thr_exit.3c 0444 root bin
+f usr/share/man/man3c/thr_getconcurrency.3c 0444 root bin
+f usr/share/man/man3c/thr_getprio.3c 0444 root bin
+s usr/share/man/man3c/thr_getspecific.3c=thr_keycreate.3c
+f usr/share/man/man3c/thr_join.3c 0444 root bin
+f usr/share/man/man3c/thr_keycreate.3c 0444 root bin
+s usr/share/man/man3c/thr_keycreate_once.3c=thr_keycreate.3c
+f usr/share/man/man3c/thr_kill.3c 0444 root bin
+f usr/share/man/man3c/thr_main.3c 0444 root bin
+f usr/share/man/man3c/thr_min_stack.3c 0444 root bin
+f usr/share/man/man3c/thr_self.3c 0444 root bin
+s usr/share/man/man3c/thr_setconcurrency.3c=thr_getconcurrency.3c
+s usr/share/man/man3c/thr_setprio.3c=thr_getprio.3c
+s usr/share/man/man3c/thr_setspecific.3c=thr_keycreate.3c
+f usr/share/man/man3c/thr_sigsetmask.3c 0444 root bin
+f usr/share/man/man3c/thr_stksegment.3c 0444 root bin
+f usr/share/man/man3c/thr_suspend.3c 0444 root bin
+f usr/share/man/man3c/thr_yield.3c 0444 root bin
+f usr/share/man/man3c/timer_create.3c 0444 root bin
+f usr/share/man/man3c/timer_delete.3c 0444 root bin
+s usr/share/man/man3c/timer_getoverrun.3c=timer_settime.3c
+s usr/share/man/man3c/timer_gettime.3c=timer_settime.3c
+f usr/share/man/man3c/timer_settime.3c 0444 root bin
+f usr/share/man/man3c/timeradd.3c 0444 root bin
+s usr/share/man/man3c/timerclear.3c=timeradd.3c
+s usr/share/man/man3c/timercmp.3c=timeradd.3c
+s usr/share/man/man3c/timerisset.3c=timeradd.3c
+s usr/share/man/man3c/timersub.3c=timeradd.3c
+f usr/share/man/man3c/tmpfile.3c 0444 root bin
+f usr/share/man/man3c/tmpnam.3c 0444 root bin
+s usr/share/man/man3c/tmpnam_r.3c=tmpnam.3c
+f usr/share/man/man3c/toascii.3c 0444 root bin
+f usr/share/man/man3c/tolower.3c 0444 root bin
+f usr/share/man/man3c/toupper.3c 0444 root bin
+f usr/share/man/man3c/truncate.3c 0444 root bin
+f usr/share/man/man3c/tsearch.3c 0444 root bin
+f usr/share/man/man3c/ttyname.3c 0444 root bin
+s usr/share/man/man3c/ttyname_r.3c=ttyname.3c
+f usr/share/man/man3c/ttyslot.3c 0444 root bin
+s usr/share/man/man3c/twalk.3c=tsearch.3c
+s usr/share/man/man3c/tzset.3c=ctime.3c
+f usr/share/man/man3c/u8_strcmp.3c 0444 root bin
+f usr/share/man/man3c/u8_textprep_str.3c 0444 root bin
+f usr/share/man/man3c/u8_validate.3c 0444 root bin
+f usr/share/man/man3c/ualarm.3c 0444 root bin
+f usr/share/man/man3c/uconv_u16tou32.3c 0444 root bin
+s usr/share/man/man3c/uconv_u16tou8.3c=uconv_u16tou32.3c
+s usr/share/man/man3c/uconv_u32tou16.3c=uconv_u16tou32.3c
+s usr/share/man/man3c/uconv_u32tou8.3c=uconv_u16tou32.3c
+s usr/share/man/man3c/uconv_u8tou16.3c=uconv_u16tou32.3c
+s usr/share/man/man3c/uconv_u8tou32.3c=uconv_u16tou32.3c
+s usr/share/man/man3c/ucred_free.3c=ucred_get.3c
+f usr/share/man/man3c/ucred_get.3c 0444 root bin
+s usr/share/man/man3c/ucred_getegid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_geteuid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getgroups.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getlabel.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getpflags.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getpid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getprivset.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getprojid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getrgid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getruid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getsgid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getsuid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_getzoneid.3c=ucred_get.3c
+s usr/share/man/man3c/ucred_size.3c=ucred_get.3c
+s usr/share/man/man3c/ulckpwdf.3c=lckpwdf.3c
+s usr/share/man/man3c/ulltostr.3c=strtol.3c
+f usr/share/man/man3c/ungetc.3c 0444 root bin
+f usr/share/man/man3c/ungetwc.3c 0444 root bin
+f usr/share/man/man3c/unlockpt.3c 0444 root bin
+s usr/share/man/man3c/unordered.3c=isnand.3c
+f usr/share/man/man3c/unsetenv.3c 0444 root bin
+s usr/share/man/man3c/updwtmp.3c=getutxent.3c
+s usr/share/man/man3c/updwtmpx.3c=getutxent.3c
+f usr/share/man/man3c/usleep.3c 0444 root bin
+s usr/share/man/man3c/utmpname.3c=getutent.3c
+s usr/share/man/man3c/utmpxname.3c=getutxent.3c
+s usr/share/man/man3c/valloc.3c=malloc.3c
+s usr/share/man/man3c/vasprintf.3c=vprintf.3c
+s usr/share/man/man3c/verr.3c=err.3c
+s usr/share/man/man3c/verrx.3c=err.3c
+s usr/share/man/man3c/vfprintf.3c=vprintf.3c
+s usr/share/man/man3c/vfscanf.3c=scanf.3c
+f usr/share/man/man3c/vfwprintf.3c 0444 root bin
+s usr/share/man/man3c/vfwscanf.3c=fwscanf.3c
+f usr/share/man/man3c/vlfmt.3c 0444 root bin
+f usr/share/man/man3c/vpfmt.3c 0444 root bin
+f usr/share/man/man3c/vprintf.3c 0444 root bin
+s usr/share/man/man3c/vscanf.3c=scanf.3c
+s usr/share/man/man3c/vsnprintf.3c=vprintf.3c
+s usr/share/man/man3c/vsprintf.3c=vprintf.3c
+s usr/share/man/man3c/vsscanf.3c=scanf.3c
+s usr/share/man/man3c/vswprintf.3c=vfwprintf.3c
+s usr/share/man/man3c/vswscanf.3c=fwscanf.3c
+f usr/share/man/man3c/vsyslog.3c 0444 root bin
+s usr/share/man/man3c/vwarn.3c=err.3c
+s usr/share/man/man3c/vwarnx.3c=err.3c
+s usr/share/man/man3c/vwprintf.3c=vfwprintf.3c
+s usr/share/man/man3c/vwscanf.3c=fwscanf.3c
+f usr/share/man/man3c/wait.3c 0444 root bin
+f usr/share/man/man3c/wait3.3c 0444 root bin
+s usr/share/man/man3c/wait4.3c=wait3.3c
+f usr/share/man/man3c/waitpid.3c 0444 root bin
+f usr/share/man/man3c/walkcontext.3c 0444 root bin
+s usr/share/man/man3c/warn.3c=err.3c
+s usr/share/man/man3c/warnx.3c=err.3c
+s usr/share/man/man3c/watof.3c=wcstod.3c
+s usr/share/man/man3c/watoi.3c=wcstol.3c
+s usr/share/man/man3c/watol.3c=wcstol.3c
+s usr/share/man/man3c/watoll.3c=wcstol.3c
+f usr/share/man/man3c/wcrtomb.3c 0444 root bin
+s usr/share/man/man3c/wcscat.3c=wcstring.3c
+s usr/share/man/man3c/wcschr.3c=wcstring.3c
+s usr/share/man/man3c/wcscmp.3c=wcstring.3c
+f usr/share/man/man3c/wcscoll.3c 0444 root bin
+s usr/share/man/man3c/wcscpy.3c=wcstring.3c
+s usr/share/man/man3c/wcscspn.3c=wcstring.3c
+s usr/share/man/man3c/wcsetno.3c=cset.3c
+f usr/share/man/man3c/wcsftime.3c 0444 root bin
+s usr/share/man/man3c/wcslen.3c=wcstring.3c
+s usr/share/man/man3c/wcsncat.3c=wcstring.3c
+s usr/share/man/man3c/wcsncmp.3c=wcstring.3c
+s usr/share/man/man3c/wcsncpy.3c=wcstring.3c
+s usr/share/man/man3c/wcspbrk.3c=wcstring.3c
+s usr/share/man/man3c/wcsrchr.3c=wcstring.3c
+f usr/share/man/man3c/wcsrtombs.3c 0444 root bin
+s usr/share/man/man3c/wcsspn.3c=wcstring.3c
+f usr/share/man/man3c/wcsstr.3c 0444 root bin
+f usr/share/man/man3c/wcstod.3c 0444 root bin
+s usr/share/man/man3c/wcstof.3c=wcstod.3c
+f usr/share/man/man3c/wcstoimax.3c 0444 root bin
+s usr/share/man/man3c/wcstok.3c=wcstring.3c
+f usr/share/man/man3c/wcstol.3c 0444 root bin
+s usr/share/man/man3c/wcstold.3c=wcstod.3c
+s usr/share/man/man3c/wcstoll.3c=wcstol.3c
+f usr/share/man/man3c/wcstoul.3c 0444 root bin
+s usr/share/man/man3c/wcstoull.3c=wcstoul.3c
+s usr/share/man/man3c/wcstoumax.3c=wcstoimax.3c
+f usr/share/man/man3c/wcstring.3c 0444 root bin
+s usr/share/man/man3c/wcswcs.3c=wcstring.3c
+f usr/share/man/man3c/wcswidth.3c 0444 root bin
+f usr/share/man/man3c/wcsxfrm.3c 0444 root bin
+f usr/share/man/man3c/wctob.3c 0444 root bin
+f usr/share/man/man3c/wctomb.3c 0444 root bin
+f usr/share/man/man3c/wctype.3c 0444 root bin
+f usr/share/man/man3c/wcwidth.3c 0444 root bin
+s usr/share/man/man3c/windex.3c=wcstring.3c
+f usr/share/man/man3c/wmemchr.3c 0444 root bin
+f usr/share/man/man3c/wmemcmp.3c 0444 root bin
+f usr/share/man/man3c/wmemcpy.3c 0444 root bin
+f usr/share/man/man3c/wmemmove.3c 0444 root bin
+f usr/share/man/man3c/wmemset.3c 0444 root bin
+f usr/share/man/man3c/wordexp.3c 0444 root bin
+s usr/share/man/man3c/wordfree.3c=wordexp.3c
+s usr/share/man/man3c/wprintf.3c=fwprintf.3c
+s usr/share/man/man3c/wrindex.3c=wcstring.3c
+s usr/share/man/man3c/wscanf.3c=fwscanf.3c
+s usr/share/man/man3c/wscasecmp.3c=wstring.3c
+s usr/share/man/man3c/wscat.3c=wcstring.3c
+s usr/share/man/man3c/wschr.3c=wcstring.3c
+s usr/share/man/man3c/wscmp.3c=wcstring.3c
+s usr/share/man/man3c/wscol.3c=wstring.3c
+s usr/share/man/man3c/wscoll.3c=wcscoll.3c
+s usr/share/man/man3c/wscpy.3c=wcstring.3c
+s usr/share/man/man3c/wscspn.3c=wcstring.3c
+s usr/share/man/man3c/wsdup.3c=wstring.3c
+s usr/share/man/man3c/wslen.3c=wcstring.3c
+s usr/share/man/man3c/wsncasecmp.3c=wstring.3c
+s usr/share/man/man3c/wsncat.3c=wcstring.3c
+s usr/share/man/man3c/wsncmp.3c=wcstring.3c
+s usr/share/man/man3c/wsncpy.3c=wcstring.3c
+s usr/share/man/man3c/wspbrk.3c=wcstring.3c
+f usr/share/man/man3c/wsprintf.3c 0444 root bin
+s usr/share/man/man3c/wsrchr.3c=wcstring.3c
+f usr/share/man/man3c/wsscanf.3c 0444 root bin
+s usr/share/man/man3c/wsspn.3c=wcstring.3c
+s usr/share/man/man3c/wstod.3c=wcstod.3c
+s usr/share/man/man3c/wstok.3c=wcstring.3c
+s usr/share/man/man3c/wstol.3c=wcstol.3c
+s usr/share/man/man3c/wstostr.3c=strtows.3c
+f usr/share/man/man3c/wstring.3c 0444 root bin
+s usr/share/man/man3c/wsxfrm.3c=wcsxfrm.3c
+d usr/share/man/man3c_db 0755 root bin
+s usr/share/man/man3c_db/td_event_addset.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_event_delset.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_event_emptyset.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_event_fillset.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_eventisempty.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_eventismember.3c_db=td_ta_event_addr.3c_db
+f usr/share/man/man3c_db/td_init.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_log.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_sync_get_info.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_sync_get_stats.3c_db=td_sync_get_info.3c_db
+s usr/share/man/man3c_db/td_sync_setstate.3c_db=td_sync_get_info.3c_db
+s usr/share/man/man3c_db/td_sync_waiters.3c_db=td_sync_get_info.3c_db
+s usr/share/man/man3c_db/td_ta_clear_event.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_ta_delete.3c_db=td_ta_new.3c_db
+f usr/share/man/man3c_db/td_ta_enable_stats.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_ta_event_addr.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_ta_event_getmsg.3c_db=td_ta_event_addr.3c_db
+f usr/share/man/man3c_db/td_ta_get_nthreads.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_ta_get_ph.3c_db=td_ta_new.3c_db
+s usr/share/man/man3c_db/td_ta_get_stats.3c_db=td_ta_enable_stats.3c_db
+f usr/share/man/man3c_db/td_ta_map_addr2sync.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_ta_map_id2thr.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_ta_map_lwp2thr.3c_db=td_ta_map_id2thr.3c_db
+f usr/share/man/man3c_db/td_ta_new.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_ta_reset_stats.3c_db=td_ta_enable_stats.3c_db
+s usr/share/man/man3c_db/td_ta_set_event.3c_db=td_ta_event_addr.3c_db
+f usr/share/man/man3c_db/td_ta_setconcurrency.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_ta_sync_iter.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_ta_sync_tracking_enable.3c_db=td_sync_get_info.3c_db
+s usr/share/man/man3c_db/td_ta_thr_iter.3c_db=td_ta_sync_iter.3c_db
+s usr/share/man/man3c_db/td_ta_tsd_iter.3c_db=td_ta_sync_iter.3c_db
+s usr/share/man/man3c_db/td_thr_clear_event.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_thr_dbresume.3c_db=td_thr_dbsuspend.3c_db
+f usr/share/man/man3c_db/td_thr_dbsuspend.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_thr_event_enable.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_thr_event_getmsg.3c_db=td_ta_event_addr.3c_db
+f usr/share/man/man3c_db/td_thr_get_info.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_thr_getfpregs.3c_db=td_thr_getgregs.3c_db
+f usr/share/man/man3c_db/td_thr_getgregs.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_thr_getxregs.3c_db=td_thr_getgregs.3c_db
+s usr/share/man/man3c_db/td_thr_getxregsize.3c_db=td_thr_getgregs.3c_db
+f usr/share/man/man3c_db/td_thr_lockowner.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_thr_set_event.3c_db=td_ta_event_addr.3c_db
+s usr/share/man/man3c_db/td_thr_setfpregs.3c_db=td_thr_getgregs.3c_db
+s usr/share/man/man3c_db/td_thr_setgregs.3c_db=td_thr_getgregs.3c_db
+f usr/share/man/man3c_db/td_thr_setprio.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_thr_setsigpending.3c_db 0444 root bin
+s usr/share/man/man3c_db/td_thr_setxregs.3c_db=td_thr_getgregs.3c_db
+s usr/share/man/man3c_db/td_thr_sigsetmask.3c_db=td_thr_setsigpending.3c_db
+f usr/share/man/man3c_db/td_thr_sleepinfo.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_thr_tsd.3c_db 0444 root bin
+f usr/share/man/man3c_db/td_thr_validate.3c_db 0444 root bin
+d usr/share/man/man3cfgadm 0755 root bin
+f usr/share/man/man3cfgadm/config_admin.3cfgadm 0444 root bin
+s usr/share/man/man3cfgadm/config_ap_id_cmp.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_change_state.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_list.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_list_ext.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_private_func.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_stat.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_strerror.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_test.3cfgadm=config_admin.3cfgadm
+s usr/share/man/man3cfgadm/config_unload_libs.3cfgadm=config_admin.3cfgadm
+d usr/share/man/man3commputil 0755 root bin
+s usr/share/man/man3commputil/sdp_add_attribute.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_bandwidth.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_connection.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_email.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_information.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_key.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_media.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_name.3commputil=sdp_add_origin.3commputil
+f usr/share/man/man3commputil/sdp_add_origin.3commputil 0444 root bin
+s usr/share/man/man3commputil/sdp_add_phone.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_repeat.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_time.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_uri.3commputil=sdp_add_origin.3commputil
+s usr/share/man/man3commputil/sdp_add_zone.3commputil=sdp_add_origin.3commputil
+f usr/share/man/man3commputil/sdp_clone_session.3commputil 0444 root bin
+f usr/share/man/man3commputil/sdp_delete_all_field.3commputil 0444 root bin
+s usr/share/man/man3commputil/sdp_delete_all_media_field.3commputil=sdp_delete_all_field.3commputil
+s usr/share/man/man3commputil/sdp_delete_attribute.3commputil=sdp_delete_media.3commputil
+f usr/share/man/man3commputil/sdp_delete_media.3commputil 0444 root bin
+f usr/share/man/man3commputil/sdp_find_attribute.3commputil 0444 root bin
+f usr/share/man/man3commputil/sdp_find_media.3commputil 0444 root bin
+f usr/share/man/man3commputil/sdp_find_media_rtpmap.3commputil 0444 root bin
+s usr/share/man/man3commputil/sdp_free_session.3commputil=sdp_new_session.3commputil
+f usr/share/man/man3commputil/sdp_new_session.3commputil 0444 root bin
+f usr/share/man/man3commputil/sdp_parse.3commputil 0444 root bin
+f usr/share/man/man3commputil/sdp_session_to_str.3commputil 0444 root bin
+d usr/share/man/man3contract 0755 root bin
+s usr/share/man/man3contract/ct_ctl_abandon.3contract=ct_ctl_adopt.3contract
+s usr/share/man/man3contract/ct_ctl_ack.3contract=ct_ctl_adopt.3contract
+f usr/share/man/man3contract/ct_ctl_adopt.3contract 0444 root bin
+s usr/share/man/man3contract/ct_ctl_nack.3contract=ct_ctl_adopt.3contract
+s usr/share/man/man3contract/ct_ctl_newct.3contract=ct_ctl_adopt.3contract
+s usr/share/man/man3contract/ct_ctl_qack.3contract=ct_ctl_adopt.3contract
+s usr/share/man/man3contract/ct_dev_status_get_aset.3contract=ct_dev_status_get_dev_state.3contract
+f usr/share/man/man3contract/ct_dev_status_get_dev_state.3contract 0444 root bin
+s usr/share/man/man3contract/ct_dev_status_get_minor.3contract=ct_dev_status_get_dev_state.3contract
+s usr/share/man/man3contract/ct_dev_status_get_noneg.3contract=ct_dev_status_get_dev_state.3contract
+s usr/share/man/man3contract/ct_dev_tmpl_clear_noneg.3contract=ct_dev_tmpl_set_aset.3contract
+s usr/share/man/man3contract/ct_dev_tmpl_get_aset.3contract=ct_dev_tmpl_set_aset.3contract
+s usr/share/man/man3contract/ct_dev_tmpl_get_minor.3contract=ct_dev_tmpl_set_aset.3contract
+s usr/share/man/man3contract/ct_dev_tmpl_get_noneg.3contract=ct_dev_tmpl_set_aset.3contract
+f usr/share/man/man3contract/ct_dev_tmpl_set_aset.3contract 0444 root bin
+s usr/share/man/man3contract/ct_dev_tmpl_set_minor.3contract=ct_dev_tmpl_set_aset.3contract
+s usr/share/man/man3contract/ct_dev_tmpl_set_noneg.3contract=ct_dev_tmpl_set_aset.3contract
+s usr/share/man/man3contract/ct_event_free.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_get_ctid.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_get_evid.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_get_flags.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_get_nevid.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_get_newct.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_get_type.3contract=ct_event_read.3contract
+f usr/share/man/man3contract/ct_event_read.3contract 0444 root bin
+s usr/share/man/man3contract/ct_event_read_critical.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_reliable.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_event_reset.3contract=ct_event_read.3contract
+s usr/share/man/man3contract/ct_pr_event_get_exitstatus.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_event_get_gcorefile.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_event_get_pcorefile.3contract=ct_pr_event_get_pid.3contract
+f usr/share/man/man3contract/ct_pr_event_get_pid.3contract 0444 root bin
+s usr/share/man/man3contract/ct_pr_event_get_ppid.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_event_get_sender.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_event_get_senderct.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_event_get_signal.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_event_get_zcorefile.3contract=ct_pr_event_get_pid.3contract
+s usr/share/man/man3contract/ct_pr_status_get_contracts.3contract=ct_pr_status_get_param.3contract
+s usr/share/man/man3contract/ct_pr_status_get_fatal.3contract=ct_pr_status_get_param.3contract
+s usr/share/man/man3contract/ct_pr_status_get_members.3contract=ct_pr_status_get_param.3contract
+f usr/share/man/man3contract/ct_pr_status_get_param.3contract 0444 root bin
+s usr/share/man/man3contract/ct_pr_status_get_svc_aux.3contract=ct_pr_status_get_param.3contract
+s usr/share/man/man3contract/ct_pr_status_get_svc_creator.3contract=ct_pr_status_get_param.3contract
+s usr/share/man/man3contract/ct_pr_status_get_svc_ctid.3contract=ct_pr_status_get_param.3contract
+s usr/share/man/man3contract/ct_pr_status_get_svc_fmri.3contract=ct_pr_status_get_param.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_get_fatal.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_get_param.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_get_svc_aux.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_get_svc_fmri.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_get_transfer.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_set_fatal.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_set_param.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_set_svc_aux.3contract=ct_pr_tmpl_set_transfer.3contract
+s usr/share/man/man3contract/ct_pr_tmpl_set_svc_fmri.3contract=ct_pr_tmpl_set_transfer.3contract
+f usr/share/man/man3contract/ct_pr_tmpl_set_transfer.3contract 0444 root bin
+s usr/share/man/man3contract/ct_status_free.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_cookie.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_critical.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_holder.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_id.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_informative.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_nevents.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_nevid.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_ntime.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_qtime.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_state.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_type.3contract=ct_status_read.3contract
+s usr/share/man/man3contract/ct_status_get_zoneid.3contract=ct_status_read.3contract
+f usr/share/man/man3contract/ct_status_read.3contract 0444 root bin
+f usr/share/man/man3contract/ct_tmpl_activate.3contract 0444 root bin
+s usr/share/man/man3contract/ct_tmpl_clear.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_create.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_get_cookie.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_get_critical.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_get_informative.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_set_cookie.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_set_critical.3contract=ct_tmpl_activate.3contract
+s usr/share/man/man3contract/ct_tmpl_set_informative.3contract=ct_tmpl_activate.3contract
+d usr/share/man/man3cpc 0755 root bin
+f usr/share/man/man3cpc/cpc.3cpc 0444 root bin
+f usr/share/man/man3cpc/cpc_access.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_bind_cpu.3cpc=cpc_bind_curlwp.3cpc
+f usr/share/man/man3cpc/cpc_bind_curlwp.3cpc 0444 root bin
+f usr/share/man/man3cpc/cpc_bind_event.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_bind_pctx.3cpc=cpc_bind_curlwp.3cpc
+s usr/share/man/man3cpc/cpc_buf_add.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_copy.3cpc=cpc_buf_create.3cpc
+f usr/share/man/man3cpc/cpc_buf_create.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_buf_destroy.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_get.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_hrtime.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_set.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_sub.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_tick.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_buf_zero.3cpc=cpc_buf_create.3cpc
+s usr/share/man/man3cpc/cpc_caps.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_cciname.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_close.3cpc=cpc_open.3cpc
+s usr/share/man/man3cpc/cpc_count_sys_events.3cpc=cpc_count_usr_events.3cpc
+f usr/share/man/man3cpc/cpc_count_usr_events.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_cpuref.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_disable.3cpc=cpc_enable.3cpc
+f usr/share/man/man3cpc/cpc_enable.3cpc 0444 root bin
+f usr/share/man/man3cpc/cpc_event.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_event_accum.3cpc=cpc_event_diff.3cpc
+f usr/share/man/man3cpc/cpc_event_diff.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_eventtostr.3cpc=cpc_strtoevent.3cpc
+s usr/share/man/man3cpc/cpc_getcciname.3cpc=cpc_getcpuver.3cpc
+s usr/share/man/man3cpc/cpc_getcpuref.3cpc=cpc_getcpuver.3cpc
+f usr/share/man/man3cpc/cpc_getcpuver.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_getnpic.3cpc=cpc_getcpuver.3cpc
+s usr/share/man/man3cpc/cpc_getusage.3cpc=cpc_getcpuver.3cpc
+f usr/share/man/man3cpc/cpc_npic.3cpc 0444 root bin
+f usr/share/man/man3cpc/cpc_open.3cpc 0444 root bin
+f usr/share/man/man3cpc/cpc_pctx_bind_event.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_pctx_invalidate.3cpc=cpc_pctx_bind_event.3cpc
+s usr/share/man/man3cpc/cpc_pctx_rele.3cpc=cpc_pctx_bind_event.3cpc
+s usr/share/man/man3cpc/cpc_pctx_take_sample.3cpc=cpc_pctx_bind_event.3cpc
+s usr/share/man/man3cpc/cpc_rele.3cpc=cpc_bind_event.3cpc
+s usr/share/man/man3cpc/cpc_request_preset.3cpc=cpc_bind_curlwp.3cpc
+s usr/share/man/man3cpc/cpc_set_add_request.3cpc=cpc_set_create.3cpc
+f usr/share/man/man3cpc/cpc_set_create.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_set_destroy.3cpc=cpc_set_create.3cpc
+s usr/share/man/man3cpc/cpc_set_restart.3cpc=cpc_bind_curlwp.3cpc
+s usr/share/man/man3cpc/cpc_set_sample.3cpc=cpc_buf_create.3cpc
+f usr/share/man/man3cpc/cpc_seterrfn.3cpc 0444 root bin
+f usr/share/man/man3cpc/cpc_seterrhndlr.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_shared_bind_event.3cpc=cpc_shared_open.3cpc
+s usr/share/man/man3cpc/cpc_shared_close.3cpc=cpc_shared_open.3cpc
+f usr/share/man/man3cpc/cpc_shared_open.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_shared_rele.3cpc=cpc_shared_open.3cpc
+s usr/share/man/man3cpc/cpc_shared_take_sample.3cpc=cpc_shared_open.3cpc
+f usr/share/man/man3cpc/cpc_strtoevent.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_take_sample.3cpc=cpc_bind_event.3cpc
+s usr/share/man/man3cpc/cpc_unbind.3cpc=cpc_bind_curlwp.3cpc
+f usr/share/man/man3cpc/cpc_version.3cpc 0444 root bin
+s usr/share/man/man3cpc/cpc_walk_attrs.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_walk_events_all.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_walk_events_pic.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_walk_generic_events_all.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_walk_generic_events_pic.3cpc=cpc_npic.3cpc
+s usr/share/man/man3cpc/cpc_walk_names.3cpc=cpc_getcpuver.3cpc
+s usr/share/man/man3cpc/cpc_walk_requests.3cpc=cpc_set_create.3cpc
+f usr/share/man/man3cpc/generic_events.3cpc 0444 root bin
+f usr/share/man/man3cpc/pctx_capture.3cpc 0444 root bin
+s usr/share/man/man3cpc/pctx_create.3cpc=pctx_capture.3cpc
+s usr/share/man/man3cpc/pctx_release.3cpc=pctx_capture.3cpc
+s usr/share/man/man3cpc/pctx_run.3cpc=pctx_capture.3cpc
+f usr/share/man/man3cpc/pctx_set_events.3cpc 0444 root bin
+d usr/share/man/man3curses 0755 root bin
+s usr/share/man/man3curses/addch.3curses=curs_addch.3curses
+s usr/share/man/man3curses/addchnstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/addchstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/addnstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/addnwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/addstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/addwch.3curses=curs_addwch.3curses
+s usr/share/man/man3curses/addwchnstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/addwchstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/addwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/adjcurspos.3curses=curs_alecompat.3curses
+s usr/share/man/man3curses/attroff.3curses=curs_attr.3curses
+s usr/share/man/man3curses/attron.3curses=curs_attr.3curses
+s usr/share/man/man3curses/attrset.3curses=curs_attr.3curses
+s usr/share/man/man3curses/baudrate.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/beep.3curses=curs_beep.3curses
+s usr/share/man/man3curses/bkgd.3curses=curs_bkgd.3curses
+s usr/share/man/man3curses/bkgdset.3curses=curs_bkgd.3curses
+s usr/share/man/man3curses/border.3curses=curs_border.3curses
+s usr/share/man/man3curses/bottom_panel.3curses=panel_top.3curses
+s usr/share/man/man3curses/box.3curses=curs_border.3curses
+s usr/share/man/man3curses/can_change_color.3curses=curs_color.3curses
+s usr/share/man/man3curses/cbreak.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/clear.3curses=curs_clear.3curses
+s usr/share/man/man3curses/clearok.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/clrtobot.3curses=curs_clear.3curses
+s usr/share/man/man3curses/clrtoeol.3curses=curs_clear.3curses
+s usr/share/man/man3curses/color_content.3curses=curs_color.3curses
+s usr/share/man/man3curses/copywin.3curses=curs_overlay.3curses
+s usr/share/man/man3curses/current_field.3curses=form_page.3curses
+s usr/share/man/man3curses/current_item.3curses=menu_item_current.3curses
+f usr/share/man/man3curses/curs_addch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_addchstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_addstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_addwch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_addwchstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_addwstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_alecompat.3curses 0444 root bin
+f usr/share/man/man3curses/curs_attr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_beep.3curses 0444 root bin
+f usr/share/man/man3curses/curs_bkgd.3curses 0444 root bin
+f usr/share/man/man3curses/curs_border.3curses 0444 root bin
+f usr/share/man/man3curses/curs_clear.3curses 0444 root bin
+f usr/share/man/man3curses/curs_color.3curses 0444 root bin
+f usr/share/man/man3curses/curs_delch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_deleteln.3curses 0444 root bin
+f usr/share/man/man3curses/curs_getch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_getstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_getwch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_getwstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_getyx.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inchstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_initscr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inopts.3curses 0444 root bin
+f usr/share/man/man3curses/curs_insch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_insstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_instr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inswch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inswstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inwch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inwchstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_inwstr.3curses 0444 root bin
+f usr/share/man/man3curses/curs_kernel.3curses 0444 root bin
+f usr/share/man/man3curses/curs_move.3curses 0444 root bin
+f usr/share/man/man3curses/curs_outopts.3curses 0444 root bin
+f usr/share/man/man3curses/curs_overlay.3curses 0444 root bin
+f usr/share/man/man3curses/curs_pad.3curses 0444 root bin
+f usr/share/man/man3curses/curs_printw.3curses 0444 root bin
+f usr/share/man/man3curses/curs_refresh.3curses 0444 root bin
+f usr/share/man/man3curses/curs_scanw.3curses 0444 root bin
+f usr/share/man/man3curses/curs_scr_dump.3curses 0444 root bin
+f usr/share/man/man3curses/curs_scroll.3curses 0444 root bin
+s usr/share/man/man3curses/curs_set.3curses=curs_kernel.3curses
+f usr/share/man/man3curses/curs_slk.3curses 0444 root bin
+f usr/share/man/man3curses/curs_termattrs.3curses 0444 root bin
+f usr/share/man/man3curses/curs_termcap.3curses 0444 root bin
+f usr/share/man/man3curses/curs_terminfo.3curses 0444 root bin
+f usr/share/man/man3curses/curs_touch.3curses 0444 root bin
+f usr/share/man/man3curses/curs_util.3curses 0444 root bin
+f usr/share/man/man3curses/curs_window.3curses 0444 root bin
+f usr/share/man/man3curses/curses.3curses 0444 root bin
+s usr/share/man/man3curses/data_ahead.3curses=form_data.3curses
+s usr/share/man/man3curses/data_behind.3curses=form_data.3curses
+s usr/share/man/man3curses/def_prog_mode.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/def_shell_mode.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/del_curterm.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/del_panel.3curses=panel_new.3curses
+s usr/share/man/man3curses/delay_output.3curses=curs_util.3curses
+s usr/share/man/man3curses/delch.3curses=curs_delch.3curses
+s usr/share/man/man3curses/deleteln.3curses=curs_deleteln.3curses
+s usr/share/man/man3curses/delscreen.3curses=curs_initscr.3curses
+s usr/share/man/man3curses/delwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/derwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/doupdate.3curses=curs_refresh.3curses
+s usr/share/man/man3curses/dup_field.3curses=form_field_new.3curses
+s usr/share/man/man3curses/dupwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/dynamic_field_info.3curses=form_field_info.3curses
+s usr/share/man/man3curses/echo.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/echochar.3curses=curs_addch.3curses
+s usr/share/man/man3curses/echowchar.3curses=curs_addwch.3curses
+s usr/share/man/man3curses/endwin.3curses=curs_initscr.3curses
+s usr/share/man/man3curses/erase.3curses=curs_clear.3curses
+s usr/share/man/man3curses/erasechar.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/field_arg.3curses=form_field_validation.3curses
+s usr/share/man/man3curses/field_back.3curses=form_field_attributes.3curses
+s usr/share/man/man3curses/field_buffer.3curses=form_field_buffer.3curses
+s usr/share/man/man3curses/field_count.3curses=form_field.3curses
+s usr/share/man/man3curses/field_fore.3curses=form_field_attributes.3curses
+s usr/share/man/man3curses/field_index.3curses=form_page.3curses
+s usr/share/man/man3curses/field_info.3curses=form_field_info.3curses
+s usr/share/man/man3curses/field_init.3curses=form_hook.3curses
+s usr/share/man/man3curses/field_just.3curses=form_field_just.3curses
+s usr/share/man/man3curses/field_opts.3curses=form_field_opts.3curses
+s usr/share/man/man3curses/field_opts_off.3curses=form_field_opts.3curses
+s usr/share/man/man3curses/field_opts_on.3curses=form_field_opts.3curses
+s usr/share/man/man3curses/field_pad.3curses=form_field_attributes.3curses
+s usr/share/man/man3curses/field_status.3curses=form_field_buffer.3curses
+s usr/share/man/man3curses/field_term.3curses=form_hook.3curses
+s usr/share/man/man3curses/field_type.3curses=form_field_validation.3curses
+s usr/share/man/man3curses/field_userptr.3curses=form_field_userptr.3curses
+s usr/share/man/man3curses/filter.3curses=curs_util.3curses
+s usr/share/man/man3curses/flash.3curses=curs_beep.3curses
+s usr/share/man/man3curses/flushinp.3curses=curs_util.3curses
+f usr/share/man/man3curses/form_cursor.3curses 0444 root bin
+f usr/share/man/man3curses/form_data.3curses 0444 root bin
+f usr/share/man/man3curses/form_driver.3curses 0444 root bin
+f usr/share/man/man3curses/form_field.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_attributes.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_buffer.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_info.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_just.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_new.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_opts.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_userptr.3curses 0444 root bin
+f usr/share/man/man3curses/form_field_validation.3curses 0444 root bin
+s usr/share/man/man3curses/form_fields.3curses=form_field.3curses
+f usr/share/man/man3curses/form_fieldtype.3curses 0444 root bin
+f usr/share/man/man3curses/form_hook.3curses 0444 root bin
+s usr/share/man/man3curses/form_init.3curses=form_hook.3curses
+f usr/share/man/man3curses/form_new.3curses 0444 root bin
+f usr/share/man/man3curses/form_new_page.3curses 0444 root bin
+f usr/share/man/man3curses/form_opts.3curses 0444 root bin
+s usr/share/man/man3curses/form_opts_off.3curses=form_opts.3curses
+s usr/share/man/man3curses/form_opts_on.3curses=form_opts.3curses
+f usr/share/man/man3curses/form_page.3curses 0444 root bin
+f usr/share/man/man3curses/form_post.3curses 0444 root bin
+s usr/share/man/man3curses/form_sub.3curses=form_win.3curses
+s usr/share/man/man3curses/form_term.3curses=form_hook.3curses
+f usr/share/man/man3curses/form_userptr.3curses 0444 root bin
+f usr/share/man/man3curses/form_win.3curses 0444 root bin
+f usr/share/man/man3curses/forms.3curses 0444 root bin
+s usr/share/man/man3curses/free_field.3curses=form_field_new.3curses
+s usr/share/man/man3curses/free_fieldtype.3curses=form_fieldtype.3curses
+s usr/share/man/man3curses/free_form.3curses=form_new.3curses
+s usr/share/man/man3curses/free_item.3curses=menu_item_new.3curses
+s usr/share/man/man3curses/free_menu.3curses=menu_new.3curses
+s usr/share/man/man3curses/getbegyx.3curses=curs_getyx.3curses
+s usr/share/man/man3curses/getch.3curses=curs_getch.3curses
+s usr/share/man/man3curses/getmaxyx.3curses=curs_getyx.3curses
+s usr/share/man/man3curses/getnwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/getparyx.3curses=curs_getyx.3curses
+s usr/share/man/man3curses/getstr.3curses=curs_getstr.3curses
+s usr/share/man/man3curses/getsyx.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/getwch.3curses=curs_getwch.3curses
+s usr/share/man/man3curses/getwin.3curses=curs_util.3curses
+s usr/share/man/man3curses/getwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/getyx.3curses=curs_getyx.3curses
+s usr/share/man/man3curses/halfdelay.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/has_colors.3curses=curs_color.3curses
+s usr/share/man/man3curses/has_ic.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/has_il.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/hide_panel.3curses=panel_show.3curses
+s usr/share/man/man3curses/idcok.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/idlok.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/immedok.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/inch.3curses=curs_inch.3curses
+s usr/share/man/man3curses/inchnstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/inchstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/init_color.3curses=curs_color.3curses
+s usr/share/man/man3curses/init_pair.3curses=curs_color.3curses
+s usr/share/man/man3curses/initscr.3curses=curs_initscr.3curses
+s usr/share/man/man3curses/innstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/innwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/insch.3curses=curs_insch.3curses
+s usr/share/man/man3curses/insdelln.3curses=curs_deleteln.3curses
+s usr/share/man/man3curses/insertln.3curses=curs_deleteln.3curses
+s usr/share/man/man3curses/insnstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/insnwstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/insstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/instr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/inswch.3curses=curs_inswch.3curses
+s usr/share/man/man3curses/inswstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/intrflush.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/inwch.3curses=curs_inwch.3curses
+s usr/share/man/man3curses/inwchnstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/inwchstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/inwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/is_linetouched.3curses=curs_touch.3curses
+s usr/share/man/man3curses/is_wintouched.3curses=curs_touch.3curses
+s usr/share/man/man3curses/isendwin.3curses=curs_initscr.3curses
+s usr/share/man/man3curses/item_count.3curses=menu_items.3curses
+s usr/share/man/man3curses/item_description.3curses=menu_item_name.3curses
+s usr/share/man/man3curses/item_index.3curses=menu_item_current.3curses
+s usr/share/man/man3curses/item_init.3curses=menu_hook.3curses
+s usr/share/man/man3curses/item_name.3curses=menu_item_name.3curses
+s usr/share/man/man3curses/item_opts.3curses=menu_item_opts.3curses
+s usr/share/man/man3curses/item_opts_off.3curses=menu_item_opts.3curses
+s usr/share/man/man3curses/item_opts_on.3curses=menu_item_opts.3curses
+s usr/share/man/man3curses/item_term.3curses=menu_hook.3curses
+s usr/share/man/man3curses/item_userptr.3curses=menu_item_userptr.3curses
+s usr/share/man/man3curses/item_value.3curses=menu_item_value.3curses
+s usr/share/man/man3curses/item_visible.3curses=menu_item_visible.3curses
+s usr/share/man/man3curses/keyname.3curses=curs_util.3curses
+s usr/share/man/man3curses/keypad.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/killchar.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/leaveok.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/link_field.3curses=form_field_new.3curses
+s usr/share/man/man3curses/link_fieldtype.3curses=form_fieldtype.3curses
+s usr/share/man/man3curses/longname.3curses=curs_termattrs.3curses
+f usr/share/man/man3curses/menu_attributes.3curses 0444 root bin
+s usr/share/man/man3curses/menu_back.3curses=menu_attributes.3curses
+f usr/share/man/man3curses/menu_cursor.3curses 0444 root bin
+f usr/share/man/man3curses/menu_driver.3curses 0444 root bin
+s usr/share/man/man3curses/menu_fore.3curses=menu_attributes.3curses
+f usr/share/man/man3curses/menu_format.3curses 0444 root bin
+s usr/share/man/man3curses/menu_grey.3curses=menu_attributes.3curses
+f usr/share/man/man3curses/menu_hook.3curses 0444 root bin
+s usr/share/man/man3curses/menu_init.3curses=menu_hook.3curses
+f usr/share/man/man3curses/menu_item_current.3curses 0444 root bin
+f usr/share/man/man3curses/menu_item_name.3curses 0444 root bin
+f usr/share/man/man3curses/menu_item_new.3curses 0444 root bin
+f usr/share/man/man3curses/menu_item_opts.3curses 0444 root bin
+f usr/share/man/man3curses/menu_item_userptr.3curses 0444 root bin
+f usr/share/man/man3curses/menu_item_value.3curses 0444 root bin
+f usr/share/man/man3curses/menu_item_visible.3curses 0444 root bin
+f usr/share/man/man3curses/menu_items.3curses 0444 root bin
+f usr/share/man/man3curses/menu_mark.3curses 0444 root bin
+f usr/share/man/man3curses/menu_new.3curses 0444 root bin
+f usr/share/man/man3curses/menu_opts.3curses 0444 root bin
+s usr/share/man/man3curses/menu_opts_off.3curses=menu_opts.3curses
+s usr/share/man/man3curses/menu_opts_on.3curses=menu_opts.3curses
+s usr/share/man/man3curses/menu_pad.3curses=menu_attributes.3curses
+f usr/share/man/man3curses/menu_pattern.3curses 0444 root bin
+f usr/share/man/man3curses/menu_post.3curses 0444 root bin
+s usr/share/man/man3curses/menu_sub.3curses=menu_win.3curses
+s usr/share/man/man3curses/menu_term.3curses=menu_hook.3curses
+f usr/share/man/man3curses/menu_userptr.3curses 0444 root bin
+f usr/share/man/man3curses/menu_win.3curses 0444 root bin
+f usr/share/man/man3curses/menus.3curses 0444 root bin
+s usr/share/man/man3curses/meta.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/move.3curses=curs_move.3curses
+s usr/share/man/man3curses/move_field.3curses=form_field.3curses
+s usr/share/man/man3curses/move_panel.3curses=panel_move.3curses
+s usr/share/man/man3curses/movenextch.3curses=curs_alecompat.3curses
+s usr/share/man/man3curses/moveprevch.3curses=curs_alecompat.3curses
+s usr/share/man/man3curses/mvaddch.3curses=curs_addch.3curses
+s usr/share/man/man3curses/mvaddchnstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/mvaddchstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/mvaddnstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/mvaddnwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/mvaddstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/mvaddwch.3curses=curs_addwch.3curses
+s usr/share/man/man3curses/mvaddwchnstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/mvaddwchstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/mvaddwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/mvcur.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/mvdelch.3curses=curs_delch.3curses
+s usr/share/man/man3curses/mvderwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/mvgetch.3curses=curs_getch.3curses
+s usr/share/man/man3curses/mvgetnwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/mvgetstr.3curses=curs_getstr.3curses
+s usr/share/man/man3curses/mvgetwch.3curses=curs_getwch.3curses
+s usr/share/man/man3curses/mvgetwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/mvinch.3curses=curs_inch.3curses
+s usr/share/man/man3curses/mvinchnstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/mvinchstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/mvinnstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/mvinnwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/mvinsch.3curses=curs_insch.3curses
+s usr/share/man/man3curses/mvinsnstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/mvinsnwstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/mvinsstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/mvinstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/mvinswch.3curses=curs_inswch.3curses
+s usr/share/man/man3curses/mvinswstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/mvinwch.3curses=curs_inwch.3curses
+s usr/share/man/man3curses/mvinwchnstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/mvinwchstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/mvinwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/mvprintw.3curses=curs_printw.3curses
+s usr/share/man/man3curses/mvscanw.3curses=curs_scanw.3curses
+s usr/share/man/man3curses/mvwaddch.3curses=curs_addch.3curses
+s usr/share/man/man3curses/mvwaddchnstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/mvwaddchstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/mvwaddnstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/mvwaddnwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/mvwaddstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/mvwaddwch.3curses=curs_addwch.3curses
+s usr/share/man/man3curses/mvwaddwchnstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/mvwaddwchstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/mvwaddwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/mvwdelch.3curses=curs_delch.3curses
+s usr/share/man/man3curses/mvwgetch.3curses=curs_getch.3curses
+s usr/share/man/man3curses/mvwgetnwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/mvwgetstr.3curses=curs_getstr.3curses
+s usr/share/man/man3curses/mvwgetwch.3curses=curs_getwch.3curses
+s usr/share/man/man3curses/mvwgetwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/mvwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/mvwinch.3curses=curs_inch.3curses
+s usr/share/man/man3curses/mvwinchnstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/mvwinchstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/mvwinnstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/mvwinnwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/mvwinsch.3curses=curs_insch.3curses
+s usr/share/man/man3curses/mvwinsnstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/mvwinsnwstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/mvwinsstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/mvwinstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/mvwinswch.3curses=curs_inswch.3curses
+s usr/share/man/man3curses/mvwinswstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/mvwinwch.3curses=curs_inwch.3curses
+s usr/share/man/man3curses/mvwinwchnstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/mvwinwchstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/mvwinwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/mvwprintw.3curses=curs_printw.3curses
+s usr/share/man/man3curses/mvwscanw.3curses=curs_scanw.3curses
+s usr/share/man/man3curses/napms.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/new_field.3curses=form_field_new.3curses
+s usr/share/man/man3curses/new_fieldtype.3curses=form_fieldtype.3curses
+s usr/share/man/man3curses/new_form.3curses=form_new.3curses
+s usr/share/man/man3curses/new_item.3curses=menu_item_new.3curses
+s usr/share/man/man3curses/new_menu.3curses=menu_new.3curses
+s usr/share/man/man3curses/new_page.3curses=form_new_page.3curses
+s usr/share/man/man3curses/new_panel.3curses=panel_new.3curses
+s usr/share/man/man3curses/newpad.3curses=curs_pad.3curses
+s usr/share/man/man3curses/newterm.3curses=curs_initscr.3curses
+s usr/share/man/man3curses/newwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/nl.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/nocbreak.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/nodelay.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/noecho.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/nonl.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/noqiflush.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/noraw.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/notimeout.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/overlay.3curses=curs_overlay.3curses
+s usr/share/man/man3curses/overwrite.3curses=curs_overlay.3curses
+s usr/share/man/man3curses/pair_content.3curses=curs_color.3curses
+f usr/share/man/man3curses/panel_above.3curses 0444 root bin
+s usr/share/man/man3curses/panel_below.3curses=panel_above.3curses
+s usr/share/man/man3curses/panel_hidden.3curses=panel_show.3curses
+f usr/share/man/man3curses/panel_move.3curses 0444 root bin
+f usr/share/man/man3curses/panel_new.3curses 0444 root bin
+f usr/share/man/man3curses/panel_show.3curses 0444 root bin
+f usr/share/man/man3curses/panel_top.3curses 0444 root bin
+f usr/share/man/man3curses/panel_update.3curses 0444 root bin
+f usr/share/man/man3curses/panel_userptr.3curses 0444 root bin
+f usr/share/man/man3curses/panel_window.3curses 0444 root bin
+f usr/share/man/man3curses/panels.3curses 0444 root bin
+s usr/share/man/man3curses/pechochar.3curses=curs_pad.3curses
+s usr/share/man/man3curses/pechowchar.3curses=curs_pad.3curses
+s usr/share/man/man3curses/pnoutrefresh.3curses=curs_pad.3curses
+s usr/share/man/man3curses/pos_form_cursor.3curses=form_cursor.3curses
+s usr/share/man/man3curses/pos_menu_cursor.3curses=menu_cursor.3curses
+s usr/share/man/man3curses/post_form.3curses=form_post.3curses
+s usr/share/man/man3curses/post_menu.3curses=menu_post.3curses
+s usr/share/man/man3curses/prefresh.3curses=curs_pad.3curses
+s usr/share/man/man3curses/printw.3curses=curs_printw.3curses
+s usr/share/man/man3curses/putp.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/putwin.3curses=curs_util.3curses
+s usr/share/man/man3curses/qiflush.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/raw.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/redrawwin.3curses=curs_refresh.3curses
+s usr/share/man/man3curses/refresh.3curses=curs_refresh.3curses
+s usr/share/man/man3curses/replace_panel.3curses=panel_window.3curses
+s usr/share/man/man3curses/reset_prog_mode.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/reset_shell_mode.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/resetty.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/restartterm.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/ripoffline.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/savetty.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/scale_form.3curses=form_win.3curses
+s usr/share/man/man3curses/scale_menu.3curses=menu_win.3curses
+s usr/share/man/man3curses/scanw.3curses=curs_scanw.3curses
+s usr/share/man/man3curses/scr_dump.3curses=curs_scr_dump.3curses
+s usr/share/man/man3curses/scr_init.3curses=curs_scr_dump.3curses
+s usr/share/man/man3curses/scr_restore.3curses=curs_scr_dump.3curses
+s usr/share/man/man3curses/scr_set.3curses=curs_scr_dump.3curses
+s usr/share/man/man3curses/scrl.3curses=curs_scroll.3curses
+s usr/share/man/man3curses/scroll.3curses=curs_scroll.3curses
+s usr/share/man/man3curses/scrollok.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/set_current_field.3curses=form_page.3curses
+s usr/share/man/man3curses/set_current_item.3curses=menu_item_current.3curses
+s usr/share/man/man3curses/set_curterm.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/set_field_back.3curses=form_field_attributes.3curses
+s usr/share/man/man3curses/set_field_buffer.3curses=form_field_buffer.3curses
+s usr/share/man/man3curses/set_field_fore.3curses=form_field_attributes.3curses
+s usr/share/man/man3curses/set_field_init.3curses=form_hook.3curses
+s usr/share/man/man3curses/set_field_just.3curses=form_field_just.3curses
+s usr/share/man/man3curses/set_field_opts.3curses=form_field_opts.3curses
+s usr/share/man/man3curses/set_field_pad.3curses=form_field_attributes.3curses
+s usr/share/man/man3curses/set_field_status.3curses=form_field_buffer.3curses
+s usr/share/man/man3curses/set_field_term.3curses=form_hook.3curses
+s usr/share/man/man3curses/set_field_type.3curses=form_field_validation.3curses
+s usr/share/man/man3curses/set_field_userptr.3curses=form_field_userptr.3curses
+s usr/share/man/man3curses/set_fieldtype_arg.3curses=form_fieldtype.3curses
+s usr/share/man/man3curses/set_fieldtype_choice.3curses=form_fieldtype.3curses
+s usr/share/man/man3curses/set_form_fields.3curses=form_field.3curses
+s usr/share/man/man3curses/set_form_init.3curses=form_hook.3curses
+s usr/share/man/man3curses/set_form_opts.3curses=form_opts.3curses
+s usr/share/man/man3curses/set_form_page.3curses=form_page.3curses
+s usr/share/man/man3curses/set_form_sub.3curses=form_win.3curses
+s usr/share/man/man3curses/set_form_term.3curses=form_hook.3curses
+s usr/share/man/man3curses/set_form_userptr.3curses=form_userptr.3curses
+s usr/share/man/man3curses/set_form_win.3curses=form_win.3curses
+s usr/share/man/man3curses/set_item_init.3curses=menu_hook.3curses
+s usr/share/man/man3curses/set_item_opts.3curses=menu_item_opts.3curses
+s usr/share/man/man3curses/set_item_term.3curses=menu_hook.3curses
+s usr/share/man/man3curses/set_item_userptr.3curses=menu_item_userptr.3curses
+s usr/share/man/man3curses/set_item_value.3curses=menu_item_value.3curses
+s usr/share/man/man3curses/set_max_field.3curses=form_field_buffer.3curses
+s usr/share/man/man3curses/set_menu_back.3curses=menu_attributes.3curses
+s usr/share/man/man3curses/set_menu_fore.3curses=menu_attributes.3curses
+s usr/share/man/man3curses/set_menu_format.3curses=menu_format.3curses
+s usr/share/man/man3curses/set_menu_grey.3curses=menu_attributes.3curses
+s usr/share/man/man3curses/set_menu_init.3curses=menu_hook.3curses
+s usr/share/man/man3curses/set_menu_items.3curses=menu_items.3curses
+s usr/share/man/man3curses/set_menu_mark.3curses=menu_mark.3curses
+s usr/share/man/man3curses/set_menu_opts.3curses=menu_opts.3curses
+s usr/share/man/man3curses/set_menu_pad.3curses=menu_attributes.3curses
+s usr/share/man/man3curses/set_menu_pattern.3curses=menu_pattern.3curses
+s usr/share/man/man3curses/set_menu_sub.3curses=menu_win.3curses
+s usr/share/man/man3curses/set_menu_term.3curses=menu_hook.3curses
+s usr/share/man/man3curses/set_menu_userptr.3curses=menu_userptr.3curses
+s usr/share/man/man3curses/set_menu_win.3curses=menu_win.3curses
+s usr/share/man/man3curses/set_new_page.3curses=form_new_page.3curses
+s usr/share/man/man3curses/set_panel_userptr.3curses=panel_userptr.3curses
+s usr/share/man/man3curses/set_term.3curses=curs_initscr.3curses
+s usr/share/man/man3curses/set_top_row.3curses=menu_item_current.3curses
+s usr/share/man/man3curses/setscrreg.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/setsyx.3curses=curs_kernel.3curses
+s usr/share/man/man3curses/setterm.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/setupterm.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/show_panel.3curses=panel_show.3curses
+s usr/share/man/man3curses/slk_attroff.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_attron.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_attrset.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_clear.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_init.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_label.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_noutrefresh.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_refresh.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_restore.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_set.3curses=curs_slk.3curses
+s usr/share/man/man3curses/slk_touch.3curses=curs_slk.3curses
+s usr/share/man/man3curses/standend.3curses=curs_attr.3curses
+s usr/share/man/man3curses/standout.3curses=curs_attr.3curses
+s usr/share/man/man3curses/start_color.3curses=curs_color.3curses
+s usr/share/man/man3curses/subpad.3curses=curs_pad.3curses
+s usr/share/man/man3curses/subwin.3curses=curs_window.3curses
+s usr/share/man/man3curses/syncok.3curses=curs_window.3curses
+s usr/share/man/man3curses/termattrs.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/termname.3curses=curs_termattrs.3curses
+s usr/share/man/man3curses/tgetent.3curses=curs_termcap.3curses
+s usr/share/man/man3curses/tgetflag.3curses=curs_termcap.3curses
+s usr/share/man/man3curses/tgetnum.3curses=curs_termcap.3curses
+s usr/share/man/man3curses/tgetstr.3curses=curs_termcap.3curses
+s usr/share/man/man3curses/tgoto.3curses=curs_termcap.3curses
+s usr/share/man/man3curses/tigetflag.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/tigetnum.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/tigetstr.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/timeout.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/top_panel.3curses=panel_top.3curses
+s usr/share/man/man3curses/top_row.3curses=menu_item_current.3curses
+s usr/share/man/man3curses/touchline.3curses=curs_touch.3curses
+s usr/share/man/man3curses/touchwin.3curses=curs_touch.3curses
+s usr/share/man/man3curses/tparm.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/tputs.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/typeahead.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/unctrl.3curses=curs_util.3curses
+s usr/share/man/man3curses/ungetch.3curses=curs_getch.3curses
+s usr/share/man/man3curses/ungetwch.3curses=curs_getwch.3curses
+s usr/share/man/man3curses/unpost_form.3curses=form_post.3curses
+s usr/share/man/man3curses/unpost_menu.3curses=menu_post.3curses
+s usr/share/man/man3curses/untouchwin.3curses=curs_touch.3curses
+s usr/share/man/man3curses/update_panels.3curses=panel_update.3curses
+s usr/share/man/man3curses/use_env.3curses=curs_util.3curses
+s usr/share/man/man3curses/vidattr.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/vidputs.3curses=curs_terminfo.3curses
+s usr/share/man/man3curses/vwprintw.3curses=curs_printw.3curses
+s usr/share/man/man3curses/vwscanw.3curses=curs_scanw.3curses
+s usr/share/man/man3curses/waddch.3curses=curs_addch.3curses
+s usr/share/man/man3curses/waddchnstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/waddchstr.3curses=curs_addchstr.3curses
+s usr/share/man/man3curses/waddnstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/waddnwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/waddstr.3curses=curs_addstr.3curses
+s usr/share/man/man3curses/waddwch.3curses=curs_addwch.3curses
+s usr/share/man/man3curses/waddwchnstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/waddwchstr.3curses=curs_addwchstr.3curses
+s usr/share/man/man3curses/waddwstr.3curses=curs_addwstr.3curses
+s usr/share/man/man3curses/wadjcurspos.3curses=curs_alecompat.3curses
+s usr/share/man/man3curses/wattroff.3curses=curs_attr.3curses
+s usr/share/man/man3curses/wattron.3curses=curs_attr.3curses
+s usr/share/man/man3curses/wattrset.3curses=curs_attr.3curses
+s usr/share/man/man3curses/wbkgd.3curses=curs_bkgd.3curses
+s usr/share/man/man3curses/wbkgdset.3curses=curs_bkgd.3curses
+s usr/share/man/man3curses/wborder.3curses=curs_border.3curses
+s usr/share/man/man3curses/wclear.3curses=curs_clear.3curses
+s usr/share/man/man3curses/wclrtobot.3curses=curs_clear.3curses
+s usr/share/man/man3curses/wclrtoeol.3curses=curs_clear.3curses
+s usr/share/man/man3curses/wcursyncup.3curses=curs_window.3curses
+s usr/share/man/man3curses/wdelch.3curses=curs_delch.3curses
+s usr/share/man/man3curses/wdeleteln.3curses=curs_deleteln.3curses
+s usr/share/man/man3curses/wechochar.3curses=curs_addch.3curses
+s usr/share/man/man3curses/wechowchar.3curses=curs_addwch.3curses
+s usr/share/man/man3curses/werase.3curses=curs_clear.3curses
+s usr/share/man/man3curses/wgetch.3curses=curs_getch.3curses
+s usr/share/man/man3curses/wgetnstr.3curses=curs_getstr.3curses
+s usr/share/man/man3curses/wgetnwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/wgetstr.3curses=curs_getstr.3curses
+s usr/share/man/man3curses/wgetwch.3curses=curs_getwch.3curses
+s usr/share/man/man3curses/wgetwstr.3curses=curs_getwstr.3curses
+s usr/share/man/man3curses/whline.3curses=curs_border.3curses
+s usr/share/man/man3curses/winch.3curses=curs_inch.3curses
+s usr/share/man/man3curses/winchnstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/winchstr.3curses=curs_inchstr.3curses
+s usr/share/man/man3curses/winnstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/winnwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/winsch.3curses=curs_insch.3curses
+s usr/share/man/man3curses/winsdelln.3curses=curs_deleteln.3curses
+s usr/share/man/man3curses/winsertln.3curses=curs_deleteln.3curses
+s usr/share/man/man3curses/winsnstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/winsnwstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/winsstr.3curses=curs_insstr.3curses
+s usr/share/man/man3curses/winstr.3curses=curs_instr.3curses
+s usr/share/man/man3curses/winswch.3curses=curs_inswch.3curses
+s usr/share/man/man3curses/winswstr.3curses=curs_inswstr.3curses
+s usr/share/man/man3curses/winwch.3curses=curs_inwch.3curses
+s usr/share/man/man3curses/winwchnstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/winwchstr.3curses=curs_inwchstr.3curses
+s usr/share/man/man3curses/winwstr.3curses=curs_inwstr.3curses
+s usr/share/man/man3curses/wmove.3curses=curs_move.3curses
+s usr/share/man/man3curses/wmovenextch.3curses=curs_alecompat.3curses
+s usr/share/man/man3curses/wmoveprevch.3curses=curs_alecompat.3curses
+s usr/share/man/man3curses/wnoutrefresh.3curses=curs_refresh.3curses
+s usr/share/man/man3curses/wprintw.3curses=curs_printw.3curses
+s usr/share/man/man3curses/wredrawln.3curses=curs_refresh.3curses
+s usr/share/man/man3curses/wrefresh.3curses=curs_refresh.3curses
+s usr/share/man/man3curses/wscanw.3curses=curs_scanw.3curses
+s usr/share/man/man3curses/wscrl.3curses=curs_scroll.3curses
+s usr/share/man/man3curses/wsetscrreg.3curses=curs_outopts.3curses
+s usr/share/man/man3curses/wstandend.3curses=curs_attr.3curses
+s usr/share/man/man3curses/wstandout.3curses=curs_attr.3curses
+s usr/share/man/man3curses/wsyncdown.3curses=curs_window.3curses
+s usr/share/man/man3curses/wsyncup.3curses=curs_window.3curses
+s usr/share/man/man3curses/wtimeout.3curses=curs_inopts.3curses
+s usr/share/man/man3curses/wtouchln.3curses=curs_touch.3curses
+s usr/share/man/man3curses/wvline.3curses=curs_border.3curses
+d usr/share/man/man3dat 0755 root bin
+f usr/share/man/man3dat/dat_cno_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cno_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cno_modify_agent.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cno_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cno_wait.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cr_accept.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cr_handoff.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cr_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_cr_reject.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_connect.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_create_with_srq.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_disconnect.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_dup_connect.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_get_status.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_modify.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_post_rdma_read.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_post_rdma_write.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_post_recv.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_post_send.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_recv_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_reset.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ep_set_watermark.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_clear_unwaitable.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_dequeue.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_disable.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_enable.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_modify_cno.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_post_se.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_resize.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_set_unwaitable.3dat 0444 root bin
+f usr/share/man/man3dat/dat_evd_wait.3dat 0444 root bin
+f usr/share/man/man3dat/dat_get_consumer_context.3dat 0444 root bin
+f usr/share/man/man3dat/dat_get_handle_type.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ia_close.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ia_open.3dat 0444 root bin
+f usr/share/man/man3dat/dat_ia_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_lmr_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_lmr_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_lmr_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_lmr_sync_rdma_read.3dat 0444 root bin
+f usr/share/man/man3dat/dat_lmr_sync_rdma_write.3dat 0444 root bin
+f usr/share/man/man3dat/dat_provider_fini.3dat 0444 root bin
+f usr/share/man/man3dat/dat_provider_init.3dat 0444 root bin
+f usr/share/man/man3dat/dat_psp_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_psp_create_any.3dat 0444 root bin
+f usr/share/man/man3dat/dat_psp_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_psp_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_pz_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_pz_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_pz_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_registry_add_provider.3dat 0444 root bin
+f usr/share/man/man3dat/dat_registry_list_providers.3dat 0444 root bin
+f usr/share/man/man3dat/dat_registry_remove_provider.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rmr_bind.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rmr_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rmr_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rmr_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rsp_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rsp_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_rsp_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_set_consumer_context.3dat 0444 root bin
+f usr/share/man/man3dat/dat_srq_create.3dat 0444 root bin
+f usr/share/man/man3dat/dat_srq_free.3dat 0444 root bin
+f usr/share/man/man3dat/dat_srq_post_recv.3dat 0444 root bin
+f usr/share/man/man3dat/dat_srq_query.3dat 0444 root bin
+f usr/share/man/man3dat/dat_srq_resize.3dat 0444 root bin
+f usr/share/man/man3dat/dat_srq_set_lw.3dat 0444 root bin
+f usr/share/man/man3dat/dat_strerror.3dat 0444 root bin
+d usr/share/man/man3devid 0755 root bin
+s usr/share/man/man3devid/devid_compare.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_deviceid_to_nmlist.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_free.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_free_nmlist.3devid=devid_get.3devid
+f usr/share/man/man3devid/devid_get.3devid 0444 root bin
+s usr/share/man/man3devid/devid_get_minor_name.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_sizeof.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_str_decode.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_str_encode.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_str_free.3devid=devid_get.3devid
+s usr/share/man/man3devid/devid_valid.3devid=devid_get.3devid
+d usr/share/man/man3devinfo 0755 root bin
+f usr/share/man/man3devinfo/di_binding_name.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_bus_addr.3devinfo=di_binding_name.3devinfo
+f usr/share/man/man3devinfo/di_child_node.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_compatible_names.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_devfs_minor_path.3devinfo=di_devfs_path.3devinfo
+f usr/share/man/man3devinfo/di_devfs_path.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_devfs_path_free.3devinfo=di_devfs_path.3devinfo
+s usr/share/man/man3devinfo/di_devid.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_devlink_content.3devinfo=di_devlink_path.3devinfo
+f usr/share/man/man3devinfo/di_devlink_dup.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_devlink_fini.3devinfo=di_devlink_init.3devinfo
+s usr/share/man/man3devinfo/di_devlink_free.3devinfo=di_devlink_dup.3devinfo
+f usr/share/man/man3devinfo/di_devlink_init.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_devlink_path.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_devlink_type.3devinfo=di_devlink_path.3devinfo
+f usr/share/man/man3devinfo/di_devlink_walk.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_driver_major.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_driver_name.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_driver_ops.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_drv_first_node.3devinfo=di_child_node.3devinfo
+s usr/share/man/man3devinfo/di_drv_next_node.3devinfo=di_child_node.3devinfo
+s usr/share/man/man3devinfo/di_fini.3devinfo=di_init.3devinfo
+f usr/share/man/man3devinfo/di_init.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_instance.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_link_next_by_lnode.3devinfo=di_link_next_by_node.3devinfo
+f usr/share/man/man3devinfo/di_link_next_by_node.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_link_private_get.3devinfo=di_node_private_set.3devinfo
+s usr/share/man/man3devinfo/di_link_private_set.3devinfo=di_node_private_set.3devinfo
+f usr/share/man/man3devinfo/di_link_spectype.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_link_to_lnode.3devinfo=di_link_spectype.3devinfo
+s usr/share/man/man3devinfo/di_lnode_devinfo.3devinfo=di_lnode_name.3devinfo
+s usr/share/man/man3devinfo/di_lnode_devt.3devinfo=di_lnode_name.3devinfo
+f usr/share/man/man3devinfo/di_lnode_name.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_lnode_next.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_lnode_private_get.3devinfo=di_node_private_set.3devinfo
+s usr/share/man/man3devinfo/di_lnode_private_set.3devinfo=di_node_private_set.3devinfo
+f usr/share/man/man3devinfo/di_minor_devt.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_minor_name.3devinfo=di_minor_devt.3devinfo
+f usr/share/man/man3devinfo/di_minor_next.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_minor_nodetype.3devinfo=di_minor_devt.3devinfo
+s usr/share/man/man3devinfo/di_minor_private_get.3devinfo=di_node_private_set.3devinfo
+s usr/share/man/man3devinfo/di_minor_private_set.3devinfo=di_node_private_set.3devinfo
+s usr/share/man/man3devinfo/di_minor_spectype.3devinfo=di_minor_devt.3devinfo
+s usr/share/man/man3devinfo/di_node_name.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_node_private_get.3devinfo=di_node_private_set.3devinfo
+f usr/share/man/man3devinfo/di_node_private_set.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_nodeid.3devinfo=di_binding_name.3devinfo
+s usr/share/man/man3devinfo/di_parent_node.3devinfo=di_child_node.3devinfo
+f usr/share/man/man3devinfo/di_path_bus_addr.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_path_client_devfs_path.3devinfo=di_devfs_path.3devinfo
+f usr/share/man/man3devinfo/di_path_client_next_path.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_path_client_node.3devinfo=di_path_bus_addr.3devinfo
+s usr/share/man/man3devinfo/di_path_devfs_path.3devinfo=di_devfs_path.3devinfo
+s usr/share/man/man3devinfo/di_path_instance.3devinfo=di_path_bus_addr.3devinfo
+s usr/share/man/man3devinfo/di_path_node_name.3devinfo=di_path_bus_addr.3devinfo
+s usr/share/man/man3devinfo/di_path_phci_next_path.3devinfo=di_path_client_next_path.3devinfo
+s usr/share/man/man3devinfo/di_path_phci_node.3devinfo=di_path_bus_addr.3devinfo
+s usr/share/man/man3devinfo/di_path_private_get.3devinfo=di_node_private_set.3devinfo
+s usr/share/man/man3devinfo/di_path_private_set.3devinfo=di_node_private_set.3devinfo
+f usr/share/man/man3devinfo/di_path_prop_bytes.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_path_prop_int64s.3devinfo=di_path_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_path_prop_ints.3devinfo=di_path_prop_bytes.3devinfo
+f usr/share/man/man3devinfo/di_path_prop_lookup_bytes.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_path_prop_lookup_int64s.3devinfo=di_path_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_path_prop_lookup_ints.3devinfo=di_path_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_path_prop_lookup_strings.3devinfo=di_path_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_path_prop_name.3devinfo=di_path_prop_bytes.3devinfo
+f usr/share/man/man3devinfo/di_path_prop_next.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_path_prop_strings.3devinfo=di_path_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_path_prop_type.3devinfo=di_path_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_path_state.3devinfo=di_path_bus_addr.3devinfo
+s usr/share/man/man3devinfo/di_prom_fini.3devinfo=di_prom_init.3devinfo
+f usr/share/man/man3devinfo/di_prom_init.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_prom_prop_data.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_prom_prop_lookup_bytes.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_prom_prop_lookup_ints.3devinfo=di_prom_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prom_prop_lookup_strings.3devinfo=di_prom_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prom_prop_name.3devinfo=di_prom_prop_data.3devinfo
+s usr/share/man/man3devinfo/di_prom_prop_next.3devinfo=di_prom_prop_data.3devinfo
+f usr/share/man/man3devinfo/di_prop_bytes.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_prop_devt.3devinfo=di_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prop_int64.3devinfo=di_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prop_ints.3devinfo=di_prop_bytes.3devinfo
+f usr/share/man/man3devinfo/di_prop_lookup_bytes.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_prop_lookup_int64.3devinfo=di_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prop_lookup_ints.3devinfo=di_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prop_lookup_strings.3devinfo=di_prop_lookup_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prop_name.3devinfo=di_prop_bytes.3devinfo
+f usr/share/man/man3devinfo/di_prop_next.3devinfo 0444 root bin
+s usr/share/man/man3devinfo/di_prop_strings.3devinfo=di_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_prop_type.3devinfo=di_prop_bytes.3devinfo
+s usr/share/man/man3devinfo/di_sibling_node.3devinfo=di_child_node.3devinfo
+f usr/share/man/man3devinfo/di_walk_link.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_walk_lnode.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_walk_minor.3devinfo 0444 root bin
+f usr/share/man/man3devinfo/di_walk_node.3devinfo 0444 root bin
+d usr/share/man/man3dlpi 0755 root bin
+f usr/share/man/man3dlpi/dlpi_arptype.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_bind.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_close.3dlpi 0444 root bin
+s usr/share/man/man3dlpi/dlpi_disabmulti.3dlpi=dlpi_enabmulti.3dlpi
+f usr/share/man/man3dlpi/dlpi_disabnotify.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_enabmulti.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_enabnotify.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_fd.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_get_physaddr.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_iftype.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_info.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_linkname.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_mactype.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_open.3dlpi 0444 root bin
+s usr/share/man/man3dlpi/dlpi_promiscoff.3dlpi=dlpi_promiscon.3dlpi
+f usr/share/man/man3dlpi/dlpi_promiscon.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_recv.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_send.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_set_physaddr.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_set_timeout.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_strerror.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_unbind.3dlpi 0444 root bin
+f usr/share/man/man3dlpi/dlpi_walk.3dlpi 0444 root bin
+d usr/share/man/man3dns_sd 0755 root bin
+s usr/share/man/man3dns_sd/DNSServiceAddRecord.3dns_sd=DNSServiceCreateConnection.3dns_sd
+f usr/share/man/man3dns_sd/DNSServiceBrowse.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceConstructFullName.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceCreateConnection.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceEnumerateDomains.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceProcessResult.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceQueryRecord.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceReconfirmRecord.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceRefDeallocate.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceRefSockFD.3dns_sd 0444 root bin
+f usr/share/man/man3dns_sd/DNSServiceRegister.3dns_sd 0444 root bin
+s usr/share/man/man3dns_sd/DNSServiceRegisterRecord.3dns_sd=DNSServiceCreateConnection.3dns_sd
+s usr/share/man/man3dns_sd/DNSServiceRemoveRecord.3dns_sd=DNSServiceCreateConnection.3dns_sd
+f usr/share/man/man3dns_sd/DNSServiceResolve.3dns_sd 0444 root bin
+s usr/share/man/man3dns_sd/DNSServiceUpdateRecord.3dns_sd=DNSServiceCreateConnection.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordContainsKey.3dns_sd=TXTRecordCreate.3dns_sd
+f usr/share/man/man3dns_sd/TXTRecordCreate.3dns_sd 0444 root bin
+s usr/share/man/man3dns_sd/TXTRecordDeallocate.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordGetBytesPtr.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordGetCount.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordGetItemAtIndex.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordGetLength.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordGetValuePtr.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordRemoveValue.3dns_sd=TXTRecordCreate.3dns_sd
+s usr/share/man/man3dns_sd/TXTRecordSetValue.3dns_sd=TXTRecordCreate.3dns_sd
+d usr/share/man/man3elf 0755 root bin
+f usr/share/man/man3elf/elf.3elf 0444 root bin
+f usr/share/man/man3elf/elf32_checksum.3elf 0444 root bin
+f usr/share/man/man3elf/elf32_fsize.3elf 0444 root bin
+f usr/share/man/man3elf/elf32_getehdr.3elf 0444 root bin
+f usr/share/man/man3elf/elf32_getphdr.3elf 0444 root bin
+f usr/share/man/man3elf/elf32_getshdr.3elf 0444 root bin
+s usr/share/man/man3elf/elf32_newehdr.3elf=elf32_getehdr.3elf
+s usr/share/man/man3elf/elf32_newphdr.3elf=elf32_getphdr.3elf
+f usr/share/man/man3elf/elf32_xlatetof.3elf 0444 root bin
+s usr/share/man/man3elf/elf32_xlatetom.3elf=elf32_xlatetof.3elf
+s usr/share/man/man3elf/elf64_checksum.3elf=elf32_checksum.3elf
+s usr/share/man/man3elf/elf64_fsize.3elf=elf32_fsize.3elf
+s usr/share/man/man3elf/elf64_getehdr.3elf=elf32_getehdr.3elf
+s usr/share/man/man3elf/elf64_getphdr.3elf=elf32_getphdr.3elf
+s usr/share/man/man3elf/elf64_getshdr.3elf=elf32_getshdr.3elf
+s usr/share/man/man3elf/elf64_newehdr.3elf=elf32_getehdr.3elf
+s usr/share/man/man3elf/elf64_newphdr.3elf=elf32_getphdr.3elf
+s usr/share/man/man3elf/elf64_xlatetof.3elf=elf32_xlatetof.3elf
+s usr/share/man/man3elf/elf64_xlatetom.3elf=elf32_xlatetof.3elf
+f usr/share/man/man3elf/elf_begin.3elf 0444 root bin
+f usr/share/man/man3elf/elf_cntl.3elf 0444 root bin
+s usr/share/man/man3elf/elf_end.3elf=elf_begin.3elf
+f usr/share/man/man3elf/elf_errmsg.3elf 0444 root bin
+s usr/share/man/man3elf/elf_errno.3elf=elf_errmsg.3elf
+f usr/share/man/man3elf/elf_fill.3elf 0444 root bin
+f usr/share/man/man3elf/elf_flagdata.3elf 0444 root bin
+s usr/share/man/man3elf/elf_flagehdr.3elf=elf_flagdata.3elf
+s usr/share/man/man3elf/elf_flagelf.3elf=elf_flagdata.3elf
+s usr/share/man/man3elf/elf_flagphdr.3elf=elf_flagdata.3elf
+s usr/share/man/man3elf/elf_flagscn.3elf=elf_flagdata.3elf
+s usr/share/man/man3elf/elf_flagshdr.3elf=elf_flagdata.3elf
+f usr/share/man/man3elf/elf_getarhdr.3elf 0444 root bin
+f usr/share/man/man3elf/elf_getarsym.3elf 0444 root bin
+f usr/share/man/man3elf/elf_getbase.3elf 0444 root bin
+f usr/share/man/man3elf/elf_getdata.3elf 0444 root bin
+f usr/share/man/man3elf/elf_getident.3elf 0444 root bin
+s usr/share/man/man3elf/elf_getphdrnum.3elf=elf_getident.3elf
+s usr/share/man/man3elf/elf_getphnum.3elf=elf_getident.3elf
+f usr/share/man/man3elf/elf_getscn.3elf 0444 root bin
+s usr/share/man/man3elf/elf_getshdrnum.3elf=elf_getident.3elf
+s usr/share/man/man3elf/elf_getshdrstrndx.3elf=elf_getident.3elf
+s usr/share/man/man3elf/elf_getshnum.3elf=elf_getident.3elf
+s usr/share/man/man3elf/elf_getshstrndx.3elf=elf_getident.3elf
+f usr/share/man/man3elf/elf_hash.3elf 0444 root bin
+f usr/share/man/man3elf/elf_kind.3elf 0444 root bin
+s usr/share/man/man3elf/elf_memory.3elf=elf_begin.3elf
+s usr/share/man/man3elf/elf_ndxscn.3elf=elf_getscn.3elf
+s usr/share/man/man3elf/elf_newdata.3elf=elf_getdata.3elf
+s usr/share/man/man3elf/elf_newscn.3elf=elf_getscn.3elf
+s usr/share/man/man3elf/elf_next.3elf=elf_begin.3elf
+s usr/share/man/man3elf/elf_nextscn.3elf=elf_getscn.3elf
+s usr/share/man/man3elf/elf_rand.3elf=elf_begin.3elf
+s usr/share/man/man3elf/elf_rawdata.3elf=elf_getdata.3elf
+f usr/share/man/man3elf/elf_rawfile.3elf 0444 root bin
+f usr/share/man/man3elf/elf_strptr.3elf 0444 root bin
+f usr/share/man/man3elf/elf_update.3elf 0444 root bin
+f usr/share/man/man3elf/elf_version.3elf 0444 root bin
+f usr/share/man/man3elf/gelf.3elf 0444 root bin
+s usr/share/man/man3elf/gelf_checksum.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_fsize.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getcap.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getclass.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getdyn.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getehdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getmove.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getphdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getrel.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getrela.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getshdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getsym.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getsyminfo.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_getsymshndx.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_newehdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_newphdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_cap.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_dyn.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_ehdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_getmove.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_move.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_phdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_rel.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_rela.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_shdr.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_sym.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_syminfo.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_update_symshndx.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_xlatetof.3elf=gelf.3elf
+s usr/share/man/man3elf/gelf_xlatetom.3elf=gelf.3elf
+f usr/share/man/man3elf/nlist.3elf 0444 root bin
+d usr/share/man/man3exacct 0755 root bin
+s usr/share/man/man3exacct/ea_alloc.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_attach_to_group.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_attach_to_object.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_close.3exacct=ea_open.3exacct
+s usr/share/man/man3exacct/ea_copy_object.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_copy_object_tree.3exacct=ea_pack_object.3exacct
+f usr/share/man/man3exacct/ea_error.3exacct 0444 root bin
+s usr/share/man/man3exacct/ea_free.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_free_item.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_free_object.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_get_creator.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_get_hostname.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_get_object.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_get_object_tree.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_match_object_catalog.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_next_object.3exacct=ea_pack_object.3exacct
+f usr/share/man/man3exacct/ea_open.3exacct 0444 root bin
+f usr/share/man/man3exacct/ea_pack_object.3exacct 0444 root bin
+s usr/share/man/man3exacct/ea_previous_object.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_set_group.3exacct=ea_set_item.3exacct
+f usr/share/man/man3exacct/ea_set_item.3exacct 0444 root bin
+s usr/share/man/man3exacct/ea_strdup.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_strfree.3exacct=ea_set_item.3exacct
+s usr/share/man/man3exacct/ea_unpack_object.3exacct=ea_pack_object.3exacct
+s usr/share/man/man3exacct/ea_write_object.3exacct=ea_pack_object.3exacct
+d usr/share/man/man3ext 0755 root bin
+s usr/share/man/man3ext/DES_FAILED.3ext=ecb_crypt.3ext
+s usr/share/man/man3ext/MD4Final.3ext=md4.3ext
+s usr/share/man/man3ext/MD4Init.3ext=md4.3ext
+s usr/share/man/man3ext/MD4Update.3ext=md4.3ext
+s usr/share/man/man3ext/MD5Final.3ext=md5.3ext
+s usr/share/man/man3ext/MD5Init.3ext=md5.3ext
+s usr/share/man/man3ext/MD5Update.3ext=md5.3ext
+f usr/share/man/man3ext/NOTE.3ext 0444 root bin
+s usr/share/man/man3ext/SHA1Final.3ext=sha1.3ext
+s usr/share/man/man3ext/SHA1Init.3ext=sha1.3ext
+s usr/share/man/man3ext/SHA1Update.3ext=sha1.3ext
+s usr/share/man/man3ext/SHA256Final.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA256Init.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA256Update.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA2Final.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA2Init.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA2Update.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA384Final.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA384Init.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA384Update.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA512Final.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA512Init.3ext=sha2.3ext
+s usr/share/man/man3ext/SHA512Update.3ext=sha2.3ext
+f usr/share/man/man3ext/SUNW_C_GetMechSession.3ext 0444 root bin
+s usr/share/man/man3ext/SUNW_C_KeyToObject.3ext=SUNW_C_GetMechSession.3ext
+s usr/share/man/man3ext/_NOTE.3ext=NOTE.3ext
+f usr/share/man/man3ext/auto_ef.3ext 0444 root bin
+s usr/share/man/man3ext/auto_ef_file.3ext=auto_ef.3ext
+s usr/share/man/man3ext/auto_ef_free.3ext=auto_ef.3ext
+s usr/share/man/man3ext/auto_ef_get_encoding.3ext=auto_ef.3ext
+s usr/share/man/man3ext/auto_ef_get_score.3ext=auto_ef.3ext
+s usr/share/man/man3ext/auto_ef_str.3ext=auto_ef.3ext
+s usr/share/man/man3ext/cbc_crypt.3ext=ecb_crypt.3ext
+s usr/share/man/man3ext/cplus_demangle.3ext=demangle.3ext
+f usr/share/man/man3ext/crypt.3ext 0444 root bin
+s usr/share/man/man3ext/crypt_close.3ext=crypt.3ext
+f usr/share/man/man3ext/demangle.3ext 0444 root bin
+s usr/share/man/man3ext/des_crypt.3ext=crypt.3ext
+s usr/share/man/man3ext/des_encrypt.3ext=crypt.3ext
+s usr/share/man/man3ext/des_setkey.3ext=crypt.3ext
+s usr/share/man/man3ext/des_setparity.3ext=ecb_crypt.3ext
+f usr/share/man/man3ext/ecb_crypt.3ext 0444 root bin
+f usr/share/man/man3ext/efi_alloc_and_init.3ext 0444 root bin
+s usr/share/man/man3ext/efi_alloc_and_read.3ext=efi_alloc_and_init.3ext
+s usr/share/man/man3ext/efi_free.3ext=efi_alloc_and_init.3ext
+s usr/share/man/man3ext/efi_use_whole_disk.3ext=efi_alloc_and_init.3ext
+s usr/share/man/man3ext/efi_write.3ext=efi_alloc_and_init.3ext
+s usr/share/man/man3ext/encrypt.3ext=crypt.3ext
+s usr/share/man/man3ext/la_activity.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_amd64_pltenter.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_i86_pltenter.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_objfilter.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_objopen.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_objsearch.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_pltexit.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_pltexit64.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_preinit.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_sparcv8_pltenter.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_sparcv9_pltenter.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_symbind32.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_symbind64.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/la_version.3ext=rtld_audit.3ext
+s usr/share/man/man3ext/ld_atexit.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_atexit64.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_file.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_file64.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_input_done.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_input_section.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_input_section64.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_open.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_open64.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_section.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_section64.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_start.3ext=ld_support.3ext
+s usr/share/man/man3ext/ld_start64.3ext=ld_support.3ext
+f usr/share/man/man3ext/ld_support.3ext 0444 root bin
+s usr/share/man/man3ext/ld_version.3ext=ld_support.3ext
+f usr/share/man/man3ext/md4.3ext 0444 root bin
+f usr/share/man/man3ext/md5.3ext 0444 root bin
+s usr/share/man/man3ext/md5_calc.3ext=md5.3ext
+s usr/share/man/man3ext/rd_delete.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_errstr.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_event_addr.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_event_enable.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_event_getmsg.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_init.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_loadobj_iter.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_log.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_new.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_objpad_enable.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_plt_resolution.3ext=rtld_db.3ext
+s usr/share/man/man3ext/rd_reset.3ext=rtld_db.3ext
+f usr/share/man/man3ext/read_vtoc.3ext 0444 root bin
+f usr/share/man/man3ext/rtld_audit.3ext 0444 root bin
+f usr/share/man/man3ext/rtld_db.3ext 0444 root bin
+s usr/share/man/man3ext/run_crypt.3ext=crypt.3ext
+s usr/share/man/man3ext/run_setkey.3ext=crypt.3ext
+f usr/share/man/man3ext/sendfile.3ext 0444 root bin
+f usr/share/man/man3ext/sendfilev.3ext 0444 root bin
+s usr/share/man/man3ext/setkey.3ext=crypt.3ext
+f usr/share/man/man3ext/sha1.3ext 0444 root bin
+f usr/share/man/man3ext/sha2.3ext 0444 root bin
+f usr/share/man/man3ext/stdarg.3ext 0444 root bin
+f usr/share/man/man3ext/tsalarm_get.3ext 0444 root bin
+s usr/share/man/man3ext/tsalarm_set.3ext=tsalarm_get.3ext
+f usr/share/man/man3ext/varargs.3ext 0444 root bin
+s usr/share/man/man3ext/write_vtoc.3ext=read_vtoc.3ext
+d usr/share/man/man3fcoe 0755 root bin
+f usr/share/man/man3fcoe/FCOE_CreatePort.3fcoe 0444 root bin
+f usr/share/man/man3fcoe/FCOE_DeletePort.3fcoe 0444 root bin
+f usr/share/man/man3fcoe/FCOE_GetPortList.3fcoe 0444 root bin
+d usr/share/man/man3fstyp 0755 root bin
+s usr/share/man/man3fstyp/fstyp_fini.3fstyp=fstyp_init.3fstyp
+f usr/share/man/man3fstyp/fstyp_get_attr.3fstyp 0444 root bin
+f usr/share/man/man3fstyp/fstyp_ident.3fstyp 0444 root bin
+f usr/share/man/man3fstyp/fstyp_init.3fstyp 0444 root bin
+s usr/share/man/man3fstyp/fstyp_mod_dump.3fstyp=fstyp_mod_init.3fstyp
+s usr/share/man/man3fstyp/fstyp_mod_fini.3fstyp=fstyp_mod_init.3fstyp
+s usr/share/man/man3fstyp/fstyp_mod_get_attr.3fstyp=fstyp_mod_init.3fstyp
+s usr/share/man/man3fstyp/fstyp_mod_ident.3fstyp=fstyp_mod_init.3fstyp
+f usr/share/man/man3fstyp/fstyp_mod_init.3fstyp 0444 root bin
+f usr/share/man/man3fstyp/fstyp_strerror.3fstyp 0444 root bin
+d usr/share/man/man3gen 0755 root bin
+s usr/share/man/man3gen/advance.3gen=regexpr.3gen
+f usr/share/man/man3gen/bgets.3gen 0444 root bin
+f usr/share/man/man3gen/bufsplit.3gen 0444 root bin
+s usr/share/man/man3gen/compile.3gen=regexpr.3gen
+f usr/share/man/man3gen/copylist.3gen 0444 root bin
+f usr/share/man/man3gen/gmatch.3gen 0444 root bin
+f usr/share/man/man3gen/isencrypt.3gen 0444 root bin
+f usr/share/man/man3gen/mkdirp.3gen 0444 root bin
+s usr/share/man/man3gen/p2close.3gen=p2open.3gen
+f usr/share/man/man3gen/p2open.3gen 0444 root bin
+f usr/share/man/man3gen/pathfind.3gen 0444 root bin
+f usr/share/man/man3gen/regexpr.3gen 0444 root bin
+s usr/share/man/man3gen/rmdirp.3gen=mkdirp.3gen
+s usr/share/man/man3gen/step.3gen=regexpr.3gen
+s usr/share/man/man3gen/str.3gen=strfind.3gen
+s usr/share/man/man3gen/strcadd.3gen=strccpy.3gen
+f usr/share/man/man3gen/strccpy.3gen 0444 root bin
+s usr/share/man/man3gen/streadd.3gen=strccpy.3gen
+s usr/share/man/man3gen/strecpy.3gen=strccpy.3gen
+f usr/share/man/man3gen/strfind.3gen 0444 root bin
+s usr/share/man/man3gen/strrspn.3gen=strfind.3gen
+s usr/share/man/man3gen/strtrns.3gen=strfind.3gen
+d usr/share/man/man3gss 0755 root bin
+f usr/share/man/man3gss/gss_accept_sec_context.3gss 0444 root bin
+f usr/share/man/man3gss/gss_acquire_cred.3gss 0444 root bin
+f usr/share/man/man3gss/gss_add_cred.3gss 0444 root bin
+f usr/share/man/man3gss/gss_add_oid_set_member.3gss 0444 root bin
+f usr/share/man/man3gss/gss_canonicalize_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_compare_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_context_time.3gss 0444 root bin
+f usr/share/man/man3gss/gss_create_empty_oid_set.3gss 0444 root bin
+f usr/share/man/man3gss/gss_delete_sec_context.3gss 0444 root bin
+f usr/share/man/man3gss/gss_display_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_display_status.3gss 0444 root bin
+f usr/share/man/man3gss/gss_duplicate_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_export_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_export_sec_context.3gss 0444 root bin
+f usr/share/man/man3gss/gss_get_mic.3gss 0444 root bin
+f usr/share/man/man3gss/gss_import_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_import_sec_context.3gss 0444 root bin
+f usr/share/man/man3gss/gss_indicate_mechs.3gss 0444 root bin
+f usr/share/man/man3gss/gss_init_sec_context.3gss 0444 root bin
+f usr/share/man/man3gss/gss_inquire_context.3gss 0444 root bin
+f usr/share/man/man3gss/gss_inquire_cred.3gss 0444 root bin
+f usr/share/man/man3gss/gss_inquire_cred_by_mech.3gss 0444 root bin
+f usr/share/man/man3gss/gss_inquire_mechs_for_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_inquire_names_for_mech.3gss 0444 root bin
+f usr/share/man/man3gss/gss_oid_to_str.3gss 0444 root bin
+f usr/share/man/man3gss/gss_process_context_token.3gss 0444 root bin
+f usr/share/man/man3gss/gss_release_buffer.3gss 0444 root bin
+f usr/share/man/man3gss/gss_release_cred.3gss 0444 root bin
+f usr/share/man/man3gss/gss_release_name.3gss 0444 root bin
+f usr/share/man/man3gss/gss_release_oid.3gss 0444 root bin
+f usr/share/man/man3gss/gss_release_oid_set.3gss 0444 root bin
+f usr/share/man/man3gss/gss_store_cred.3gss 0444 root bin
+f usr/share/man/man3gss/gss_str_to_oid.3gss 0444 root bin
+f usr/share/man/man3gss/gss_test_oid_set_member.3gss 0444 root bin
+f usr/share/man/man3gss/gss_unwrap.3gss 0444 root bin
+f usr/share/man/man3gss/gss_verify_mic.3gss 0444 root bin
+f usr/share/man/man3gss/gss_wrap.3gss 0444 root bin
+f usr/share/man/man3gss/gss_wrap_size_limit.3gss 0444 root bin
+d usr/share/man/man3head 0755 root bin
+s usr/share/man/man3head/acct.3head=acct.h.3head
+f usr/share/man/man3head/acct.h.3head 0444 root bin
+s usr/share/man/man3head/aio.3head=aio.h.3head
+f usr/share/man/man3head/aio.h.3head 0444 root bin
+s usr/share/man/man3head/ar.3head=ar.h.3head
+f usr/share/man/man3head/ar.h.3head 0444 root bin
+s usr/share/man/man3head/archives.3head=archives.h.3head
+f usr/share/man/man3head/archives.h.3head 0444 root bin
+s usr/share/man/man3head/assert.3head=assert.h.3head
+f usr/share/man/man3head/assert.h.3head 0444 root bin
+s usr/share/man/man3head/complex.3head=complex.h.3head
+f usr/share/man/man3head/complex.h.3head 0444 root bin
+s usr/share/man/man3head/cpio.3head=cpio.h.3head
+f usr/share/man/man3head/cpio.h.3head 0444 root bin
+s usr/share/man/man3head/dirent.3head=dirent.h.3head
+f usr/share/man/man3head/dirent.h.3head 0444 root bin
+s usr/share/man/man3head/errno.3head=errno.h.3head
+f usr/share/man/man3head/errno.h.3head 0444 root bin
+s usr/share/man/man3head/fcntl.3head=fcntl.h.3head
+f usr/share/man/man3head/fcntl.h.3head 0444 root bin
+s usr/share/man/man3head/fenv.3head=fenv.h.3head
+f usr/share/man/man3head/fenv.h.3head 0444 root bin
+s usr/share/man/man3head/float.3head=float.h.3head
+f usr/share/man/man3head/float.h.3head 0444 root bin
+s usr/share/man/man3head/floatingpoint.3head=floatingpoint.h.3head
+f usr/share/man/man3head/floatingpoint.h.3head 0444 root bin
+s usr/share/man/man3head/fmtmsg.3head=fmtmsg.h.3head
+f usr/share/man/man3head/fmtmsg.h.3head 0444 root bin
+s usr/share/man/man3head/fnmatch.3head=fnmatch.h.3head
+f usr/share/man/man3head/fnmatch.h.3head 0444 root bin
+s usr/share/man/man3head/ftw.3head=ftw.h.3head
+f usr/share/man/man3head/ftw.h.3head 0444 root bin
+s usr/share/man/man3head/glob.3head=glob.h.3head
+f usr/share/man/man3head/glob.h.3head 0444 root bin
+s usr/share/man/man3head/grp.3head=grp.h.3head
+f usr/share/man/man3head/grp.h.3head 0444 root bin
+s usr/share/man/man3head/iconv.3head=iconv.h.3head
+f usr/share/man/man3head/iconv.h.3head 0444 root bin
+s usr/share/man/man3head/if.3head=if.h.3head
+f usr/share/man/man3head/if.h.3head 0444 root bin
+s usr/share/man/man3head/in.3head=in.h.3head
+f usr/share/man/man3head/in.h.3head 0444 root bin
+s usr/share/man/man3head/inet.3head=inet.h.3head
+f usr/share/man/man3head/inet.h.3head 0444 root bin
+s usr/share/man/man3head/inttypes.3head=inttypes.h.3head
+f usr/share/man/man3head/inttypes.h.3head 0444 root bin
+s usr/share/man/man3head/ipc.3head=ipc.h.3head
+f usr/share/man/man3head/ipc.h.3head 0444 root bin
+s usr/share/man/man3head/iso646.3head=iso646.h.3head
+f usr/share/man/man3head/iso646.h.3head 0444 root bin
+s usr/share/man/man3head/langinfo.3head=langinfo.h.3head
+f usr/share/man/man3head/langinfo.h.3head 0444 root bin
+s usr/share/man/man3head/libgen.3head=libgen.h.3head
+f usr/share/man/man3head/libgen.h.3head 0444 root bin
+s usr/share/man/man3head/libintl.3head=libintl.h.3head
+f usr/share/man/man3head/libintl.h.3head 0444 root bin
+s usr/share/man/man3head/limits.3head=limits.h.3head
+f usr/share/man/man3head/limits.h.3head 0444 root bin
+s usr/share/man/man3head/locale.3head=locale.h.3head
+f usr/share/man/man3head/locale.h.3head 0444 root bin
+s usr/share/man/man3head/math.3head=math.h.3head
+f usr/share/man/man3head/math.h.3head 0444 root bin
+s usr/share/man/man3head/mman.3head=mman.h.3head
+f usr/share/man/man3head/mman.h.3head 0444 root bin
+s usr/share/man/man3head/monetary.3head=monetary.h.3head
+f usr/share/man/man3head/monetary.h.3head 0444 root bin
+s usr/share/man/man3head/mqueue.3head=mqueue.h.3head
+f usr/share/man/man3head/mqueue.h.3head 0444 root bin
+s usr/share/man/man3head/msg.3head=msg.h.3head
+f usr/share/man/man3head/msg.h.3head 0444 root bin
+s usr/share/man/man3head/ndbm.3head=ndbm.h.3head
+f usr/share/man/man3head/ndbm.h.3head 0444 root bin
+s usr/share/man/man3head/netdb.3head=netdb.h.3head
+f usr/share/man/man3head/netdb.h.3head 0444 root bin
+s usr/share/man/man3head/nl_types.3head=nl_types.h.3head
+f usr/share/man/man3head/nl_types.h.3head 0444 root bin
+s usr/share/man/man3head/poll.3head=poll.h.3head
+f usr/share/man/man3head/poll.h.3head 0444 root bin
+s usr/share/man/man3head/pthread.3head=pthread.h.3head
+f usr/share/man/man3head/pthread.h.3head 0444 root bin
+s usr/share/man/man3head/pwd.3head=pwd.h.3head
+f usr/share/man/man3head/pwd.h.3head 0444 root bin
+s usr/share/man/man3head/regex.3head=regex.h.3head
+f usr/share/man/man3head/regex.h.3head 0444 root bin
+s usr/share/man/man3head/resource.3head=resource.h.3head
+f usr/share/man/man3head/resource.h.3head 0444 root bin
+s usr/share/man/man3head/sched.3head=sched.h.3head
+f usr/share/man/man3head/sched.h.3head 0444 root bin
+s usr/share/man/man3head/search.3head=search.h.3head
+f usr/share/man/man3head/search.h.3head 0444 root bin
+s usr/share/man/man3head/select.3head=select.h.3head
+f usr/share/man/man3head/select.h.3head 0444 root bin
+s usr/share/man/man3head/sem.3head=sem.h.3head
+f usr/share/man/man3head/sem.h.3head 0444 root bin
+s usr/share/man/man3head/semaphore.3head=semaphore.h.3head
+f usr/share/man/man3head/semaphore.h.3head 0444 root bin
+s usr/share/man/man3head/setjmp.3head=setjmp.h.3head
+f usr/share/man/man3head/setjmp.h.3head 0444 root bin
+s usr/share/man/man3head/shm.3head=shm.h.3head
+f usr/share/man/man3head/shm.h.3head 0444 root bin
+s usr/share/man/man3head/siginfo.3head=siginfo.h.3head
+f usr/share/man/man3head/siginfo.h.3head 0444 root bin
+s usr/share/man/man3head/signal.3head=signal.h.3head
+f usr/share/man/man3head/signal.h.3head 0444 root bin
+s usr/share/man/man3head/socket.3head=socket.h.3head
+f usr/share/man/man3head/socket.h.3head 0444 root bin
+s usr/share/man/man3head/spawn.3head=spawn.h.3head
+f usr/share/man/man3head/spawn.h.3head 0444 root bin
+s usr/share/man/man3head/stat.3head=stat.h.3head
+f usr/share/man/man3head/stat.h.3head 0444 root bin
+s usr/share/man/man3head/statvfs.3head=statvfs.h.3head
+f usr/share/man/man3head/statvfs.h.3head 0444 root bin
+s usr/share/man/man3head/stdbool.3head=stdbool.h.3head
+f usr/share/man/man3head/stdbool.h.3head 0444 root bin
+s usr/share/man/man3head/stddef.3head=stddef.h.3head
+f usr/share/man/man3head/stddef.h.3head 0444 root bin
+s usr/share/man/man3head/stdint.3head=stdint.h.3head
+f usr/share/man/man3head/stdint.h.3head 0444 root bin
+s usr/share/man/man3head/stdio.3head=stdio.h.3head
+f usr/share/man/man3head/stdio.h.3head 0444 root bin
+s usr/share/man/man3head/stdlib.3head=stdlib.h.3head
+f usr/share/man/man3head/stdlib.h.3head 0444 root bin
+s usr/share/man/man3head/string.3head=string.h.3head
+f usr/share/man/man3head/string.h.3head 0444 root bin
+s usr/share/man/man3head/strings.3head=strings.h.3head
+f usr/share/man/man3head/strings.h.3head 0444 root bin
+s usr/share/man/man3head/stropts.3head=stropts.h.3head
+f usr/share/man/man3head/stropts.h.3head 0444 root bin
+s usr/share/man/man3head/syslog.3head=syslog.h.3head
+f usr/share/man/man3head/syslog.h.3head 0444 root bin
+s usr/share/man/man3head/tar.3head=tar.h.3head
+f usr/share/man/man3head/tar.h.3head 0444 root bin
+s usr/share/man/man3head/tcp.3head=tcp.h.3head
+f usr/share/man/man3head/tcp.h.3head 0444 root bin
+s usr/share/man/man3head/termios.3head=termios.h.3head
+f usr/share/man/man3head/termios.h.3head 0444 root bin
+s usr/share/man/man3head/tgmath.3head=tgmath.h.3head
+f usr/share/man/man3head/tgmath.h.3head 0444 root bin
+s usr/share/man/man3head/time.3head=time.h.3head
+f usr/share/man/man3head/time.h.3head 0444 root bin
+s usr/share/man/man3head/timeb.3head=timeb.h.3head
+f usr/share/man/man3head/timeb.h.3head 0444 root bin
+s usr/share/man/man3head/times.3head=times.h.3head
+f usr/share/man/man3head/times.h.3head 0444 root bin
+s usr/share/man/man3head/types.3head=types.h.3head
+f usr/share/man/man3head/types.h.3head 0444 root bin
+s usr/share/man/man3head/types32.3head=types32.h.3head
+f usr/share/man/man3head/types32.h.3head 0444 root bin
+s usr/share/man/man3head/ucontext.3head=ucontext.h.3head
+f usr/share/man/man3head/ucontext.h.3head 0444 root bin
+s usr/share/man/man3head/uio.3head=uio.h.3head
+f usr/share/man/man3head/uio.h.3head 0444 root bin
+s usr/share/man/man3head/ulimit.3head=ulimit.h.3head
+f usr/share/man/man3head/ulimit.h.3head 0444 root bin
+s usr/share/man/man3head/un.3head=un.h.3head
+f usr/share/man/man3head/un.h.3head 0444 root bin
+s usr/share/man/man3head/unistd.3head=unistd.h.3head
+f usr/share/man/man3head/unistd.h.3head 0444 root bin
+s usr/share/man/man3head/utime.3head=utime.h.3head
+f usr/share/man/man3head/utime.h.3head 0444 root bin
+s usr/share/man/man3head/utmpx.3head=utmpx.h.3head
+f usr/share/man/man3head/utmpx.h.3head 0444 root bin
+s usr/share/man/man3head/utsname.3head=utsname.h.3head
+f usr/share/man/man3head/utsname.h.3head 0444 root bin
+s usr/share/man/man3head/values.3head=values.h.3head
+f usr/share/man/man3head/values.h.3head 0444 root bin
+s usr/share/man/man3head/wait.3head=wait.h.3head
+f usr/share/man/man3head/wait.h.3head 0444 root bin
+s usr/share/man/man3head/wchar.3head=wchar.h.3head
+f usr/share/man/man3head/wchar.h.3head 0444 root bin
+s usr/share/man/man3head/wctype.3head=wctype.h.3head
+f usr/share/man/man3head/wctype.h.3head 0444 root bin
+s usr/share/man/man3head/wordexp.3head=wordexp.h.3head
+f usr/share/man/man3head/wordexp.h.3head 0444 root bin
+d usr/share/man/man3kstat 0755 root bin
+f usr/share/man/man3kstat/kstat.3kstat 0444 root bin
+f usr/share/man/man3kstat/kstat_chain_update.3kstat 0444 root bin
+s usr/share/man/man3kstat/kstat_close.3kstat=kstat_open.3kstat
+s usr/share/man/man3kstat/kstat_data_lookup.3kstat=kstat_lookup.3kstat
+f usr/share/man/man3kstat/kstat_lookup.3kstat 0444 root bin
+f usr/share/man/man3kstat/kstat_open.3kstat 0444 root bin
+f usr/share/man/man3kstat/kstat_read.3kstat 0444 root bin
+s usr/share/man/man3kstat/kstat_write.3kstat=kstat_read.3kstat
+d usr/share/man/man3kvm 0755 root bin
+s usr/share/man/man3kvm/kvm_close.3kvm=kvm_open.3kvm
+s usr/share/man/man3kvm/kvm_getcmd.3kvm=kvm_getu.3kvm
+s usr/share/man/man3kvm/kvm_getproc.3kvm=kvm_nextproc.3kvm
+f usr/share/man/man3kvm/kvm_getu.3kvm 0444 root bin
+f usr/share/man/man3kvm/kvm_kread.3kvm 0444 root bin
+s usr/share/man/man3kvm/kvm_kwrite.3kvm=kvm_kread.3kvm
+f usr/share/man/man3kvm/kvm_nextproc.3kvm 0444 root bin
+f usr/share/man/man3kvm/kvm_nlist.3kvm 0444 root bin
+f usr/share/man/man3kvm/kvm_open.3kvm 0444 root bin
+f usr/share/man/man3kvm/kvm_read.3kvm 0444 root bin
+s usr/share/man/man3kvm/kvm_setproc.3kvm=kvm_nextproc.3kvm
+s usr/share/man/man3kvm/kvm_uread.3kvm=kvm_kread.3kvm
+s usr/share/man/man3kvm/kvm_uwrite.3kvm=kvm_kread.3kvm
+s usr/share/man/man3kvm/kvm_write.3kvm=kvm_read.3kvm
+d usr/share/man/man3ldap 0755 root bin
+s usr/share/man/man3ldap/ber_alloc.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_alloc_t.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_bvdup.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_bvecfree.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_bvfree.3ldap=ber_decode.3ldap
+f usr/share/man/man3ldap/ber_decode.3ldap 0444 root bin
+f usr/share/man/man3ldap/ber_encode.3ldap 0444 root bin
+s usr/share/man/man3ldap/ber_first_element.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_flatten.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_free.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_bitstring.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_boolean.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_int.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_next.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_null.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_stringa.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_stringal.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_get_stringb.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_init.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_next_element.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_peek_tag.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_printf.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_bitstring.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_boolean.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_int.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_null.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_ostring.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_seq.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_set.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_put_string.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_scanf.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_skip_tag.3ldap=ber_decode.3ldap
+s usr/share/man/man3ldap/ber_start_seq.3ldap=ber_encode.3ldap
+s usr/share/man/man3ldap/ber_start_set.3ldap=ber_encode.3ldap
+f usr/share/man/man3ldap/cldap_close.3ldap 0444 root bin
+f usr/share/man/man3ldap/cldap_open.3ldap 0444 root bin
+f usr/share/man/man3ldap/cldap_search_s.3ldap 0444 root bin
+f usr/share/man/man3ldap/cldap_setretryinfo.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_8859_to_t61.3ldap=ldap_charset.3ldap
+f usr/share/man/man3ldap/ldap_abandon.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_add.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_add_ext.3ldap=ldap_add.3ldap
+s usr/share/man/man3ldap/ldap_add_ext_s.3ldap=ldap_add.3ldap
+s usr/share/man/man3ldap/ldap_add_s.3ldap=ldap_add.3ldap
+f usr/share/man/man3ldap/ldap_ber_free.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_bind.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_bind_s.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_build_filter.3ldap=ldap_getfilter.3ldap
+f usr/share/man/man3ldap/ldap_charset.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_compare.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_compare_ext.3ldap=ldap_compare.3ldap
+s usr/share/man/man3ldap/ldap_compare_ext_s.3ldap=ldap_compare.3ldap
+s usr/share/man/man3ldap/ldap_compare_s.3ldap=ldap_compare.3ldap
+f usr/share/man/man3ldap/ldap_control_free.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_controls_free.3ldap=ldap_control_free.3ldap
+s usr/share/man/man3ldap/ldap_count_entries.3ldap=ldap_first_entry.3ldap
+s usr/share/man/man3ldap/ldap_count_messages.3ldap=ldap_first_message.3ldap
+s usr/share/man/man3ldap/ldap_count_references.3ldap=ldap_first_entry.3ldap
+s usr/share/man/man3ldap/ldap_count_values.3ldap=ldap_get_values.3ldap
+s usr/share/man/man3ldap/ldap_count_values_len.3ldap=ldap_get_values.3ldap
+f usr/share/man/man3ldap/ldap_delete.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_delete_ext.3ldap=ldap_delete.3ldap
+s usr/share/man/man3ldap/ldap_delete_ext_s.3ldap=ldap_delete.3ldap
+s usr/share/man/man3ldap/ldap_delete_s.3ldap=ldap_delete.3ldap
+f usr/share/man/man3ldap/ldap_disptmpl.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_dn2ufn.3ldap=ldap_get_dn.3ldap
+s usr/share/man/man3ldap/ldap_dn_to_url.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_dns_to_dn.3ldap=ldap_get_dn.3ldap
+s usr/share/man/man3ldap/ldap_dns_to_url.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_enable_translation.3ldap=ldap_charset.3ldap
+s usr/share/man/man3ldap/ldap_entry2html.3ldap=ldap_entry2text.3ldap
+s usr/share/man/man3ldap/ldap_entry2html_search.3ldap=ldap_entry2text.3ldap
+f usr/share/man/man3ldap/ldap_entry2text.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_entry2text_search.3ldap=ldap_entry2text.3ldap
+s usr/share/man/man3ldap/ldap_err2string.3ldap=ldap_error.3ldap
+f usr/share/man/man3ldap/ldap_error.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_explode_dn.3ldap=ldap_get_dn.3ldap
+s usr/share/man/man3ldap/ldap_explode_dns.3ldap=ldap_get_dn.3ldap
+f usr/share/man/man3ldap/ldap_first_attribute.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_first_disptmpl.3ldap=ldap_disptmpl.3ldap
+f usr/share/man/man3ldap/ldap_first_entry.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_first_message.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_first_reference.3ldap=ldap_first_entry.3ldap
+s usr/share/man/man3ldap/ldap_first_searchobj.3ldap=ldap_searchprefs.3ldap
+s usr/share/man/man3ldap/ldap_first_tmplcol.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_first_tmplrow.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_free_friendlymap.3ldap=ldap_friendly.3ldap
+s usr/share/man/man3ldap/ldap_free_searchprefs.3ldap=ldap_searchprefs.3ldap
+s usr/share/man/man3ldap/ldap_free_templates.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_free_urldesc.3ldap=ldap_url.3ldap
+f usr/share/man/man3ldap/ldap_friendly.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_friendly_name.3ldap=ldap_friendly.3ldap
+f usr/share/man/man3ldap/ldap_get_dn.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_get_entry_controls.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_get_lang_values.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_get_lang_values_len.3ldap=ldap_get_lang_values.3ldap
+f usr/share/man/man3ldap/ldap_get_option.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_get_values.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_get_values_len.3ldap=ldap_get_values.3ldap
+f usr/share/man/man3ldap/ldap_getfilter.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_getfilter_free.3ldap=ldap_getfilter.3ldap
+s usr/share/man/man3ldap/ldap_getfirstfilter.3ldap=ldap_getfilter.3ldap
+s usr/share/man/man3ldap/ldap_getnextfilter.3ldap=ldap_getfilter.3ldap
+s usr/share/man/man3ldap/ldap_init.3ldap=ldap_open.3ldap
+s usr/share/man/man3ldap/ldap_init_getfilter.3ldap=ldap_getfilter.3ldap
+s usr/share/man/man3ldap/ldap_init_getfilter_buf.3ldap=ldap_getfilter.3ldap
+s usr/share/man/man3ldap/ldap_init_searchprefs.3ldap=ldap_searchprefs.3ldap
+s usr/share/man/man3ldap/ldap_init_searchprefs_buf.3ldap=ldap_searchprefs.3ldap
+s usr/share/man/man3ldap/ldap_init_templates.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_init_templates_buf.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_is_dns_dn.3ldap=ldap_get_dn.3ldap
+s usr/share/man/man3ldap/ldap_is_ldap_url.3ldap=ldap_url.3ldap
+f usr/share/man/man3ldap/ldap_memcache.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_memcache_destroy.3ldap=ldap_memcache.3ldap
+s usr/share/man/man3ldap/ldap_memcache_flush.3ldap=ldap_memcache.3ldap
+s usr/share/man/man3ldap/ldap_memcache_get.3ldap=ldap_memcache.3ldap
+s usr/share/man/man3ldap/ldap_memcache_init.3ldap=ldap_memcache.3ldap
+s usr/share/man/man3ldap/ldap_memcache_set.3ldap=ldap_memcache.3ldap
+s usr/share/man/man3ldap/ldap_memcache_update.3ldap=ldap_memcache.3ldap
+f usr/share/man/man3ldap/ldap_memfree.3ldap 0444 root bin
+f usr/share/man/man3ldap/ldap_modify.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_modify_ext.3ldap=ldap_modify.3ldap
+s usr/share/man/man3ldap/ldap_modify_ext_s.3ldap=ldap_modify.3ldap
+s usr/share/man/man3ldap/ldap_modify_s.3ldap=ldap_modify.3ldap
+f usr/share/man/man3ldap/ldap_modrdn.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_modrdn2.3ldap=ldap_modrdn.3ldap
+s usr/share/man/man3ldap/ldap_modrdn2_s.3ldap=ldap_modrdn.3ldap
+s usr/share/man/man3ldap/ldap_modrdn_s.3ldap=ldap_modrdn.3ldap
+s usr/share/man/man3ldap/ldap_mods_free.3ldap=ldap_modify.3ldap
+s usr/share/man/man3ldap/ldap_msgfree.3ldap=ldap_result.3ldap
+s usr/share/man/man3ldap/ldap_msgtype.3ldap=ldap_first_message.3ldap
+s usr/share/man/man3ldap/ldap_name2template.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_next_attribute.3ldap=ldap_first_attribute.3ldap
+s usr/share/man/man3ldap/ldap_next_disptmpl.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_next_entry.3ldap=ldap_first_entry.3ldap
+s usr/share/man/man3ldap/ldap_next_message.3ldap=ldap_first_message.3ldap
+s usr/share/man/man3ldap/ldap_next_reference.3ldap=ldap_first_entry.3ldap
+s usr/share/man/man3ldap/ldap_next_searchobj.3ldap=ldap_searchprefs.3ldap
+s usr/share/man/man3ldap/ldap_next_tmplcol.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_next_tmplrow.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_oc2template.3ldap=ldap_disptmpl.3ldap
+f usr/share/man/man3ldap/ldap_open.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_parse_extended_result.3ldap=ldap_parse_result.3ldap
+f usr/share/man/man3ldap/ldap_parse_result.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_parse_sasl_bind_result.3ldap=ldap_parse_result.3ldap
+s usr/share/man/man3ldap/ldap_perror.3ldap=ldap_error.3ldap
+s usr/share/man/man3ldap/ldap_rename.3ldap=ldap_modrdn.3ldap
+s usr/share/man/man3ldap/ldap_rename_s.3ldap=ldap_modrdn.3ldap
+f usr/share/man/man3ldap/ldap_result.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_result2error.3ldap=ldap_error.3ldap
+s usr/share/man/man3ldap/ldap_sasl_bind.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_sasl_bind_s.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_sasl_interactive_bind_s.3ldap=ldap_bind.3ldap
+f usr/share/man/man3ldap/ldap_search.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_search_ext.3ldap=ldap_search.3ldap
+s usr/share/man/man3ldap/ldap_search_ext_s.3ldap=ldap_search.3ldap
+s usr/share/man/man3ldap/ldap_search_s.3ldap=ldap_search.3ldap
+s usr/share/man/man3ldap/ldap_search_st.3ldap=ldap_search.3ldap
+f usr/share/man/man3ldap/ldap_searchprefs.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_set_option.3ldap=ldap_get_option.3ldap
+s usr/share/man/man3ldap/ldap_set_rebind_proc.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_set_string_translators.3ldap=ldap_charset.3ldap
+s usr/share/man/man3ldap/ldap_setfilteraffixes.3ldap=ldap_getfilter.3ldap
+s usr/share/man/man3ldap/ldap_simple_bind.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_simple_bind_s.3ldap=ldap_bind.3ldap
+f usr/share/man/man3ldap/ldap_sort.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_sort_entries.3ldap=ldap_sort.3ldap
+s usr/share/man/man3ldap/ldap_sort_strcasecmp.3ldap=ldap_sort.3ldap
+s usr/share/man/man3ldap/ldap_sort_values.3ldap=ldap_sort.3ldap
+s usr/share/man/man3ldap/ldap_t61_to_8859.3ldap=ldap_charset.3ldap
+s usr/share/man/man3ldap/ldap_tmplattrs.3ldap=ldap_disptmpl.3ldap
+s usr/share/man/man3ldap/ldap_translate_from_t61.3ldap=ldap_charset.3ldap
+s usr/share/man/man3ldap/ldap_translate_to_t61.3ldap=ldap_charset.3ldap
+f usr/share/man/man3ldap/ldap_ufn.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_ufn_search_c.3ldap=ldap_ufn.3ldap
+s usr/share/man/man3ldap/ldap_ufn_search_ct.3ldap=ldap_ufn.3ldap
+s usr/share/man/man3ldap/ldap_ufn_search_s.3ldap=ldap_ufn.3ldap
+s usr/share/man/man3ldap/ldap_ufn_setfilter.3ldap=ldap_ufn.3ldap
+s usr/share/man/man3ldap/ldap_ufn_setprefix.3ldap=ldap_ufn.3ldap
+s usr/share/man/man3ldap/ldap_ufn_timeout.3ldap=ldap_ufn.3ldap
+s usr/share/man/man3ldap/ldap_unbind.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_unbind_ext.3ldap=ldap_bind.3ldap
+s usr/share/man/man3ldap/ldap_unbind_s.3ldap=ldap_bind.3ldap
+f usr/share/man/man3ldap/ldap_url.3ldap 0444 root bin
+s usr/share/man/man3ldap/ldap_url_parse.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_url_parse_nodn.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_url_search.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_url_search_s.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_url_search_st.3ldap=ldap_url.3ldap
+s usr/share/man/man3ldap/ldap_vals2html.3ldap=ldap_entry2text.3ldap
+s usr/share/man/man3ldap/ldap_vals2text.3ldap=ldap_entry2text.3ldap
+s usr/share/man/man3ldap/ldap_value_free.3ldap=ldap_get_values.3ldap
+s usr/share/man/man3ldap/ldap_value_free_len.3ldap=ldap_get_values.3ldap
+f usr/share/man/man3ldap/ldap_version.3ldap 0444 root bin
+d usr/share/man/man3lgrp 0755 root bin
+f usr/share/man/man3lgrp/lgrp_affinity_get.3lgrp 0444 root bin
+s usr/share/man/man3lgrp/lgrp_affinity_set.3lgrp=lgrp_affinity_get.3lgrp
+f usr/share/man/man3lgrp/lgrp_children.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_cookie_stale.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_cpus.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_fini.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_home.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_init.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_latency.3lgrp 0444 root bin
+s usr/share/man/man3lgrp/lgrp_latency_cookie.3lgrp=lgrp_latency.3lgrp
+f usr/share/man/man3lgrp/lgrp_mem_size.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_nlgrps.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_parents.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_resources.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_root.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_version.3lgrp 0444 root bin
+f usr/share/man/man3lgrp/lgrp_view.3lgrp 0444 root bin
+d usr/share/man/man3lib 0755 root bin
+s usr/share/man/man3lib/SMHBA_GetAdapterAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetAdapterPortAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetBindingCapability.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetBindingSupport.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetDiscoveredPortAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetFCPhyAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetLUNStatistics.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetNumberofPorts.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetPersistentBinding.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetPhyStatistics.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetPortAttributesByWWN.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetPortType.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetProtocolStatistics.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetSASPhyAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetTargetMapping.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetVendorLibraryAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetVersion.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_GetWrapperLibraryAttributes.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterForAdapterAddEvents.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterForAdapterEvents.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterForAdapterPhyStatEvents.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterForAdapterPortEvents.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterForAdapterPortStatEvents.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterForTargetEvents.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RegisterLibrary.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RemoveAllPersistentBindings.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_RemovePersistentBinding.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_ScsiInquiry.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_ScsiReadCapacity.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_ScsiReportLuns.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_SendECHO.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_SendSMPPassThru.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_SendTEST.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_SetBindingSupport.3lib=libSMHBAAPI.3lib
+s usr/share/man/man3lib/SMHBA_SetPersistentBinding.3lib=libSMHBAAPI.3lib
+f usr/share/man/man3lib/libMPAPI.3lib 0444 root bin
+f usr/share/man/man3lib/libSMHBAAPI.3lib 0444 root bin
+f usr/share/man/man3lib/libadm.3lib 0444 root bin
+f usr/share/man/man3lib/libaio.3lib 0444 root bin
+f usr/share/man/man3lib/libbsdmalloc.3lib 0444 root bin
+f usr/share/man/man3lib/libbsm.3lib 0444 root bin
+f usr/share/man/man3lib/libc.3lib 0444 root bin
+f usr/share/man/man3lib/libc_db.3lib 0444 root bin
+f usr/share/man/man3lib/libcfgadm.3lib 0444 root bin
+f usr/share/man/man3lib/libcommputil.3lib 0444 root bin
+f usr/share/man/man3lib/libcontract.3lib 0444 root bin
+f usr/share/man/man3lib/libcpc.3lib 0444 root bin
+f usr/share/man/man3lib/libcrypt.3lib 0444 root bin
+f usr/share/man/man3lib/libcurses.3lib 0444 root bin
+f usr/share/man/man3lib/libdat.3lib 0444 root bin
+f usr/share/man/man3lib/libdevid.3lib 0444 root bin
+f usr/share/man/man3lib/libdevinfo.3lib 0444 root bin
+f usr/share/man/man3lib/libdl.3lib 0444 root bin
+f usr/share/man/man3lib/libdlpi.3lib 0444 root bin
+f usr/share/man/man3lib/libdns_sd.3lib 0444 root bin
+f usr/share/man/man3lib/libdoor.3lib 0444 root bin
+f usr/share/man/man3lib/libdtrace.3lib 0444 root bin
+f usr/share/man/man3lib/libefi.3lib 0444 root bin
+f usr/share/man/man3lib/libelf.3lib 0444 root bin
+f usr/share/man/man3lib/libexacct.3lib 0444 root bin
+f usr/share/man/man3lib/libfcoe.3lib 0444 root bin
+f usr/share/man/man3lib/libform.3lib 0444 root bin
+f usr/share/man/man3lib/libfstyp.3lib 0444 root bin
+f usr/share/man/man3lib/libgen.3lib 0444 root bin
+f usr/share/man/man3lib/libgss.3lib 0444 root bin
+f usr/share/man/man3lib/libintl.3lib 0444 root bin
+f usr/share/man/man3lib/libiscsit.3lib 0444 root bin
+f usr/share/man/man3lib/libkmf.3lib 0444 root bin
+f usr/share/man/man3lib/libkrb5.3lib 0444 root bin
+f usr/share/man/man3lib/libkstat.3lib 0444 root bin
+f usr/share/man/man3lib/libkvm.3lib 0444 root bin
+f usr/share/man/man3lib/libl.3lib 0444 root bin
+f usr/share/man/man3lib/liblgrp.3lib 0444 root bin
+f usr/share/man/man3lib/libmail.3lib 0444 root bin
+f usr/share/man/man3lib/libmalloc.3lib 0444 root bin
+f usr/share/man/man3lib/libmapmalloc.3lib 0444 root bin
+f usr/share/man/man3lib/libmd.3lib 0444 root bin
+f usr/share/man/man3lib/libmd5.3lib 0444 root bin
+f usr/share/man/man3lib/libmenu.3lib 0444 root bin
+f usr/share/man/man3lib/libmp.3lib 0444 root bin
+s usr/share/man/man3lib/libmpapi.3lib=libMPAPI.3lib
+f usr/share/man/man3lib/libmtmalloc.3lib 0444 root bin
+f usr/share/man/man3lib/libnls.3lib 0444 root bin
+f usr/share/man/man3lib/libnsl.3lib 0444 root bin
+f usr/share/man/man3lib/libnvpair.3lib 0444 root bin
+f usr/share/man/man3lib/libpam.3lib 0444 root bin
+f usr/share/man/man3lib/libpanel.3lib 0444 root bin
+f usr/share/man/man3lib/libpctx.3lib 0444 root bin
+f usr/share/man/man3lib/libpicl.3lib 0444 root bin
+f usr/share/man/man3lib/libpicltree.3lib 0444 root bin
+f usr/share/man/man3lib/libpkcs11.3lib 0444 root bin
+f usr/share/man/man3lib/libpool.3lib 0444 root bin
+s usr/share/man/man3lib/libposix4.3lib=librt.3lib
+f usr/share/man/man3lib/libproject.3lib 0444 root bin
+f usr/share/man/man3lib/libpthread.3lib 0444 root bin
+f usr/share/man/man3lib/libresolv.3lib 0444 root bin
+f usr/share/man/man3lib/librpcsvc.3lib 0444 root bin
+f usr/share/man/man3lib/librsm.3lib 0444 root bin
+f usr/share/man/man3lib/librt.3lib 0444 root bin
+f usr/share/man/man3lib/librtld_db.3lib 0444 root bin
+f usr/share/man/man3lib/libsasl.3lib 0444 root bin
+f usr/share/man/man3lib/libscf.3lib 0444 root bin
+f usr/share/man/man3lib/libsctp.3lib 0444 root bin
+f usr/share/man/man3lib/libsec.3lib 0444 root bin
+f usr/share/man/man3lib/libsecdb.3lib 0444 root bin
+f usr/share/man/man3lib/libsendfile.3lib 0444 root bin
+f usr/share/man/man3lib/libsip.3lib 0444 root bin
+f usr/share/man/man3lib/libslp.3lib 0444 root bin
+s usr/share/man/man3lib/libsmhbaapi.3lib=libSMHBAAPI.3lib
+f usr/share/man/man3lib/libsocket.3lib 0444 root bin
+f usr/share/man/man3lib/libstmf.3lib 0444 root bin
+f usr/share/man/man3lib/libsys.3lib 0444 root bin
+f usr/share/man/man3lib/libsysevent.3lib 0444 root bin
+f usr/share/man/man3lib/libtecla.3lib 0444 root bin
+s usr/share/man/man3lib/libtermcap.3lib=libcurses.3lib
+s usr/share/man/man3lib/libtermlib.3lib=libcurses.3lib
+f usr/share/man/man3lib/libthread.3lib 0444 root bin
+f usr/share/man/man3lib/libtnfctl.3lib 0444 root bin
+f usr/share/man/man3lib/libtsalarm.3lib 0444 root bin
+f usr/share/man/man3lib/libumem.3lib 0444 root bin
+f usr/share/man/man3lib/libuuid.3lib 0444 root bin
+f usr/share/man/man3lib/libvolmgt.3lib 0444 root bin
+f usr/share/man/man3lib/libw.3lib 0444 root bin
+f usr/share/man/man3lib/libxnet.3lib 0444 root bin
+f usr/share/man/man3lib/liby.3lib 0444 root bin
+d usr/share/man/man3mail 0755 root bin
+f usr/share/man/man3mail/maillock.3mail 0444 root bin
+s usr/share/man/man3mail/mailunlock.3mail=maillock.3mail
+s usr/share/man/man3mail/touchlock.3mail=maillock.3mail
+d usr/share/man/man3malloc 0755 root bin
+f usr/share/man/man3malloc/bsdmalloc.3malloc 0444 root bin
+s usr/share/man/man3malloc/calloc.3malloc=malloc.3malloc
+s usr/share/man/man3malloc/free.3malloc=malloc.3malloc
+s usr/share/man/man3malloc/mallinfo.3malloc=malloc.3malloc
+f usr/share/man/man3malloc/malloc.3malloc 0444 root bin
+s usr/share/man/man3malloc/mallocctl.3malloc=mtmalloc.3malloc
+s usr/share/man/man3malloc/mallopt.3malloc=malloc.3malloc
+f usr/share/man/man3malloc/mapmalloc.3malloc 0444 root bin
+s usr/share/man/man3malloc/memalign.3malloc=malloc.3malloc
+f usr/share/man/man3malloc/mtmalloc.3malloc 0444 root bin
+s usr/share/man/man3malloc/realloc.3malloc=malloc.3malloc
+f usr/share/man/man3malloc/umem_alloc.3malloc 0444 root bin
+s usr/share/man/man3malloc/umem_cache_alloc.3malloc=umem_cache_create.3malloc
+f usr/share/man/man3malloc/umem_cache_create.3malloc 0444 root bin
+s usr/share/man/man3malloc/umem_cache_destroy.3malloc=umem_cache_create.3malloc
+s usr/share/man/man3malloc/umem_cache_free.3malloc=umem_cache_create.3malloc
+f usr/share/man/man3malloc/umem_debug.3malloc 0444 root bin
+s usr/share/man/man3malloc/umem_free.3malloc=umem_alloc.3malloc
+s usr/share/man/man3malloc/umem_nofail_callback.3malloc=umem_alloc.3malloc
+s usr/share/man/man3malloc/umem_zalloc.3malloc=umem_alloc.3malloc
+s usr/share/man/man3malloc/valloc.3malloc=malloc.3malloc
+f usr/share/man/man3malloc/watchmalloc.3malloc 0444 root bin
+d usr/share/man/man3mp 0755 root bin
+f usr/share/man/man3mp/mp.3mp 0444 root bin
+s usr/share/man/man3mp/mp_gcd.3mp=mp.3mp
+s usr/share/man/man3mp/mp_itom.3mp=mp.3mp
+s usr/share/man/man3mp/mp_madd.3mp=mp.3mp
+s usr/share/man/man3mp/mp_mcmp.3mp=mp.3mp
+s usr/share/man/man3mp/mp_mdiv.3mp=mp.3mp
+s usr/share/man/man3mp/mp_mfree.3mp=mp.3mp
+s usr/share/man/man3mp/mp_min.3mp=mp.3mp
+s usr/share/man/man3mp/mp_mout.3mp=mp.3mp
+s usr/share/man/man3mp/mp_msqrt.3mp=mp.3mp
+s usr/share/man/man3mp/mp_msub.3mp=mp.3mp
+s usr/share/man/man3mp/mp_mtox.3mp=mp.3mp
+s usr/share/man/man3mp/mp_mult.3mp=mp.3mp
+s usr/share/man/man3mp/mp_pow.3mp=mp.3mp
+s usr/share/man/man3mp/mp_rpow.3mp=mp.3mp
+s usr/share/man/man3mp/mp_sdiv.3mp=mp.3mp
+s usr/share/man/man3mp/mp_xtom.3mp=mp.3mp
+d usr/share/man/man3mpapi 0755 root bin
+f usr/share/man/man3mpapi/MP_AssignLogicalUnitToTPG.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_CancelOverridePath.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_CompareOIDs.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_DeregisterForObjectPropertyChanges.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_DeregisterForObjectVisibilityChanges.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_DeregisterPlugin.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_DisableAutoFailback.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_DisableAutoProbing.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_DisablePath.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_EnableAutoFailback.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_EnableAutoProbing.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_EnablePath.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_FreeOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetAssociatedPathOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetAssociatedPluginOid.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetAssociatedTPGOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetDeviceProductOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetDeviceProductProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetInitiatorPortOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetInitiatorPortProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetLibraryProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetMPLogicalUnitProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetMPLuOidListFromTPG.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetMultipathLus.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetObjectType.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetPathLogicalUnitProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetPluginOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetPluginProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetProprietaryLoadBalanceOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetProprietaryLoadBalanceProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetTargetPortGroupProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetTargetPortOidList.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_GetTargetPortProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_RegisterForObjectPropertyChanges.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_RegisterForObjectVisibilityChanges.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_RegisterPlugin.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetFailbackPollingRate.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetLogicalUnitLoadBalanceType.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetOverridePath.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetPathWeight.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetPluginLoadBalanceType.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetProbingPollingRate.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetProprietaryProperties.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/MP_SetTPGAccess.3mpapi 0444 root bin
+f usr/share/man/man3mpapi/Sun_MP_SendScsiCmd.3mpapi 0444 root bin
+d usr/share/man/man3nsl 0755 root bin
+s usr/share/man/man3nsl/auth_destroy.3nsl=rpc_clnt_auth.3nsl
+s usr/share/man/man3nsl/authdes_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/authdes_getucred.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/authdes_seccreate.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/authnone_create.3nsl=rpc_clnt_auth.3nsl
+s usr/share/man/man3nsl/authsys_create.3nsl=rpc_clnt_auth.3nsl
+s usr/share/man/man3nsl/authsys_create_default.3nsl=rpc_clnt_auth.3nsl
+s usr/share/man/man3nsl/authunix_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/authunix_create_default.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/callrpc.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/clnt_broadcast.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/clnt_call.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_control.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_create_timed.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_create_vers.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_create_vers_timed.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_destroy.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_dg_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_door_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_freeres.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_geterr.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_pcreateerror.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_perrno.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_perror.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_raw_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_send.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_spcreateerror.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_sperrno.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_sperror.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/clnt_tli_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_tp_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_tp_create_timed.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clnt_vc_create.3nsl=rpc_clnt_create.3nsl
+s usr/share/man/man3nsl/clntraw_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/clnttcp_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/clntudp_bufcreate.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/clntudp_create.3nsl=rpc_soc.3nsl
+f usr/share/man/man3nsl/dial.3nsl 0444 root bin
+f usr/share/man/man3nsl/doconfig.3nsl 0444 root bin
+s usr/share/man/man3nsl/endhostent.3nsl=gethostbyname.3nsl
+s usr/share/man/man3nsl/endnetconfig.3nsl=getnetconfig.3nsl
+s usr/share/man/man3nsl/endnetpath.3nsl=getnetpath.3nsl
+s usr/share/man/man3nsl/endrpcent.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/freeipsecalgent.3nsl=getipsecalgbyname.3nsl
+s usr/share/man/man3nsl/freenetconfigent.3nsl=getnetconfig.3nsl
+s usr/share/man/man3nsl/get_myaddress.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/gethostbyaddr.3nsl=gethostbyname.3nsl
+s usr/share/man/man3nsl/gethostbyaddr_r.3nsl=gethostbyname.3nsl
+f usr/share/man/man3nsl/gethostbyname.3nsl 0444 root bin
+s usr/share/man/man3nsl/gethostbyname_r.3nsl=gethostbyname.3nsl
+s usr/share/man/man3nsl/gethostent.3nsl=gethostbyname.3nsl
+s usr/share/man/man3nsl/gethostent_r.3nsl=gethostbyname.3nsl
+f usr/share/man/man3nsl/getipsecalgbyname.3nsl 0444 root bin
+s usr/share/man/man3nsl/getipsecalgbynum.3nsl=getipsecalgbyname.3nsl
+f usr/share/man/man3nsl/getipsecprotobyname.3nsl 0444 root bin
+s usr/share/man/man3nsl/getipsecprotobynum.3nsl=getipsecprotobyname.3nsl
+f usr/share/man/man3nsl/getnetconfig.3nsl 0444 root bin
+s usr/share/man/man3nsl/getnetconfigent.3nsl=getnetconfig.3nsl
+s usr/share/man/man3nsl/getnetname.3nsl=secure_rpc.3nsl
+f usr/share/man/man3nsl/getnetpath.3nsl 0444 root bin
+f usr/share/man/man3nsl/getpublickey.3nsl 0444 root bin
+f usr/share/man/man3nsl/getrpcbyname.3nsl 0444 root bin
+s usr/share/man/man3nsl/getrpcbyname_r.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/getrpcbynumber.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/getrpcbynumber_r.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/getrpcent.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/getrpcent_r.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/getrpcport.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/getsecretkey.3nsl=getpublickey.3nsl
+s usr/share/man/man3nsl/host2netname.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/key_decryptsession.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/key_encryptsession.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/key_gendes.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/key_secretkey_is_set.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/key_setsecret.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/nc_perror.3nsl=getnetconfig.3nsl
+s usr/share/man/man3nsl/nc_sperror.3nsl=getnetconfig.3nsl
+f usr/share/man/man3nsl/netdir.3nsl 0444 root bin
+s usr/share/man/man3nsl/netdir_free.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netdir_getbyaddr.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netdir_getbyname.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netdir_mergeaddr.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netdir_options.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netdir_perror.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netdir_sperror.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/netname2host.3nsl=secure_rpc.3nsl
+s usr/share/man/man3nsl/netname2user.3nsl=secure_rpc.3nsl
+f usr/share/man/man3nsl/nlsgetcall.3nsl 0444 root bin
+f usr/share/man/man3nsl/nlsprovider.3nsl 0444 root bin
+f usr/share/man/man3nsl/nlsrequest.3nsl 0444 root bin
+s usr/share/man/man3nsl/pmap_getmaps.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/pmap_getport.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/pmap_rmtcall.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/pmap_set.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/pmap_unset.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/publickey.3nsl=getpublickey.3nsl
+s usr/share/man/man3nsl/registerrpc.3nsl=rpc_soc.3nsl
+f usr/share/man/man3nsl/rpc.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_broadcast.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/rpc_broadcast_exp.3nsl=rpc_clnt_calls.3nsl
+s usr/share/man/man3nsl/rpc_call.3nsl=rpc_clnt_calls.3nsl
+f usr/share/man/man3nsl/rpc_clnt_auth.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_clnt_calls.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_clnt_create.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_control.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_createerr.3nsl=rpc_clnt_create.3nsl
+f usr/share/man/man3nsl/rpc_gss_get_error.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_gss_get_mech_info.3nsl=rpc_gss_get_mechanisms.3nsl
+f usr/share/man/man3nsl/rpc_gss_get_mechanisms.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_gss_get_principal_name.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_gss_get_versions.3nsl=rpc_gss_get_mechanisms.3nsl
+f usr/share/man/man3nsl/rpc_gss_getcred.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_gss_is_installed.3nsl=rpc_gss_get_mechanisms.3nsl
+f usr/share/man/man3nsl/rpc_gss_max_data_length.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_gss_mech_to_oid.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_gss_qop_to_num.3nsl=rpc_gss_mech_to_oid.3nsl
+f usr/share/man/man3nsl/rpc_gss_seccreate.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_gss_set_callback.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_gss_set_defaults.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_gss_set_svc_name.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpc_gss_svc_max_data_length.3nsl=rpc_gss_max_data_length.3nsl
+s usr/share/man/man3nsl/rpc_reg.3nsl=rpc_svc_reg.3nsl
+f usr/share/man/man3nsl/rpc_soc.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_svc_calls.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_svc_create.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_svc_err.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_svc_input.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_svc_reg.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpc_xdr.3nsl 0444 root bin
+s usr/share/man/man3nsl/rpcb_getaddr.3nsl=rpcbind.3nsl
+s usr/share/man/man3nsl/rpcb_getmaps.3nsl=rpcbind.3nsl
+s usr/share/man/man3nsl/rpcb_gettime.3nsl=rpcbind.3nsl
+s usr/share/man/man3nsl/rpcb_rmtcall.3nsl=rpcbind.3nsl
+s usr/share/man/man3nsl/rpcb_set.3nsl=rpcbind.3nsl
+s usr/share/man/man3nsl/rpcb_unset.3nsl=rpcbind.3nsl
+f usr/share/man/man3nsl/rpcbind.3nsl 0444 root bin
+f usr/share/man/man3nsl/rpcsec_gss.3nsl 0444 root bin
+f usr/share/man/man3nsl/secure_rpc.3nsl 0444 root bin
+s usr/share/man/man3nsl/sethostent.3nsl=gethostbyname.3nsl
+s usr/share/man/man3nsl/setnetconfig.3nsl=getnetconfig.3nsl
+s usr/share/man/man3nsl/setnetpath.3nsl=getnetpath.3nsl
+s usr/share/man/man3nsl/setrpcent.3nsl=getrpcbyname.3nsl
+s usr/share/man/man3nsl/svc_add_input.3nsl=rpc_svc_input.3nsl
+s usr/share/man/man3nsl/svc_auth_reg.3nsl=rpc_svc_reg.3nsl
+s usr/share/man/man3nsl/svc_control.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_destroy.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_dg_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_dg_enablecache.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_done.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_door_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_exit.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_fd_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_fd_negotiate_ucred.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_fds.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svc_fdset.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_freeargs.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_getargs.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_getcaller.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svc_getcallerucred.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_getreq.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svc_getreq_common.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_getreq_poll.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_getreqset.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_getrpccaller.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_max_pollfd.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_pollfd.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_raw_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_reg.3nsl=rpc_svc_reg.3nsl
+s usr/share/man/man3nsl/svc_register.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svc_remove_input.3nsl=rpc_svc_input.3nsl
+s usr/share/man/man3nsl/svc_run.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_sendreply.3nsl=rpc_svc_calls.3nsl
+s usr/share/man/man3nsl/svc_tli_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_tp_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svc_unreg.3nsl=rpc_svc_reg.3nsl
+s usr/share/man/man3nsl/svc_unregister.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svc_vc_create.3nsl=rpc_svc_create.3nsl
+s usr/share/man/man3nsl/svcerr_auth.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcerr_decode.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcerr_noproc.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcerr_noprog.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcerr_progvers.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcerr_systemerr.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcerr_weakauth.3nsl=rpc_svc_err.3nsl
+s usr/share/man/man3nsl/svcfd_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svcraw_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svctcp_create.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svcudp_bufcreate.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/svcudp_create.3nsl=rpc_soc.3nsl
+f usr/share/man/man3nsl/t_accept.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_alloc.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_bind.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_close.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_connect.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_errno.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_error.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_free.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_getinfo.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_getprotaddr.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_getstate.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_listen.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_look.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_open.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_optmgmt.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcv.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvconnect.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvdis.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvrel.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvreldata.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvudata.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvuderr.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvv.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_rcvvudata.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_snd.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_snddis.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sndrel.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sndreldata.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sndudata.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sndv.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sndvudata.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_strerror.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sync.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_sysconf.3nsl 0444 root bin
+f usr/share/man/man3nsl/t_unbind.3nsl 0444 root bin
+s usr/share/man/man3nsl/taddr2uaddr.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/uaddr2taddr.3nsl=netdir.3nsl
+s usr/share/man/man3nsl/undial.3nsl=dial.3nsl
+s usr/share/man/man3nsl/user2netname.3nsl=secure_rpc.3nsl
+f usr/share/man/man3nsl/xdr.3nsl 0444 root bin
+s usr/share/man/man3nsl/xdr_accepted_reply.3nsl=rpc_xdr.3nsl
+f usr/share/man/man3nsl/xdr_admin.3nsl 0444 root bin
+s usr/share/man/man3nsl/xdr_array.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_authsys_parms.3nsl=rpc_xdr.3nsl
+s usr/share/man/man3nsl/xdr_authunix_parms.3nsl=rpc_soc.3nsl
+s usr/share/man/man3nsl/xdr_bool.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_bytes.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_callhdr.3nsl=rpc_xdr.3nsl
+s usr/share/man/man3nsl/xdr_callmsg.3nsl=rpc_xdr.3nsl
+s usr/share/man/man3nsl/xdr_char.3nsl=xdr_simple.3nsl
+f usr/share/man/man3nsl/xdr_complex.3nsl 0444 root bin
+s usr/share/man/man3nsl/xdr_control.3nsl=xdr_admin.3nsl
+f usr/share/man/man3nsl/xdr_create.3nsl 0444 root bin
+s usr/share/man/man3nsl/xdr_destroy.3nsl=xdr_create.3nsl
+s usr/share/man/man3nsl/xdr_double.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_enum.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_float.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_free.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_getpos.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdr_hyper.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_inline.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdr_int.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_long.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_longlong_t.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_opaque.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_opaque_auth.3nsl=rpc_xdr.3nsl
+s usr/share/man/man3nsl/xdr_pointer.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_quadruple.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_reference.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_rejected_reply.3nsl=rpc_xdr.3nsl
+s usr/share/man/man3nsl/xdr_replymsg.3nsl=rpc_xdr.3nsl
+s usr/share/man/man3nsl/xdr_setpos.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdr_short.3nsl=xdr_simple.3nsl
+f usr/share/man/man3nsl/xdr_simple.3nsl 0444 root bin
+s usr/share/man/man3nsl/xdr_sizeof.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdr_string.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_u_char.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_u_hyper.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_u_int.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_u_long.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_u_longlong_t.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_u_short.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_union.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_vector.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdr_void.3nsl=xdr_simple.3nsl
+s usr/share/man/man3nsl/xdr_wrapstring.3nsl=xdr_complex.3nsl
+s usr/share/man/man3nsl/xdrmem_create.3nsl=xdr_create.3nsl
+s usr/share/man/man3nsl/xdrrec_create.3nsl=xdr_create.3nsl
+s usr/share/man/man3nsl/xdrrec_endofrecord.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdrrec_eof.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdrrec_readbytes.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdrrec_skiprecord.3nsl=xdr_admin.3nsl
+s usr/share/man/man3nsl/xdrstdio_create.3nsl=xdr_create.3nsl
+s usr/share/man/man3nsl/xprt_register.3nsl=rpc_svc_reg.3nsl
+s usr/share/man/man3nsl/xprt_unregister.3nsl=rpc_svc_reg.3nsl
+s usr/share/man/man3nsl/yp_all.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_bind.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_first.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_get_default_domain.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_master.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_match.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_next.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_order.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/yp_unbind.3nsl=ypclnt.3nsl
+f usr/share/man/man3nsl/yp_update.3nsl 0444 root bin
+f usr/share/man/man3nsl/ypclnt.3nsl 0444 root bin
+s usr/share/man/man3nsl/yperr_string.3nsl=ypclnt.3nsl
+s usr/share/man/man3nsl/ypprot_err.3nsl=ypclnt.3nsl
+d usr/share/man/man3nvpair 0755 root bin
+s usr/share/man/man3nvpair/nv_alloc_fini.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nv_alloc_init.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nv_alloc_reset.3nvpair=nvlist_alloc.3nvpair
+f usr/share/man/man3nvpair/nvlist_add_boolean.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvlist_add_boolean_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_boolean_value.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_byte.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_byte_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_double.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int16.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int16_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int32.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int32_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int64.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int64_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int8.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_int8_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_nvlist.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_nvlist_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_nvpair.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_string.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_string_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint16.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint16_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint32.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint32_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint64.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint64_array.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint8.3nvpair=nvlist_add_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_add_uint8_array.3nvpair=nvlist_add_boolean.3nvpair
+f usr/share/man/man3nvpair/nvlist_alloc.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvlist_dup.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_exists.3nvpair=nvlist_lookup_nvpair.3nvpair
+s usr/share/man/man3nvpair/nvlist_free.3nvpair=nvlist_alloc.3nvpair
+f usr/share/man/man3nvpair/nvlist_lookup_boolean.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvlist_lookup_boolean_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_boolean_value.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_byte.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_byte_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_double.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int16.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int16_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int32.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int32_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int64.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int64_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int8.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_int8_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_nv_alloc.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_nvlist.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_nvlist_array.3nvpair=nvlist_lookup_boolean.3nvpair
+f usr/share/man/man3nvpair/nvlist_lookup_nvpair.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvlist_lookup_pairs.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_string.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_string_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint16.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint16_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint32.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint32_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint64.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint64_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint8.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_lookup_uint8_array.3nvpair=nvlist_lookup_boolean.3nvpair
+s usr/share/man/man3nvpair/nvlist_merge.3nvpair=nvlist_alloc.3nvpair
+f usr/share/man/man3nvpair/nvlist_next_nvpair.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvlist_pack.3nvpair=nvlist_alloc.3nvpair
+f usr/share/man/man3nvpair/nvlist_remove.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvlist_remove_all.3nvpair=nvlist_remove.3nvpair
+s usr/share/man/man3nvpair/nvlist_size.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_unpack.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_xalloc.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_xdup.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_xpack.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvlist_xunpack.3nvpair=nvlist_alloc.3nvpair
+s usr/share/man/man3nvpair/nvpair_name.3nvpair=nvlist_next_nvpair.3nvpair
+s usr/share/man/man3nvpair/nvpair_type.3nvpair=nvlist_next_nvpair.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_boolean_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_boolean_value.3nvpair=nvpair_value_byte.3nvpair
+f usr/share/man/man3nvpair/nvpair_value_byte.3nvpair 0444 root bin
+s usr/share/man/man3nvpair/nvpair_value_byte_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_double.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int16.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int16_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int32.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int32_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int64.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int64_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int8.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_int8_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_nvlist.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_nvlist_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_string.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_string_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint16.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint16_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint32.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint32_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint64.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint64_array.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint8.3nvpair=nvpair_value_byte.3nvpair
+s usr/share/man/man3nvpair/nvpair_value_uint8_array.3nvpair=nvpair_value_byte.3nvpair
+d usr/share/man/man3pam 0755 root bin
+f usr/share/man/man3pam/pam.3pam 0444 root bin
+f usr/share/man/man3pam/pam_acct_mgmt.3pam 0444 root bin
+f usr/share/man/man3pam/pam_authenticate.3pam 0444 root bin
+f usr/share/man/man3pam/pam_chauthtok.3pam 0444 root bin
+s usr/share/man/man3pam/pam_close_session.3pam=pam_open_session.3pam
+s usr/share/man/man3pam/pam_end.3pam=pam_start.3pam
+s usr/share/man/man3pam/pam_get_data.3pam=pam_set_data.3pam
+s usr/share/man/man3pam/pam_get_item.3pam=pam_set_item.3pam
+f usr/share/man/man3pam/pam_get_user.3pam 0444 root bin
+f usr/share/man/man3pam/pam_getenv.3pam 0444 root bin
+f usr/share/man/man3pam/pam_getenvlist.3pam 0444 root bin
+f usr/share/man/man3pam/pam_open_session.3pam 0444 root bin
+f usr/share/man/man3pam/pam_putenv.3pam 0444 root bin
+f usr/share/man/man3pam/pam_set_data.3pam 0444 root bin
+f usr/share/man/man3pam/pam_set_item.3pam 0444 root bin
+f usr/share/man/man3pam/pam_setcred.3pam 0444 root bin
+f usr/share/man/man3pam/pam_sm.3pam 0444 root bin
+f usr/share/man/man3pam/pam_sm_acct_mgmt.3pam 0444 root bin
+f usr/share/man/man3pam/pam_sm_authenticate.3pam 0444 root bin
+f usr/share/man/man3pam/pam_sm_chauthtok.3pam 0444 root bin
+s usr/share/man/man3pam/pam_sm_close_session.3pam=pam_sm_open_session.3pam
+f usr/share/man/man3pam/pam_sm_open_session.3pam 0444 root bin
+f usr/share/man/man3pam/pam_sm_setcred.3pam 0444 root bin
+f usr/share/man/man3pam/pam_start.3pam 0444 root bin
+f usr/share/man/man3pam/pam_strerror.3pam 0444 root bin
+d usr/share/man/man3papi 0755 root bin
+f usr/share/man/man3papi/papiAttributeListAddValue.3papi 0444 root bin
+f usr/share/man/man3papi/papiJobSubmit.3papi 0444 root bin
+f usr/share/man/man3papi/papiLibrarySupportedCall.3papi 0444 root bin
+f usr/share/man/man3papi/papiPrintersList.3papi 0444 root bin
+f usr/share/man/man3papi/papiServiceCreate.3papi 0444 root bin
+f usr/share/man/man3papi/papiStatusString.3papi 0444 root bin
+d usr/share/man/man3picl 0755 root bin
+f usr/share/man/man3picl/libpicl.3picl 0444 root bin
+f usr/share/man/man3picl/picl_find_node.3picl 0444 root bin
+f usr/share/man/man3picl/picl_get_first_prop.3picl 0444 root bin
+f usr/share/man/man3picl/picl_get_frutree_parent.3picl 0444 root bin
+s usr/share/man/man3picl/picl_get_next_by_col.3picl=picl_get_next_by_row.3picl
+f usr/share/man/man3picl/picl_get_next_by_row.3picl 0444 root bin
+s usr/share/man/man3picl/picl_get_next_prop.3picl=picl_get_first_prop.3picl
+f usr/share/man/man3picl/picl_get_node_by_path.3picl 0444 root bin
+f usr/share/man/man3picl/picl_get_prop_by_name.3picl 0444 root bin
+f usr/share/man/man3picl/picl_get_propinfo.3picl 0444 root bin
+f usr/share/man/man3picl/picl_get_propinfo_by_name.3picl 0444 root bin
+f usr/share/man/man3picl/picl_get_propval.3picl 0444 root bin
+s usr/share/man/man3picl/picl_get_propval_by_name.3picl=picl_get_propval.3picl
+f usr/share/man/man3picl/picl_get_root.3picl 0444 root bin
+f usr/share/man/man3picl/picl_initialize.3picl 0444 root bin
+f usr/share/man/man3picl/picl_set_propval.3picl 0444 root bin
+s usr/share/man/man3picl/picl_set_propval_by_name.3picl=picl_set_propval.3picl
+f usr/share/man/man3picl/picl_shutdown.3picl 0444 root bin
+f usr/share/man/man3picl/picl_strerror.3picl 0444 root bin
+f usr/share/man/man3picl/picl_wait.3picl 0444 root bin
+f usr/share/man/man3picl/picl_walk_tree_by_class.3picl 0444 root bin
+d usr/share/man/man3picltree 0755 root bin
+f usr/share/man/man3picltree/libpicltree.3picltree 0444 root bin
+f usr/share/man/man3picltree/picld_log.3picltree 0444 root bin
+f usr/share/man/man3picltree/picld_plugin_register.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_add_node.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_add_prop.3picltree 0444 root bin
+s usr/share/man/man3picltree/ptree_add_row_to_table.3picltree=ptree_create_table.3picltree
+f usr/share/man/man3picltree/ptree_create_and_add_node.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_create_and_add_prop.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_create_node.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_create_prop.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_create_table.3picltree 0444 root bin
+s usr/share/man/man3picltree/ptree_delete_node.3picltree=ptree_add_node.3picltree
+s usr/share/man/man3picltree/ptree_delete_prop.3picltree=ptree_add_prop.3picltree
+s usr/share/man/man3picltree/ptree_destroy_node.3picltree=ptree_create_node.3picltree
+s usr/share/man/man3picltree/ptree_destroy_prop.3picltree=ptree_create_prop.3picltree
+f usr/share/man/man3picltree/ptree_find_node.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_get_first_prop.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_get_frutree_parent.3picltree 0444 root bin
+s usr/share/man/man3picltree/ptree_get_next_by_col.3picltree=ptree_get_next_by_row.3picltree
+f usr/share/man/man3picltree/ptree_get_next_by_row.3picltree 0444 root bin
+s usr/share/man/man3picltree/ptree_get_next_prop.3picltree=ptree_get_first_prop.3picltree
+f usr/share/man/man3picltree/ptree_get_node_by_path.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_get_prop_by_name.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_get_propinfo.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_get_propinfo_by_name.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_get_propval.3picltree 0444 root bin
+s usr/share/man/man3picltree/ptree_get_propval_by_name.3picltree=ptree_get_propval.3picltree
+f usr/share/man/man3picltree/ptree_get_root.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_init_propinfo.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_post_event.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_register_handler.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_unregister_handler.3picltree 0444 root bin
+f usr/share/man/man3picltree/ptree_update_propval.3picltree 0444 root bin
+s usr/share/man/man3picltree/ptree_update_propval_by_name.3picltree=ptree_update_propval.3picltree
+f usr/share/man/man3picltree/ptree_walk_tree_by_class.3picltree 0444 root bin
+d usr/share/man/man3pool 0755 root bin
+f usr/share/man/man3pool/pool_associate.3pool 0444 root bin
+f usr/share/man/man3pool/pool_component_info.3pool 0444 root bin
+f usr/share/man/man3pool/pool_component_to_elem.3pool 0444 root bin
+f usr/share/man/man3pool/pool_conf_alloc.3pool 0444 root bin
+s usr/share/man/man3pool/pool_conf_close.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_commit.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_export.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_free.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_info.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_location.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_open.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_remove.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_rollback.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_status.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_to_elem.3pool=pool_component_to_elem.3pool
+s usr/share/man/man3pool/pool_conf_update.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_conf_validate.3pool=pool_conf_alloc.3pool
+s usr/share/man/man3pool/pool_create.3pool=pool_associate.3pool
+s usr/share/man/man3pool/pool_destroy.3pool=pool_associate.3pool
+s usr/share/man/man3pool/pool_dissociate.3pool=pool_associate.3pool
+f usr/share/man/man3pool/pool_dynamic_location.3pool 0444 root bin
+f usr/share/man/man3pool/pool_error.3pool 0444 root bin
+f usr/share/man/man3pool/pool_get_binding.3pool 0444 root bin
+s usr/share/man/man3pool/pool_get_owning_resource.3pool=pool_component_info.3pool
+f usr/share/man/man3pool/pool_get_pool.3pool 0444 root bin
+f usr/share/man/man3pool/pool_get_property.3pool 0444 root bin
+s usr/share/man/man3pool/pool_get_resource.3pool=pool_get_pool.3pool
+s usr/share/man/man3pool/pool_get_resource_binding.3pool=pool_get_binding.3pool
+s usr/share/man/man3pool/pool_get_status.3pool=pool_dynamic_location.3pool
+s usr/share/man/man3pool/pool_info.3pool=pool_associate.3pool
+s usr/share/man/man3pool/pool_put_property.3pool=pool_get_property.3pool
+s usr/share/man/man3pool/pool_query_components.3pool=pool_get_pool.3pool
+s usr/share/man/man3pool/pool_query_pool_resources.3pool=pool_associate.3pool
+s usr/share/man/man3pool/pool_query_pools.3pool=pool_get_pool.3pool
+s usr/share/man/man3pool/pool_query_resource_components.3pool=pool_resource_create.3pool
+s usr/share/man/man3pool/pool_query_resources.3pool=pool_get_pool.3pool
+f usr/share/man/man3pool/pool_resource_create.3pool 0444 root bin
+s usr/share/man/man3pool/pool_resource_destroy.3pool=pool_resource_create.3pool
+s usr/share/man/man3pool/pool_resource_info.3pool=pool_resource_create.3pool
+s usr/share/man/man3pool/pool_resource_to_elem.3pool=pool_component_to_elem.3pool
+s usr/share/man/man3pool/pool_resource_transfer.3pool=pool_resource_create.3pool
+s usr/share/man/man3pool/pool_resource_type_list.3pool=pool_dynamic_location.3pool
+s usr/share/man/man3pool/pool_resource_xtransfer.3pool=pool_resource_create.3pool
+s usr/share/man/man3pool/pool_rm_property.3pool=pool_get_property.3pool
+s usr/share/man/man3pool/pool_set_binding.3pool=pool_get_binding.3pool
+s usr/share/man/man3pool/pool_set_status.3pool=pool_dynamic_location.3pool
+s usr/share/man/man3pool/pool_static_location.3pool=pool_dynamic_location.3pool
+s usr/share/man/man3pool/pool_strerror.3pool=pool_error.3pool
+s usr/share/man/man3pool/pool_to_elem.3pool=pool_component_to_elem.3pool
+f usr/share/man/man3pool/pool_value_alloc.3pool 0444 root bin
+s usr/share/man/man3pool/pool_value_free.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_bool.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_double.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_int64.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_name.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_string.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_type.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_get_uint64.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_set_bool.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_set_double.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_set_int64.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_set_name.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_set_string.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_value_set_uint64.3pool=pool_value_alloc.3pool
+s usr/share/man/man3pool/pool_version.3pool=pool_dynamic_location.3pool
+f usr/share/man/man3pool/pool_walk_components.3pool 0444 root bin
+s usr/share/man/man3pool/pool_walk_pools.3pool=pool_walk_components.3pool
+s usr/share/man/man3pool/pool_walk_properties.3pool=pool_get_property.3pool
+s usr/share/man/man3pool/pool_walk_resources.3pool=pool_walk_components.3pool
+d usr/share/man/man3proc 0755 root bin
+f usr/share/man/man3proc/proc_service.3proc 0444 root bin
+s usr/share/man/man3proc/ps_kill.3proc=ps_pstop.3proc
+s usr/share/man/man3proc/ps_lcontinue.3proc=ps_pstop.3proc
+s usr/share/man/man3proc/ps_lgetfpregs.3proc=ps_lgetregs.3proc
+f usr/share/man/man3proc/ps_lgetregs.3proc 0444 root bin
+s usr/share/man/man3proc/ps_lgetxregs.3proc=ps_lgetregs.3proc
+s usr/share/man/man3proc/ps_lgetxregsize.3proc=ps_lgetregs.3proc
+s usr/share/man/man3proc/ps_lrolltoaddr.3proc=ps_pstop.3proc
+s usr/share/man/man3proc/ps_lsetfpregs.3proc=ps_lgetregs.3proc
+s usr/share/man/man3proc/ps_lsetregs.3proc=ps_lgetregs.3proc
+s usr/share/man/man3proc/ps_lsetxregs.3proc=ps_lgetregs.3proc
+s usr/share/man/man3proc/ps_lstop.3proc=ps_pstop.3proc
+s usr/share/man/man3proc/ps_pcontinue.3proc=ps_pstop.3proc
+s usr/share/man/man3proc/ps_pdread.3proc=ps_pread.3proc
+s usr/share/man/man3proc/ps_pdwrite.3proc=ps_pread.3proc
+f usr/share/man/man3proc/ps_pglobal_lookup.3proc 0444 root bin
+s usr/share/man/man3proc/ps_pglobal_sym.3proc=ps_pglobal_lookup.3proc
+f usr/share/man/man3proc/ps_pread.3proc 0444 root bin
+f usr/share/man/man3proc/ps_pstop.3proc 0444 root bin
+s usr/share/man/man3proc/ps_ptread.3proc=ps_pread.3proc
+s usr/share/man/man3proc/ps_ptwrite.3proc=ps_pread.3proc
+s usr/share/man/man3proc/ps_pwrite.3proc=ps_pread.3proc
+d usr/share/man/man3project 0755 root bin
+s usr/share/man/man3project/endprojent.3project=getprojent.3project
+s usr/share/man/man3project/fgetprojent.3project=getprojent.3project
+s usr/share/man/man3project/getdefaultproj.3project=getprojent.3project
+s usr/share/man/man3project/getprojbyid.3project=getprojent.3project
+s usr/share/man/man3project/getprojbyname.3project=getprojent.3project
+f usr/share/man/man3project/getprojent.3project 0444 root bin
+s usr/share/man/man3project/getprojidbyname.3project=getprojent.3project
+s usr/share/man/man3project/inproj.3project=getprojent.3project
+f usr/share/man/man3project/project_walk.3project 0444 root bin
+f usr/share/man/man3project/setproject.3project 0444 root bin
+s usr/share/man/man3project/setprojent.3project=getprojent.3project
+d usr/share/man/man3resolv 0755 root bin
+s usr/share/man/man3resolv/dn_comp.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/dn_expand.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/fp_resstat.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/herror.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/hstrerror.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_getservers.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_hostalias.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_init.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_mkquery.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nclose.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_ndestroy.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_ninit.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nmkquery.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nquery.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nquerydomain.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nsearch.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nsend.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_nsendsigned.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_query.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_search.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_send.3resolv=resolver.3resolv
+s usr/share/man/man3resolv/res_setservers.3resolv=resolver.3resolv
+f usr/share/man/man3resolv/resolver.3resolv 0444 root bin
+d usr/share/man/man3rpc 0755 root bin
+s usr/share/man/man3rpc/havedisk.3rpc=rstat.3rpc
+s usr/share/man/man3rpc/rnusers.3rpc=rusers.3rpc
+f usr/share/man/man3rpc/rstat.3rpc 0444 root bin
+f usr/share/man/man3rpc/rusers.3rpc 0444 root bin
+f usr/share/man/man3rpc/rwall.3rpc 0444 root bin
+d usr/share/man/man3rsm 0755 root bin
+f usr/share/man/man3rsm/rsm_create_localmemory_handle.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_get_controller.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_get_interconnect_topology.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_get_segmentid_range.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_intr_signal_post.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_intr_signal_wait_pollfd.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_export_create.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_export_publish.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_get_pollfd.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_connect.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_get.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_init_barrier.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_map.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_open_barrier.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_put.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_putv.3rsm 0444 root bin
+f usr/share/man/man3rsm/rsm_memseg_import_set_mode.3rsm 0444 root bin
+d usr/share/man/man3sasl 0755 root bin
+s usr/share/man/man3sasl/prop_clear.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_dispose.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_dup.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_erase.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_format.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_get.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_getnames.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_new.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_request.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_set.3sasl=sasl_auxprop.3sasl
+s usr/share/man/man3sasl/prop_setvals.3sasl=sasl_auxprop.3sasl
+f usr/share/man/man3sasl/sasl_authorize_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_auxprop.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_auxprop_add_plugin.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_auxprop_getctx.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_auxprop_request.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_canon_user_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_canonuser_add_plugin.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_chalprompt_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_checkapop.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_checkpass.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_client_add_plugin.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_client_init.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_client_new.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_client_plug_init_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_client_start.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_client_step.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_decode.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_decode64.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_dispose.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_done.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_encode.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_encode64.3sasl 0444 root bin
+s usr/share/man/man3sasl/sasl_encodev.3sasl=sasl_encode.3sasl
+f usr/share/man/man3sasl/sasl_erasebuffer.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_errdetail.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_errors.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_errstring.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getcallback_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getopt_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getpath_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getprop.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getrealm_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getsecret_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_getsimple_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_global_listmech.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_idle.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_listmech.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_log_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_add_plugin.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_init.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_new.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_plug_init_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_start.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_step.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_userdb_checkpass_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_server_userdb_setpass_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_set_alloc.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_set_mutex.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_seterror.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_setpass.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_setprop.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_utf8verify.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_verifyfile_t.3sasl 0444 root bin
+f usr/share/man/man3sasl/sasl_version.3sasl 0444 root bin
+d usr/share/man/man3scf 0755 root bin
+s usr/share/man/man3scf/scf_count_ranges_destroy.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_entry_add_value.3scf=scf_entry_create.3scf
+f usr/share/man/man3scf/scf_entry_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_entry_destroy.3scf=scf_entry_create.3scf
+s usr/share/man/man3scf/scf_entry_destroy_children.3scf=scf_entry_create.3scf
+s usr/share/man/man3scf/scf_entry_handle.3scf=scf_entry_create.3scf
+s usr/share/man/man3scf/scf_entry_reset.3scf=scf_entry_create.3scf
+f usr/share/man/man3scf/scf_error.3scf 0444 root bin
+s usr/share/man/man3scf/scf_handle_bind.3scf=scf_handle_create.3scf
+f usr/share/man/man3scf/scf_handle_create.3scf 0444 root bin
+f usr/share/man/man3scf/scf_handle_decode_fmri.3scf 0444 root bin
+s usr/share/man/man3scf/scf_handle_decorate.3scf=scf_handle_create.3scf
+s usr/share/man/man3scf/scf_handle_destroy.3scf=scf_handle_create.3scf
+s usr/share/man/man3scf/scf_handle_get_scope.3scf=scf_scope_create.3scf
+s usr/share/man/man3scf/scf_handle_unbind.3scf=scf_handle_create.3scf
+s usr/share/man/man3scf/scf_instance_add_pg.3scf=scf_pg_create.3scf
+f usr/share/man/man3scf/scf_instance_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_instance_delete.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_instance_destroy.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_instance_get_name.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_instance_get_parent.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_instance_get_pg.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_instance_get_pg_composed.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_instance_get_snapshot.3scf=scf_snapshot_create.3scf
+s usr/share/man/man3scf/scf_instance_handle.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_instance_to_fmri.3scf=scf_handle_decode_fmri.3scf
+s usr/share/man/man3scf/scf_int_ranges_destroy.3scf=scf_tmpl_prop_name.3scf
+f usr/share/man/man3scf/scf_iter_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_iter_destroy.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_handle.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_handle_scopes.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_instance_pgs.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_instance_pgs_composed.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_instance_pgs_typed.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_instance_pgs_typed_composed.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_instance_snapshots.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_instance.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_pg.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_property.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_scope.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_service.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_snapshot.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_next_value.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_pg_properties.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_property_values.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_reset.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_scope_services.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_service_instances.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_service_pgs.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_service_pgs_typed.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_snaplevel_pgs.3scf=scf_iter_create.3scf
+s usr/share/man/man3scf/scf_iter_snaplevel_pgs_typed.3scf=scf_iter_create.3scf
+f usr/share/man/man3scf/scf_limit.3scf 0444 root bin
+s usr/share/man/man3scf/scf_myname.3scf=scf_handle_create.3scf
+f usr/share/man/man3scf/scf_pg_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_pg_delete.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_destroy.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_flags.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_name.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_parent_instance.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_parent_service.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_parent_snaplevel.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_property.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_pg_get_type.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_get_underlying_pg.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_handle.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_pg_to_fmri.3scf=scf_handle_decode_fmri.3scf
+s usr/share/man/man3scf/scf_pg_update.3scf=scf_pg_create.3scf
+f usr/share/man/man3scf/scf_property_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_property_destroy.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_property_get_name.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_property_get_value.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_property_handle.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_property_is_type.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_property_to_fmri.3scf=scf_handle_decode_fmri.3scf
+s usr/share/man/man3scf/scf_property_type.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_scope_add_service.3scf=scf_service_create.3scf
+f usr/share/man/man3scf/scf_scope_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_scope_destroy.3scf=scf_scope_create.3scf
+s usr/share/man/man3scf/scf_scope_get_name.3scf=scf_scope_create.3scf
+s usr/share/man/man3scf/scf_scope_get_service.3scf=scf_service_create.3scf
+s usr/share/man/man3scf/scf_scope_handle.3scf=scf_scope_create.3scf
+s usr/share/man/man3scf/scf_scope_to_fmri.3scf=scf_handle_decode_fmri.3scf
+s usr/share/man/man3scf/scf_service_add_instance.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_service_add_pg.3scf=scf_pg_create.3scf
+f usr/share/man/man3scf/scf_service_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_service_delete.3scf=scf_service_create.3scf
+s usr/share/man/man3scf/scf_service_destroy.3scf=scf_service_create.3scf
+s usr/share/man/man3scf/scf_service_get_instance.3scf=scf_instance_create.3scf
+s usr/share/man/man3scf/scf_service_get_name.3scf=scf_service_create.3scf
+s usr/share/man/man3scf/scf_service_get_parent.3scf=scf_service_create.3scf
+s usr/share/man/man3scf/scf_service_get_pg.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_service_handle.3scf=scf_service_create.3scf
+s usr/share/man/man3scf/scf_service_to_fmri.3scf=scf_handle_decode_fmri.3scf
+s usr/share/man/man3scf/scf_simple_app_props_free.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_app_props_get.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_app_props_next.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_app_props_search.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_free.3scf=scf_simple_prop_get.3scf
+f usr/share/man/man3scf/scf_simple_prop_get.3scf 0444 root bin
+s usr/share/man/man3scf/scf_simple_prop_name.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_astring.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_boolean.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_count.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_integer.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_opaque.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_reset.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_time.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_next_ustring.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_numvalues.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_pgname.3scf=scf_simple_prop_get.3scf
+s usr/share/man/man3scf/scf_simple_prop_type.3scf=scf_simple_prop_get.3scf
+f usr/share/man/man3scf/scf_simple_walk_instances.3scf 0444 root bin
+f usr/share/man/man3scf/scf_snaplevel_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_snaplevel_destroy.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_get_instance_name.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_get_next_snaplevel.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_get_parent.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_get_pg.3scf=scf_pg_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_get_scope_name.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_get_service_name.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snaplevel_handle.3scf=scf_snaplevel_create.3scf
+f usr/share/man/man3scf/scf_snapshot_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_snapshot_destroy.3scf=scf_snapshot_create.3scf
+s usr/share/man/man3scf/scf_snapshot_get_base_snaplevel.3scf=scf_snaplevel_create.3scf
+s usr/share/man/man3scf/scf_snapshot_get_name.3scf=scf_snapshot_create.3scf
+s usr/share/man/man3scf/scf_snapshot_get_parent.3scf=scf_snapshot_create.3scf
+s usr/share/man/man3scf/scf_snapshot_handle.3scf=scf_snapshot_create.3scf
+s usr/share/man/man3scf/scf_snapshot_update.3scf=scf_snapshot_create.3scf
+s usr/share/man/man3scf/scf_strerror.3scf=scf_error.3scf
+s usr/share/man/man3scf/scf_string_to_type.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_tmpl_error_pg.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_error_pg_tmpl.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_error_prop.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_error_prop_tmpl.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_error_source_fmri.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_error_type.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_error_value.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_errors_destroy.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_get_by_pg.3scf=scf_tmpl_pg_create.3scf
+s usr/share/man/man3scf/scf_tmpl_get_by_pg_name.3scf=scf_tmpl_pg_create.3scf
+s usr/share/man/man3scf/scf_tmpl_get_by_prop.3scf=scf_tmpl_prop_create.3scf
+s usr/share/man/man3scf/scf_tmpl_iter_pgs.3scf=scf_tmpl_pg_create.3scf
+s usr/share/man/man3scf/scf_tmpl_iter_props.3scf=scf_tmpl_prop_create.3scf
+s usr/share/man/man3scf/scf_tmpl_next_error.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_pg_common_name.3scf=scf_tmpl_pg_name.3scf
+f usr/share/man/man3scf/scf_tmpl_pg_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_tmpl_pg_description.3scf=scf_tmpl_pg_name.3scf
+s usr/share/man/man3scf/scf_tmpl_pg_destroy.3scf=scf_tmpl_pg_create.3scf
+f usr/share/man/man3scf/scf_tmpl_pg_name.3scf 0444 root bin
+s usr/share/man/man3scf/scf_tmpl_pg_required.3scf=scf_tmpl_pg_name.3scf
+s usr/share/man/man3scf/scf_tmpl_pg_reset.3scf=scf_tmpl_pg_create.3scf
+s usr/share/man/man3scf/scf_tmpl_pg_target.3scf=scf_tmpl_pg_name.3scf
+s usr/share/man/man3scf/scf_tmpl_pg_type.3scf=scf_tmpl_pg_name.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_cardinality.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_common_name.3scf=scf_tmpl_prop_name.3scf
+f usr/share/man/man3scf/scf_tmpl_prop_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_tmpl_prop_description.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_destroy.3scf=scf_tmpl_prop_create.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_internal_seps.3scf=scf_tmpl_prop_name.3scf
+f usr/share/man/man3scf/scf_tmpl_prop_name.3scf 0444 root bin
+s usr/share/man/man3scf/scf_tmpl_prop_required.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_reset.3scf=scf_tmpl_prop_create.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_type.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_units.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_prop_visibility.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_reset_errors.3scf=scf_tmpl_validate_fmri.3scf
+s usr/share/man/man3scf/scf_tmpl_strerror.3scf=scf_tmpl_validate_fmri.3scf
+f usr/share/man/man3scf/scf_tmpl_validate_fmri.3scf 0444 root bin
+s usr/share/man/man3scf/scf_tmpl_value_common_name.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_count_range_choices.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_count_range_constraints.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_description.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_in_constraint.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_int_range_choices.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_int_range_constraints.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_name_choices.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_value_name_constraints.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_tmpl_visibility_to_string.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/scf_transaction_commit.3scf=scf_transaction_create.3scf
+f usr/share/man/man3scf/scf_transaction_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_transaction_destroy.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_destroy_children.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_handle.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_property_change.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_property_change_type.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_property_delete.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_property_new.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_reset.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_reset_all.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_transaction_start.3scf=scf_transaction_create.3scf
+s usr/share/man/man3scf/scf_type_base_type.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_type_to_string.3scf=scf_property_create.3scf
+s usr/share/man/man3scf/scf_value_base_type.3scf=scf_value_create.3scf
+f usr/share/man/man3scf/scf_value_create.3scf 0444 root bin
+s usr/share/man/man3scf/scf_value_destroy.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_as_string.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_as_string_typed.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_astring.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_boolean.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_count.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_integer.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_opaque.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_time.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_get_ustring.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_handle.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_is_type.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_reset.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_astring.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_boolean.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_count.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_from_string.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_integer.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_opaque.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_time.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_set_ustring.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_value_type.3scf=scf_value_create.3scf
+s usr/share/man/man3scf/scf_values_destroy.3scf=scf_tmpl_prop_name.3scf
+s usr/share/man/man3scf/smf_degrade_instance.3scf=smf_enable_instance.3scf
+s usr/share/man/man3scf/smf_disable_instance.3scf=smf_enable_instance.3scf
+f usr/share/man/man3scf/smf_enable_instance.3scf 0444 root bin
+s usr/share/man/man3scf/smf_get_state.3scf=smf_enable_instance.3scf
+s usr/share/man/man3scf/smf_maintain_instance.3scf=smf_enable_instance.3scf
+s usr/share/man/man3scf/smf_refresh_instance.3scf=smf_enable_instance.3scf
+s usr/share/man/man3scf/smf_restart_instance.3scf=smf_enable_instance.3scf
+s usr/share/man/man3scf/smf_restore_instance.3scf=smf_enable_instance.3scf
+d usr/share/man/man3sec 0755 root bin
+f usr/share/man/man3sec/acl_check.3sec 0444 root bin
+f usr/share/man/man3sec/acl_free.3sec 0444 root bin
+s usr/share/man/man3sec/acl_fromtext.3sec=acl_totext.3sec
+f usr/share/man/man3sec/acl_get.3sec 0444 root bin
+s usr/share/man/man3sec/acl_set.3sec=acl_get.3sec
+f usr/share/man/man3sec/acl_strip.3sec 0444 root bin
+f usr/share/man/man3sec/acl_totext.3sec 0444 root bin
+f usr/share/man/man3sec/acl_trivial.3sec 0444 root bin
+f usr/share/man/man3sec/aclcheck.3sec 0444 root bin
+s usr/share/man/man3sec/aclfrommode.3sec=acltomode.3sec
+s usr/share/man/man3sec/aclfromtext.3sec=acltotext.3sec
+f usr/share/man/man3sec/aclsort.3sec 0444 root bin
+f usr/share/man/man3sec/acltomode.3sec 0444 root bin
+f usr/share/man/man3sec/acltotext.3sec 0444 root bin
+s usr/share/man/man3sec/facl_get.3sec=acl_get.3sec
+s usr/share/man/man3sec/facl_set.3sec=acl_get.3sec
+d usr/share/man/man3secdb 0755 root bin
+s usr/share/man/man3secdb/chkauthattr.3secdb=getauthattr.3secdb
+s usr/share/man/man3secdb/endauthattr.3secdb=getauthattr.3secdb
+s usr/share/man/man3secdb/endexecattr.3secdb=getexecattr.3secdb
+s usr/share/man/man3secdb/endprofattr.3secdb=getprofattr.3secdb
+s usr/share/man/man3secdb/enduserattr.3secdb=getuserattr.3secdb
+s usr/share/man/man3secdb/fgetuserattr.3secdb=getuserattr.3secdb
+s usr/share/man/man3secdb/free_authattr.3secdb=getauthattr.3secdb
+s usr/share/man/man3secdb/free_execattr.3secdb=getexecattr.3secdb
+s usr/share/man/man3secdb/free_profattr.3secdb=getprofattr.3secdb
+s usr/share/man/man3secdb/free_proflist.3secdb=getprofattr.3secdb
+s usr/share/man/man3secdb/free_userattr.3secdb=getuserattr.3secdb
+f usr/share/man/man3secdb/getauthattr.3secdb 0444 root bin
+s usr/share/man/man3secdb/getauthnam.3secdb=getauthattr.3secdb
+f usr/share/man/man3secdb/getexecattr.3secdb 0444 root bin
+s usr/share/man/man3secdb/getexecprof.3secdb=getexecattr.3secdb
+s usr/share/man/man3secdb/getexecuser.3secdb=getexecattr.3secdb
+f usr/share/man/man3secdb/getprofattr.3secdb 0444 root bin
+s usr/share/man/man3secdb/getproflist.3secdb=getprofattr.3secdb
+s usr/share/man/man3secdb/getprofnam.3secdb=getprofattr.3secdb
+f usr/share/man/man3secdb/getuserattr.3secdb 0444 root bin
+s usr/share/man/man3secdb/getusernam.3secdb=getuserattr.3secdb
+s usr/share/man/man3secdb/getuseruid.3secdb=getuserattr.3secdb
+f usr/share/man/man3secdb/kva_match.3secdb 0444 root bin
+s usr/share/man/man3secdb/match_execattr.3secdb=getexecattr.3secdb
+s usr/share/man/man3secdb/setauthattr.3secdb=getauthattr.3secdb
+s usr/share/man/man3secdb/setexecattr.3secdb=getexecattr.3secdb
+s usr/share/man/man3secdb/setprofattr.3secdb=getprofattr.3secdb
+s usr/share/man/man3secdb/setuserattr.3secdb=getuserattr.3secdb
+d usr/share/man/man3sip 0755 root bin
+s usr/share/man/man3sip/sip_add_accept.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_accept_enc.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_accept_lang.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_alert_info.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_allow.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_allow_events.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_authen_info.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_author.3sip=sip_add_from.3sip
+f usr/share/man/man3sip/sip_add_branchid_to_via.3sip 0444 root bin
+s usr/share/man/man3sip/sip_add_call_info.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_callid.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_contact.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_content.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_content_disp.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_content_enc.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_content_lang.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_content_type.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_cseq.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_date.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_error_info.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_event.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_expires.3sip=sip_add_from.3sip
+f usr/share/man/man3sip/sip_add_from.3sip 0444 root bin
+f usr/share/man/man3sip/sip_add_header.3sip 0444 root bin
+s usr/share/man/man3sip/sip_add_in_reply_to.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_maxforward.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_mime_version.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_min_expires.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_org.3sip=sip_add_from.3sip
+f usr/share/man/man3sip/sip_add_param.3sip 0444 root bin
+s usr/share/man/man3sip/sip_add_passertedid.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_ppreferredid.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_priority.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_privacy.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_proxy_authen.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_proxy_author.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_proxy_require.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_rack.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_record_route.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_reply_to.3sip=sip_add_from.3sip
+f usr/share/man/man3sip/sip_add_request_line.3sip 0444 root bin
+s usr/share/man/man3sip/sip_add_require.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_response_line.3sip=sip_add_request_line.3sip
+s usr/share/man/man3sip/sip_add_retry_after.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_route.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_rseq.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_server.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_subject.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_substate.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_supported.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_to.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_tstamp.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_unsupported.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_user_agent.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_via.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_warning.3sip=sip_add_from.3sip
+s usr/share/man/man3sip/sip_add_www_authen.3sip=sip_add_from.3sip
+f usr/share/man/man3sip/sip_branchid.3sip 0444 root bin
+s usr/share/man/man3sip/sip_clear_stale_data.3sip=sip_init_conn_object.3sip
+f usr/share/man/man3sip/sip_clone_msg.3sip 0444 root bin
+s usr/share/man/man3sip/sip_conn_destroyed.3sip=sip_init_conn_object.3sip
+s usr/share/man/man3sip/sip_copy_all_headers.3sip=sip_copy_start_line.3sip
+s usr/share/man/man3sip/sip_copy_header.3sip=sip_copy_start_line.3sip
+s usr/share/man/man3sip/sip_copy_header_by_name.3sip=sip_copy_start_line.3sip
+f usr/share/man/man3sip/sip_copy_start_line.3sip 0444 root bin
+f usr/share/man/man3sip/sip_create_OKack.3sip 0444 root bin
+f usr/share/man/man3sip/sip_create_dialog_req.3sip 0444 root bin
+s usr/share/man/man3sip/sip_create_dialog_req_nocontact.3sip=sip_create_dialog_req.3sip
+f usr/share/man/man3sip/sip_create_response.3sip 0444 root bin
+f usr/share/man/man3sip/sip_delete_dialog.3sip 0444 root bin
+s usr/share/man/man3sip/sip_delete_header.3sip=sip_delete_start_line.3sip
+s usr/share/man/man3sip/sip_delete_header_by_name.3sip=sip_delete_start_line.3sip
+f usr/share/man/man3sip/sip_delete_start_line.3sip 0444 root bin
+s usr/share/man/man3sip/sip_delete_value.3sip=sip_delete_start_line.3sip
+s usr/share/man/man3sip/sip_disable_counters.3sip=sip_enable_counters.3sip
+s usr/share/man/man3sip/sip_disable_dialog_logging.3sip=sip_enable_trans_logging.3sip
+s usr/share/man/man3sip/sip_disable_trans_logging.3sip=sip_enable_trans_logging.3sip
+f usr/share/man/man3sip/sip_enable_counters.3sip 0444 root bin
+s usr/share/man/man3sip/sip_enable_dialog_logging.3sip=sip_enable_trans_logging.3sip
+f usr/share/man/man3sip/sip_enable_trans_logging.3sip 0444 root bin
+s usr/share/man/man3sip/sip_free_msg.3sip=sip_hold_msg.3sip
+s usr/share/man/man3sip/sip_free_parsed_uri.3sip=sip_parse_uri.3sip
+s usr/share/man/man3sip/sip_get_accept_enc.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_accept_lang.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_accept_sub_type.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_accept_type.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_alert_info_uri.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_allow_events.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_allow_method.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_authen_info.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_author_param.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_author_scheme.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_branchid.3sip=sip_get_num_via.3sip
+s usr/share/man/man3sip/sip_get_call_info_uri.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_callid.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_callseq_method.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_callseq_num.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_contact_display_name.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_contact_uri_str.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content_disp.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content_enc.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content_lang.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content_length.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content_sub_type.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_content_type.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_counter_value.3sip=sip_enable_counters.3sip
+f usr/share/man/man3sip/sip_get_cseq.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_date_day.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_date_month.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_date_time.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_date_timezone.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_date_wkday.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_date_year.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_dialog_callid.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_local_contact_uri.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_local_cseq.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_local_tag.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_local_uri.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_method.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_msgcnt.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_remote_cseq.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_remote_tag.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_remote_target_uri.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_remote_uri.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_dialog_route_set.3sip=sip_get_dialog_state.3sip
+f usr/share/man/man3sip/sip_get_dialog_state.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_dialog_type.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_get_error_info_uri.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_event.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_expires.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_from_display_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_from_tag.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_from_uri_str.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_header.3sip 0444 root bin
+f usr/share/man/man3sip/sip_get_header_value.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_in_reply_to.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_maxforward.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_mime_version.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_min_expires.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_msg_len.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_next_value.3sip=sip_get_header_value.3sip
+f usr/share/man/man3sip/sip_get_num_via.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_org.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_param_value.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_params.3sip=sip_get_param_value.3sip
+s usr/share/man/man3sip/sip_get_passertedid_display_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_passertedid_uri_str.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_ppreferredid_display_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_ppreferredid_uri_str.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_priority.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_priv_value.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_proxy_authen_param.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_proxy_authen_scheme.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_proxy_author_param.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_proxy_author_scheme.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_proxy_require.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_rack_cseq_num.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_rack_method.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_rack_resp_num.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_replyto_display_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_replyto_uri_str.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_request_method.3sip 0444 root bin
+f usr/share/man/man3sip/sip_get_request_uri_str.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_require.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_resp_desc.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_response_code.3sip=sip_get_request_method.3sip
+s usr/share/man/man3sip/sip_get_response_phrase.3sip=sip_get_request_method.3sip
+s usr/share/man/man3sip/sip_get_retry_after_cmts.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_retry_after_time.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_route_display_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_route_uri_str.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_rseq.3sip=sip_get_cseq.3sip
+s usr/share/man/man3sip/sip_get_rseq_resp_num.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_server.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_sip_version.3sip=sip_get_request_method.3sip
+s usr/share/man/man3sip/sip_get_subject.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_substate.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_supported.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_to_display_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_to_tag.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_to_uri_str.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_get_trans.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_trans_branchid.3sip=sip_get_trans_method.3sip
+s usr/share/man/man3sip/sip_get_trans_conn_obj.3sip=sip_get_trans_method.3sip
+f usr/share/man/man3sip/sip_get_trans_method.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_trans_orig_msg.3sip=sip_get_trans_method.3sip
+s usr/share/man/man3sip/sip_get_trans_resp_msg.3sip=sip_get_trans_method.3sip
+s usr/share/man/man3sip/sip_get_trans_state.3sip=sip_get_trans_method.3sip
+s usr/share/man/man3sip/sip_get_tstamp_delay.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_tstamp_value.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_unsupported.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_uri_errflags.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_headers.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_host.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_opaque.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_params.3sip=sip_is_sip_uri.3sip
+f usr/share/man/man3sip/sip_get_uri_parsed.3sip 0444 root bin
+s usr/share/man/man3sip/sip_get_uri_password.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_path.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_port.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_query.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_regname.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_scheme.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_uri_user.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_get_user_agent.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_via_sent_by_host.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_via_sent_by_port.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_via_sent_protocol_name.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_via_sent_protocol_version.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_via_sent_transport.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_warning_agent.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_warning_code.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_warning_text.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_www_authen_param.3sip=sip_get_contact_display_name.3sip
+s usr/share/man/man3sip/sip_get_www_authen_scheme.3sip=sip_get_contact_display_name.3sip
+f usr/share/man/man3sip/sip_guid.3sip 0444 root bin
+s usr/share/man/man3sip/sip_hdr_to_str.3sip=sip_msg_to_str.3sip
+f usr/share/man/man3sip/sip_hold_dialog.3sip 0444 root bin
+f usr/share/man/man3sip/sip_hold_msg.3sip 0444 root bin
+f usr/share/man/man3sip/sip_hold_trans.3sip 0444 root bin
+f usr/share/man/man3sip/sip_init_conn_object.3sip 0444 root bin
+s usr/share/man/man3sip/sip_is_dialog_secure.3sip=sip_get_dialog_state.3sip
+s usr/share/man/man3sip/sip_is_param_present.3sip=sip_get_param_value.3sip
+f usr/share/man/man3sip/sip_is_sip_uri.3sip 0444 root bin
+s usr/share/man/man3sip/sip_is_uri_teluser.3sip=sip_is_sip_uri.3sip
+s usr/share/man/man3sip/sip_message_is_response.3sip=sip_msg_is_request.3sip
+f usr/share/man/man3sip/sip_msg_is_request.3sip 0444 root bin
+f usr/share/man/man3sip/sip_msg_to_str.3sip 0444 root bin
+f usr/share/man/man3sip/sip_new_msg.3sip 0444 root bin
+f usr/share/man/man3sip/sip_parse_uri.3sip 0444 root bin
+f usr/share/man/man3sip/sip_process_new_packet.3sip 0444 root bin
+f usr/share/man/man3sip/sip_register_sent_by.3sip 0444 root bin
+s usr/share/man/man3sip/sip_release_dialog.3sip=sip_hold_dialog.3sip
+s usr/share/man/man3sip/sip_release_trans.3sip=sip_hold_trans.3sip
+s usr/share/man/man3sip/sip_reqline_to_str.3sip=sip_msg_to_str.3sip
+s usr/share/man/man3sip/sip_respline_to_str.3sip=sip_msg_to_str.3sip
+f usr/share/man/man3sip/sip_sendmsg.3sip 0444 root bin
+s usr/share/man/man3sip/sip_sent_by_to_str.3sip=sip_msg_to_str.3sip
+f usr/share/man/man3sip/sip_stack_init.3sip 0444 root bin
+s usr/share/man/man3sip/sip_unregister_all_sent_by.3sip=sip_register_sent_by.3sip
+s usr/share/man/man3sip/sip_unregister_sent_by.3sip=sip_register_sent_by.3sip
+s usr/share/man/man3sip/sip_uri_errflags_to_str.3sip=sip_is_sip_uri.3sip
+d usr/share/man/man3slp 0755 root bin
+f usr/share/man/man3slp/SLPClose.3slp 0444 root bin
+f usr/share/man/man3slp/SLPDelAttrs.3slp 0444 root bin
+f usr/share/man/man3slp/SLPDereg.3slp 0444 root bin
+f usr/share/man/man3slp/SLPEscape.3slp 0444 root bin
+f usr/share/man/man3slp/SLPFindAttrs.3slp 0444 root bin
+f usr/share/man/man3slp/SLPFindScopes.3slp 0444 root bin
+f usr/share/man/man3slp/SLPFindSrvTypes.3slp 0444 root bin
+f usr/share/man/man3slp/SLPFindSrvs.3slp 0444 root bin
+f usr/share/man/man3slp/SLPFree.3slp 0444 root bin
+f usr/share/man/man3slp/SLPGetProperty.3slp 0444 root bin
+f usr/share/man/man3slp/SLPGetRefreshInterval.3slp 0444 root bin
+f usr/share/man/man3slp/SLPOpen.3slp 0444 root bin
+f usr/share/man/man3slp/SLPParseSrvURL.3slp 0444 root bin
+f usr/share/man/man3slp/SLPReg.3slp 0444 root bin
+f usr/share/man/man3slp/SLPSetProperty.3slp 0444 root bin
+f usr/share/man/man3slp/SLPUnescape.3slp 0444 root bin
+f usr/share/man/man3slp/slp_api.3slp 0444 root bin
+f usr/share/man/man3slp/slp_strerror.3slp 0444 root bin
+d usr/share/man/man3socket 0755 root bin
+f usr/share/man/man3socket/accept.3socket 0444 root bin
+s usr/share/man/man3socket/accept4.3socket=accept.3socket
+f usr/share/man/man3socket/bind.3socket 0444 root bin
+f usr/share/man/man3socket/byteorder.3socket 0444 root bin
+f usr/share/man/man3socket/connect.3socket 0444 root bin
+s usr/share/man/man3socket/endnetent.3socket=getnetbyname.3socket
+s usr/share/man/man3socket/endprotoent.3socket=getprotobyname.3socket
+s usr/share/man/man3socket/endservent.3socket=getservbyname.3socket
+s usr/share/man/man3socket/ether_aton.3socket=ethers.3socket
+s usr/share/man/man3socket/ether_hostton.3socket=ethers.3socket
+s usr/share/man/man3socket/ether_line.3socket=ethers.3socket
+s usr/share/man/man3socket/ether_ntoa.3socket=ethers.3socket
+s usr/share/man/man3socket/ether_ntohost.3socket=ethers.3socket
+f usr/share/man/man3socket/ethers.3socket 0444 root bin
+s usr/share/man/man3socket/freeaddrinfo.3socket=getaddrinfo.3socket
+s usr/share/man/man3socket/freehostent.3socket=getipnodebyname.3socket
+s usr/share/man/man3socket/freeifaddrs.3socket=getifaddrs.3socket
+s usr/share/man/man3socket/gai_strerror.3socket=getaddrinfo.3socket
+f usr/share/man/man3socket/getaddrinfo.3socket 0444 root bin
+f usr/share/man/man3socket/getifaddrs.3socket 0444 root bin
+s usr/share/man/man3socket/getipnodebyaddr.3socket=getipnodebyname.3socket
+f usr/share/man/man3socket/getipnodebyname.3socket 0444 root bin
+s usr/share/man/man3socket/getipv4sourcefilter.3socket=getsourcefilter.3socket
+s usr/share/man/man3socket/getnameinfo.3socket=getaddrinfo.3socket
+s usr/share/man/man3socket/getnetbyaddr.3socket=getnetbyname.3socket
+s usr/share/man/man3socket/getnetbyaddr_r.3socket=getnetbyname.3socket
+f usr/share/man/man3socket/getnetbyname.3socket 0444 root bin
+s usr/share/man/man3socket/getnetbyname_r.3socket=getnetbyname.3socket
+s usr/share/man/man3socket/getnetent.3socket=getnetbyname.3socket
+s usr/share/man/man3socket/getnetent_r.3socket=getnetbyname.3socket
+f usr/share/man/man3socket/getpeername.3socket 0444 root bin
+f usr/share/man/man3socket/getprotobyname.3socket 0444 root bin
+s usr/share/man/man3socket/getprotobyname_r.3socket=getprotobyname.3socket
+s usr/share/man/man3socket/getprotobynumber.3socket=getprotobyname.3socket
+s usr/share/man/man3socket/getprotobynumber_r.3socket=getprotobyname.3socket
+s usr/share/man/man3socket/getprotoent.3socket=getprotobyname.3socket
+s usr/share/man/man3socket/getprotoent_r.3socket=getprotobyname.3socket
+f usr/share/man/man3socket/getservbyname.3socket 0444 root bin
+s usr/share/man/man3socket/getservbyname_r.3socket=getservbyname.3socket
+s usr/share/man/man3socket/getservbyport.3socket=getservbyname.3socket
+s usr/share/man/man3socket/getservbyport_r.3socket=getservbyname.3socket
+s usr/share/man/man3socket/getservent.3socket=getservbyname.3socket
+s usr/share/man/man3socket/getservent_r.3socket=getservbyname.3socket
+f usr/share/man/man3socket/getsockname.3socket 0444 root bin
+f usr/share/man/man3socket/getsockopt.3socket 0444 root bin
+f usr/share/man/man3socket/getsourcefilter.3socket 0444 root bin
+s usr/share/man/man3socket/htonl.3socket=byteorder.3socket
+s usr/share/man/man3socket/htonll.3socket=byteorder.3socket
+s usr/share/man/man3socket/htons.3socket=byteorder.3socket
+f usr/share/man/man3socket/icmp6_filter.3socket 0444 root bin
+s usr/share/man/man3socket/if_freenameindex.3socket=if_nametoindex.3socket
+s usr/share/man/man3socket/if_indextoname.3socket=if_nametoindex.3socket
+s usr/share/man/man3socket/if_nameindex.3socket=if_nametoindex.3socket
+f usr/share/man/man3socket/if_nametoindex.3socket 0444 root bin
+f usr/share/man/man3socket/inet.3socket 0444 root bin
+s usr/share/man/man3socket/inet6.3socket=inet.3socket
+f usr/share/man/man3socket/inet6_opt.3socket 0444 root bin
+s usr/share/man/man3socket/inet6_opt_append.3socket=inet6_opt.3socket
+s usr/share/man/man3socket/inet6_opt_find.3socket=inet6_opt.3socket
+s usr/share/man/man3socket/inet6_opt_finish.3socket=inet6_opt.3socket
+s usr/share/man/man3socket/inet6_opt_get_val.3socket=inet6_opt.3socket
+s usr/share/man/man3socket/inet6_opt_init.3socket=inet6_opt.3socket
+s usr/share/man/man3socket/inet6_opt_next.3socket=inet6_opt.3socket
+s usr/share/man/man3socket/inet6_opt_set_val.3socket=inet6_opt.3socket
+f usr/share/man/man3socket/inet6_rth.3socket 0444 root bin
+s usr/share/man/man3socket/inet6_rth_add.3socket=inet6_rth.3socket
+s usr/share/man/man3socket/inet6_rth_getaddr.3socket=inet6_rth.3socket
+s usr/share/man/man3socket/inet6_rth_init.3socket=inet6_rth.3socket
+s usr/share/man/man3socket/inet6_rth_reverse.3socket=inet6_rth.3socket
+s usr/share/man/man3socket/inet6_rth_segments.3socket=inet6_rth.3socket
+s usr/share/man/man3socket/inet6_rth_space.3socket=inet6_rth.3socket
+s usr/share/man/man3socket/inet_addr.3socket=inet.3socket
+s usr/share/man/man3socket/inet_aton.3socket=inet.3socket
+s usr/share/man/man3socket/inet_lnaof.3socket=inet.3socket
+s usr/share/man/man3socket/inet_makeaddr.3socket=inet.3socket
+s usr/share/man/man3socket/inet_netof.3socket=inet.3socket
+s usr/share/man/man3socket/inet_network.3socket=inet.3socket
+s usr/share/man/man3socket/inet_ntoa.3socket=inet.3socket
+s usr/share/man/man3socket/inet_ntop.3socket=inet.3socket
+s usr/share/man/man3socket/inet_pton.3socket=inet.3socket
+f usr/share/man/man3socket/listen.3socket 0444 root bin
+s usr/share/man/man3socket/ntohl.3socket=byteorder.3socket
+s usr/share/man/man3socket/ntohll.3socket=byteorder.3socket
+s usr/share/man/man3socket/ntohs.3socket=byteorder.3socket
+f usr/share/man/man3socket/rcmd.3socket 0444 root bin
+s usr/share/man/man3socket/rcmd_af.3socket=rcmd.3socket
+f usr/share/man/man3socket/recv.3socket 0444 root bin
+s usr/share/man/man3socket/recvfrom.3socket=recv.3socket
+s usr/share/man/man3socket/recvmsg.3socket=recv.3socket
+f usr/share/man/man3socket/rexec.3socket 0444 root bin
+s usr/share/man/man3socket/rexec_af.3socket=rexec.3socket
+s usr/share/man/man3socket/rresvport.3socket=rcmd.3socket
+s usr/share/man/man3socket/rresvport_af.3socket=rcmd.3socket
+s usr/share/man/man3socket/ruserok.3socket=rcmd.3socket
+f usr/share/man/man3socket/sctp_bindx.3socket 0444 root bin
+s usr/share/man/man3socket/sctp_freeladdrs.3socket=sctp_getladdrs.3socket
+s usr/share/man/man3socket/sctp_freepaddrs.3socket=sctp_getpaddrs.3socket
+f usr/share/man/man3socket/sctp_getladdrs.3socket 0444 root bin
+f usr/share/man/man3socket/sctp_getpaddrs.3socket 0444 root bin
+f usr/share/man/man3socket/sctp_opt_info.3socket 0444 root bin
+f usr/share/man/man3socket/sctp_peeloff.3socket 0444 root bin
+f usr/share/man/man3socket/sctp_recvmsg.3socket 0444 root bin
+f usr/share/man/man3socket/sctp_send.3socket 0444 root bin
+f usr/share/man/man3socket/sctp_sendmsg.3socket 0444 root bin
+f usr/share/man/man3socket/send.3socket 0444 root bin
+s usr/share/man/man3socket/sendmsg.3socket=send.3socket
+s usr/share/man/man3socket/sendto.3socket=send.3socket
+s usr/share/man/man3socket/setipv4sourcefilter.3socket=getsourcefilter.3socket
+s usr/share/man/man3socket/setnetent.3socket=getnetbyname.3socket
+s usr/share/man/man3socket/setprotoent.3socket=getprotobyname.3socket
+s usr/share/man/man3socket/setservent.3socket=getservbyname.3socket
+s usr/share/man/man3socket/setsockopt.3socket=getsockopt.3socket
+s usr/share/man/man3socket/setsourcefilter.3socket=getsourcefilter.3socket
+f usr/share/man/man3socket/shutdown.3socket 0444 root bin
+f usr/share/man/man3socket/socket.3socket 0444 root bin
+f usr/share/man/man3socket/socketpair.3socket 0444 root bin
+f usr/share/man/man3socket/spray.3socket 0444 root bin
+d usr/share/man/man3stmf 0755 root bin
+f usr/share/man/man3stmf/stmfAddToHostGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfAddToTargetGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfAddViewEntry.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfClearProviderData.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfCreateHostGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfCreateLu.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfCreateLuResource.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfCreateTargetGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfDeleteHostGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfDeleteLu.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfDeleteTargetGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfDevidFromIscsiName.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfDevidFromWwn.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfFreeLuResource.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfFreeMemory.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetHostGroupList.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetHostGroupMembers.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetLogicalUnitList.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetLogicalUnitProperties.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetLuResource.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetPersistMethod.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetProviderData.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetProviderDataProt.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetState.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetTargetGroupList.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetTargetGroupMembers.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetTargetList.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetTargetProperties.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfGetViewEntryList.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfModifyLu.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfOfflineLogicalUnit.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfOfflineTarget.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfOnlineLogicalUnit.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfOnlineTarget.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfRemoveFromHostGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfRemoveFromTargetGroup.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfRemoveViewEntry.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfSetLuProp.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfSetPersistMethod.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfSetProviderData.3stmf 0444 root bin
+f usr/share/man/man3stmf/stmfSetProviderDataProt.3stmf 0444 root bin
+d usr/share/man/man3sysevent 0755 root bin
+f usr/share/man/man3sysevent/sysevent_bind_handle.3sysevent 0444 root bin
+f usr/share/man/man3sysevent/sysevent_free.3sysevent 0444 root bin
+f usr/share/man/man3sysevent/sysevent_get_attr_list.3sysevent 0444 root bin
+f usr/share/man/man3sysevent/sysevent_get_class_name.3sysevent 0444 root bin
+s usr/share/man/man3sysevent/sysevent_get_pid.3sysevent=sysevent_get_vendor_name.3sysevent
+s usr/share/man/man3sysevent/sysevent_get_pub_name.3sysevent=sysevent_get_vendor_name.3sysevent
+s usr/share/man/man3sysevent/sysevent_get_seq.3sysevent=sysevent_get_class_name.3sysevent
+s usr/share/man/man3sysevent/sysevent_get_size.3sysevent=sysevent_get_class_name.3sysevent
+s usr/share/man/man3sysevent/sysevent_get_subclass_name.3sysevent=sysevent_get_class_name.3sysevent
+s usr/share/man/man3sysevent/sysevent_get_time.3sysevent=sysevent_get_class_name.3sysevent
+f usr/share/man/man3sysevent/sysevent_get_vendor_name.3sysevent 0444 root bin
+f usr/share/man/man3sysevent/sysevent_post_event.3sysevent 0444 root bin
+f usr/share/man/man3sysevent/sysevent_subscribe_event.3sysevent 0444 root bin
+s usr/share/man/man3sysevent/sysevent_unbind_handle.3sysevent=sysevent_bind_handle.3sysevent
+s usr/share/man/man3sysevent/sysevent_unsubscribe_event.3sysevent=sysevent_subscribe_event.3sysevent
+d usr/share/man/man3tecla 0755 root bin
+s usr/share/man/man3tecla/cfc_file_start.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cfc_literal_escapes.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cfc_set_check_fn.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cpl_add_completion.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cpl_check_exe.3tecla=cpl_complete_word.3tecla
+f usr/share/man/man3tecla/cpl_complete_word.3tecla 0444 root bin
+s usr/share/man/man3tecla/cpl_file_completions.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cpl_last_error.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cpl_list_completions.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cpl_recall_matches.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/cpl_record_error.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/del_CplFileConf.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/del_ExpandFile.3tecla=ef_expand_file.3tecla
+s usr/share/man/man3tecla/del_GetLine.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/del_PathCache.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/del_PcaPathConf.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/del_WordCompletion.3tecla=cpl_complete_word.3tecla
+f usr/share/man/man3tecla/ef_expand_file.3tecla 0444 root bin
+s usr/share/man/man3tecla/ef_last_error.3tecla=ef_expand_file.3tecla
+s usr/share/man/man3tecla/ef_list_expansions.3tecla=ef_expand_file.3tecla
+s usr/share/man/man3tecla/gl_abandon_line.3tecla=gl_io_mode.3tecla
+s usr/share/man/man3tecla/gl_append_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_automatic_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_bind_keyseq.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_catch_blocked.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_change_terminal.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_clear_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_completion_action.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_configure_getline.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_customize_completion.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_display_text.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_echo_mode.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_erase_terminal.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_error_message.3tecla=gl_get_line.3tecla
+f usr/share/man/man3tecla/gl_get_line.3tecla 0444 root bin
+s usr/share/man/man3tecla/gl_group_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_handle_signal.3tecla=gl_io_mode.3tecla
+s usr/share/man/man3tecla/gl_ignore_signal.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_inactivity_timeout.3tecla=gl_get_line.3tecla
+f usr/share/man/man3tecla/gl_io_mode.3tecla 0444 root bin
+s usr/share/man/man3tecla/gl_last_signal.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_limit_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_list_signals.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_load_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_lookup_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_normal_io.3tecla=gl_io_mode.3tecla
+s usr/share/man/man3tecla/gl_pending_io.3tecla=gl_io_mode.3tecla
+s usr/share/man/man3tecla/gl_prompt_style.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_query_char.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_range_of_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_raw_io.3tecla=gl_io_mode.3tecla
+s usr/share/man/man3tecla/gl_read_char.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_register_action.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_replace_prompt.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_resize_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_return_status.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_save_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_set_term_size.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_show_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_size_of_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_state_of_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_terminal_size.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_toggle_history.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_trap_signal.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/gl_tty_signals.3tecla=gl_io_mode.3tecla
+s usr/share/man/man3tecla/gl_watch_fd.3tecla=gl_get_line.3tecla
+f usr/share/man/man3tecla/libtecla_version.3tecla 0444 root bin
+s usr/share/man/man3tecla/new_CplFileConf.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/new_ExpandFile.3tecla=ef_expand_file.3tecla
+s usr/share/man/man3tecla/new_GetLine.3tecla=gl_get_line.3tecla
+s usr/share/man/man3tecla/new_PathCache.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/new_PcaPathConf.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/new_WordCompletion.3tecla=cpl_complete_word.3tecla
+s usr/share/man/man3tecla/pca_last_error.3tecla=pca_lookup_file.3tecla
+f usr/share/man/man3tecla/pca_lookup_file.3tecla 0444 root bin
+s usr/share/man/man3tecla/pca_path_completions.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/pca_scan_path.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/pca_set_check_fn.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/ppc_file_start.3tecla=pca_lookup_file.3tecla
+s usr/share/man/man3tecla/ppc_literal_escapes.3tecla=pca_lookup_file.3tecla
+d usr/share/man/man3tnf 0755 root bin
+f usr/share/man/man3tnf/TNF_DECLARE_RECORD.3tnf 0444 root bin
+f usr/share/man/man3tnf/TNF_PROBE.3tnf 0444 root bin
+f usr/share/man/man3tnf/libtnfctl.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnf_process_disable.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_buffer_alloc.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_close.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_indirect_open.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_internal_open.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_kernel_open.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_pid_open.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_probe_apply.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_probe_state_get.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_register_funcs.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_strerror.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_trace_attrs_get.3tnf 0444 root bin
+f usr/share/man/man3tnf/tnfctl_trace_state_set.3tnf 0444 root bin
+f usr/share/man/man3tnf/tracing.3tnf 0444 root bin
+d usr/share/man/man3uuid 0755 root bin
+f usr/share/man/man3uuid/uuid_clear.3uuid 0444 root bin
+s usr/share/man/man3uuid/uuid_compare.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_copy.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_generate.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_generate_random.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_generate_time.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_is_null.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_parse.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_time.3uuid=uuid_clear.3uuid
+s usr/share/man/man3uuid/uuid_unparse.3uuid=uuid_clear.3uuid
+d usr/share/man/man3volmgt 0755 root bin
+f usr/share/man/man3volmgt/media_findname.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/media_getattr.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/media_getid.3volmgt 0444 root bin
+s usr/share/man/man3volmgt/media_setattr.3volmgt=media_getattr.3volmgt
+f usr/share/man/man3volmgt/volmgt_acquire.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_check.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_feature_enabled.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_inuse.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_ownspath.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_release.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_root.3volmgt 0444 root bin
+f usr/share/man/man3volmgt/volmgt_running.3volmgt 0444 root bin
+s usr/share/man/man3volmgt/volmgt_symdev.3volmgt=volmgt_symname.3volmgt
+f usr/share/man/man3volmgt/volmgt_symname.3volmgt 0444 root bin
+d usr/share/man/man3x11 0755 root bin
+d usr/share/man/man3xau 0755 root bin
+d usr/share/man/man3xaw 0755 root bin
+d usr/share/man/man3xcurses 0755 root bin
+s usr/share/man/man3xcurses/COLORS.3xcurses=can_change_color.3xcurses
+s usr/share/man/man3xcurses/COLOR_PAIR.3xcurses=can_change_color.3xcurses
+s usr/share/man/man3xcurses/COLOR_PAIRS.3xcurses=can_change_color.3xcurses
+f usr/share/man/man3xcurses/COLS.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/LINES.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/PAIR_NUMBER.3xcurses=can_change_color.3xcurses
+f usr/share/man/man3xcurses/add_wch.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/add_wchnstr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/add_wchstr.3xcurses=add_wchnstr.3xcurses
+f usr/share/man/man3xcurses/addch.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/addchnstr.3xcurses=addchstr.3xcurses
+f usr/share/man/man3xcurses/addchstr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/addnstr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/addnwstr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/addstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/addwstr.3xcurses=addnwstr.3xcurses
+f usr/share/man/man3xcurses/attr_get.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/attr_off.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/attr_on.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/attr_set.3xcurses=attr_get.3xcurses
+f usr/share/man/man3xcurses/attroff.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/attron.3xcurses=attroff.3xcurses
+s usr/share/man/man3xcurses/attrset.3xcurses=attroff.3xcurses
+f usr/share/man/man3xcurses/baudrate.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/beep.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/bkgd.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/bkgdset.3xcurses=bkgd.3xcurses
+f usr/share/man/man3xcurses/bkgrnd.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/bkgrndset.3xcurses=bkgrnd.3xcurses
+f usr/share/man/man3xcurses/border.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/border_set.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/box.3xcurses=border.3xcurses
+s usr/share/man/man3xcurses/box_set.3xcurses=border_set.3xcurses
+f usr/share/man/man3xcurses/can_change_color.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/cbreak.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/chgat.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/clear.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/clearok.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/clrtobot.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/clrtoeol.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/color_content.3xcurses=can_change_color.3xcurses
+s usr/share/man/man3xcurses/color_set.3xcurses=attr_get.3xcurses
+f usr/share/man/man3xcurses/copywin.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/cur_term.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/curs_set.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/curscr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/curses.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/def_prog_mode.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/def_shell_mode.3xcurses=def_prog_mode.3xcurses
+f usr/share/man/man3xcurses/del_curterm.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/delay_output.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/delch.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/deleteln.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/delscreen.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/delwin.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/derwin.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/doupdate.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/dupwin.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/echo.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/echo_wchar.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/echochar.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/endwin.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/erase.3xcurses=clear.3xcurses
+f usr/share/man/man3xcurses/erasechar.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/erasewchar.3xcurses=erasechar.3xcurses
+f usr/share/man/man3xcurses/filter.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/flash.3xcurses=beep.3xcurses
+f usr/share/man/man3xcurses/flushinp.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/get_wch.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/get_wstr.3xcurses=getn_wstr.3xcurses
+f usr/share/man/man3xcurses/getbegyx.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/getbkgd.3xcurses=bkgd.3xcurses
+s usr/share/man/man3xcurses/getbkgrnd.3xcurses=bkgrnd.3xcurses
+f usr/share/man/man3xcurses/getcchar.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/getch.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/getmaxyx.3xcurses=getbegyx.3xcurses
+f usr/share/man/man3xcurses/getn_wstr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/getnstr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/getparyx.3xcurses=getbegyx.3xcurses
+s usr/share/man/man3xcurses/getstr.3xcurses=getnstr.3xcurses
+f usr/share/man/man3xcurses/getwin.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/getyx.3xcurses=getbegyx.3xcurses
+f usr/share/man/man3xcurses/halfdelay.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/has_colors.3xcurses=can_change_color.3xcurses
+f usr/share/man/man3xcurses/has_ic.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/has_il.3xcurses=has_ic.3xcurses
+f usr/share/man/man3xcurses/hline.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/hline_set.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/idcok.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/idlok.3xcurses=clearok.3xcurses
+f usr/share/man/man3xcurses/immedok.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/in_wch.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/in_wchnstr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/in_wchstr.3xcurses=in_wchnstr.3xcurses
+f usr/share/man/man3xcurses/inch.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/inchnstr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/inchstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/init_color.3xcurses=can_change_color.3xcurses
+s usr/share/man/man3xcurses/init_pair.3xcurses=can_change_color.3xcurses
+f usr/share/man/man3xcurses/initscr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/innstr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/innwstr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/ins_nwstr.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/ins_wch.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/ins_wstr.3xcurses=ins_nwstr.3xcurses
+f usr/share/man/man3xcurses/insch.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/insdelln.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/insertln.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/insnstr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/insstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/instr.3xcurses=innstr.3xcurses
+f usr/share/man/man3xcurses/intrflush.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/inwstr.3xcurses=innwstr.3xcurses
+f usr/share/man/man3xcurses/is_linetouched.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/is_wintouched.3xcurses=is_linetouched.3xcurses
+s usr/share/man/man3xcurses/isendwin.3xcurses=endwin.3xcurses
+s usr/share/man/man3xcurses/key_name.3xcurses=keyname.3xcurses
+f usr/share/man/man3xcurses/keyname.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/keypad.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/killchar.3xcurses=erasechar.3xcurses
+s usr/share/man/man3xcurses/killwchar.3xcurses=erasechar.3xcurses
+s usr/share/man/man3xcurses/leaveok.3xcurses=clearok.3xcurses
+f usr/share/man/man3xcurses/libcurses.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/longname.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/meta.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/move.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/mvadd_wch.3xcurses=add_wch.3xcurses
+s usr/share/man/man3xcurses/mvadd_wchnstr.3xcurses=add_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvadd_wchstr.3xcurses=add_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvaddch.3xcurses=addch.3xcurses
+s usr/share/man/man3xcurses/mvaddchnstr.3xcurses=addchstr.3xcurses
+s usr/share/man/man3xcurses/mvaddchstr.3xcurses=addchstr.3xcurses
+s usr/share/man/man3xcurses/mvaddnstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/mvaddnwstr.3xcurses=addnwstr.3xcurses
+s usr/share/man/man3xcurses/mvaddstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/mvaddwstr.3xcurses=addnwstr.3xcurses
+s usr/share/man/man3xcurses/mvchgat.3xcurses=chgat.3xcurses
+f usr/share/man/man3xcurses/mvcur.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/mvdelch.3xcurses=delch.3xcurses
+f usr/share/man/man3xcurses/mvderwin.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/mvget_wch.3xcurses=get_wch.3xcurses
+s usr/share/man/man3xcurses/mvget_wstr.3xcurses=getn_wstr.3xcurses
+s usr/share/man/man3xcurses/mvgetch.3xcurses=getch.3xcurses
+s usr/share/man/man3xcurses/mvgetn_wstr.3xcurses=getn_wstr.3xcurses
+s usr/share/man/man3xcurses/mvgetnstr.3xcurses=getnstr.3xcurses
+s usr/share/man/man3xcurses/mvgetstr.3xcurses=getnstr.3xcurses
+s usr/share/man/man3xcurses/mvhline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/mvhline_set.3xcurses=hline_set.3xcurses
+s usr/share/man/man3xcurses/mvin_wch.3xcurses=in_wch.3xcurses
+s usr/share/man/man3xcurses/mvin_wchnstr.3xcurses=in_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvin_wchstr.3xcurses=in_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvinch.3xcurses=inch.3xcurses
+s usr/share/man/man3xcurses/mvinchnstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/mvinchstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/mvinnstr.3xcurses=innstr.3xcurses
+s usr/share/man/man3xcurses/mvinnwstr.3xcurses=innwstr.3xcurses
+s usr/share/man/man3xcurses/mvins_nwstr.3xcurses=ins_nwstr.3xcurses
+s usr/share/man/man3xcurses/mvins_wch.3xcurses=ins_wch.3xcurses
+s usr/share/man/man3xcurses/mvins_wstr.3xcurses=ins_nwstr.3xcurses
+s usr/share/man/man3xcurses/mvinsch.3xcurses=insch.3xcurses
+s usr/share/man/man3xcurses/mvinsnstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/mvinsstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/mvinstr.3xcurses=innstr.3xcurses
+s usr/share/man/man3xcurses/mvinwstr.3xcurses=innwstr.3xcurses
+f usr/share/man/man3xcurses/mvprintw.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/mvscanw.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/mvvline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/mvvline_set.3xcurses=hline_set.3xcurses
+s usr/share/man/man3xcurses/mvwadd_wch.3xcurses=add_wch.3xcurses
+s usr/share/man/man3xcurses/mvwadd_wchnstr.3xcurses=add_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvwadd_wchstr.3xcurses=add_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvwaddch.3xcurses=addch.3xcurses
+s usr/share/man/man3xcurses/mvwaddchnstr.3xcurses=addchstr.3xcurses
+s usr/share/man/man3xcurses/mvwaddchstr.3xcurses=addchstr.3xcurses
+s usr/share/man/man3xcurses/mvwaddnstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/mvwaddnwstr.3xcurses=addnwstr.3xcurses
+s usr/share/man/man3xcurses/mvwaddstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/mvwaddwstr.3xcurses=addnwstr.3xcurses
+s usr/share/man/man3xcurses/mvwchgat.3xcurses=chgat.3xcurses
+s usr/share/man/man3xcurses/mvwdelch.3xcurses=delch.3xcurses
+s usr/share/man/man3xcurses/mvwget_wch.3xcurses=get_wch.3xcurses
+s usr/share/man/man3xcurses/mvwget_wstr.3xcurses=getn_wstr.3xcurses
+s usr/share/man/man3xcurses/mvwgetch.3xcurses=getch.3xcurses
+s usr/share/man/man3xcurses/mvwgetn_wstr.3xcurses=getn_wstr.3xcurses
+s usr/share/man/man3xcurses/mvwgetnstr.3xcurses=getnstr.3xcurses
+s usr/share/man/man3xcurses/mvwgetstr.3xcurses=getnstr.3xcurses
+s usr/share/man/man3xcurses/mvwhline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/mvwhline_set.3xcurses=hline_set.3xcurses
+f usr/share/man/man3xcurses/mvwin.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/mvwin_wch.3xcurses=in_wch.3xcurses
+s usr/share/man/man3xcurses/mvwin_wchnstr.3xcurses=in_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvwin_wchstr.3xcurses=in_wchnstr.3xcurses
+s usr/share/man/man3xcurses/mvwinch.3xcurses=inch.3xcurses
+s usr/share/man/man3xcurses/mvwinchnstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/mvwinchstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/mvwinnstr.3xcurses=innstr.3xcurses
+s usr/share/man/man3xcurses/mvwinnwstr.3xcurses=innwstr.3xcurses
+s usr/share/man/man3xcurses/mvwins_nwstr.3xcurses=ins_nwstr.3xcurses
+s usr/share/man/man3xcurses/mvwins_wch.3xcurses=ins_wch.3xcurses
+s usr/share/man/man3xcurses/mvwins_wstr.3xcurses=ins_nwstr.3xcurses
+s usr/share/man/man3xcurses/mvwinsch.3xcurses=insch.3xcurses
+s usr/share/man/man3xcurses/mvwinsnstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/mvwinsstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/mvwinstr.3xcurses=innstr.3xcurses
+s usr/share/man/man3xcurses/mvwinwstr.3xcurses=innwstr.3xcurses
+s usr/share/man/man3xcurses/mvwprintw.3xcurses=mvprintw.3xcurses
+s usr/share/man/man3xcurses/mvwscanw.3xcurses=mvscanw.3xcurses
+s usr/share/man/man3xcurses/mvwvline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/mvwvline_set.3xcurses=hline_set.3xcurses
+f usr/share/man/man3xcurses/napms.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/newpad.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/newterm.3xcurses=initscr.3xcurses
+s usr/share/man/man3xcurses/newwin.3xcurses=derwin.3xcurses
+f usr/share/man/man3xcurses/nl.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/nocbreak.3xcurses=cbreak.3xcurses
+f usr/share/man/man3xcurses/nodelay.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/noecho.3xcurses=echo.3xcurses
+s usr/share/man/man3xcurses/nonl.3xcurses=nl.3xcurses
+f usr/share/man/man3xcurses/noqiflush.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/noraw.3xcurses=cbreak.3xcurses
+f usr/share/man/man3xcurses/notimeout.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/overlay.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/overwrite.3xcurses=overlay.3xcurses
+s usr/share/man/man3xcurses/pair_content.3xcurses=can_change_color.3xcurses
+s usr/share/man/man3xcurses/pecho_wchar.3xcurses=pechochar.3xcurses
+f usr/share/man/man3xcurses/pechochar.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/pnoutrefresh.3xcurses=newpad.3xcurses
+s usr/share/man/man3xcurses/prefresh.3xcurses=newpad.3xcurses
+s usr/share/man/man3xcurses/printw.3xcurses=mvprintw.3xcurses
+f usr/share/man/man3xcurses/putp.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/putwin.3xcurses=getwin.3xcurses
+s usr/share/man/man3xcurses/qiflush.3xcurses=noqiflush.3xcurses
+s usr/share/man/man3xcurses/raw.3xcurses=cbreak.3xcurses
+f usr/share/man/man3xcurses/redrawwin.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/refresh.3xcurses=doupdate.3xcurses
+s usr/share/man/man3xcurses/reset_prog_mode.3xcurses=def_prog_mode.3xcurses
+s usr/share/man/man3xcurses/reset_shell_mode.3xcurses=def_prog_mode.3xcurses
+f usr/share/man/man3xcurses/resetty.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/restartterm.3xcurses=del_curterm.3xcurses
+f usr/share/man/man3xcurses/ripoffline.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/savetty.3xcurses=resetty.3xcurses
+s usr/share/man/man3xcurses/scanw.3xcurses=mvscanw.3xcurses
+f usr/share/man/man3xcurses/scr_dump.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/scr_init.3xcurses=scr_dump.3xcurses
+s usr/share/man/man3xcurses/scr_restore.3xcurses=scr_dump.3xcurses
+s usr/share/man/man3xcurses/scr_set.3xcurses=scr_dump.3xcurses
+f usr/share/man/man3xcurses/scrl.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/scroll.3xcurses=scrl.3xcurses
+s usr/share/man/man3xcurses/scrollok.3xcurses=clearok.3xcurses
+s usr/share/man/man3xcurses/set_curterm.3xcurses=del_curterm.3xcurses
+f usr/share/man/man3xcurses/set_term.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/setcchar.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/setscrreg.3xcurses=clearok.3xcurses
+s usr/share/man/man3xcurses/setupterm.3xcurses=del_curterm.3xcurses
+s usr/share/man/man3xcurses/slk_attr_off.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_attr_on.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_attr_set.3xcurses=slk_attroff.3xcurses
+f usr/share/man/man3xcurses/slk_attroff.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/slk_attron.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_attrset.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_clear.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_color.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_init.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_label.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_noutrefresh.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_refresh.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_restore.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_set.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_touch.3xcurses=slk_attroff.3xcurses
+s usr/share/man/man3xcurses/slk_wset.3xcurses=slk_attroff.3xcurses
+f usr/share/man/man3xcurses/standend.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/standout.3xcurses=standend.3xcurses
+s usr/share/man/man3xcurses/start_color.3xcurses=can_change_color.3xcurses
+f usr/share/man/man3xcurses/stdscr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/subpad.3xcurses=newpad.3xcurses
+s usr/share/man/man3xcurses/subwin.3xcurses=derwin.3xcurses
+f usr/share/man/man3xcurses/syncok.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/term_attrs.3xcurses=termattrs.3xcurses
+f usr/share/man/man3xcurses/termattrs.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/termname.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/tgetent.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/tgetflag.3xcurses=tgetent.3xcurses
+s usr/share/man/man3xcurses/tgetnum.3xcurses=tgetent.3xcurses
+s usr/share/man/man3xcurses/tgetstr.3xcurses=tgetent.3xcurses
+s usr/share/man/man3xcurses/tgoto.3xcurses=tgetent.3xcurses
+f usr/share/man/man3xcurses/tigetflag.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/tigetnum.3xcurses=tigetflag.3xcurses
+s usr/share/man/man3xcurses/tigetstr.3xcurses=tigetflag.3xcurses
+s usr/share/man/man3xcurses/timeout.3xcurses=notimeout.3xcurses
+s usr/share/man/man3xcurses/touchline.3xcurses=is_linetouched.3xcurses
+s usr/share/man/man3xcurses/touchwin.3xcurses=is_linetouched.3xcurses
+s usr/share/man/man3xcurses/tparm.3xcurses=tigetflag.3xcurses
+s usr/share/man/man3xcurses/tputs.3xcurses=putp.3xcurses
+f usr/share/man/man3xcurses/typeahead.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/unctrl.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/unget_wch.3xcurses=ungetch.3xcurses
+f usr/share/man/man3xcurses/ungetch.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/untouchwin.3xcurses=is_linetouched.3xcurses
+f usr/share/man/man3xcurses/use_env.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/vid_attr.3xcurses=vidattr.3xcurses
+s usr/share/man/man3xcurses/vid_puts.3xcurses=vidattr.3xcurses
+f usr/share/man/man3xcurses/vidattr.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/vidputs.3xcurses=vidattr.3xcurses
+s usr/share/man/man3xcurses/vline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/vline_set.3xcurses=hline_set.3xcurses
+f usr/share/man/man3xcurses/vw_printw.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/vw_scanw.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/vwprintw.3xcurses 0444 root bin
+f usr/share/man/man3xcurses/vwscanw.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/wadd_wch.3xcurses=add_wch.3xcurses
+s usr/share/man/man3xcurses/wadd_wchnstr.3xcurses=add_wchnstr.3xcurses
+s usr/share/man/man3xcurses/wadd_wchstr.3xcurses=add_wchnstr.3xcurses
+s usr/share/man/man3xcurses/waddch.3xcurses=addch.3xcurses
+s usr/share/man/man3xcurses/waddchnstr.3xcurses=addchstr.3xcurses
+s usr/share/man/man3xcurses/waddchstr.3xcurses=addchstr.3xcurses
+s usr/share/man/man3xcurses/waddnstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/waddnwstr.3xcurses=addnwstr.3xcurses
+s usr/share/man/man3xcurses/waddstr.3xcurses=addnstr.3xcurses
+s usr/share/man/man3xcurses/waddwstr.3xcurses=addnwstr.3xcurses
+s usr/share/man/man3xcurses/wattr_get.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/wattr_off.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/wattr_on.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/wattr_set.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/wattroff.3xcurses=attroff.3xcurses
+s usr/share/man/man3xcurses/wattron.3xcurses=attroff.3xcurses
+s usr/share/man/man3xcurses/wattrset.3xcurses=attroff.3xcurses
+s usr/share/man/man3xcurses/wbkgd.3xcurses=bkgd.3xcurses
+s usr/share/man/man3xcurses/wbkgdset.3xcurses=bkgd.3xcurses
+s usr/share/man/man3xcurses/wbkgrnd.3xcurses=bkgrnd.3xcurses
+s usr/share/man/man3xcurses/wbkgrndset.3xcurses=bkgrnd.3xcurses
+s usr/share/man/man3xcurses/wborder.3xcurses=border.3xcurses
+s usr/share/man/man3xcurses/wborder_set.3xcurses=border_set.3xcurses
+s usr/share/man/man3xcurses/wchgat.3xcurses=chgat.3xcurses
+s usr/share/man/man3xcurses/wclear.3xcurses=clear.3xcurses
+s usr/share/man/man3xcurses/wclrtobot.3xcurses=clrtobot.3xcurses
+s usr/share/man/man3xcurses/wclrtoeol.3xcurses=clrtoeol.3xcurses
+s usr/share/man/man3xcurses/wcolor_set.3xcurses=attr_get.3xcurses
+s usr/share/man/man3xcurses/wcursyncup.3xcurses=syncok.3xcurses
+s usr/share/man/man3xcurses/wdelch.3xcurses=delch.3xcurses
+s usr/share/man/man3xcurses/wdeleteln.3xcurses=deleteln.3xcurses
+s usr/share/man/man3xcurses/wecho_wchar.3xcurses=echo_wchar.3xcurses
+s usr/share/man/man3xcurses/wechochar.3xcurses=echochar.3xcurses
+s usr/share/man/man3xcurses/werase.3xcurses=clear.3xcurses
+s usr/share/man/man3xcurses/wget_wch.3xcurses=get_wch.3xcurses
+s usr/share/man/man3xcurses/wget_wstr.3xcurses=getn_wstr.3xcurses
+s usr/share/man/man3xcurses/wgetbkgrnd.3xcurses=bkgrnd.3xcurses
+s usr/share/man/man3xcurses/wgetch.3xcurses=getch.3xcurses
+s usr/share/man/man3xcurses/wgetn_wstr.3xcurses=getn_wstr.3xcurses
+s usr/share/man/man3xcurses/wgetnstr.3xcurses=getnstr.3xcurses
+s usr/share/man/man3xcurses/wgetstr.3xcurses=getnstr.3xcurses
+s usr/share/man/man3xcurses/whline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/whline_set.3xcurses=hline_set.3xcurses
+s usr/share/man/man3xcurses/win_wch.3xcurses=in_wch.3xcurses
+s usr/share/man/man3xcurses/win_wchnstr.3xcurses=in_wchnstr.3xcurses
+s usr/share/man/man3xcurses/win_wchstr.3xcurses=in_wchnstr.3xcurses
+s usr/share/man/man3xcurses/winch.3xcurses=inch.3xcurses
+s usr/share/man/man3xcurses/winchnstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/winchstr.3xcurses=inchnstr.3xcurses
+s usr/share/man/man3xcurses/winnstr.3xcurses=innstr.3xcurses
+s usr/share/man/man3xcurses/winnwstr.3xcurses=innwstr.3xcurses
+s usr/share/man/man3xcurses/wins_nwstr.3xcurses=ins_nwstr.3xcurses
+s usr/share/man/man3xcurses/wins_wch.3xcurses=ins_wch.3xcurses
+s usr/share/man/man3xcurses/wins_wstr.3xcurses=ins_nwstr.3xcurses
+s usr/share/man/man3xcurses/winsch.3xcurses=insch.3xcurses
+s usr/share/man/man3xcurses/winsdelln.3xcurses=insdelln.3xcurses
+s usr/share/man/man3xcurses/winsertln.3xcurses=insertln.3xcurses
+s usr/share/man/man3xcurses/winsnstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/winsstr.3xcurses=insnstr.3xcurses
+s usr/share/man/man3xcurses/winstr.3xcurses=innstr.3xcurses
+s usr/share/man/man3xcurses/winwstr.3xcurses=innwstr.3xcurses
+s usr/share/man/man3xcurses/wmove.3xcurses=move.3xcurses
+s usr/share/man/man3xcurses/wnoutrefresh.3xcurses=doupdate.3xcurses
+s usr/share/man/man3xcurses/wprintw.3xcurses=mvprintw.3xcurses
+s usr/share/man/man3xcurses/wredrawln.3xcurses=redrawwin.3xcurses
+s usr/share/man/man3xcurses/wrefresh.3xcurses=doupdate.3xcurses
+s usr/share/man/man3xcurses/wscanw.3xcurses=mvscanw.3xcurses
+s usr/share/man/man3xcurses/wscrl.3xcurses=scrl.3xcurses
+s usr/share/man/man3xcurses/wsetscrreg.3xcurses=clearok.3xcurses
+s usr/share/man/man3xcurses/wstandend.3xcurses=standend.3xcurses
+s usr/share/man/man3xcurses/wstandout.3xcurses=standend.3xcurses
+s usr/share/man/man3xcurses/wsyncdown.3xcurses=syncok.3xcurses
+s usr/share/man/man3xcurses/wsyncup.3xcurses=syncok.3xcurses
+s usr/share/man/man3xcurses/wtimeout.3xcurses=notimeout.3xcurses
+s usr/share/man/man3xcurses/wtouchln.3xcurses=is_linetouched.3xcurses
+f usr/share/man/man3xcurses/wunctrl.3xcurses 0444 root bin
+s usr/share/man/man3xcurses/wvline.3xcurses=hline.3xcurses
+s usr/share/man/man3xcurses/wvline_set.3xcurses=hline_set.3xcurses
+d usr/share/man/man3xext 0755 root bin
+d usr/share/man/man3xmu 0755 root bin
+d usr/share/man/man3xnet 0755 root bin
+f usr/share/man/man3xnet/accept.3xnet 0444 root bin
+f usr/share/man/man3xnet/bind.3xnet 0444 root bin
+f usr/share/man/man3xnet/connect.3xnet 0444 root bin
+f usr/share/man/man3xnet/endhostent.3xnet 0444 root bin
+f usr/share/man/man3xnet/endnetent.3xnet 0444 root bin
+f usr/share/man/man3xnet/endprotoent.3xnet 0444 root bin
+f usr/share/man/man3xnet/endservent.3xnet 0444 root bin
+f usr/share/man/man3xnet/freeaddrinfo.3xnet 0444 root bin
+f usr/share/man/man3xnet/gai_strerror.3xnet 0444 root bin
+s usr/share/man/man3xnet/getaddrinfo.3xnet=freeaddrinfo.3xnet
+s usr/share/man/man3xnet/gethostbyaddr.3xnet=endhostent.3xnet
+s usr/share/man/man3xnet/gethostbyname.3xnet=endhostent.3xnet
+s usr/share/man/man3xnet/gethostent.3xnet=endhostent.3xnet
+f usr/share/man/man3xnet/gethostname.3xnet 0444 root bin
+f usr/share/man/man3xnet/getnameinfo.3xnet 0444 root bin
+s usr/share/man/man3xnet/getnetbyaddr.3xnet=endnetent.3xnet
+s usr/share/man/man3xnet/getnetbyname.3xnet=endnetent.3xnet
+s usr/share/man/man3xnet/getnetent.3xnet=endnetent.3xnet
+f usr/share/man/man3xnet/getpeername.3xnet 0444 root bin
+s usr/share/man/man3xnet/getprotobyname.3xnet=endprotoent.3xnet
+s usr/share/man/man3xnet/getprotobynumber.3xnet=endprotoent.3xnet
+s usr/share/man/man3xnet/getprotoent.3xnet=endprotoent.3xnet
+s usr/share/man/man3xnet/getservbyname.3xnet=endservent.3xnet
+s usr/share/man/man3xnet/getservbyport.3xnet=endservent.3xnet
+s usr/share/man/man3xnet/getservent.3xnet=endservent.3xnet
+f usr/share/man/man3xnet/getsockname.3xnet 0444 root bin
+f usr/share/man/man3xnet/getsockopt.3xnet 0444 root bin
+f usr/share/man/man3xnet/htonl.3xnet 0444 root bin
+s usr/share/man/man3xnet/htonll.3xnet=htonl.3xnet
+s usr/share/man/man3xnet/htons.3xnet=htonl.3xnet
+s usr/share/man/man3xnet/if_freenameindex.3xnet=if_nametoindex.3xnet
+s usr/share/man/man3xnet/if_indextoname.3xnet=if_nametoindex.3xnet
+s usr/share/man/man3xnet/if_nameindex.3xnet=if_nametoindex.3xnet
+f usr/share/man/man3xnet/if_nametoindex.3xnet 0444 root bin
+f usr/share/man/man3xnet/inet_addr.3xnet 0444 root bin
+s usr/share/man/man3xnet/inet_lnaof.3xnet=inet_addr.3xnet
+s usr/share/man/man3xnet/inet_makeaddr.3xnet=inet_addr.3xnet
+s usr/share/man/man3xnet/inet_netof.3xnet=inet_addr.3xnet
+s usr/share/man/man3xnet/inet_network.3xnet=inet_addr.3xnet
+s usr/share/man/man3xnet/inet_ntoa.3xnet=inet_addr.3xnet
+f usr/share/man/man3xnet/inet_ntop.3xnet 0444 root bin
+s usr/share/man/man3xnet/inet_pton.3xnet=inet_ntop.3xnet
+f usr/share/man/man3xnet/listen.3xnet 0444 root bin
+s usr/share/man/man3xnet/ntohl.3xnet=htonl.3xnet
+s usr/share/man/man3xnet/ntohll.3xnet=htonl.3xnet
+s usr/share/man/man3xnet/ntohs.3xnet=htonl.3xnet
+f usr/share/man/man3xnet/recv.3xnet 0444 root bin
+f usr/share/man/man3xnet/recvfrom.3xnet 0444 root bin
+f usr/share/man/man3xnet/recvmsg.3xnet 0444 root bin
+f usr/share/man/man3xnet/send.3xnet 0444 root bin
+f usr/share/man/man3xnet/sendmsg.3xnet 0444 root bin
+f usr/share/man/man3xnet/sendto.3xnet 0444 root bin
+s usr/share/man/man3xnet/sethostent.3xnet=endhostent.3xnet
+s usr/share/man/man3xnet/setnetent.3xnet=endnetent.3xnet
+s usr/share/man/man3xnet/setprotoent.3xnet=endprotoent.3xnet
+s usr/share/man/man3xnet/setservent.3xnet=endservent.3xnet
+f usr/share/man/man3xnet/setsockopt.3xnet 0444 root bin
+f usr/share/man/man3xnet/shutdown.3xnet 0444 root bin
+f usr/share/man/man3xnet/sockatmark.3xnet 0444 root bin
+f usr/share/man/man3xnet/socket.3xnet 0444 root bin
+f usr/share/man/man3xnet/socketpair.3xnet 0444 root bin
+d usr/share/man/man4 0755 root bin
+f usr/share/man/man4/Intro.4 0444 root bin
+f usr/share/man/man4/NISLDAPmapping.4 0444 root bin
+f usr/share/man/man4/TIMEZONE.4 0444 root bin
+f usr/share/man/man4/a.out.4 0444 root bin
+s usr/share/man/man4/addresses.4=aliases.4
+f usr/share/man/man4/admin.4 0444 root bin
+f usr/share/man/man4/alias.4 0444 root bin
+f usr/share/man/man4/aliases.4 0444 root bin
+f usr/share/man/man4/au.4 0444 root bin
+f usr/share/man/man4/audit.log.4 0444 root bin
+f usr/share/man/man4/audit_class.4 0444 root bin
+f usr/share/man/man4/audit_control.4 0444 root bin
+f usr/share/man/man4/audit_event.4 0444 root bin
+f usr/share/man/man4/audit_user.4 0444 root bin
+f usr/share/man/man4/auth_attr.4 0444 root bin
+f usr/share/man/man4/autofs.4 0444 root bin
+f usr/share/man/man4/bart_manifest.4 0444 root bin
+f usr/share/man/man4/bart_rules.4 0444 root bin
+f usr/share/man/man4/bootparams.4 0444 root bin
+f usr/share/man/man4/cardbus.4 0444 root bin
+f usr/share/man/man4/compver.4 0444 root bin
+f usr/share/man/man4/contents.4 0444 root bin
+f usr/share/man/man4/contract.4 0444 root bin
+f usr/share/man/man4/copyright.4 0444 root bin
+f usr/share/man/man4/core.4 0444 root bin
+f usr/share/man/man4/crypt.conf.4 0444 root bin
+f usr/share/man/man4/crypto_certs.4 0444 root bin
+f usr/share/man/man4/d_passwd.4 0444 root bin
+f usr/share/man/man4/dacf.conf.4 0444 root bin
+f usr/share/man/man4/dat.conf.4 0444 root bin
+f usr/share/man/man4/default_fs.4 0444 root bin
+f usr/share/man/man4/defaultdomain.4 0444 root bin
+f usr/share/man/man4/defaultrouter.4 0444 root bin
+f usr/share/man/man4/depend.4 0444 root bin
+f usr/share/man/man4/device_allocate.4 0444 root bin
+f usr/share/man/man4/device_contract.4 0444 root bin
+f usr/share/man/man4/device_maps.4 0444 root bin
+f usr/share/man/man4/devices.4 0444 root bin
+s usr/share/man/man4/devid_cache.4=devices.4
+s usr/share/man/man4/devname_cache.4=devices.4
+f usr/share/man/man4/dfstab.4 0444 root bin
+f usr/share/man/man4/dhcp_inittab.4 0444 root bin
+f usr/share/man/man4/dhcp_network.4 0444 root bin
+f usr/share/man/man4/dhcpsvc.conf.4 0444 root bin
+f usr/share/man/man4/dhcptab.4 0444 root bin
+f usr/share/man/man4/dialups.4 0444 root bin
+s usr/share/man/man4/dir.4=dir_ufs.4
+f usr/share/man/man4/dir_ufs.4 0444 root bin
+f usr/share/man/man4/driver.conf.4 0444 root bin
+f usr/share/man/man4/ds.log.4 0444 root bin
+s usr/share/man/man4/dumpdates.4=ufsdump.4
+f usr/share/man/man4/ethers.4 0444 root bin
+f usr/share/man/man4/exec_attr.4 0444 root bin
+s usr/share/man/man4/fbtab.4=logindevperm.4
+f usr/share/man/man4/fdi.4 0444 root bin
+f usr/share/man/man4/format.dat.4 0444 root bin
+s usr/share/man/man4/forward.4=aliases.4
+s usr/share/man/man4/fs.4=default_fs.4
+f usr/share/man/man4/fspec.4 0444 root bin
+f usr/share/man/man4/fstypes.4 0444 root bin
+f usr/share/man/man4/ftp.4 0444 root bin
+f usr/share/man/man4/ftpaccess.4 0444 root bin
+f usr/share/man/man4/ftpconversions.4 0444 root bin
+f usr/share/man/man4/ftpgroups.4 0444 root bin
+f usr/share/man/man4/ftphosts.4 0444 root bin
+f usr/share/man/man4/ftpservers.4 0444 root bin
+f usr/share/man/man4/ftpusers.4 0444 root bin
+f usr/share/man/man4/fx_dptbl.4 0444 root bin
+f usr/share/man/man4/gateways.4 0444 root bin
+f usr/share/man/man4/group.4 0444 root bin
+f usr/share/man/man4/gsscred.conf.4 0444 root bin
+f usr/share/man/man4/hba.conf.4 0444 root bin
+f usr/share/man/man4/holidays.4 0444 root bin
+f usr/share/man/man4/hosts.4 0444 root bin
+s usr/share/man/man4/hosts.allow.4=hosts_access.4
+s usr/share/man/man4/hosts.deny.4=hosts_access.4
+f usr/share/man/man4/hosts.equiv.4 0444 root bin
+f usr/share/man/man4/hosts_access.4 0444 root bin
+f usr/share/man/man4/hosts_options.4 0444 root bin
+f usr/share/man/man4/ib.4 0444 root bin
+f usr/share/man/man4/ike.config.4 0444 root bin
+f usr/share/man/man4/ike.preshared.4 0444 root bin
+f usr/share/man/man4/inet_type.4 0444 root bin
+f usr/share/man/man4/inetd.conf.4 0444 root bin
+f usr/share/man/man4/init.d.4 0444 root bin
+f usr/share/man/man4/inittab.4 0444 root bin
+s usr/share/man/man4/intro.4=Intro.4
+f usr/share/man/man4/ipaddrsel.conf.4 0444 root bin
+f usr/share/man/man4/ipnodes.4 0444 root bin
+s usr/share/man/man4/isa.4=sysbus.4
+f usr/share/man/man4/issue.4 0444 root bin
+f usr/share/man/man4/kadm5.acl.4 0444 root bin
+f usr/share/man/man4/kdc.conf.4 0444 root bin
+f usr/share/man/man4/keytables.4 0444 root bin
+f usr/share/man/man4/krb5.conf.4 0444 root bin
+f usr/share/man/man4/ldapfilter.conf.4 0444 root bin
+f usr/share/man/man4/ldapsearchprefs.conf.4 0444 root bin
+f usr/share/man/man4/ldaptemplates.conf.4 0444 root bin
+f usr/share/man/man4/logadm.conf.4 0444 root bin
+f usr/share/man/man4/logindevperm.4 0444 root bin
+f usr/share/man/man4/loginlog.4 0444 root bin
+f usr/share/man/man4/magic.4 0444 root bin
+f usr/share/man/man4/md.tab.4 0444 root bin
+f usr/share/man/man4/mddb.cf.4 0444 root bin
+s usr/share/man/man4/mdi_ib_cache.4=devices.4
+s usr/share/man/man4/mdi_scsi_vhci_cache.4=devices.4
+f usr/share/man/man4/mech.4 0444 root bin
+f usr/share/man/man4/meddb.4 0444 root bin
+f usr/share/man/man4/mnttab.4 0444 root bin
+f usr/share/man/man4/mod_ipp.4 0444 root bin
+f usr/share/man/man4/mpapi.conf.4 0444 root bin
+f usr/share/man/man4/nca.if.4 0444 root bin
+f usr/share/man/man4/ncad_addr.4 0444 root bin
+f usr/share/man/man4/ncakmod.conf.4 0444 root bin
+f usr/share/man/man4/ncalogd.conf.4 0444 root bin
+f usr/share/man/man4/ncaport.conf.4 0444 root bin
+f usr/share/man/man4/ndmp.4 0444 root bin
+f usr/share/man/man4/ndpd.conf.4 0444 root bin
+f usr/share/man/man4/netconfig.4 0444 root bin
+f usr/share/man/man4/netgroup.4 0444 root bin
+f usr/share/man/man4/netid.4 0444 root bin
+f usr/share/man/man4/netmasks.4 0444 root bin
+f usr/share/man/man4/netrc.4 0444 root bin
+f usr/share/man/man4/networks.4 0444 root bin
+f usr/share/man/man4/nfs.4 0444 root bin
+f usr/share/man/man4/nfslog.conf.4 0444 root bin
+f usr/share/man/man4/nfssec.conf.4 0444 root bin
+f usr/share/man/man4/nodename.4 0444 root bin
+f usr/share/man/man4/nologin.4 0444 root bin
+f usr/share/man/man4/note.4 0444 root bin
+f usr/share/man/man4/notrouter.4 0444 root bin
+f usr/share/man/man4/nscd.conf.4 0444 root bin
+f usr/share/man/man4/nsmbrc.4 0444 root bin
+f usr/share/man/man4/nss.4 0444 root bin
+f usr/share/man/man4/nsswitch.conf.4 0444 root bin
+f usr/share/man/man4/packingrules.4 0444 root bin
+f usr/share/man/man4/pam.conf.4 0444 root bin
+f usr/share/man/man4/passwd.4 0444 root bin
+f usr/share/man/man4/path_to_inst.4 0444 root bin
+f usr/share/man/man4/pci.4 0444 root bin
+s usr/share/man/man4/pci_unitaddr_persistent.4=devices.4
+s usr/share/man/man4/pcie.4=pci.4
+f usr/share/man/man4/phones.4 0444 root bin
+f usr/share/man/man4/pkginfo.4 0444 root bin
+f usr/share/man/man4/pkgmap.4 0444 root bin
+f usr/share/man/man4/policy.conf.4 0444 root bin
+f usr/share/man/man4/power.conf.4 0444 root bin
+f usr/share/man/man4/printers.4 0444 root bin
+f usr/share/man/man4/printers.conf.4 0444 root bin
+f usr/share/man/man4/priv_names.4 0444 root bin
+f usr/share/man/man4/proc.4 0444 root bin
+f usr/share/man/man4/process.4 0444 root bin
+f usr/share/man/man4/prof_attr.4 0444 root bin
+f usr/share/man/man4/profile.4 0444 root bin
+f usr/share/man/man4/project.4 0444 root bin
+f usr/share/man/man4/protocols.4 0444 root bin
+f usr/share/man/man4/prototype.4 0444 root bin
+f usr/share/man/man4/pseudo.4 0444 root bin
+f usr/share/man/man4/publickey.4 0444 root bin
+s usr/share/man/man4/qop.4=mech.4
+f usr/share/man/man4/queuedefs.4 0444 root bin
+f usr/share/man/man4/rcmscript.4 0444 root bin
+f usr/share/man/man4/rdc.cf.4 0444 root bin
+f usr/share/man/man4/remote.4 0444 root bin
+f usr/share/man/man4/resolv.conf.4 0444 root bin
+f usr/share/man/man4/rmtab.4 0444 root bin
+f usr/share/man/man4/rpc.4 0444 root bin
+f usr/share/man/man4/rt_dptbl.4 0444 root bin
+f usr/share/man/man4/sasl_appname.conf.4 0444 root bin
+f usr/share/man/man4/scsi.4 0444 root bin
+f usr/share/man/man4/securenets.4 0444 root bin
+f usr/share/man/man4/sel_config.4 0444 root bin
+f usr/share/man/man4/sendmail.4 0444 root bin
+s usr/share/man/man4/sendmail.cf.4=sendmail.4
+f usr/share/man/man4/service_bundle.4 0444 root bin
+f usr/share/man/man4/service_provider.conf.4 0444 root bin
+f usr/share/man/man4/services.4 0444 root bin
+f usr/share/man/man4/shadow.4 0444 root bin
+f usr/share/man/man4/sharetab.4 0444 root bin
+f usr/share/man/man4/shells.4 0444 root bin
+f usr/share/man/man4/slp.conf.4 0444 root bin
+f usr/share/man/man4/slpd.reg.4 0444 root bin
+f usr/share/man/man4/smb.4 0444 root bin
+f usr/share/man/man4/smbautohome.4 0444 root bin
+f usr/share/man/man4/smhba.conf.4 0444 root bin
+s usr/share/man/man4/snapshot_cache.4=devices.4
+f usr/share/man/man4/sndr.4 0444 root bin
+f usr/share/man/man4/sock2path.4 0444 root bin
+f usr/share/man/man4/space.4 0444 root bin
+f usr/share/man/man4/ssh_config.4 0444 root bin
+f usr/share/man/man4/sshd_config.4 0444 root bin
+s usr/share/man/man4/submit.cf.4=sendmail.4
+f usr/share/man/man4/sulog.4 0444 root bin
+f usr/share/man/man4/sysbus.4 0444 root bin
+f usr/share/man/man4/syslog.conf.4 0444 root bin
+f usr/share/man/man4/system.4 0444 root bin
+f usr/share/man/man4/term.4 0444 root bin
+f usr/share/man/man4/terminfo.4 0444 root bin
+f usr/share/man/man4/timezone.4 0444 root bin
+f usr/share/man/man4/tnf_kernel_probes.4 0444 root bin
+f usr/share/man/man4/ts_dptbl.4 0444 root bin
+f usr/share/man/man4/ttydefs.4 0444 root bin
+f usr/share/man/man4/ttysrch.4 0444 root bin
+f usr/share/man/man4/ufsdump.4 0444 root bin
+f usr/share/man/man4/updaters.4 0444 root bin
+f usr/share/man/man4/user_attr.4 0444 root bin
+f usr/share/man/man4/utmp.4 0444 root bin
+f usr/share/man/man4/utmpx.4 0444 root bin
+f usr/share/man/man4/vfstab.4 0444 root bin
+f usr/share/man/man4/volume-config.4 0444 root bin
+f usr/share/man/man4/volume-request.4 0444 root bin
+f usr/share/man/man4/warn.conf.4 0444 root bin
+s usr/share/man/man4/wtmp.4=utmp.4
+s usr/share/man/man4/wtmpx.4=utmpx.4
+f usr/share/man/man4/xferlog.4 0444 root bin
+f usr/share/man/man4/ypfiles.4 0444 root bin
+f usr/share/man/man4/yppasswdd.4 0444 root bin
+f usr/share/man/man4/ypserv.4 0444 root bin
+f usr/share/man/man4/zoneinfo.4 0444 root bin
+d usr/share/man/man4b 0755 root bin
+d usr/share/man/man5 0755 root bin
+s usr/share/man/man5/ANSI.5=standards.5
+s usr/share/man/man5/C++.5=standards.5
+s usr/share/man/man5/C.5=standards.5
+s usr/share/man/man5/CSI.5=attributes.5
+s usr/share/man/man5/ISO.5=standards.5
+f usr/share/man/man5/Intro.5 0444 root bin
+s usr/share/man/man5/MT-Level.5=attributes.5
+s usr/share/man/man5/POSIX.1.5=standards.5
+s usr/share/man/man5/POSIX.2.5=standards.5
+s usr/share/man/man5/POSIX.5=standards.5
+s usr/share/man/man5/RBAC.5=rbac.5
+s usr/share/man/man5/SUS.5=standards.5
+s usr/share/man/man5/SUSv2.5=standards.5
+s usr/share/man/man5/SUSv3.5=standards.5
+s usr/share/man/man5/SVID.5=standards.5
+s usr/share/man/man5/SVID3.5=standards.5
+s usr/share/man/man5/XNS.5=standards.5
+s usr/share/man/man5/XNS4.5=standards.5
+s usr/share/man/man5/XNS5.5=standards.5
+s usr/share/man/man5/XPG.5=standards.5
+s usr/share/man/man5/XPG3.5=standards.5
+s usr/share/man/man5/XPG4.5=standards.5
+s usr/share/man/man5/XPG4v2.5=standards.5
+f usr/share/man/man5/acl.5 0444 root bin
+f usr/share/man/man5/ad.5 0444 root bin
+s usr/share/man/man5/advance.5=regexp.5
+s usr/share/man/man5/architecture.5=attributes.5
+f usr/share/man/man5/ascii.5 0444 root bin
+f usr/share/man/man5/attributes.5 0444 root bin
+f usr/share/man/man5/audit_binfile.5 0444 root bin
+f usr/share/man/man5/audit_remote.5 0444 root bin
+f usr/share/man/man5/audit_syslog.5 0444 root bin
+s usr/share/man/man5/availability.5=attributes.5
+f usr/share/man/man5/brands.5 0444 root bin
+f usr/share/man/man5/cancellation.5 0444 root bin
+f usr/share/man/man5/charmap.5 0444 root bin
+s usr/share/man/man5/compile.5=regexp.5
+f usr/share/man/man5/condition.5 0444 root bin
+f usr/share/man/man5/crypt_bsdbf.5 0444 root bin
+f usr/share/man/man5/crypt_bsdmd5.5 0444 root bin
+f usr/share/man/man5/crypt_sha256.5 0444 root bin
+f usr/share/man/man5/crypt_sha512.5 0444 root bin
+f usr/share/man/man5/crypt_sunmd5.5 0444 root bin
+f usr/share/man/man5/crypt_unix.5 0444 root bin
+f usr/share/man/man5/device_clean.5 0444 root bin
+f usr/share/man/man5/dhcp.5 0444 root bin
+f usr/share/man/man5/dhcp_modules.5 0444 root bin
+f usr/share/man/man5/environ.5 0444 root bin
+f usr/share/man/man5/eqnchar.5 0444 root bin
+f usr/share/man/man5/extendedFILE.5 0444 root bin
+f usr/share/man/man5/filesystem.5 0444 root bin
+f usr/share/man/man5/fnmatch.5 0444 root bin
+f usr/share/man/man5/formats.5 0444 root bin
+f usr/share/man/man5/fsattr.5 0444 root bin
+f usr/share/man/man5/grub.5 0444 root bin
+f usr/share/man/man5/gss_auth_rules.5 0444 root bin
+f usr/share/man/man5/iconv.5 0444 root bin
+f usr/share/man/man5/iconv_unicode.5 0444 root bin
+f usr/share/man/man5/ieee802.11.5 0444 root bin
+s usr/share/man/man5/intro.5=Intro.5
+f usr/share/man/man5/ipfilter.5 0444 root bin
+f usr/share/man/man5/isalist.5 0444 root bin
+f usr/share/man/man5/kerberos.5 0444 root bin
+f usr/share/man/man5/krb5_auth_rules.5 0444 root bin
+f usr/share/man/man5/krb5envvar.5 0444 root bin
+f usr/share/man/man5/largefile.5 0444 root bin
+f usr/share/man/man5/lf64.5 0444 root bin
+f usr/share/man/man5/lfcompile.5 0444 root bin
+f usr/share/man/man5/lfcompile64.5 0444 root bin
+f usr/share/man/man5/locale.5 0444 root bin
+f usr/share/man/man5/man.5 0444 root bin
+f usr/share/man/man5/mansun.5 0444 root bin
+f usr/share/man/man5/me.5 0444 root bin
+f usr/share/man/man5/mech_spnego.5 0444 root bin
+f usr/share/man/man5/mm.5 0444 root bin
+f usr/share/man/man5/ms.5 0444 root bin
+f usr/share/man/man5/mutex.5 0444 root bin
+f usr/share/man/man5/nfssec.5 0444 root bin
+f usr/share/man/man5/pam_allow.5 0444 root bin
+f usr/share/man/man5/pam_authtok_check.5 0444 root bin
+f usr/share/man/man5/pam_authtok_get.5 0444 root bin
+f usr/share/man/man5/pam_authtok_store.5 0444 root bin
+f usr/share/man/man5/pam_deny.5 0444 root bin
+f usr/share/man/man5/pam_dhkeys.5 0444 root bin
+f usr/share/man/man5/pam_dial_auth.5 0444 root bin
+f usr/share/man/man5/pam_krb5.5 0444 root bin
+f usr/share/man/man5/pam_krb5_migrate.5 0444 root bin
+f usr/share/man/man5/pam_ldap.5 0444 root bin
+f usr/share/man/man5/pam_list.5 0444 root bin
+f usr/share/man/man5/pam_passwd_auth.5 0444 root bin
+f usr/share/man/man5/pam_rhosts_auth.5 0444 root bin
+f usr/share/man/man5/pam_roles.5 0444 root bin
+f usr/share/man/man5/pam_sample.5 0444 root bin
+f usr/share/man/man5/pam_smb_passwd.5 0444 root bin
+f usr/share/man/man5/pam_smbfs_login.5 0444 root bin
+f usr/share/man/man5/pam_unix_account.5 0444 root bin
+f usr/share/man/man5/pam_unix_auth.5 0444 root bin
+f usr/share/man/man5/pam_unix_cred.5 0444 root bin
+f usr/share/man/man5/pam_unix_session.5 0444 root bin
+f usr/share/man/man5/pkcs11_kernel.5 0444 root bin
+f usr/share/man/man5/pkcs11_softtoken.5 0444 root bin
+f usr/share/man/man5/privileges.5 0444 root bin
+f usr/share/man/man5/prof.5 0444 root bin
+s usr/share/man/man5/pthreads.5=threads.5
+f usr/share/man/man5/rbac.5 0444 root bin
+f usr/share/man/man5/regex.5 0444 root bin
+f usr/share/man/man5/regexp.5 0444 root bin
+f usr/share/man/man5/resource_controls.5 0444 root bin
+f usr/share/man/man5/smf.5 0444 root bin
+f usr/share/man/man5/smf_bootstrap.5 0444 root bin
+f usr/share/man/man5/smf_method.5 0444 root bin
+f usr/share/man/man5/smf_restarter.5 0444 root bin
+f usr/share/man/man5/smf_security.5 0444 root bin
+f usr/share/man/man5/smf_template.5 0444 root bin
+s usr/share/man/man5/stability.5=attributes.5
+s usr/share/man/man5/standard.5=attributes.5
+f usr/share/man/man5/standards.5 0444 root bin
+s usr/share/man/man5/step.5=regexp.5
+f usr/share/man/man5/sticky.5 0444 root bin
+f usr/share/man/man5/tecla.5 0444 root bin
+s usr/share/man/man5/teclarc.5=tecla.5
+f usr/share/man/man5/term.5 0444 root bin
+f usr/share/man/man5/threads.5 0444 root bin
+f usr/share/man/man5/vgrindefs.5 0444 root bin
+f usr/share/man/man5/zones.5 0444 root bin
+f usr/share/man/man5/zpool-features.5 0444 root bin
+d usr/share/man/man7 0755 root bin
+f usr/share/man/man7/FSS.7 0444 root bin
+f usr/share/man/man7/Intro.7 0444 root bin
+f usr/share/man/man7/cpr.7 0444 root bin
+s usr/share/man/man7/intro.7=Intro.7
+d usr/share/man/man7d 0755 root bin
+s usr/share/man/man7d/1394.7d=ieee1394.7d
+f usr/share/man/man7d/aac.7d 0444 root bin
+f usr/share/man/man7d/afe.7d 0444 root bin
+f usr/share/man/man7d/ahci.7d 0444 root bin
+s usr/share/man/man7d/allkmem.7d=mem.7d
+f usr/share/man/man7d/amd8111s.7d 0444 root bin
+f usr/share/man/man7d/amr.7d 0444 root bin
+f usr/share/man/man7d/arcmsr.7d 0444 root bin
+f usr/share/man/man7d/asy.7d 0444 root bin
+f usr/share/man/man7d/ata.7d 0444 root bin
+f usr/share/man/man7d/atge.7d 0444 root bin
+f usr/share/man/man7d/bcm_sata.7d 0444 root bin
+f usr/share/man/man7d/bfe.7d 0444 root bin
+f usr/share/man/man7d/bge.7d 0444 root bin
+f usr/share/man/man7d/chxge.7d 0444 root bin
+f usr/share/man/man7d/cmdk.7d 0444 root bin
+f usr/share/man/man7d/cpqary3.7d 0444 root bin
+f usr/share/man/man7d/cpuid.7d 0444 root bin
+f usr/share/man/man7d/devinfo.7d 0444 root bin
+f usr/share/man/man7d/dmfe.7d 0444 root bin
+f usr/share/man/man7d/dnet.7d 0444 root bin
+f usr/share/man/man7d/dtrace.7d 0444 root bin
+f usr/share/man/man7d/ehci.7d 0444 root bin
+f usr/share/man/man7d/fasttrap.7d 0444 root bin
+f usr/share/man/man7d/fbt.7d 0444 root bin
+f usr/share/man/man7d/fctl.7d 0444 root bin
+f usr/share/man/man7d/fd.7d 0444 root bin
+s usr/share/man/man7d/fdc.7d=fd.7d
+s usr/share/man/man7d/firewire.7d=ieee1394.7d
+f usr/share/man/man7d/fp.7d 0444 root bin
+f usr/share/man/man7d/gld.7d 0444 root bin
+f usr/share/man/man7d/hci1394.7d 0444 root bin
+f usr/share/man/man7d/heci.7d 0444 root bin
+f usr/share/man/man7d/hid.7d 0444 root bin
+f usr/share/man/man7d/hubd.7d 0444 root bin
+s usr/share/man/man7d/hwa1480_fw.7d=wusb_df.7d
+f usr/share/man/man7d/hwahc.7d 0444 root bin
+f usr/share/man/man7d/hwarc.7d 0444 root bin
+f usr/share/man/man7d/hxge.7d 0444 root bin
+f usr/share/man/man7d/ieee1394.7d 0444 root bin
+f usr/share/man/man7d/igb.7d 0444 root bin
+f usr/share/man/man7d/ipmi.7d 0444 root bin
+f usr/share/man/man7d/ipnet.7d 0444 root bin
+f usr/share/man/man7d/iscsi.7d 0444 root bin
+f usr/share/man/man7d/ixgbe.7d 0444 root bin
+f usr/share/man/man7d/kmdb.7d 0444 root bin
+s usr/share/man/man7d/kmem.7d=mem.7d
+f usr/share/man/man7d/kstat.7d 0444 root bin
+f usr/share/man/man7d/ksyms.7d 0444 root bin
+f usr/share/man/man7d/llc1.7d 0444 root bin
+s usr/share/man/man7d/lo0.7d=ipnet.7d
+f usr/share/man/man7d/lockstat.7d 0444 root bin
+f usr/share/man/man7d/lofi.7d 0444 root bin
+f usr/share/man/man7d/log.7d 0444 root bin
+f usr/share/man/man7d/mega_sas.7d 0444 root bin
+f usr/share/man/man7d/mem.7d 0444 root bin
+f usr/share/man/man7d/mpt_sas.7d 0444 root bin
+f usr/share/man/man7d/mr_sas.7d 0444 root bin
+f usr/share/man/man7d/msglog.7d 0444 root bin
+f usr/share/man/man7d/mt.7d 0444 root bin
+f usr/share/man/man7d/mxfe.7d 0444 root bin
+f usr/share/man/man7d/myri10ge.7d 0444 root bin
+f usr/share/man/man7d/npe.7d 0444 root bin
+f usr/share/man/man7d/ntxn.7d 0444 root bin
+f usr/share/man/man7d/null.7d 0444 root bin
+f usr/share/man/man7d/nulldriver.7d 0444 root bin
+f usr/share/man/man7d/nv_sata.7d 0444 root bin
+f usr/share/man/man7d/nxge.7d 0444 root bin
+f usr/share/man/man7d/ohci.7d 0444 root bin
+f usr/share/man/man7d/openprom.7d 0444 root bin
+f usr/share/man/man7d/pcn.7d 0444 root bin
+f usr/share/man/man7d/physmem.7d 0444 root bin
+f usr/share/man/man7d/pm.7d 0444 root bin
+f usr/share/man/man7d/poll.7d 0444 root bin
+f usr/share/man/man7d/profile.7d 0444 root bin
+f usr/share/man/man7d/ptm.7d 0444 root bin
+f usr/share/man/man7d/pts.7d 0444 root bin
+f usr/share/man/man7d/pty.7d 0444 root bin
+f usr/share/man/man7d/qlc.7d 0444 root bin
+f usr/share/man/man7d/ramdisk.7d 0444 root bin
+f usr/share/man/man7d/random.7d 0444 root bin
+f usr/share/man/man7d/rge.7d 0444 root bin
+f usr/share/man/man7d/sad.7d 0444 root bin
+f usr/share/man/man7d/sata.7d 0444 root bin
+f usr/share/man/man7d/scsa1394.7d 0444 root bin
+f usr/share/man/man7d/scsa2usb.7d 0444 root bin
+f usr/share/man/man7d/sd.7d 0444 root bin
+f usr/share/man/man7d/sda.7d 0444 root bin
+f usr/share/man/man7d/sdcard.7d 0444 root bin
+f usr/share/man/man7d/sdhost.7d 0444 root bin
+f usr/share/man/man7d/sdt.7d 0444 root bin
+f usr/share/man/man7d/ses.7d 0444 root bin
+f usr/share/man/man7d/sfe.7d 0444 root bin
+f usr/share/man/man7d/sgen.7d 0444 root bin
+f usr/share/man/man7d/si3124.7d 0444 root bin
+f usr/share/man/man7d/smbios.7d 0444 root bin
+f usr/share/man/man7d/st.7d 0444 root bin
+f usr/share/man/man7d/sysmsg.7d 0444 root bin
+f usr/share/man/man7d/systrace.7d 0444 root bin
+f usr/share/man/man7d/ticlts.7d 0444 root bin
+s usr/share/man/man7d/ticots.7d=ticlts.7d
+s usr/share/man/man7d/ticotsord.7d=ticlts.7d
+f usr/share/man/man7d/tty.7d 0444 root bin
+f usr/share/man/man7d/ttymux.7d 0444 root bin
+f usr/share/man/man7d/tzmon.7d 0444 root bin
+f usr/share/man/man7d/ugen.7d 0444 root bin
+f usr/share/man/man7d/uhci.7d 0444 root bin
+s usr/share/man/man7d/urandom.7d=random.7d
+s usr/share/man/man7d/usb.7d=usba.7d
+f usr/share/man/man7d/usb_ac.7d 0444 root bin
+f usr/share/man/man7d/usb_as.7d 0444 root bin
+f usr/share/man/man7d/usb_ia.7d 0444 root bin
+f usr/share/man/man7d/usb_mid.7d 0444 root bin
+f usr/share/man/man7d/usba.7d 0444 root bin
+f usr/share/man/man7d/usbftdi.7d 0444 root bin
+f usr/share/man/man7d/usbsacm.7d 0444 root bin
+f usr/share/man/man7d/usbsksp.7d 0444 root bin
+f usr/share/man/man7d/usbsprl.7d 0444 root bin
+s usr/share/man/man7d/uwb.7d=uwba.7d
+f usr/share/man/man7d/uwba.7d 0444 root bin
+f usr/share/man/man7d/virtualkm.7d 0444 root bin
+f usr/share/man/man7d/vni.7d 0444 root bin
+f usr/share/man/man7d/vr.7d 0444 root bin
+f usr/share/man/man7d/wscons.7d 0444 root bin
+f usr/share/man/man7d/wusb_ca.7d 0444 root bin
+f usr/share/man/man7d/wusb_df.7d 0444 root bin
+f usr/share/man/man7d/xge.7d 0444 root bin
+f usr/share/man/man7d/yge.7d 0444 root bin
+f usr/share/man/man7d/zcons.7d 0444 root bin
+f usr/share/man/man7d/zero.7d 0444 root bin
+d usr/share/man/man7fs 0755 root bin
+f usr/share/man/man7fs/ctfs.7fs 0444 root bin
+f usr/share/man/man7fs/dcfs.7fs 0444 root bin
+f usr/share/man/man7fs/dev.7fs 0444 root bin
+f usr/share/man/man7fs/devfs.7fs 0444 root bin
+f usr/share/man/man7fs/fd.7fs 0444 root bin
+f usr/share/man/man7fs/hsfs.7fs 0444 root bin
+f usr/share/man/man7fs/hyprlofs.7fs 0444 root bin
+f usr/share/man/man7fs/lofs.7fs 0444 root bin
+f usr/share/man/man7fs/lxproc.7fs 0444 root bin
+f usr/share/man/man7fs/objfs.7fs 0444 root bin
+f usr/share/man/man7fs/pcfs.7fs 0444 root bin
+f usr/share/man/man7fs/sharefs.7fs 0444 root bin
+f usr/share/man/man7fs/smbfs.7fs 0444 root bin
+s usr/share/man/man7fs/stderr.7fs=fd.7fs
+s usr/share/man/man7fs/stdin.7fs=fd.7fs
+s usr/share/man/man7fs/stdout.7fs=fd.7fs
+f usr/share/man/man7fs/tmpfs.7fs 0444 root bin
+f usr/share/man/man7fs/udfs.7fs 0444 root bin
+f usr/share/man/man7fs/ufs.7fs 0444 root bin
+d usr/share/man/man7i 0755 root bin
+f usr/share/man/man7i/cdio.7i 0444 root bin
+f usr/share/man/man7i/dkio.7i 0444 root bin
+f usr/share/man/man7i/fbio.7i 0444 root bin
+f usr/share/man/man7i/fdio.7i 0444 root bin
+f usr/share/man/man7i/hdio.7i 0444 root bin
+f usr/share/man/man7i/iec61883.7i 0444 root bin
+f usr/share/man/man7i/ipnat.7i 0444 root bin
+f usr/share/man/man7i/mhd.7i 0444 root bin
+f usr/share/man/man7i/mtio.7i 0444 root bin
+f usr/share/man/man7i/prnio.7i 0444 root bin
+f usr/share/man/man7i/quotactl.7i 0444 root bin
+f usr/share/man/man7i/sesio.7i 0444 root bin
+f usr/share/man/man7i/sockio.7i 0444 root bin
+f usr/share/man/man7i/streamio.7i 0444 root bin
+f usr/share/man/man7i/termio.7i 0444 root bin
+f usr/share/man/man7i/termiox.7i 0444 root bin
+f usr/share/man/man7i/uscsi.7i 0444 root bin
+f usr/share/man/man7i/visual_io.7i 0444 root bin
+f usr/share/man/man7i/vt.7i 0444 root bin
+d usr/share/man/man7ipp 0755 root bin
+f usr/share/man/man7ipp/dlcosmk.7ipp 0444 root bin
+f usr/share/man/man7ipp/dscpmk.7ipp 0444 root bin
+f usr/share/man/man7ipp/flowacct.7ipp 0444 root bin
+f usr/share/man/man7ipp/ipgpc.7ipp 0444 root bin
+f usr/share/man/man7ipp/ipqos.7ipp 0444 root bin
+f usr/share/man/man7ipp/tokenmt.7ipp 0444 root bin
+f usr/share/man/man7ipp/tswtclmt.7ipp 0444 root bin
+d usr/share/man/man7m 0755 root bin
+f usr/share/man/man7m/bufmod.7m 0444 root bin
+f usr/share/man/man7m/connld.7m 0444 root bin
+f usr/share/man/man7m/ldterm.7m 0444 root bin
+f usr/share/man/man7m/pckt.7m 0444 root bin
+f usr/share/man/man7m/pfmod.7m 0444 root bin
+f usr/share/man/man7m/pipemod.7m 0444 root bin
+f usr/share/man/man7m/ptem.7m 0444 root bin
+f usr/share/man/man7m/sppptun.7m 0444 root bin
+f usr/share/man/man7m/timod.7m 0444 root bin
+f usr/share/man/man7m/tirdwr.7m 0444 root bin
+f usr/share/man/man7m/ttcompat.7m 0444 root bin
+f usr/share/man/man7m/usb_ah.7m 0444 root bin
+f usr/share/man/man7m/usbkbm.7m 0444 root bin
+f usr/share/man/man7m/usbms.7m 0444 root bin
+s usr/share/man/man7m/vuid2ps2.7m=vuidmice.7m
+s usr/share/man/man7m/vuid3ps2.7m=vuidmice.7m
+s usr/share/man/man7m/vuidm3p.7m=vuidmice.7m
+s usr/share/man/man7m/vuidm4p.7m=vuidmice.7m
+s usr/share/man/man7m/vuidm5p.7m=vuidmice.7m
+f usr/share/man/man7m/vuidmice.7m 0444 root bin
+d usr/share/man/man7p 0755 root bin
+s usr/share/man/man7p/AH.7p=ipsecah.7p
+s usr/share/man/man7p/ARP.7p=arp.7p
+s usr/share/man/man7p/ESP.7p=ipsecesp.7p
+s usr/share/man/man7p/ICMP.7p=icmp.7p
+s usr/share/man/man7p/IP.7p=ip.7p
+s usr/share/man/man7p/SCTP.7p=sctp.7p
+s usr/share/man/man7p/TCP.7p=tcp.7p
+s usr/share/man/man7p/UDP.7p=udp.7p
+f usr/share/man/man7p/arp.7p 0444 root bin
+f usr/share/man/man7p/dlpi.7p 0444 root bin
+f usr/share/man/man7p/icmp.7p 0444 root bin
+f usr/share/man/man7p/icmp6.7p 0444 root bin
+s usr/share/man/man7p/if.7p=if_tcp.7p
+f usr/share/man/man7p/if_tcp.7p 0444 root bin
+f usr/share/man/man7p/inet.7p 0444 root bin
+f usr/share/man/man7p/inet6.7p 0444 root bin
+f usr/share/man/man7p/ip.7p 0444 root bin
+f usr/share/man/man7p/ip6.7p 0444 root bin
+f usr/share/man/man7p/ipsec.7p 0444 root bin
+f usr/share/man/man7p/ipsecah.7p 0444 root bin
+f usr/share/man/man7p/ipsecesp.7p 0444 root bin
+f usr/share/man/man7p/pf_key.7p 0444 root bin
+f usr/share/man/man7p/route.7p 0444 root bin
+f usr/share/man/man7p/routing.7p 0444 root bin
+f usr/share/man/man7p/sctp.7p 0444 root bin
+f usr/share/man/man7p/sip.7p 0444 root bin
+f usr/share/man/man7p/slp.7p 0444 root bin
+f usr/share/man/man7p/tcp.7p 0444 root bin
+f usr/share/man/man7p/udp.7p 0444 root bin
+d usr/share/man/man9 0755 root bin
+s usr/share/man/man9/Intro.9=../man9e/Intro.9e
+s usr/share/man/man9/intro.9=../man9e/Intro.9e
+d usr/share/man/man9e 0755 root bin
+f usr/share/man/man9e/Intro.9e 0444 root bin
+f usr/share/man/man9e/_fini.9e 0444 root bin
+s usr/share/man/man9e/_info.9e=_fini.9e
+s usr/share/man/man9e/_init.9e=_fini.9e
+f usr/share/man/man9e/aread.9e 0444 root bin
+f usr/share/man/man9e/attach.9e 0444 root bin
+f usr/share/man/man9e/awrite.9e 0444 root bin
+f usr/share/man/man9e/chpoll.9e 0444 root bin
+f usr/share/man/man9e/close.9e 0444 root bin
+f usr/share/man/man9e/csx_event_handler.9e 0444 root bin
+f usr/share/man/man9e/detach.9e 0444 root bin
+f usr/share/man/man9e/devmap.9e 0444 root bin
+f usr/share/man/man9e/devmap_access.9e 0444 root bin
+f usr/share/man/man9e/devmap_contextmgt.9e 0444 root bin
+f usr/share/man/man9e/devmap_dup.9e 0444 root bin
+f usr/share/man/man9e/devmap_map.9e 0444 root bin
+f usr/share/man/man9e/devmap_unmap.9e 0444 root bin
+f usr/share/man/man9e/dump.9e 0444 root bin
+f usr/share/man/man9e/getinfo.9e 0444 root bin
+f usr/share/man/man9e/gld.9e 0444 root bin
+s usr/share/man/man9e/gldm_get_stats.9e=gld.9e
+s usr/share/man/man9e/gldm_intr.9e=gld.9e
+s usr/share/man/man9e/gldm_ioctl.9e=gld.9e
+s usr/share/man/man9e/gldm_reset.9e=gld.9e
+s usr/share/man/man9e/gldm_send.9e=gld.9e
+s usr/share/man/man9e/gldm_set_mac_addr.9e=gld.9e
+s usr/share/man/man9e/gldm_set_multicast.9e=gld.9e
+s usr/share/man/man9e/gldm_set_promiscuous.9e=gld.9e
+s usr/share/man/man9e/gldm_start.9e=gld.9e
+s usr/share/man/man9e/gldm_stop.9e=gld.9e
+f usr/share/man/man9e/identify.9e 0444 root bin
+s usr/share/man/man9e/intro.9e=Intro.9e
+f usr/share/man/man9e/ioctl.9e 0444 root bin
+f usr/share/man/man9e/ks_snapshot.9e 0444 root bin
+f usr/share/man/man9e/ks_update.9e 0444 root bin
+f usr/share/man/man9e/mmap.9e 0444 root bin
+f usr/share/man/man9e/open.9e 0444 root bin
+f usr/share/man/man9e/power.9e 0444 root bin
+f usr/share/man/man9e/print.9e 0444 root bin
+f usr/share/man/man9e/probe.9e 0444 root bin
+f usr/share/man/man9e/prop_op.9e 0444 root bin
+f usr/share/man/man9e/put.9e 0444 root bin
+f usr/share/man/man9e/quiesce.9e 0444 root bin
+f usr/share/man/man9e/read.9e 0444 root bin
+f usr/share/man/man9e/segmap.9e 0444 root bin
+f usr/share/man/man9e/srv.9e 0444 root bin
+f usr/share/man/man9e/strategy.9e 0444 root bin
+f usr/share/man/man9e/tran_abort.9e 0444 root bin
+f usr/share/man/man9e/tran_bus_reset.9e 0444 root bin
+s usr/share/man/man9e/tran_destroy_pkt.9e=tran_init_pkt.9e
+f usr/share/man/man9e/tran_dmafree.9e 0444 root bin
+f usr/share/man/man9e/tran_getcap.9e 0444 root bin
+f usr/share/man/man9e/tran_init_pkt.9e 0444 root bin
+s usr/share/man/man9e/tran_pkt_constructor.9e=tran_setup_pkt.9e
+s usr/share/man/man9e/tran_pkt_destructor.9e=tran_setup_pkt.9e
+f usr/share/man/man9e/tran_quiesce.9e 0444 root bin
+f usr/share/man/man9e/tran_reset.9e 0444 root bin
+f usr/share/man/man9e/tran_reset_notify.9e 0444 root bin
+s usr/share/man/man9e/tran_setcap.9e=tran_getcap.9e
+f usr/share/man/man9e/tran_setup_pkt.9e 0444 root bin
+f usr/share/man/man9e/tran_start.9e 0444 root bin
+f usr/share/man/man9e/tran_sync_pkt.9e 0444 root bin
+s usr/share/man/man9e/tran_teardown_pkt.9e=tran_setup_pkt.9e
+f usr/share/man/man9e/tran_tgt_free.9e 0444 root bin
+f usr/share/man/man9e/tran_tgt_init.9e 0444 root bin
+f usr/share/man/man9e/tran_tgt_probe.9e 0444 root bin
+s usr/share/man/man9e/tran_unquiesce.9e=tran_quiesce.9e
+f usr/share/man/man9e/write.9e 0444 root bin
+d usr/share/man/man9f 0755 root bin
+f usr/share/man/man9f/ASSERT.9f 0444 root bin
+f usr/share/man/man9f/Intro.9f 0444 root bin
+f usr/share/man/man9f/OTHERQ.9f 0444 root bin
+f usr/share/man/man9f/RD.9f 0444 root bin
+f usr/share/man/man9f/SAMESTR.9f 0444 root bin
+s usr/share/man/man9f/SIZEOF_PTR.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/SIZEOF_STRUCT.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_BUF.9f=STRUCT_DECL.9f
+f usr/share/man/man9f/STRUCT_DECL.9f 0444 root bin
+s usr/share/man/man9f/STRUCT_FADDR.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_FGET.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_FGETP.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_FSET.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_FSETP.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_HANDLE.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_INIT.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_SET_HANDLE.9f=STRUCT_DECL.9f
+s usr/share/man/man9f/STRUCT_SIZE.9f=STRUCT_DECL.9f
+f usr/share/man/man9f/WR.9f 0444 root bin
+f usr/share/man/man9f/adjmsg.9f 0444 root bin
+f usr/share/man/man9f/allocb.9f 0444 root bin
+s usr/share/man/man9f/assert.9f=ASSERT.9f
+f usr/share/man/man9f/atomic_add.9f 0444 root bin
+s usr/share/man/man9f/atomic_add_16.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_16_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_32.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_32_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_64.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_64_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_8.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_8_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_char.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_char_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_int.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_int_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_long.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_long_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_ptr.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_ptr_nv.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_short.9f=atomic_add.9f
+s usr/share/man/man9f/atomic_add_short_nv.9f=atomic_add.9f
+f usr/share/man/man9f/atomic_and.9f 0444 root bin
+s usr/share/man/man9f/atomic_and_16.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_16_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_32.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_32_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_64.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_64_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_8.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_8_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_uchar.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_uchar_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_uint.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_uint_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_ulong.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_ulong_nv.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_ushort.9f=atomic_and.9f
+s usr/share/man/man9f/atomic_and_ushort_nv.9f=atomic_and.9f
+f usr/share/man/man9f/atomic_bits.9f 0444 root bin
+f usr/share/man/man9f/atomic_cas.9f 0444 root bin
+s usr/share/man/man9f/atomic_cas_16.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_32.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_64.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_8.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_ptr.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_uchar.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_uint.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_ulong.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_cas_ushort.9f=atomic_cas.9f
+s usr/share/man/man9f/atomic_clear_long_excl.9f=atomic_bits.9f
+f usr/share/man/man9f/atomic_dec.9f 0444 root bin
+s usr/share/man/man9f/atomic_dec_16.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_16_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_32.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_32_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_64.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_64_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_8.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_8_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_ptr.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_ptr_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_uchar.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_uchar_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_uint.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_uint_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_ulong.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_ulong_nv.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_ushort.9f=atomic_dec.9f
+s usr/share/man/man9f/atomic_dec_ushort_nv.9f=atomic_dec.9f
+f usr/share/man/man9f/atomic_inc.9f 0444 root bin
+s usr/share/man/man9f/atomic_inc_16.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_16_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_32.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_32_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_64.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_64_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_8.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_8_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_ptr.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_ptr_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_uchar.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_uchar_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_uint.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_uint_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_ulong.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_ulong_nv.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_ushort.9f=atomic_inc.9f
+s usr/share/man/man9f/atomic_inc_ushort_nv.9f=atomic_inc.9f
+f usr/share/man/man9f/atomic_ops.9f 0444 root bin
+f usr/share/man/man9f/atomic_or.9f 0444 root bin
+s usr/share/man/man9f/atomic_or_16.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_16_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_32.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_32_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_64.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_64_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_8.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_8_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_uchar.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_uchar_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_uint.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_uint_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_ulong.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_ulong_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_ushort.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_or_ushort_nv.9f=atomic_or.9f
+s usr/share/man/man9f/atomic_set_long_excl.9f=atomic_bits.9f
+f usr/share/man/man9f/atomic_swap.9f 0444 root bin
+s usr/share/man/man9f/atomic_swap_16.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_32.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_64.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_8.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_ptr.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_uchar.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_uint.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_ulong.9f=atomic_swap.9f
+s usr/share/man/man9f/atomic_swap_ushort.9f=atomic_swap.9f
+f usr/share/man/man9f/backq.9f 0444 root bin
+f usr/share/man/man9f/bcanput.9f 0444 root bin
+f usr/share/man/man9f/bcmp.9f 0444 root bin
+f usr/share/man/man9f/bcopy.9f 0444 root bin
+f usr/share/man/man9f/bioclone.9f 0444 root bin
+f usr/share/man/man9f/biodone.9f 0444 root bin
+f usr/share/man/man9f/bioerror.9f 0444 root bin
+f usr/share/man/man9f/biofini.9f 0444 root bin
+f usr/share/man/man9f/bioinit.9f 0444 root bin
+f usr/share/man/man9f/biomodified.9f 0444 root bin
+f usr/share/man/man9f/bioreset.9f 0444 root bin
+f usr/share/man/man9f/biosize.9f 0444 root bin
+f usr/share/man/man9f/biowait.9f 0444 root bin
+f usr/share/man/man9f/bp_copyin.9f 0444 root bin
+f usr/share/man/man9f/bp_copyout.9f 0444 root bin
+f usr/share/man/man9f/bp_mapin.9f 0444 root bin
+f usr/share/man/man9f/bp_mapout.9f 0444 root bin
+f usr/share/man/man9f/btop.9f 0444 root bin
+f usr/share/man/man9f/btopr.9f 0444 root bin
+f usr/share/man/man9f/bufcall.9f 0444 root bin
+f usr/share/man/man9f/bzero.9f 0444 root bin
+f usr/share/man/man9f/canput.9f 0444 root bin
+f usr/share/man/man9f/clrbuf.9f 0444 root bin
+f usr/share/man/man9f/cmn_err.9f 0444 root bin
+f usr/share/man/man9f/condvar.9f 0444 root bin
+f usr/share/man/man9f/copyb.9f 0444 root bin
+f usr/share/man/man9f/copyin.9f 0444 root bin
+f usr/share/man/man9f/copymsg.9f 0444 root bin
+f usr/share/man/man9f/copyout.9f 0444 root bin
+s usr/share/man/man9f/crgetgid.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetgroups.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetngroups.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetrgid.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetruid.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetsgid.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetsuid.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetuid.9f=ddi_cred.9f
+s usr/share/man/man9f/crgetzoneid.9f=ddi_cred.9f
+f usr/share/man/man9f/csx_AccessConfigurationRegister.9f 0444 root bin
+f usr/share/man/man9f/csx_CS_DDI_Info.9f 0444 root bin
+f usr/share/man/man9f/csx_ConvertSize.9f 0444 root bin
+f usr/share/man/man9f/csx_ConvertSpeed.9f 0444 root bin
+f usr/share/man/man9f/csx_DeregisterClient.9f 0444 root bin
+f usr/share/man/man9f/csx_DupHandle.9f 0444 root bin
+f usr/share/man/man9f/csx_Error2Text.9f 0444 root bin
+f usr/share/man/man9f/csx_Event2Text.9f 0444 root bin
+f usr/share/man/man9f/csx_FreeHandle.9f 0444 root bin
+s usr/share/man/man9f/csx_Get16.9f=csx_Get8.9f
+s usr/share/man/man9f/csx_Get32.9f=csx_Get8.9f
+s usr/share/man/man9f/csx_Get64.9f=csx_Get8.9f
+f usr/share/man/man9f/csx_Get8.9f 0444 root bin
+s usr/share/man/man9f/csx_GetEventMask.9f=csx_SetEventMask.9f
+f usr/share/man/man9f/csx_GetFirstClient.9f 0444 root bin
+f usr/share/man/man9f/csx_GetFirstTuple.9f 0444 root bin
+f usr/share/man/man9f/csx_GetHandleOffset.9f 0444 root bin
+f usr/share/man/man9f/csx_GetMappedAddr.9f 0444 root bin
+s usr/share/man/man9f/csx_GetNextClient.9f=csx_GetFirstClient.9f
+s usr/share/man/man9f/csx_GetNextTuple.9f=csx_GetFirstTuple.9f
+f usr/share/man/man9f/csx_GetStatus.9f 0444 root bin
+f usr/share/man/man9f/csx_GetTupleData.9f 0444 root bin
+f usr/share/man/man9f/csx_MakeDeviceNode.9f 0444 root bin
+f usr/share/man/man9f/csx_MapLogSocket.9f 0444 root bin
+f usr/share/man/man9f/csx_MapMemPage.9f 0444 root bin
+f usr/share/man/man9f/csx_ModifyConfiguration.9f 0444 root bin
+f usr/share/man/man9f/csx_ModifyWindow.9f 0444 root bin
+f usr/share/man/man9f/csx_ParseTuple.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_BATTERY.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_BYTEORDER.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_CFTABLE_ENTRY.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_CONFIG.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_DATE.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_DEVICE.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_DEVICEGEO.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_DEVICEGEO_A.9f 0444 root bin
+s usr/share/man/man9f/csx_Parse_CISTPL_DEVICE_A.9f=csx_Parse_CISTPL_DEVICE.9f
+s usr/share/man/man9f/csx_Parse_CISTPL_DEVICE_OA.9f=csx_Parse_CISTPL_DEVICE.9f
+s usr/share/man/man9f/csx_Parse_CISTPL_DEVICE_OC.9f=csx_Parse_CISTPL_DEVICE.9f
+f usr/share/man/man9f/csx_Parse_CISTPL_FORMAT.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_FUNCE.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_FUNCID.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_GEOMETRY.9f 0444 root bin
+s usr/share/man/man9f/csx_Parse_CISTPL_JEDEC_A.9f=csx_Parse_CISTPL_JEDEC_C.9f
+f usr/share/man/man9f/csx_Parse_CISTPL_JEDEC_C.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_LINKTARGET.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_LONGLINK_A.9f 0444 root bin
+s usr/share/man/man9f/csx_Parse_CISTPL_LONGLINK_C.9f=csx_Parse_CISTPL_LONGLINK_A.9f
+f usr/share/man/man9f/csx_Parse_CISTPL_LONGLINK_MFC.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_MANFID.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_ORG.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_SPCL.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_SWIL.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_VERS_1.9f 0444 root bin
+f usr/share/man/man9f/csx_Parse_CISTPL_VERS_2.9f 0444 root bin
+s usr/share/man/man9f/csx_Put16.9f=csx_Put8.9f
+s usr/share/man/man9f/csx_Put32.9f=csx_Put8.9f
+s usr/share/man/man9f/csx_Put64.9f=csx_Put8.9f
+f usr/share/man/man9f/csx_Put8.9f 0444 root bin
+f usr/share/man/man9f/csx_RegisterClient.9f 0444 root bin
+f usr/share/man/man9f/csx_ReleaseConfiguration.9f 0444 root bin
+s usr/share/man/man9f/csx_ReleaseIO.9f=csx_RequestIO.9f
+s usr/share/man/man9f/csx_ReleaseIRQ.9f=csx_RequestIRQ.9f
+s usr/share/man/man9f/csx_ReleaseSocketMask.9f=csx_RequestSocketMask.9f
+s usr/share/man/man9f/csx_ReleaseWindow.9f=csx_RequestWindow.9f
+s usr/share/man/man9f/csx_RemoveDeviceNode.9f=csx_MakeDeviceNode.9f
+s usr/share/man/man9f/csx_RepGet16.9f=csx_RepGet8.9f
+s usr/share/man/man9f/csx_RepGet32.9f=csx_RepGet8.9f
+s usr/share/man/man9f/csx_RepGet64.9f=csx_RepGet8.9f
+f usr/share/man/man9f/csx_RepGet8.9f 0444 root bin
+s usr/share/man/man9f/csx_RepPut16.9f=csx_RepPut8.9f
+s usr/share/man/man9f/csx_RepPut32.9f=csx_RepPut8.9f
+s usr/share/man/man9f/csx_RepPut64.9f=csx_RepPut8.9f
+f usr/share/man/man9f/csx_RepPut8.9f 0444 root bin
+f usr/share/man/man9f/csx_RequestConfiguration.9f 0444 root bin
+f usr/share/man/man9f/csx_RequestIO.9f 0444 root bin
+f usr/share/man/man9f/csx_RequestIRQ.9f 0444 root bin
+f usr/share/man/man9f/csx_RequestSocketMask.9f 0444 root bin
+f usr/share/man/man9f/csx_RequestWindow.9f 0444 root bin
+f usr/share/man/man9f/csx_ResetFunction.9f 0444 root bin
+f usr/share/man/man9f/csx_SetEventMask.9f 0444 root bin
+f usr/share/man/man9f/csx_SetHandleOffset.9f 0444 root bin
+f usr/share/man/man9f/csx_ValidateCIS.9f 0444 root bin
+s usr/share/man/man9f/cv_broadcast.9f=condvar.9f
+s usr/share/man/man9f/cv_destroy.9f=condvar.9f
+s usr/share/man/man9f/cv_init.9f=condvar.9f
+s usr/share/man/man9f/cv_reltimedwait.9f=condvar.9f
+s usr/share/man/man9f/cv_reltimedwait_sig.9f=condvar.9f
+s usr/share/man/man9f/cv_signal.9f=condvar.9f
+s usr/share/man/man9f/cv_timedwait.9f=condvar.9f
+s usr/share/man/man9f/cv_timedwait_sig.9f=condvar.9f
+s usr/share/man/man9f/cv_wait.9f=condvar.9f
+s usr/share/man/man9f/cv_wait_sig.9f=condvar.9f
+f usr/share/man/man9f/datamsg.9f 0444 root bin
+f usr/share/man/man9f/ddi_add_event_handler.9f 0444 root bin
+f usr/share/man/man9f/ddi_add_intr.9f 0444 root bin
+f usr/share/man/man9f/ddi_add_softintr.9f 0444 root bin
+f usr/share/man/man9f/ddi_binding_name.9f 0444 root bin
+f usr/share/man/man9f/ddi_btop.9f 0444 root bin
+s usr/share/man/man9f/ddi_btopr.9f=ddi_btop.9f
+f usr/share/man/man9f/ddi_can_receive_sig.9f 0444 root bin
+f usr/share/man/man9f/ddi_cb_register.9f 0444 root bin
+s usr/share/man/man9f/ddi_cb_unregister.9f=ddi_cb_register.9f
+f usr/share/man/man9f/ddi_check_acc_handle.9f 0444 root bin
+s usr/share/man/man9f/ddi_check_dma_handle.9f=ddi_check_acc_handle.9f
+f usr/share/man/man9f/ddi_copyin.9f 0444 root bin
+f usr/share/man/man9f/ddi_copyout.9f 0444 root bin
+f usr/share/man/man9f/ddi_create_minor_node.9f 0444 root bin
+f usr/share/man/man9f/ddi_cred.9f 0444 root bin
+f usr/share/man/man9f/ddi_dev_is_needed.9f 0444 root bin
+f usr/share/man/man9f/ddi_dev_is_sid.9f 0444 root bin
+f usr/share/man/man9f/ddi_dev_nintrs.9f 0444 root bin
+f usr/share/man/man9f/ddi_dev_nregs.9f 0444 root bin
+f usr/share/man/man9f/ddi_dev_regsize.9f 0444 root bin
+f usr/share/man/man9f/ddi_dev_report_fault.9f 0444 root bin
+f usr/share/man/man9f/ddi_device_copy.9f 0444 root bin
+f usr/share/man/man9f/ddi_device_zero.9f 0444 root bin
+f usr/share/man/man9f/ddi_devid_compare.9f 0444 root bin
+s usr/share/man/man9f/ddi_devid_free.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_get.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_init.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_register.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_sizeof.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_str_decode.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_str_encode.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_str_free.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_unregister.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devid_valid.9f=ddi_devid_compare.9f
+s usr/share/man/man9f/ddi_devmap_segmap.9f=devmap_setup.9f
+f usr/share/man/man9f/ddi_dma_addr_bind_handle.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_alloc_handle.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_buf_bind_handle.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_burstsizes.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_free_handle.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_getwin.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_mem_alloc.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_mem_free.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_nextcookie.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_numwin.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_set_sbus64.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_sync.9f 0444 root bin
+f usr/share/man/man9f/ddi_dma_unbind_handle.9f 0444 root bin
+f usr/share/man/man9f/ddi_dmae.9f 0444 root bin
+s usr/share/man/man9f/ddi_dmae_1stparty.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_alloc.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_disable.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_enable.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_getattr.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_getcnt.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_getlim.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_prog.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_release.9f=ddi_dmae.9f
+s usr/share/man/man9f/ddi_dmae_stop.9f=ddi_dmae.9f
+f usr/share/man/man9f/ddi_driver_major.9f 0444 root bin
+f usr/share/man/man9f/ddi_driver_name.9f 0444 root bin
+f usr/share/man/man9f/ddi_enter_critical.9f 0444 root bin
+s usr/share/man/man9f/ddi_exit_critical.9f=ddi_enter_critical.9f
+f usr/share/man/man9f/ddi_ffs.9f 0444 root bin
+s usr/share/man/man9f/ddi_fls.9f=ddi_ffs.9f
+f usr/share/man/man9f/ddi_fm_acc_err_clear.9f 0444 root bin
+f usr/share/man/man9f/ddi_fm_acc_err_get.9f 0444 root bin
+s usr/share/man/man9f/ddi_fm_capable.9f=ddi_fm_init.9f
+s usr/share/man/man9f/ddi_fm_dma_err_clear.9f=ddi_fm_acc_err_clear.9f
+s usr/share/man/man9f/ddi_fm_dma_err_get.9f=ddi_fm_acc_err_get.9f
+f usr/share/man/man9f/ddi_fm_ereport_post.9f 0444 root bin
+s usr/share/man/man9f/ddi_fm_fini.9f=ddi_fm_init.9f
+f usr/share/man/man9f/ddi_fm_handler_register.9f 0444 root bin
+s usr/share/man/man9f/ddi_fm_handler_unregister.9f=ddi_fm_handler_register.9f
+f usr/share/man/man9f/ddi_fm_init.9f 0444 root bin
+f usr/share/man/man9f/ddi_fm_service_impact.9f 0444 root bin
+s usr/share/man/man9f/ddi_get16.9f=ddi_get8.9f
+s usr/share/man/man9f/ddi_get32.9f=ddi_get8.9f
+s usr/share/man/man9f/ddi_get64.9f=ddi_get8.9f
+f usr/share/man/man9f/ddi_get8.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_cred.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_devstate.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_driver_private.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_eventcookie.9f 0444 root bin
+s usr/share/man/man9f/ddi_get_iblock_cookie.9f=ddi_add_intr.9f
+f usr/share/man/man9f/ddi_get_instance.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_kt_did.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_lbolt.9f 0444 root bin
+s usr/share/man/man9f/ddi_get_lbolt64.9f=ddi_get_lbolt.9f
+s usr/share/man/man9f/ddi_get_name.9f=ddi_binding_name.9f
+f usr/share/man/man9f/ddi_get_parent.9f 0444 root bin
+f usr/share/man/man9f/ddi_get_pid.9f 0444 root bin
+s usr/share/man/man9f/ddi_get_soft_iblock_cookie.9f=ddi_add_softintr.9f
+s usr/share/man/man9f/ddi_get_soft_state.9f=ddi_soft_state.9f
+f usr/share/man/man9f/ddi_get_time.9f 0444 root bin
+s usr/share/man/man9f/ddi_getb.9f=ddi_get8.9f
+f usr/share/man/man9f/ddi_getiminor.9f 0444 root bin
+s usr/share/man/man9f/ddi_getl.9f=ddi_get8.9f
+s usr/share/man/man9f/ddi_getll.9f=ddi_get8.9f
+s usr/share/man/man9f/ddi_getlongprop.9f=ddi_prop_op.9f
+s usr/share/man/man9f/ddi_getlongprop_buf.9f=ddi_prop_op.9f
+s usr/share/man/man9f/ddi_getprop.9f=ddi_prop_op.9f
+s usr/share/man/man9f/ddi_getproplen.9f=ddi_prop_op.9f
+s usr/share/man/man9f/ddi_getw.9f=ddi_get8.9f
+f usr/share/man/man9f/ddi_in_panic.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_add_handler.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_add_softint.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_alloc.9f 0444 root bin
+s usr/share/man/man9f/ddi_intr_block_disable.9f=ddi_intr_enable.9f
+s usr/share/man/man9f/ddi_intr_block_enable.9f=ddi_intr_enable.9f
+s usr/share/man/man9f/ddi_intr_clr_mask.9f=ddi_intr_set_mask.9f
+s usr/share/man/man9f/ddi_intr_disable.9f=ddi_intr_enable.9f
+f usr/share/man/man9f/ddi_intr_dup_handler.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_enable.9f 0444 root bin
+s usr/share/man/man9f/ddi_intr_free.9f=ddi_intr_alloc.9f
+f usr/share/man/man9f/ddi_intr_get_cap.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_get_hilevel_pri.9f 0444 root bin
+s usr/share/man/man9f/ddi_intr_get_navail.9f=ddi_intr_get_nintrs.9f
+f usr/share/man/man9f/ddi_intr_get_nintrs.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_get_pending.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_get_pri.9f 0444 root bin
+s usr/share/man/man9f/ddi_intr_get_softint_pri.9f=ddi_intr_add_softint.9f
+f usr/share/man/man9f/ddi_intr_get_supported_types.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_hilevel.9f 0444 root bin
+s usr/share/man/man9f/ddi_intr_remove_handler.9f=ddi_intr_add_handler.9f
+s usr/share/man/man9f/ddi_intr_remove_softint.9f=ddi_intr_add_softint.9f
+s usr/share/man/man9f/ddi_intr_set_cap.9f=ddi_intr_get_cap.9f
+f usr/share/man/man9f/ddi_intr_set_mask.9f 0444 root bin
+f usr/share/man/man9f/ddi_intr_set_nreq.9f 0444 root bin
+s usr/share/man/man9f/ddi_intr_set_pri.9f=ddi_intr_get_pri.9f
+s usr/share/man/man9f/ddi_intr_set_softint_pri.9f=ddi_intr_add_softint.9f
+s usr/share/man/man9f/ddi_intr_trigger_softint.9f=ddi_intr_add_softint.9f
+s usr/share/man/man9f/ddi_io_get16.9f=ddi_io_get8.9f
+s usr/share/man/man9f/ddi_io_get32.9f=ddi_io_get8.9f
+f usr/share/man/man9f/ddi_io_get8.9f 0444 root bin
+s usr/share/man/man9f/ddi_io_getb.9f=ddi_io_get8.9f
+s usr/share/man/man9f/ddi_io_getl.9f=ddi_io_get8.9f
+s usr/share/man/man9f/ddi_io_getw.9f=ddi_io_get8.9f
+s usr/share/man/man9f/ddi_io_put16.9f=ddi_io_put8.9f
+s usr/share/man/man9f/ddi_io_put32.9f=ddi_io_put8.9f
+f usr/share/man/man9f/ddi_io_put8.9f 0444 root bin
+s usr/share/man/man9f/ddi_io_putb.9f=ddi_io_put8.9f
+s usr/share/man/man9f/ddi_io_putl.9f=ddi_io_put8.9f
+s usr/share/man/man9f/ddi_io_putw.9f=ddi_io_put8.9f
+s usr/share/man/man9f/ddi_io_rep_get16.9f=ddi_io_rep_get8.9f
+s usr/share/man/man9f/ddi_io_rep_get32.9f=ddi_io_rep_get8.9f
+f usr/share/man/man9f/ddi_io_rep_get8.9f 0444 root bin
+s usr/share/man/man9f/ddi_io_rep_getb.9f=ddi_io_rep_get8.9f
+s usr/share/man/man9f/ddi_io_rep_getl.9f=ddi_io_rep_get8.9f
+s usr/share/man/man9f/ddi_io_rep_getw.9f=ddi_io_rep_get8.9f
+s usr/share/man/man9f/ddi_io_rep_put16.9f=ddi_io_rep_put8.9f
+s usr/share/man/man9f/ddi_io_rep_put32.9f=ddi_io_rep_put8.9f
+f usr/share/man/man9f/ddi_io_rep_put8.9f 0444 root bin
+s usr/share/man/man9f/ddi_io_rep_putb.9f=ddi_io_rep_put8.9f
+s usr/share/man/man9f/ddi_io_rep_putl.9f=ddi_io_rep_put8.9f
+s usr/share/man/man9f/ddi_io_rep_putw.9f=ddi_io_rep_put8.9f
+f usr/share/man/man9f/ddi_iomin.9f 0444 root bin
+f usr/share/man/man9f/ddi_log_sysevent.9f 0444 root bin
+f usr/share/man/man9f/ddi_map_regs.9f 0444 root bin
+s usr/share/man/man9f/ddi_mem_get16.9f=ddi_mem_get8.9f
+s usr/share/man/man9f/ddi_mem_get32.9f=ddi_mem_get8.9f
+s usr/share/man/man9f/ddi_mem_get64.9f=ddi_mem_get8.9f
+f usr/share/man/man9f/ddi_mem_get8.9f 0444 root bin
+s usr/share/man/man9f/ddi_mem_getb.9f=ddi_mem_get8.9f
+s usr/share/man/man9f/ddi_mem_getl.9f=ddi_mem_get8.9f
+s usr/share/man/man9f/ddi_mem_getll.9f=ddi_mem_get8.9f
+s usr/share/man/man9f/ddi_mem_getw.9f=ddi_mem_get8.9f
+s usr/share/man/man9f/ddi_mem_put16.9f=ddi_mem_put8.9f
+s usr/share/man/man9f/ddi_mem_put32.9f=ddi_mem_put8.9f
+s usr/share/man/man9f/ddi_mem_put64.9f=ddi_mem_put8.9f
+f usr/share/man/man9f/ddi_mem_put8.9f 0444 root bin
+s usr/share/man/man9f/ddi_mem_putb.9f=ddi_mem_put8.9f
+s usr/share/man/man9f/ddi_mem_putl.9f=ddi_mem_put8.9f
+s usr/share/man/man9f/ddi_mem_putll.9f=ddi_mem_put8.9f
+s usr/share/man/man9f/ddi_mem_putw.9f=ddi_mem_put8.9f
+s usr/share/man/man9f/ddi_mem_rep_get16.9f=ddi_mem_rep_get8.9f
+s usr/share/man/man9f/ddi_mem_rep_get32.9f=ddi_mem_rep_get8.9f
+s usr/share/man/man9f/ddi_mem_rep_get64.9f=ddi_mem_rep_get8.9f
+f usr/share/man/man9f/ddi_mem_rep_get8.9f 0444 root bin
+s usr/share/man/man9f/ddi_mem_rep_getb.9f=ddi_mem_rep_get8.9f
+s usr/share/man/man9f/ddi_mem_rep_getl.9f=ddi_mem_rep_get8.9f
+s usr/share/man/man9f/ddi_mem_rep_getll.9f=ddi_mem_rep_get8.9f
+s usr/share/man/man9f/ddi_mem_rep_getw.9f=ddi_mem_rep_get8.9f
+s usr/share/man/man9f/ddi_mem_rep_put16.9f=ddi_mem_rep_put8.9f
+s usr/share/man/man9f/ddi_mem_rep_put32.9f=ddi_mem_rep_put8.9f
+s usr/share/man/man9f/ddi_mem_rep_put64.9f=ddi_mem_rep_put8.9f
+f usr/share/man/man9f/ddi_mem_rep_put8.9f 0444 root bin
+s usr/share/man/man9f/ddi_mem_rep_putb.9f=ddi_mem_rep_put8.9f
+s usr/share/man/man9f/ddi_mem_rep_putl.9f=ddi_mem_rep_put8.9f
+s usr/share/man/man9f/ddi_mem_rep_putll.9f=ddi_mem_rep_put8.9f
+s usr/share/man/man9f/ddi_mem_rep_putw.9f=ddi_mem_rep_put8.9f
+f usr/share/man/man9f/ddi_mmap_get_model.9f 0444 root bin
+s usr/share/man/man9f/ddi_modclose.9f=ddi_modopen.9f
+f usr/share/man/man9f/ddi_model_convert_from.9f 0444 root bin
+f usr/share/man/man9f/ddi_modopen.9f 0444 root bin
+s usr/share/man/man9f/ddi_modsym.9f=ddi_modopen.9f
+f usr/share/man/man9f/ddi_no_info.9f 0444 root bin
+f usr/share/man/man9f/ddi_node_name.9f 0444 root bin
+f usr/share/man/man9f/ddi_peek.9f 0444 root bin
+s usr/share/man/man9f/ddi_peek16.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peek32.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peek64.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peek8.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peekc.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peekd.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peekl.9f=ddi_peek.9f
+s usr/share/man/man9f/ddi_peeks.9f=ddi_peek.9f
+f usr/share/man/man9f/ddi_periodic_add.9f 0444 root bin
+f usr/share/man/man9f/ddi_periodic_delete.9f 0444 root bin
+f usr/share/man/man9f/ddi_poke.9f 0444 root bin
+s usr/share/man/man9f/ddi_poke16.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_poke32.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_poke64.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_poke8.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_pokec.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_poked.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_pokel.9f=ddi_poke.9f
+s usr/share/man/man9f/ddi_pokes.9f=ddi_poke.9f
+f usr/share/man/man9f/ddi_prop_create.9f 0444 root bin
+f usr/share/man/man9f/ddi_prop_exists.9f 0444 root bin
+s usr/share/man/man9f/ddi_prop_free.9f=ddi_prop_lookup.9f
+f usr/share/man/man9f/ddi_prop_get_int.9f 0444 root bin
+s usr/share/man/man9f/ddi_prop_get_int64.9f=ddi_prop_get_int.9f
+f usr/share/man/man9f/ddi_prop_lookup.9f 0444 root bin
+s usr/share/man/man9f/ddi_prop_lookup_byte_array.9f=ddi_prop_lookup.9f
+s usr/share/man/man9f/ddi_prop_lookup_int64_array.9f=ddi_prop_lookup.9f
+s usr/share/man/man9f/ddi_prop_lookup_int_array.9f=ddi_prop_lookup.9f
+s usr/share/man/man9f/ddi_prop_lookup_string.9f=ddi_prop_lookup.9f
+s usr/share/man/man9f/ddi_prop_lookup_string_array.9f=ddi_prop_lookup.9f
+s usr/share/man/man9f/ddi_prop_modify.9f=ddi_prop_create.9f
+f usr/share/man/man9f/ddi_prop_op.9f 0444 root bin
+s usr/share/man/man9f/ddi_prop_remove.9f=ddi_prop_create.9f
+s usr/share/man/man9f/ddi_prop_remove_all.9f=ddi_prop_create.9f
+s usr/share/man/man9f/ddi_prop_undefine.9f=ddi_prop_create.9f
+f usr/share/man/man9f/ddi_prop_update.9f 0444 root bin
+s usr/share/man/man9f/ddi_prop_update_byte_array.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_prop_update_int.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_prop_update_int64.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_prop_update_int64_array.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_prop_update_int_array.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_prop_update_string.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_prop_update_string_array.9f=ddi_prop_update.9f
+s usr/share/man/man9f/ddi_ptob.9f=ddi_btop.9f
+s usr/share/man/man9f/ddi_put16.9f=ddi_put8.9f
+s usr/share/man/man9f/ddi_put32.9f=ddi_put8.9f
+s usr/share/man/man9f/ddi_put64.9f=ddi_put8.9f
+f usr/share/man/man9f/ddi_put8.9f 0444 root bin
+s usr/share/man/man9f/ddi_putb.9f=ddi_put8.9f
+s usr/share/man/man9f/ddi_putl.9f=ddi_put8.9f
+s usr/share/man/man9f/ddi_putll.9f=ddi_put8.9f
+s usr/share/man/man9f/ddi_putw.9f=ddi_put8.9f
+f usr/share/man/man9f/ddi_regs_map_free.9f 0444 root bin
+f usr/share/man/man9f/ddi_regs_map_setup.9f 0444 root bin
+f usr/share/man/man9f/ddi_remove_event_handler.9f 0444 root bin
+s usr/share/man/man9f/ddi_remove_intr.9f=ddi_add_intr.9f
+f usr/share/man/man9f/ddi_remove_minor_node.9f 0444 root bin
+s usr/share/man/man9f/ddi_remove_softintr.9f=ddi_add_softintr.9f
+f usr/share/man/man9f/ddi_removing_power.9f 0444 root bin
+s usr/share/man/man9f/ddi_rep_get16.9f=ddi_rep_get8.9f
+s usr/share/man/man9f/ddi_rep_get32.9f=ddi_rep_get8.9f
+s usr/share/man/man9f/ddi_rep_get64.9f=ddi_rep_get8.9f
+f usr/share/man/man9f/ddi_rep_get8.9f 0444 root bin
+s usr/share/man/man9f/ddi_rep_getb.9f=ddi_rep_get8.9f
+s usr/share/man/man9f/ddi_rep_getl.9f=ddi_rep_get8.9f
+s usr/share/man/man9f/ddi_rep_getll.9f=ddi_rep_get8.9f
+s usr/share/man/man9f/ddi_rep_getw.9f=ddi_rep_get8.9f
+s usr/share/man/man9f/ddi_rep_put16.9f=ddi_rep_put8.9f
+s usr/share/man/man9f/ddi_rep_put32.9f=ddi_rep_put8.9f
+s usr/share/man/man9f/ddi_rep_put64.9f=ddi_rep_put8.9f
+f usr/share/man/man9f/ddi_rep_put8.9f 0444 root bin
+s usr/share/man/man9f/ddi_rep_putb.9f=ddi_rep_put8.9f
+s usr/share/man/man9f/ddi_rep_putl.9f=ddi_rep_put8.9f
+s usr/share/man/man9f/ddi_rep_putll.9f=ddi_rep_put8.9f
+s usr/share/man/man9f/ddi_rep_putw.9f=ddi_rep_put8.9f
+f usr/share/man/man9f/ddi_report_dev.9f 0444 root bin
+f usr/share/man/man9f/ddi_root_node.9f 0444 root bin
+f usr/share/man/man9f/ddi_segmap.9f 0444 root bin
+s usr/share/man/man9f/ddi_segmap_setup.9f=ddi_segmap.9f
+s usr/share/man/man9f/ddi_set_driver_private.9f=ddi_get_driver_private.9f
+f usr/share/man/man9f/ddi_slaveonly.9f 0444 root bin
+f usr/share/man/man9f/ddi_soft_state.9f 0444 root bin
+s usr/share/man/man9f/ddi_soft_state_fini.9f=ddi_soft_state.9f
+s usr/share/man/man9f/ddi_soft_state_free.9f=ddi_soft_state.9f
+s usr/share/man/man9f/ddi_soft_state_init.9f=ddi_soft_state.9f
+s usr/share/man/man9f/ddi_soft_state_zalloc.9f=ddi_soft_state.9f
+s usr/share/man/man9f/ddi_strdup.9f=string.9f
+f usr/share/man/man9f/ddi_strtol.9f 0444 root bin
+f usr/share/man/man9f/ddi_strtoll.9f 0444 root bin
+f usr/share/man/man9f/ddi_strtoul.9f 0444 root bin
+s usr/share/man/man9f/ddi_strtoull.9f=ddi_strtoll.9f
+s usr/share/man/man9f/ddi_taskq_create.9f=taskq.9f
+s usr/share/man/man9f/ddi_taskq_destroy.9f=taskq.9f
+s usr/share/man/man9f/ddi_taskq_dispatch.9f=taskq.9f
+s usr/share/man/man9f/ddi_taskq_resume.9f=taskq.9f
+s usr/share/man/man9f/ddi_taskq_suspend.9f=taskq.9f
+s usr/share/man/man9f/ddi_taskq_wait.9f=taskq.9f
+s usr/share/man/man9f/ddi_trigger_softintr.9f=ddi_add_softintr.9f
+f usr/share/man/man9f/ddi_umem_alloc.9f 0444 root bin
+s usr/share/man/man9f/ddi_umem_free.9f=ddi_umem_alloc.9f
+f usr/share/man/man9f/ddi_umem_iosetup.9f 0444 root bin
+f usr/share/man/man9f/ddi_umem_lock.9f 0444 root bin
+s usr/share/man/man9f/ddi_umem_unlock.9f=ddi_umem_lock.9f
+s usr/share/man/man9f/ddi_unmap_regs.9f=ddi_map_regs.9f
+f usr/share/man/man9f/delay.9f 0444 root bin
+s usr/share/man/man9f/desballoc.9f=esballoc.9f
+f usr/share/man/man9f/devmap_default_access.9f 0444 root bin
+f usr/share/man/man9f/devmap_devmem_setup.9f 0444 root bin
+f usr/share/man/man9f/devmap_do_ctxmgt.9f 0444 root bin
+s usr/share/man/man9f/devmap_load.9f=devmap_unload.9f
+f usr/share/man/man9f/devmap_set_ctx_timeout.9f 0444 root bin
+f usr/share/man/man9f/devmap_setup.9f 0444 root bin
+s usr/share/man/man9f/devmap_umem_setup.9f=devmap_devmem_setup.9f
+f usr/share/man/man9f/devmap_unload.9f 0444 root bin
+f usr/share/man/man9f/disksort.9f 0444 root bin
+f usr/share/man/man9f/dlbindack.9f 0444 root bin
+s usr/share/man/man9f/dlerrorack.9f=dlbindack.9f
+s usr/share/man/man9f/dlokack.9f=dlbindack.9f
+s usr/share/man/man9f/dlphysaddrack.9f=dlbindack.9f
+s usr/share/man/man9f/dluderrorind.9f=dlbindack.9f
+f usr/share/man/man9f/drv_getparm.9f 0444 root bin
+f usr/share/man/man9f/drv_hztousec.9f 0444 root bin
+f usr/share/man/man9f/drv_priv.9f 0444 root bin
+f usr/share/man/man9f/drv_usectohz.9f 0444 root bin
+f usr/share/man/man9f/drv_usecwait.9f 0444 root bin
+f usr/share/man/man9f/dupb.9f 0444 root bin
+f usr/share/man/man9f/dupmsg.9f 0444 root bin
+f usr/share/man/man9f/enableok.9f 0444 root bin
+f usr/share/man/man9f/esballoc.9f 0444 root bin
+f usr/share/man/man9f/esbbcall.9f 0444 root bin
+f usr/share/man/man9f/flushband.9f 0444 root bin
+f usr/share/man/man9f/flushq.9f 0444 root bin
+s usr/share/man/man9f/free_pktiopb.9f=get_pktiopb.9f
+f usr/share/man/man9f/freeb.9f 0444 root bin
+f usr/share/man/man9f/freemsg.9f 0444 root bin
+f usr/share/man/man9f/freerbuf.9f 0444 root bin
+f usr/share/man/man9f/freezestr.9f 0444 root bin
+f usr/share/man/man9f/get_pktiopb.9f 0444 root bin
+f usr/share/man/man9f/geterror.9f 0444 root bin
+f usr/share/man/man9f/gethrtime.9f 0444 root bin
+f usr/share/man/man9f/getmajor.9f 0444 root bin
+f usr/share/man/man9f/getminor.9f 0444 root bin
+f usr/share/man/man9f/getq.9f 0444 root bin
+f usr/share/man/man9f/getrbuf.9f 0444 root bin
+f usr/share/man/man9f/gld.9f 0444 root bin
+s usr/share/man/man9f/gld_intr.9f=gld.9f
+s usr/share/man/man9f/gld_mac_alloc.9f=gld.9f
+s usr/share/man/man9f/gld_mac_free.9f=gld.9f
+s usr/share/man/man9f/gld_recv.9f=gld.9f
+s usr/share/man/man9f/gld_register.9f=gld.9f
+s usr/share/man/man9f/gld_sched.9f=gld.9f
+s usr/share/man/man9f/gld_unregister.9f=gld.9f
+f usr/share/man/man9f/hook_alloc.9f 0444 root bin
+f usr/share/man/man9f/hook_free.9f 0444 root bin
+f usr/share/man/man9f/id32_alloc.9f 0444 root bin
+s usr/share/man/man9f/id32_free.9f=id32_alloc.9f
+s usr/share/man/man9f/id32_lookup.9f=id32_alloc.9f
+f usr/share/man/man9f/inb.9f 0444 root bin
+s usr/share/man/man9f/inl.9f=inb.9f
+f usr/share/man/man9f/insq.9f 0444 root bin
+s usr/share/man/man9f/intro.9f=Intro.9f
+s usr/share/man/man9f/inw.9f=inb.9f
+f usr/share/man/man9f/kiconv.9f 0444 root bin
+f usr/share/man/man9f/kiconv_close.9f 0444 root bin
+f usr/share/man/man9f/kiconv_open.9f 0444 root bin
+f usr/share/man/man9f/kiconvstr.9f 0444 root bin
+f usr/share/man/man9f/kmem_alloc.9f 0444 root bin
+s usr/share/man/man9f/kmem_cache_alloc.9f=kmem_cache_create.9f
+f usr/share/man/man9f/kmem_cache_create.9f 0444 root bin
+s usr/share/man/man9f/kmem_cache_destroy.9f=kmem_cache_create.9f
+s usr/share/man/man9f/kmem_cache_free.9f=kmem_cache_create.9f
+s usr/share/man/man9f/kmem_cache_set_move.9f=kmem_cache_create.9f
+s usr/share/man/man9f/kmem_free.9f=kmem_alloc.9f
+s usr/share/man/man9f/kmem_zalloc.9f=kmem_alloc.9f
+f usr/share/man/man9f/kstat_create.9f 0444 root bin
+f usr/share/man/man9f/kstat_delete.9f 0444 root bin
+f usr/share/man/man9f/kstat_install.9f 0444 root bin
+f usr/share/man/man9f/kstat_named_init.9f 0444 root bin
+s usr/share/man/man9f/kstat_named_setstr.9f=kstat_named_init.9f
+f usr/share/man/man9f/kstat_queue.9f 0444 root bin
+s usr/share/man/man9f/kstat_runq_back_to_waitq.9f=kstat_queue.9f
+s usr/share/man/man9f/kstat_runq_enter.9f=kstat_queue.9f
+s usr/share/man/man9f/kstat_runq_exit.9f=kstat_queue.9f
+s usr/share/man/man9f/kstat_waitq_enter.9f=kstat_queue.9f
+s usr/share/man/man9f/kstat_waitq_exit.9f=kstat_queue.9f
+s usr/share/man/man9f/kstat_waitq_to_runq.9f=kstat_queue.9f
+f usr/share/man/man9f/ldi_add_event_handler.9f 0444 root bin
+f usr/share/man/man9f/ldi_aread.9f 0444 root bin
+s usr/share/man/man9f/ldi_awrite.9f=ldi_aread.9f
+s usr/share/man/man9f/ldi_close.9f=ldi_open_by_dev.9f
+f usr/share/man/man9f/ldi_devmap.9f 0444 root bin
+f usr/share/man/man9f/ldi_dump.9f 0444 root bin
+f usr/share/man/man9f/ldi_ev_finalize.9f 0444 root bin
+f usr/share/man/man9f/ldi_ev_get_cookie.9f 0444 root bin
+f usr/share/man/man9f/ldi_ev_get_type.9f 0444 root bin
+f usr/share/man/man9f/ldi_ev_notify.9f 0444 root bin
+f usr/share/man/man9f/ldi_ev_register_callbacks.9f 0444 root bin
+f usr/share/man/man9f/ldi_ev_remove_callbacks.9f 0444 root bin
+f usr/share/man/man9f/ldi_get_dev.9f 0444 root bin
+s usr/share/man/man9f/ldi_get_devid.9f=ldi_get_dev.9f
+f usr/share/man/man9f/ldi_get_eventcookie.9f 0444 root bin
+s usr/share/man/man9f/ldi_get_minor_name.9f=ldi_get_dev.9f
+s usr/share/man/man9f/ldi_get_otyp.9f=ldi_get_dev.9f
+f usr/share/man/man9f/ldi_get_size.9f 0444 root bin
+s usr/share/man/man9f/ldi_getmsg.9f=ldi_putmsg.9f
+f usr/share/man/man9f/ldi_ident_from_dev.9f 0444 root bin
+s usr/share/man/man9f/ldi_ident_from_dip.9f=ldi_ident_from_dev.9f
+s usr/share/man/man9f/ldi_ident_from_stream.9f=ldi_ident_from_dev.9f
+s usr/share/man/man9f/ldi_ident_release.9f=ldi_ident_from_dev.9f
+f usr/share/man/man9f/ldi_ioctl.9f 0444 root bin
+f usr/share/man/man9f/ldi_open_by_dev.9f 0444 root bin
+s usr/share/man/man9f/ldi_open_by_devid.9f=ldi_open_by_dev.9f
+s usr/share/man/man9f/ldi_open_by_name.9f=ldi_open_by_dev.9f
+f usr/share/man/man9f/ldi_poll.9f 0444 root bin
+f usr/share/man/man9f/ldi_prop_exists.9f 0444 root bin
+f usr/share/man/man9f/ldi_prop_get_int.9f 0444 root bin
+s usr/share/man/man9f/ldi_prop_get_int64.9f=ldi_prop_get_int.9f
+s usr/share/man/man9f/ldi_prop_lookup_byte_array.9f=ldi_prop_lookup_int_array.9f
+s usr/share/man/man9f/ldi_prop_lookup_int64_array.9f=ldi_prop_lookup_int_array.9f
+f usr/share/man/man9f/ldi_prop_lookup_int_array.9f 0444 root bin
+s usr/share/man/man9f/ldi_prop_lookup_string.9f=ldi_prop_lookup_int_array.9f
+s usr/share/man/man9f/ldi_prop_lookup_string_array.9f=ldi_prop_lookup_int_array.9f
+f usr/share/man/man9f/ldi_putmsg.9f 0444 root bin
+f usr/share/man/man9f/ldi_read.9f 0444 root bin
+f usr/share/man/man9f/ldi_remove_event_handler.9f 0444 root bin
+f usr/share/man/man9f/ldi_strategy.9f 0444 root bin
+s usr/share/man/man9f/ldi_write.9f=ldi_read.9f
+f usr/share/man/man9f/linkb.9f 0444 root bin
+f usr/share/man/man9f/list_create.9f 0444 root bin
+s usr/share/man/man9f/list_destroy.9f=list_create.9f
+s usr/share/man/man9f/list_head.9f=list_create.9f
+s usr/share/man/man9f/list_insert_after.9f=list_create.9f
+s usr/share/man/man9f/list_insert_before.9f=list_create.9f
+s usr/share/man/man9f/list_insert_head.9f=list_create.9f
+s usr/share/man/man9f/list_insert_tail.9f=list_create.9f
+s usr/share/man/man9f/list_is_empty.9f=list_create.9f
+s usr/share/man/man9f/list_link_active.9f=list_create.9f
+s usr/share/man/man9f/list_link_init.9f=list_create.9f
+s usr/share/man/man9f/list_link_replace.9f=list_create.9f
+s usr/share/man/man9f/list_move_tail.9f=list_create.9f
+s usr/share/man/man9f/list_next.9f=list_create.9f
+s usr/share/man/man9f/list_prev.9f=list_create.9f
+s usr/share/man/man9f/list_remove.9f=list_create.9f
+s usr/share/man/man9f/list_remove_head.9f=list_create.9f
+s usr/share/man/man9f/list_remove_tail.9f=list_create.9f
+s usr/share/man/man9f/list_tail.9f=list_create.9f
+f usr/share/man/man9f/makecom.9f 0444 root bin
+s usr/share/man/man9f/makecom_g0.9f=makecom.9f
+s usr/share/man/man9f/makecom_g0_s.9f=makecom.9f
+s usr/share/man/man9f/makecom_g1.9f=makecom.9f
+s usr/share/man/man9f/makecom_g5.9f=makecom.9f
+f usr/share/man/man9f/makedevice.9f 0444 root bin
+f usr/share/man/man9f/max.9f 0444 root bin
+f usr/share/man/man9f/mcopyin.9f 0444 root bin
+f usr/share/man/man9f/mcopymsg.9f 0444 root bin
+f usr/share/man/man9f/mcopyout.9f 0444 root bin
+s usr/share/man/man9f/membar_consumer.9f=membar_ops.9f
+s usr/share/man/man9f/membar_enter.9f=membar_ops.9f
+s usr/share/man/man9f/membar_exit.9f=membar_ops.9f
+f usr/share/man/man9f/membar_ops.9f 0444 root bin
+s usr/share/man/man9f/membar_producer.9f=membar_ops.9f
+f usr/share/man/man9f/memchr.9f 0444 root bin
+s usr/share/man/man9f/memcmp.9f=memchr.9f
+s usr/share/man/man9f/memcpy.9f=memchr.9f
+s usr/share/man/man9f/memmove.9f=memchr.9f
+s usr/share/man/man9f/memset.9f=memchr.9f
+f usr/share/man/man9f/merror.9f 0444 root bin
+f usr/share/man/man9f/mexchange.9f 0444 root bin
+f usr/share/man/man9f/min.9f 0444 root bin
+s usr/share/man/man9f/minphys.9f=physio.9f
+f usr/share/man/man9f/mioc2ack.9f 0444 root bin
+f usr/share/man/man9f/miocack.9f 0444 root bin
+f usr/share/man/man9f/miocnak.9f 0444 root bin
+f usr/share/man/man9f/miocpullup.9f 0444 root bin
+f usr/share/man/man9f/mkiocb.9f 0444 root bin
+s usr/share/man/man9f/mod_info.9f=mod_install.9f
+f usr/share/man/man9f/mod_install.9f 0444 root bin
+s usr/share/man/man9f/mod_modname.9f=mod_install.9f
+s usr/share/man/man9f/mod_remove.9f=mod_install.9f
+f usr/share/man/man9f/msgdsize.9f 0444 root bin
+f usr/share/man/man9f/msgpullup.9f 0444 root bin
+f usr/share/man/man9f/msgsize.9f 0444 root bin
+f usr/share/man/man9f/mt-streams.9f 0444 root bin
+f usr/share/man/man9f/mutex.9f 0444 root bin
+s usr/share/man/man9f/mutex_destroy.9f=mutex.9f
+s usr/share/man/man9f/mutex_enter.9f=mutex.9f
+s usr/share/man/man9f/mutex_exit.9f=mutex.9f
+s usr/share/man/man9f/mutex_init.9f=mutex.9f
+s usr/share/man/man9f/mutex_owned.9f=mutex.9f
+s usr/share/man/man9f/mutex_tryenter.9f=mutex.9f
+f usr/share/man/man9f/net_event_notify_register.9f 0444 root bin
+s usr/share/man/man9f/net_event_notify_unregister.9f=net_event_notify_register.9f
+f usr/share/man/man9f/net_getifname.9f 0444 root bin
+f usr/share/man/man9f/net_getlifaddr.9f 0444 root bin
+f usr/share/man/man9f/net_getmtu.9f 0444 root bin
+f usr/share/man/man9f/net_getnetid.9f 0444 root bin
+f usr/share/man/man9f/net_getpmtuenabled.9f 0444 root bin
+f usr/share/man/man9f/net_hook_register.9f 0444 root bin
+f usr/share/man/man9f/net_hook_unregister.9f 0444 root bin
+f usr/share/man/man9f/net_inject.9f 0444 root bin
+f usr/share/man/man9f/net_inject_alloc.9f 0444 root bin
+f usr/share/man/man9f/net_inject_free.9f 0444 root bin
+f usr/share/man/man9f/net_instance_alloc.9f 0444 root bin
+f usr/share/man/man9f/net_instance_free.9f 0444 root bin
+f usr/share/man/man9f/net_instance_notify_register.9f 0444 root bin
+s usr/share/man/man9f/net_instance_notify_unregister.9f=net_instance_notify_register.9f
+s usr/share/man/man9f/net_instance_protocol_unregister.9f=net_protocol_notify_register.9f
+f usr/share/man/man9f/net_instance_register.9f 0444 root bin
+f usr/share/man/man9f/net_instance_unregister.9f 0444 root bin
+f usr/share/man/man9f/net_ispartialchecksum.9f 0444 root bin
+f usr/share/man/man9f/net_isvalidchecksum.9f 0444 root bin
+f usr/share/man/man9f/net_kstat_create.9f 0444 root bin
+f usr/share/man/man9f/net_kstat_delete.9f 0444 root bin
+f usr/share/man/man9f/net_lifgetnext.9f 0444 root bin
+f usr/share/man/man9f/net_netidtozonid.9f 0444 root bin
+f usr/share/man/man9f/net_phygetnext.9f 0444 root bin
+f usr/share/man/man9f/net_phylookup.9f 0444 root bin
+f usr/share/man/man9f/net_protocol_lookup.9f 0444 root bin
+f usr/share/man/man9f/net_protocol_notify_register.9f 0444 root bin
+f usr/share/man/man9f/net_protocol_release.9f 0444 root bin
+f usr/share/man/man9f/net_protocol_walk.9f 0444 root bin
+f usr/share/man/man9f/net_routeto.9f 0444 root bin
+f usr/share/man/man9f/net_zoneidtonetid.9f 0444 root bin
+f usr/share/man/man9f/netinfo.9f 0444 root bin
+f usr/share/man/man9f/nochpoll.9f 0444 root bin
+f usr/share/man/man9f/nodev.9f 0444 root bin
+f usr/share/man/man9f/noenable.9f 0444 root bin
+f usr/share/man/man9f/nulldev.9f 0444 root bin
+s usr/share/man/man9f/numtos.9f=stoi.9f
+s usr/share/man/man9f/nv_alloc_fini.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nv_alloc_init.9f=nvlist_alloc.9f
+f usr/share/man/man9f/nvlist_add_boolean.9f 0444 root bin
+s usr/share/man/man9f/nvlist_add_boolean_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_boolean_value.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_byte.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_byte_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int16.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int16_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int32.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int32_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int64.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int64_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int8.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_int8_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_nvlist.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_nvlist_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_nvpair.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_string.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_string_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint16.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint16_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint32.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint32_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint64.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint64_array.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint8.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_add_uint8_array.9f=nvlist_add_boolean.9f
+f usr/share/man/man9f/nvlist_alloc.9f 0444 root bin
+s usr/share/man/man9f/nvlist_dup.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvlist_exists.9f=nvlist_lookup_nvpair.9f
+s usr/share/man/man9f/nvlist_free.9f=nvlist_alloc.9f
+f usr/share/man/man9f/nvlist_lookup_boolean.9f 0444 root bin
+s usr/share/man/man9f/nvlist_lookup_boolean_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_boolean_value.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_byte.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_byte_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int16.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int16_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int32.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int32_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int64.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int64_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int8.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_int8_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_nvlist.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_nvlist_array.9f=nvlist_lookup_boolean.9f
+f usr/share/man/man9f/nvlist_lookup_nvpair.9f 0444 root bin
+s usr/share/man/man9f/nvlist_lookup_pairs.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_string.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_string_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint16.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint16_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint32.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint32_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint64.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint64_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint8.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_lookup_uint8_array.9f=nvlist_lookup_boolean.9f
+s usr/share/man/man9f/nvlist_merge.9f=nvlist_alloc.9f
+f usr/share/man/man9f/nvlist_next_nvpair.9f 0444 root bin
+s usr/share/man/man9f/nvlist_pack.9f=nvlist_alloc.9f
+f usr/share/man/man9f/nvlist_remove.9f 0444 root bin
+s usr/share/man/man9f/nvlist_remove_all.9f=nvlist_remove.9f
+s usr/share/man/man9f/nvlist_size.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvlist_t.9f=nvlist_add_boolean.9f
+s usr/share/man/man9f/nvlist_unpack.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvlist_xalloc.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvlist_xdup.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvlist_xpack.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvlist_xunpack.9f=nvlist_alloc.9f
+s usr/share/man/man9f/nvpair_name.9f=nvlist_next_nvpair.9f
+s usr/share/man/man9f/nvpair_type.9f=nvlist_next_nvpair.9f
+s usr/share/man/man9f/nvpair_value_boolean_array.9f=nvpair_value_byte.9f
+f usr/share/man/man9f/nvpair_value_byte.9f 0444 root bin
+s usr/share/man/man9f/nvpair_value_byte_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int16.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int16_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int32.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int32_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int64.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int64_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int8.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_int8_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_nvlist.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_nvlist_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_string.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_string_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint16.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint16_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint32.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint32_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint64.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint64_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint8.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/nvpair_value_uint8_array.9f=nvpair_value_byte.9f
+s usr/share/man/man9f/otherq.9f=OTHERQ.9f
+f usr/share/man/man9f/outb.9f 0444 root bin
+s usr/share/man/man9f/outl.9f=outb.9f
+s usr/share/man/man9f/outw.9f=outb.9f
+s usr/share/man/man9f/pci_config_get16.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_get32.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_get64.9f=pci_config_get8.9f
+f usr/share/man/man9f/pci_config_get8.9f 0444 root bin
+s usr/share/man/man9f/pci_config_getb.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_getl.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_getll.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_getw.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_put16.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_put32.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_put64.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_put8.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_putb.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_putl.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_putll.9f=pci_config_get8.9f
+s usr/share/man/man9f/pci_config_putw.9f=pci_config_get8.9f
+f usr/share/man/man9f/pci_config_setup.9f 0444 root bin
+s usr/share/man/man9f/pci_config_teardown.9f=pci_config_setup.9f
+s usr/share/man/man9f/pci_ereport_post.9f=pci_ereport_setup.9f
+f usr/share/man/man9f/pci_ereport_setup.9f 0444 root bin
+s usr/share/man/man9f/pci_ereport_teardown.9f=pci_ereport_setup.9f
+f usr/share/man/man9f/pci_report_pmcap.9f 0444 root bin
+s usr/share/man/man9f/pci_restore_config_regs.9f=pci_save_config_regs.9f
+f usr/share/man/man9f/pci_save_config_regs.9f 0444 root bin
+f usr/share/man/man9f/physio.9f 0444 root bin
+f usr/share/man/man9f/pm_busy_component.9f 0444 root bin
+s usr/share/man/man9f/pm_idle_component.9f=pm_busy_component.9f
+s usr/share/man/man9f/pm_lower_power.9f=pm_raise_power.9f
+f usr/share/man/man9f/pm_power_has_changed.9f 0444 root bin
+f usr/share/man/man9f/pm_raise_power.9f 0444 root bin
+f usr/share/man/man9f/pm_trans_check.9f 0444 root bin
+f usr/share/man/man9f/pollwakeup.9f 0444 root bin
+f usr/share/man/man9f/priv_getbyname.9f 0444 root bin
+f usr/share/man/man9f/priv_policy.9f 0444 root bin
+s usr/share/man/man9f/priv_policy_choice.9f=priv_policy.9f
+s usr/share/man/man9f/priv_policy_only.9f=priv_policy.9f
+s usr/share/man/man9f/proc_ref.9f=proc_signal.9f
+f usr/share/man/man9f/proc_signal.9f 0444 root bin
+s usr/share/man/man9f/proc_unref.9f=proc_signal.9f
+f usr/share/man/man9f/ptob.9f 0444 root bin
+f usr/share/man/man9f/pullupmsg.9f 0444 root bin
+f usr/share/man/man9f/put.9f 0444 root bin
+f usr/share/man/man9f/putbq.9f 0444 root bin
+f usr/share/man/man9f/putctl.9f 0444 root bin
+f usr/share/man/man9f/putctl1.9f 0444 root bin
+f usr/share/man/man9f/putnext.9f 0444 root bin
+f usr/share/man/man9f/putnextctl.9f 0444 root bin
+f usr/share/man/man9f/putnextctl1.9f 0444 root bin
+f usr/share/man/man9f/putq.9f 0444 root bin
+f usr/share/man/man9f/qassociate.9f 0444 root bin
+f usr/share/man/man9f/qbufcall.9f 0444 root bin
+f usr/share/man/man9f/qenable.9f 0444 root bin
+s usr/share/man/man9f/qprocsoff.9f=qprocson.9f
+f usr/share/man/man9f/qprocson.9f 0444 root bin
+f usr/share/man/man9f/qreply.9f 0444 root bin
+f usr/share/man/man9f/qsize.9f 0444 root bin
+f usr/share/man/man9f/qtimeout.9f 0444 root bin
+f usr/share/man/man9f/qunbufcall.9f 0444 root bin
+f usr/share/man/man9f/quntimeout.9f 0444 root bin
+f usr/share/man/man9f/qwait.9f 0444 root bin
+s usr/share/man/man9f/qwait_sig.9f=qwait.9f
+f usr/share/man/man9f/qwriter.9f 0444 root bin
+s usr/share/man/man9f/rd.9f=RD.9f
+s usr/share/man/man9f/repinsb.9f=inb.9f
+s usr/share/man/man9f/repinsd.9f=inb.9f
+s usr/share/man/man9f/repinsw.9f=inb.9f
+s usr/share/man/man9f/repoutsb.9f=outb.9f
+s usr/share/man/man9f/repoutsd.9f=outb.9f
+s usr/share/man/man9f/repoutsw.9f=outb.9f
+f usr/share/man/man9f/rmalloc.9f 0444 root bin
+f usr/share/man/man9f/rmalloc_wait.9f 0444 root bin
+f usr/share/man/man9f/rmallocmap.9f 0444 root bin
+s usr/share/man/man9f/rmallocmap_wait.9f=rmallocmap.9f
+f usr/share/man/man9f/rmfree.9f 0444 root bin
+s usr/share/man/man9f/rmfreemap.9f=rmallocmap.9f
+f usr/share/man/man9f/rmvb.9f 0444 root bin
+f usr/share/man/man9f/rmvq.9f 0444 root bin
+s usr/share/man/man9f/rw_destroy.9f=rwlock.9f
+s usr/share/man/man9f/rw_downgrade.9f=rwlock.9f
+s usr/share/man/man9f/rw_enter.9f=rwlock.9f
+s usr/share/man/man9f/rw_exit.9f=rwlock.9f
+s usr/share/man/man9f/rw_init.9f=rwlock.9f
+s usr/share/man/man9f/rw_read_locked.9f=rwlock.9f
+s usr/share/man/man9f/rw_tryenter.9f=rwlock.9f
+s usr/share/man/man9f/rw_tryupgrade.9f=rwlock.9f
+f usr/share/man/man9f/rwlock.9f 0444 root bin
+s usr/share/man/man9f/samestr.9f=SAMESTR.9f
+f usr/share/man/man9f/scsi_abort.9f 0444 root bin
+f usr/share/man/man9f/scsi_alloc_consistent_buf.9f 0444 root bin
+f usr/share/man/man9f/scsi_cname.9f 0444 root bin
+f usr/share/man/man9f/scsi_destroy_pkt.9f 0444 root bin
+s usr/share/man/man9f/scsi_dmafree.9f=scsi_dmaget.9f
+f usr/share/man/man9f/scsi_dmaget.9f 0444 root bin
+s usr/share/man/man9f/scsi_dname.9f=scsi_cname.9f
+f usr/share/man/man9f/scsi_errmsg.9f 0444 root bin
+f usr/share/man/man9f/scsi_ext_sense_fields.9f 0444 root bin
+f usr/share/man/man9f/scsi_find_sense_descr.9f 0444 root bin
+f usr/share/man/man9f/scsi_free_consistent_buf.9f 0444 root bin
+f usr/share/man/man9f/scsi_get_device_type_scsi_options.9f 0444 root bin
+f usr/share/man/man9f/scsi_get_device_type_string.9f 0444 root bin
+s usr/share/man/man9f/scsi_hba_attach.9f=scsi_hba_attach_setup.9f
+f usr/share/man/man9f/scsi_hba_attach_setup.9f 0444 root bin
+s usr/share/man/man9f/scsi_hba_detach.9f=scsi_hba_attach_setup.9f
+s usr/share/man/man9f/scsi_hba_fini.9f=scsi_hba_init.9f
+f usr/share/man/man9f/scsi_hba_init.9f 0444 root bin
+f usr/share/man/man9f/scsi_hba_lookup_capstr.9f 0444 root bin
+f usr/share/man/man9f/scsi_hba_pkt_alloc.9f 0444 root bin
+f usr/share/man/man9f/scsi_hba_pkt_comp.9f 0444 root bin
+s usr/share/man/man9f/scsi_hba_pkt_free.9f=scsi_hba_pkt_alloc.9f
+f usr/share/man/man9f/scsi_hba_probe.9f 0444 root bin
+f usr/share/man/man9f/scsi_hba_tran_alloc.9f 0444 root bin
+s usr/share/man/man9f/scsi_hba_tran_free.9f=scsi_hba_tran_alloc.9f
+f usr/share/man/man9f/scsi_ifgetcap.9f 0444 root bin
+s usr/share/man/man9f/scsi_ifsetcap.9f=scsi_ifgetcap.9f
+f usr/share/man/man9f/scsi_init_pkt.9f 0444 root bin
+f usr/share/man/man9f/scsi_log.9f 0444 root bin
+s usr/share/man/man9f/scsi_mname.9f=scsi_cname.9f
+f usr/share/man/man9f/scsi_pktalloc.9f 0444 root bin
+s usr/share/man/man9f/scsi_pktfree.9f=scsi_pktalloc.9f
+f usr/share/man/man9f/scsi_poll.9f 0444 root bin
+f usr/share/man/man9f/scsi_probe.9f 0444 root bin
+s usr/share/man/man9f/scsi_resalloc.9f=scsi_pktalloc.9f
+f usr/share/man/man9f/scsi_reset.9f 0444 root bin
+f usr/share/man/man9f/scsi_reset_notify.9f 0444 root bin
+s usr/share/man/man9f/scsi_resfree.9f=scsi_pktalloc.9f
+s usr/share/man/man9f/scsi_rname.9f=scsi_cname.9f
+s usr/share/man/man9f/scsi_sense_asc.9f=scsi_sense_key.9f
+s usr/share/man/man9f/scsi_sense_ascq.9f=scsi_sense_key.9f
+s usr/share/man/man9f/scsi_sense_cmdspecific_uint64.9f=scsi_ext_sense_fields.9f
+s usr/share/man/man9f/scsi_sense_info_uint64.9f=scsi_ext_sense_fields.9f
+f usr/share/man/man9f/scsi_sense_key.9f 0444 root bin
+f usr/share/man/man9f/scsi_setup_cdb.9f 0444 root bin
+f usr/share/man/man9f/scsi_slave.9f 0444 root bin
+s usr/share/man/man9f/scsi_sname.9f=scsi_cname.9f
+f usr/share/man/man9f/scsi_sync_pkt.9f 0444 root bin
+f usr/share/man/man9f/scsi_transport.9f 0444 root bin
+f usr/share/man/man9f/scsi_unprobe.9f 0444 root bin
+s usr/share/man/man9f/scsi_unslave.9f=scsi_unprobe.9f
+f usr/share/man/man9f/scsi_validate_sense.9f 0444 root bin
+f usr/share/man/man9f/scsi_vu_errmsg.9f 0444 root bin
+s usr/share/man/man9f/sema_destroy.9f=semaphore.9f
+s usr/share/man/man9f/sema_init.9f=semaphore.9f
+s usr/share/man/man9f/sema_p.9f=semaphore.9f
+s usr/share/man/man9f/sema_p_sig.9f=semaphore.9f
+s usr/share/man/man9f/sema_tryp.9f=semaphore.9f
+s usr/share/man/man9f/sema_v.9f=semaphore.9f
+f usr/share/man/man9f/semaphore.9f 0444 root bin
+f usr/share/man/man9f/stoi.9f 0444 root bin
+s usr/share/man/man9f/strcasecmp.9f=string.9f
+s usr/share/man/man9f/strchr.9f=string.9f
+s usr/share/man/man9f/strcmp.9f=string.9f
+s usr/share/man/man9f/strcpy.9f=string.9f
+s usr/share/man/man9f/strdup.9f=string.9f
+s usr/share/man/man9f/strfree.9f=string.9f
+f usr/share/man/man9f/string.9f 0444 root bin
+s usr/share/man/man9f/strlcat.9f=string.9f
+s usr/share/man/man9f/strlcpy.9f=string.9f
+s usr/share/man/man9f/strlen.9f=string.9f
+f usr/share/man/man9f/strlog.9f 0444 root bin
+s usr/share/man/man9f/strncasecmp.9f=string.9f
+s usr/share/man/man9f/strncat.9f=string.9f
+s usr/share/man/man9f/strncmp.9f=string.9f
+s usr/share/man/man9f/strncpy.9f=string.9f
+s usr/share/man/man9f/strnlen.9f=string.9f
+f usr/share/man/man9f/strqget.9f 0444 root bin
+f usr/share/man/man9f/strqset.9f 0444 root bin
+s usr/share/man/man9f/strrchr.9f=string.9f
+s usr/share/man/man9f/strspn.9f=string.9f
+f usr/share/man/man9f/swab.9f 0444 root bin
+f usr/share/man/man9f/taskq.9f 0444 root bin
+s usr/share/man/man9f/taskq_suspended.9f=taskq.9f
+f usr/share/man/man9f/testb.9f 0444 root bin
+f usr/share/man/man9f/timeout.9f 0444 root bin
+f usr/share/man/man9f/u8_strcmp.9f 0444 root bin
+f usr/share/man/man9f/u8_textprep_str.9f 0444 root bin
+f usr/share/man/man9f/u8_validate.9f 0444 root bin
+f usr/share/man/man9f/uconv_u16tou32.9f 0444 root bin
+s usr/share/man/man9f/uconv_u16tou8.9f=uconv_u16tou32.9f
+s usr/share/man/man9f/uconv_u32tou16.9f=uconv_u16tou32.9f
+s usr/share/man/man9f/uconv_u32tou8.9f=uconv_u16tou32.9f
+s usr/share/man/man9f/uconv_u8tou16.9f=uconv_u16tou32.9f
+s usr/share/man/man9f/uconv_u8tou32.9f=uconv_u16tou32.9f
+f usr/share/man/man9f/uiomove.9f 0444 root bin
+f usr/share/man/man9f/unbufcall.9f 0444 root bin
+s usr/share/man/man9f/unfreezestr.9f=freezestr.9f
+f usr/share/man/man9f/unlinkb.9f 0444 root bin
+f usr/share/man/man9f/untimeout.9f 0444 root bin
+f usr/share/man/man9f/ureadc.9f 0444 root bin
+s usr/share/man/man9f/usb_alloc_bulk_req.9f=usb_alloc_request.9f
+s usr/share/man/man9f/usb_alloc_ctrl_req.9f=usb_alloc_request.9f
+s usr/share/man/man9f/usb_alloc_intr_req.9f=usb_alloc_request.9f
+s usr/share/man/man9f/usb_alloc_isoc_req.9f=usb_alloc_request.9f
+f usr/share/man/man9f/usb_alloc_request.9f 0444 root bin
+f usr/share/man/man9f/usb_client_attach.9f 0444 root bin
+s usr/share/man/man9f/usb_client_detach.9f=usb_client_attach.9f
+f usr/share/man/man9f/usb_clr_feature.9f 0444 root bin
+f usr/share/man/man9f/usb_create_pm_components.9f 0444 root bin
+s usr/share/man/man9f/usb_free_bulk_req.9f=usb_alloc_request.9f
+s usr/share/man/man9f/usb_free_ctrl_req.9f=usb_alloc_request.9f
+s usr/share/man/man9f/usb_free_descr_tree.9f=usb_get_dev_data.9f
+s usr/share/man/man9f/usb_free_dev_data.9f=usb_get_dev_data.9f
+s usr/share/man/man9f/usb_free_intr_req.9f=usb_alloc_request.9f
+s usr/share/man/man9f/usb_free_isoc_req.9f=usb_alloc_request.9f
+f usr/share/man/man9f/usb_get_addr.9f 0444 root bin
+f usr/share/man/man9f/usb_get_alt_if.9f 0444 root bin
+f usr/share/man/man9f/usb_get_cfg.9f 0444 root bin
+f usr/share/man/man9f/usb_get_current_frame_number.9f 0444 root bin
+f usr/share/man/man9f/usb_get_dev_data.9f 0444 root bin
+s usr/share/man/man9f/usb_get_if_number.9f=usb_get_alt_if.9f
+f usr/share/man/man9f/usb_get_max_pkts_per_isoc_request.9f 0444 root bin
+f usr/share/man/man9f/usb_get_status.9f 0444 root bin
+f usr/share/man/man9f/usb_get_string_descr.9f 0444 root bin
+f usr/share/man/man9f/usb_handle_remote_wakeup.9f 0444 root bin
+f usr/share/man/man9f/usb_lookup_ep_data.9f 0444 root bin
+s usr/share/man/man9f/usb_owns_device.9f=usb_get_alt_if.9f
+f usr/share/man/man9f/usb_parse_data.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_bulk_xfer.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_close.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_ctrl_xfer.9f 0444 root bin
+s usr/share/man/man9f/usb_pipe_ctrl_xfer_wait.9f=usb_pipe_ctrl_xfer.9f
+f usr/share/man/man9f/usb_pipe_drain_reqs.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_get_max_bulk_transfer_size.9f 0444 root bin
+s usr/share/man/man9f/usb_pipe_get_private.9f=usb_pipe_set_private.9f
+f usr/share/man/man9f/usb_pipe_get_state.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_intr_xfer.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_isoc_xfer.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_open.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_reset.9f 0444 root bin
+f usr/share/man/man9f/usb_pipe_set_private.9f 0444 root bin
+s usr/share/man/man9f/usb_pipe_stop_intr_polling.9f=usb_pipe_intr_xfer.9f
+s usr/share/man/man9f/usb_pipe_stop_isoc_polling.9f=usb_pipe_isoc_xfer.9f
+s usr/share/man/man9f/usb_print_descr_tree.9f=usb_get_dev_data.9f
+f usr/share/man/man9f/usb_register_hotplug_cbs.9f 0444 root bin
+f usr/share/man/man9f/usb_reset_device.9f 0444 root bin
+s usr/share/man/man9f/usb_set_alt_if.9f=usb_get_alt_if.9f
+s usr/share/man/man9f/usb_set_cfg.9f=usb_get_cfg.9f
+s usr/share/man/man9f/usb_unregister_hotplug_cbs.9f=usb_register_hotplug_cbs.9f
+f usr/share/man/man9f/uwritec.9f 0444 root bin
+f usr/share/man/man9f/va_arg.9f 0444 root bin
+s usr/share/man/man9f/va_copy.9f=va_arg.9f
+s usr/share/man/man9f/va_end.9f=va_arg.9f
+s usr/share/man/man9f/va_start.9f=va_arg.9f
+s usr/share/man/man9f/vcmn_err.9f=cmn_err.9f
+f usr/share/man/man9f/vsprintf.9f 0444 root bin
+s usr/share/man/man9f/wr.9f=WR.9f
+s usr/share/man/man9f/zcmn_err.9f=cmn_err.9f
+d usr/share/man/man9p 0755 root bin
+s usr/share/man/man9p/Nblock.9p=size.9p
+s usr/share/man/man9p/blksize.9p=size.9p
+f usr/share/man/man9p/ddi-forceattach.9p 0444 root bin
+s usr/share/man/man9p/ddi-no-autodetach.9p=ddi-forceattach.9p
+s usr/share/man/man9p/device-blksize.9p=size.9p
+s usr/share/man/man9p/device-nblocks.9p=size.9p
+f usr/share/man/man9p/inquiry-device-type.9p 0444 root bin
+s usr/share/man/man9p/inquiry-product-id.9p=inquiry-device-type.9p
+s usr/share/man/man9p/inquiry-revision-id.9p=inquiry-device-type.9p
+s usr/share/man/man9p/inquiry-serial-no.9p=inquiry-device-type.9p
+s usr/share/man/man9p/inquiry-vendor-id.9p=inquiry-device-type.9p
+f usr/share/man/man9p/no-involuntary-power-cycles.9p 0444 root bin
+f usr/share/man/man9p/pm-components.9p 0444 root bin
+f usr/share/man/man9p/pm.9p 0444 root bin
+f usr/share/man/man9p/removable-media.9p 0444 root bin
+f usr/share/man/man9p/size.9p 0444 root bin
+d usr/share/man/man9s 0755 root bin
+f usr/share/man/man9s/Intro.9s 0444 root bin
+f usr/share/man/man9s/aio_req.9s 0444 root bin
+f usr/share/man/man9s/buf.9s 0444 root bin
+f usr/share/man/man9s/cb_ops.9s 0444 root bin
+f usr/share/man/man9s/copyreq.9s 0444 root bin
+f usr/share/man/man9s/copyresp.9s 0444 root bin
+f usr/share/man/man9s/datab.9s 0444 root bin
+s usr/share/man/man9s/dblk.9s=datab.9s
+f usr/share/man/man9s/ddi_device_acc_attr.9s 0444 root bin
+f usr/share/man/man9s/ddi_dma_attr.9s 0444 root bin
+f usr/share/man/man9s/ddi_dma_cookie.9s 0444 root bin
+s usr/share/man/man9s/ddi_dma_lim.9s=ddi_dma_lim_sparc.9s
+f usr/share/man/man9s/ddi_dma_lim_sparc.9s 0444 root bin
+f usr/share/man/man9s/ddi_dma_lim_x86.9s 0444 root bin
+f usr/share/man/man9s/ddi_dma_req.9s 0444 root bin
+f usr/share/man/man9s/ddi_dmae_req.9s 0444 root bin
+f usr/share/man/man9s/ddi_fm_error.9s 0444 root bin
+f usr/share/man/man9s/ddi_idevice_cookie.9s 0444 root bin
+f usr/share/man/man9s/dev_ops.9s 0444 root bin
+f usr/share/man/man9s/devmap_callback_ctl.9s 0444 root bin
+f usr/share/man/man9s/fmodsw.9s 0444 root bin
+f usr/share/man/man9s/free_rtn.9s 0444 root bin
+f usr/share/man/man9s/gld_mac_info.9s 0444 root bin
+f usr/share/man/man9s/gld_stats.9s 0444 root bin
+f usr/share/man/man9s/hook_nic_event.9s 0444 root bin
+f usr/share/man/man9s/hook_pkt_event.9s 0444 root bin
+f usr/share/man/man9s/hook_t.9s 0444 root bin
+s usr/share/man/man9s/intro.9s=Intro.9s
+f usr/share/man/man9s/iocblk.9s 0444 root bin
+f usr/share/man/man9s/iovec.9s 0444 root bin
+f usr/share/man/man9s/kstat.9s 0444 root bin
+f usr/share/man/man9s/kstat_intr.9s 0444 root bin
+f usr/share/man/man9s/kstat_io.9s 0444 root bin
+f usr/share/man/man9s/kstat_named.9s 0444 root bin
+f usr/share/man/man9s/linkblk.9s 0444 root bin
+s usr/share/man/man9s/mblk.9s=msgb.9s
+f usr/share/man/man9s/modldrv.9s 0444 root bin
+f usr/share/man/man9s/modlinkage.9s 0444 root bin
+f usr/share/man/man9s/modlmisc.9s 0444 root bin
+f usr/share/man/man9s/modlstrmod.9s 0444 root bin
+f usr/share/man/man9s/module_info.9s 0444 root bin
+f usr/share/man/man9s/msgb.9s 0444 root bin
+f usr/share/man/man9s/net_inject_t.9s 0444 root bin
+f usr/share/man/man9s/net_instance_t.9s 0444 root bin
+f usr/share/man/man9s/qband.9s 0444 root bin
+f usr/share/man/man9s/qinit.9s 0444 root bin
+f usr/share/man/man9s/queclass.9s 0444 root bin
+f usr/share/man/man9s/queue.9s 0444 root bin
+f usr/share/man/man9s/scsi_address.9s 0444 root bin
+f usr/share/man/man9s/scsi_arq_status.9s 0444 root bin
+f usr/share/man/man9s/scsi_asc_key_strings.9s 0444 root bin
+f usr/share/man/man9s/scsi_device.9s 0444 root bin
+f usr/share/man/man9s/scsi_extended_sense.9s 0444 root bin
+f usr/share/man/man9s/scsi_hba_tran.9s 0444 root bin
+f usr/share/man/man9s/scsi_inquiry.9s 0444 root bin
+f usr/share/man/man9s/scsi_pkt.9s 0444 root bin
+f usr/share/man/man9s/scsi_status.9s 0444 root bin
+f usr/share/man/man9s/streamtab.9s 0444 root bin
+f usr/share/man/man9s/stroptions.9s 0444 root bin
+f usr/share/man/man9s/tuple.9s 0444 root bin
+f usr/share/man/man9s/uio.9s 0444 root bin
+f usr/share/man/man9s/usb_bulk_request.9s 0444 root bin
+f usr/share/man/man9s/usb_callback_flags.9s 0444 root bin
+f usr/share/man/man9s/usb_cfg_descr.9s 0444 root bin
+f usr/share/man/man9s/usb_client_dev_data.9s 0444 root bin
+f usr/share/man/man9s/usb_completion_reason.9s 0444 root bin
+f usr/share/man/man9s/usb_ctrl_request.9s 0444 root bin
+f usr/share/man/man9s/usb_dev_descr.9s 0444 root bin
+f usr/share/man/man9s/usb_dev_qlf_descr.9s 0444 root bin
+f usr/share/man/man9s/usb_ep_descr.9s 0444 root bin
+f usr/share/man/man9s/usb_if_descr.9s 0444 root bin
+f usr/share/man/man9s/usb_intr_request.9s 0444 root bin
+f usr/share/man/man9s/usb_isoc_request.9s 0444 root bin
+f usr/share/man/man9s/usb_other_speed_cfg_descr.9s 0444 root bin
+f usr/share/man/man9s/usb_request_attributes.9s 0444 root bin
+f usr/share/man/man9s/usb_string_descr.9s 0444 root bin
+d usr/share/src 0755 root sys
+s usr/spool=../var/spool
+s usr/src=share/src
+s usr/tmp=../var/tmp
+d usr/ucb 0755 root bin
+d usr/ucb/amd64 0755 root bin
+f usr/ucb/amd64/ps 0555 root bin
+f usr/ucb/df 0755 root bin
+d usr/ucb/i86 0755 root bin
+f usr/ucb/ls 0755 root bin
+s usr/ucb/more=../bin/more
+s usr/ucb/page=../bin/more
+h usr/ucb/ps=usr/lib/isaexec
+f usr/ucb/shutdown 0755 root bin
+f usr/ucb/touch 0755 root bin
+s usr/ucb/uptime=../bin/uptime
+d usr/ucbinclude 0755 root bin
+f usr/ucbinclude/curses.h 0755 root bin
+f usr/ucbinclude/dbm.h 0755 root bin
+s usr/ucbinclude/fcntl.h=sys/fcntl.h
+f usr/ucbinclude/setjmp.h 0755 root bin
+f usr/ucbinclude/sgtty.h 0755 root bin
+f usr/ucbinclude/signal.h 0755 root bin
+f usr/ucbinclude/stdio.h 0755 root bin
+f usr/ucbinclude/strings.h 0755 root bin
+d usr/ucbinclude/sys 0755 root bin
+f usr/ucbinclude/sys/dir.h 0755 root bin
+f usr/ucbinclude/sys/fcntl.h 0755 root bin
+f usr/ucbinclude/sys/file.h 0755 root bin
+f usr/ucbinclude/sys/ioctl.h 0755 root bin
+f usr/ucbinclude/sys/param.h 0755 root bin
+f usr/ucbinclude/sys/resource.h 0755 root bin
+f usr/ucbinclude/sys/rusage.h 0755 root bin
+f usr/ucbinclude/sys/signal.h 0755 root bin
+f usr/ucbinclude/sys/sysmacros.h 0755 root bin
+f usr/ucbinclude/sys/ttychars.h 0755 root bin
+f usr/ucbinclude/sys/types.h 0755 root bin
+f usr/ucbinclude/sys/vfs.h 0755 root bin
+f usr/ucbinclude/sys/wait.h 0755 root bin
+f usr/ucbinclude/unistd.h 0755 root bin
+d usr/ucblib 0755 root bin
+s usr/ucblib/32=.
+s usr/ucblib/64=amd64
+d usr/ucblib/amd64 0755 root bin
+f usr/ucblib/amd64/libucb.so.1 0755 root bin
+s usr/ucblib/amd64/libucb.so=libucb.so.1
+f usr/ucblib/libucb.so.1 0755 root bin
+s usr/ucblib/libucb.so=libucb.so.1
+d usr/xpg4 0755 root bin
+d usr/xpg4/bin 0755 root bin
+s usr/xpg4/bin/alias=../../bin/alias
+f usr/xpg4/bin/ar 0555 root bin
+f usr/xpg4/bin/at 4755 root bin
+f usr/xpg4/bin/awk 0555 root bin
+f usr/xpg4/bin/basename 0555 root bin
+f usr/xpg4/bin/batch 0555 root bin
+s usr/xpg4/bin/bg=../../bin/alias
+s usr/xpg4/bin/cd=../../bin/alias
+f usr/xpg4/bin/chgrp 0555 root bin
+f usr/xpg4/bin/chown 0555 root bin
+s usr/xpg4/bin/command=../../bin/alias
+f usr/xpg4/bin/cp 0555 root bin
+f usr/xpg4/bin/crontab 4555 root bin
+f usr/xpg4/bin/ctags 0555 root bin
+f usr/xpg4/bin/date 0555 root bin
+f usr/xpg4/bin/df 0555 root bin
+f usr/xpg4/bin/du 0555 root bin
+f usr/xpg4/bin/ed 0555 root bin
+f usr/xpg4/bin/edit 0555 root bin
+h usr/xpg4/bin/egrep=usr/xpg4/bin/grep
+f usr/xpg4/bin/env 0555 root bin
+h usr/xpg4/bin/ex=usr/xpg4/bin/edit
+f usr/xpg4/bin/expr 0555 root bin
+s usr/xpg4/bin/fc=../../bin/alias
+s usr/xpg4/bin/fg=../../bin/alias
+h usr/xpg4/bin/fgrep=usr/xpg4/bin/grep
+f usr/xpg4/bin/file 0555 root bin
+f usr/xpg4/bin/find 0555 root bin
+f usr/xpg4/bin/getconf 0555 root bin
+s usr/xpg4/bin/getopts=../../bin/alias
+f usr/xpg4/bin/grep 0555 root bin
+s usr/xpg4/bin/hash=../../bin/alias
+f usr/xpg4/bin/id 0555 root bin
+s usr/xpg4/bin/ipcs=../../bin/ipcs
+s usr/xpg4/bin/jobs=../../bin/alias
+s usr/xpg4/bin/kill=../../bin/alias
+f usr/xpg4/bin/link 0555 root bin
+h usr/xpg4/bin/ln=usr/xpg4/bin/cp
+f usr/xpg4/bin/ls 0555 root bin
+f usr/xpg4/bin/m4 0555 root bin
+f usr/xpg4/bin/more 0555 root bin
+h usr/xpg4/bin/mv=usr/xpg4/bin/cp
+f usr/xpg4/bin/nice 0555 root bin
+f usr/xpg4/bin/nl 0555 root bin
+f usr/xpg4/bin/nm 0555 root bin
+f usr/xpg4/bin/nohup 0555 root bin
+s usr/xpg4/bin/od=../../bin/od
+s usr/xpg4/bin/pfsh=../../bin/pfexec
+f usr/xpg4/bin/pr 0555 root bin
+s usr/xpg4/bin/read=../../bin/alias
+f usr/xpg4/bin/rm 0555 root bin
+f usr/xpg4/bin/sed 0555 root bin
+s usr/xpg4/bin/sh=../../bin/ksh93
+f usr/xpg4/bin/sort 0555 root bin
+f usr/xpg4/bin/stty 0555 root bin
+s usr/xpg4/bin/tail=../../bin/tail
+s usr/xpg4/bin/test=../../bin/alias
+s usr/xpg4/bin/tr=../../bin/tr
+s usr/xpg4/bin/type=../../bin/alias
+s usr/xpg4/bin/ulimit=../../bin/alias
+s usr/xpg4/bin/umask=../../bin/alias
+s usr/xpg4/bin/unalias=../../bin/alias
+h usr/xpg4/bin/vedit=usr/xpg4/bin/edit
+h usr/xpg4/bin/vi=usr/xpg4/bin/edit
+h usr/xpg4/bin/view=usr/xpg4/bin/edit
+s usr/xpg4/bin/wait=../../bin/alias
+f usr/xpg4/bin/who 0555 root bin
+d usr/xpg4/include 0755 root bin
+f usr/xpg4/include/curses.h 0644 root bin
+f usr/xpg4/include/term.h 0644 root bin
+f usr/xpg4/include/unctrl.h 0644 root bin
+d usr/xpg4/lib 0755 root bin
+s usr/xpg4/lib/64=amd64
+d usr/xpg4/lib/amd64 0755 root bin
+f usr/xpg4/lib/amd64/libcurses.so.1 0755 root bin
+f usr/xpg4/lib/amd64/libcurses.so.2 0755 root bin
+s usr/xpg4/lib/amd64/libcurses.so=libcurses.so.2
+f usr/xpg4/lib/libcurses.so.1 0755 root bin
+f usr/xpg4/lib/libcurses.so.2 0755 root bin
+s usr/xpg4/lib/libcurses.so=libcurses.so.2
+d var 0755 root sys
+d var/adm 0775 root sys
+d var/adm/acct 0775 adm adm
+d var/adm/acct/fiscal 0775 adm adm
+d var/adm/acct/nite 0775 adm adm
+d var/adm/acct/sum 0775 adm adm
+d var/adm/exacct 0755 adm adm
+d var/adm/log 0755 adm adm
+d var/adm/pool 0755 root sys
+d var/adm/sa 0775 adm sys
+d var/adm/sm.bin 0755 root sys
+d var/adm/streams 0755 root sys
+d var/audit 0755 root sys
+d var/cache 0755 root bin
+d var/cores 0755 root sys
+d var/cron 0755 root sys
+d var/db 0755 root sys
+d var/db/ipf 0755 root sys
+d var/fm 0755 root sys
+d var/fm/fmd 0755 root sys
+d var/fm/fmd/ckpt 0755 root sys
+d var/fm/fmd/rsrc 0755 root sys
+d var/fm/fmd/xprt 0755 root sys
+d var/games 0755 root bin
+d var/idmap 0755 daemon daemon
+d var/inet 0755 root sys
+d var/krb5 0755 root sys
+d var/krb5/rcache 1777 root sys
+d var/krb5/rcache/root 0700 root sys
+d var/ldap 0755 root sys
+d var/lib 0755 root other
+d var/lib/sgml 0755 root sys
+s var/lib/sgml/CATALOG.jade_dsl=CATALOG.openjade
+d var/log 0755 root sys
+d var/log/pool 0755 root sys
+d var/logadm 0755 root bin
+d var/mail 1777 root mail
+d var/mail/:saved 0775 root mail
+d var/news 0755 root bin
+d var/ntp 0755 root sys
+d var/ntp/ntpstats 0755 root sys
+d var/opt 0755 root sys
+d var/pkg 0755 root root
+d var/pkg/download 0755 root root
+d var/pkg/file 0755 root root
+d var/pkg/history 0755 root root
+d var/pkg/index 0755 root root
+d var/pkg/pkg 0755 root root
+d var/pkg/publisher 0755 root root
+d var/pkg/state 0755 root root
+d var/pkg/state/installed 0755 root root
+d var/pkg/state/known 0755 root root
+d var/pkg/tmp 0755 root root
+d var/preserve 1777 root bin
+d var/run 0755 root sys
+d var/sadm 0755 root sys
+d var/sadm/install 0755 root bin
+d var/sadm/install/admin 0755 root bin
+d var/sadm/install/logs 0555 root bin
+d var/sadm/install_data 0755 root sys
+d var/sadm/pkg 0555 root sys
+d var/sadm/security 0555 root sys
+d var/sadm/softinfo 0755 root sys
+s var/sadm/softinfo/INST_RELEASE=../system/admin/INST_RELEASE
+d var/sadm/system 0755 root sys
+d var/sadm/system/admin 0755 root sys
+d var/sadm/system/admin/services 0755 root sys
+d var/sadm/system/data 0755 root sys
+d var/sadm/system/logs 0755 root sys
+d var/saf 0755 root bin
+d var/saf/zsmon 0755 root sys
+d var/smb 0755 root sys
+d var/spool 0755 root bin
+d var/spool/clientmqueue 0770 smmsp smmsp
+d var/spool/cron 0755 root sys
+d var/spool/cron/atjobs 0755 root sys
+d var/spool/cron/crontabs 0755 root sys
+d var/spool/locks 0755 uucp uucp
+d var/spool/mqueue 0750 root bin
+d var/spool/pkg 1777 root bin
+d var/ssh 0755 root sys
+d var/svc 0755 root sys
+d var/svc/log 0755 root sys
+d var/svc/manifest 0755 root sys
+d var/svc/manifest/application 0755 root sys
+d var/svc/manifest/application/management 0755 root sys
+d var/svc/manifest/application/security 0755 root sys
+d var/svc/manifest/device 0755 root sys
+d var/svc/manifest/milestone 0755 root sys
+d var/svc/manifest/network 0755 root sys
+d var/svc/manifest/network/dns 0755 root sys
+d var/svc/manifest/network/ipsec 0755 root sys
+d var/svc/manifest/network/ldap 0755 root sys
+d var/svc/manifest/network/nfs 0755 root sys
+d var/svc/manifest/network/nis 0755 root sys
+d var/svc/manifest/network/routing 0755 root sys
+d var/svc/manifest/network/rpc 0755 root sys
+d var/svc/manifest/network/security 0755 root sys
+d var/svc/manifest/network/shares 0755 root sys
+d var/svc/manifest/network/ssl 0755 root sys
+d var/svc/manifest/platform 0755 root sys
+d var/svc/manifest/site 0755 root sys
+d var/svc/manifest/system 0755 root sys
+d var/svc/manifest/system/device 0755 root sys
+d var/svc/manifest/system/filesystem 0755 root sys
+d var/svc/manifest/system/security 0755 root sys
+d var/svc/manifest/system/svc 0755 root sys
+d var/svc/profile 0755 root sys
+d var/tmp 1777 root sys
+d var/yp 0755 root bin
+d var/yp/binding 0755 root bin
diff --git a/usr/src/Makefile b/usr/src/Makefile
index ef522a4817..0e13e8b2a6 100644
--- a/usr/src/Makefile
+++ b/usr/src/Makefile
@@ -45,7 +45,7 @@ $(SPARC_BLD)psm: stand
SUBDIRS= $(COMMON_SUBDIRS) $($(MACH)_SUBDIRS)
-HDRSUBDIRS= uts head lib cmd
+HDRSUBDIRS= uts head lib cmd ucbhead
# UCB headers are bug-for-bug compatible and not checkable against the header
# standards.
@@ -55,7 +55,7 @@ CHKHDRSUBDIRS= head uts lib
#
# Headers that can be built in parallel
#
-PARALLEL_HEADERS = sysheaders userheaders libheaders cmdheaders
+PARALLEL_HEADERS = sysheaders userheaders libheaders ucbheaders cmdheaders
#
# Directories that can be built in parallel
@@ -107,7 +107,7 @@ all: mapfiles closedbins sgs .WAIT $(SUBDIRS) pkg
# packaging to be pulled from $(SRC) and $(CLOSED) and staged in
# $(ROOT)/licenses.
#
-install: install1 install2 _msg stage-licenses
+install: install1 install2 _msg
@cd msg; pwd; $(MAKE) _msg
@rm -rf "$(ROOT)/catalog"
@@ -158,13 +158,13 @@ closedbins: bldtools $(ROOTDIRS) FRC
.PARALLEL: $(PARALLEL_HEADERS) DUMMY
.PARALLEL: $(PARALLEL_DIRS) DUMMY
-$(SUBDIRS) head pkg: FRC
+$(SUBDIRS) head ucbhead pkg: FRC
@cd $@; pwd; $(MAKE) $(TARGET)
# librpcsvc has a dependency on headers installed by
# userheaders, hence the .WAIT before libheaders.
sgs: rootdirs .WAIT sysheaders userheaders .WAIT \
- libheaders cmdheaders
+ libheaders ucbheaders cmdheaders
#
# Top-level setup target to setup the development environment that includes
@@ -201,6 +201,9 @@ libheaders: bldtools
sysheaders: FRC
@cd uts; pwd; $(MAKE) install_h
+ucbheaders: FRC
+ @cd ucbhead; pwd; $(MAKE) install_h
+
cmdheaders: FRC
@cd cmd/fm; pwd; $(MAKE) install_h
@cd cmd/mdb; pwd; $(MAKE) install_h
diff --git a/usr/src/Makefile.lint b/usr/src/Makefile.lint
index 6c8b973928..03850d711c 100644
--- a/usr/src/Makefile.lint
+++ b/usr/src/Makefile.lint
@@ -340,6 +340,7 @@ COMMON_SUBDIRS = \
lib/libbe \
lib/pylibbe \
lib/brand/sn1 \
+ lib/brand/sngl \
lib/brand/solaris10 \
lib/crypt_modules \
lib/extendedFILE \
@@ -461,7 +462,6 @@ COMMON_SUBDIRS = \
lib/pam_modules \
lib/passwdutil \
lib/pkcs11 \
- lib/print \
lib/raidcfg_plugins \
lib/scsi \
lib/smbsrv \
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 8fe3bd0caa..974422a675 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -235,7 +235,8 @@ INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
# rebuilds if the baked-in mtime != the mtime of the source file
# (rather than only if it's less than), thus when installing python
# files we must make certain to not adjust the mtime of the source
-# (.py) file.
+# (.py) file. As a part of this we also go through and change the #!
+# line in the python script to that of the actual python we are using.
#
INS.pyfile= $(INS.file); $(TOUCH) -r $< $@
@@ -417,9 +418,17 @@ sparcv9_COPTFLAG= -xO3
i386_COPTFLAG= -O
amd64_COPTFLAG= -xO3
+# This would normally be added by cw(1) but cannot be while we want to support
+# Both GCC 3.x and GCC 4.x
+$(__GNUC4)$(MACH)_COPTFLAG += -_gcc=-fno-inline-small-functions \
+ -_gcc=-fno-inline-functions-called-once
+$(__GNUC4)$(MACH64)_COPTFLAG += -_gcc=-fno-inline-small-functions \
+ -_gcc=-fno-inline-functions-called-once
+
COPTFLAG= $($(MACH)_COPTFLAG)
COPTFLAG64= $($(MACH64)_COPTFLAG)
+
# When -g is used, the compiler globalizes static objects
# (gives them a unique prefix). Disable that.
CNOGLOBAL= -W0,-noglobal
@@ -1080,9 +1089,16 @@ PKGPUBLISHER_NONREDIST= on-extra
$(RM) $@;
$(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
$(CHMOD) +x $@
+#
+# You might ask why we aren't using -i for sed here. That's because illumos
+# 1815 hasn't been fixed and sadly we didn't back out something that broke a lot
+# of working code in favor of GNU compatibility.
+#
+SED.py= $(SED) -e 's?^$(POUND_SIGN)!ON_PYTHON_26$$?$(POUND_SIGN)!$(PYTHON_26)?' \
+ -e 's?^$(POUND_SIGN)!ON_PYTHON$$?$(POUND_SIGN)!$(PYTHON)?'
.py:
- $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
+ $(RM) $@; $(SED.py) $< > $@; $(CHMOD) +x $@
.py.pyc:
$(RM) $@
diff --git a/usr/src/Targetdirs b/usr/src/Targetdirs
index 1ccb5c1378..b81bfd4517 100644
--- a/usr/src/Targetdirs
+++ b/usr/src/Targetdirs
@@ -203,6 +203,7 @@ DIRS= \
/root \
/sbin \
/system \
+ /system/boot \
/system/contract \
/system/object \
/tmp \
@@ -245,6 +246,7 @@ DIRS= \
/usr/lib/brand/labeled \
/usr/lib/brand/shared \
/usr/lib/brand/sn1 \
+ /usr/lib/brand/sngl \
/usr/lib/brand/solaris10 \
/usr/lib/class \
/usr/lib/class/FSS \
@@ -529,6 +531,7 @@ DIRS64= \
/usr/lib/$(MACH64) \
/usr/lib/$(MACH64)/gss \
/usr/lib/brand/sn1/$(MACH64) \
+ /usr/lib/brand/sngl/$(MACH64) \
/usr/lib/brand/solaris10/$(MACH64) \
/usr/lib/elfedit/$(MACH64) \
/usr/lib/fm/$(MACH64) \
@@ -600,6 +603,7 @@ SYM.DIRS64= \
/lib/secure/64 \
/usr/lib/64 \
/usr/lib/brand/sn1/64 \
+ /usr/lib/brand/sngl/64 \
/usr/lib/brand/solaris10/64 \
/usr/lib/elfedit/64 \
/usr/lib/libp/64 \
@@ -708,6 +712,7 @@ $(BUILD64) $(ROOT)/lib/secure/64:= LINKDEST=$(MACH64)
$(BUILD64) $(ROOT)/usr/lib/64:= LINKDEST=$(MACH64)
$(BUILD64) $(ROOT)/usr/lib/elfedit/64:= LINKDEST=$(MACH64)
$(BUILD64) $(ROOT)/usr/lib/brand/sn1/64:= LINKDEST=$(MACH64)
+$(BUILD64) $(ROOT)/usr/lib/brand/sngl/64:= LINKDEST=$(MACH64)
$(BUILD64) $(ROOT)/usr/lib/brand/solaris10/64:= LINKDEST=$(MACH64)
$(BUILD64) $(ROOT)/usr/lib/libp/64:= LINKDEST=$(MACH64)
$(BUILD64) $(ROOT)/usr/lib/lwp/64:= LINKDEST=$(MACH64)
diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile
index d04b74d498..5aa255deb0 100644
--- a/usr/src/cmd/Makefile
+++ b/usr/src/cmd/Makefile
@@ -21,14 +21,14 @@
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2010 Nexenta Systems, Inc. All rights reserved.
-# Copyright (c) 2012 Joyent, Inc. All rights reserved.
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright (c) 2013 DEY Storage Systems, Inc. All rights reserved.
include ../Makefile.master
#
-# Note that the commands 'agents', 'lp', 'perl', and 'man' are first in
+# Note that the commands 'perl', and 'man' are first in
# the list, violating alphabetical order. This is because they are very
# long-running and should be given the most wall-clock time for a
# parallel build.
@@ -50,7 +50,6 @@ FIRST_SUBDIRS= \
COMMON_SUBDIRS= \
allocate \
availdevs \
- lp \
perl \
man \
Adm \
@@ -95,6 +94,7 @@ COMMON_SUBDIRS= \
cmd-crypto \
cmd-inet \
col \
+ column \
compress \
consadm \
coreadm \
@@ -188,7 +188,6 @@ COMMON_SUBDIRS= \
groups \
grpck \
gss \
- hal \
halt \
head \
hostid \
@@ -226,7 +225,6 @@ COMMON_SUBDIRS= \
kvmstat \
last \
lastcomm \
- latencytop \
ldap \
ldapcachemgr \
lgrpinfo \
@@ -247,7 +245,6 @@ COMMON_SUBDIRS= \
look \
ls \
luxadm \
- lvm \
mach \
machid \
mail \
@@ -280,6 +277,7 @@ COMMON_SUBDIRS= \
news \
newtask \
nice \
+ nicstat \
nl \
nlsadmin \
nohup \
@@ -312,7 +310,6 @@ COMMON_SUBDIRS= \
plockstat \
pr \
prctl \
- print \
printf \
priocntl \
profiles \
@@ -330,7 +327,6 @@ COMMON_SUBDIRS= \
pwck \
pwconv \
pwd \
- pyzfs \
raidctl \
ramdiskadm \
rcap \
@@ -499,11 +495,10 @@ sparc_SUBDIRS= \
vntsd
#
-# Commands that are messaged. Note that 'lp' and 'man' come first
-# (see previous comment about 'lp' and 'man').
+# Commands that are messaged. Note that 'man' comes first
+# (see previous comment about 'man').
#
MSGSUBDIRS= \
- lp \
man \
abi \
acctadm \
@@ -616,7 +611,6 @@ MSGSUBDIRS= \
logins \
ls \
luxadm \
- lvm \
mailx \
mesg \
mkdir \
@@ -645,7 +639,6 @@ MSGSUBDIRS= \
power \
pr \
praudit \
- print \
profiles \
projadd \
projects \
@@ -656,7 +649,6 @@ MSGSUBDIRS= \
ptools \
pwconv \
pwd \
- pyzfs \
raidctl \
ramdiskadm \
rcap \
diff --git a/usr/src/cmd/Makefile.check b/usr/src/cmd/Makefile.check
index 5cd0b89828..70c12088bc 100644
--- a/usr/src/cmd/Makefile.check
+++ b/usr/src/cmd/Makefile.check
@@ -118,7 +118,6 @@ MANIFEST_SUBDIRS= \
krb5/krb5kdc \
krb5/kwarn \
krb5/slave \
- lp/cmd/lpsched \
lvm/rpc.mdcommd \
lvm/rpc.metad \
lvm/rpc.metamedd \
@@ -127,8 +126,6 @@ MANIFEST_SUBDIRS= \
lvm/util \
picl/picld \
pools/poold \
- print/bsd-sysv-commands \
- print/ppdmgr \
rcap/rcapd \
rpcsvc/rpc.bootparamd \
sendmail/lib \
diff --git a/usr/src/cmd/boot/bootadm/bootadm_upgrade.c b/usr/src/cmd/boot/bootadm/bootadm_upgrade.c
index b80581432c..17590bc528 100644
--- a/usr/src/cmd/boot/bootadm/bootadm_upgrade.c
+++ b/usr/src/cmd/boot/bootadm/bootadm_upgrade.c
@@ -124,7 +124,6 @@ get_boot_cap(const char *osroot)
}
if (!is_grub(osroot)) {
- bam_error(NOT_GRUB_ROOT, osroot);
return (BAM_ERROR);
}
diff --git a/usr/src/cmd/cmd-inet/lib/ipmgmtd/net-ipmgmt b/usr/src/cmd/cmd-inet/lib/ipmgmtd/net-ipmgmt
index 77b6be9f54..d5812793d4 100644
--- a/usr/src/cmd/cmd-inet/lib/ipmgmtd/net-ipmgmt
+++ b/usr/src/cmd/cmd-inet/lib/ipmgmtd/net-ipmgmt
@@ -21,6 +21,7 @@
#
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# This daemon stores address object to logical interface number mappings
# (among other things) and reads/writes from/to ipmgmtd data store.
@@ -38,14 +39,16 @@ fi
# When the non-global shared-IP stack zone boots, it tries to bring up this
# service as well. If we don't start a background process and simply exit the
# service, the service will go into maintenance mode and so will all it's
-# dependents.
+# dependents. Ideally we would simply exit with SMF_EXIT_NODAEMON, but since
+# this method is also used in an S10C zone, where support for SMF_EXIT_NODAEMON
+# does not exist, we have to stick around.
#
# In S10C zone (where this script is also used) smf_isnonglobalzone
# function is unavailable in smf_include.sh
#
if [ `/sbin/zonename` != global ]; then
if [ `/sbin/zonename -t` = shared ]; then
- (while true ; do sleep 3600 ; done) &
+ (while true ; do sleep 3600 ; done) &
exit $SMF_EXIT_OK
fi
fi
diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c b/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c
index 78da07aebf..9a710f9125 100644
--- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c
+++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/request.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*
* REQUESTING state of the client state machine.
*/
@@ -38,6 +39,7 @@
#include <dhcp_hostconf.h>
#include <dhcpagent_util.h>
#include <dhcpmsg.h>
+#include <strings.h>
#include "states.h"
#include "util.h"
@@ -641,8 +643,24 @@ accept_v4_acknak(dhcp_smach_t *dsmp, PKT_LIST *plp)
stop_pkt_retransmission(dsmp);
if (*plp->opts[CD_DHCP_TYPE]->value == NAK) {
- dhcpmsg(MSG_WARNING, "accept_v4_acknak: NAK on interface %s",
- dsmp->dsm_name);
+ char saddr[18];
+
+ saddr[0] = '\0';
+ if (plp->opts[CD_SERVER_ID] != NULL &&
+ plp->opts[CD_SERVER_ID]->len == sizeof (struct in_addr)) {
+ struct in_addr t_server;
+
+ bcopy(plp->opts[CD_SERVER_ID]->value, &t_server,
+ plp->opts[CD_SERVER_ID]->len);
+ (void) strlcpy(saddr, inet_ntoa(t_server),
+ sizeof (saddr));
+ }
+
+ dhcpmsg(MSG_WARNING, "accept_v4_acknak: NAK on interface %s "
+ "from %s %s",
+ dsmp->dsm_name,
+ inet_ntoa(plp->pktfrom.v4.sin_addr), saddr);
+
dsmp->dsm_bad_offers++;
free_pkt_entry(plp);
dhcp_restart(dsmp);
diff --git a/usr/src/cmd/cmd-inet/usr.lib/mdnsd/DNSCommon.c b/usr/src/cmd/cmd-inet/usr.lib/mdnsd/DNSCommon.c
index ce771e3188..173a8f8325 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/mdnsd/DNSCommon.c
+++ b/usr/src/cmd/cmd-inet/usr.lib/mdnsd/DNSCommon.c
@@ -1485,7 +1485,7 @@ mDNSlocal const mDNSu8 *getOptRdata(const mDNSu8 *ptr, const mDNSu8 *const limit
ptr += sizeof(mDNSs32);
nread += sizeof(mDNSs32);
}
- else { LogMsg("ERROR: getOptRdata - unknown opt %d", opt->opt); return mDNSNULL; }
+ else { return mDNSNULL; }
opt++; // increment pointer into rdatabody
}
diff --git a/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile b/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile
index e93209c9b6..fb8c1cdad6 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile
@@ -25,7 +25,7 @@
include ../Makefile.com
PROG= p12split
-LDLIBS += -lwanboot -linetutil -lwanbootutil -lcrypto
+LDLIBS += -lwanboot -linetutil -lwanbootutil -lsunw_crypto
CPPFLAGS += -I$(CMNCRYPTDIR)
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile b/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile
index f4a1f548b7..acad766bd3 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile
@@ -25,7 +25,7 @@
include ../Makefile.com
PROG = wanboot-cgi
-LDLIBS += -lgen -lnsl -lwanbootutil -lnvpair -lwanboot -lcrypto
+LDLIBS += -lgen -lnsl -lwanbootutil -lnvpair -lwanboot -lsunw_crypto
CPPFLAGS += -I$(CMNCRYPTDIR)
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile b/usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile
index 1b82adef80..a743bed065 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile
@@ -33,7 +33,7 @@ include ../../../Makefile.cmd
ROOTMANIFESTDIR = $(ROOTSVCNETWORK)
LDLIBS += -ldladm -ldlpi
-all install := LDLIBS += -lcrypto
+all install := LDLIBS += -lsunw_crypto
LINTFLAGS += -u
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm.c b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm.c
index 71a2fc9853..be826baba2 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm.c
@@ -21,10 +21,9 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -46,6 +45,7 @@
#include <libscf.h>
#include <libscf_priv.h>
#include <libuutil.h>
+#include <ifaddrs.h>
/*
* This program moves routing management under SMF. We do this by giving
@@ -2335,8 +2335,8 @@ out:
/*
*
- * Return the number of IPv6 addresses configured. This answers the
- * generic question, "is IPv6 configured?". We only start in.ndpd if IPv6
+ * Return the number of non-loopback IPv6 addresses configured. This answers
+ * the generic question, "is IPv6 configured?". We only start in.ndpd if IPv6
* is configured, and we also only enable IPv6 routing daemons if IPv6 is
* enabled.
*/
@@ -2344,28 +2344,24 @@ static int
ra_numv6intfs(void)
{
static int num = -1;
- int ipsock;
- struct lifnum lifn;
+ int cnt;
+ struct ifaddrs *ifp_head, *ifp;
if (num != -1)
return (num);
- if ((ipsock = socket(PF_INET6, SOCK_DGRAM, 0)) == -1) {
- (void) fprintf(stderr,
- gettext("%1$s: unable to open %2$s: %3$s\n"),
- myname, IP_DEV_NAME, strerror(errno));
+ if (getifaddrs(&ifp_head) < 0)
return (0);
- }
- lifn.lifn_family = AF_INET6;
- lifn.lifn_flags = 0;
- if (ioctl(ipsock, SIOCGLIFNUM, &lifn) == -1) {
- (void) close(ipsock);
- return (0);
+ cnt = 0;
+ for (ifp = ifp_head; ifp; ifp = ifp->ifa_next) {
+ if (!(ifp->ifa_flags & IFF_LOOPBACK) &&
+ (ifp->ifa_flags & IFF_IPV6))
+ cnt++;
}
- (void) close(ipsock);
- return (num = lifn.lifn_count);
+ freeifaddrs(ifp_head);
+ return (num = cnt);
}
/*
diff --git a/usr/src/cmd/column/Makefile b/usr/src/cmd/column/Makefile
new file mode 100644
index 0000000000..ab4cf3390e
--- /dev/null
+++ b/usr/src/cmd/column/Makefile
@@ -0,0 +1,43 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+PROG=column
+
+include ../Makefile.cmd
+
+CFLAGS += $(CCVERBOSE)
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+install: all $(ROOTPROG)
+
+clean:
+
+lint: lint_PROG
+
+include ../Makefile.targ
diff --git a/usr/src/cmd/column/THIRDPARTYLICENSE b/usr/src/cmd/column/THIRDPARTYLICENSE
new file mode 100644
index 0000000000..a80f56cb43
--- /dev/null
+++ b/usr/src/cmd/column/THIRDPARTYLICENSE
@@ -0,0 +1,26 @@
+Copyright (c) 1989, 1993, 1994
+ The Regents of the University of California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+4. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ *
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/usr/src/cmd/column/THIRDPARTYLICENSE.descrip b/usr/src/cmd/column/THIRDPARTYLICENSE.descrip
new file mode 100644
index 0000000000..42051a2982
--- /dev/null
+++ b/usr/src/cmd/column/THIRDPARTYLICENSE.descrip
@@ -0,0 +1 @@
+PORTIONS OF COLUMN COMMAND FUNCTIONALITY
diff --git a/usr/src/cmd/column/column.c b/usr/src/cmd/column/column.c
new file mode 100644
index 0000000000..4f9a3c81a6
--- /dev/null
+++ b/usr/src/cmd/column/column.c
@@ -0,0 +1,335 @@
+/*
+ * Copyright (c) 1989, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+ * Portions Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#ifndef lint
+static const char copyright[] =
+"@(#) Copyright (c) 1989, 1993, 1994\n\
+ The Regents of the University of California. All rights reserved.\n";
+#endif
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/param.h>
+#include <sys/termios.h>
+
+#include <err.h>
+#include <limits.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#define TAB 8
+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
+
+static void c_columnate(void);
+static void input(FILE *);
+static void maketbl(void);
+static void print(void);
+static void r_columnate(void);
+static void usage(void);
+static int width(const wchar_t *);
+
+static int termwidth = 80; /* default terminal width */
+
+static int entries; /* number of records */
+static int eval; /* exit value */
+static int maxlength; /* longest record */
+static wchar_t **list; /* array of pointers to records */
+static const wchar_t *separator = L"\t "; /* field separator for table option */
+
+int
+main(int argc, char **argv)
+{
+ struct winsize win;
+ FILE *fp;
+ int ch, tflag, xflag;
+ char *p;
+ const char *src;
+ wchar_t *newsep;
+ size_t seplen;
+
+ (void) setlocale(LC_ALL, "");
+
+ if (ioctl(1, TIOCGWINSZ, &win) == -1 || !win.ws_col) {
+ if ((p = getenv("COLUMNS")))
+ termwidth = atoi(p);
+ } else
+ termwidth = win.ws_col;
+
+ tflag = xflag = 0;
+ while ((ch = getopt(argc, argv, "c:s:tx")) != -1)
+ switch (ch) {
+ case 'c':
+ termwidth = atoi(optarg);
+ break;
+ case 's':
+ src = optarg;
+ seplen = mbsrtowcs(NULL, &src, 0, NULL);
+ if (seplen == (size_t)-1)
+ err(1, "bad separator");
+ newsep = malloc((seplen + 1) * sizeof (wchar_t));
+ if (newsep == NULL)
+ err(1, NULL);
+ (void) mbsrtowcs(newsep, &src, seplen + 1, NULL);
+ separator = newsep;
+ break;
+ case 't':
+ tflag = 1;
+ break;
+ case 'x':
+ xflag = 1;
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (!*argv)
+ input(stdin);
+ else for (; *argv; ++argv)
+ if ((fp = fopen(*argv, "rF"))) {
+ input(fp);
+ (void) fclose(fp);
+ } else {
+ warn("%s", *argv);
+ eval = 1;
+ }
+
+ if (!entries)
+ exit(eval);
+
+ maxlength = roundup(maxlength + 1, TAB);
+ if (tflag)
+ maketbl();
+ else if (maxlength >= termwidth)
+ print();
+ else if (xflag)
+ c_columnate();
+ else
+ r_columnate();
+ exit(eval);
+
+ /*NOTREACHED*/
+ return (eval);
+}
+
+static void
+c_columnate(void)
+{
+ int chcnt, col, cnt, endcol, numcols;
+ wchar_t **lp;
+
+ numcols = termwidth / maxlength;
+ endcol = maxlength;
+ for (chcnt = col = 0, lp = list; ; ++lp) {
+ (void) wprintf(L"%ls", *lp);
+ chcnt += width(*lp);
+ if (!--entries)
+ break;
+ if (++col == numcols) {
+ chcnt = col = 0;
+ endcol = maxlength;
+ (void) putwchar('\n');
+ } else {
+ while ((cnt = roundup(chcnt + 1, TAB)) <= endcol) {
+ (void) putwchar('\t');
+ chcnt = cnt;
+ }
+ endcol += maxlength;
+ }
+ }
+ if (chcnt)
+ (void) putwchar('\n');
+}
+
+static void
+r_columnate(void)
+{
+ int base, chcnt, cnt, col, endcol, numcols, numrows, row;
+
+ numcols = termwidth / maxlength;
+ numrows = entries / numcols;
+ if (entries % numcols)
+ ++numrows;
+
+ for (row = 0; row < numrows; ++row) {
+ endcol = maxlength;
+ for (base = row, chcnt = col = 0; col < numcols; ++col) {
+ (void) wprintf(L"%ls", list[base]);
+ chcnt += width(list[base]);
+ if ((base += numrows) >= entries)
+ break;
+ while ((cnt = roundup(chcnt + 1, TAB)) <= endcol) {
+ (void) putwchar('\t');
+ chcnt = cnt;
+ }
+ endcol += maxlength;
+ }
+ (void) putwchar('\n');
+ }
+}
+
+static void
+print(void)
+{
+ int cnt;
+ wchar_t **lp;
+
+ for (cnt = entries, lp = list; cnt--; ++lp)
+ (void) wprintf(L"%ls\n", *lp);
+}
+
+typedef struct _tbl {
+ wchar_t **list;
+ int cols, *len;
+} TBL;
+#define DEFCOLS 25
+
+static void
+maketbl(void)
+{
+ TBL *t;
+ int coloff, cnt;
+ wchar_t *p, **lp;
+ int *lens, maxcols;
+ TBL *tbl;
+ wchar_t **cols;
+ wchar_t *last;
+
+ if ((t = tbl = calloc(entries, sizeof (TBL))) == NULL)
+ err(1, (char *)NULL);
+ if ((cols = calloc((maxcols = DEFCOLS), sizeof (*cols))) == NULL)
+ err(1, (char *)NULL);
+ if ((lens = calloc(maxcols, sizeof (int))) == NULL)
+ err(1, (char *)NULL);
+ for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
+ for (coloff = 0, p = *lp;
+ (cols[coloff] = wcstok(p, separator, &last));
+ p = NULL)
+ if (++coloff == maxcols) {
+ if (!(cols = realloc(cols, ((uint_t)maxcols +
+ DEFCOLS) * sizeof (char *))) ||
+ !(lens = realloc(lens,
+ ((uint_t)maxcols + DEFCOLS) *
+ sizeof (int))))
+ err(1, NULL);
+ (void) memset((char *)lens + maxcols *
+ sizeof (int), 0, DEFCOLS * sizeof (int));
+ maxcols += DEFCOLS;
+ }
+ if ((t->list = calloc(coloff, sizeof (*t->list))) == NULL)
+ err(1, (char *)NULL);
+ if ((t->len = calloc(coloff, sizeof (int))) == NULL)
+ err(1, (char *)NULL);
+ for (t->cols = coloff; --coloff >= 0; ) {
+ t->list[coloff] = cols[coloff];
+ t->len[coloff] = width(cols[coloff]);
+ if (t->len[coloff] > lens[coloff])
+ lens[coloff] = t->len[coloff];
+ }
+ }
+ for (cnt = 0, t = tbl; cnt < entries; ++cnt, ++t) {
+ for (coloff = 0; coloff < t->cols - 1; ++coloff)
+ (void) wprintf(L"%ls%*ls", t->list[coloff],
+ lens[coloff] - t->len[coloff] + 2, L" ");
+ (void) wprintf(L"%ls\n", t->list[coloff]);
+ }
+}
+
+#define DEFNUM 1000
+#define MAXLINELEN (LINE_MAX + 1)
+
+static void
+input(FILE *fp)
+{
+ static int maxentry;
+ int len;
+ wchar_t *p, buf[MAXLINELEN];
+
+ if (!list)
+ if ((list = calloc((maxentry = DEFNUM), sizeof (*list))) ==
+ NULL)
+ err(1, (char *)NULL);
+ while (fgetws(buf, MAXLINELEN, fp)) {
+ for (p = buf; *p && iswspace(*p); ++p)
+ ;
+ if (!*p)
+ continue;
+ if (!(p = wcschr(p, L'\n'))) {
+ warnx("line too long");
+ eval = 1;
+ continue;
+ }
+ *p = L'\0';
+ len = width(buf);
+ if (maxlength < len)
+ maxlength = len;
+ if (entries == maxentry) {
+ maxentry += DEFNUM;
+ if (!(list = realloc(list,
+ (uint_t)maxentry * sizeof (*list))))
+ err(1, NULL);
+ }
+ list[entries] = malloc((wcslen(buf) + 1) * sizeof (wchar_t));
+ if (list[entries] == NULL)
+ err(1, NULL);
+ (void) wcscpy(list[entries], buf);
+ entries++;
+ }
+}
+
+/* Like wcswidth(), but ignores non-printing characters. */
+static int
+width(const wchar_t *wcs)
+{
+ int w, cw;
+
+ for (w = 0; *wcs != L'\0'; wcs++)
+ if ((cw = wcwidth(*wcs)) > 0)
+ w += cw;
+ return (w);
+}
+
+static void
+usage(void)
+{
+
+ (void) fprintf(stderr,
+ "usage: column [-tx] [-c columns] [-s sep] [file ...]\n");
+ exit(1);
+}
diff --git a/usr/src/cmd/coreadm/coreadm.xml b/usr/src/cmd/coreadm/coreadm.xml
index 46a4cda17a..28f1e27240 100644
--- a/usr/src/cmd/coreadm/coreadm.xml
+++ b/usr/src/cmd/coreadm/coreadm.xml
@@ -48,14 +48,6 @@
<service_fmri value='svc:/system/filesystem/minimal' />
</dependency>
- <dependency
- name='coreadm_manifest-import'
- type='service'
- grouping='require_all'
- restart_on='none'>
- <service_fmri value='svc:/system/manifest-import:default' />
- </dependency>
-
<instance name='default' enabled='false'>
<exec_method
type='method'
diff --git a/usr/src/cmd/cron/Makefile b/usr/src/cmd/cron/Makefile
index c9ffeadffe..fb05e292a3 100644
--- a/usr/src/cmd/cron/Makefile
+++ b/usr/src/cmd/cron/Makefile
@@ -26,6 +26,7 @@
DEFAULTFILES = cron.dfl
include ../Makefile.cmd
+include ../Makefile.ctf
MANIFEST = cron.xml
@@ -96,20 +97,20 @@ XPG4ATOBJS= $(ATOBJS:%=objs.xpg4/%) $(XPG4OBJS:%=objs.xpg4/%)
XPG6COMMONOBJS= $(COMMONOBJS:%=objs.xpg6/%)
XPG6CTOBJS= $(CRONTABOBJS:%=objs.xpg6/%)
-cron := POBJS = $(CRONOBJS) $(COMMONOBJ2)
-at := POBJS = $(ATOBJS) $(COMMONOBJS)
-at.xpg4 := POBJS = $(XPG4ATOBJS) $(XPG4COMMONOBJS)
-atrm := POBJS = $(ATRMOBJS) $(COMMONOBJS)
-atq := POBJS = $(ATQOBJS) $(COMMONOBJS)
-crontab := POBJS = $(CRONTABOBJS) $(COMMONOBJS)
-crontab.xpg4 := POBJS = $(XPG4CTOBJS) $(XPG4COMMONOBJS)
-crontab.xpg6 := POBJS = $(XPG6CTOBJS) $(XPG6COMMONOBJS)
+cron := OBJS = $(CRONOBJS) $(COMMONOBJ2)
+at := OBJS = $(ATOBJS) $(COMMONOBJS)
+at.xpg4 := OBJS = $(XPG4ATOBJS) $(XPG4COMMONOBJS)
+atrm := OBJS = $(ATRMOBJS) $(COMMONOBJS)
+atq := OBJS = $(ATQOBJS) $(COMMONOBJS)
+crontab := OBJS = $(CRONTABOBJS) $(COMMONOBJS)
+crontab.xpg4 := OBJS = $(XPG4CTOBJS) $(XPG4COMMONOBJS)
+crontab.xpg6 := OBJS = $(XPG6CTOBJS) $(XPG6COMMONOBJS)
CFLAGS += $(CCVERBOSE)
NOBJS= $(CRONOBJS) $(ATOBJS) $(ATRMOBJS1) $(ATQOBJS) $(CRONTABOBJS1) \
$(COMMONOBJS)
-OBJS = $(NOBJS) $(XPG4COMMONOBJS) $(XPG4ATOBJS) $(XPG4CTOBJS) \
+COBJS = $(NOBJS) $(XPG4COMMONOBJS) $(XPG4ATOBJS) $(XPG4CTOBJS) \
$(XPG6COMMONOBJS) $(XPG6CTOBJS) $(GETRESPOBJ)
SRCS = $(NOBJS:%.o=%.c) $(GETRESPSRC)
@@ -157,32 +158,35 @@ all : $(PROG) $(XPG4) $(XPG6) $(SCRIPT) $(XPG4SCRIPT) $(FILES)
install : all $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTSYMLINK) \
$(ROOTMANIFEST) $(ROOTMETHOD)
-$(PROG) : $$(POBJS)
- $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
+$(PROG) : $$(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
-$(XPG4) : objs.xpg4 $$(POBJS)
- $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
+$(XPG4) : objs.xpg4 $$(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
-$(XPG6) : objs.xpg6 $$(POBJS)
- $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
+$(XPG6) : objs.xpg6 $$(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
objs.xpg6/%.o: %.c
$(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
objs.xpg6:
-@mkdir -p $@
objs.xpg4/%.o: %.c
$(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
objs.xpg4:
-@mkdir -p $@
objs.xpg4/values-xpg4.o: ../../lib/common/common/values-xpg4.c
$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+ $(POST_PROCESS_O)
%.o: $(SRC)/common/util/%.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
@@ -219,7 +223,7 @@ $(POFILE): $(POFILES)
$(RM) $@; cat $(POFILES) > $@
clean :
- $(RM) $(OBJS) att1.h att1.c att2.c
+ $(RM) $(COBJS) att1.h att1.c att2.c
lint : lint_SRCS
diff --git a/usr/src/cmd/cron/cron.c b/usr/src/cmd/cron/cron.c
index ab36d09037..33a7373f1e 100644
--- a/usr/src/cmd/cron/cron.c
+++ b/usr/src/cmd/cron/cron.c
@@ -23,7 +23,7 @@
* Use is subject to license terms.
*
* Copyright 2013 Joshua M. Clulow <josh@sysmgr.org>
- *
+ * Copyright 2013 Joyent, Inc. All rights reserved.
* Copyright (c) 2014 Gary Mills
*/
@@ -315,7 +315,8 @@ static int ex(struct event *e);
static void read_dirs(int);
static void mail(char *, char *, int);
static char *next_field(int, int);
-static void readcron(struct usr *, time_t);
+static void readcron(char *, struct usr *, time_t);
+static void readcronfile(FILE *, struct usr *, time_t);
static int next_ge(int, char *);
static void free_if_unused(struct usr *);
static void del_atjob(char *, char *);
@@ -420,7 +421,7 @@ extern void el_delete(void);
static int valid_entry(char *, int);
static struct usr *create_ulist(char *, int);
-static void init_cronevent(char *, int);
+static void init_cronevent(char *, char *);
static void init_atevent(char *, time_t, int, int);
static void update_atevent(struct usr *, char *, time_t, int);
@@ -759,6 +760,18 @@ read_dirs(int first)
time_t tim;
+ if (chdir(SYSCRONDIR) != -1) {
+ cwd = CRON;
+ if ((dir = opendir(".")) != NULL) {
+ while ((dp = readdir(dir)) != NULL) {
+ if (!valid_entry(dp->d_name, CRONEVENT))
+ continue;
+ init_cronevent(SYSCRONDIR, dp->d_name);
+ }
+ (void) closedir(dir);
+ }
+ }
+
if (chdir(CRONDIR) == -1)
crabort(BADCD, REMOVE_FIFO|CONSOLE_MSG);
cwd = CRON;
@@ -767,7 +780,7 @@ read_dirs(int first)
while ((dp = readdir(dir)) != NULL) {
if (!valid_entry(dp->d_name, CRONEVENT))
continue;
- init_cronevent(dp->d_name, first);
+ init_cronevent(CRONDIR, dp->d_name);
}
(void) closedir(dir);
@@ -853,23 +866,18 @@ create_ulist(char *name, int type)
}
void
-init_cronevent(char *name, int first)
+init_cronevent(char *basedir, char *name)
{
struct usr *u;
- if (first) {
+ if ((u = find_usr(name)) == NULL) {
u = create_ulist(name, CRONEVENT);
- readcron(u, 0);
+ readcron(basedir, u, 0);
} else {
- if ((u = find_usr(name)) == NULL) {
- u = create_ulist(name, CRONEVENT);
- readcron(u, 0);
- } else {
- u->ctexists = TRUE;
- rm_ctevents(u);
- el_remove(u->ctid, 0);
- readcron(u, 0);
- }
+ u->ctexists = TRUE;
+ rm_ctevents(u);
+ el_remove(u->ctid, 0);
+ readcron(basedir, u, 0);
}
}
@@ -950,7 +958,7 @@ mod_ctab(char *name, time_t reftime)
(void) strcpy(u->home, pw->pw_dir);
u->uid = pw->pw_uid;
u->gid = pw->pw_gid;
- readcron(u, reftime);
+ readcron(CRONDIR, u, reftime);
} else {
u->uid = pw->pw_uid;
u->gid = pw->pw_gid;
@@ -973,7 +981,7 @@ mod_ctab(char *name, time_t reftime)
/* user didnt have a crontab last time */
u->ctid = ecid++;
u->ctevents = NULL;
- readcron(u, reftime);
+ readcron(CRONDIR, u, reftime);
return;
}
#ifdef DEBUG
@@ -981,7 +989,7 @@ mod_ctab(char *name, time_t reftime)
#endif
rm_ctevents(u);
el_remove(u->ctid, 0);
- readcron(u, reftime);
+ readcron(CRONDIR, u, reftime);
}
}
@@ -1116,8 +1124,94 @@ update_atevent(struct usr *u, char *name, time_t tim, int jobtype)
static char line[CTLINESIZE]; /* holds a line from a crontab file */
static int cursor; /* cursor for the above line */
+static int
+copyfile(char *name, FILE *dp)
+{
+ FILE *tf;
+
+ if ((tf = fopen(name, "r")) == NULL) {
+ (void) fclose(dp);
+ return (1);
+ }
+
+ while (fgets(line, CTLINESIZE, tf) != NULL) {
+ if (fputs(line, dp) == EOF) {
+ (void) fclose(tf);
+ (void) fclose(dp);
+ return (1);
+ }
+ }
+ (void) fclose(tf);
+
+ return (0);
+}
+
+static void
+readcron(char *basedir, struct usr *u, time_t reftime)
+{
+ char *altpath;
+ struct stat sb;
+ FILE *cf; /* cf will be a user's crontab file */
+ char altnamebuf[PATH_MAX];
+ char namebuf[PATH_MAX];
+
+ if (strcmp(basedir, SYSCRONDIR) == 0)
+ altpath = CRONDIR;
+ else
+ altpath = SYSCRONDIR;
+
+ if (snprintf(altnamebuf, sizeof (altnamebuf), "%s/%s", altpath,
+ u->name) >= sizeof (altnamebuf))
+ return;
+
+ if (snprintf(namebuf, sizeof (namebuf), "%s/%s", basedir, u->name) >=
+ sizeof (namebuf))
+ return;
+
+ if (stat(altnamebuf, &sb) != -1) {
+ /*
+ * There is a secondary crontab for this user. We need to
+ * merge the two crontabs into a temporary file for loading.
+ */
+ int fd;
+ char tmpfile[PATH_MAX];
+
+ (void) strlcpy(tmpfile, "/tmp/cronXXXXXX", sizeof (tmpfile));
+ if ((fd = mkstemp(tmpfile)) == -1)
+ return;
+
+ unlink(tmpfile);
+ if ((cf = fdopen(fd, "w+")) == NULL) {
+ close(fd);
+ return;
+ }
+
+ if (copyfile(namebuf, cf) != 0)
+ return;
+
+ if (copyfile(altnamebuf, cf) != 0)
+ return;
+
+ (void) fflush(cf);
+ rewind(cf);
+
+ } else {
+ /*
+ * Only one crontab, open it directly.
+ */
+ if ((cf = fopen(namebuf, "r")) == NULL) {
+ mail(u->name, NOREAD, ERR_UNIXERR);
+ return;
+ }
+ }
+
+ readcronfile(cf, u, reftime);
+
+ (void) fclose(cf);
+}
+
static void
-readcron(struct usr *u, time_t reftime)
+readcronfile(FILE *cf, struct usr *u, time_t reftime)
{
/*
* readcron reads in a crontab file for a user (u). The list of
@@ -1125,12 +1219,9 @@ readcron(struct usr *u, time_t reftime)
* this list. Each event is also entered into the main event
* list.
*/
- FILE *cf; /* cf will be a user's crontab file */
struct event *e;
int start;
unsigned int i;
- char namebuf[PATH_MAX];
- char *pname;
struct shared *tz = NULL;
struct shared *home = NULL;
struct shared *shell = NULL;
@@ -1138,19 +1229,6 @@ readcron(struct usr *u, time_t reftime)
/* read the crontab file */
cte_init(); /* Init error handling */
- if (cwd != CRON) {
- if (snprintf(namebuf, sizeof (namebuf), "%s/%s",
- CRONDIR, u->name) >= sizeof (namebuf)) {
- return;
- }
- pname = namebuf;
- } else {
- pname = u->name;
- }
- if ((cf = fopen(pname, "r")) == NULL) {
- mail(u->name, NOREAD, ERR_UNIXERR);
- return;
- }
while (fgets(line, CTLINESIZE, cf) != NULL) {
char *tmp;
/* process a line of a crontab file */
@@ -1279,7 +1357,6 @@ again:
#endif
}
cte_sendmail(u->name); /* mail errors if any to user */
- (void) fclose(cf);
rel_shared(tz);
rel_shared(shell);
rel_shared(home);
@@ -2442,6 +2519,9 @@ ex(struct event *e)
} else {
r = audit_cron_session(e->u->name, CRONDIR,
e->u->uid, e->u->gid, NULL);
+ if (r != 0)
+ r = audit_cron_session(e->u->name, SYSCRONDIR,
+ e->u->uid, e->u->gid, NULL);
}
if (r != 0) {
msg("cron audit problem. job failed (%s) for user %s",
diff --git a/usr/src/cmd/cron/cron.h b/usr/src/cmd/cron/cron.h
index a76016299c..93e21e7b41 100644
--- a/usr/src/cmd/cron/cron.h
+++ b/usr/src/cmd/cron/cron.h
@@ -71,6 +71,9 @@ struct message {
char logname[LLEN];
};
+/* anything below here can be changed */
+
+#define SYSCRONDIR "/etc/cron.d/crontabs"
#define CRONDIR "/var/spool/cron/crontabs"
#define ATDIR "/var/spool/cron/atjobs"
#define ACCTFILE "/var/cron/log"
diff --git a/usr/src/cmd/cron/crontab.c b/usr/src/cmd/cron/crontab.c
index 327a71388b..cdb4e1e394 100644
--- a/usr/src/cmd/cron/crontab.c
+++ b/usr/src/cmd/cron/crontab.c
@@ -71,7 +71,7 @@
"usage:\n" \
"\tcrontab [file]\n" \
"\tcrontab -e [username]\n" \
- "\tcrontab -l [username]\n" \
+ "\tcrontab -l [-g] [username]\n" \
"\tcrontab -r [username]"
#define INVALIDUSER "you are not a valid user (no entry in /etc/passwd)."
#define NOTALLOWED "you are not authorized to use cron. Sorry."
@@ -120,6 +120,7 @@ main(int argc, char **argv)
int c, r;
int rflag = 0;
int lflag = 0;
+ int gflag = 0;
int eflag = 0;
int errflg = 0;
char *pp;
@@ -151,11 +152,14 @@ main(int argc, char **argv)
exit(1);
}
- while ((c = getopt(argc, argv, "elr")) != EOF)
+ while ((c = getopt(argc, argv, "eglr")) != EOF)
switch (c) {
case 'e':
eflag++;
break;
+ case 'g':
+ gflag++;
+ break;
case 'l':
lflag++;
break;
@@ -170,6 +174,9 @@ main(int argc, char **argv)
if (eflag + lflag + rflag > 1)
errflg++;
+ if (gflag && !lflag)
+ errflg++;
+
argc -= optind;
argv += optind;
if (errflg || argc > 1)
@@ -236,12 +243,27 @@ main(int argc, char **argv)
exit(0);
}
if (lflag) {
- if ((fp = fopen(cf, "r")) == NULL)
- crabort(BADOPEN);
- while (fgets(line, CTLINESIZE, fp) != NULL)
- fputs(line, stdout);
- fclose(fp);
- exit(0);
+ char sysconf[PATH_MAX];
+
+ if (gflag) {
+ if (snprintf(sysconf, sizeof (sysconf), "%s/%s",
+ SYSCRONDIR, login) < sizeof (sysconf) &&
+ (fp = fopen(sysconf, "r")) != NULL) {
+ while (fgets(line, CTLINESIZE, fp) != NULL)
+ fputs(line, stdout);
+ fclose(fp);
+ exit(0);
+ } else {
+ crabort(BADOPEN);
+ }
+ } else {
+ if ((fp = fopen(cf, "r")) == NULL)
+ crabort(BADOPEN);
+ while (fgets(line, CTLINESIZE, fp) != NULL)
+ fputs(line, stdout);
+ fclose(fp);
+ exit(0);
+ }
}
if (eflag) {
if ((fp = fopen(cf, "r")) == NULL) {
diff --git a/usr/src/cmd/devfsadm/Makefile.com b/usr/src/cmd/devfsadm/Makefile.com
index 4df3b00585..1585db2894 100644
--- a/usr/src/cmd/devfsadm/Makefile.com
+++ b/usr/src/cmd/devfsadm/Makefile.com
@@ -67,7 +67,6 @@ LINK_OBJS_CMN = \
fssnap_link.o \
sgen_link.o \
smp_link.o \
- md_link.o \
dtrace_link.o \
vscan_link.o \
zfs_link.o \
diff --git a/usr/src/cmd/devfsadm/devlink.tab.sh b/usr/src/cmd/devfsadm/devlink.tab.sh
index 6724fcb573..0267efeb9f 100644
--- a/usr/src/cmd/devfsadm/devlink.tab.sh
+++ b/usr/src/cmd/devfsadm/devlink.tab.sh
@@ -22,8 +22,7 @@
#
# Copyright (c) 1998, 2000 by Sun Microsystems, Inc.
# All rights reserved.
-#
-#ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
#
# This is the script that generates the devlink.tab file. It is
# architecture-aware, and dumps different stuff for x86 and sparc.
@@ -34,8 +33,6 @@
#
cat <<EOM
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1998 by Sun Microsystems, Inc.
#
#
diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c
index 8efdb32d0e..6352e33fa5 100644
--- a/usr/src/cmd/dladm/dladm.c
+++ b/usr/src/cmd/dladm/dladm.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -154,6 +155,7 @@ typedef struct show_vnic_state {
dladm_status_t vs_status;
uint32_t vs_flags;
ofmt_handle_t vs_ofmt;
+ char *vs_zonename;
} show_vnic_state_t;
typedef struct show_part_state {
@@ -265,7 +267,7 @@ typedef struct cmd {
static cmd_t cmds[] = {
{ "rename-link", do_rename_link,
- " rename-link <oldlink> <newlink>" },
+ " rename-link [-z zonename] <oldlink> <newlink>" },
{ "show-link", do_show_link,
" show-link [-pP] [-o <field>,..] [-s [-i <interval>]] "
"[<link>]\n" },
@@ -300,12 +302,13 @@ static cmd_t cmds[] = {
{ "show-wifi", do_show_wifi,
" show-wifi [-p] [-o <field>,...] [<link>]\n" },
{ "set-linkprop", do_set_linkprop,
- " set-linkprop [-t] -p <prop>=<value>[,...] <name>" },
+ " set-linkprop [-t] [-z zonename] -p <prop>=<value>[,...] "
+ "<name>" },
{ "reset-linkprop", do_reset_linkprop,
- " reset-linkprop [-t] [-p <prop>,...] <name>" },
+ " reset-linkprop [-t] [-z zonename] [-p <prop>,...] <name>"},
{ "show-linkprop", do_show_linkprop,
- " show-linkprop [-cP] [-o <field>,...] [-p <prop>,...] "
- "<name>\n" },
+ " show-linkprop [-cP] [-o <field>,...] [-z zonename] "
+ "[-p <prop>,...] <name>\n" },
{ "show-ether", do_show_ether,
" show-ether [-px][-o <field>,...] <link>\n" },
{ "create-secobj", do_create_secobj,
@@ -346,10 +349,10 @@ static cmd_t cmds[] = {
"\t\t {vrrp -V <vrid> -A {inet | inet6}} [-v <vid> [-f]]\n"
"\t\t [-p <prop>=<value>[,...]] <vnic-link>" },
{ "delete-vnic", do_delete_vnic,
- " delete-vnic [-t] <vnic-link>" },
+ " delete-vnic [-t] [-z zonename] <vnic-link>" },
{ "show-vnic", do_show_vnic,
- " show-vnic [-pP] [-l <link>] [-s [-i <interval>]] "
- "[<link>]\n" },
+ " show-vnic [-pP] [-l <link>] [-z zonename] "
+ "[-s [-i <interval>]] [<link>]\n" },
{ "up-vnic", do_up_vnic, NULL },
{ "create-part", do_create_part,
" create-part [-t] [-f] -l <link> [-P <pkey>]\n"
@@ -958,6 +961,7 @@ typedef struct show_linkprop_state {
char ls_link[MAXLINKNAMELEN];
char *ls_line;
char **ls_propvals;
+ char *ls_zonename;
dladm_arg_list_t *ls_proplist;
boolean_t ls_parsable;
boolean_t ls_persist;
@@ -1010,21 +1014,24 @@ typedef struct vnic_fields_buf_s
char vnic_macaddr[18];
char vnic_macaddrtype[19];
char vnic_vid[6];
+ char vnic_zone[ZONENAME_MAX];
} vnic_fields_buf_t;
static const ofmt_field_t vnic_fields[] = {
{ "LINK", 13,
offsetof(vnic_fields_buf_t, vnic_link), print_default_cb},
-{ "OVER", 13,
+{ "OVER", 11,
offsetof(vnic_fields_buf_t, vnic_over), print_default_cb},
-{ "SPEED", 7,
+{ "SPEED", 6,
offsetof(vnic_fields_buf_t, vnic_speed), print_default_cb},
{ "MACADDRESS", 18,
offsetof(vnic_fields_buf_t, vnic_macaddr), print_default_cb},
-{ "MACADDRTYPE", 20,
+{ "MACADDRTYPE", 12,
offsetof(vnic_fields_buf_t, vnic_macaddrtype), print_default_cb},
-{ "VID", 7,
+{ "VID", 5,
offsetof(vnic_fields_buf_t, vnic_vid), print_default_cb},
+{ "ZONE", 20,
+ offsetof(vnic_fields_buf_t, vnic_zone), print_default_cb},
{ NULL, 0, 0, NULL}}
;
@@ -2494,13 +2501,17 @@ do_rename_link(int argc, char *argv[], const char *use)
char *link1, *link2;
char *altroot = NULL;
dladm_status_t status;
+ char *zonename = NULL;
opterr = 0;
- while ((option = getopt_long(argc, argv, ":R:", lopts, NULL)) != -1) {
+ while ((option = getopt_long(argc, argv, ":R:z:", lopts, NULL)) != -1) {
switch (option) {
case 'R':
altroot = optarg;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, use);
break;
@@ -2516,7 +2527,7 @@ do_rename_link(int argc, char *argv[], const char *use)
link1 = argv[optind++];
link2 = argv[optind];
- if ((status = dladm_rename_link(handle, link1, link2)) !=
+ if ((status = dladm_rename_link(handle, zonename, link1, link2)) !=
DLADM_STATUS_OK)
die_dlerr(status, "rename operation failed");
}
@@ -3406,11 +3417,12 @@ do_show_link(int argc, char *argv[], const char *use)
ofmt_handle_t ofmt;
ofmt_status_t oferr;
uint_t ofmtflags = 0;
+ char *zonename = NULL;
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":pPsSi:o:",
+ while ((option = getopt_long(argc, argv, ":pPsSi:o:z:",
show_lopts, NULL)) != -1) {
switch (option) {
case 'p':
@@ -3449,6 +3461,9 @@ do_show_link(int argc, char *argv[], const char *use)
if (!dladm_str2interval(optarg, &interval))
die("invalid interval value '%s'", optarg);
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, use);
break;
@@ -3474,8 +3489,8 @@ do_show_link(int argc, char *argv[], const char *use)
if (strlcpy(linkname, argv[optind], MAXLINKNAMELEN) >=
MAXLINKNAMELEN)
die("link name too long");
- if ((status = dladm_name2info(handle, linkname, &linkid, &f,
- NULL, NULL)) != DLADM_STATUS_OK) {
+ if ((status = dladm_zname2info(handle, zonename, linkname,
+ &linkid, &f, NULL, NULL)) != DLADM_STATUS_OK) {
die_dlerr(status, "link %s is not valid", linkname);
}
@@ -4740,6 +4755,12 @@ do_create_vnic(int argc, char *argv[], const char *use)
if ((flags & DLADM_OPT_FORCE) != 0 && vid == 0)
die("-f option can only be used with -v");
+ /*
+ * If creating a transient VNIC for a zone, mark it in the kernel.
+ */
+ if (strstr(propstr, "zone=") != NULL && !(flags & DLADM_OPT_PERSIST))
+ flags |= DLADM_OPT_TRANSIENT;
+
if (mac_prefix_len != 0 && mac_addr_type != VNIC_MAC_ADDR_TYPE_RANDOM &&
mac_addr_type != VNIC_MAC_ADDR_TYPE_FIXED)
usage();
@@ -4831,9 +4852,10 @@ do_delete_vnic_common(int argc, char *argv[], const char *use,
datalink_id_t linkid;
char *altroot = NULL;
dladm_status_t status;
+ char *zonename = NULL;
opterr = 0;
- while ((option = getopt_long(argc, argv, ":R:t", lopts,
+ while ((option = getopt_long(argc, argv, ":R:tz:", lopts,
NULL)) != -1) {
switch (option) {
case 't':
@@ -4842,6 +4864,9 @@ do_delete_vnic_common(int argc, char *argv[], const char *use,
case 'R':
altroot = optarg;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, use);
}
@@ -4854,8 +4879,8 @@ do_delete_vnic_common(int argc, char *argv[], const char *use,
if (altroot != NULL)
altroot_cmd(altroot, argc, argv);
- status = dladm_name2info(handle, argv[optind], &linkid, NULL, NULL,
- NULL);
+ status = dladm_zname2info(handle, zonename, argv[optind], &linkid, NULL,
+ NULL, NULL);
if (status != DLADM_STATUS_OK)
die("invalid link name '%s'", argv[optind]);
@@ -4987,6 +5012,9 @@ print_vnic(show_vnic_state_t *state, datalink_id_t linkid)
char vnic_name[MAXLINKNAMELEN];
char mstr[MAXMACADDRLEN * 3];
vnic_fields_buf_t vbuf;
+ uint_t valcnt = 1;
+ char zonename[DLADM_PROP_VAL_MAX + 1];
+ char *valptr[1];
if ((status = dladm_vnic_info(handle, linkid, vnic, state->vs_flags)) !=
DLADM_STATUS_OK)
@@ -5016,6 +5044,18 @@ print_vnic(show_vnic_state_t *state, datalink_id_t linkid)
NULL, devname, sizeof (devname)) != DLADM_STATUS_OK)
(void) sprintf(devname, "?");
+
+ zonename[0] = '\0';
+ if (!is_etherstub) {
+ valptr[0] = zonename;
+ (void) dladm_get_linkprop(handle, linkid,
+ DLADM_PROP_VAL_CURRENT, "zone", (char **)valptr, &valcnt);
+ }
+
+ if (state->vs_zonename != NULL &&
+ strcmp(state->vs_zonename, zonename) != 0)
+ return (DLADM_STATUS_OK);
+
state->vs_found = B_TRUE;
if (state->vs_stats) {
/* print vnic statistics */
@@ -5091,6 +5131,13 @@ print_vnic(show_vnic_state_t *state, datalink_id_t linkid)
(void) snprintf(vbuf.vnic_vid, sizeof (vbuf.vnic_vid),
"%d", vnic->va_vid);
+
+ if (zonename[0] != '\0')
+ (void) snprintf(vbuf.vnic_zone,
+ sizeof (vbuf.vnic_zone), "%s", zonename);
+ else
+ (void) strlcpy(vbuf.vnic_zone, "--",
+ sizeof (vbuf.vnic_zone));
}
ofmt_print(state->vs_ofmt, &vbuf);
@@ -5129,10 +5176,11 @@ do_show_vnic_common(int argc, char *argv[], const char *use,
ofmt_handle_t ofmt;
ofmt_status_t oferr;
uint_t ofmtflags = 0;
+ char *zonename = NULL;
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":pPl:si:o:", lopts,
+ while ((option = getopt_long(argc, argv, ":pPl:si:o:z:", lopts,
NULL)) != -1) {
switch (option) {
case 'p':
@@ -5171,6 +5219,9 @@ do_show_vnic_common(int argc, char *argv[], const char *use,
o_arg = B_TRUE;
fields_str = optarg;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, use);
}
@@ -5181,8 +5232,8 @@ do_show_vnic_common(int argc, char *argv[], const char *use,
/* get vnic ID (optional last argument) */
if (optind == (argc - 1)) {
- status = dladm_name2info(handle, argv[optind], &linkid, NULL,
- NULL, NULL);
+ status = dladm_zname2info(handle, zonename, argv[optind],
+ &linkid, NULL, NULL, NULL);
if (status != DLADM_STATUS_OK) {
die_dlerr(status, "invalid vnic name '%s'",
argv[optind]);
@@ -5193,8 +5244,8 @@ do_show_vnic_common(int argc, char *argv[], const char *use,
}
if (l_arg) {
- status = dladm_name2info(handle, state.vs_link, &dev_linkid,
- NULL, NULL, NULL);
+ status = dladm_zname2info(handle, zonename, state.vs_link,
+ &dev_linkid, NULL, NULL, NULL);
if (status != DLADM_STATUS_OK) {
die_dlerr(status, "invalid link name '%s'",
state.vs_link);
@@ -5206,6 +5257,7 @@ do_show_vnic_common(int argc, char *argv[], const char *use,
state.vs_etherstub = etherstub;
state.vs_found = B_FALSE;
state.vs_flags = flags;
+ state.vs_zonename = zonename;
if (!o_arg || (o_arg && strcasecmp(fields_str, "all") == 0)) {
if (etherstub)
@@ -6694,6 +6746,7 @@ do_show_linkprop(int argc, char **argv, const char *use)
ofmt_handle_t ofmt;
ofmt_status_t oferr;
uint_t ofmtflags = 0;
+ char *zonename = NULL;
bzero(propstr, DLADM_STRSIZE);
opterr = 0;
@@ -6704,7 +6757,7 @@ do_show_linkprop(int argc, char **argv, const char *use)
state.ls_header = B_TRUE;
state.ls_retstatus = DLADM_STATUS_OK;
- while ((option = getopt_long(argc, argv, ":p:cPo:",
+ while ((option = getopt_long(argc, argv, ":p:cPo:z:",
prop_longopts, NULL)) != -1) {
switch (option) {
case 'p':
@@ -6723,6 +6776,9 @@ do_show_linkprop(int argc, char **argv, const char *use)
case 'o':
fields_str = optarg;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, use);
break;
@@ -6730,8 +6786,8 @@ do_show_linkprop(int argc, char **argv, const char *use)
}
if (optind == (argc - 1)) {
- if ((status = dladm_name2info(handle, argv[optind], &linkid,
- NULL, NULL, NULL)) != DLADM_STATUS_OK) {
+ if ((status = dladm_zname2info(handle, zonename, argv[optind],
+ &linkid, NULL, NULL, NULL)) != DLADM_STATUS_OK) {
die_dlerr(status, "link %s is not valid", argv[optind]);
}
} else if (optind != argc) {
@@ -6742,6 +6798,7 @@ do_show_linkprop(int argc, char **argv, const char *use)
!= DLADM_STATUS_OK)
die("invalid link properties specified");
state.ls_proplist = proplist;
+ state.ls_zonename = zonename;
state.ls_status = DLADM_STATUS_OK;
if (state.ls_parsable)
@@ -6786,6 +6843,17 @@ show_linkprop_onelink(dladm_handle_t hdl, datalink_id_t linkid, void *arg)
return (DLADM_WALK_CONTINUE);
}
+ if (statep->ls_zonename != NULL) {
+ datalink_id_t tlinkid;
+
+ if (dladm_zname2info(hdl, statep->ls_zonename, statep->ls_link,
+ &tlinkid, NULL, NULL, NULL) != DLADM_STATUS_OK ||
+ linkid != tlinkid) {
+ statep->ls_status = DLADM_STATUS_NOTFOUND;
+ return (DLADM_WALK_CONTINUE);
+ }
+ }
+
if ((statep->ls_persist && !(flags & DLADM_OPT_PERSIST)) ||
(!statep->ls_persist && !(flags & DLADM_OPT_ACTIVE))) {
statep->ls_status = DLADM_STATUS_BADARG;
@@ -6868,11 +6936,12 @@ set_linkprop(int argc, char **argv, boolean_t reset, const char *use)
dladm_status_t status = DLADM_STATUS_OK;
char propstr[DLADM_STRSIZE];
dladm_arg_list_t *proplist = NULL;
+ char *zonename = NULL;
opterr = 0;
bzero(propstr, DLADM_STRSIZE);
- while ((option = getopt_long(argc, argv, ":p:R:t",
+ while ((option = getopt_long(argc, argv, ":p:R:tz:",
prop_longopts, NULL)) != -1) {
switch (option) {
case 'p':
@@ -6887,6 +6956,9 @@ set_linkprop(int argc, char **argv, boolean_t reset, const char *use)
case 'R':
altroot = optarg;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, use);
@@ -6909,8 +6981,8 @@ set_linkprop(int argc, char **argv, boolean_t reset, const char *use)
altroot_cmd(altroot, argc, argv);
}
- status = dladm_name2info(handle, argv[optind], &linkid, NULL, NULL,
- NULL);
+ status = dladm_zname2info(handle, zonename, argv[optind], &linkid,
+ NULL, NULL, NULL);
if (status != DLADM_STATUS_OK)
die_dlerr(status, "link %s is not valid", argv[optind]);
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_db.c b/usr/src/cmd/dlmgmtd/dlmgmt_db.c
index 99307dbc03..a2000ff3b5 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_db.c
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_db.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <assert.h>
@@ -43,6 +44,7 @@
#include <libcontract.h>
#include <libcontract_priv.h>
#include <sys/contract/process.h>
+#include <sys/vnic.h>
#include "dlmgmt_impl.h"
typedef enum dlmgmt_db_op {
@@ -552,6 +554,10 @@ dlmgmt_db_update(dlmgmt_db_op_t op, const char *entryname, dlmgmt_link_t *linkp,
linkp->ll_zoneid, flags, &err)) == NULL)
return (err);
+ /* If transient op and onloan, use the global zone cache file. */
+ if (flags == DLMGMT_ACTIVE && linkp->ll_onloan)
+ req->ls_zoneid = GLOBAL_ZONEID;
+
/*
* If the return error is EINPROGRESS, this request is handled
* asynchronously; return success.
@@ -1382,13 +1388,49 @@ dlmgmt_db_walk(zoneid_t zoneid, datalink_class_t class, db_walk_func_t *func)
}
/*
+ * Attempt to mitigate one of the deadlocks in the dlmgmtd architecture.
+ *
+ * dlmgmt_db_init() calls dlmgmt_process_db_req() which eventually gets to
+ * dlmgmt_zfop() which tries to fork, enter the zone and read the file.
+ * Because of the upcall architecture of dlmgmtd this can lead to deadlock
+ * with the following scenario:
+ * a) the thread preparing to fork will have acquired the malloc locks
+ * then attempt to suspend every thread in preparation to fork.
+ * b) all of the upcalls will be blocked in door_ucred() trying to malloc()
+ * and get the credentials of their caller.
+ * c) we can't suspend the in-kernel thread making the upcall.
+ *
+ * Thus, we cannot serve door requests because we're blocked in malloc()
+ * which fork() owns, but fork() is in turn blocked on the in-kernel thread
+ * making the door upcall. This is a fundamental architectural problem with
+ * any server handling upcalls and also trying to fork().
+ *
+ * To minimize the chance of this deadlock occuring, we check ahead of time to
+ * see if the file we want to read actually exists in the zone (which it almost
+ * never does), so we don't need fork in that case (i.e. rarely to never).
+ */
+static boolean_t
+zone_file_exists(char *zoneroot, char *filename)
+{
+ struct stat sb;
+ char fname[MAXPATHLEN];
+
+ (void) snprintf(fname, sizeof (fname), "%s/%s", zoneroot, filename);
+
+ if (stat(fname, &sb) == -1)
+ return (B_FALSE);
+
+ return (B_TRUE);
+}
+
+/*
* Initialize the datalink <link name, linkid> mapping and the link's
* attributes list based on the configuration file /etc/dladm/datalink.conf
* and the active configuration cache file
* /etc/svc/volatile/dladm/datalink-management:default.cache.
*/
int
-dlmgmt_db_init(zoneid_t zoneid)
+dlmgmt_db_init(zoneid_t zoneid, char *zoneroot)
{
dlmgmt_db_req_t *req;
int err;
@@ -1398,22 +1440,28 @@ dlmgmt_db_init(zoneid_t zoneid)
DATALINK_INVALID_LINKID, zoneid, DLMGMT_ACTIVE, &err)) == NULL)
return (err);
- if ((err = dlmgmt_process_db_req(req)) != 0) {
- /*
- * If we get back ENOENT, that means that the active
- * configuration file doesn't exist yet, and is not an error.
- * We'll create it down below after we've loaded the
- * persistent configuration.
- */
- if (err != ENOENT)
- goto done;
+ if (zone_file_exists(zoneroot, cachefile)) {
+ if ((err = dlmgmt_process_db_req(req)) != 0) {
+ /*
+ * If we get back ENOENT, that means that the active
+ * configuration file doesn't exist yet, and is not an
+ * error. We'll create it down below after we've
+ * loaded the persistent configuration.
+ */
+ if (err != ENOENT)
+ goto done;
+ boot = B_TRUE;
+ }
+ } else {
boot = B_TRUE;
}
- req->ls_flags = DLMGMT_PERSIST;
- err = dlmgmt_process_db_req(req);
- if (err != 0 && err != ENOENT)
- goto done;
+ if (zone_file_exists(zoneroot, DLMGMT_PERSISTENT_DB_PATH)) {
+ req->ls_flags = DLMGMT_PERSIST;
+ err = dlmgmt_process_db_req(req);
+ if (err != 0 && err != ENOENT)
+ goto done;
+ }
err = 0;
if (rewrite_needed) {
/*
@@ -1451,8 +1499,29 @@ dlmgmt_db_fini(zoneid_t zoneid)
while (linkp != NULL) {
next_linkp = AVL_NEXT(&dlmgmt_name_avl, linkp);
if (linkp->ll_zoneid == zoneid) {
+ vnic_ioc_delete_t ioc;
+ boolean_t onloan;
+
+ ioc.vd_vnic_id = linkp->ll_linkid;
+ onloan = linkp->ll_onloan;
+
+ /*
+ * Cleanup any VNICs that were loaned to the zone
+ * before the zone goes away and we can no longer
+ * refer to the VNIC by the name/zoneid.
+ */
+ if (onloan)
+ (void) dlmgmt_delete_db_entry(linkp,
+ DLMGMT_ACTIVE);
+
(void) dlmgmt_destroy_common(linkp,
DLMGMT_ACTIVE | DLMGMT_PERSIST);
+
+ if (onloan && ioctl(dladm_dld_fd(dld_handle),
+ VNIC_IOC_DELETE, &ioc) < 0)
+ dlmgmt_log(LOG_WARNING, "dlmgmt_db_fini "
+ "delete VNIC ioctl failed %d %d",
+ ioc.vd_vnic_id, errno);
}
linkp = next_linkp;
}
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_door.c b/usr/src/cmd/dlmgmtd/dlmgmt_door.c
index 11e4329669..ef5fa0e745 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_door.c
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_door.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/*
@@ -58,6 +59,10 @@
#include <libsysevent.h>
#include <libdlmgmt.h>
#include <librcm.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
#include "dlmgmt_impl.h"
typedef void dlmgmt_door_handler_t(void *, void *, size_t *, zoneid_t,
@@ -439,6 +444,10 @@ dlmgmt_getlinkid(void *argp, void *retp, size_t *sz, zoneid_t zoneid,
dlmgmt_link_t *linkp;
int err = 0;
+ /* Enable the global zone to lookup links it has given away. */
+ if (zoneid == GLOBAL_ZONEID && getlinkid->ld_zoneid != -1)
+ zoneid = getlinkid->ld_zoneid;
+
/*
* Hold the reader lock to access the link
*/
@@ -1245,7 +1254,19 @@ dlmgmt_setzoneid(void *argp, void *retp, size_t *sz, zoneid_t zoneid,
"zone %d: %s", linkid, oldzoneid, strerror(err));
goto done;
}
- avl_remove(&dlmgmt_loan_avl, linkp);
+
+ if (newzoneid == GLOBAL_ZONEID && linkp->ll_onloan) {
+ /*
+ * We can only reassign a loaned VNIC back to the
+ * global zone when the zone is shutting down, since
+ * otherwise the VNIC is in use by the zone and will be
+ * busy. Leave the VNIC assigned to the zone so we can
+ * still see it and delete it when dlmgmt_zonehalt()
+ * runs.
+ */
+ goto done;
+ }
+
linkp->ll_onloan = B_FALSE;
}
if (newzoneid != GLOBAL_ZONEID) {
@@ -1256,7 +1277,6 @@ dlmgmt_setzoneid(void *argp, void *retp, size_t *sz, zoneid_t zoneid,
(void) zone_add_datalink(oldzoneid, linkid);
goto done;
}
- avl_add(&dlmgmt_loan_avl, linkp);
linkp->ll_onloan = B_TRUE;
}
@@ -1309,6 +1329,10 @@ dlmgmt_zonehalt(void *argp, void *retp, size_t *sz, zoneid_t zoneid,
int err = 0;
dlmgmt_door_zonehalt_t *zonehalt = argp;
dlmgmt_zonehalt_retval_t *retvalp = retp;
+ static char my_pid[10];
+
+ if (my_pid[0] == NULL)
+ (void) snprintf(my_pid, sizeof (my_pid), "%d\n", getpid());
if ((err = dlmgmt_checkprivs(0, cred)) == 0) {
if (zoneid != GLOBAL_ZONEID) {
@@ -1316,9 +1340,31 @@ dlmgmt_zonehalt(void *argp, void *retp, size_t *sz, zoneid_t zoneid,
} else if (zonehalt->ld_zoneid == GLOBAL_ZONEID) {
err = EINVAL;
} else {
+ /*
+ * dlmgmt_db_fini makes ioctls which lead to the
+ * following kernel stack:
+ * vnic_ioc_delete
+ * vnic_dev_delete
+ * dls_devnet_destroy
+ * dls_devnet_destroy calls mac_perim_enter_by_mh
+ * which could lead to deadlock if another process is
+ * holding the mac perimeter then made an upcall to
+ * dlmgmtd. To try to avoid this, we serialize zone
+ * activity on the /etc/dladm/zone.lck file.
+ */
+ int fd;
+
+ while ((fd = open(ZONE_LOCK, O_WRONLY |
+ O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) < 0)
+ (void) sleep(1);
+ (void) write(fd, my_pid, sizeof(my_pid));
+ (void) close(fd);
+
dlmgmt_table_lock(B_TRUE);
dlmgmt_db_fini(zonehalt->ld_zoneid);
dlmgmt_table_unlock();
+
+ (void) unlink(ZONE_LOCK);
}
}
retvalp->lr_err = err;
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_impl.h b/usr/src/cmd/dlmgmtd/dlmgmt_impl.h
index cdfd0d8a4d..107870fbe2 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_impl.h
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/*
@@ -84,6 +85,8 @@ typedef struct dlmgmt_dlconf_s {
avl_node_t ld_node;
} dlmgmt_dlconf_t;
+#define ZONE_LOCK "/etc/dladm/zone.lck"
+
extern boolean_t debug;
extern const char *progname;
extern char cachefile[];
@@ -138,7 +141,7 @@ void dlmgmt_handler(void *, char *, size_t, door_desc_t *, uint_t);
void dlmgmt_log(int, const char *, ...);
int dlmgmt_write_db_entry(const char *, dlmgmt_link_t *, uint32_t);
int dlmgmt_delete_db_entry(dlmgmt_link_t *, uint32_t);
-int dlmgmt_db_init(zoneid_t);
+int dlmgmt_db_init(zoneid_t, char *);
void dlmgmt_db_fini(zoneid_t);
#ifdef __cplusplus
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_main.c b/usr/src/cmd/dlmgmtd/dlmgmt_main.c
index c02610bb5f..e0c179cf5e 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_main.c
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_main.c
@@ -22,6 +22,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/*
@@ -125,7 +126,7 @@ dlmgmt_door_fini(void)
dlmgmt_door_fd = -1;
}
-int
+static int
dlmgmt_door_attach(zoneid_t zoneid, char *rootdir)
{
int fd;
@@ -203,7 +204,7 @@ dlmgmt_zone_init(zoneid_t zoneid)
return (EPERM);
}
- if ((err = dlmgmt_db_init(zoneid)) != 0)
+ if ((err = dlmgmt_db_init(zoneid, rootdir)) != 0)
return (err);
return (dlmgmt_door_attach(zoneid, rootdir));
}
@@ -214,7 +215,7 @@ dlmgmt_zone_init(zoneid_t zoneid)
static int
dlmgmt_allzones_init(void)
{
- int err, i;
+ int i;
zoneid_t *zids = NULL;
uint_t nzids, nzids_saved;
@@ -235,11 +236,37 @@ again:
}
for (i = 0; i < nzids; i++) {
- if ((err = dlmgmt_zone_init(zids[i])) != 0)
- break;
+ int res;
+ zone_status_t status;
+
+ /*
+ * Skip over zones that have gone away or are going down
+ * since we got the list. Process all zones in the list,
+ * logging errors for any that failed.
+ */
+ if (zone_getattr(zids[i], ZONE_ATTR_STATUS, &status,
+ sizeof (status)) < 0)
+ continue;
+ switch (status) {
+ case ZONE_IS_SHUTTING_DOWN:
+ case ZONE_IS_EMPTY:
+ case ZONE_IS_DOWN:
+ case ZONE_IS_DYING:
+ case ZONE_IS_DEAD:
+ /* FALLTHRU */
+ continue;
+ default:
+ break;
+ }
+ if ((res = dlmgmt_zone_init(zids[i])) != 0) {
+ (void) fprintf(stderr, "zone (%ld) init error %s",
+ zids[i], strerror(res));
+ dlmgmt_log(LOG_ERR, "zone (%d) init error %s",
+ zids[i], strerror(res));
+ }
}
free(zids);
- return (err);
+ return (0);
}
static int
@@ -262,6 +289,8 @@ dlmgmt_init(void)
return (err);
}
+ (void) unlink(ZONE_LOCK);
+
/*
* First derive the name of the cache file from the FMRI name. This
* cache name is used to keep active datalink configuration.
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_util.c b/usr/src/cmd/dlmgmtd/dlmgmt_util.c
index afcfbed37b..b8d02d6f5d 100644
--- a/usr/src/cmd/dlmgmtd/dlmgmt_util.c
+++ b/usr/src/cmd/dlmgmtd/dlmgmt_util.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/*
@@ -45,13 +46,10 @@
/*
* There are three datalink AVL tables. The dlmgmt_name_avl tree contains all
* datalinks and is keyed by zoneid and link name. The dlmgmt_id_avl also
- * contains all datalinks, and it is keyed by link ID. The dlmgmt_loan_avl is
- * keyed by link name, and contains the set of global-zone links that are
- * currently on loan to non-global zones.
+ * contains all datalinks, and it is keyed by link ID.
*/
avl_tree_t dlmgmt_name_avl;
avl_tree_t dlmgmt_id_avl;
-avl_tree_t dlmgmt_loan_avl;
avl_tree_t dlmgmt_dlconf_avl;
@@ -162,8 +160,6 @@ dlmgmt_linktable_init(void)
offsetof(dlmgmt_link_t, ll_name_node));
avl_create(&dlmgmt_id_avl, cmp_link_by_id, sizeof (dlmgmt_link_t),
offsetof(dlmgmt_link_t, ll_id_node));
- avl_create(&dlmgmt_loan_avl, cmp_link_by_name, sizeof (dlmgmt_link_t),
- offsetof(dlmgmt_link_t, ll_loan_node));
avl_create(&dlmgmt_dlconf_avl, cmp_dlconf_by_id,
sizeof (dlmgmt_dlconf_t), offsetof(dlmgmt_dlconf_t, ld_node));
dlmgmt_nextlinkid = 1;
@@ -181,7 +177,6 @@ dlmgmt_linktable_fini(void)
avl_destroy(&dlmgmt_dlconf_avl);
avl_destroy(&dlmgmt_name_avl);
- avl_destroy(&dlmgmt_loan_avl);
avl_destroy(&dlmgmt_id_avl);
}
@@ -385,7 +380,6 @@ link_activate(dlmgmt_link_t *linkp)
linkp->ll_zoneid = zoneid;
avl_add(&dlmgmt_name_avl, linkp);
- avl_add(&dlmgmt_loan_avl, linkp);
linkp->ll_onloan = B_TRUE;
}
} else if (linkp->ll_zoneid != GLOBAL_ZONEID) {
@@ -430,10 +424,6 @@ link_by_name(const char *name, zoneid_t zoneid)
(void) strlcpy(link.ll_link, name, MAXLINKNAMELEN);
link.ll_zoneid = zoneid;
linkp = avl_find(&dlmgmt_name_avl, &link, NULL);
- if (linkp == NULL && zoneid == GLOBAL_ZONEID) {
- /* The link could be on loan to a non-global zone? */
- linkp = avl_find(&dlmgmt_loan_avl, &link, NULL);
- }
return (linkp);
}
@@ -511,8 +501,6 @@ dlmgmt_destroy_common(dlmgmt_link_t *linkp, uint32_t flags)
if ((flags & DLMGMT_ACTIVE) && linkp->ll_zoneid != GLOBAL_ZONEID) {
(void) zone_remove_datalink(linkp->ll_zoneid, linkp->ll_linkid);
- if (linkp->ll_onloan)
- avl_remove(&dlmgmt_loan_avl, linkp);
}
if (linkp->ll_flags == 0) {
diff --git a/usr/src/cmd/dlmgmtd/svc-dlmgmtd b/usr/src/cmd/dlmgmtd/svc-dlmgmtd
index 7559207535..a75e71f9b3 100644
--- a/usr/src/cmd/dlmgmtd/svc-dlmgmtd
+++ b/usr/src/cmd/dlmgmtd/svc-dlmgmtd
@@ -23,17 +23,16 @@
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2012 Joyent, Inc. All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
. /lib/svc/share/smf_include.sh
-# The real daemon is not started in a non-global zone. But we need to
-# create a dummy background process to preserve contract lifetime.
+# The real daemon is not started in a non-global zone. Exit to leave
+# an empty contract.
if smf_is_nonglobalzone; then
- (while true ; do sleep 3600 ; done) &
- exit $SMF_EXIT_OK
+ exit $SMF_EXIT_NODAEMON
fi
# Start the dlmgmtd daemon.
diff --git a/usr/src/cmd/dlstat/dlstat.c b/usr/src/cmd/dlstat/dlstat.c
index a931ba82ff..2615fdbb12 100644
--- a/usr/src/cmd/dlstat/dlstat.c
+++ b/usr/src/cmd/dlstat/dlstat.c
@@ -62,7 +62,7 @@ typedef struct link_chain_s {
struct link_chain_s *lc_next;
} link_chain_t;
-typedef void * (*stats2str_t)(const char *, void *,
+typedef void * (*stats2str_t)(const char *, const char *, void *,
char, boolean_t);
typedef struct show_state {
@@ -141,6 +141,7 @@ typedef struct total_fields_buf_s {
char t_rbytes[MAXSTATLEN];
char t_opackets[MAXSTATLEN];
char t_obytes[MAXSTATLEN];
+ char t_zone[ZONENAME_MAX];
} total_fields_buf_t;
static ofmt_field_t total_s_fields[] = {
@@ -154,6 +155,8 @@ static ofmt_field_t total_s_fields[] = {
offsetof(total_fields_buf_t, t_opackets), print_default_cb},
{ "OBYTES", 8,
offsetof(total_fields_buf_t, t_obytes), print_default_cb},
+{ "ZONE", 20,
+ offsetof(total_fields_buf_t, t_zone), print_default_cb},
{ NULL, 0, 0, NULL}};
/*
@@ -957,8 +960,8 @@ cleanup_removed_links(show_state_t *state)
}
void *
-print_total_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_total_stats(const char *linkname, const char *zonename, void *statentry,
+ char unit, boolean_t parsable)
{
total_stat_entry_t *sentry = statentry;
total_stat_t *link_stats = &sentry->tse_stats;
@@ -970,6 +973,7 @@ print_total_stats(const char *linkname, void *statentry, char unit,
(void) snprintf(buf->t_linkname, sizeof (buf->t_linkname), "%s",
linkname);
+ (void) snprintf(buf->t_zone, sizeof (buf->t_zone), "%s", zonename);
map_to_units(buf->t_ipackets, sizeof (buf->t_ipackets),
link_stats->ts_ipackets, unit, parsable);
@@ -988,8 +992,8 @@ done:
}
void *
-print_rx_generic_ring_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_rx_generic_ring_stats(const char *linkname, const char *zonename,
+ void *statentry, char unit, boolean_t parsable)
{
ring_stat_entry_t *sentry = statentry;
ring_stat_t *link_stats = &sentry->re_stats;
@@ -1022,8 +1026,8 @@ done:
}
void *
-print_tx_generic_ring_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_tx_generic_ring_stats(const char *linkname, const char *zonename,
+ void *statentry, char unit, boolean_t parsable)
{
ring_stat_entry_t *sentry = statentry;
ring_stat_t *link_stats = &sentry->re_stats;
@@ -1056,8 +1060,8 @@ done:
}
void *
-print_rx_ring_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_rx_ring_stats(const char *linkname, const char *zonename, void *statentry,
+ char unit, boolean_t parsable)
{
ring_stat_entry_t *sentry = statentry;
ring_stat_t *link_stats = &sentry->re_stats;
@@ -1090,8 +1094,8 @@ done:
}
void *
-print_tx_ring_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_tx_ring_stats(const char *linkname, const char *zonename, void *statentry,
+ char unit, boolean_t parsable)
{
ring_stat_entry_t *sentry = statentry;
ring_stat_t *link_stats = &sentry->re_stats;
@@ -1124,8 +1128,8 @@ done:
}
void *
-print_rx_generic_lane_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_rx_generic_lane_stats(const char *linkname, const char *zonename,
+ void *statentry, char unit, boolean_t parsable)
{
rx_lane_stat_entry_t *sentry = statentry;
rx_lane_stat_t *link_stats = &sentry->rle_stats;
@@ -1172,8 +1176,8 @@ done:
}
void *
-print_tx_generic_lane_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_tx_generic_lane_stats(const char *linkname, const char *zonename,
+ void *statentry, char unit, boolean_t parsable)
{
tx_lane_stat_entry_t *sentry = statentry;
tx_lane_stat_t *link_stats = &sentry->tle_stats;
@@ -1217,8 +1221,8 @@ done:
}
void *
-print_rx_lane_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_rx_lane_stats(const char *linkname, const char *zonename, void *statentry,
+ char unit, boolean_t parsable)
{
rx_lane_stat_entry_t *sentry = statentry;
rx_lane_stat_t *link_stats = &sentry->rle_stats;
@@ -1283,9 +1287,8 @@ done:
}
void *
-print_tx_lane_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
-{
+print_tx_lane_stats(const char *linkname, const char *zonename, void *statentry,
+ char unit, boolean_t parsable) {
tx_lane_stat_entry_t *sentry = statentry;
tx_lane_stat_t *link_stats = &sentry->tle_stats;
tx_lane_fields_buf_t *buf = NULL;
@@ -1338,8 +1341,8 @@ done:
}
void *
-print_fanout_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_fanout_stats(const char *linkname, const char *zonename, void *statentry,
+ char unit, boolean_t parsable)
{
fanout_stat_entry_t *sentry = statentry;
fanout_stat_t *link_stats = &sentry->fe_stats;
@@ -1392,8 +1395,8 @@ done:
}
void *
-print_aggr_port_stats(const char *linkname, void *statentry, char unit,
- boolean_t parsable)
+print_aggr_port_stats(const char *linkname, const char *zonename,
+ void *statentry, char unit, boolean_t parsable)
{
aggr_port_stat_entry_t *sentry = statentry;
aggr_port_stat_t *link_stats = &sentry->ape_stats;
@@ -1470,7 +1473,8 @@ done:
void
walk_dlstat_stats(show_state_t *state, const char *linkname,
- dladm_stat_type_t stattype, dladm_stat_chain_t *diff_stat)
+ const char *zonename, dladm_stat_type_t stattype,
+ dladm_stat_chain_t *diff_stat)
{
dladm_stat_chain_t *curr;
@@ -1480,7 +1484,8 @@ walk_dlstat_stats(show_state_t *state, const char *linkname,
/* Format the raw numbers for printing */
fields_buf = state->ls_stats2str[stattype](linkname,
- curr->dc_statentry, state->ls_unit, state->ls_parsable);
+ zonename, curr->dc_statentry, state->ls_unit,
+ state->ls_parsable);
/* Print the stats */
if (fields_buf != NULL)
ofmt_print(state->ls_ofmt, fields_buf);
@@ -1495,12 +1500,20 @@ show_queried_stats(dladm_handle_t dh, datalink_id_t linkid, void *arg)
int i;
dladm_stat_chain_t *diff_stat;
char linkname[DLPI_LINKNAME_MAX];
+ char zonename[DLADM_PROP_VAL_MAX + 1];
+ char *valptr[1];
+ uint_t valcnt = 1;
if (dladm_datalink_id2info(dh, linkid, NULL, NULL, NULL, linkname,
DLPI_LINKNAME_MAX) != DLADM_STATUS_OK) {
goto done;
}
+ valptr[0] = zonename;
+ if (dladm_get_linkprop(handle, linkid, DLADM_PROP_VAL_CURRENT, "zone",
+ (char **)valptr, &valcnt) != 0)
+ zonename[0] = '\0';
+
for (i = 0; i < DLADM_STAT_NUM_STATS; i++) {
if (state->ls_stattype[i]) {
/*
@@ -1508,7 +1521,8 @@ show_queried_stats(dladm_handle_t dh, datalink_id_t linkid, void *arg)
* Stats are returned as chain of raw numbers
*/
diff_stat = query_link_stats(handle, linkid, arg, i);
- walk_dlstat_stats(state, linkname, i, diff_stat);
+ walk_dlstat_stats(state, linkname, zonename, i,
+ diff_stat);
dladm_link_stat_free(diff_stat);
}
}
@@ -1628,7 +1642,7 @@ do_show(int argc, char *argv[], const char *use)
char *o_fields_str = NULL;
char *total_stat_fields =
- "link,ipkts,rbytes,opkts,obytes";
+ "link,ipkts,rbytes,opkts,obytes,zone";
char *rx_total_stat_fields =
"link,ipkts,rbytes,intrs,polls,ch<10,ch10-50,ch>50";
char *tx_total_stat_fields =
diff --git a/usr/src/cmd/dtrace/Makefile.com b/usr/src/cmd/dtrace/Makefile.com
index 2f69e31be5..81aad72bbf 100644
--- a/usr/src/cmd/dtrace/Makefile.com
+++ b/usr/src/cmd/dtrace/Makefile.com
@@ -29,6 +29,7 @@ OBJS = dtrace.o
SRCS = $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
+include ../../Makefile.ctf
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
@@ -53,5 +54,6 @@ lint: lint_SRCS
%.o: ../%.c
$(COMPILE.c) $<
+ $(POST_PROCESS_O)
include ../../Makefile.targ
diff --git a/usr/src/cmd/dtrace/dtrace.c b/usr/src/cmd/dtrace/dtrace.c
index e74e3df690..f005629fc9 100644
--- a/usr/src/cmd/dtrace/dtrace.c
+++ b/usr/src/cmd/dtrace/dtrace.c
@@ -25,6 +25,7 @@
*/
/*
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -488,6 +489,7 @@ static void
print_probe_info(const dtrace_probeinfo_t *p)
{
char buf[BUFSIZ];
+ char *user;
int i;
oprintf("\n\tProbe Description Attributes\n");
@@ -511,10 +513,14 @@ print_probe_info(const dtrace_probeinfo_t *p)
oprintf("\n\tArgument Types\n");
for (i = 0; i < p->dtp_argc; i++) {
+ if (p->dtp_argv[i].dtt_flags & DTT_FL_USER)
+ user = "userland ";
+ else
+ user = "";
if (ctf_type_name(p->dtp_argv[i].dtt_ctfp,
p->dtp_argv[i].dtt_type, buf, sizeof (buf)) == NULL)
(void) strlcpy(buf, "(unknown)", sizeof (buf));
- oprintf("\t\targs[%d]: %s\n", i, buf);
+ oprintf("\t\targs[%d]: %s%s\n", i, user, buf);
}
if (p->dtp_argc == 0)
diff --git a/usr/src/cmd/dtrace/test/cmd/scripts/dtest.pl b/usr/src/cmd/dtrace/test/cmd/scripts/dtest.pl
index d6f1c8c277..e7f9189822 100644
--- a/usr/src/cmd/dtrace/test/cmd/scripts/dtest.pl
+++ b/usr/src/cmd/dtrace/test/cmd/scripts/dtest.pl
@@ -566,7 +566,7 @@ $defdir = -d $dt_tst ? $dt_tst : '.';
$bindir = -d $dt_bin ? $dt_bin : '.';
if (!$opt_F) {
- my @dependencies = ("gcc", "make", "java", "perl");
+ my @dependencies = ("gcc", "cc", "make", "java", "perl", "printenv");
for my $dep (@dependencies) {
if (!inpath($dep)) {
diff --git a/usr/src/cmd/dtrace/test/tst/common/Makefile b/usr/src/cmd/dtrace/test/tst/common/Makefile
index 4b813cb231..efa32d9179 100644
--- a/usr/src/cmd/dtrace/test/tst/common/Makefile
+++ b/usr/src/cmd/dtrace/test/tst/common/Makefile
@@ -26,6 +26,12 @@
#
# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
+#
+
+#
+# WARNING: Do not include Makefile.ctf here. That will cause tests to
+# break.
#
include $(SRC)/Makefile.master
@@ -72,6 +78,50 @@ pid/tst.gcc.exe: pid/tst.gcc.c
$(GCC) -o pid/tst.gcc.exe pid/tst.gcc.c $(LDFLAGS)
$(POST_PROCESS) ; $(STRIP_STABS)
+json/tst.usdt.o: json/usdt.h
+
+json/usdt.h: json/usdt.d
+ $(DTRACE) -h -s json/usdt.d -o json/usdt.h
+
+json/usdt.o: json/usdt.d json/tst.usdt.o
+ $(COMPILE.d) -o json/usdt.o -s json/usdt.d json/tst.usdt.o
+
+json/tst.usdt.exe: json/tst.usdt.o json/usdt.o
+ $(LINK.c) -o json/tst.usdt.exe json/tst.usdt.o json/usdt.o $(LDLIBS)
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+#
+# Tests that use the next three programs rely on the binaries having
+# valid CTF data.
+#
+uctf/tst.aouttype.exe: uctf/tst.aouttype.c
+ $(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.aouttype.o uctf/tst.aouttype.c
+ $(CTFCONVERT) -i -L VERSION uctf/tst.aouttype.o
+ $(LINK.c) -o uctf/tst.aouttype.exe uctf/tst.aouttype.o $(LDLIBS)
+ $(CTFMERGE) -L VERSION -o $@ uctf/tst.aouttype.o
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+uctf/tst.chasestrings.exe: uctf/tst.chasestrings.c
+ $(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.chasestrings.o uctf/tst.chasestrings.c
+ $(CTFCONVERT) -i -L VERSION uctf/tst.chasestrings.o
+ $(LINK.c) -o uctf/tst.chasestrings.exe uctf/tst.chasestrings.o $(LDLIBS)
+ $(CTFMERGE) -L VERSION -o $@ uctf/tst.chasestrings.o
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+uctf/tst.printtype.exe: uctf/tst.printtype.c
+ $(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.printtype.o uctf/tst.printtype.c
+ $(CTFCONVERT) -i -L VERSION uctf/tst.printtype.o
+ $(LINK.c) -o uctf/tst.printtype.exe uctf/tst.printtype.o $(LDLIBS)
+ $(CTFMERGE) -L VERSION -o $@ uctf/tst.printtype.o
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+#
+# This program should never have any ctf data in it.
+#
+uctf/tst.libtype.exe:
+ $(LINK.c) -o uctf/tst.libtype.exe uctf/tst.libtype.c $(LDLIBS)
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
usdt/tst.args.exe: usdt/tst.args.o usdt/args.o
$(LINK.c) -o usdt/tst.args.exe usdt/tst.args.o usdt/args.o $(LDLIBS)
$(POST_PROCESS) ; $(STRIP_STABS)
@@ -100,6 +150,14 @@ usdt/tst.forker.o: usdt/forker.h
usdt/forker.h: usdt/forker.d
$(DTRACE) -h -s usdt/forker.d -o usdt/forker.h
+ustack/tst.unpriv.exe: ustack/tst.unpriv.o ustack/unpriv_helper.o
+ $(LINK.c) -o ustack/tst.unpriv.exe \
+ ustack/tst.unpriv.o ustack/unpriv_helper.o $(LDLIBS)
+ $(POST_PROCESS) ; $(STRIP_STABS)
+
+ustack/unpriv_helper.o: ustack/unpriv_helper.d
+ $(COMPILE.d) -o ustack/unpriv_helper.o -s ustack/unpriv_helper.d
+
usdt/tst.lazyprobe.exe: usdt/tst.lazyprobe.o usdt/lazyprobe.o
$(LINK.c) -o usdt/tst.lazyprobe.exe \
usdt/tst.lazyprobe.o usdt/lazyprobe.o $(LDLIBS)
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
new file mode 100644
index 0000000000..a594afc7d6
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
@@ -0,0 +1,32 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+#pragma D option encoding=utf8
+#pragma D option aggzoom
+
+tick-1ms
+/i++ < 320/
+{
+ @ = lquantize(i, 0, 640, 1, i);
+ @ = lquantize(641 - i, 0, 640, 1, i);
+}
+
+tick-1ms
+/i == 320/
+{
+ printa(@);
+ exit(0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
new file mode 100644
index 0000000000..68482ffbe1
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
@@ -0,0 +1,646 @@
+
+
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 | 1
+ 2 |â– 2
+ 3 |â–Ž 3
+ 4 |â– 4
+ 5 |▌ 5
+ 6 |â–‹ 6
+ 7 |â–Š 7
+ 8 |â–‰ 8
+ 9 |â–ˆ 9
+ 10 |█■10
+ 11 |█▎ 11
+ 12 |█■12
+ 13 |█▌ 13
+ 14 |█▋ 14
+ 15 |█▊ 15
+ 16 |█▉ 16
+ 17 |██ 17
+ 18 |██■18
+ 19 |██▎ 19
+ 20 |██■20
+ 21 |██■21
+ 22 |██▌ 22
+ 23 |██▋ 23
+ 24 |██▊ 24
+ 25 |██▉ 25
+ 26 |███ 26
+ 27 |███■27
+ 28 |███▎ 28
+ 29 |███■29
+ 30 |███▌ 30
+ 31 |███▋ 31
+ 32 |███▊ 32
+ 33 |███▉ 33
+ 34 |████ 34
+ 35 |████■35
+ 36 |████▎ 36
+ 37 |████■37
+ 38 |████▌ 38
+ 39 |████▋ 39
+ 40 |████▊ 40
+ 41 |████▊ 41
+ 42 |████▉ 42
+ 43 |█████ 43
+ 44 |█████■44
+ 45 |█████▎ 45
+ 46 |█████■46
+ 47 |█████▌ 47
+ 48 |█████▋ 48
+ 49 |█████▊ 49
+ 50 |█████▉ 50
+ 51 |██████ 51
+ 52 |██████■52
+ 53 |██████▎ 53
+ 54 |██████■54
+ 55 |██████▌ 55
+ 56 |██████▋ 56
+ 57 |██████▊ 57
+ 58 |██████▉ 58
+ 59 |███████ 59
+ 60 |███████■60
+ 61 |███████■61
+ 62 |███████▎ 62
+ 63 |███████■63
+ 64 |███████▌ 64
+ 65 |███████▋ 65
+ 66 |███████▊ 66
+ 67 |███████▉ 67
+ 68 |████████ 68
+ 69 |████████■69
+ 70 |████████▎ 70
+ 71 |████████■71
+ 72 |████████▌ 72
+ 73 |████████▋ 73
+ 74 |████████▊ 74
+ 75 |████████▉ 75
+ 76 |█████████ 76
+ 77 |█████████■77
+ 78 |█████████▎ 78
+ 79 |█████████■79
+ 80 |█████████▌ 80
+ 81 |█████████▌ 81
+ 82 |█████████▋ 82
+ 83 |█████████▊ 83
+ 84 |█████████▉ 84
+ 85 |██████████ 85
+ 86 |██████████■86
+ 87 |██████████▎ 87
+ 88 |██████████■88
+ 89 |██████████▌ 89
+ 90 |██████████▋ 90
+ 91 |██████████▊ 91
+ 92 |██████████▉ 92
+ 93 |███████████ 93
+ 94 |███████████■94
+ 95 |███████████▎ 95
+ 96 |███████████■96
+ 97 |███████████▌ 97
+ 98 |███████████▋ 98
+ 99 |███████████▊ 99
+ 100 |███████████▉ 100
+ 101 |███████████▉ 101
+ 102 |████████████ 102
+ 103 |████████████■103
+ 104 |████████████▎ 104
+ 105 |████████████■105
+ 106 |████████████▌ 106
+ 107 |████████████▋ 107
+ 108 |████████████▊ 108
+ 109 |████████████▉ 109
+ 110 |█████████████ 110
+ 111 |█████████████■111
+ 112 |█████████████▎ 112
+ 113 |█████████████■113
+ 114 |█████████████▌ 114
+ 115 |█████████████▋ 115
+ 116 |█████████████▊ 116
+ 117 |█████████████▉ 117
+ 118 |██████████████ 118
+ 119 |██████████████■119
+ 120 |██████████████▎ 120
+ 121 |██████████████▎ 121
+ 122 |██████████████■122
+ 123 |██████████████▌ 123
+ 124 |██████████████▋ 124
+ 125 |██████████████▊ 125
+ 126 |██████████████▉ 126
+ 127 |███████████████ 127
+ 128 |███████████████■128
+ 129 |███████████████▎ 129
+ 130 |███████████████■130
+ 131 |███████████████▌ 131
+ 132 |███████████████▋ 132
+ 133 |███████████████▊ 133
+ 134 |███████████████▉ 134
+ 135 |████████████████ 135
+ 136 |████████████████■136
+ 137 |████████████████▎ 137
+ 138 |████████████████■138
+ 139 |████████████████▌ 139
+ 140 |████████████████▋ 140
+ 141 |████████████████▋ 141
+ 142 |████████████████▊ 142
+ 143 |████████████████▉ 143
+ 144 |█████████████████ 144
+ 145 |█████████████████■145
+ 146 |█████████████████▎ 146
+ 147 |█████████████████■147
+ 148 |█████████████████▌ 148
+ 149 |█████████████████▋ 149
+ 150 |█████████████████▊ 150
+ 151 |█████████████████▉ 151
+ 152 |██████████████████ 152
+ 153 |██████████████████■153
+ 154 |██████████████████▎ 154
+ 155 |██████████████████■155
+ 156 |██████████████████▌ 156
+ 157 |██████████████████▋ 157
+ 158 |██████████████████▊ 158
+ 159 |██████████████████▉ 159
+ 160 |███████████████████ 160
+ 161 |███████████████████ 161
+ 162 |███████████████████■162
+ 163 |███████████████████▎ 163
+ 164 |███████████████████■164
+ 165 |███████████████████▌ 165
+ 166 |███████████████████▋ 166
+ 167 |███████████████████▊ 167
+ 168 |███████████████████▉ 168
+ 169 |████████████████████ 169
+ 170 |████████████████████■170
+ 171 |████████████████████▎ 171
+ 172 |████████████████████■172
+ 173 |████████████████████▌ 173
+ 174 |████████████████████▋ 174
+ 175 |████████████████████▊ 175
+ 176 |████████████████████▉ 176
+ 177 |█████████████████████ 177
+ 178 |█████████████████████■178
+ 179 |█████████████████████▎ 179
+ 180 |█████████████████████■180
+ 181 |█████████████████████■181
+ 182 |█████████████████████▌ 182
+ 183 |█████████████████████▋ 183
+ 184 |█████████████████████▊ 184
+ 185 |█████████████████████▉ 185
+ 186 |██████████████████████ 186
+ 187 |██████████████████████■187
+ 188 |██████████████████████▎ 188
+ 189 |██████████████████████■189
+ 190 |██████████████████████▌ 190
+ 191 |██████████████████████▋ 191
+ 192 |██████████████████████▊ 192
+ 193 |██████████████████████▉ 193
+ 194 |███████████████████████ 194
+ 195 |███████████████████████■195
+ 196 |███████████████████████▎ 196
+ 197 |███████████████████████■197
+ 198 |███████████████████████▌ 198
+ 199 |███████████████████████▋ 199
+ 200 |███████████████████████▊ 200
+ 201 |███████████████████████▊ 201
+ 202 |███████████████████████▉ 202
+ 203 |████████████████████████ 203
+ 204 |████████████████████████■204
+ 205 |████████████████████████▎ 205
+ 206 |████████████████████████■206
+ 207 |████████████████████████▌ 207
+ 208 |████████████████████████▋ 208
+ 209 |████████████████████████▊ 209
+ 210 |████████████████████████▉ 210
+ 211 |█████████████████████████ 211
+ 212 |█████████████████████████■212
+ 213 |█████████████████████████▎ 213
+ 214 |█████████████████████████■214
+ 215 |█████████████████████████▌ 215
+ 216 |█████████████████████████▋ 216
+ 217 |█████████████████████████▊ 217
+ 218 |█████████████████████████▉ 218
+ 219 |██████████████████████████ 219
+ 220 |██████████████████████████■220
+ 221 |██████████████████████████■221
+ 222 |██████████████████████████▎ 222
+ 223 |██████████████████████████■223
+ 224 |██████████████████████████▌ 224
+ 225 |██████████████████████████▋ 225
+ 226 |██████████████████████████▊ 226
+ 227 |██████████████████████████▉ 227
+ 228 |███████████████████████████ 228
+ 229 |███████████████████████████■229
+ 230 |███████████████████████████▎ 230
+ 231 |███████████████████████████■231
+ 232 |███████████████████████████▌ 232
+ 233 |███████████████████████████▋ 233
+ 234 |███████████████████████████▊ 234
+ 235 |███████████████████████████▉ 235
+ 236 |████████████████████████████ 236
+ 237 |████████████████████████████■237
+ 238 |████████████████████████████▎ 238
+ 239 |████████████████████████████■239
+ 240 |████████████████████████████▌ 240
+ 241 |████████████████████████████▌ 241
+ 242 |████████████████████████████▋ 242
+ 243 |████████████████████████████▊ 243
+ 244 |████████████████████████████▉ 244
+ 245 |█████████████████████████████ 245
+ 246 |█████████████████████████████■246
+ 247 |█████████████████████████████▎ 247
+ 248 |█████████████████████████████■248
+ 249 |█████████████████████████████▌ 249
+ 250 |█████████████████████████████▋ 250
+ 251 |█████████████████████████████▊ 251
+ 252 |█████████████████████████████▉ 252
+ 253 |██████████████████████████████ 253
+ 254 |██████████████████████████████■254
+ 255 |██████████████████████████████▎ 255
+ 256 |██████████████████████████████■256
+ 257 |██████████████████████████████▌ 257
+ 258 |██████████████████████████████▋ 258
+ 259 |██████████████████████████████▊ 259
+ 260 |██████████████████████████████▉ 260
+ 261 |██████████████████████████████▉ 261
+ 262 |███████████████████████████████ 262
+ 263 |███████████████████████████████■263
+ 264 |███████████████████████████████▎ 264
+ 265 |███████████████████████████████■265
+ 266 |███████████████████████████████▌ 266
+ 267 |███████████████████████████████▋ 267
+ 268 |███████████████████████████████▊ 268
+ 269 |███████████████████████████████▉ 269
+ 270 |████████████████████████████████ 270
+ 271 |████████████████████████████████■271
+ 272 |████████████████████████████████▎ 272
+ 273 |████████████████████████████████■273
+ 274 |████████████████████████████████▌ 274
+ 275 |████████████████████████████████▋ 275
+ 276 |████████████████████████████████▊ 276
+ 277 |████████████████████████████████▉ 277
+ 278 |█████████████████████████████████ 278
+ 279 |█████████████████████████████████■279
+ 280 |█████████████████████████████████▎ 280
+ 281 |█████████████████████████████████▎ 281
+ 282 |█████████████████████████████████■282
+ 283 |█████████████████████████████████▌ 283
+ 284 |█████████████████████████████████▋ 284
+ 285 |█████████████████████████████████▊ 285
+ 286 |█████████████████████████████████▉ 286
+ 287 |██████████████████████████████████ 287
+ 288 |██████████████████████████████████■288
+ 289 |██████████████████████████████████▎ 289
+ 290 |██████████████████████████████████■290
+ 291 |██████████████████████████████████▌ 291
+ 292 |██████████████████████████████████▋ 292
+ 293 |██████████████████████████████████▊ 293
+ 294 |██████████████████████████████████▉ 294
+ 295 |███████████████████████████████████ 295
+ 296 |███████████████████████████████████■296
+ 297 |███████████████████████████████████▎ 297
+ 298 |███████████████████████████████████■298
+ 299 |███████████████████████████████████▌ 299
+ 300 |███████████████████████████████████▋ 300
+ 301 |███████████████████████████████████▋ 301
+ 302 |███████████████████████████████████▊ 302
+ 303 |███████████████████████████████████▉ 303
+ 304 |████████████████████████████████████ 304
+ 305 |████████████████████████████████████■305
+ 306 |████████████████████████████████████▎ 306
+ 307 |████████████████████████████████████■307
+ 308 |████████████████████████████████████▌ 308
+ 309 |████████████████████████████████████▋ 309
+ 310 |████████████████████████████████████▊ 310
+ 311 |████████████████████████████████████▉ 311
+ 312 |█████████████████████████████████████ 312
+ 313 |█████████████████████████████████████■313
+ 314 |█████████████████████████████████████▎ 314
+ 315 |█████████████████████████████████████■315
+ 316 |█████████████████████████████████████▌ 316
+ 317 |█████████████████████████████████████▋ 317
+ 318 |█████████████████████████████████████▊ 318
+ 319 |█████████████████████████████████████▉ 319
+ 320 |██████████████████████████████████████ 320
+ 321 |██████████████████████████████████████ 320
+ 322 |█████████████████████████████████████▉ 319
+ 323 |█████████████████████████████████████▊ 318
+ 324 |█████████████████████████████████████▋ 317
+ 325 |█████████████████████████████████████▌ 316
+ 326 |█████████████████████████████████████■315
+ 327 |█████████████████████████████████████▎ 314
+ 328 |█████████████████████████████████████■313
+ 329 |█████████████████████████████████████ 312
+ 330 |████████████████████████████████████▉ 311
+ 331 |████████████████████████████████████▊ 310
+ 332 |████████████████████████████████████▋ 309
+ 333 |████████████████████████████████████▌ 308
+ 334 |████████████████████████████████████■307
+ 335 |████████████████████████████████████▎ 306
+ 336 |████████████████████████████████████■305
+ 337 |████████████████████████████████████ 304
+ 338 |███████████████████████████████████▉ 303
+ 339 |███████████████████████████████████▊ 302
+ 340 |███████████████████████████████████▋ 301
+ 341 |███████████████████████████████████▋ 300
+ 342 |███████████████████████████████████▌ 299
+ 343 |███████████████████████████████████■298
+ 344 |███████████████████████████████████▎ 297
+ 345 |███████████████████████████████████■296
+ 346 |███████████████████████████████████ 295
+ 347 |██████████████████████████████████▉ 294
+ 348 |██████████████████████████████████▊ 293
+ 349 |██████████████████████████████████▋ 292
+ 350 |██████████████████████████████████▌ 291
+ 351 |██████████████████████████████████■290
+ 352 |██████████████████████████████████▎ 289
+ 353 |██████████████████████████████████■288
+ 354 |██████████████████████████████████ 287
+ 355 |█████████████████████████████████▉ 286
+ 356 |█████████████████████████████████▊ 285
+ 357 |█████████████████████████████████▋ 284
+ 358 |█████████████████████████████████▌ 283
+ 359 |█████████████████████████████████■282
+ 360 |█████████████████████████████████▎ 281
+ 361 |█████████████████████████████████▎ 280
+ 362 |█████████████████████████████████■279
+ 363 |█████████████████████████████████ 278
+ 364 |████████████████████████████████▉ 277
+ 365 |████████████████████████████████▊ 276
+ 366 |████████████████████████████████▋ 275
+ 367 |████████████████████████████████▌ 274
+ 368 |████████████████████████████████■273
+ 369 |████████████████████████████████▎ 272
+ 370 |████████████████████████████████■271
+ 371 |████████████████████████████████ 270
+ 372 |███████████████████████████████▉ 269
+ 373 |███████████████████████████████▊ 268
+ 374 |███████████████████████████████▋ 267
+ 375 |███████████████████████████████▌ 266
+ 376 |███████████████████████████████■265
+ 377 |███████████████████████████████▎ 264
+ 378 |███████████████████████████████■263
+ 379 |███████████████████████████████ 262
+ 380 |██████████████████████████████▉ 261
+ 381 |██████████████████████████████▉ 260
+ 382 |██████████████████████████████▊ 259
+ 383 |██████████████████████████████▋ 258
+ 384 |██████████████████████████████▌ 257
+ 385 |██████████████████████████████■256
+ 386 |██████████████████████████████▎ 255
+ 387 |██████████████████████████████■254
+ 388 |██████████████████████████████ 253
+ 389 |█████████████████████████████▉ 252
+ 390 |█████████████████████████████▊ 251
+ 391 |█████████████████████████████▋ 250
+ 392 |█████████████████████████████▌ 249
+ 393 |█████████████████████████████■248
+ 394 |█████████████████████████████▎ 247
+ 395 |█████████████████████████████■246
+ 396 |█████████████████████████████ 245
+ 397 |████████████████████████████▉ 244
+ 398 |████████████████████████████▊ 243
+ 399 |████████████████████████████▋ 242
+ 400 |████████████████████████████▌ 241
+ 401 |████████████████████████████▌ 240
+ 402 |████████████████████████████■239
+ 403 |████████████████████████████▎ 238
+ 404 |████████████████████████████■237
+ 405 |████████████████████████████ 236
+ 406 |███████████████████████████▉ 235
+ 407 |███████████████████████████▊ 234
+ 408 |███████████████████████████▋ 233
+ 409 |███████████████████████████▌ 232
+ 410 |███████████████████████████■231
+ 411 |███████████████████████████▎ 230
+ 412 |███████████████████████████■229
+ 413 |███████████████████████████ 228
+ 414 |██████████████████████████▉ 227
+ 415 |██████████████████████████▊ 226
+ 416 |██████████████████████████▋ 225
+ 417 |██████████████████████████▌ 224
+ 418 |██████████████████████████■223
+ 419 |██████████████████████████▎ 222
+ 420 |██████████████████████████■221
+ 421 |██████████████████████████■220
+ 422 |██████████████████████████ 219
+ 423 |█████████████████████████▉ 218
+ 424 |█████████████████████████▊ 217
+ 425 |█████████████████████████▋ 216
+ 426 |█████████████████████████▌ 215
+ 427 |█████████████████████████■214
+ 428 |█████████████████████████▎ 213
+ 429 |█████████████████████████■212
+ 430 |█████████████████████████ 211
+ 431 |████████████████████████▉ 210
+ 432 |████████████████████████▊ 209
+ 433 |████████████████████████▋ 208
+ 434 |████████████████████████▌ 207
+ 435 |████████████████████████■206
+ 436 |████████████████████████▎ 205
+ 437 |████████████████████████■204
+ 438 |████████████████████████ 203
+ 439 |███████████████████████▉ 202
+ 440 |███████████████████████▊ 201
+ 441 |███████████████████████▊ 200
+ 442 |███████████████████████▋ 199
+ 443 |███████████████████████▌ 198
+ 444 |███████████████████████■197
+ 445 |███████████████████████▎ 196
+ 446 |███████████████████████■195
+ 447 |███████████████████████ 194
+ 448 |██████████████████████▉ 193
+ 449 |██████████████████████▊ 192
+ 450 |██████████████████████▋ 191
+ 451 |██████████████████████▌ 190
+ 452 |██████████████████████■189
+ 453 |██████████████████████▎ 188
+ 454 |██████████████████████■187
+ 455 |██████████████████████ 186
+ 456 |█████████████████████▉ 185
+ 457 |█████████████████████▊ 184
+ 458 |█████████████████████▋ 183
+ 459 |█████████████████████▌ 182
+ 460 |█████████████████████■181
+ 461 |█████████████████████■180
+ 462 |█████████████████████▎ 179
+ 463 |█████████████████████■178
+ 464 |█████████████████████ 177
+ 465 |████████████████████▉ 176
+ 466 |████████████████████▊ 175
+ 467 |████████████████████▋ 174
+ 468 |████████████████████▌ 173
+ 469 |████████████████████■172
+ 470 |████████████████████▎ 171
+ 471 |████████████████████■170
+ 472 |████████████████████ 169
+ 473 |███████████████████▉ 168
+ 474 |███████████████████▊ 167
+ 475 |███████████████████▋ 166
+ 476 |███████████████████▌ 165
+ 477 |███████████████████■164
+ 478 |███████████████████▎ 163
+ 479 |███████████████████■162
+ 480 |███████████████████ 161
+ 481 |███████████████████ 160
+ 482 |██████████████████▉ 159
+ 483 |██████████████████▊ 158
+ 484 |██████████████████▋ 157
+ 485 |██████████████████▌ 156
+ 486 |██████████████████■155
+ 487 |██████████████████▎ 154
+ 488 |██████████████████■153
+ 489 |██████████████████ 152
+ 490 |█████████████████▉ 151
+ 491 |█████████████████▊ 150
+ 492 |█████████████████▋ 149
+ 493 |█████████████████▌ 148
+ 494 |█████████████████■147
+ 495 |█████████████████▎ 146
+ 496 |█████████████████■145
+ 497 |█████████████████ 144
+ 498 |████████████████▉ 143
+ 499 |████████████████▊ 142
+ 500 |████████████████▋ 141
+ 501 |████████████████▋ 140
+ 502 |████████████████▌ 139
+ 503 |████████████████■138
+ 504 |████████████████▎ 137
+ 505 |████████████████■136
+ 506 |████████████████ 135
+ 507 |███████████████▉ 134
+ 508 |███████████████▊ 133
+ 509 |███████████████▋ 132
+ 510 |███████████████▌ 131
+ 511 |███████████████■130
+ 512 |███████████████▎ 129
+ 513 |███████████████■128
+ 514 |███████████████ 127
+ 515 |██████████████▉ 126
+ 516 |██████████████▊ 125
+ 517 |██████████████▋ 124
+ 518 |██████████████▌ 123
+ 519 |██████████████■122
+ 520 |██████████████▎ 121
+ 521 |██████████████▎ 120
+ 522 |██████████████■119
+ 523 |██████████████ 118
+ 524 |█████████████▉ 117
+ 525 |█████████████▊ 116
+ 526 |█████████████▋ 115
+ 527 |█████████████▌ 114
+ 528 |█████████████■113
+ 529 |█████████████▎ 112
+ 530 |█████████████■111
+ 531 |█████████████ 110
+ 532 |████████████▉ 109
+ 533 |████████████▊ 108
+ 534 |████████████▋ 107
+ 535 |████████████▌ 106
+ 536 |████████████■105
+ 537 |████████████▎ 104
+ 538 |████████████■103
+ 539 |████████████ 102
+ 540 |███████████▉ 101
+ 541 |███████████▉ 100
+ 542 |███████████▊ 99
+ 543 |███████████▋ 98
+ 544 |███████████▌ 97
+ 545 |███████████■96
+ 546 |███████████▎ 95
+ 547 |███████████■94
+ 548 |███████████ 93
+ 549 |██████████▉ 92
+ 550 |██████████▊ 91
+ 551 |██████████▋ 90
+ 552 |██████████▌ 89
+ 553 |██████████■88
+ 554 |██████████▎ 87
+ 555 |██████████■86
+ 556 |██████████ 85
+ 557 |█████████▉ 84
+ 558 |█████████▊ 83
+ 559 |█████████▋ 82
+ 560 |█████████▌ 81
+ 561 |█████████▌ 80
+ 562 |█████████■79
+ 563 |█████████▎ 78
+ 564 |█████████■77
+ 565 |█████████ 76
+ 566 |████████▉ 75
+ 567 |████████▊ 74
+ 568 |████████▋ 73
+ 569 |████████▌ 72
+ 570 |████████■71
+ 571 |████████▎ 70
+ 572 |████████■69
+ 573 |████████ 68
+ 574 |███████▉ 67
+ 575 |███████▊ 66
+ 576 |███████▋ 65
+ 577 |███████▌ 64
+ 578 |███████■63
+ 579 |███████▎ 62
+ 580 |███████■61
+ 581 |███████■60
+ 582 |███████ 59
+ 583 |██████▉ 58
+ 584 |██████▊ 57
+ 585 |██████▋ 56
+ 586 |██████▌ 55
+ 587 |██████■54
+ 588 |██████▎ 53
+ 589 |██████■52
+ 590 |██████ 51
+ 591 |█████▉ 50
+ 592 |█████▊ 49
+ 593 |█████▋ 48
+ 594 |█████▌ 47
+ 595 |█████■46
+ 596 |█████▎ 45
+ 597 |█████■44
+ 598 |█████ 43
+ 599 |████▉ 42
+ 600 |████▊ 41
+ 601 |████▊ 40
+ 602 |████▋ 39
+ 603 |████▌ 38
+ 604 |████■37
+ 605 |████▎ 36
+ 606 |████■35
+ 607 |████ 34
+ 608 |███▉ 33
+ 609 |███▊ 32
+ 610 |███▋ 31
+ 611 |███▌ 30
+ 612 |███■29
+ 613 |███▎ 28
+ 614 |███■27
+ 615 |███ 26
+ 616 |██▉ 25
+ 617 |██▊ 24
+ 618 |██▋ 23
+ 619 |██▌ 22
+ 620 |██■21
+ 621 |██■20
+ 622 |██▎ 19
+ 623 |██■18
+ 624 |██ 17
+ 625 |█▉ 16
+ 626 |█▊ 15
+ 627 |█▋ 14
+ 628 |█▌ 13
+ 629 |█■12
+ 630 |█▎ 11
+ 631 |█■10
+ 632 |â–ˆ 9
+ 633 |â–‰ 8
+ 634 |â–Š 7
+ 635 |â–‹ 6
+ 636 |▌ 5
+ 637 |â– 4
+ 638 |â–Ž 3
+ 639 |â– 2
+ >= 640 | 1
+
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
new file mode 100644
index 0000000000..317aecefdd
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
@@ -0,0 +1,46 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option agghist
+#pragma D option quiet
+
+BEGIN
+{
+ @["demerit"] = sum(-10);
+ @["wtf"] = sum(10);
+ @["bot"] = sum(20);
+
+ @bagnoogle["SOAP/XML"] = sum(1);
+ @bagnoogle["XACML store"] = sum(5);
+ @bagnoogle["SAML token"] = sum(6);
+
+ @stalloogle["breakfast"] = sum(-5);
+ @stalloogle["non-diet pepsi"] = sum(-20);
+ @stalloogle["parrot"] = sum(-100);
+
+ printa(@);
+ printa(@bagnoogle);
+ printa(@stalloogle);
+
+ printf("\nzoomed:");
+
+ setopt("aggzoom");
+ printa(@);
+ printa(@bagnoogle);
+ printa(@stalloogle);
+
+ exit(0);
+}
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
new file mode 100644
index 0000000000..d76e4da4b8
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
@@ -0,0 +1,38 @@
+
+
+ key ------------- Distribution ------------- count
+ demerit @@@@@| -10
+ wtf |@@@@@ 10
+ bot |@@@@@@@@@@ 20
+
+
+ key ------------- Distribution ------------- count
+ SOAP/XML |@@@ 1
+ XACML store |@@@@@@@@@@@@@@@@@ 5
+ SAML token |@@@@@@@@@@@@@@@@@@@@ 6
+
+
+ key ------------- Distribution ------------- count
+ parrot @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100
+ non-diet pepsi @@@@@@| -20
+ breakfast @@| -5
+
+zoomed:
+
+ key ------------- Distribution ------------- count
+ demerit @@@@@@@@@@| -10
+ wtf |@@@@@@@@@@ 10
+ bot |@@@@@@@@@@@@@@@@@@@ 20
+
+
+ key ------------- Distribution ------------- count
+ SOAP/XML |@@@@@@@ 1
+ XACML store |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ SAML token |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
+
+
+ key ------------- Distribution ------------- count
+ parrot @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100
+ non-diet pepsi @@@@@@@@| -20
+ breakfast @@| -5
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
new file mode 100644
index 0000000000..c9fdba76c4
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
@@ -0,0 +1,53 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option aggpack
+#pragma D option encoding=ascii
+#pragma D option quiet
+
+BEGIN
+{
+ @x = quantize(1 << 32);
+ @y[1] = quantize(1);
+ @z["mumble"] = quantize(1);
+ @xx["foo", (char)1, (short)2, (long)3] = quantize(1);
+
+ @neg = lquantize(-10, -10, 20, 1, -1);
+ @neg = lquantize(-5, -10, 20, 1, 1);
+ @neg = lquantize(0, -10, 20, 1, 1);
+
+ i = 0;
+}
+
+tick-1ms
+{
+ @a[i] = quantize(0, i);
+ @a[i] = quantize(1, 100 - i);
+ i++;
+}
+
+tick-1ms
+/i > 100/
+{
+ exit(0);
+}
+
+END
+{
+ setopt("aggzoom", "true");
+ printa(@neg);
+ setopt("aggzoom", "false");
+ printa(@neg);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
new file mode 100644
index 0000000000..5300ebdbe9
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
@@ -0,0 +1,124 @@
+
+
+ min .--------------------------------. max | count
+ < -10 : V X X : >= 20 | 1
+
+
+ min .--------------------------------. max | count
+ < -10 : v x x : >= 20 | 1
+
+
+ min .---. max | count
+ 2147483648 : X : 8589934592 | 1
+
+ key min .---. max | count
+ 1 0 : X : 2 | 1
+
+ key min .---. max | count
+ mumble 0 : X : 2 | 1
+
+ key min .---. max | count
+ foo 1 2 3 0 : X : 2 | 1
+
+ key min .---. max | count
+ 100 0 :X : 2 | 100
+ 99 0 :X_ : 2 | 100
+ 98 0 :X_ : 2 | 100
+ 97 0 :X_ : 2 | 100
+ 96 0 :X_ : 2 | 100
+ 95 0 :X_ : 2 | 100
+ 94 0 :X_ : 2 | 100
+ 93 0 :X_ : 2 | 100
+ 92 0 :X_ : 2 | 100
+ 91 0 :X_ : 2 | 100
+ 90 0 :X_ : 2 | 100
+ 89 0 :X_ : 2 | 100
+ 88 0 :X_ : 2 | 100
+ 87 0 :X_ : 2 | 100
+ 86 0 :X_ : 2 | 100
+ 85 0 :X_ : 2 | 100
+ 84 0 :X_ : 2 | 100
+ 83 0 :X_ : 2 | 100
+ 82 0 :X_ : 2 | 100
+ 81 0 :X_ : 2 | 100
+ 80 0 :X_ : 2 | 100
+ 79 0 :X_ : 2 | 100
+ 78 0 :xx : 2 | 100
+ 77 0 :xx : 2 | 100
+ 76 0 :xx : 2 | 100
+ 75 0 :xx : 2 | 100
+ 74 0 :xx : 2 | 100
+ 73 0 :xx : 2 | 100
+ 72 0 :xx : 2 | 100
+ 71 0 :xx : 2 | 100
+ 70 0 :xx : 2 | 100
+ 69 0 :xx : 2 | 100
+ 68 0 :xx : 2 | 100
+ 67 0 :xx : 2 | 100
+ 66 0 :xx : 2 | 100
+ 65 0 :xx : 2 | 100
+ 64 0 :xx : 2 | 100
+ 63 0 :xx : 2 | 100
+ 62 0 :xx : 2 | 100
+ 61 0 :xx : 2 | 100
+ 60 0 :xx : 2 | 100
+ 59 0 :xx : 2 | 100
+ 58 0 :xx : 2 | 100
+ 57 0 :xx : 2 | 100
+ 56 0 :xx : 2 | 100
+ 55 0 :xx : 2 | 100
+ 54 0 :xx : 2 | 100
+ 53 0 :xx : 2 | 100
+ 52 0 :xx : 2 | 100
+ 51 0 :xx : 2 | 100
+ 50 0 :xx : 2 | 100
+ 49 0 :xx : 2 | 100
+ 48 0 :xx : 2 | 100
+ 47 0 :xx : 2 | 100
+ 46 0 :xx : 2 | 100
+ 45 0 :xx : 2 | 100
+ 44 0 :xx : 2 | 100
+ 43 0 :xx : 2 | 100
+ 42 0 :xx : 2 | 100
+ 41 0 :xx : 2 | 100
+ 40 0 :xx : 2 | 100
+ 39 0 :xx : 2 | 100
+ 38 0 :xx : 2 | 100
+ 37 0 :xx : 2 | 100
+ 36 0 :xx : 2 | 100
+ 35 0 :xx : 2 | 100
+ 34 0 :xx : 2 | 100
+ 33 0 :xx : 2 | 100
+ 32 0 :xx : 2 | 100
+ 31 0 :xx : 2 | 100
+ 30 0 :xx : 2 | 100
+ 29 0 :xx : 2 | 100
+ 28 0 :xx : 2 | 100
+ 27 0 :xx : 2 | 100
+ 26 0 :xx : 2 | 100
+ 25 0 :xx : 2 | 100
+ 24 0 :xx : 2 | 100
+ 23 0 :xx : 2 | 100
+ 22 0 :xx : 2 | 100
+ 21 0 :_X : 2 | 100
+ 20 0 :_X : 2 | 100
+ 19 0 :_X : 2 | 100
+ 18 0 :_X : 2 | 100
+ 17 0 :_X : 2 | 100
+ 16 0 :_X : 2 | 100
+ 15 0 :_X : 2 | 100
+ 14 0 :_X : 2 | 100
+ 13 0 :_X : 2 | 100
+ 12 0 :_X : 2 | 100
+ 11 0 :_X : 2 | 100
+ 10 0 :_X : 2 | 100
+ 9 0 :_X : 2 | 100
+ 8 0 :_X : 2 | 100
+ 7 0 :_X : 2 | 100
+ 6 0 :_X : 2 | 100
+ 5 0 :_X : 2 | 100
+ 4 0 :_X : 2 | 100
+ 3 0 :_X : 2 | 100
+ 2 0 :_X : 2 | 100
+ 1 0 :_X : 2 | 100
+ 0 0 : X : 2 | 100
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
new file mode 100644
index 0000000000..e53a89b0bb
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
@@ -0,0 +1,75 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+let width=8
+
+function outputchar
+{
+ banner $3 | awk -v line=$1 -v pos=$2 -v width=$width '{ \
+ for (i = 1; i <= length($0); i++) { \
+ if (substr($0, i, 1) == " ") \
+ continue; \
+ printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
+ line, NR, i + (pos * width));
+ } \
+ }'
+}
+
+function outputstr
+{
+ let pos=0;
+ let line=0
+
+ printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
+
+ printf "BEGIN\n{\n"
+ for c in `echo "$1" | awk '{ \
+ for (i = 1; i <= length($0); i++) { \
+ c = substr($0, i, 1); \
+ printf("%s\n", c == " " ? "space" : \
+ c == "\n" ? "newline" : c); \
+ } \
+ }'`; do
+ if [[ "$c" == "space" ]]; then
+ let line=line+1
+ let pos=0
+ continue
+ fi
+
+ outputchar $line $pos $c
+ let pos=pos+1
+ done
+
+ let i=0
+
+ while [[ $i -le $line ]]; do
+ printf "\tprinta(@letter%d);\n" $i
+ let i=i+1
+ done
+ printf "\texit(0);\n}\n"
+}
+
+dtrace -qs /dev/stdin -x encoding=utf8 <<EOF
+`outputstr "why must i do this"`
+EOF
+
+dtrace -qs /dev/stdin -x encoding=ascii -x aggzoom <<EOF
+`outputstr "i am not well"`
+EOF
+
+dtrace -qs /dev/stdin -x encoding=utf8 -x aggzoom <<EOF
+`outputstr "send help"`
+EOF
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
new file mode 100644
index 0000000000..a7eba38785
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
@@ -0,0 +1,102 @@
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 6
+ 3 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 6
+ 4 < 0 : â–‚ â–‚ â–‚â–‚â–‚â–‚â–‚â–‚ â–‚ : >= 40 | 9
+ 5 < 0 : â–‚ â–‚â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 7
+ 6 < 0 : â–‚â–‚ â–‚â–‚ â–‚ â–‚ â–‚ : >= 40 | 7
+ 7 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 5
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚â–‚â–‚â–‚ â–‚â–‚â–‚â–‚â–‚ : >= 40 | 13
+ 3 < 0 : â–‚â–‚ â–‚â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 8
+ 4 < 0 : â–‚ â–‚â–‚ â–‚ â–‚ â–‚ â–‚â–‚â–‚â–‚ â–‚ : >= 40 | 11
+ 5 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 6
+ 6 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 7
+ 7 < 0 : â–‚ â–‚ â–‚â–‚â–‚â–‚ â–‚â–‚â–‚â–‚ â–‚ : >= 40 | 11
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : â–ˆ : >= 40 | 1
+ 3 < 0 : â–ˆ : >= 40 | 1
+ 4 < 0 : â–ˆ : >= 40 | 1
+ 5 < 0 : â–ˆ : >= 40 | 1
+ 6 < 0 : â–ˆ : >= 40 | 1
+ 7 < 0 : â–ˆ : >= 40 | 1
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : â–‚â–‚â–‚â–‚â–‚ â–‚â–‚â–‚â–‚ : >= 40 | 9
+ 3 < 0 : â–ƒ â–ƒ â–ƒ â–ƒ : >= 40 | 4
+ 4 < 0 : â–ƒ â–ƒ â–ƒ â–ƒ : >= 40 | 4
+ 5 < 0 : â–ƒ â–ƒ â–ƒ â–ƒ : >= 40 | 4
+ 6 < 0 : â–ƒ â–ƒ â–ƒ â–ƒ : >= 40 | 4
+ 7 < 0 : â–‚â–‚â–‚â–‚â–‚ â–‚â–‚â–‚â–‚ : >= 40 | 9
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : â–‚â–‚â–‚â–‚â–‚ â–‚ â–‚ â–‚ â–‚â–‚â–‚â–‚ : >= 40 | 12
+ 3 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 5
+ 4 < 0 : â–‚ â–‚â–‚â–‚â–‚â–‚â–‚ â–‚ â–‚â–‚â–‚â–‚ : >= 40 | 12
+ 5 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 5
+ 6 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚ â–‚ : >= 40 | 6
+ 7 < 0 : â–‚ â–‚ â–‚ â–‚ â–‚â–‚â–‚â–‚ : >= 40 | 8
+
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : X : >= 40 | 1
+ 3 < 0 : X : >= 40 | 1
+ 4 < 0 : X : >= 40 | 1
+ 5 < 0 : X : >= 40 | 1
+ 6 < 0 : X : >= 40 | 1
+ 7 < 0 : X : >= 40 | 1
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : XX X X : >= 40 | 4
+ 3 < 0 : X X XX XX : >= 40 | 6
+ 4 < 0 : X X X XX X : >= 40 | 6
+ 5 < 0 : XXXXXX X X : >= 40 | 8
+ 6 < 0 : X X X X : >= 40 | 4
+ 7 < 0 : X X X X : >= 40 | 4
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : X X XXXX XXXXX : >= 40 | 11
+ 3 < 0 : XX X X X X : >= 40 | 6
+ 4 < 0 : X X X X X X : >= 40 | 6
+ 5 < 0 : X X X X X X : >= 40 | 6
+ 6 < 0 : X XX X X X : >= 40 | 6
+ 7 < 0 : X X XXXX X : >= 40 | 7
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : X X XXXXXX X X : >= 40 | 10
+ 3 < 0 : X X X X X : >= 40 | 5
+ 4 < 0 : X X XXXXX X X : >= 40 | 9
+ 5 < 0 : X XX X X X X : >= 40 | 7
+ 6 < 0 : XX XX X X X : >= 40 | 7
+ 7 < 0 : X X XXXXXX XXXXXX XXXXXX : >= 40 | 20
+
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : ████ ██████ █ █ █████ : >= 40 | 17
+ 3 < 0 : █ █ ██ █ █ █ : >= 40 | 7
+ 4 < 0 : ████ █████ █ █ █ █ █ : >= 40 | 14
+ 5 < 0 : â–ˆ â–ˆ â–ˆ â–ˆ â–ˆ â–ˆ â–ˆ : >= 40 | 7
+ 6 < 0 : █ █ █ █ ██ █ █ : >= 40 | 8
+ 7 < 0 : ████ ██████ █ █ █████ : >= 40 | 17
+
+
+ key min .------------------------------------------. max | count
+ 2 < 0 : █ █ ██████ █ █████ : >= 40 | 14
+ 3 < 0 : â–ˆ â–ˆ â–ˆ â–ˆ â–ˆ â–ˆ : >= 40 | 6
+ 4 < 0 : ██████ █████ █ █ █ : >= 40 | 14
+ 5 < 0 : █ █ █ █ █████ : >= 40 | 9
+ 6 < 0 : â–ˆ â–ˆ â–ˆ â–ˆ â–ˆ : >= 40 | 5
+ 7 < 0 : █ █ ██████ ██████ █ : >= 40 | 15
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
new file mode 100644
index 0000000000..537d1defe5
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
@@ -0,0 +1,42 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ < 30/
+{
+ @[1] = lquantize(i, 0, 40, 1, 1000);
+ @[2] = lquantize(i, 0, 40, 1, 1000);
+ @[3] = lquantize(i, 0, 40, 1, 1000);
+}
+
+tick-1ms
+/i == 40/
+{
+ @[1] = lquantize(0, 0, 40, 1, 1);
+ @[1] = lquantize(i, 0, 40, 1, 2000);
+ @[2] = lquantize(0, 0, 40, 1, 1);
+ @[2] = lquantize(i, 0, 40, 1, 2000);
+ @[3] = lquantize(0, 0, 40, 1, 1);
+ @[3] = lquantize(i, 0, 40, 1, 2000);
+
+ printa(@);
+ setopt("aggpack");
+ printa(@);
+ setopt("aggzoom");
+ printa(@);
+ exit(0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
new file mode 100644
index 0000000000..bc7ec00ca5
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
@@ -0,0 +1,149 @@
+
+ 1
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 | 1
+ 1 |@ 1000
+ 2 |@ 1000
+ 3 |@ 1000
+ 4 |@ 1000
+ 5 |@ 1000
+ 6 |@ 1000
+ 7 |@ 1000
+ 8 |@ 1000
+ 9 |@ 1000
+ 10 |@ 1000
+ 11 |@ 1000
+ 12 |@ 1000
+ 13 |@ 1000
+ 14 |@ 1000
+ 15 |@ 1000
+ 16 |@ 1000
+ 17 |@ 1000
+ 18 |@ 1000
+ 19 |@ 1000
+ 20 |@ 1000
+ 21 |@ 1000
+ 22 |@ 1000
+ 23 |@ 1000
+ 24 |@ 1000
+ 25 |@ 1000
+ 26 |@ 1000
+ 27 |@ 1000
+ 28 |@ 1000
+ 29 |@ 1000
+ 30 |@ 1000
+ 31 | 0
+ 32 | 0
+ 33 | 0
+ 34 | 0
+ 35 | 0
+ 36 | 0
+ 37 | 0
+ 38 | 0
+ 39 | 0
+ >= 40 |@@ 2000
+
+ 2
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 | 1
+ 1 |@ 1000
+ 2 |@ 1000
+ 3 |@ 1000
+ 4 |@ 1000
+ 5 |@ 1000
+ 6 |@ 1000
+ 7 |@ 1000
+ 8 |@ 1000
+ 9 |@ 1000
+ 10 |@ 1000
+ 11 |@ 1000
+ 12 |@ 1000
+ 13 |@ 1000
+ 14 |@ 1000
+ 15 |@ 1000
+ 16 |@ 1000
+ 17 |@ 1000
+ 18 |@ 1000
+ 19 |@ 1000
+ 20 |@ 1000
+ 21 |@ 1000
+ 22 |@ 1000
+ 23 |@ 1000
+ 24 |@ 1000
+ 25 |@ 1000
+ 26 |@ 1000
+ 27 |@ 1000
+ 28 |@ 1000
+ 29 |@ 1000
+ 30 |@ 1000
+ 31 | 0
+ 32 | 0
+ 33 | 0
+ 34 | 0
+ 35 | 0
+ 36 | 0
+ 37 | 0
+ 38 | 0
+ 39 | 0
+ >= 40 |@@ 2000
+
+ 3
+ value ------------- Distribution ------------- count
+ < 0 | 0
+ 0 | 1
+ 1 |@ 1000
+ 2 |@ 1000
+ 3 |@ 1000
+ 4 |@ 1000
+ 5 |@ 1000
+ 6 |@ 1000
+ 7 |@ 1000
+ 8 |@ 1000
+ 9 |@ 1000
+ 10 |@ 1000
+ 11 |@ 1000
+ 12 |@ 1000
+ 13 |@ 1000
+ 14 |@ 1000
+ 15 |@ 1000
+ 16 |@ 1000
+ 17 |@ 1000
+ 18 |@ 1000
+ 19 |@ 1000
+ 20 |@ 1000
+ 21 |@ 1000
+ 22 |@ 1000
+ 23 |@ 1000
+ 24 |@ 1000
+ 25 |@ 1000
+ 26 |@ 1000
+ 27 |@ 1000
+ 28 |@ 1000
+ 29 |@ 1000
+ 30 |@ 1000
+ 31 | 0
+ 32 | 0
+ 33 | 0
+ 34 | 0
+ 35 | 0
+ 36 | 0
+ 37 | 0
+ 38 | 0
+ 39 | 0
+ >= 40 |@@ 2000
+
+
+
+ key min .------------------------------------------. max | count
+ 1 < 0 : â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â– â–: >= 40 | 32001
+ 2 < 0 : â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â– â–: >= 40 | 32001
+ 3 < 0 : â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â– â–: >= 40 | 32001
+
+
+ key min .------------------------------------------. max | count
+ 1 < 0 : â–â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„ â–ˆ: >= 40 | 32001
+ 2 < 0 : â–â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„ â–ˆ: >= 40 | 32001
+ 3 < 0 : â–â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„ â–ˆ: >= 40 | 32001
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
new file mode 100644
index 0000000000..860a169336
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
@@ -0,0 +1,34 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ < 90/
+{
+ @ = lquantize(i, 0, 100, 1, 1000);
+}
+
+tick-1ms
+/i == 100/
+{
+ @ = lquantize(i++, 0, 100, 1, 2000);
+ @ = lquantize(i++, 0, 100, 1, 3000);
+
+ printa(@);
+ setopt("aggzoom");
+ printa(@);
+ exit(0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
new file mode 100644
index 0000000000..acddf7f731
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
@@ -0,0 +1,211 @@
+
+
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 | 1000
+ 2 | 1000
+ 3 | 1000
+ 4 | 1000
+ 5 | 1000
+ 6 | 1000
+ 7 | 1000
+ 8 | 1000
+ 9 | 1000
+ 10 | 1000
+ 11 | 1000
+ 12 | 1000
+ 13 | 1000
+ 14 | 1000
+ 15 | 1000
+ 16 | 1000
+ 17 | 1000
+ 18 | 1000
+ 19 | 1000
+ 20 | 1000
+ 21 | 1000
+ 22 | 1000
+ 23 | 1000
+ 24 | 1000
+ 25 | 1000
+ 26 | 1000
+ 27 | 1000
+ 28 | 1000
+ 29 | 1000
+ 30 | 1000
+ 31 | 1000
+ 32 | 1000
+ 33 | 1000
+ 34 | 1000
+ 35 | 1000
+ 36 | 1000
+ 37 | 1000
+ 38 | 1000
+ 39 | 1000
+ 40 | 1000
+ 41 | 1000
+ 42 | 1000
+ 43 | 1000
+ 44 | 1000
+ 45 | 1000
+ 46 | 1000
+ 47 | 1000
+ 48 | 1000
+ 49 | 1000
+ 50 | 1000
+ 51 | 1000
+ 52 | 1000
+ 53 | 1000
+ 54 | 1000
+ 55 | 1000
+ 56 | 1000
+ 57 | 1000
+ 58 | 1000
+ 59 | 1000
+ 60 | 1000
+ 61 | 1000
+ 62 | 1000
+ 63 | 1000
+ 64 | 1000
+ 65 | 1000
+ 66 | 1000
+ 67 | 1000
+ 68 | 1000
+ 69 | 1000
+ 70 | 1000
+ 71 | 1000
+ 72 | 1000
+ 73 | 1000
+ 74 | 1000
+ 75 | 1000
+ 76 | 1000
+ 77 | 1000
+ 78 | 1000
+ 79 | 1000
+ 80 | 1000
+ 81 | 1000
+ 82 | 1000
+ 83 | 1000
+ 84 | 1000
+ 85 | 1000
+ 86 | 1000
+ 87 | 1000
+ 88 | 1000
+ 89 | 1000
+ 90 | 1000
+ 91 | 0
+ 92 | 0
+ 93 | 0
+ 94 | 0
+ 95 | 0
+ 96 | 0
+ 97 | 0
+ 98 | 0
+ 99 | 0
+ >= 100 |@@ 5000
+
+
+
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@ 1000
+ 2 |@@@@@@@@ 1000
+ 3 |@@@@@@@@ 1000
+ 4 |@@@@@@@@ 1000
+ 5 |@@@@@@@@ 1000
+ 6 |@@@@@@@@ 1000
+ 7 |@@@@@@@@ 1000
+ 8 |@@@@@@@@ 1000
+ 9 |@@@@@@@@ 1000
+ 10 |@@@@@@@@ 1000
+ 11 |@@@@@@@@ 1000
+ 12 |@@@@@@@@ 1000
+ 13 |@@@@@@@@ 1000
+ 14 |@@@@@@@@ 1000
+ 15 |@@@@@@@@ 1000
+ 16 |@@@@@@@@ 1000
+ 17 |@@@@@@@@ 1000
+ 18 |@@@@@@@@ 1000
+ 19 |@@@@@@@@ 1000
+ 20 |@@@@@@@@ 1000
+ 21 |@@@@@@@@ 1000
+ 22 |@@@@@@@@ 1000
+ 23 |@@@@@@@@ 1000
+ 24 |@@@@@@@@ 1000
+ 25 |@@@@@@@@ 1000
+ 26 |@@@@@@@@ 1000
+ 27 |@@@@@@@@ 1000
+ 28 |@@@@@@@@ 1000
+ 29 |@@@@@@@@ 1000
+ 30 |@@@@@@@@ 1000
+ 31 |@@@@@@@@ 1000
+ 32 |@@@@@@@@ 1000
+ 33 |@@@@@@@@ 1000
+ 34 |@@@@@@@@ 1000
+ 35 |@@@@@@@@ 1000
+ 36 |@@@@@@@@ 1000
+ 37 |@@@@@@@@ 1000
+ 38 |@@@@@@@@ 1000
+ 39 |@@@@@@@@ 1000
+ 40 |@@@@@@@@ 1000
+ 41 |@@@@@@@@ 1000
+ 42 |@@@@@@@@ 1000
+ 43 |@@@@@@@@ 1000
+ 44 |@@@@@@@@ 1000
+ 45 |@@@@@@@@ 1000
+ 46 |@@@@@@@@ 1000
+ 47 |@@@@@@@@ 1000
+ 48 |@@@@@@@@ 1000
+ 49 |@@@@@@@@ 1000
+ 50 |@@@@@@@@ 1000
+ 51 |@@@@@@@@ 1000
+ 52 |@@@@@@@@ 1000
+ 53 |@@@@@@@@ 1000
+ 54 |@@@@@@@@ 1000
+ 55 |@@@@@@@@ 1000
+ 56 |@@@@@@@@ 1000
+ 57 |@@@@@@@@ 1000
+ 58 |@@@@@@@@ 1000
+ 59 |@@@@@@@@ 1000
+ 60 |@@@@@@@@ 1000
+ 61 |@@@@@@@@ 1000
+ 62 |@@@@@@@@ 1000
+ 63 |@@@@@@@@ 1000
+ 64 |@@@@@@@@ 1000
+ 65 |@@@@@@@@ 1000
+ 66 |@@@@@@@@ 1000
+ 67 |@@@@@@@@ 1000
+ 68 |@@@@@@@@ 1000
+ 69 |@@@@@@@@ 1000
+ 70 |@@@@@@@@ 1000
+ 71 |@@@@@@@@ 1000
+ 72 |@@@@@@@@ 1000
+ 73 |@@@@@@@@ 1000
+ 74 |@@@@@@@@ 1000
+ 75 |@@@@@@@@ 1000
+ 76 |@@@@@@@@ 1000
+ 77 |@@@@@@@@ 1000
+ 78 |@@@@@@@@ 1000
+ 79 |@@@@@@@@ 1000
+ 80 |@@@@@@@@ 1000
+ 81 |@@@@@@@@ 1000
+ 82 |@@@@@@@@ 1000
+ 83 |@@@@@@@@ 1000
+ 84 |@@@@@@@@ 1000
+ 85 |@@@@@@@@ 1000
+ 86 |@@@@@@@@ 1000
+ 87 |@@@@@@@@ 1000
+ 88 |@@@@@@@@ 1000
+ 89 |@@@@@@@@ 1000
+ 90 |@@@@@@@@ 1000
+ 91 | 0
+ 92 | 0
+ 93 | 0
+ 94 | 0
+ 95 | 0
+ 96 | 0
+ 97 | 0
+ 98 | 0
+ 99 | 0
+ >= 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5000
+
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d
index bb0739f0d3..ccafc2edd1 100644
--- a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d
+++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d
@@ -22,6 +22,7 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <sys/dtrace.h>
@@ -98,6 +99,9 @@ STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
STRFUNC(toupper("foo"))
STRFUNC(tolower("BAR"))
+INTFUNC(getf(0))
+INTFUNC(strtoll("0x12EE5D5", 16))
+STRFUNC(json("{\"systemtap\": false}", "systemtap"))
BEGIN
/subr == DIF_SUBR_MAX + 1/
diff --git a/usr/src/cmd/dtrace/test/tst/common/arithmetic/tst.nonarrow.ksh b/usr/src/cmd/dtrace/test/tst/common/arithmetic/tst.nonarrow.ksh
new file mode 100644
index 0000000000..3a2942e9f1
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/arithmetic/tst.nonarrow.ksh
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+#
+# Somewhat surprisingly, DTrace very much relies on the fact that when 32-bit
+# is forced, pointers are not, in fact, narrowed to 32-bits. In particular, if
+# this is not so (that is, if pointers are narrowed to their seemingly correct
+# 32-bit width), helpers attached to 32-bit programs will fail to operate:
+# they will erroneously zero the high 32-bits of the return values of 64-bit
+# kernel pointers as returned by copyin(), alloca(), etc. This test asserts
+# this implicit behavior -- and this comment regrettably serves as this
+# behavior's only documentation.
+#
+doit()
+{
+ /usr/sbin/dtrace $1 -n BEGIN'{trace(sizeof (long))}' \
+ -n 'BEGIN{*(int *)alloca(4) = 21506; exit(0)}' \
+ -n 'ERROR{exit(1)}'
+
+ if [ "$?" -ne 0 ]; then
+ exit $?
+ fi
+}
+
+doit
+doit -32
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d b/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d
new file mode 100644
index 0000000000..4600811d95
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d
@@ -0,0 +1,179 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * General functional tests of JSON parser for json().
+ */
+
+#pragma D option quiet
+#pragma D option strsize=1k
+
+#define TST(name) \
+ printf("\ntst |%s|\n", name)
+#define IN2(vala, valb) \
+ in = strjoin(vala, valb); \
+ printf("in |%s|\n", in)
+#define IN(val) \
+ in = val; \
+ printf("in |%s|\n", in)
+#define SEL(ss) \
+ out = json(in, ss); \
+ printf("sel |%s|\nout |%s|\n", ss, \
+ out != NULL ? out : "<NULL>")
+
+BEGIN
+{
+ TST("empty array");
+ IN("[]");
+ SEL("0");
+
+ TST("one-element array: integer");
+ IN("[1]");
+ SEL("0");
+ SEL("1");
+ SEL("100");
+ SEL("-1");
+
+ TST("one-element array: hex integer (not in spec, not supported)");
+ IN("[0x1000]");
+ SEL("0");
+
+ TST("one-element array: float");
+ IN("[1.5001]");
+ SEL("0");
+
+ TST("one-element array: float + exponent");
+ IN("[16.3e10]");
+ SEL("0");
+
+ TST("one-element array: integer + whitespace");
+ IN("[ \t 5\t]");
+ SEL("0");
+
+ TST("one-element array: integer + exponent + whitespace");
+ IN("[ \t \t 16E10 \t ]");
+ SEL("0");
+
+ TST("one-element array: string");
+ IN("[\"alpha\"]");
+ SEL("0");
+
+ TST("alternative first-element indexing");
+ IN("[1,5,10,15,20]");
+ SEL("[0]");
+ SEL("[3]");
+ SEL("[4]");
+ SEL("[5]");
+
+ TST("one-element array: object");
+ IN("[ { \"first\": true, \"second\": false }]");
+ SEL("0.first");
+ SEL("0.second");
+ SEL("0.third");
+
+ TST("many-element array: integers");
+ IN("[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377]");
+ SEL("10"); /* F(10) = 55 */
+ SEL("14"); /* F(14) = 377 */
+ SEL("19");
+
+ TST("many-element array: multiple types");
+ IN2("[\"string\",32,true,{\"a\":9,\"b\":false},100.3e10,false,200.5,",
+ "{\"key\":\"val\"},null]");
+ SEL("0");
+ SEL("0.notobject");
+ SEL("1");
+ SEL("2");
+ SEL("3");
+ SEL("3.a");
+ SEL("3.b");
+ SEL("3.c");
+ SEL("4");
+ SEL("5");
+ SEL("6");
+ SEL("7");
+ SEL("7.key");
+ SEL("7.key.notobject");
+ SEL("7.nonexist");
+ SEL("8");
+ SEL("9");
+
+ TST("many-element array: multiple types + whitespace");
+ IN2("\n[\t\"string\" ,\t32 , true\t,\t {\"a\": 9,\t\"b\": false},\t\t",
+ "100.3e10, false, 200.5,{\"key\" \t:\n \"val\"},\t\t null ]\t\t");
+ SEL("0");
+ SEL("0.notobject");
+ SEL("1");
+ SEL("2");
+ SEL("3");
+ SEL("3.a");
+ SEL("3.b");
+ SEL("3.c");
+ SEL("4");
+ SEL("5");
+ SEL("6");
+ SEL("7");
+ SEL("7.key");
+ SEL("7.key.notobject");
+ SEL("7.nonexist");
+ SEL("8");
+ SEL("9");
+
+ TST("two-element array: various string escape codes");
+ IN2("[\"abcd \\\" \\\\ \\/ \\b \\f \\n \\r \\t \\u0000 \\uf00F \", ",
+ "\"final\"]");
+ SEL("0");
+ SEL("1");
+
+ TST("three-element array: broken escape code");
+ IN("[\"fine here\", \"dodgey \\u00AZ\", \"wont get here\"]");
+ SEL("0");
+ SEL("1");
+ SEL("2");
+
+ TST("nested objects");
+ IN2("{ \"top\": { \"mid\" : { \"legs\": \"feet\" }, \"number\": 9, ",
+ "\"array\":[0,1,{\"a\":true,\"bb\":[1,2,false,{\"x\":\"yz\"}]}]}}");
+ SEL("top");
+ SEL("fargo");
+ SEL("top.mid");
+ SEL("top.centre");
+ SEL("top.mid.legs");
+ SEL("top.mid.number");
+ SEL("top.mid.array");
+ SEL("top.number");
+ SEL("top.array");
+ SEL("top.array[0]");
+ SEL("top.array[1]");
+ SEL("top.array[2]");
+ SEL("top.array[2].a");
+ SEL("top.array[2].b");
+ SEL("top.array[2].bb");
+ SEL("top.array[2].bb[0]");
+ SEL("top.array[2].bb[1]");
+ SEL("top.array[2].bb[2]");
+ SEL("top.array[2].bb[3]");
+ SEL("top.array[2].bb[3].x");
+ SEL("top.array[2].bb[3].x.nofurther");
+ SEL("top.array[2].bb[4]");
+ SEL("top.array[3]");
+
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d.out b/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d.out
new file mode 100644
index 0000000000..a857ab91d8
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.general.d.out
@@ -0,0 +1,218 @@
+
+tst |empty array|
+in |[]|
+sel |0|
+out |<NULL>|
+
+tst |one-element array: integer|
+in |[1]|
+sel |0|
+out |1|
+sel |1|
+out |<NULL>|
+sel |100|
+out |<NULL>|
+sel |-1|
+out |<NULL>|
+
+tst |one-element array: hex integer (not in spec, not supported)|
+in |[0x1000]|
+sel |0|
+out |<NULL>|
+
+tst |one-element array: float|
+in |[1.5001]|
+sel |0|
+out |1.5001|
+
+tst |one-element array: float + exponent|
+in |[16.3e10]|
+sel |0|
+out |16.3e10|
+
+tst |one-element array: integer + whitespace|
+in |[ 5 ]|
+sel |0|
+out |5|
+
+tst |one-element array: integer + exponent + whitespace|
+in |[ 16E10 ]|
+sel |0|
+out |16E10|
+
+tst |one-element array: string|
+in |["alpha"]|
+sel |0|
+out |alpha|
+
+tst |alternative first-element indexing|
+in |[1,5,10,15,20]|
+sel |[0]|
+out |1|
+sel |[3]|
+out |15|
+sel |[4]|
+out |20|
+sel |[5]|
+out |<NULL>|
+
+tst |one-element array: object|
+in |[ { "first": true, "second": false }]|
+sel |0.first|
+out |true|
+sel |0.second|
+out |false|
+sel |0.third|
+out |<NULL>|
+
+tst |many-element array: integers|
+in |[0,1,1,2,3,5,8,13,21,34,55,89,144,233,377]|
+sel |10|
+out |55|
+sel |14|
+out |377|
+sel |19|
+out |<NULL>|
+
+tst |many-element array: multiple types|
+in |["string",32,true,{"a":9,"b":false},100.3e10,false,200.5,{"key":"val"},null]|
+sel |0|
+out |string|
+sel |0.notobject|
+out |<NULL>|
+sel |1|
+out |32|
+sel |2|
+out |true|
+sel |3|
+out |{"a":9,"b":false}|
+sel |3.a|
+out |9|
+sel |3.b|
+out |false|
+sel |3.c|
+out |<NULL>|
+sel |4|
+out |100.3e10|
+sel |5|
+out |false|
+sel |6|
+out |200.5|
+sel |7|
+out |{"key":"val"}|
+sel |7.key|
+out |val|
+sel |7.key.notobject|
+out |<NULL>|
+sel |7.nonexist|
+out |<NULL>|
+sel |8|
+out |null|
+sel |9|
+out |<NULL>|
+
+tst |many-element array: multiple types + whitespace|
+in |
+[ "string" , 32 , true , {"a": 9, "b": false}, 100.3e10, false, 200.5,{"key" :
+ "val"}, null ] |
+sel |0|
+out |string|
+sel |0.notobject|
+out |<NULL>|
+sel |1|
+out |32|
+sel |2|
+out |true|
+sel |3|
+out |{"a": 9, "b": false}|
+sel |3.a|
+out |9|
+sel |3.b|
+out |false|
+sel |3.c|
+out |<NULL>|
+sel |4|
+out |100.3e10|
+sel |5|
+out |false|
+sel |6|
+out |200.5|
+sel |7|
+out |{"key" :
+ "val"}|
+sel |7.key|
+out |val|
+sel |7.key.notobject|
+out |<NULL>|
+sel |7.nonexist|
+out |<NULL>|
+sel |8|
+out |null|
+sel |9|
+out |<NULL>|
+
+tst |two-element array: various string escape codes|
+in |["abcd \" \\ \/ \b \f \n \r \t \u0000 \uf00F ", "final"]|
+sel |0|
+out |abcd \" \\ \/ \b \f \n \r \t \u0000 \uf00F |
+sel |1|
+out |final|
+
+tst |three-element array: broken escape code|
+in |["fine here", "dodgey \u00AZ", "wont get here"]|
+sel |0|
+out |fine here|
+sel |1|
+out |<NULL>|
+sel |2|
+out |<NULL>|
+
+tst |nested objects|
+in |{ "top": { "mid" : { "legs": "feet" }, "number": 9, "array":[0,1,{"a":true,"bb":[1,2,false,{"x":"yz"}]}]}}|
+sel |top|
+out |{ "mid" : { "legs": "feet" }, "number": 9, "array":[0,1,{"a":true,"bb":[1,2,false,{"x":"yz"}]}]}|
+sel |fargo|
+out |<NULL>|
+sel |top.mid|
+out |{ "legs": "feet" }|
+sel |top.centre|
+out |<NULL>|
+sel |top.mid.legs|
+out |feet|
+sel |top.mid.number|
+out |<NULL>|
+sel |top.mid.array|
+out |<NULL>|
+sel |top.number|
+out |9|
+sel |top.array|
+out |[0,1,{"a":true,"bb":[1,2,false,{"x":"yz"}]}]|
+sel |top.array[0]|
+out |0|
+sel |top.array[1]|
+out |1|
+sel |top.array[2]|
+out |{"a":true,"bb":[1,2,false,{"x":"yz"}]}|
+sel |top.array[2].a|
+out |true|
+sel |top.array[2].b|
+out |<NULL>|
+sel |top.array[2].bb|
+out |[1,2,false,{"x":"yz"}]|
+sel |top.array[2].bb[0]|
+out |1|
+sel |top.array[2].bb[1]|
+out |2|
+sel |top.array[2].bb[2]|
+out |false|
+sel |top.array[2].bb[3]|
+out |{"x":"yz"}|
+sel |top.array[2].bb[3].x|
+out |yz|
+sel |top.array[2].bb[3].x.nofurther|
+out |<NULL>|
+sel |top.array[2].bb[4]|
+out |<NULL>|
+sel |top.array[3]|
+out |<NULL>|
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d b/usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d
new file mode 100644
index 0000000000..6aa50b9ad0
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d
@@ -0,0 +1,51 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * json() run time must be bounded above by strsize. This test makes strsize
+ * small and deliberately overflows it to prove we bail and return NULL in
+ * the event that we run off the end of the string.
+ *
+ */
+
+#pragma D option quiet
+#pragma D option strsize=18
+
+BEGIN
+{
+ in = "{\"a\": 1024}"; /* length == 19 */
+ out = json(in, "a");
+ printf("|%s|\n%s\n\n", in, out != NULL ? out : "<NULL>");
+
+ in = "{\"a\": 1024}"; /* length == 11 */
+ out = json(in, "a");
+ printf("|%s|\n%s\n\n", in, out != NULL ? out : "<NULL>");
+
+ in = "{\"a\":false,\"b\":true}"; /* length == 20 */
+ out = json(in, "b");
+ printf("|%s|\n%s\n\n", in, out != NULL ? out : "<NULL>");
+
+ in = "{\"a\":false,\"b\":20}"; /* length == 18 */
+ out = json(in, "b");
+ printf("|%s|\n%s\n\n", in, out != NULL ? out : "<NULL>");
+
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d.out b/usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d.out
new file mode 100644
index 0000000000..7f1d79b6fe
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.strsize.d.out
@@ -0,0 +1,13 @@
+|{"a": 1024|
+<NULL>
+
+|{"a": 1024}|
+1024
+
+|{"a":false,"b":tru|
+<NULL>
+
+|{"a":false,"b":20}|
+20
+
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.c b/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.c
new file mode 100644
index 0000000000..307106d903
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.c
@@ -0,0 +1,61 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2012 (c), Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/sdt.h>
+#include "usdt.h"
+
+#define FMT "{" \
+ " \"sizes\": [ \"first\", 2, %f ]," \
+ " \"index\": %d," \
+ " \"facts\": {" \
+ " \"odd\": \"%s\"," \
+ " \"even\": \"%s\"" \
+ " }," \
+ " \"action\": \"%s\"" \
+ "}\n"
+
+int
+waiting(volatile int *a)
+{
+ return (*a);
+}
+
+int
+main(int argc, char **argv)
+{
+ volatile int a = 0;
+ int idx;
+ double size = 250.5;
+
+ while (waiting(&a) == 0)
+ continue;
+
+ for (idx = 0; idx < 10; idx++) {
+ char *odd, *even, *json, *action;
+
+ size *= 1.78;
+ odd = idx % 2 == 1 ? "true" : "false";
+ even = idx % 2 == 0 ? "true" : "false";
+ action = idx == 7 ? "ignore" : "print";
+
+ asprintf(&json, FMT, size, idx, odd, even, action);
+ BUNYAN_FAKE_LOG_DEBUG(json);
+ free(json);
+ }
+
+ BUNYAN_FAKE_LOG_DEBUG("{\"finished\": true}");
+
+ return (0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d b/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d
new file mode 100644
index 0000000000..f0fbdd5cab
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d
@@ -0,0 +1,65 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option strsize=4k
+#pragma D option quiet
+#pragma D option destructive
+
+/*
+ * This test reads a JSON string from a USDT probe, roughly simulating the
+ * primary motivating use case for the json() subroutine: filtering
+ * JSON-formatted log messages from a logging subsystem like node-bunyan.
+ */
+
+pid$1:a.out:waiting:entry
+{
+ this->value = (int *)alloca(sizeof (int));
+ *this->value = 1;
+ copyout(this->value, arg0, sizeof (int));
+}
+
+bunyan*$1:::log-*
+{
+ this->j = copyinstr(arg0);
+}
+
+bunyan*$1:::log-*
+/json(this->j, "finished") == NULL && json(this->j, "action") != "ignore"/
+{
+ this->index = strtoll(json(this->j, "index"));
+ this->size = json(this->j, "sizes[2]");
+ this->odd = json(this->j, "facts.odd");
+ this->even = json(this->j, "facts.even");
+ printf("[%d] sz %s odd %s even %s\n", this->index, this->size,
+ this->odd, this->even);
+}
+
+bunyan*$1:::log-*
+/json(this->j, "finished") != NULL/
+{
+ printf("FINISHED!\n");
+ exit(0);
+}
+
+tick-10s
+{
+ printf("ERROR: Timed out before finish message!\n");
+ exit(1);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d.out b/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d.out
new file mode 100644
index 0000000000..c7f58bb535
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/tst.usdt.d.out
@@ -0,0 +1,11 @@
+[0] sz 445.890000 odd false even true
+[1] sz 793.684200 odd true even false
+[2] sz 1412.757876 odd false even true
+[3] sz 2514.709019 odd true even false
+[4] sz 4476.182054 odd false even true
+[5] sz 7967.604057 odd true even false
+[6] sz 14182.335221 odd false even true
+[8] sz 44935.310914 odd false even true
+[9] sz 79984.853427 odd true even false
+FINISHED!
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/json/usdt.d b/usr/src/cmd/dtrace/test/tst/common/json/usdt.d
new file mode 100644
index 0000000000..1a4fc87f60
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/json/usdt.d
@@ -0,0 +1,27 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * Sets up a fake node-bunyan-like USDT provider for use from C.
+ */
+
+provider bunyan_fake {
+ probe log__trace(char *msg);
+ probe log__debug(char *msg);
+ probe log__info(char *msg);
+ probe log__warn(char *msg);
+ probe log__error(char *msg);
+ probe log__fatal(char *msg);
+};
diff --git a/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.range.d b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.range.d
index e2882b3f8e..a9138d2f54 100644
--- a/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.range.d
+++ b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.range.d
@@ -19,10 +19,6 @@
* CDDL HEADER END
*/
-/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- */
-
#pragma D option quiet
BEGIN
diff --git a/usr/src/cmd/dtrace/test/tst/common/mdb/tst.postmort.ksh b/usr/src/cmd/dtrace/test/tst/common/mdb/tst.postmort.ksh
new file mode 100644
index 0000000000..c5921b8d28
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/mdb/tst.postmort.ksh
@@ -0,0 +1,69 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+expected=`od -t u8 -N 8 /dev/urandom | head -1 | cut -d ' ' -f2`
+
+$dtrace -x bufpolicy=ring -x bufsize=10k -qs /dev/stdin > /dev/null 2>&1 <<EOF &
+ tick-1ms
+ /i < 10000/
+ {
+ printf("%d: expected is $expected!\n", i++);
+ }
+
+ tick-1ms
+ /i >= 10000/
+ {
+ exit(0);
+ }
+EOF
+
+background=$!
+
+#
+# Give some time for the enabling to get there...
+#
+sleep 2
+
+echo "::walk dtrace_state | ::dtrace" | mdb -k | tee test.out
+grep "expected is $expected" test.out 2> /dev/null 1>&2
+status=$?
+
+kill $background
+
+cd /
+/usr/bin/rm -rf $DIR
+
+exit $status
diff --git a/usr/src/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh b/usr/src/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh
new file mode 100644
index 0000000000..22c267dcfc
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh
@@ -0,0 +1,97 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+let j=8
+
+enable()
+{
+ prog=/var/tmp/dtest.$$.d
+ err=/var/tmp/dtest.$$.err
+
+ nawk -v nprobes=$1 'BEGIN { \
+ for (i = 0; i < nprobes - 1; i++) { \
+ printf("dtrace:::BEGIN,\n"); \
+ } \
+ \
+ printf("dtrace:::BEGIN { exit(0); }\n"); \
+ }' /dev/null > $prog
+
+ dtrace -qs $prog > /dev/null 2> $err
+
+ if [[ "$?" -eq 0 ]]; then
+ return 0
+ else
+ if ! grep "DIF program exceeds maximum program size" $err \
+ 1> /dev/null 2>&1 ; then
+ echo "failed to enable $prog: `cat $err`"
+ exit 1
+ fi
+
+ return 1
+ fi
+}
+
+#
+# First, establish an upper bound
+#
+let upper=1
+
+while enable $upper ; do
+ let lower=upper
+ let upper=upper+upper
+ echo success at $lower, raised to $upper
+done
+
+#
+# Now search for the highest value that can be enabled
+#
+while [[ "$lower" -lt "$upper" ]]; do
+ let guess=$(((lower + upper) / 2))
+ echo "lower is $lower; upper is $upper; guess is $guess\c"
+
+ if enable $guess ; then
+ if [[ $((upper - lower)) -le 2 ]]; then
+ let upper=guess
+ fi
+
+ echo " (success)"
+ let lower=guess
+ else
+ echo " (failure)"
+ let upper=guess
+ fi
+done
+
+let expected=10000
+
+if [[ "$lower" -lt "$expected" ]]; then
+ echo "expected support for enablings of at least $expected probes; \c"
+ echo "found $lower"
+ exit 1
+fi
+
+echo "maximum supported enabled probes found to be $lower"
+exit 0
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
index 692a715303..b16ea53c81 100644
--- a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
@@ -45,10 +45,10 @@ cat > Makefile <<EOF
all: main
main: main.o
- gcc -o main main.o
+ gcc -m32 -o main main.o
main.o: main.c
- gcc -c main.c
+ gcc -m32 -c main.c
EOF
cat > main.c <<EOF
diff --git a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
index 03b6003fed..d447c2225f 100644
--- a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
@@ -45,16 +45,16 @@ cat > Makefile <<EOF
all: main altlib.so
main: main.o
- gcc -o main main.o
+ gcc -m32 -o main main.o
main.o: main.c
- gcc -c main.c
+ gcc -m32 -c main.c
altlib.so: altlib.o
- gcc -shared -o altlib.so altlib.o -lc
+ gcc -m32 -shared -o altlib.so altlib.o -lc
altlib.o: altlib.c
- gcc -c altlib.c
+ gcc -m32 -fPIC -c altlib.c
EOF
cat > altlib.c <<EOF
diff --git a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
index 4a74cb050a..dcd4d4111a 100644
--- a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
@@ -46,10 +46,10 @@ cat > Makefile <<EOF
all: main
main: main.o prov.o
- gcc -o main main.o prov.o
+ gcc -m32 -o main main.o prov.o
main.o: main.c prov.h
- gcc -c main.c
+ gcc -m32 -c main.c
prov.h: prov.d
$dtrace -h -s prov.d
diff --git a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
index 8d326ad7c1..7030be7394 100644
--- a/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
@@ -46,10 +46,10 @@ cat > Makefile <<EOF
all: main altlib.so
main: main.o provmain.o
- gcc -o main main.o provmain.o
+ gcc -m32 -o main main.o provmain.o
main.o: main.c prov.h
- gcc -c main.c
+ gcc -m32 -c main.c
prov.h: prov.d
$dtrace -h -s prov.d
@@ -58,10 +58,10 @@ provmain.o: prov.d main.o
$dtrace -G -32 -o provmain.o -s prov.d main.o
altlib.so: altlib.o provalt.o
- gcc -shared -o altlib.so altlib.o provalt.o -lc
+ gcc -m32 -shared -o altlib.so altlib.o provalt.o -lc
altlib.o: altlib.c prov.h
- gcc -c altlib.c
+ gcc -m32 -c altlib.c
provalt.o: prov.d altlib.o
$dtrace -G -32 -o provalt.o -s prov.d altlib.o
diff --git a/usr/src/cmd/dtrace/test/tst/common/privs/tst.fds.ksh b/usr/src/cmd/dtrace/test/tst/common/privs/tst.fds.ksh
new file mode 100644
index 0000000000..a5aa27137e
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/privs/tst.fds.ksh
@@ -0,0 +1,91 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+tmpin=/tmp/tst.fds.$$.d
+tmpout1=/tmp/tst.fds.$$.out1
+tmpout2=/tmp/tst.fds.$$.out2
+
+cat > $tmpin <<EOF
+#define DUMPFIELD(fd, fmt, field) \
+ errmsg = "could not dump field"; \
+ printf("%d: field =fmt\n", fd, fds[fd].field);
+
+/*
+ * Note that we are explicitly not looking at fi_mount -- it (by design) does
+ * not work if not running with kernel permissions.
+ */
+#define DUMP(fd) \
+ DUMPFIELD(fd, %s, fi_name); \
+ DUMPFIELD(fd, %s, fi_dirname); \
+ DUMPFIELD(fd, %s, fi_pathname); \
+ DUMPFIELD(fd, %d, fi_offset); \
+ DUMPFIELD(fd, %s, fi_fs); \
+ DUMPFIELD(fd, %o, fi_oflags);
+
+BEGIN
+{
+ DUMP(0);
+ DUMP(1);
+ DUMP(2);
+ DUMP(3);
+ DUMP(4);
+ exit(0);
+}
+
+ERROR
+{
+ printf("error: %s\n", errmsg);
+ exit(1);
+}
+EOF
+
+#
+# First, with all privs
+#
+/usr/sbin/dtrace -q -Cs /dev/stdin < $tmpin > $tmpout2
+mv $tmpout2 $tmpout1
+
+#
+# And now with only dtrace_proc and dtrace_user -- the output should be
+# identical.
+#
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+/usr/sbin/dtrace -q -Cs /dev/stdin < $tmpin > $tmpout2
+
+echo ">>> $tmpout1"
+cat $tmpout1
+
+echo ">>> $tmpout2"
+cat $tmpout2
+
+rval=0
+
+if ! cmp $tmpout1 $tmpout2 ; then
+ rval=1
+fi
+
+rm $tmpout1 $tmpout2 $tmpin
+exit $rval
diff --git a/usr/src/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh b/usr/src/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
index ae4934cdeb..da9bb4c6c6 100644
--- a/usr/src/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
@@ -22,8 +22,8 @@
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
ppriv -s A=basic,dtrace_proc,dtrace_user $$
@@ -31,7 +31,7 @@ ppriv -s A=basic,dtrace_proc,dtrace_user $$
BEGIN {
errorcount = 0;
- expected_errorcount = 23;
+ expected_errorcount = 27;
}
BEGIN { trace(mutex_owned(&`pidlock)); }
@@ -55,6 +55,8 @@ BEGIN { trace(strtok(`initname, "/")); }
BEGIN { trace(strtok(NULL, "/")); }
BEGIN { trace(strtok("foo/bar", `initname)); }
BEGIN { trace(strtok(NULL, `initname)); }
+BEGIN { trace(strtoll(`initname)); }
+BEGIN { trace(strtoll(`initname, 10)); }
BEGIN { trace(substr(`initname, 2, 3)); }
BEGIN { trace(ddi_pathname(`top_devinfo, 1)); }
@@ -63,6 +65,9 @@ BEGIN { trace(strjoin("foo", `initname)); }
BEGIN { trace(dirname(`initname)); }
BEGIN { trace(cleanpath(`initname)); }
+BEGIN { j = "{\"/sbin/init\":\"uh oh\"}"; trace(json(j, `initname)); }
+BEGIN { trace(json(`initname, "x")); }
+
ERROR {
errorcount++;
}
diff --git a/usr/src/cmd/dtrace/test/tst/common/privs/tst.getf.ksh b/usr/src/cmd/dtrace/test/tst/common/privs/tst.getf.ksh
new file mode 100644
index 0000000000..8f4d65dfd5
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/privs/tst.getf.ksh
@@ -0,0 +1,98 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+/usr/sbin/dtrace -q -Cs /dev/stdin <<EOF
+
+#define CANREAD(field) \
+ BEGIN { this->fp = getf(0); errmsg = "can't read field"; \
+ printf("field: "); trace(this->fp->field); printf("\n"); }
+
+#define CANTREAD(field) \
+ BEGIN { errmsg = ""; this->fp = getf(0); trace(this->fp->field); \
+ printf("\nable to successfully read field!"); exit(1); }
+
+CANREAD(f_flag)
+CANREAD(f_flag2)
+CANREAD(f_vnode)
+CANREAD(f_offset)
+CANREAD(f_cred)
+CANREAD(f_audit_data)
+CANREAD(f_count)
+
+/*
+ * We can potentially read parts of our cred, but we can't dereference
+ * through cr_zone.
+ */
+CANTREAD(f_cred->cr_zone->zone_id)
+
+CANREAD(f_vnode->v_path)
+CANREAD(f_vnode->v_op)
+CANREAD(f_vnode->v_op->vnop_name)
+
+CANTREAD(f_vnode->v_flag)
+CANTREAD(f_vnode->v_count)
+CANTREAD(f_vnode->v_pages)
+CANTREAD(f_vnode->v_type)
+CANTREAD(f_vnode->v_vfsmountedhere)
+CANTREAD(f_vnode->v_op->vop_open)
+
+BEGIN
+{
+ errmsg = "";
+ this->fp = getf(0);
+ this->fp2 = getf(1);
+
+ trace(this->fp->f_vnode);
+ printf("\nable to successfully read this->fp!");
+ exit(1);
+}
+
+BEGIN
+{
+ errmsg = "";
+ this->fp = getf(0);
+}
+
+BEGIN
+{
+ trace(this->fp->f_vnode);
+ printf("\nable to successfully read this->fp from prior clause!");
+}
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+/errmsg != ""/
+{
+ printf("fatal error: %s", errmsg);
+ exit(1);
+}
+
+EOF
diff --git a/usr/src/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh b/usr/src/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh
new file mode 100755
index 0000000000..6227a057da
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh
@@ -0,0 +1,138 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+#
+# When we have dtrace_proc (but lack dtrace_kernel), we expect to be able to
+# read certain curpsinfo/curlwpsinfo/curcpu fields even though they require
+# reading in-kernel state. However, there are other fields in these translated
+# structures that we know we shouldn't be able to read, as they require reading
+# in-kernel state that we cannot read with only dtrace_proc. Finally, there
+# are a few fields that we may or may not be able to read depending on the
+# specifics of context. This test therefore asserts that we can read what we
+# think we should be able to, that we can't read what we think we shouldn't be
+# able to, and (for purposes of completeness) that we are indifferent about
+# what we cannot assert one way or the other.
+#
+/usr/sbin/dtrace -q -Cs /dev/stdin <<EOF
+
+#define CANREAD(what, field) \
+ BEGIN { errmsg = "can't read field from what"; printf("field: "); \
+ trace(what->field); printf("\n"); }
+
+#define CANTREAD(what, field) \
+ BEGIN { errmsg = ""; trace(what->field); \
+ printf("\nable to successfully read field from what!"); exit(1); }
+
+#define MIGHTREAD(what, field) \
+ BEGIN { errmsg = ""; printf("field: "); trace(what->field); printf("\n"); }
+
+#define CANREADVAR(vname) \
+ BEGIN { errmsg = "can't read vname"; printf("vname: "); \
+ trace(vname); printf("\n"); }
+
+#define CANTREADVAR(vname) \
+ BEGIN { errmsg = ""; trace(vname); \
+ printf("\nable to successfully read vname!"); exit(1); }
+
+#define MIGHTREADVAR(vname) \
+ BEGIN { errmsg = ""; printf("vname: "); trace(vname); printf("\n"); }
+
+CANREAD(curpsinfo, pr_pid)
+CANREAD(curpsinfo, pr_nlwp)
+CANREAD(curpsinfo, pr_ppid)
+CANREAD(curpsinfo, pr_uid)
+CANREAD(curpsinfo, pr_euid)
+CANREAD(curpsinfo, pr_gid)
+CANREAD(curpsinfo, pr_egid)
+CANREAD(curpsinfo, pr_addr)
+CANREAD(curpsinfo, pr_start)
+CANREAD(curpsinfo, pr_fname)
+CANREAD(curpsinfo, pr_psargs)
+CANREAD(curpsinfo, pr_argc)
+CANREAD(curpsinfo, pr_argv)
+CANREAD(curpsinfo, pr_envp)
+CANREAD(curpsinfo, pr_dmodel)
+
+/*
+ * If our p_pgidp points to the same pid structure as our p_pidp, we will
+ * be able to read pr_pgid -- but we won't if not.
+ */
+MIGHTREAD(curpsinfo, pr_pgid)
+
+CANTREAD(curpsinfo, pr_sid)
+CANTREAD(curpsinfo, pr_ttydev)
+CANTREAD(curpsinfo, pr_projid)
+CANTREAD(curpsinfo, pr_zoneid)
+CANTREAD(curpsinfo, pr_contract)
+
+CANREAD(curlwpsinfo, pr_flag)
+CANREAD(curlwpsinfo, pr_lwpid)
+CANREAD(curlwpsinfo, pr_addr)
+CANREAD(curlwpsinfo, pr_wchan)
+CANREAD(curlwpsinfo, pr_stype)
+CANREAD(curlwpsinfo, pr_state)
+CANREAD(curlwpsinfo, pr_sname)
+CANREAD(curlwpsinfo, pr_syscall)
+CANREAD(curlwpsinfo, pr_pri)
+CANREAD(curlwpsinfo, pr_onpro)
+CANREAD(curlwpsinfo, pr_bindpro)
+CANREAD(curlwpsinfo, pr_bindpset)
+
+CANTREAD(curlwpsinfo, pr_clname)
+CANTREAD(curlwpsinfo, pr_lgrp)
+
+CANREAD(curcpu, cpu_id)
+
+CANTREAD(curcpu, cpu_pset)
+CANTREAD(curcpu, cpu_chip)
+CANTREAD(curcpu, cpu_lgrp)
+CANTREAD(curcpu, cpu_info)
+
+/*
+ * We cannot assert one thing or another about the variable "root": for those
+ * with only dtrace_proc, it will be readable in the global but not readable in
+ * the non-global.
+ */
+MIGHTREADVAR(root)
+
+CANREADVAR(cpu)
+CANTREADVAR(pset)
+CANTREADVAR(cwd)
+CANTREADVAR(chip)
+CANTREADVAR(lgrp)
+
+BEGIN
+{
+ exit(0);
+}
+
+ERROR
+/errmsg != ""/
+{
+ printf("fatal error: %s", errmsg);
+ exit(1);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/privs/tst.providers.ksh b/usr/src/cmd/dtrace/test/tst/common/privs/tst.providers.ksh
new file mode 100644
index 0000000000..94c3722f78
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/privs/tst.providers.ksh
@@ -0,0 +1,126 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+#
+# First, make sure that we can successfully enable the io provider
+#
+if ! dtrace -P io -n BEGIN'{exit(0)}' > /dev/null 2>&1 ; then
+ echo failed to enable io provider with full privs
+ exit 1
+fi
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+#
+# Now make sure that we cannot enable the io provider with reduced privs
+#
+if ! dtrace -x errtags -P io -n BEGIN'{exit(1)}' 2>&1 | \
+ grep D_PDESC_ZERO > /dev/null 2>&1 ; then
+ echo successfully enabled the io provider with reduced privs
+ exit 1
+fi
+
+#
+# Keeping our reduced privs, we want to assure that we can see every provider
+# that we think we should be able to see -- and that we can see curpsinfo
+# state but can't otherwise see arguments.
+#
+/usr/sbin/dtrace -wq -Cs /dev/stdin <<EOF
+
+int seen[string];
+int err;
+
+#define CANENABLE(provider) \
+provider::: \
+/err == 0 && progenyof(\$pid) && !seen["provider"]/ \
+{ \
+ trace(arg0); \
+ printf("\nsuccessful trace of arg0 in %s:%s:%s:%s\n", \
+ probeprov, probemod, probefunc, probename); \
+ exit(++err); \
+} \
+ \
+provider::: \
+/progenyof(\$pid)/ \
+{ \
+ seen["provider"]++; \
+} \
+ \
+provider::: \
+/progenyof(\$pid)/ \
+{ \
+ errstr = "provider"; \
+ this->ignore = stringof(curpsinfo->pr_psargs); \
+ errstr = ""; \
+} \
+ \
+END \
+/err == 0 && !seen["provider"]/ \
+{ \
+ printf("no probes from provider\n"); \
+ exit(++err); \
+} \
+ \
+END \
+/err == 0/ \
+{ \
+ printf("saw %d probes from provider\n", seen["provider"]); \
+}
+
+CANENABLE(proc)
+CANENABLE(sched)
+CANENABLE(vminfo)
+CANENABLE(sysinfo)
+
+BEGIN
+{
+ /*
+ * We'll kick off a system of a do-nothing command -- which should be
+ * enough to kick proc, sched, vminfo and sysinfo probes.
+ */
+ system("echo > /dev/null");
+}
+
+ERROR
+/err == 0 && errstr != ""/
+{
+ printf("fatal error: couldn't read curpsinfo->pr_psargs in ");
+ printf("%s-provided probe\n", errstr);
+ exit(++err);
+}
+
+proc:::exit
+/progenyof(\$pid)/
+{
+ exit(0);
+}
+
+tick-10ms
+/i++ > 500/
+{
+ printf("exit probe did not seem to fire\n");
+ exit(++err);
+}
+EOF
diff --git a/usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooLarge.d b/usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooLarge.d
new file mode 100644
index 0000000000..4d6b5af75b
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooLarge.d
@@ -0,0 +1,35 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * The largest base we will accept is Base 36 -- i.e. using all of 0-9 and
+ * A-Z as numerals.
+ *
+ * SECTION: Actions and Subroutines/strtoll()
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%d\n", strtoll("0", 37));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooSmall.d b/usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooSmall.d
new file mode 100644
index 0000000000..de56b50e9e
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/strtoll/err.BaseTooSmall.d
@@ -0,0 +1,34 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * The smallest base we will accept is Base 2.
+ *
+ * SECTION: Actions and Subroutines/strtoll()
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%d\n", strtoll("0", 1));
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d b/usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d
new file mode 100644
index 0000000000..0b1812a53c
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d
@@ -0,0 +1,66 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ * Test the strtoll() subroutine.
+ *
+ * SECTION: Actions and Subroutines/strtoll()
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+
+ /* minimum base (2) and maximum base (36): */
+ printf("%d\n", strtoll("0", 2));
+ printf("%d\n", strtoll("1", 36));
+
+ /* simple tests: */
+ printf("%d\n", strtoll("0x20", 16));
+ printf("%d\n", strtoll("-32", 10));
+ printf("%d\n", strtoll("010", 8));
+ printf("%d\n", strtoll("101010", 2));
+
+ /* INT64_MIN and INT64_MAX: */
+ printf("%d\n", strtoll("9223372036854775807"));
+ printf("%d\n", strtoll("-9223372036854775808"));
+ printf("%d\n", strtoll("0777777777777777777777", 8));
+ printf("%d\n", strtoll("-01000000000000000000000", 8));
+
+ /* wrapping: */
+ printf("%d\n", strtoll("1000000000000000000000", 8));
+ printf("%d\n", strtoll("-1000000000000000000001", 8));
+
+ /* hex without prefix: */
+ printf("%d\n", strtoll("baddcafe", 16));
+
+ /* stopping at first out-of-base character: */
+ printf("%d\n", strtoll("12j", 10));
+ printf("%d\n", strtoll("102", 2));
+
+ /* base 36: */
+ printf("%d\n", strtoll("-0DTrace4EverZ", 36));
+
+ /* base 10 is assumed: */
+ printf("%d\n", strtoll("1985"));
+ printf("%d\n", strtoll("-2012"));
+
+ /* empty string: */
+ printf("%d\n", strtoll(""));
+
+ exit(0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d.out b/usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d.out
new file mode 100644
index 0000000000..d12eb9c197
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/strtoll/tst.strtoll.d.out
@@ -0,0 +1,20 @@
+0
+1
+32
+-32
+8
+42
+9223372036854775807
+-9223372036854775808
+9223372036854775807
+-9223372036854775808
+-9223372036854775808
+9223372036854775807
+3135097598
+12
+2
+-1819882045752187535
+1985
+-2012
+0
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid.d b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid.d
new file mode 100644
index 0000000000..4865d81ee1
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid.d
@@ -0,0 +1,21 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ trace((pidfoo`int)0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid2.d b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid2.d
new file mode 100644
index 0000000000..bafed12172
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid2.d
@@ -0,0 +1,21 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ trace((pid8foo`int)0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid3.d b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid3.d
new file mode 100644
index 0000000000..fb9443a828
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidpid3.d
@@ -0,0 +1,21 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ trace((pid0`int)0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh
new file mode 100644
index 0000000000..978cde3cf0
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype.ksh
@@ -0,0 +1,34 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# While it's hard to be completely certain that a type of the name we want
+# doesn't exist, we're going to try to pick a name which is rather unique.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="season_8_mountain_of_madness_t"
+pid=$$
+
+rc=`$dtrace -n "BEGIN{ trace(pid$pid`$t)0); }"`
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh
new file mode 100644
index 0000000000..e64ed526ed
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/err.invalidtype2.ksh
@@ -0,0 +1,35 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# While it's hard to be completely certain that a type of the name we want
+# doesn't exist, we're going to try to pick a name which is rather
+# unique. This time we're also going to use the pid$target alias.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="season_8_mountain_of_madness_t"
+pid=$$
+
+rc=`$dtrace -n "BEGIN{ trace(pid`$t)0); }"` -p $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh
new file mode 100644
index 0000000000..d987c8da7a
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh
@@ -0,0 +1,90 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# This test is purposefully using a 64-bit DTrace and thus 64-bit types
+# when compared with a 32-bit process. This test uses the userland
+# keyword and so the implicit copyin should access illegal memory and
+# thus exit.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="zelda_info_t"
+exe="tst.chasestrings.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -64 -qs /dev/stdin <<EOF
+typedef struct info {
+ char *zi_gamename;
+ int zi_ndungeons;
+ char *zi_villain;
+ int zi_haszelda;
+} info_t;
+
+pid$pid::has_princess:entry
+/next == 0/
+{
+ this->t = (userland info_t *)arg0;
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(this->t->zi_gamename), this->t->zi_ndungeons,
+ stringof(this->t->zi_villain), this->t->zi_haszelda);
+ next = 1;
+}
+
+pid$pid::has_dungeons:entry
+/next == 1/
+{
+ this->t = (userland info_t *)arg0;
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(this->t->zi_gamename), this->t->zi_ndungeons,
+ stringof(this->t->zi_villain), this->t->zi_haszelda);
+ next = 2;
+}
+
+pid$pid::has_villain:entry
+/next == 2/
+{
+ this->t = (userland info_t *)arg0;
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(this->t->zi_gamename), this->t->zi_ndungeons,
+ stringof(this->t->zi_villain), this->t->zi_haszelda);
+ exit(0);
+}
+
+ERROR
+{
+ exit(1);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c
new file mode 100644
index 0000000000..a4d25f8ca8
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c
@@ -0,0 +1,46 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2013 (c) Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * This test tries to make sure that we have CTF data for a type that only this
+ * binary would reasonably have. In this case, the
+ * season_7_lisa_the_vegetarian_t.
+ */
+#include <unistd.h>
+
+typedef struct season_7_lisa_the_vegetarian {
+ int fr_salad;
+} season_7_lisa_the_vegetarian_t;
+
+int
+sleeper(season_7_lisa_the_vegetarian_t *lp)
+{
+ for (;;) {
+ sleep(lp->fr_salad);
+ }
+ /*NOTREACHED*/
+ return (0);
+}
+
+int
+main(void)
+{
+ season_7_lisa_the_vegetarian_t l;
+ l.fr_salad = 100;
+
+ sleeper(&l);
+
+ return (0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh
new file mode 100644
index 0000000000..151a93676d
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.aouttype.ksh
@@ -0,0 +1,44 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Lookup a type that is inside a.out.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="season_7_lisa_the_vegetrian_t *"
+exe="tst.aouttype.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+rc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"`
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c
new file mode 100644
index 0000000000..595a7cb6c5
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c
@@ -0,0 +1,79 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2013 (c) Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * This test takes data from the current binary which is basically running in a
+ * loop between two functions and our goal is to have two unique types that they
+ * contain which we can print.
+ */
+
+#include <unistd.h>
+
+typedef struct zelda_info {
+ char *zi_gamename;
+ int zi_ndungeons;
+ char *zi_villain;
+ int zi_haszelda;
+} zelda_info_t;
+
+static int
+has_princess(zelda_info_t *z)
+{
+ return (z->zi_haszelda);
+}
+
+static int
+has_dungeons(zelda_info_t *z)
+{
+ return (z->zi_ndungeons != 0);
+}
+
+static const char *
+has_villain(zelda_info_t *z)
+{
+ return (z->zi_villain);
+}
+
+int
+main(void)
+{
+ zelda_info_t oot;
+ zelda_info_t la;
+ zelda_info_t lttp;
+
+ oot.zi_gamename = "Ocarina of Time";
+ oot.zi_ndungeons = 10;
+ oot.zi_villain = "Ganondorf";
+ oot.zi_haszelda = 1;
+
+ la.zi_gamename = "Link's Awakening";
+ la.zi_ndungeons = 9;
+ la.zi_villain = "Nightmare";
+ la.zi_haszelda = 0;
+
+ lttp.zi_gamename = "A Link to the Past";
+ lttp.zi_ndungeons = 12;
+ lttp.zi_villain = "Ganon";
+ lttp.zi_haszelda = 1;
+
+ for (;;) {
+ (void) has_princess(&oot);
+ (void) has_dungeons(&la);
+ (void) has_villain(&lttp);
+ sleep(1);
+ }
+
+ return (0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh
new file mode 100644
index 0000000000..25028460db
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh
@@ -0,0 +1,76 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# This test is checking that we can read members and that pointers inside
+# members point to valid data that is intelligible, eg. strings.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="zelda_info_t"
+exe="tst.chasestrings.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -qs /dev/stdin <<EOF
+pid$pid::has_princess:entry
+/next == 0/
+{
+ this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)));
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons,
+ copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda);
+ next = 1;
+}
+
+pid$pid::has_dungeons:entry
+/next == 1/
+{
+ this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)));
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons,
+ copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda);
+ next = 2;
+}
+
+pid$pid::has_villain:entry
+/next == 2/
+{
+ this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)));
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons,
+ copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda);
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh.out b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh.out
new file mode 100644
index 0000000000..219e406e61
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.ksh.out
@@ -0,0 +1,4 @@
+game: Ocarina of Time, dungeon: 10, villain: Ganondorf, zelda: 1
+game: Link's Awakening, dungeon: 9, villain: Nightmare, zelda: 0
+game: A Link to the Past, dungeon: 12, villain: Ganon, zelda: 1
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.c b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.c
new file mode 100644
index 0000000000..916a5b51b9
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.c
@@ -0,0 +1,29 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2013 (c) Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * We're linked against libc which has types, though we do not.
+ */
+#include <unistd.h>
+
+int
+main(void)
+{
+ for (;;) {
+ sleep(1000);
+ }
+ /*NOTREACHED*/
+ return (0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh
new file mode 100644
index 0000000000..af7c6c8fe1
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.libtype.ksh
@@ -0,0 +1,45 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Here we want to make sure that the program in question does not have ctf data
+# in its a.out; however, we can get types out of a linked libc.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="int"
+exe="tst.libtype.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -eq 0 ]]; then
+ echo "CTF exists in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+rc=`$dtrace -n "BEGIN{ trace((pid$pid\`$t)0); exit(0); }"`
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.linkmap.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.linkmap.ksh
new file mode 100644
index 0000000000..f767def53d
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.linkmap.ksh
@@ -0,0 +1,44 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# We should be able to see both strstr from libc and from ld on an
+# alternate linkmap.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -q -p $$ -s /dev/stdin <<EOF
+pid\$target:LM1\`ld.so.1:strstr:entry,
+pid\$target:libc.so.1:strstr:entry
+{
+ exit (0);
+}
+
+BEGIN
+{
+ exit (0);
+}
+EOF
+rc=$?
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh
new file mode 100644
index 0000000000..febb015918
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprint.ksh
@@ -0,0 +1,69 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Use print() on userland CTF types and verify we get the data we expect.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="final_fantasy_info_t"
+exe="tst.printtype.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -qs /dev/stdin <<EOF
+pid$pid::ff_getgameid:entry
+/next == 0/
+{
+ print(*args[0]);
+ printf("\n");
+ next = 1;
+}
+
+pid$pid::ff_getpartysize:entry
+/next == 1/
+{
+ print(*args[0]);
+ printf("\n");
+ next = 2;
+}
+
+pid$pid::ff_getsummons:entry
+/next == 2/
+{
+ print(*args[0]);
+ printf("\n");
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh
new file mode 100644
index 0000000000..7398dc41d9
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.pidprinttarg.ksh
@@ -0,0 +1,70 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Use print() on userland CTF types and verify we get the data we
+# expect. This time, use $target to make sure that path works correctly.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="final_fantasy_info_t"
+exe="tst.printtype.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -p $pid -qs /dev/stdin <<EOF
+pid\$target::ff_getgameid:entry
+/next == 0/
+{
+ print(*args[0]);
+ printf("\n");
+ next = 1;
+}
+
+pid\$target::ff_getpartysize:entry
+/next == 1/
+{
+ print(*args[0]);
+ printf("\n");
+ next = 2;
+}
+
+pid\$target::ff_getsummons:entry
+/next == 2/
+{
+ print(*args[0]);
+ printf("\n");
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.c b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.c
new file mode 100644
index 0000000000..6c27593e97
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.c
@@ -0,0 +1,72 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2013 (c) Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * The point of this is to use print() on various functions to make sure that we
+ * can print basic structures. Note that we purposefully are making sure that
+ * there are no pointers here.
+ */
+#include <unistd.h>
+
+typedef struct final_fantasy_info {
+ int ff_gameid;
+ int ff_partysize;
+ int ff_hassummons;
+} final_fantasy_info_t;
+
+static int
+ff_getgameid(final_fantasy_info_t *f)
+{
+ return (0);
+}
+
+static int
+ff_getpartysize(final_fantasy_info_t *f)
+{
+ return (0);
+}
+
+static int
+ff_getsummons(final_fantasy_info_t *f)
+{
+ return (0);
+}
+
+int
+main(void)
+{
+ final_fantasy_info_t ffiii, ffx, ffi;
+
+ ffi.ff_gameid = 1;
+ ffi.ff_partysize = 4;
+ ffi.ff_hassummons = 0;
+
+ ffiii.ff_gameid = 6;
+ ffiii.ff_partysize = 4;
+ ffiii.ff_hassummons = 1;
+
+ ffx.ff_gameid = 10;
+ ffx.ff_partysize = 3;
+ ffx.ff_hassummons = 1;
+
+ for (;;) {
+ ff_getgameid(&ffi);
+ ff_getpartysize(&ffx);
+ ff_getsummons(&ffiii);
+ sleep(1);
+ }
+ /*NOTREACHED*/
+ return (0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh
new file mode 100644
index 0000000000..dfc1535829
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh
@@ -0,0 +1,69 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Use print() on userland CTF types and verify we get the data we expect.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="final_fantasy_info_t"
+exe="tst.printtype.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -qs /dev/stdin <<EOF
+pid$pid::ff_getgameid:entry
+/next == 0/
+{
+ print(*(pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))));
+ printf("\n");
+ next = 1;
+}
+
+pid$pid::ff_getpartysize:entry
+/next == 1/
+{
+ print(*(pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))));
+ printf("\n");
+ next = 2;
+}
+
+pid$pid::ff_getsummons:entry
+/next == 2/
+{
+ print(*(pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))));
+ printf("\n");
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh.out b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh.out
new file mode 100644
index 0000000000..1770ba2354
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtype.ksh.out
@@ -0,0 +1,16 @@
+final_fantasy_info_t {
+ int ff_gameid = 0x1
+ int ff_partysize = 0x4
+ int ff_hassummons = 0
+}
+final_fantasy_info_t {
+ int ff_gameid = 0xa
+ int ff_partysize = 0x3
+ int ff_hassummons = 0x1
+}
+final_fantasy_info_t {
+ int ff_gameid = 0x6
+ int ff_partysize = 0x4
+ int ff_hassummons = 0x1
+}
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh
new file mode 100644
index 0000000000..025d4a8c02
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.printtypetarg.ksh
@@ -0,0 +1,70 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Use print() on userland CTF types and verify we get the data we
+# expect. Use the pid` alias for $target.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="final_fantasy_info_t"
+exe="tst.printtype.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -p $pid -qs /dev/stdin <<EOF
+pid\$target::ff_getgameid:entry
+/next == 0/
+{
+ print(*(pid\`$t *)(copyin(arg0, sizeof (pid\`$t))));
+ printf("\n");
+ next = 1;
+}
+
+pid\$target::ff_getpartysize:entry
+/next == 1/
+{
+ print(*(pid\`$t *)(copyin(arg0, sizeof (pid\`$t))));
+ printf("\n");
+ next = 2;
+}
+
+pid\$target::ff_getsummons:entry
+/next == 2/
+{
+ print(*(pid\`$t *)(copyin(arg0, sizeof (pid\`$t))));
+ printf("\n");
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
new file mode 100644
index 0000000000..58811ff6fb
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
@@ -0,0 +1,83 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# Simple test that if we manually use the userland keyword that it
+# works.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+t="zelda_info_t"
+exe="tst.chasestrings.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -32 -qs /dev/stdin <<EOF
+typedef struct info {
+ char *zi_gamename;
+ int zi_ndungeons;
+ char *zi_villain;
+ int zi_haszelda;
+} info_t;
+
+pid$pid::has_princess:entry
+/next == 0/
+{
+ this->t = (userland info_t *)arg0;
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(this->t->zi_gamename), this->t->zi_ndungeons,
+ stringof(this->t->zi_villain), this->t->zi_haszelda);
+ next = 1;
+}
+
+pid$pid::has_dungeons:entry
+/next == 1/
+{
+ this->t = (userland info_t *)arg0;
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(this->t->zi_gamename), this->t->zi_ndungeons,
+ stringof(this->t->zi_villain), this->t->zi_haszelda);
+ next = 2;
+}
+
+pid$pid::has_villain:entry
+/next == 2/
+{
+ this->t = (userland info_t *)arg0;
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(this->t->zi_gamename), this->t->zi_ndungeons,
+ stringof(this->t->zi_villain), this->t->zi_haszelda);
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh.out b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh.out
new file mode 100644
index 0000000000..219e406e61
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh.out
@@ -0,0 +1,4 @@
+game: Ocarina of Time, dungeon: 10, villain: Ganondorf, zelda: 1
+game: Link's Awakening, dungeon: 9, villain: Nightmare, zelda: 0
+game: A Link to the Past, dungeon: 12, villain: Ganon, zelda: 1
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh
new file mode 100644
index 0000000000..79d79de8ae
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh
@@ -0,0 +1,72 @@
+#! /usr/bin/ksh
+#
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+#
+# This test is checking that we can read members and that pointers inside
+# members point to valid data that is intelligible, eg. strings.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+exe="tst.chasestrings.exe"
+
+elfdump "./$exe" | grep -q '.SUNW_ctf'
+if [[ $? -ne 0 ]]; then
+ echo "CTF does not exist in $exe, that's a bug" >&2
+ exit 1
+fi
+
+./$exe &
+pid=$!
+
+$dtrace -qs /dev/stdin <<EOF
+pid$pid::has_princess:entry
+/next == 0/
+{
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(args[0]->zi_gamename), args[0]->zi_ndungeons,
+ stringof(args[0]->zi_villain), args[0]->zi_haszelda);
+ next = 1;
+}
+
+pid$pid::has_dungeons:entry
+/next == 1/
+{
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(args[0]->zi_gamename), args[0]->zi_ndungeons,
+ stringof(args[0]->zi_villain), args[0]->zi_haszelda);
+ next = 2;
+}
+
+pid$pid::has_villain:entry
+/next == 2/
+{
+ printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n",
+ stringof(args[0]->zi_gamename), args[0]->zi_ndungeons,
+ stringof(args[0]->zi_villain), args[0]->zi_haszelda);
+ exit(0);
+}
+EOF
+rc=$?
+
+kill -9 $pid
+
+exit $rc
diff --git a/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh.out b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh.out
new file mode 100644
index 0000000000..219e406e61
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/uctf/tst.userstrings.ksh.out
@@ -0,0 +1,4 @@
+game: Ocarina of Time, dungeon: 10, villain: Ganondorf, zelda: 1
+game: Link's Awakening, dungeon: 9, villain: Nightmare, zelda: 0
+game: A Link to the Past, dungeon: 12, villain: Ganon, zelda: 1
+
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
index c9bcb03e63..3480d34862 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
@@ -60,10 +60,10 @@ cat > Makefile <<EOF
all: main
main: main.o prov.o
- gcc -o main main.o prov.o
+ gcc -m32 -o main main.o prov.o
main.o: main.c prov.h
- gcc -c main.c
+ gcc -m32 -c main.c
prov.h: prov.d
$dtrace -h -s prov.d
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
index ade3a54d48..da1b2b3e28 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
@@ -45,17 +45,17 @@ cat > Makefile <<EOF
all: main livelib.so deadlib.so
main: main.o prov.o
- gcc -o main main.o
+ gcc -m32 -o main main.o
main.o: main.c
- gcc -c main.c
+ gcc -m32 -c main.c
livelib.so: livelib.o prov.o
- gcc -shared -o livelib.so livelib.o prov.o -lc
+ gcc -m32 -shared -o livelib.so livelib.o prov.o -lc
livelib.o: livelib.c prov.h
- gcc -c livelib.c
+ gcc -m32 -fPIC -c livelib.c
prov.o: livelib.o prov.d
$dtrace -G -s prov.d livelib.o
@@ -65,10 +65,10 @@ prov.h: prov.d
deadlib.so: deadlib.o
- gcc -shared -o deadlib.so deadlib.o -lc
+ gcc -m32 -shared -o deadlib.so deadlib.o -lc
deadlib.o: deadlib.c
- gcc -c deadlib.c
+ gcc -m32 -fPIC -c deadlib.c
clean:
rm -f main.o livelib.o prov.o prov.h deadlib.o
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
index 692c8d9b5c..328db12cc1 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
@@ -40,17 +40,17 @@ cat > Makefile <<EOF
all: main livelib.so deadlib.so
main: main.o prov.o
- gcc -o main main.o
+ gcc -m32 -o main main.o
main.o: main.c
- gcc -c main.c
+ gcc -m32 -c main.c
livelib.so: livelib.o prov.o
- gcc -shared -o livelib.so livelib.o prov.o -lc
+ gcc -m32 -shared -o livelib.so livelib.o prov.o -lc
livelib.o: livelib.c prov.h
- gcc -c livelib.c
+ gcc -m32 -fPIC -c livelib.c
prov.o: livelib.o prov.d
$dtrace -G -s prov.d livelib.o
@@ -60,10 +60,10 @@ prov.h: prov.d
deadlib.so: deadlib.o
- gcc -shared -o deadlib.so deadlib.o -lc
+ gcc -m32 -shared -o deadlib.so deadlib.o -lc
deadlib.o: deadlib.c
- gcc -c deadlib.c
+ gcc -m32 -fPIC -c deadlib.c
clean:
rm -f main.o livelib.o prov.o prov.h deadlib.o
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
index e950eb4af2..73400cda99 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
@@ -45,17 +45,17 @@ cat > Makefile <<EOF
all: main livelib.so deadlib.so
main: main.o prov.o
- gcc -o main main.o
+ gcc -m32 -o main main.o
main.o: main.c
- gcc -c main.c
+ gcc -m32 -c main.c
livelib.so: livelib.o prov.o
- gcc -shared -o livelib.so livelib.o prov.o -lc
+ gcc -m32 -shared -o livelib.so livelib.o prov.o -lc
livelib.o: livelib.c prov.h
- gcc -c livelib.c
+ gcc -m32 -fPIC -c livelib.c
prov.o: livelib.o prov.d
$dtrace -G -s prov.d livelib.o
@@ -65,10 +65,10 @@ prov.h: prov.d
deadlib.so: deadlib.o
- gcc -shared -o deadlib.so deadlib.o -lc
+ gcc -m32 -shared -o deadlib.so deadlib.o -lc
deadlib.o: deadlib.c
- gcc -c deadlib.c
+ gcc -m32 -fPIC -c deadlib.c
clean:
rm -f main.o livelib.o prov.o prov.h deadlib.o
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
index 3d50443370..307b8a02a0 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
@@ -71,7 +71,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -81,7 +81,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
index 47ea79f376..abf037f92f 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
@@ -60,7 +60,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -70,7 +70,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
index 9b71ac2637..72efdf1a30 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
@@ -76,7 +76,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -86,7 +86,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
index 79e8266192..630f4c9342 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
@@ -69,7 +69,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -79,7 +79,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
index 1264e3ffb6..9449313483 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
@@ -70,7 +70,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -80,7 +80,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.header.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
index f4679bc3f8..9fc5838db2 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
@@ -64,7 +64,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -74,7 +74,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
index bbe1a4acc9..2f659a20d1 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
@@ -61,7 +61,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -71,7 +71,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
index 35d97afc48..f740ae0b16 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
@@ -63,7 +63,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -73,7 +73,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
index 852f5a0b3c..515d5d50c7 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
@@ -64,7 +64,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -74,7 +74,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
index 338dcdf03e..a2472b0d14 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
@@ -51,7 +51,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -61,7 +61,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
index a2e5edee38..9c12f60e1f 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
@@ -51,7 +51,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -61,7 +61,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
index a1e939c883..512595d012 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
@@ -61,7 +61,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -71,7 +71,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
index f18c585ef6..80156de173 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
@@ -51,7 +51,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -61,7 +61,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
index 2f0ee33f1e..76d9391179 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
@@ -51,7 +51,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -61,7 +61,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
index 85b0e553c4..b646cf067e 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
@@ -62,7 +62,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -72,7 +72,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
index 07b765702c..162074501c 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
@@ -66,7 +66,7 @@ provider test_prov {
};
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -82,7 +82,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create final DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.user.ksh b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
index f52c1c351e..0b28060600 100644
--- a/usr/src/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
+++ b/usr/src/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
@@ -61,7 +61,7 @@ main(int argc, char **argv)
}
EOF
-gcc -c test.c
+gcc -m32 -c test.c
if [ $? -ne 0 ]; then
print -u2 "failed to compile test.c"
exit 1
@@ -71,7 +71,7 @@ if [ $? -ne 0 ]; then
print -u2 "failed to create DOF"
exit 1
fi
-gcc -o test test.o prov.o
+gcc -m32 -o test test.o prov.o
if [ $? -ne 0 ]; then
print -u2 "failed to link final executable"
exit 1
diff --git a/usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.c b/usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.c
new file mode 100644
index 0000000000..43ba244444
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.c
@@ -0,0 +1,7 @@
+int
+main(int argc, char *argv[])
+{
+ for (;;)
+ ;
+ return (0);
+}
diff --git a/usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.ksh b/usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.ksh
new file mode 100644
index 0000000000..26c430bff7
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/ustack/tst.unpriv.ksh
@@ -0,0 +1,68 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+ppriv -s A=basic,dtrace_user,dtrace_proc $$
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+file=out.$$
+dtrace=$1
+
+rm -f $file
+
+dir=`/bin/dirname $tst`
+
+$dtrace -o $file -c $dir/tst.unpriv.exe -ws /dev/stdin <<EOF
+ profile-1234hz
+ /pid == \$target/
+ {
+ @[ustack(20, 8192)] = count();
+ }
+
+ tick-1s
+ {
+ secs++;
+ }
+
+ tick-1s
+ /secs > 10/
+ {
+ trace("test timed out");
+ exit(1);
+ }
+
+ profile-1234hz
+ /pid == \$target && secs > 5/
+ {
+ raise(SIGINT);
+ exit(0);
+ }
+EOF
+
+status=$?
+exit $status
diff --git a/usr/src/cmd/dtrace/test/tst/common/ustack/unpriv_helper.d b/usr/src/cmd/dtrace/test/tst/common/ustack/unpriv_helper.d
new file mode 100644
index 0000000000..eb7b0e9e9d
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/ustack/unpriv_helper.d
@@ -0,0 +1,4 @@
+dtrace:helper:ustack:
+{
+ this->otherstr = "doogle";
+}
diff --git a/usr/src/cmd/flowadm/flowadm.c b/usr/src/cmd/flowadm/flowadm.c
index 374fa1675c..34e597dc78 100644
--- a/usr/src/cmd/flowadm/flowadm.c
+++ b/usr/src/cmd/flowadm/flowadm.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -233,9 +234,9 @@ usage(void)
(void) fprintf(stderr, gettext("usage: flowadm <subcommand>"
" <args>...\n"
" add-flow [-t] -l <link> -a <attr>=<value>[,...]\n"
- "\t\t [-p <prop>=<value>,...] <flow>\n"
- " remove-flow [-t] {-l <link> | <flow>}\n"
- " show-flow [-p] [-l <link>] "
+ "\t\t [-p <prop>=<value>,...] [-z zonename] <flow>\n"
+ " remove-flow [-t] [-z zonename] {-l <link> | <flow>}\n"
+ " show-flow [-p] [-l <link>] [-z zonename] "
"[<flow>]\n\n"
" set-flowprop [-t] -p <prop>=<value>[,...] <flow>\n"
" reset-flowprop [-t] [-p <prop>,...] <flow>\n"
@@ -333,11 +334,12 @@ do_add_flow(int argc, char *argv[])
dladm_arg_list_t *proplist = NULL;
dladm_arg_list_t *attrlist = NULL;
dladm_status_t status;
+ char *zonename = NULL;
bzero(propstr, DLADM_STRSIZE);
bzero(attrstr, DLADM_STRSIZE);
- while ((option = getopt_long(argc, argv, "tR:l:a:p:",
+ while ((option = getopt_long(argc, argv, "tR:l:a:p:z:",
prop_longopts, NULL)) != -1) {
switch (option) {
case 't':
@@ -351,9 +353,6 @@ do_add_flow(int argc, char *argv[])
MAXLINKNAMELEN) >= MAXLINKNAMELEN) {
die("link name too long");
}
- if (dladm_name2info(handle, devname, &linkid, NULL,
- NULL, NULL) != DLADM_STATUS_OK)
- die("invalid link '%s'", devname);
l_arg = B_TRUE;
break;
case 'a':
@@ -368,6 +367,9 @@ do_add_flow(int argc, char *argv[])
DLADM_STRSIZE)
die("property list too long '%s'", propstr);
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option);
}
@@ -376,6 +378,10 @@ do_add_flow(int argc, char *argv[])
die("link is required");
}
+ if (dladm_zname2info(handle, zonename, devname, &linkid, NULL,
+ NULL, NULL) != DLADM_STATUS_OK)
+ die("invalid link '%s'", devname);
+
opterr = 0;
index = optind;
@@ -414,11 +420,12 @@ do_remove_flow(int argc, char *argv[])
boolean_t l_arg = B_FALSE;
remove_flow_state_t state;
dladm_status_t status;
+ char *zonename = NULL;
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":tR:l:",
+ while ((option = getopt_long(argc, argv, ":tR:l:z:",
longopts, NULL)) != -1) {
switch (option) {
case 't':
@@ -432,12 +439,11 @@ do_remove_flow(int argc, char *argv[])
MAXLINKNAMELEN) >= MAXLINKNAMELEN) {
die("link name too long");
}
- if (dladm_name2info(handle, linkname, &linkid, NULL,
- NULL, NULL) != DLADM_STATUS_OK) {
- die("invalid link '%s'", linkname);
- }
l_arg = B_TRUE;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option);
break;
@@ -458,6 +464,12 @@ do_remove_flow(int argc, char *argv[])
/* if link is specified then flow name should not be there */
if (optind == argc-1)
usage();
+
+ if (dladm_zname2info(handle, zonename, linkname, &linkid, NULL,
+ NULL, NULL) != DLADM_STATUS_OK) {
+ die("invalid link '%s'", linkname);
+ }
+
/* walk the link to find flows and remove them */
state.fs_tempop = t_arg;
state.fs_altroot = altroot;
@@ -597,11 +609,12 @@ do_show_flow(int argc, char *argv[])
ofmt_handle_t ofmt;
ofmt_status_t oferr;
uint_t ofmtflags = 0;
+ char *zonename = NULL;
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":pPl:o:",
+ while ((option = getopt_long(argc, argv, ":pPl:o:z:",
longopts, NULL)) != -1) {
switch (option) {
case 'p':
@@ -622,17 +635,23 @@ do_show_flow(int argc, char *argv[])
if (strlcpy(linkname, optarg, MAXLINKNAMELEN)
>= MAXLINKNAMELEN)
die("link name too long\n");
- if (dladm_name2info(handle, linkname, &linkid, NULL,
- NULL, NULL) != DLADM_STATUS_OK)
- die("invalid link '%s'", linkname);
l_arg = B_TRUE;
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option);
break;
}
}
+ if (l_arg) {
+ if (dladm_zname2info(handle, zonename, linkname, &linkid, NULL,
+ NULL, NULL) != DLADM_STATUS_OK)
+ die("invalid link '%s'", linkname);
+ }
+
/* get flow name (optional last argument */
if (optind == (argc-1)) {
if (strlcpy(flowname, argv[optind], MAXFLOWNAMELEN)
diff --git a/usr/src/cmd/flowstat/flowstat.c b/usr/src/cmd/flowstat/flowstat.c
index 3ddff9e34f..781ce6b0f0 100644
--- a/usr/src/cmd/flowstat/flowstat.c
+++ b/usr/src/cmd/flowstat/flowstat.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -190,9 +191,9 @@ static char *progname;
static dladm_handle_t handle = NULL;
const char *usage_ermsg = "flowstat [-r | -t] [-i interval] "
- "[-l link] [flow]\n"
+ "[-l link] [-z zonename] [flow]\n"
" flowstat [-S] [-A] [-i interval] [-p] [ -o field[,...]]\n"
- " [-u R|K|M|G|T|P] [-l link] [flow]\n"
+ " [-u R|K|M|G|T|P] [-l link] [-z zonename] [flow]\n"
" flowstat -h [-a] [-d] [-F format]"
" [-s <DD/MM/YYYY,HH:MM:SS>]\n"
" [-e <DD/MM/YYYY,HH:MM:SS>] -f <logfile> "
@@ -556,6 +557,7 @@ main(int argc, char *argv[])
show_flow_state_t state;
char *fields_str = NULL;
char *o_fields_str = NULL;
+ char *zonename = NULL;
char *total_stat_fields =
"flow,ipkts,rbytes,ierrs,opkts,obytes,oerrs";
@@ -582,10 +584,11 @@ main(int argc, char *argv[])
if ((status = dladm_open(&handle)) != DLADM_STATUS_OK)
die_dlerr(status, "could not open /dev/dld");
+ linkname[0] = '\0';
bzero(&state, sizeof (state));
opterr = 0;
- while ((option = getopt_long(argc, argv, ":rtApSi:o:u:l:h",
+ while ((option = getopt_long(argc, argv, ":rtApSi:o:u:l:hz:",
NULL, NULL)) != -1) {
switch (option) {
case 'r':
@@ -642,9 +645,6 @@ main(int argc, char *argv[])
if (strlcpy(linkname, optarg, MAXLINKNAMELEN)
>= MAXLINKNAMELEN)
die("link name too long\n");
- if (dladm_name2info(handle, linkname, &linkid, NULL,
- NULL, NULL) != DLADM_STATUS_OK)
- die("invalid link '%s'", linkname);
break;
case 'h':
if (r_arg || t_arg || p_arg || o_arg || u_arg ||
@@ -655,6 +655,9 @@ main(int argc, char *argv[])
do_show_history(argc, argv);
return (0);
break;
+ case 'z':
+ zonename = optarg;
+ break;
default:
die_opterr(optopt, option, usage_ermsg);
break;
@@ -683,6 +686,12 @@ main(int argc, char *argv[])
die("the option -A is not compatible with "
"-r, -t, -p, -o, -u, -i");
+ if (linkname[0] != '\0') {
+ if (dladm_zname2info(handle, zonename, linkname, &linkid, NULL,
+ NULL, NULL) != DLADM_STATUS_OK)
+ die("invalid link '%s'", linkname);
+ }
+
/* get flow name (optional last argument) */
if (optind == (argc-1)) {
if (strlcpy(flowname, argv[optind], MAXFLOWNAMELEN)
diff --git a/usr/src/cmd/fs.d/Makefile b/usr/src/cmd/fs.d/Makefile
index 8e8faaa643..2f0be1c22f 100644
--- a/usr/src/cmd/fs.d/Makefile
+++ b/usr/src/cmd/fs.d/Makefile
@@ -19,6 +19,7 @@
# CDDL HEADER END
#
# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2012, Joyent, Inc. All rights reserved.
#
# The filesystem independent utilities clri, fsdb, dcopy, labelit, and mkfs
@@ -38,8 +39,8 @@ DEFAULTFILES= fs.dfl
include ../Makefile.cmd
-SUBDIR1= lofs zfs
-SUBDIR2= dev fd pcfs nfs hsfs proc ctfs udfs ufs tmpfs cachefs \
+SUBDIR1= hyprlofs lofs zfs
+SUBDIR2= dev fd pcfs nfs hsfs lxproc proc ctfs udfs ufs tmpfs cachefs \
autofs mntfs objfs sharefs smbclnt reparsed
SUBDIRS= $(SUBDIR1) $(SUBDIR2)
I18NDIRS= $(SUBDIR2)
diff --git a/usr/src/cmd/fs.d/hyprlofs/Makefile b/usr/src/cmd/fs.d/hyprlofs/Makefile
new file mode 100644
index 0000000000..1a3aaf18d3
--- /dev/null
+++ b/usr/src/cmd/fs.d/hyprlofs/Makefile
@@ -0,0 +1,42 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved
+#
+
+SUBDIRS= hlcfg mount
+
+all:= TARGET= all
+install:= TARGET= install
+clean:= TARGET= clean
+clobber:= TARGET= clobber
+lint:= TARGET= lint
+
+.KEEP_STATE:
+
+.PARALLEL: $(SUBDIRS)
+
+all install clean clobber lint: $(SUBDIRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
diff --git a/usr/src/cmd/fs.d/hyprlofs/hlcfg/Makefile b/usr/src/cmd/fs.d/hyprlofs/hlcfg/Makefile
new file mode 100644
index 0000000000..d2ae22e9fd
--- /dev/null
+++ b/usr/src/cmd/fs.d/hyprlofs/hlcfg/Makefile
@@ -0,0 +1,30 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2012, Joyent, Inc. All rights reserved.
+#
+
+FSTYPE= hyprlofs
+LIBPROG= hlcfg
+
+include ../../Makefile.fstype
+include ../../Makefile.mount
+include ../../Makefile.mount.targ
diff --git a/usr/src/cmd/fs.d/hyprlofs/hlcfg/hlcfg.c b/usr/src/cmd/fs.d/hyprlofs/hlcfg/hlcfg.c
new file mode 100644
index 0000000000..16e8e32b1c
--- /dev/null
+++ b/usr/src/cmd/fs.d/hyprlofs/hlcfg/hlcfg.c
@@ -0,0 +1,244 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * This is a simple test program to exercise the hyprlofs ioctls. This is
+ * not designed as a full featured CLI and only does minimal error checking
+ * and reporting.
+ */
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <strings.h>
+#include <sys/errno.h>
+#include <sys/fs/hyprlofs.h>
+
+extern int errno;
+
+char *usage = "usage: <fs path> add [<file name> <alias>]+\n"
+ " <fs path> addl [<file name>]+\n"
+ " <fs path> rm [<alias>]+\n"
+ " <fs path> clear"
+ " <fs path> get";
+
+typedef enum {
+ CMD_ADD,
+ CMD_RM,
+ CMD_CLR,
+ CMD_ADDL,
+ CMD_GET
+} cmd_t;
+
+static int
+get_entries(int fd)
+{
+ int err;
+ int i;
+ hyprlofs_curr_entries_t e;
+ hyprlofs_curr_entry_t *ep;
+
+ e.hce_cnt = 0;
+ e.hce_entries = NULL;
+
+ err = ioctl(fd, HYPRLOFS_GET_ENTRIES, &e);
+ if (err != 0 && errno != E2BIG) {
+ perror("ioctl");
+ return (1);
+ }
+
+ if (err == 0) {
+ (void) printf("success, but no entries\n");
+ return (0);
+ }
+
+ /*
+ * E2BIG is what we expect when there are existing mappings
+ * since the current cnt is still returned in that case.
+ */
+ (void) printf("cnt: %d\n", e.hce_cnt);
+
+ /* alloc array and call again, then print array */
+ if ((ep = (hyprlofs_curr_entry_t *)
+ malloc(sizeof (hyprlofs_curr_entry_t) * e.hce_cnt)) == NULL) {
+ (void) fprintf(stderr, "out of memory\n");
+ exit(1);
+ }
+
+ e.hce_entries = ep;
+ errno = 0;
+ if (ioctl(fd, HYPRLOFS_GET_ENTRIES, &e) != 0) {
+ /*
+ * Not handling an increase here. We would need to free and
+ * start over to do that, but ok for a test program.
+ */
+ perror("ioctl");
+ free(ep);
+ return (1);
+ }
+ for (i = 0; i < e.hce_cnt; i++)
+ (void) printf("%s %s\n", ep[i].hce_path, ep[i].hce_name);
+
+ free(ep);
+ return (0);
+}
+
+int
+main(int argc, char **argv)
+{
+ int i, ap;
+ cmd_t cmd;
+ int cnt = 0;
+ int fd;
+ int rv = 0;
+ hyprlofs_entry_t *e = NULL;
+ hyprlofs_entries_t ents;
+
+ if (argc < 3) {
+ (void) fprintf(stderr, "%s\n", usage);
+ exit(1);
+ }
+
+ if ((fd = open(argv[1], O_RDONLY)) < 0) {
+ perror("can't open hyprlofs mount");
+ exit(1);
+ }
+
+ if (strcmp(argv[2], "add") == 0) {
+ cmd = CMD_ADD;
+ } else if (strcmp(argv[2], "rm") == 0) {
+ cmd = CMD_RM;
+ } else if (strcmp(argv[2], "clear") == 0) {
+ cmd = CMD_CLR;
+ } else if (strcmp(argv[2], "addl") == 0) {
+ cmd = CMD_ADDL;
+ } else if (strcmp(argv[2], "get") == 0) {
+ cmd = CMD_GET;
+ } else {
+ (void) fprintf(stderr, "%s\n", usage);
+ exit(1);
+ }
+
+ /* Count up the number of parameters. The arg format varies w/ cmd */
+ switch (cmd) {
+ case CMD_ADD:
+ for (i = 3; i < argc; i++) {
+ /* argv[i] is the file path */
+
+ /* The next arg is the alias */
+ if (++i >= argc) {
+ (void) fprintf(stderr, "missing alias for %s\n",
+ argv[i - 1]);
+ exit(1);
+ }
+
+ cnt++;
+ }
+ break;
+ case CMD_ADDL:
+ cnt = argc - 3;
+ break;
+ case CMD_RM:
+ cnt = argc - 3;
+ break;
+ case CMD_CLR: /*FALLTHRU*/
+ case CMD_GET:
+ if (argc > 3) {
+ (void) fprintf(stderr, "%s\n", usage);
+ exit(1);
+ }
+ break;
+ }
+
+ if (cnt > 0) {
+ if ((e = (hyprlofs_entry_t *)malloc(sizeof (hyprlofs_entry_t) *
+ cnt)) == NULL) {
+ (void) fprintf(stderr, "out of memory\n");
+ exit(1);
+ }
+ }
+
+ /*
+ * Format up the args.
+ * We only setup the path member for the add cmd.
+ * We won't run this loop for the clear cmd.
+ * The addl command is special since we use basename to get the alias.
+ */
+ for (i = 0, ap = 3; i < cnt; i++, ap++) {
+ if (cmd == CMD_ADDL) {
+ e[i].hle_path = argv[ap];
+ e[i].hle_plen = strlen(e[i].hle_path);
+
+ e[i].hle_name = basename(argv[ap]);
+ e[i].hle_nlen = strlen(e[i].hle_name);
+
+ continue;
+ }
+
+ if (cmd == CMD_ADD) {
+ e[i].hle_path = argv[ap++];
+ e[i].hle_plen = strlen(e[i].hle_path);
+ }
+
+ e[i].hle_name = argv[ap];
+ e[i].hle_nlen = strlen(e[i].hle_name);
+ }
+
+ ents.hle_entries = e;
+ ents.hle_len = cnt;
+
+ switch (cmd) {
+ case CMD_ADD: /*FALLTHRU*/
+ case CMD_ADDL:
+ if (ioctl(fd, HYPRLOFS_ADD_ENTRIES, &ents) < 0) {
+ perror("ioctl");
+ rv = 1;
+ }
+ break;
+ case CMD_RM:
+ if (ioctl(fd, HYPRLOFS_RM_ENTRIES, &ents) < 0) {
+ perror("ioctl");
+ rv = 1;
+ }
+ break;
+ case CMD_CLR:
+ if (ioctl(fd, HYPRLOFS_RM_ALL) < 0) {
+ perror("ioctl");
+ rv = 1;
+ }
+ break;
+ case CMD_GET:
+ rv = get_entries(fd);
+ break;
+ }
+
+ (void) close(fd);
+ if (cnt > 0)
+ free(e);
+ return (rv);
+}
diff --git a/usr/src/cmd/fs.d/hyprlofs/mount/Makefile b/usr/src/cmd/fs.d/hyprlofs/mount/Makefile
new file mode 100644
index 0000000000..a0b63d211c
--- /dev/null
+++ b/usr/src/cmd/fs.d/hyprlofs/mount/Makefile
@@ -0,0 +1,31 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2012 Joyent, Inc. All rights reserved.
+#
+
+FSTYPE= hyprlofs
+LIBPROG= mount
+
+include ../../Makefile.fstype
+include ../../Makefile.mount
+include ../../Makefile.mount.targ
diff --git a/usr/src/cmd/fs.d/hyprlofs/mount/mount.c b/usr/src/cmd/fs.d/hyprlofs/mount/mount.c
new file mode 100644
index 0000000000..a95c9ca3c2
--- /dev/null
+++ b/usr/src/cmd/fs.d/hyprlofs/mount/mount.c
@@ -0,0 +1,148 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
+ */
+
+#define HLFS
+#define MNTTYPE_HYFS "hyprlofs"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libintl.h>
+#include <errno.h>
+#include <sys/fstyp.h>
+#include <sys/fsid.h>
+#include <sys/mntent.h>
+#include <sys/mnttab.h>
+#include <sys/mount.h>
+#include <sys/signal.h>
+#include <sys/stat.h>
+#include <fslib.h>
+
+#define RET_OK 0
+/*
+ * /sbin/mount and the fs-local method understand this exit code to
+ * mean that all the mount failures were related to hyprlofs mounts. Since
+ * this program only attempts to mount hyfs file systems, when it fails
+ * it returns this exit status.
+ */
+#define RET_ERR 111
+
+static void usage(void);
+
+static char optbuf[MAX_MNTOPT_STR] = { '\0', };
+static int optsize = 0;
+
+static char fstype[] = MNTTYPE_HYFS;
+
+/*
+ * usage: mount [-Ormq] [-o options] special mountp
+ *
+ * This mount program is exec'ed by /usr/sbin/mount if '-F hyprlofs' is
+ * specified.
+ */
+int
+main(int argc, char *argv[])
+{
+ int c;
+ char *special; /* Entity being mounted */
+ char *mountp; /* Entity being mounted on */
+ char *savedoptbuf;
+ char *myname;
+ char typename[64];
+ int flags = 0;
+ int errflag = 0;
+ int qflg = 0;
+
+ myname = strrchr(argv[0], '/');
+ myname = myname ? myname+1 : argv[0];
+ (void) snprintf(typename, sizeof (typename), "%s %s", fstype, myname);
+ argv[0] = typename;
+
+ while ((c = getopt(argc, argv, "o:rmOq")) != EOF) {
+ switch (c) {
+ case '?':
+ errflag++;
+ break;
+
+ case 'o':
+ if (strlcpy(optbuf, optarg, sizeof (optbuf)) >=
+ sizeof (optbuf)) {
+ (void) fprintf(stderr,
+ gettext("%s: Invalid argument: %s\n"),
+ myname, optarg);
+ return (2);
+ }
+ optsize = strlen(optbuf);
+ break;
+ case 'O':
+ flags |= MS_OVERLAY;
+ break;
+ case 'r':
+ flags |= MS_RDONLY;
+ break;
+
+ case 'm':
+ flags |= MS_NOMNTTAB;
+ break;
+
+ case 'q':
+ qflg = 1;
+ break;
+
+ default:
+ usage();
+ }
+ }
+ if ((argc - optind != 2) || errflag) {
+ usage();
+ }
+ special = argv[argc - 2];
+ mountp = argv[argc - 1];
+
+ if ((savedoptbuf = strdup(optbuf)) == NULL) {
+ (void) fprintf(stderr, gettext("%s: out of memory\n"),
+ myname);
+ exit(2);
+ }
+ if (mount(special, mountp, flags | MS_OPTIONSTR, fstype, NULL, 0,
+ optbuf, MAX_MNTOPT_STR)) {
+ (void) fprintf(stderr, "mount: ");
+ perror(special);
+ exit(RET_ERR);
+ }
+ if (optsize && !qflg)
+ cmp_requested_to_actual_options(savedoptbuf, optbuf,
+ special, mountp);
+ return (0);
+}
+
+void
+usage(void)
+{
+ (void) fprintf(stderr,
+ "Usage: mount [-Ormq] [-o options] special mountpoint\n");
+ exit(RET_ERR);
+}
diff --git a/usr/src/cmd/fs.d/lxproc/Makefile b/usr/src/cmd/fs.d/lxproc/Makefile
new file mode 100644
index 0000000000..77075ef1dd
--- /dev/null
+++ b/usr/src/cmd/fs.d/lxproc/Makefile
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+FSTYPE= lxproc
+LIBPROG= mount
+
+include ../Makefile.fstype
+include ../Makefile.mount
+include ../Makefile.mount.targ
diff --git a/usr/src/cmd/fs.d/lxproc/mount.c b/usr/src/cmd/fs.d/lxproc/mount.c
new file mode 100644
index 0000000000..5a000997bd
--- /dev/null
+++ b/usr/src/cmd/fs.d/lxproc/mount.c
@@ -0,0 +1,140 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libintl.h>
+#include <errno.h>
+#include <sys/fstyp.h>
+#include <sys/fsid.h>
+#include <sys/mntent.h>
+#include <sys/mnttab.h>
+#include <sys/mount.h>
+#include <sys/signal.h>
+#include <sys/stat.h>
+#include <fslib.h>
+
+#define RET_OK 0
+#define RET_ERR 33
+
+static void usage(void);
+
+static char optbuf[MAX_MNTOPT_STR] = { '\0', };
+static int optsize = 0;
+
+static char fstype[] = "lxproc";
+
+/*
+ * usage: mount [-Ormq] [-o options] special mountp
+ *
+ * This mount program is exec'ed by /usr/sbin/mount if '-F lxproc' is
+ * specified.
+ */
+int
+main(int argc, char *argv[])
+{
+ int c;
+ char *special; /* Entity being mounted */
+ char *mountp; /* Entity being mounted on */
+ char *savedoptbuf;
+ char *myname;
+ char typename[64];
+ int flags = 0;
+ int errflag = 0;
+ int qflg = 0;
+
+ myname = strrchr(argv[0], '/');
+ myname = myname ? myname+1 : argv[0];
+ (void) snprintf(typename, sizeof (typename), "%s %s", fstype, myname);
+ argv[0] = typename;
+
+ while ((c = getopt(argc, argv, "o:rmOq")) != EOF) {
+ switch (c) {
+ case '?':
+ errflag++;
+ break;
+
+ case 'o':
+ if (strlcpy(optbuf, optarg, sizeof (optbuf)) >=
+ sizeof (optbuf)) {
+ (void) fprintf(stderr,
+ gettext("%s: Invalid argument: %s\n"),
+ myname, optarg);
+ return (2);
+ }
+ optsize = strlen(optbuf);
+ break;
+ case 'O':
+ flags |= MS_OVERLAY;
+ break;
+ case 'r':
+ flags |= MS_RDONLY;
+ break;
+
+ case 'm':
+ flags |= MS_NOMNTTAB;
+ break;
+
+ case 'q':
+ qflg = 1;
+ break;
+
+ default:
+ usage();
+ }
+ }
+ if ((argc - optind != 2) || errflag) {
+ usage();
+ }
+ special = argv[argc - 2];
+ mountp = argv[argc - 1];
+
+ if ((savedoptbuf = strdup(optbuf)) == NULL) {
+ (void) fprintf(stderr, gettext("%s: out of memory\n"),
+ myname);
+ exit(2);
+ }
+ if (mount(special, mountp, flags | MS_OPTIONSTR, fstype, NULL, 0,
+ optbuf, MAX_MNTOPT_STR)) {
+ (void) fprintf(stderr, "mount: ");
+ perror(special);
+ exit(RET_ERR);
+ }
+ if (optsize && !qflg)
+ cmp_requested_to_actual_options(savedoptbuf, optbuf,
+ special, mountp);
+ return (0);
+}
+
+void
+usage(void)
+{
+ (void) fprintf(stderr,
+ "Usage: mount [-Ormq] [-o options] special mountpoint\n");
+ exit(RET_ERR);
+}
diff --git a/usr/src/cmd/fs.d/nfs/lib/smfcfg.c b/usr/src/cmd/fs.d/nfs/lib/smfcfg.c
index ba2420362a..b79fff4125 100644
--- a/usr/src/cmd/fs.d/nfs/lib/smfcfg.c
+++ b/usr/src/cmd/fs.d/nfs/lib/smfcfg.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <stdio.h>
#include <stdlib.h>
@@ -344,8 +345,23 @@ fs_smf_get_prop(smf_fstype_t fstype, char *prop_name, char *cbuf,
} else {
ret = scf_error();
}
- if ((ret != 0) && scf_error() != SCF_ERROR_NONE)
- fprintf(stdout, gettext("%s\n"), scf_strerror(ret));
+ if ((ret != 0) && scf_error() != SCF_ERROR_NONE) {
+ /*
+ * This is a workaround for the NFS service manifests not
+ * containing the proper properties in local zones.
+ *
+ * When in a local zone and the property doesn't exist on an NFS
+ * service (most likely nfs/server or nfs/client), don't print
+ * the error. The caller will still see the correct error code,
+ * but a user creating a delegated dataset or mounting an NFS
+ * share won't see this spurious error.
+ */
+ if (getzoneid() == GLOBAL_ZONEID ||
+ scf_error() != SCF_ERROR_NOT_FOUND) {
+ fprintf(stdout, gettext("%s\n"), scf_strerror(ret));
+ }
+ }
+
out:
fs_smf_fini(phandle);
return (ret);
diff --git a/usr/src/cmd/fs.d/nfs/lib/smfcfg.h b/usr/src/cmd/fs.d/nfs/lib/smfcfg.h
index c06327d801..f0b70907aa 100644
--- a/usr/src/cmd/fs.d/nfs/lib/smfcfg.h
+++ b/usr/src/cmd/fs.d/nfs/lib/smfcfg.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SMFCFG_H
@@ -42,6 +43,7 @@
#include <locale.h>
#include <errno.h>
#include <sys/types.h>
+#include <zone.h>
#ifdef __cplusplus
extern "C" {
diff --git a/usr/src/cmd/fs.d/nfs/mount/mount.c b/usr/src/cmd/fs.d/nfs/mount/mount.c
index c228a91d05..b3b255d098 100644
--- a/usr/src/cmd/fs.d/nfs/mount/mount.c
+++ b/usr/src/cmd/fs.d/nfs/mount/mount.c
@@ -2104,7 +2104,7 @@ get_fh(struct nfs_args *args, char *fshost, char *fspath, int *versp,
}
while ((cl = clnt_create_vers(fshost, MOUNTPROG, &outvers,
- vers_min, vers_to_try, "datagram_v")) == NULL) {
+ vers_min, vers_to_try, NULL)) == NULL) {
if (rpc_createerr.cf_stat == RPC_UNKNOWNHOST) {
pr_err(gettext("%s: %s\n"), fshost,
clnt_spcreateerror(""));
diff --git a/usr/src/cmd/fs.d/nfs/mountd/mountd.c b/usr/src/cmd/fs.d/nfs/mountd/mountd.c
index 3d17d3b044..4f2fd66a9e 100644
--- a/usr/src/cmd/fs.d/nfs/mountd/mountd.c
+++ b/usr/src/cmd/fs.d/nfs/mountd/mountd.c
@@ -20,6 +20,7 @@
*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -393,6 +394,13 @@ main(int argc, char *argv[])
exit(1);
}
+ /* Mountd cannot run in a non-global zone. */
+ if (getzoneid() != GLOBAL_ZONEID) {
+ (void) fprintf(stderr, "%s: can only run in the global zone\n",
+ argv[0]);
+ exit(1);
+ }
+
if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
syslog(LOG_ERR, "getrlimit failed");
} else {
diff --git a/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c b/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
index 6c0e0bda5e..c34c39a13e 100644
--- a/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
+++ b/usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -176,6 +177,13 @@ main(int ac, char *av[])
exit(1);
}
+ /* Nfsd cannot run in a non-global zone. */
+ if (getzoneid() != GLOBAL_ZONEID) {
+ (void) fprintf(stderr, "%s: can only run in the global zone\n",
+ av[0]);
+ exit(1);
+ }
+
(void) enable_extended_FILE_stdio(-1, -1);
/*
diff --git a/usr/src/cmd/fs.d/nfs/svc/nfs-server b/usr/src/cmd/fs.d/nfs/svc/nfs-server
index b0c6d155a5..8542ce9b9f 100644
--- a/usr/src/cmd/fs.d/nfs/svc/nfs-server
+++ b/usr/src/cmd/fs.d/nfs/svc/nfs-server
@@ -50,13 +50,13 @@ configure_ipfilter()
#
# Nothing to do if:
+ # - service's policy is 'use_global'
# - ipfilter isn't online
# - global policy is 'custom'
- # - service's policy is 'use_global'
#
+ [ "`get_policy $SMF_FMRI`" = "use_global" ] && return 0
service_check_state $IPF_FMRI $SMF_ONLINE || return 0
[ "`get_global_def_policy`" = "custom" ] && return 0
- [ "`get_policy $SMF_FMRI`" = "use_global" ] && return 0
svcadm restart $IPF_FMRI
}
diff --git a/usr/src/cmd/fs.d/nfs/umount/umount.c b/usr/src/cmd/fs.d/nfs/umount/umount.c
index aabdc8a592..66d280bcdb 100644
--- a/usr/src/cmd/fs.d/nfs/umount/umount.c
+++ b/usr/src/cmd/fs.d/nfs/umount/umount.c
@@ -297,7 +297,7 @@ retry:
*/
timep = (quick ? &create_timeout : NULL);
cl = clnt_create_timed(list[i].host, MOUNTPROG, vers,
- "datagram_n", timep);
+ NULL, timep);
/*
* Do not print any error messages in case of forced
* unmount.
diff --git a/usr/src/cmd/halt/halt.c b/usr/src/cmd/halt/halt.c
index ba969a369c..aa6909b643 100644
--- a/usr/src/cmd/halt/halt.c
+++ b/usr/src/cmd/halt/halt.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
@@ -1231,6 +1232,17 @@ do_archives_update(int do_fast_reboot)
pid_t pid;
char *cmd_argv[MAXARGS];
+#if defined(__i386)
+ {
+ /*
+ * bootadm will complain and exit if not a grub root, so
+ * just skip running it.
+ */
+ struct stat sb;
+ if (stat("/boot/grub/stage2", &sb) == -1)
+ return;
+ }
+#endif /* __i386 */
cmd_argv[i++] = "/sbin/bootadm";
cmd_argv[i++] = "-ea";
@@ -1295,7 +1307,7 @@ main(int argc, char *argv[])
optstring = "dlnqfp";
usage = gettext("usage: %s [ -dlnq(p|f) ] [ boot args ]\n");
#endif
- cmd = A_SHUTDOWN;
+ cmd = A_REBOOT;
fcn = AD_BOOT;
} else {
(void) fprintf(stderr,
@@ -1493,7 +1505,8 @@ main(int argc, char *argv[])
* check_zone_haltedness later on.
*/
if (zoneid == GLOBAL_ZONEID && cmd != A_DUMP) {
- need_check_zones = halt_zones();
+ if (!qflag)
+ need_check_zones = halt_zones();
}
#if defined(__i386)
@@ -1593,7 +1606,7 @@ main(int argc, char *argv[])
(void) signal(SIGINT, SIG_IGN);
- if (!qflag && !nosync) {
+ if (!nosync) {
struct utmpx wtmpx;
bzero(&wtmpx, sizeof (struct utmpx));
diff --git a/usr/src/cmd/ibd_upgrade/ibd_delete_link.c b/usr/src/cmd/ibd_upgrade/ibd_delete_link.c
index b9d10a56cd..f63630207d 100644
--- a/usr/src/cmd/ibd_upgrade/ibd_delete_link.c
+++ b/usr/src/cmd/ibd_upgrade/ibd_delete_link.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <stdio.h>
@@ -86,6 +87,7 @@ ibd_delete_link(dladm_handle_t dlh, char *link)
getlinkid.ld_cmd = DLMGMT_CMD_GETLINKID;
(void) strlcpy(getlinkid.ld_link, link, MAXLINKNAMELEN);
+ getlinkid.ld_zoneid = -1;
if ((status = ibd_dladm_door_call(dlh, &getlinkid, sizeof (getlinkid),
&retval, sizeof (retval))) != DLADM_STATUS_OK) {
diff --git a/usr/src/cmd/init/Makefile b/usr/src/cmd/init/Makefile
index a867a0e780..b4b857882b 100644
--- a/usr/src/cmd/init/Makefile
+++ b/usr/src/cmd/init/Makefile
@@ -25,11 +25,13 @@
#
PROG= init
+OBJS= init.o
ROOTFS_PROG= $(PROG)
DEFAULTFILES= init.dfl
include ../Makefile.cmd
+include ../Makefile.ctf
LDLIBS += -lpam -lbsm -lcontract -lscf
CERRWARN += -_gcc=-Wno-parentheses
@@ -41,6 +43,10 @@ CLOBBERFILES= $(STATIC)
all: $(ROOTFS_PROG)
+$(ROOTFS_PROG): $(OBJS)
+ $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
+ $(POST_PROCESS)
+
install: all $(ROOTETCDEFAULTFILES) $(ROOTSBINPROG)
$(RM) $(ROOTETCPROG)
$(RM) $(ROOTUSRSBINPROG)
@@ -58,4 +64,8 @@ clean:
lint: lint_PROG
+%.o: %.c
+ $(COMPILE.c) $<
+ $(POST_PROCESS_O)
+
include ../Makefile.targ
diff --git a/usr/src/cmd/init/init.c b/usr/src/cmd/init/init.c
index 031a053b65..f6f8bccdbb 100644
--- a/usr/src/cmd/init/init.c
+++ b/usr/src/cmd/init/init.c
@@ -23,6 +23,7 @@
* Copyright (c) 2013 Gary Mills
*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -144,6 +145,8 @@
#define UT_USER_SZ 32 /* Size of a utmpx ut_user field */
#define UT_LINE_SZ 32 /* Size of a utmpx ut_line field */
+#define CHECK_SVC SCF_INSTANCE_FS_MINIMAL
+
/*
* SLEEPTIME The number of seconds "init" sleeps between wakeups if
* nothing else requires this "init" wakeup.
@@ -696,9 +699,8 @@ main(int argc, char *argv[])
console(B_FALSE,
"\n\n%s Release %s Version %s %d-bit\r\n",
un.sysname, un.release, un.version, bits);
- console(B_FALSE,
- "Copyright (c) 1983, 2010, Oracle and/or its affiliates."
- " All rights reserved.\r\n");
+ console(B_FALSE, "Copyright (c) 2010-2012, "
+ "Joyent Inc. All rights reserved.\r\n");
}
/*
@@ -3509,6 +3511,28 @@ bail:
}
/*
+ * Attempt to confirm that svc.startd is ready to accept a user-initiated
+ * run-level change. startd is not ready until it has started its
+ * _scf_notify_wait thread to watch for events from svc.configd. This is
+ * inherently racy. To workaround this, we check the status of a file that
+ * startd will create once it has started the _scf_notify_wait thread.
+ * If we don't see this file after one minute, then charge ahead.
+ */
+static void
+verify_startd_ready()
+{
+ struct stat64 buf;
+ int i;
+
+ for (i = 0; i < 60; i++) {
+ if (stat64("/etc/svc/volatile/startd.ready", &buf) == 0)
+ return;
+ sleep(1);
+ }
+ console(B_TRUE, "verify startd timeout\n");
+}
+
+/*
* Function to handle requests from users to main init running as process 1.
*/
static void
@@ -3596,6 +3620,12 @@ userinit(int argc, char **argv)
(void) audit_put_record(ADT_SUCCESS, ADT_SUCCESS, argv[1]);
/*
+ * Before we tell init to start a run-level change, we need to be
+ * sure svc.startd is ready to accept that.
+ */
+ verify_startd_ready();
+
+ /*
* Signal init; init will take care of telling svc.startd.
*/
if (kill(init_pid, init_signal) == FAILURE) {
@@ -4305,9 +4335,7 @@ contract_event(struct pollfd *poll)
if (ret == 0) {
if (cookie == STARTD_COOKIE &&
do_restart_startd) {
- if (smf_debug)
- console(B_TRUE, "Restarting "
- "svc.startd.\n");
+ console(B_TRUE, "Restarting svc.startd.\n");
/*
* Account for the failure. If the failure rate
diff --git a/usr/src/cmd/initpkg/mountall.sh b/usr/src/cmd/initpkg/mountall.sh
index 56f2798e18..38693dd8da 100644
--- a/usr/src/cmd/initpkg/mountall.sh
+++ b/usr/src/cmd/initpkg/mountall.sh
@@ -28,6 +28,8 @@
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
# All Rights Reserved
#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
usage () {
if [ -n "$1" ]; then
@@ -148,6 +150,9 @@ isremote() {
# Get list of remote FS types (just once)
RemoteFSTypes=`while read t junk; do echo $t; done < /etc/dfs/fstypes`
+# Ensure nfs/smbfs are remote FS types even if not delivered from fstypes
+isremote "nfs" || set -A RemoteFSTypes "nfs"
+isremote "smbfs" || set -A RemoteFSTypes "smbfs"
#
# Process command line args
diff --git a/usr/src/cmd/initpkg/shutdown.sh b/usr/src/cmd/initpkg/shutdown.sh
index e65224c632..820d50310c 100644
--- a/usr/src/cmd/initpkg/shutdown.sh
+++ b/usr/src/cmd/initpkg/shutdown.sh
@@ -41,7 +41,7 @@ usage() {
}
notify() {
- /usr/sbin/wall -a <<-!
+ /usr/sbin/wall -Za <<-!
$*
!
if [ -x /usr/sbin/showmount -a -x /usr/sbin/rwall ]
diff --git a/usr/src/cmd/initpkg/umountall.sh b/usr/src/cmd/initpkg/umountall.sh
index c9a94fd8f1..4a45e19e18 100644
--- a/usr/src/cmd/initpkg/umountall.sh
+++ b/usr/src/cmd/initpkg/umountall.sh
@@ -25,6 +25,7 @@
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
# All Rights Reserved
#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
usage () {
@@ -98,6 +99,9 @@ isremote() {
# Get list of remote FS types (just once)
RemoteFSTypes=`while read t junk; do echo $t; done < /etc/dfs/fstypes`
+# Ensure nfs/smbfs are remote FS types even if not delivered from fstypes
+isremote "nfs" || set -A RemoteFSTypes "nfs"
+isremote "smbfs" || set -A RemoteFSTypes "smbfs"
#
# Process command line args
diff --git a/usr/src/cmd/ipf/lib/common/load_hash.c b/usr/src/cmd/ipf/lib/common/load_hash.c
index e43ddf54a3..d91a831f44 100644
--- a/usr/src/cmd/ipf/lib/common/load_hash.c
+++ b/usr/src/cmd/ipf/lib/common/load_hash.c
@@ -7,6 +7,8 @@
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -17,6 +19,10 @@
#include "netinet/ip_lookup.h"
#include "netinet/ip_htable.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
static int hashfd = -1;
@@ -35,6 +41,12 @@ ioctlfunc_t iocfunc;
hashfd = open(IPLOOKUP_NAME, O_RDWR);
if ((hashfd == -1) && ((opts & OPT_DONOTHING) == 0))
return -1;
+#if SOLARIS
+ if (setzone(hashfd) != 0) {
+ close(hashfd);
+ return -1;
+ }
+#endif
for (n = 0, a = list; a != NULL; a = a->ipe_next)
n++;
diff --git a/usr/src/cmd/ipf/lib/common/load_hashnode.c b/usr/src/cmd/ipf/lib/common/load_hashnode.c
index 8cf1bb2c67..dd343f3ab1 100644
--- a/usr/src/cmd/ipf/lib/common/load_hashnode.c
+++ b/usr/src/cmd/ipf/lib/common/load_hashnode.c
@@ -7,6 +7,8 @@
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -17,6 +19,10 @@
#include "netinet/ip_lookup.h"
#include "netinet/ip_htable.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
static int hashfd = -1;
@@ -34,6 +40,12 @@ ioctlfunc_t iocfunc;
hashfd = open(IPLOOKUP_NAME, O_RDWR);
if ((hashfd == -1) && ((opts & OPT_DONOTHING) == 0))
return -1;
+#if SOLARIS
+ if (setzone(hashfd) != 0) {
+ close(hashfd);
+ return -1;
+ }
+#endif
op.iplo_type = IPLT_HASH;
op.iplo_unit = unit;
diff --git a/usr/src/cmd/ipf/lib/common/load_pool.c b/usr/src/cmd/ipf/lib/common/load_pool.c
index b8146c060c..e09f77f6b4 100644
--- a/usr/src/cmd/ipf/lib/common/load_pool.c
+++ b/usr/src/cmd/ipf/lib/common/load_pool.c
@@ -7,6 +7,8 @@
*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -17,6 +19,10 @@
#include "netinet/ip_lookup.h"
#include "netinet/ip_pool.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
static int poolfd = -1;
@@ -32,6 +38,12 @@ ioctlfunc_t iocfunc;
poolfd = open(IPLOOKUP_NAME, O_RDWR);
if ((poolfd == -1) && ((opts & OPT_DONOTHING) == 0))
return -1;
+#if SOLARIS
+ if (setzone(poolfd) != 0) {
+ close(poolfd);
+ return -1;
+ }
+#endif
op.iplo_unit = plp->ipo_unit;
op.iplo_type = IPLT_POOL;
diff --git a/usr/src/cmd/ipf/lib/common/load_poolnode.c b/usr/src/cmd/ipf/lib/common/load_poolnode.c
index e992a80281..37c7ef861e 100644
--- a/usr/src/cmd/ipf/lib/common/load_poolnode.c
+++ b/usr/src/cmd/ipf/lib/common/load_poolnode.c
@@ -4,6 +4,8 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id: load_poolnode.c,v 1.3.2.1 2004/03/06 14:33:29 darrenr Exp $
+ *
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <fcntl.h>
@@ -12,6 +14,10 @@
#include "netinet/ip_lookup.h"
#include "netinet/ip_pool.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
static int poolfd = -1;
@@ -29,6 +35,12 @@ ioctlfunc_t iocfunc;
poolfd = open(IPLOOKUP_NAME, O_RDWR);
if ((poolfd == -1) && ((opts & OPT_DONOTHING) == 0))
return -1;
+#if SOLARIS
+ if (setzone(poolfd) != 0) {
+ close(poolfd);
+ return -1;
+ }
+#endif
op.iplo_unit = role;
op.iplo_type = IPLT_POOL;
diff --git a/usr/src/cmd/ipf/tools/Makefile.tools b/usr/src/cmd/ipf/tools/Makefile.tools
index 5d8bee1d04..ce0db79970 100644
--- a/usr/src/cmd/ipf/tools/Makefile.tools
+++ b/usr/src/cmd/ipf/tools/Makefile.tools
@@ -23,18 +23,19 @@
# Use is subject to license terms.
#
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright (c) 2012, Joyent Inc. All rights reserved.
#
PROG= ipf ipfs ipmon ipnat ippool ipfstat
IPFPROG= ipftest
-IPF_OBJS= ipf.o ipfcomp.o ipf_y.o ipf_l.o
-IPFS_OBJS= ipfs.o
-IPFSTAT_OBJS= ipfstat.o
-IPMON_OBJS= ipmon.o ipmon_y.o ipmon_l.o
-IPNAT_OBJS= ipnat.o ipnat_y.o ipnat_l.o
-IPPOOL_OBJS= ippool.o ippool_y.o ippool_l.o
-IPFTEST_OBJS= ipftest.o \
+IPF_OBJS= ipf.o ipfcomp.o ipfzone.o ipf_y.o ipf_l.o
+IPFS_OBJS= ipfs.o ipfzone.o
+IPFSTAT_OBJS= ipfstat.o ipfzone.o
+IPMON_OBJS= ipmon.o ipfzone.o ipmon_y.o ipmon_l.o
+IPNAT_OBJS= ipnat.o ipfzone.o ipnat_y.o ipnat_l.o
+IPPOOL_OBJS= ippool.o ipfzone.o ippool_y.o ippool_l.o
+IPFTEST_OBJS= ipftest.o ipfzone.o \
ip_fil.o ip_state.o ip_compat.o \
ip_frag.o ip_nat.o ip_nat6.o fil.o \
ip_htable.o ip_lookup.o \
diff --git a/usr/src/cmd/ipf/tools/ipf.c b/usr/src/cmd/ipf/tools/ipf.c
index e81389b342..97bee67b26 100644
--- a/usr/src/cmd/ipf/tools/ipf.c
+++ b/usr/src/cmd/ipf/tools/ipf.c
@@ -5,6 +5,8 @@
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifdef __FreeBSD__
@@ -21,6 +23,10 @@
#include <sys/ioctl.h>
#include "netinet/ipl.h"
+#ifdef SOLARIS
+#include "ipfzone.h"
+#endif
+
#if !defined(lint)
static const char sccsid[] = "@(#)ipf.c 1.23 6/5/96 (C) 1993-2000 Darren Reed";
static const char rcsid[] = "@(#)$Id: ipf.c,v 1.35.2.3 2004/12/15 18:27:17 darrenr Exp $";
@@ -62,9 +68,14 @@ static ioctlfunc_t iocfunctions[IPL_LOGSIZE] = { ioctl, ioctl, ioctl,
static void usage()
{
- fprintf(stderr, "usage: ipf [-6AdDEInoPrRsvVyzZ] %s %s %s\n",
+ fprintf(stderr, "usage: ipf [-6AdDEGInoPrRsvVyzZ] %s %s %s",
"[-l block|pass|nomatch|state|nat]", "[-cc] [-F i|o|a|s|S|u]",
"[-f filename] [-T <tuneopts>]");
+#if SOLARIS
+ fprintf(stderr, " [zonename]\n");
+#else
+ fprintf(stderr, "\n");
+#endif
exit(1);
}
@@ -74,11 +85,20 @@ int argc;
char *argv[];
{
int c;
+ const char *optstr = "6Ac:dDEf:F:GIl:noPrRsT:vVyzZ";
if (argc < 2)
usage();
- while ((c = getopt(argc, argv, "6Ac:dDEf:F:Il:noPrRsT:vVyzZ")) != -1) {
+#if SOLARIS
+ /*
+ * We need to set the zone name before calling the functions
+ * in the switch statement below
+ */
+ getzonearg(argc, argv, optstr);
+#endif
+
+ while ((c = getopt(argc, argv, optstr)) != -1) {
switch (c)
{
case '?' :
@@ -187,6 +207,14 @@ int check;
if ((fd = open(ipfdev, O_RDWR)) == -1)
if ((fd = open(ipfdev, O_RDONLY)) == -1)
perror("open device");
+
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ return -1;
+ }
+#endif
+
return fd;
}
@@ -307,6 +335,13 @@ char *opt;
if (opts & OPT_VERBOSE)
printf("set state log flag\n");
xfd = open(IPSTATE_NAME, O_RDWR);
+#if SOLARIS
+ if (xfd >= 0 && setzone(xfd) != 0) {
+ close(xfd);
+ xfd = -1;
+ }
+#endif
+
if (xfd >= 0) {
logopt = 0;
if (ioctl(xfd, SIOCGETLG, &logopt))
@@ -324,6 +359,13 @@ char *opt;
if (opts & OPT_VERBOSE)
printf("set nat log flag\n");
xfd = open(IPNAT_NAME, O_RDWR);
+#if SOLARIS
+ if (xfd >= 0 && setzone(xfd) != 0) {
+ close(xfd);
+ xfd = -1;
+ }
+#endif
+
if (xfd >= 0) {
logopt = 0;
if (ioctl(xfd, SIOCGETLG, &logopt))
@@ -516,6 +558,14 @@ static int showversion()
return 1;
}
+#if SOLARIS
+ if (setzone(vfd) != 0) {
+ close(vfd);
+ return 1;
+ }
+#endif
+
+
if (ioctl(vfd, SIOCGETFS, &ipfo)) {
perror("ioctl(SIOCGETFS)");
close(vfd);
diff --git a/usr/src/cmd/ipf/tools/ipfs.c b/usr/src/cmd/ipf/tools/ipfs.c
index da8387324a..72296a09d0 100644
--- a/usr/src/cmd/ipf/tools/ipfs.c
+++ b/usr/src/cmd/ipf/tools/ipfs.c
@@ -5,6 +5,8 @@
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifdef __FreeBSD__
@@ -44,6 +46,9 @@
#include <resolv.h>
#include "ipf.h"
#include "netinet/ipl.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
#if !defined(lint)
static const char rcsid[] = "@(#)Id: ipfs.c,v 1.12 2003/12/01 01:56:53 darrenr Exp";
@@ -86,14 +91,21 @@ char *progname;
void usage()
{
- fprintf(stderr, "usage: %s [-nv] -l\n", progname);
- fprintf(stderr, "usage: %s [-nv] -u\n", progname);
- fprintf(stderr, "usage: %s [-nv] [-d <dir>] -R\n", progname);
- fprintf(stderr, "usage: %s [-nv] [-d <dir>] -W\n", progname);
- fprintf(stderr, "usage: %s [-nv] [-N|-S] [-f <file>] -r\n", progname);
- fprintf(stderr, "usage: %s [-nv] [-N|-S] [-f <file>] -w\n", progname);
- fprintf(stderr, "usage: %s [-nv] [-N|-S] -f <file> -i <if1>,<if2>\n",
- progname);
+#if SOLARIS
+ const char *zoneopt = "[-G|-z zonename] ";
+#else
+ const char *zoneopt = "";
+#endif
+ fprintf(stderr, "usage: %s %s[-nv] -l\n", progname, zoneopt);
+ fprintf(stderr, "usage: %s %s[-nv] -u\n", progname, zoneopt);
+ fprintf(stderr, "usage: %s %s[-nv] [-d <dir>] -R\n", progname, zoneopt);
+ fprintf(stderr, "usage: %s %s[-nv] [-d <dir>] -W\n", progname, zoneopt);
+ fprintf(stderr, "usage: %s %s[-nv] [-N|-S] [-f <file>] -r\n", progname,
+ zoneopt);
+ fprintf(stderr, "usage: %s %s[-nv] [-N|-S] [-f <file>] -w\n", progname,
+ zoneopt);
+ fprintf(stderr, "usage: %s %s[-nv] [-N|-S] -f <file> -i <if1>,<if2>\n",
+ progname, zoneopt);
exit(1);
}
@@ -218,7 +230,7 @@ char *argv[];
char *dirname = NULL, *filename = NULL, *ifs = NULL;
progname = argv[0];
- while ((c = getopt(argc, argv, "d:f:lNnSRruvWw")) != -1)
+ while ((c = getopt(argc, argv, "d:f:G:lNnSRruvWwz:")) != -1)
switch (c)
{
case 'd' :
@@ -233,6 +245,11 @@ char *argv[];
else
usage();
break;
+#if SOLARIS
+ case 'G' :
+ setzonename_global(optarg);
+ break;
+#endif
case 'i' :
ifs = optarg;
set = 1;
@@ -287,6 +304,11 @@ char *argv[];
rw = 3;
set = 1;
break;
+#if SOLARIS
+ case 'z' :
+ setzonename(optarg);
+ break;
+#endif
case '?' :
default :
usage();
@@ -355,6 +377,14 @@ char *ipfdev;
if ((fd = open(ipfdev, O_RDWR)) == -1)
if ((fd = open(ipfdev, O_RDONLY)) == -1)
perror("open device");
+
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ fd = -1;
+ }
+#endif
+
return fd;
}
diff --git a/usr/src/cmd/ipf/tools/ipfstat.c b/usr/src/cmd/ipf/tools/ipfstat.c
index 27b018e273..49ee7cd23d 100644
--- a/usr/src/cmd/ipf/tools/ipfstat.c
+++ b/usr/src/cmd/ipf/tools/ipfstat.c
@@ -5,6 +5,8 @@
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifdef __FreeBSD__
@@ -162,6 +164,10 @@ static int sort_dstip __P((const void *, const void *));
static int sort_dstpt __P((const void *, const void *));
#endif
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
static void usage(name)
char *name;
@@ -177,6 +183,9 @@ char *name;
#else
fprintf(stderr, " %s -t [-C] ", name);
#endif
+#ifdef SOLARIS
+ fprintf(stderr, "[-G|-z zonename] ");
+#endif
fprintf(stderr, "[-D destination address] [-P protocol] [-S source address] [-T refresh time]\n");
exit(1);
}
@@ -207,9 +216,9 @@ char *argv[];
u_32_t frf;
#ifdef USE_INET6
- options = "6aACdfghIilnostvD:M:N:P:RS:T:";
+ options = "6aACdfgG:hIilnostvD:M:N:P:RS:T:z:";
#else
- options = "aACdfghIilnostvD:M:N:P:RS:T:";
+ options = "aACdfgG:hIilnostvD:M:N:P:RS:T:z:";
#endif
saddr.in4.s_addr = INADDR_ANY; /* default any v4 source addr */
@@ -223,13 +232,20 @@ char *argv[];
opterr = 0;
/*
- * Parse these two arguments now lest there be any buffer overflows
+ * Parse these four arguments now lest there be any buffer overflows
* in the parsing of the rest.
*/
myoptind = optind;
while ((c = getopt(argc, argv, options)) != -1) {
switch (c)
{
+ case 'G' :
+#if SOLARIS
+ setzonename_global(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
case 'M' :
memf = optarg;
live_kernel = 0;
@@ -238,6 +254,13 @@ char *argv[];
kern = optarg;
live_kernel = 0;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
}
optind = myoptind;
@@ -247,11 +270,23 @@ char *argv[];
perror("open(IPSTATE_NAME)");
exit(-1);
}
+#if SOLARIS
+ if (setzone(state_fd) != 0) {
+ close(state_fd);
+ exit(-1);
+ }
+#endif
if ((ipf_fd = open(device, O_RDONLY)) == -1) {
fprintf(stderr, "open(%s)", device);
perror("");
exit(-1);
}
+#if SOLARIS
+ if (setzone(ipf_fd) != 0) {
+ close(ipf_fd);
+ exit(-1);
+ }
+#endif
}
if (kern != NULL || memf != NULL) {
@@ -298,6 +333,8 @@ char *argv[];
case 'g' :
opts |= OPT_GROUPS;
break;
+ case 'G' :
+ break;
case 'h' :
opts |= OPT_HITS;
break;
@@ -360,6 +397,8 @@ char *argv[];
opts |= OPT_VERBOSE;
opts |= OPT_UNDEF;
break;
+ case 'z' :
+ break;
default :
usage(argv[0]);
break;
@@ -482,6 +521,13 @@ u_32_t *frfp;
exit(-1);
}
+#if SOLARIS
+ if (setzone(ipf_fd) != 0) {
+ close(ipf_fd);
+ exit(-1);
+ }
+#endif
+
bzero((caddr_t)&ipfo, sizeof(ipfo));
ipfo.ipfo_rev = IPFILTER_VERSION;
ipfo.ipfo_size = sizeof(fr_authstat_t);
diff --git a/usr/src/cmd/ipf/tools/ipfzone.c b/usr/src/cmd/ipf/tools/ipfzone.c
new file mode 100644
index 0000000000..c52b3e879d
--- /dev/null
+++ b/usr/src/cmd/ipf/tools/ipfzone.c
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * See the IPFILTER.LICENCE file for details on licensing.
+ */
+
+
+#include <errno.h>
+#include <net/if.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <zone.h>
+
+#include "netinet/ip_fil.h"
+#include "ipfzone.h"
+
+static ipfzoneobj_t ipzo;
+static boolean_t do_setzone = 0;
+static int num_setzones = 0;
+
+extern int errno;
+extern int optind;
+extern char *optarg;
+
+/*
+ * Get the zonename if it's the last argument and set the zonename
+ * in ipfzo to it
+ */
+void
+getzonearg(int argc, char *argv[], const char *optstr)
+{
+ int c;
+
+ /*
+ * getopt is also used here to set optind so that we can
+ * determine if the last argument belongs to a flag or is
+ * actually a zonename.
+ */
+ while ((c = getopt(argc, argv, optstr)) != -1) {
+ if (c == 'G')
+ ipzo.ipfz_gz = 1;
+ }
+
+ if (optind < argc)
+ setzonename(argv[optind]);
+
+ /*
+ * Reset optind so the next getopt call will go through all of argv
+ * again.
+ */
+ optind = 1;
+}
+
+/*
+ * Get a -z option from argv and set the zonename in ipfzo accordingly
+ */
+void
+getzoneopt(int argc, char *argv[], const char *optstr)
+{
+ int c;
+
+ while ((c = getopt(argc, argv, optstr)) != -1) {
+ if (c == 'G')
+ setzonename_global(optarg);
+
+ if (c == 'z')
+ setzonename(optarg);
+ }
+
+ /*
+ * Reset optind so the next getopt call will go through all of argv
+ * again.
+ */
+ optind = 1;
+}
+
+/*
+ * Set the zonename in ipfzo to the given string
+ */
+void
+setzonename(const char *zonename)
+{
+ memcpy(ipzo.ipfz_zonename, zonename, sizeof (ipzo.ipfz_zonename));
+ do_setzone = B_TRUE;
+ num_setzones++;
+}
+
+/*
+ * Set the zonename in ipfo, and the gz flag to indicate that we want to
+ * act on the GZ-controlled stack
+ */
+void
+setzonename_global(const char *zonename)
+{
+ setzonename(zonename);
+ ipzo.ipfz_gz = 1;
+}
+
+/*
+ * Set the zone that all further ioctls will operate on
+ */
+int
+setzone(int fd)
+{
+ if (!do_setzone)
+ return (0);
+
+ if (num_setzones > 1) {
+ (void) fprintf(stderr,
+ "Only one of -G and -z may be set\n");
+ return (-1);
+ }
+
+ if (ioctl(fd, SIOCIPFZONESET, &ipzo) == -1) {
+ switch (errno) {
+ case ENODEV:
+ (void) fprintf(stderr,
+ "Could not find running zone: %s\n",
+ ipzo.ipfz_zonename);
+ break;
+ case EACCES:
+ (void) fprintf(stderr,
+ "Permission denied setting zone: %s\n",
+ ipzo.ipfz_zonename);
+ break;
+ default:
+ perror("Error setting zone");
+ }
+ return (-1);
+ }
+
+ return (0);
+}
diff --git a/usr/src/cmd/ipf/tools/ipfzone.h b/usr/src/cmd/ipf/tools/ipfzone.h
new file mode 100644
index 0000000000..ca6f42ec6a
--- /dev/null
+++ b/usr/src/cmd/ipf/tools/ipfzone.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * See the IPFILTER.LICENCE file for details on licensing.
+ */
+
+#ifndef __IPFZONE_H__
+#define __IPFZONE_H__
+
+void getzonearg(int, char *[], const char *);
+void getzoneopt(int, char *[], const char *);
+int setzone(int);
+void setzonename(const char *);
+void setzonename_global(const char *);
+
+#endif /* __IPFZONE_H__ */
diff --git a/usr/src/cmd/ipf/tools/ipmon.c b/usr/src/cmd/ipf/tools/ipmon.c
index d4a351b015..07d3d40be2 100644
--- a/usr/src/cmd/ipf/tools/ipmon.c
+++ b/usr/src/cmd/ipf/tools/ipmon.c
@@ -5,6 +5,8 @@
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
@@ -78,6 +80,9 @@
#include "netinet/ip_state.h"
#include "netinet/ip_proxy.h"
#include "ipmon.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
#if !defined(lint)
static const char sccsid[] = "@(#)ipmon.c 1.21 6/5/96 (C)1993-2000 Darren Reed";
@@ -1340,8 +1345,13 @@ printipflog:
static void usage(prog)
char *prog;
{
- fprintf(stderr, "%s: [-abDFhnpstvxX] %s %s %s %s %s %s\n",
- prog, "[-N device]", "[ [-o [NSI]] [-O [NSI]]",
+#if SOLARIS
+ const char *zoneopt = " [-G|-z zonename]";
+#else
+ const char *zoneopt = "";
+#endif
+ fprintf(stderr, "%s: [-abDFhnpstvxX]%s %s %s %s %s %s %s\n",
+ prog, zoneopt, "[-N device]", "[ [-o [NSI]] [-O [NSI]]",
"[-P pidfile]", "[-S device]", "[-f device]",
"filename");
exit(1);
@@ -1380,6 +1390,13 @@ FILE *log;
exit(1);
}
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ exit(1);
+ }
+#endif
+
if (ioctl(fd, SIOCIPFFB, &flushed) == 0) {
printf("%d bytes flushed from log buffer\n",
flushed);
@@ -1444,6 +1461,7 @@ char *argv[];
char buf[DEFAULT_IPFLOGSIZE], *iplfile[3], *s;
extern int optind;
extern char *optarg;
+ const char *optstr = "?abB:C:Df:G:FhnN:o:O:pP:sS:tvxXz:";
fd[0] = fd[1] = fd[2] = -1;
fdt[0] = fdt[1] = fdt[2] = -1;
@@ -1451,7 +1469,15 @@ char *argv[];
iplfile[1] = IPNAT_NAME;
iplfile[2] = IPSTATE_NAME;
- while ((c = getopt(argc, argv, "?abB:C:Df:FhnN:o:O:pP:sS:tvxX")) != -1)
+#if SOLARIS
+ /*
+ * We need to set the zone name before calling openlog in
+ * the switch statement below
+ */
+ getzoneopt(argc, argv, optstr);
+#endif
+
+ while ((c = getopt(argc, argv, optstr)) != -1)
switch (c)
{
case 'a' :
@@ -1483,6 +1509,11 @@ char *argv[];
flushlogs(iplfile[1], log);
flushlogs(iplfile[2], log);
break;
+#if SOLARIS
+ case 'G' :
+ /* Already handled by getzoneopt() above */
+ break;
+#endif
case 'n' :
opts |= OPT_RESOLVE;
break;
@@ -1535,6 +1566,11 @@ char *argv[];
case 'X' :
opts |= OPT_HEXHDR;
break;
+#if SOLARIS
+ case 'z' :
+ /* Already handled by getzoneopt() above */
+ break;
+#endif
default :
case 'h' :
case '?' :
@@ -1571,6 +1607,13 @@ char *argv[];
exit(1);
/* NOTREACHED */
}
+
+#if SOLARIS
+ if (setzone(fd[i]) != 0) {
+ close(fd[i]);
+ exit(1);
+ }
+#endif
if (!(regular[i] = !S_ISCHR(sb.st_mode)))
devices++;
}
diff --git a/usr/src/cmd/ipf/tools/ipnat.c b/usr/src/cmd/ipf/tools/ipnat.c
index 4a9a37a4a9..a7e37b0295 100644
--- a/usr/src/cmd/ipf/tools/ipnat.c
+++ b/usr/src/cmd/ipf/tools/ipnat.c
@@ -7,6 +7,8 @@
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -56,6 +58,10 @@
#include "netinet/ipl.h"
#include "kmem.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
#ifdef __hpux
# define nlist nlist64
#endif
@@ -95,7 +101,12 @@ int opts;
void usage(name)
char *name;
{
- fprintf(stderr, "Usage: %s [-CdFhlnrRsv] [-f filename]\n", name);
+ fprintf(stderr, "Usage: %s [-CdFhlnrRsv] [-f filename]", name);
+#if SOLARIS
+ fprintf(stderr, " [-G|-z zonename]\n");
+#else
+ fprintf(stderr, "\n");
+#endif
exit(1);
}
@@ -117,7 +128,7 @@ char *argv[];
kernel = NULL;
mode = O_RDWR;
- while ((c = getopt(argc, argv, "CdFf:hlM:N:nrRsv")) != -1)
+ while ((c = getopt(argc, argv, "CdFf:G:hlM:N:nrRsvz:")) != -1)
switch (c)
{
case 'C' :
@@ -132,6 +143,11 @@ char *argv[];
case 'F' :
opts |= OPT_FLUSH;
break;
+#if SOLARIS
+ case 'G' :
+ setzonename_global(optarg);
+ break;
+#endif
case 'h' :
opts |=OPT_HITS;
break;
@@ -162,6 +178,11 @@ char *argv[];
case 'v' :
opts |= OPT_VERBOSE;
break;
+#if SOLARIS
+ case 'z' :
+ setzonename(optarg);
+ break;
+#endif
default :
usage(argv[0]);
}
@@ -194,6 +215,12 @@ char *argv[];
STRERROR(errno));
exit(1);
}
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ exit(1);
+ }
+#endif
bzero((char *)&obj, sizeof(obj));
obj.ipfo_rev = IPFILTER_VERSION;
diff --git a/usr/src/cmd/ipf/tools/ippool.c b/usr/src/cmd/ipf/tools/ippool.c
index 5f18379420..3eca3e1776 100644
--- a/usr/src/cmd/ipf/tools/ippool.c
+++ b/usr/src/cmd/ipf/tools/ippool.c
@@ -5,6 +5,8 @@
*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -42,6 +44,10 @@
#include "netinet/ip_htable.h"
#include "kmem.h"
+#if SOLARIS
+#include "ipfzone.h"
+#endif
+
extern int ippool_yyparse __P((void));
extern int ippool_yydebug;
extern FILE *ippool_yyin;
@@ -71,15 +77,25 @@ int use_inet6 = 0;
void usage(prog)
char *prog;
{
+#if SOLARIS
+ const char *zoneopt = "[-G|-z zonename] ";
+#else
+ const char *zoneopt = "";
+#endif
fprintf(stderr, "Usage:\t%s\n", prog);
- fprintf(stderr, "\t\t\t-a [-dnv] [-m <name>] [-o <role>] -i <ipaddr>[/netmask]\n");
- fprintf(stderr, "\t\t\t-A [-dnv] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]\n");
- fprintf(stderr, "\t\t\t-f <file> [-dnuv]\n");
- fprintf(stderr, "\t\t\t-F [-dv] [-o <role>] [-t <type>]\n");
- fprintf(stderr, "\t\t\t-l [-dv] [-m <name>] [-t <type>]\n");
- fprintf(stderr, "\t\t\t-r [-dnv] [-m <name>] [-o <role>] -i <ipaddr>[/netmask]\n");
- fprintf(stderr, "\t\t\t-R [-dnv] [-m <name>] [-o <role>] [-t <type>]\n");
- fprintf(stderr, "\t\t\t-s [-dtv] [-M <core>] [-N <namelist>]\n");
+ fprintf(stderr, "\t\t\t-a [-dnv] %s[-m <name>] [-o <role>] -i <ipaddr>[/netmask]\n",
+ zoneopt);
+ fprintf(stderr, "\t\t\t-A [-dnv] %s[-m <name>] [-o <role>] [-S <seed>] [-t <type>]\n",
+ zoneopt);
+ fprintf(stderr, "\t\t\t-f <file> %s[-dnuv]\n", zoneopt);
+ fprintf(stderr, "\t\t\t-F [-dv] %s[-o <role>] [-t <type>]\n", zoneopt);
+ fprintf(stderr, "\t\t\t-l [-dv] %s[-m <name>] [-t <type>]\n", zoneopt);
+ fprintf(stderr, "\t\t\t-r [-dnv] %s[-m <name>] [-o <role>] -i <ipaddr>[/netmask]\n",
+ zoneopt);
+ fprintf(stderr, "\t\t\t-R [-dnv] %s[-m <name>] [-o <role>] [-t <type>]\n",
+ zoneopt);
+ fprintf(stderr, "\t\t\t-s [-dtv] %s[-M <core>] [-N <namelist>]\n",
+ zoneopt);
exit(1);
}
@@ -140,13 +156,20 @@ char *argv[];
role = IPL_LOGIPF;
bzero((char *)&node, sizeof(node));
- while ((c = getopt(argc, argv, "di:m:no:Rv")) != -1)
+ while ((c = getopt(argc, argv, "di:G:m:no:Rvz:")) != -1)
switch (c)
{
case 'd' :
opts |= OPT_DEBUG;
ippool_yydebug++;
break;
+ case 'G' :
+#if SOLARIS
+ setzonename_global(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
case 'i' :
s = strchr(optarg, '/');
if (s == NULL)
@@ -182,6 +205,13 @@ char *argv[];
case 'v' :
opts |= OPT_VERBOSE;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
if (opts & OPT_DEBUG)
@@ -219,13 +249,19 @@ char *argv[];
bzero((char *)&iph, sizeof(iph));
bzero((char *)&pool, sizeof(pool));
- while ((c = getopt(argc, argv, "dm:no:RS:t:v")) != -1)
+ while ((c = getopt(argc, argv, "dG:m:no:RS:t:vz:")) != -1)
switch (c)
{
case 'd' :
opts |= OPT_DEBUG;
ippool_yydebug++;
break;
+ case 'G' :
+#if SOLARIS
+ setzonename_global(optarg);
+#else
+ usage(argv[0]);
+#endif
case 'm' :
poolname = optarg;
break;
@@ -255,6 +291,13 @@ char *argv[];
case 'v' :
opts |= OPT_VERBOSE;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
if (opts & OPT_DEBUG)
@@ -308,13 +351,20 @@ char *argv[], *infile;
infile = optarg;
- while ((c = getopt(argc, argv, "dnRuv")) != -1)
+ while ((c = getopt(argc, argv, "dG:nRuvz:")) != -1)
switch (c)
{
case 'd' :
opts |= OPT_DEBUG;
ippool_yydebug++;
break;
+ case 'G' :
+#if SOLARIS
+ setzonename_global(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
case 'n' :
opts |= OPT_DONOTHING;
break;
@@ -327,6 +377,13 @@ char *argv[], *infile;
case 'v' :
opts |= OPT_VERBOSE;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
if (opts & OPT_DEBUG)
@@ -338,6 +395,12 @@ char *argv[], *infile;
perror("open(IPLOOKUP_NAME)");
exit(1);
}
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ exit(1);
+ }
+#endif
}
if (ippool_parsefile(fd, infile, ioctl) != 0)
@@ -365,12 +428,19 @@ char *argv[];
poolname = NULL;
role = IPL_LOGALL;
- while ((c = getopt(argc, argv, "dm:M:N:o:Rt:v")) != -1)
+ while ((c = getopt(argc, argv, "dG:m:M:N:o:Rt:vz:")) != -1)
switch (c)
{
case 'd' :
opts |= OPT_DEBUG;
break;
+ case 'G' :
+#if SOLARIS
+ setzonename_global(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
case 'm' :
poolname = optarg;
break;
@@ -402,6 +472,13 @@ char *argv[];
case 'v' :
opts |= OPT_VERBOSE;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
if (opts & OPT_DEBUG)
@@ -413,6 +490,12 @@ char *argv[];
perror("open(IPLOOKUP_NAME)");
exit(1);
}
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ exit(1);
+ }
+#endif
}
bzero((char *)&op, sizeof(op));
@@ -615,12 +698,19 @@ char *argv[];
bzero((char *)&op, sizeof(op));
- while ((c = getopt(argc, argv, "dM:N:o:t:v")) != -1)
+ while ((c = getopt(argc, argv, "dG:M:N:o:t:vz:")) != -1)
switch (c)
{
case 'd' :
opts |= OPT_DEBUG;
break;
+ case 'G' :
+#if SOLARIS
+ setzonename_global(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
case 'M' :
live_kernel = 0;
core = optarg;
@@ -647,6 +737,13 @@ char *argv[];
case 'v' :
opts |= OPT_VERBOSE;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
if (opts & OPT_DEBUG)
@@ -658,6 +755,12 @@ char *argv[];
perror("open(IPLOOKUP_NAME)");
exit(1);
}
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ exit(1);
+ }
+#endif
}
if (type == IPLT_ALL || type == IPLT_POOL) {
@@ -705,7 +808,7 @@ char *argv[];
type = IPLT_ALL;
role = IPL_LOGALL;
- while ((c = getopt(argc, argv, "do:t:v")) != -1)
+ while ((c = getopt(argc, argv, "do:t:vz:")) != -1)
switch (c)
{
case 'd' :
@@ -728,6 +831,13 @@ char *argv[];
case 'v' :
opts |= OPT_VERBOSE;
break;
+ case 'z' :
+#if SOLARIS
+ setzonename(optarg);
+#else
+ usage(argv[0]);
+#endif
+ break;
}
if (opts & OPT_DEBUG)
@@ -739,6 +849,12 @@ char *argv[];
perror("open(IPLOOKUP_NAME)");
exit(1);
}
+#if SOLARIS
+ if (setzone(fd) != 0) {
+ close(fd);
+ exit(1);
+ }
+#endif
}
bzero((char *)&flush, sizeof(flush));
diff --git a/usr/src/cmd/krb5/kadmin/Makefile b/usr/src/cmd/krb5/kadmin/Makefile
index de893f05a4..8d0dbdc93f 100644
--- a/usr/src/cmd/krb5/kadmin/Makefile
+++ b/usr/src/cmd/krb5/kadmin/Makefile
@@ -25,7 +25,7 @@
include ../../Makefile.cmd
-SUBDIRS= cli dbutil ktutil kpasswd server kclient kdcmgr gui
+SUBDIRS= cli dbutil ktutil kpasswd server kclient kdcmgr
all := TARGET= all
clean := TARGET= clean
diff --git a/usr/src/cmd/ksh/Makefile.com b/usr/src/cmd/ksh/Makefile.com
index 8716f4eb9d..e5615cb407 100644
--- a/usr/src/cmd/ksh/Makefile.com
+++ b/usr/src/cmd/ksh/Makefile.com
@@ -36,11 +36,13 @@ LIBSHELLBASE=../../../lib/libshell
LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
SRCS= $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
+OBJS= $(OBJECTS)
LDLIBS += -lshell
# Set common AST build flags (e.g., needed to support the math stuff).
include ../../../Makefile.ast
+include ../../Makefile.ctf
# 1. Make sure that the -D/-U defines in CFLAGS below are in sync
# with usr/src/lib/libshell/Makefile.com
diff --git a/usr/src/cmd/localedef/Makefile b/usr/src/cmd/localedef/Makefile
index 4b012d0c45..ad0a46f5ed 100644
--- a/usr/src/cmd/localedef/Makefile
+++ b/usr/src/cmd/localedef/Makefile
@@ -13,6 +13,7 @@
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Copyright 2011 EveryCity Ltd. All rights reserved.
# Copyright 2013 DEY Storage Systems, Inc.
+# Copyright 2012 Joyent, Inc. All rights reserved.
#
PROG=localedef
@@ -51,13 +52,13 @@ POFILE = localedef_cmd.po
ISO8859_1_LOCALES = \
da_DK \
- de_CH \
+ de_CH de_DE \
en_AU en_CA en_GB en_NZ en_US \
- es_AR es_BO es_CL es_CO es_EC es_GT es_MX es_NI es_PA \
+ es_AR es_BO es_CL es_CO es_EC es_ES es_GT es_MX es_NI es_PA \
es_PE es_SV es_UY es_VE \
- fr_CA fr_CH \
+ fr_CA fr_CH fr_FR \
is_IS \
- it_CH \
+ it_CH it_IT \
sv_SE
ISO8859_2_LOCALES = \
@@ -275,8 +276,11 @@ locale/%.UTF-8/stamp: data/%.UTF-8.src UTF-8.cm \
$(SED) '/^LC_CTYPE/,/^END LC_CTYPE/d;$$r UTF-8.ct' $< | \
./$(PROG) -U -w data/widths.txt -f UTF-8.cm $(@D)
$(TOUCH) $@
+# Convert EURO_SIGN to CURRENCY_SIGN for the ISO8859-1 locales
locale/%.ISO8859-1/stamp: data/%.UTF-8.src 8859-1.cm locale $(PROG)
- ./$(PROG) -U -w data/widths.txt -i $< -f 8859-1.cm $(@D)
+ sed 's/EURO_SIGN/CURRENCY_SIGN/' $< > $<.tmp
+ ./$(PROG) -U -w data/widths.txt -i $<.tmp -f 8859-1.cm $(@D)
+ rm -f $<.tmp
$(TOUCH) $@
locale/%.ISO8859-2/stamp: data/%.UTF-8.src 8859-2.cm locale $(PROG)
./$(PROG) -U -w data/widths.txt -i $< -f 8859-2.cm $(@D)
diff --git a/usr/src/cmd/lofiadm/main.c b/usr/src/cmd/lofiadm/main.c
index 0fc494943e..d93edd1ea9 100644
--- a/usr/src/cmd/lofiadm/main.c
+++ b/usr/src/cmd/lofiadm/main.c
@@ -150,7 +150,7 @@ lofi_compress_info_t lofi_compress_table[LOFI_COMPRESS_FUNCTIONS] = {
#define KILOBYTE 1024
#define MEGABYTE (KILOBYTE * KILOBYTE)
#define GIGABYTE (KILOBYTE * MEGABYTE)
-#define LIBZ "libz.so"
+#define LIBZ "libz.so.1"
static void
usage(const char *pname)
@@ -348,7 +348,8 @@ out:
* DO NOT use this function if the filename is actually the device name.
*/
static int
-lofi_map_file(int lfd, struct lofi_ioctl li, const char *filename)
+lofi_map_file(int lfd, struct lofi_ioctl li, const char *filename,
+ boolean_t no_devlink_flag)
{
int minor;
@@ -361,7 +362,8 @@ lofi_map_file(int lfd, struct lofi_ioctl li, const char *filename)
"unsupported"));
die(gettext("could not map file %s"), filename);
}
- wait_until_dev_complete(minor);
+ if (!no_devlink_flag)
+ wait_until_dev_complete(minor);
return (minor);
}
@@ -371,7 +373,8 @@ lofi_map_file(int lfd, struct lofi_ioctl li, const char *filename)
*/
static void
add_mapping(int lfd, const char *devicename, const char *filename,
- mech_alias_t *cipher, const char *rkey, size_t rksz, boolean_t rdonly)
+ mech_alias_t *cipher, const char *rkey, size_t rksz,
+ boolean_t rdonly, boolean_t no_devlink_flag)
{
struct lofi_ioctl li;
@@ -407,7 +410,7 @@ add_mapping(int lfd, const char *devicename, const char *filename,
int minor;
/* pick one via the driver */
- minor = lofi_map_file(lfd, li, filename);
+ minor = lofi_map_file(lfd, li, filename, no_devlink_flag);
/* if mapping succeeds, print the one picked */
(void) printf("/dev/%s/%d\n", LOFI_BLOCK_NAME, minor);
return;
@@ -428,7 +431,8 @@ add_mapping(int lfd, const char *devicename, const char *filename,
die(gettext("could not map file %s to %s"), filename,
devicename);
}
- wait_until_dev_complete(li.li_minor);
+ if (!no_devlink_flag)
+ wait_until_dev_complete(li.li_minor);
}
/*
@@ -1310,7 +1314,7 @@ lofi_uncompress(int lfd, const char *filename)
if (statbuf.st_size == 0)
return;
- minor = lofi_map_file(lfd, li, filename);
+ minor = lofi_map_file(lfd, li, filename, B_FALSE);
(void) snprintf(devicename, sizeof (devicename), "/dev/%s/%d",
LOFI_BLOCK_NAME, minor);
@@ -1816,6 +1820,7 @@ main(int argc, char *argv[])
boolean_t ephflag = B_FALSE;
boolean_t compressflag = B_FALSE;
boolean_t uncompressflag = B_FALSE;
+ boolean_t no_devlink_flag = B_FALSE;
/* the next two work together for -c, -k, -T, -e options only */
boolean_t need_crypto = B_FALSE; /* if any -c, -k, -T, -e */
boolean_t cipher_only = B_TRUE; /* if -c only */
@@ -1831,7 +1836,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "a:c:Cd:efk:o:rs:T:U")) != EOF) {
+ while ((c = getopt(argc, argv, "a:c:Cd:efk:o:rs:T:UX")) != EOF) {
switch (c) {
case 'a':
addflag = B_TRUE;
@@ -1909,6 +1914,13 @@ main(int argc, char *argv[])
case 'U':
uncompressflag = B_TRUE;
break;
+ case 'X':
+ /*
+ * Private flag to skip the wait for the /dev links to
+ * be created.
+ */
+ no_devlink_flag = B_TRUE;
+ break;
case '?':
default:
errflag = B_TRUE;
@@ -2037,7 +2049,7 @@ main(int argc, char *argv[])
*/
if (addflag)
add_mapping(lfd, devicename, filename, cipher, rkey, rksz,
- rdflag);
+ rdflag, no_devlink_flag);
else if (compressflag)
lofi_compress(&lfd, filename, compress_index, segsize);
else if (uncompressflag)
diff --git a/usr/src/cmd/lp/terminfo/40.ti b/usr/src/cmd/lp/terminfo/40.ti
new file mode 100644
index 0000000000..2e08ece1ca
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/40.ti
@@ -0,0 +1,68 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */
+
+######################################################################
+#
+# Entries for the AT&T Model 40 line printers
+#
+
+
+
+40-80-6|att40-80-6|AT&T Model 40 line printer 80 cloumn 6 line per inch,
+
+ daisy,
+ bufsz#160,
+ cols#80,
+ lines#66,
+ orc#1,
+ orhi#10,
+ orl#1,
+ orvi#6,
+ cps#400,
+
+ cr=^M,
+ cuf1=\s,
+ ff=^L,
+
+40-80-8|att40-80-8|AT&T Model 40 line printer 80 cloumn 8 line per inch,
+
+ lines#88,
+ orvi#8,
+ use=40-80-6,
+
+40-132-6|att40-132-6|AT&T Model 40 line printer 132 cloumn 6 line per inch,
+
+ bufsz#264,
+ cols#132,
+ use=40-80-6,
+
+40-132-8|att40-132-8|AT&T Model 40 line printer 132 cloumn 8 line per inch,
+
+ lines#88,
+ orvi#8,
+ use=40-132-6,
+
diff --git a/usr/src/cmd/lp/terminfo/44x.ti b/usr/src/cmd/lp/terminfo/44x.ti
new file mode 100644
index 0000000000..d932bf441e
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/44x.ti
@@ -0,0 +1,57 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+
+######################################################################
+#
+# Entries for the AT&T 440 seris line printers
+#
+
+
+442|att442|AT&T 442 line printer,
+
+ bufsz#2048,
+ cols#132,
+ lines#66,
+ orc#1,
+ orhi#10,
+ orl#1,
+ orvi#6,
+ cps#440,
+
+ cr=^M,
+ cuf1=\s,
+ ff=^L,
+
+444|att444|AT&T 444 line printer,
+
+ use=442,
+
+446|att446|AT&T 446 line printer,
+
+ cps#1100,
+ use=442,
+
diff --git a/usr/src/cmd/lp/terminfo/45x.ti b/usr/src/cmd/lp/terminfo/45x.ti
new file mode 100644
index 0000000000..e4a6c5ab92
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/45x.ti
@@ -0,0 +1,42 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+
+######################################################################
+#
+# Entries for the AT&T 455, 457, 459 printers
+#
+
+455|att455|AT&T 455 Daisywheel printer,
+
+ use=Gdaisy+basic,
+
+457|att457|458|att458|AT&T 457 Daisy printer,
+
+ bufsz#1024,
+ use=455,
+
+
diff --git a/usr/src/cmd/lp/terminfo/477.ti b/usr/src/cmd/lp/terminfo/477.ti
new file mode 100644
index 0000000000..51b808b2ce
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/477.ti
@@ -0,0 +1,181 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.7 */
+
+######################################################################
+#
+# Entries for the AT&T 477 printer
+#
+
+#
+# Basic capabilities (all emulations):
+#
+att477+basic1,
+
+ bufsz#8192,
+ cps#80,
+
+######################################################################
+#
+# Particular printers:
+#
+
+477-470|att477-470|AT&T 477; 470 emulation,
+
+ cols#136,
+ cpix,
+
+ orc#10,
+ orhi#100,
+ orl#30,
+ orvi#180,
+
+ csnm=%?%p1%{0}%=%tamerican%e%p1%{1}%=%tbritish%e%p1%{2}%=%tswedish%e%p1%{3}%=%tgerman%e%p1%{4}%=%tfrench%e%p1%{5}%=%titalian%e%p1%{6}%=%tspanish%;,
+ scs=%?%p1%{0}%=%t\EZ^O@\ED^B@%e%p1%{1}%=%t\EZ^O@\ED^C@%e%p1%{2}%=%t\EZ^O@\ED^E@%e%p1%{3}%=%t\EZ^O@\ED^D@%e%p1%{4}%=%t\EZ^O@\ED^A@%e%p1%{5}%=%t\EZ^O@\ED^F@%e%p1%{6}%=%t\EZ^O@\ED^G@%;,
+
+ use=470,
+
+477ibmc|att477ibmc|AT&T 477 IBM Color printer emulation,
+
+ cols#135,
+
+ orc#15,
+ orhi#150,
+
+ orl#10,
+ orvi#60,
+
+ cvr=%?%p1%{0}%>%p1%{256}%<%&%t\EA%p1%c\E2%;
+
+ cpi=%?%p1%{10}%=%t^R%e%p1%{12}%=%t\E:%e%p1%{17}%=%t^O%;,
+
+
+ smglp=\EX%p1%{1}%+%c%p2%{2}%+%c,
+ smgt=\E4,
+
+
+ use=att477+basic1, use=Gibmc+basic, use=Gibmc+low+5x6,
+ use=Gibmc+color,
+
+477ibmg|att477ibmg|AT&T 477 IBM Graphics printer emulation,
+
+ cols#136,
+
+ orc#10,
+ orhi#100,
+ orl#10,
+ orvi#60,
+
+ is2=\E@,
+
+ smglp=%?%p1%{256}%<%t\El%p1%{1}%+%c,
+ smgrp=%?%p1%{256}%<%t\EQ%p1%{2}%+%c,
+
+
+ use=att477+basic1, use=Gibmg+basic, use=Gibmg+low,
+
+477qume|att477qume|477-455|att477-455|AT&T 477 qume emulation,
+
+
+ cols#136,
+
+
+ is2=\E\rP\EW\E.\EL08\EY,
+
+ use=att477+basic1, use=Gdaisy+basic, use=Gdaisy+lowres,
+
+######################################################################
+#
+# In Fujitsu DPL24C mode. This seems to be more like the Epson LQ-2500
+# than the IBM Proprinter XL.
+#
+
+#
+# Basic capabilities (Fujitsu emulation only):
+#
+att477+basic2,
+
+ orc#18,
+ orhi#180,
+ orl#30,
+ orvi#180,
+
+
+#
+# The following is not redundant with the cpi capability, because
+# the cpi changes the character size as well, so that printing
+# looks balanced, while this leaves the character size alone.
+ chr=%?%p1%{256}%<%t\Eh%p1%c%;,
+
+
+ is2=\E@,
+
+ csnm=%?%p1%{0}%=%tcharacter_set_1%e%p1%{1}%=%tcharacter_set_2%e%p1%{2}%=%tusa%e%p1%{3}%=%tfrench%e%p1%{4}%=%tgerman%e%p1%{5}%=%tuk%e%p1%{6}%=%tdanish%e%p1%{7}%=%tswedish%e%p1%{8}%=%titalian%e%p1%{9}%=%tspanish%;,
+ scs=%?%p1%{0}%=%t\E7%e%p1%{1}%=%t\E6%e%p1%{3}%=%t\ER0%e%p1%{3}%=%t\ER1%e%p1%{4}%=%t\ER2%e%p1%{5}%=%t\ER3%e%p1%{6}%=%t\ER4%e%p1%{7}%=%t\ER5%e%p1%{8}%=%t\ER6%e%p1%{9}%=%t\ER7%;,
+
+
+477-5x6|att477-5x6|AT&T 477 as Fujitsu DPL24C; 5:6 aspect ratio,
+
+ spinh#50,
+
+# defbi=
+# Like the defbi for the epson2500, except:
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 50 dots per inch horizontally this means 5
+# dots per character.
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\E3\030^R\EP\EB%p2%{8}%/%c$<>\ED%p1%{6}%/%c$<>\013\r\t%;,
+
+#
+# Note that the epson2500 drives a real Epson LQ-2500 at
+# 60 dots per inch horizontally; the same control sequences
+# drive the Fujitsu DPL24C at 50 dots per inch horixontally.
+ use=att477+basic1, use=att477+basic2, use=Gep2500+basic,
+ use=Gep2500+low, use=Gep2500+color,
+
+477|att477|AT&T 477 as Fujitsu DPL24C; 1:1; low res,
+
+ is1@,
+
+#
+# This mode differs from the 5x6 mode only in sbim and defbi
+# (and spinh, of course). However, it is even closer to the
+# epson2500, so we use that.
+
+ sdrfq=\EH,
+ snlq=\EG,
+ snrmq@,
+
+ sbim=\E*\005%p1%{256}%m%c%p1%{256}%/%c,
+
+ use=att477+basic1, use=att477+basic2, use=Gep2500+basic,
+ use=Gep2500+low, use=Gep2500+color,
+
+477-hi|att477-hi|AT&T 477 as Fujitsu DPL24C; 1:1; high res,
+
+ use=att477+basic1, use=att477+basic2, use=Gep2500+basic,
+ use=Gep2500+high, use=Gep2500+color,
diff --git a/usr/src/cmd/lp/terminfo/47x.ti b/usr/src/cmd/lp/terminfo/47x.ti
new file mode 100644
index 0000000000..a5db8850de
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/47x.ti
@@ -0,0 +1,134 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Entries for the AT&T 470, 471, 473, 474, 475, 476, 478, 479 printers
+#
+
+#
+# C.Itoh derived printers:
+#
+
+470|att470|AT&T 470; C.Itoh 8510; 8"; parallel matrix printer,
+
+ bufsz#4096,
+
+ cols#80,
+ cpix,
+
+ sdrfq@,
+ snlq@,
+ snrmq@,
+ ssubm@,
+ ssupm@,
+ rsubm@,
+ rsupm@,
+
+ sgr0=\E"\EY,
+
+# Reset command does not reset form length
+
+ is2=\Ec1\Ev66,
+
+ csnm=%?%p1%{0}%=%tusa%e%p1%{1}%=%tbritish%e%p1%{2}%=%tdanish%e%p1%{3}%=%tjapanese%e%p1%{4}%=%tnorwegian%e%p1%{5}%=%tswedish%e%p1%{6}%=%tgerman%e%p1%{7}%=%tfrench%e%p1%{8}%=%tfrench2%e%p1%{9}%=%titalian%e%p1%{10}%=%tspanish%e%p1%{11}%=%tnetherland%e%p1%{12}%=%tafrikaans%e%p1%{13}%=%tbritish2%;,
+ scs=%?%p1%{0}%=%t\EZ^O@\ED^B@%e%p1%{1}%=%t\EZ^O@\ED^C@%e%p1%{2}%=%t\EZ^O@\ED\b@%e%p1%{3}%=%t\EZ^O@%e%p1%{4}%=%t\EZ^O@\ED\t@%e%p1%{5}%=%t\EZ^O@\ED^E@%e%p1%{6}%=%t\EZ^O@\ED^D@%e%p1%{7}%=%t\EZ^O@\ED^A@%e%p1%{8}%=%t\EZ^O@\ED^N@%e%p1%{9}%=%t\EZ^O@\ED^F@%e%p1%{10}%=%t\EZ^O@\ED^G@%e%p1%{11}%=%t\EZ^O@\ED\n@%e%p1%{12}%=%t\EZ^O@\ED^K@%e%p1%{13}%=%t\ED^O@%;,
+
+
+ use=Gcitoh+basic, use=Gcitoh+low,
+
+471|att471|AT&T 471; C.Itoh 1550; 14"; parallel matrix printer,
+
+ cols#136,
+
+ use=470,
+
+475|att475|AT&T 475; C.Itoh 8510; 8"; serial matrix printer,
+
+ use=470,
+
+476|att476|AT&T 475; C.Itoh 1550; 14"; serial matrix printer,
+
+ use=471,
+
+#
+# IBM derived printers:
+#
+
+473|att473|AT&T 473; 8"; C.Itoh 8510EP; IBM Graphics,
+
+ bufsz#4096,
+ cps#120,
+
+#
+# FIX: The AT&T 473 doesn't seem to have fine-scale horizontal
+# motion--the only motion is by columns.
+ orc#10,
+ orhi#100,
+
+
+
+
+ use=Gibmg+basic, use=Gibmg+low,
+
+474|att474|AT&T 474; 14"; C.Itoh 1550EP; IBM Graphics,
+
+ cols#132,
+
+ use=473,
+
+478|att478|AT&T 478; 8"; parallel matrix printer,
+
+ bufsz#16384,
+ cps#120,
+
+#
+# FIX: The AT&T 478 doesn't seem to have fine-scale horizontal
+# motion--the only motion is by columns.
+ orc#10,
+ orhi#100,
+
+ cpi=%?%p1%{10}%=%t^R%e%p1%{12}%=%t\E:%e%p1%{13}%=%p1%{14}%=%O%t\Eh%e%p1%{16}%=%p1%{17}%=%O%t\Em%e%p1%{18}%=%t^O%;,
+
+ is2=^R\EW0\E-0\E_0\EF\EH\EI\ET\EA\014\E2\ER\El\001\Er\120\Et\001\EC\102\E7\EU0\EO,
+
+ sdrfq=\EI^D,
+ snlq=\EI^B,
+
+ smglp=\El%{1}%p1%+%c,
+ smgrp=\Er%{1}%p1%+%c,
+ smgtp=\Et%{1}%p1%+%c,
+
+ use=Gibmg+basic, use=Gibmg+low,
+
+479|att479|AT&T 479; 14"; IBM parallel; matrix printer,
+
+ cols#132,
+ is2=^R\EW0\E-0\E_0\EF\EH\EI\004\ET\EA\014\E2\ER\El\001\Er\204\Et\001\EC\102\E7\EU0\EO,
+
+
+ use=478,
diff --git a/usr/src/cmd/lp/terminfo/495.ti b/usr/src/cmd/lp/terminfo/495.ti
new file mode 100644
index 0000000000..562c62b6be
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/495.ti
@@ -0,0 +1,78 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+
+######################################################################
+#
+# Entries for the AT&T 495 printer
+#
+
+495ibm|att495ibm|AT&T 495 IBM Graphics emulation,
+
+ bufsz#1024,
+ cps#800,
+
+
+ orc#12,
+ orhi#120,
+
+ lines#63,
+
+ cpi=%?%p1%{10}%=%t^R%e%p1%{17}%=%t^O%;,
+
+# Reset defaults, enter IBM Graphics emulation mode
+ is2=\E[0~\E[12~,
+
+ use=Gibmg+basic, use=Gibmg+low,
+
+495qume|att495qume|AT&T 495 Qume emulation,
+
+ daisy@,
+
+ bufsz#1024,
+ cps#800,
+
+ cols#80,
+ lines#63,
+
+
+ chr=%?%p1%{0}%>%p1%{127}%<%&%t\E^_%p1%{1}%+%c%;,
+ cvr=%?%p1%{0}%>%p1%{127}%<%&%t\E^^%p1%{1}%+%c%;,
+
+ is2=\E[0~\E[11~\E^_\r,
+
+ u9=%?%p1%{128}%<%t\EF%p1%02d%;,
+
+ use=Gdaisy+basic, use=Gdaisy+lowres,
+
+495hp|att495hp|AT&T 495 HP Laserjet I emulation,
+
+ bufsz#1024,
+ cps#800,
+
+ is2=\E[0~\E[10~\E&k0S,
+
+ use=Ghplaser+basic, use=Ghplaser+high,
diff --git a/usr/src/cmd/lp/terminfo/53x0.ti b/usr/src/cmd/lp/terminfo/53x0.ti
new file mode 100644
index 0000000000..fc6fb2cef9
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/53x0.ti
@@ -0,0 +1,81 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Entries for the AT&T 5310, 5320 printers
+#
+
+53x0+high,
+
+ spinv#72,
+ spinh#150,
+
+ bitwin#2,
+ u1=2,
+
+# defbi=
+# X is in 1/150 increments; set char spacing to 1/16.7
+# increments to allow us to get close; column is X*16.7/150.
+# Y is in 1/144 increments; set line spacing to 1/12
+# increments to allow us to get close; line is Y/12.
+# Note: The 5310/5320 won't move upward with the absolute
+# addressing control sequence, so we use the relative motion.
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\E[4w\E[%p1%{167}%*%{1500}%/%d`\E[w\E[3z\E[%p2%{12}%/%de\E[z\EP\035q%;,
+ defbi=%?%p5%{1}%=%t\E[4w\E[%p1%{167}%*%{1500}%/%d`\E[w\E[3z\E[%p2%{12}%/%de\E[z\EP\035q%;,
+
+ use=Gdec+low,
+
+5320|att5320|AT&T Model 5320 printer (EMUL set to ANSI),
+
+ bufsz#8192,
+ cps#120,
+
+
+#
+# FIX: The AT&T 5320 doesn't seem to have fine-scale horizontal
+# motion--the only motion is by columns.
+ orc#10,
+ orhi#100,
+
+#
+# FIX: The AT&T 5320 seems to only have half-line vertical motion
+# at best.
+ orl#12,
+ orvi#72,
+
+
+
+ use=53x0+high, use=Gdec+basic, use=Gdec+low,
+
+5310|att5310|AT&T 5310 matrix printer (EMUL set to ANSI),
+
+ cols#80,
+
+ use=5320,
diff --git a/usr/src/cmd/lp/terminfo/57x.ti b/usr/src/cmd/lp/terminfo/57x.ti
new file mode 100644
index 0000000000..677090111e
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/57x.ti
@@ -0,0 +1,105 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Entries for the AT&T 570 series printers
+#
+
+570eps|att570eps|AT&T 570 Epson emulation,
+
+ bufsz#10000,
+ cps#250,
+ cols#80,
+ orl#36,
+ orvi#216,
+
+ use=Gepson+basic,
+ use=Gepson+low,
+
+570ibm|att570ibm|AT&T 570 IBM ProPrinter emulation,
+
+ bufsz#10000,
+ cps#250,
+
+ use=Gibmg+basic,
+ use=Gibmg+low,
+
+571eps|att571eps|AT&T 571 Epson emulation,
+
+ cols#136,
+
+ use=570eps,
+
+571ibm|att571ibm|AT&T 571 IBM ProPrinter emulation,
+
+ cols#136,
+ use=570ibm,
+
+572|att572|AT&T 572 9-wire Matrix Printer,
+
+ bufsz#10000,
+ cps#250,
+ cols#80,
+ xhpa@,
+ xvpa@,
+
+ csnm=%?%p1%{0}%=%tusascii%e%p1%{1}%=%tbritish%e%p1%{2}%=%tfinnish%e%p1%{3}%=%tjapanese%e%p1%{4}%=%tnorwegian%e%p1%{5}%=%tswedish%e%p1%{6}%=%tgerman%e%p1%{7}%=%tfrench%e%p1%{8}%=%tfrench_canadian%e%p1%{9}%=%titalian%e%p1%{10}%=%tspanish%e%p1%{11}%=%tline_drawing%e%p1%{12}%=%tdanish%e%p1%{13}%=%tebcdic%e%p1%{14}%=%tmulti_national%;,
+ scs=%?%p1%{0}%=%t\E(B%e%p1%{1}%=%t\E(A%e%p1%{2}%=%t\E(C%e%p1%{3}%=%t\E(J%e%p1%{4}%=%t\E(E%e%p1%{5}%=%t\E(H%e%p1%{6}%=%t\E(K%e%p1%{7}%=%t\E(R%e%p1%{8}%=%t\E(Q%e%p1%{9}%=%t\E(Y%e%p1%{10}%=%t\E(Z%e%p1%{11}%=%t\E(O%e%p1%{12}%=%t\E(E%e%p1%{13}%=%t\E(3%e%p1%{14}%=%t\E(<%;,
+
+ is3=\E[0"z,
+
+ snlq=\E[2"z,
+ snrmq=\E[3"z,
+ sdrfq=\E[0"z,
+ sshm=\E[1m,
+ rshm=\E[22m,
+ smul=\E[4m,
+ rmul=\E[24m,
+
+# The following are not supported by 572/573
+
+ smgbp@,
+ smgtp@,
+ smglp@,
+ smgrp@,
+ cud@,
+ cuf@,
+ cuu1@,
+ hpa@,
+ vpa@,
+ nel@,
+
+ use=Gdec+basic,
+ use=Gdec+low,
+
+573|att573|AT&T 573 9-wire Matrix Printer,
+
+ cols#132,
+
+ use=572,
diff --git a/usr/src/cmd/lp/terminfo/58x.ti b/usr/src/cmd/lp/terminfo/58x.ti
new file mode 100644
index 0000000000..bd5b65c663
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/58x.ti
@@ -0,0 +1,103 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Generic entry:
+#
+
+att583+basic,
+
+ bufsz#16384,
+ cps#200,
+
+######################################################################
+#
+# Specific printers:
+#
+
+583ibm|att583ibm|AT&T 583 as IBM Proprinter XL,
+
+ cols#136,
+ is3=\EX\210,
+
+ use=att583+basic, use=Gibmxl+basic, use=Gibmxl+low+5x6, use=Gibmc+color,
+
+
+583ibm-80|att583ibm-80|AT&T 583 as IBM Proprinter XL;80-col,
+
+ use=att583+basic, use=Gibmxl+basic, use=Gibmxl+low+5x6, use=Gibmc+color,
+
+
+583eps|att583eps|AT&T 583 as Epson LQ-2500; low resolution,
+
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+low, use=Gep2500+color,
+
+583eps-hi|att583eps-hi|AT&T 583 as Epson LQ-2500; high resolution,
+
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+high, use=Gep2500+color,
+
+583eps-80|att583eps-80|AT&T 583 as Epson LQ-2500; low resolution; 80-col,
+
+ cols#80,
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+low, use=Gep2500+color,
+
+583eps-hi-80|att583eps-hi-80|AT&T 583 as Epson LQ-2500; high resolution; 80-col,
+
+ cols#80,
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+high, use=Gep2500+color,
+
+
+580ibm|att580ibm|AT&T 580 as IBM Proprinter XL,
+
+ use=att583+basic, use=Gibmxl+basic, use=Gibmxl+low+5x6,
+
+581ibm|att581ibm|AT&T 581 as IBM Proprinter XL,
+
+ cols#136,
+ is3=\EX\210,
+
+ use=580ibm,
+
+
+581eps|att581eps|AT&T 581 as Epson LQ-2500; low resolution,
+
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+low,
+
+581eps-hi|att581eps-hi|AT&T 581 as Epson LQ-2500; high resolution,
+
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+high,
+
+580eps|att580eps|AT&T 580 as Epson LQ-2500; low resolution,
+
+ cols#80,
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+low,
+
+580eps-hi|att580eps-hi|AT&T 580 as Epson LQ-2500; high resolution,
+
+ cols#80,
+ use=att583+basic, use=Gep2500+basic, use=Gep2500+high,
diff --git a/usr/src/cmd/lp/terminfo/593.ti b/usr/src/cmd/lp/terminfo/593.ti
new file mode 100644
index 0000000000..3d2a592c47
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/593.ti
@@ -0,0 +1,73 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Entries for the AT&T 593 printer
+#
+
+593eps|att593eps|AT&T 593 Epson FX86e emulation,
+
+ bufsz#2000,
+ cps#480,
+ cols#80,
+ lines#62,
+ orl#36,
+ orvi#216,
+
+# Only letter quality for laser printer
+ snlq@,
+ snrmq@,
+ sdrfq@,
+
+ use=Gep2500+basic,
+ use=Gepson+low,
+
+593ibm|att593ibm|AT&T 593 IBM ProPrinter XL emulation,
+
+ bufsz#2000,
+ cps#480,
+
+ lines#62,
+
+# Only letter quality for laser printer
+ snlq@,
+ sdrfq@,
+
+ smglp=\EX%p1%{1}%+%c%p2%{1}%+%c,
+
+ use=Gibmxl+basic,
+ use=Gibmxl+low+1x1,
+
+
+593hp|att593hp|AT&T 593 HP Laserjet II emulation,
+
+ bufsz#2000,
+ cps#480,
+
+
+ use=Ghplaser+II,
diff --git a/usr/src/cmd/lp/terminfo/Makefile b/usr/src/cmd/lp/terminfo/Makefile
new file mode 100644
index 0000000000..b94f821b6b
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/Makefile
@@ -0,0 +1,77 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# cmd/lp/terminfo/Makefile
+#
+
+include ../Makefile.lp
+
+ROOTTERMINFO = $(ROOT)/usr/share/lib/terminfo
+
+TIC = tic
+
+SRCS = PS.ti 40.ti 477.ti 53x0.ti 593.ti daisy.ti hplaser.ti \
+ 44x.ti 47x.ti 57x.ti dec.ti ibm.ti 45x.ti 495.ti \
+ 58x.ti citoh.ti epson.ti unknown.ti
+
+
+TMPSRC = terminfo.src
+
+DIRMODE= 755
+FILEMODE= 644
+
+.KEEP_STATE:
+
+all : $(TMPSRC)
+
+$(TMPSRC) : $(SRCS)
+ $(RM) $@; cat $(SRCS) > $@
+
+#
+# Since all entries are created at once, we simply choose one of the
+# target files and assume everything will be made at one time. This
+# has holes (like if somebody removes P/PSR but not P/PS), but those
+# are the breaks.
+#
+install : all $(ROOTTERMINFO) $(ROOTTERMINFO)/P/PS
+
+$(ROOTTERMINFO)/P/PS: $(TMPSRC)
+ TERMINFO=$(ROOTTERMINFO) 2>&1 $(TIC) -v $(TMPSRC) > errs
+ @$(ECHO) "\n`2>/dev/null cat errs|wc -l` entries have been compiled\n"
+ @-( 2>/dev/null cat errs|grep -iv "^mkdir"|grep -iv "^create"|grep -iv "^link"|grep -vi $(TMPSRC)|grep -vi touch|grep -vi "working"; \
+ if [ $$? -ne 0 ] ; \
+ then \
+ $(ECHO) "\tNo errors\n"; \
+ else \
+ $(ECHO) "\n\tErrors can be found in `pwd`/errs\n"; \
+ fi \
+ )
+
+$(ROOTTERMINFO) :
+ $(INS.dir)
+
+clean clobber:
+ $(RM) $(TMPSRC)
+
+strip lint :
+
diff --git a/usr/src/cmd/lp/terminfo/PS.ti b/usr/src/cmd/lp/terminfo/PS.ti
new file mode 100644
index 0000000000..28a83e988b
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/PS.ti
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+# ident "%Z%%M% %I% %E% SMI" /* SVr4 1.1 */
+
+PS|PSR|PS-b|PS-r|PS-br|Fake PostScript entry,
+ slines=\004,
+ u9=\004,
+ csnm=\004,
+ scs=\004,
+ cpi=null,
+ lpi=null,
+ cols#80,
+ lines#66,
diff --git a/usr/src/cmd/lp/terminfo/citoh.ti b/usr/src/cmd/lp/terminfo/citoh.ti
new file mode 100644
index 0000000000..c2b584b7c6
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/citoh.ti
@@ -0,0 +1,127 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+
+######################################################################
+#
+# Generic entry for the C.Itoh 8510 printer and emulations:
+#
+
+Gcitoh+basic,
+
+# The 8510 I use only allows 79 columns!
+ cols#79,
+
+ lines#66,
+ it#8,
+
+ orc#1,
+ orhi#10,
+ orl#24,
+ orvi#144,
+
+ cr=\r,
+ cud1=\n,
+ cuf1=\s,
+ ff=\f,
+ ht=\t,
+
+ cpi=%?%p1%{10}%=%t\EN%e%p1%{12}%=%t\EE%e%p1%{16}%=%p1%{17}%=%O%t\EQ%;,
+ cvr=%?%p1%{0}%>%p1%{100}%<%&%t\ET%p1%02d%;,
+
+ is1=^Q^X,
+ is2=\Ec1\Ev66.,
+
+ smso=\E!,
+ rmso=\E",
+ smul=\EX,
+ rmul=\EY,
+ bold=\E!,
+ ssubm=\Es2,
+ rsubm=\Es0,
+ ssupm=\Es1,
+ rsupm=\Es0,
+ swidm=^N,
+ rwidm=^O,
+ sgr0=\E"\EY\Es0^O,
+ sgr=%?%p1%p6%|%t\E!%e\E"%;%?%p2%t\EX%e\EY%;,
+
+ rep=\ER%p2%03d%p1%c,
+
+ snlq=\Em2,
+ snrmq=\Em1,
+ sdrfq=\Em0,
+
+ smglp=\EL%p1%03d,
+ smgrp=\E/%{1}%p1%+%03d,
+
+# slines=
+ u9=\Ev%p1%02d.,
+ slines=\Ev%p1%02d.,
+
+Gcitoh+low,
+
+ npins#8,
+ spinv#68,
+ spinh#136,
+
+ porder=8\,7\,6\,5\,4\,3\,2\,1;0,
+
+ sbim=\ES%p1%04d,
+
+# birep=
+ u4=\EV%p2%04d%p3%c,
+ birep=\EV%p2%04d%p3%c,
+
+ bitwin#1,
+ u1=1,
+ bitype#1,
+ u2=1,
+
+# defbi=
+# Set the line spacing to 17/144 inch to get (almost) 68 dots
+# per inch vertically (8 * 144/17).
+# Set the character spacing to compressed (1/17 inch or 17
+# characters per inch); at 136 dots per inch horizontally this
+# means 8 dots per character.
+# Set the left margin at the left edge of the image.
+# The C.Itoh doesn't have parameterized vertical motion,
+# so we simulate it with linefeeds. Assume we never need
+# to move more than 63 lines (at 17/144 LPI).
+# Set uni-directional motion; bi-directional causes a wavy
+# image.
+# defbi=
+ u6=%?%p5%{1}%=%t\ET17\EQ\EL%p1%{8}%/%03d%p2%{8}%/%Py%?%gy%{31}%>%t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%gy%{32}%-%Py%;%?%gy%{15}%>%t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%gy%{16}%-%Py%;%?%gy%{7}%>%t\n\n\n\n\n\n\n\n%gy%{8}%-%Py%;%?%gy%{3}%>%t\n\n\n\n%gy%{4}%-%Py%;%?%gy%{1}%>%t\n\n%gy%{2}%-%Py%;%?%gy%{0}%>%t\n%;\E>%;,
+ defbi=%?%p5%{1}%=%t\ET17\EQ\EL%p1%{8}%/%03d%p2%{8}%/%Py%?%gy%{31}%>%t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%gy%{32}%-%Py%;%?%gy%{15}%>%t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%gy%{16}%-%Py%;%?%gy%{7}%>%t\n\n\n\n\n\n\n\n%gy%{8}%-%Py%;%?%gy%{3}%>%t\n\n\n\n%gy%{4}%-%Py%;%?%gy%{1}%>%t\n\n%gy%{2}%-%Py%;%?%gy%{0}%>%t\n%;\E>%;,
+
+# endbi=
+ u7=\EA\EP\EL001\E<,
+ endbi=\EA\EP\EL001\E<,
+
+# binel=
+ u5=\n\r\EL%p1%{8}%/%03d,
+ binel=\n\r\EL%p1%{8}%/%03d,
+
diff --git a/usr/src/cmd/lp/terminfo/daisy.ti b/usr/src/cmd/lp/terminfo/daisy.ti
new file mode 100644
index 0000000000..26c7b31d9f
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/daisy.ti
@@ -0,0 +1,126 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Generic entry for the daisy wheel printers and emulations:
+#
+
+#
+# Basic capabilities:
+#
+Gdaisy+basic,
+
+ daisy,
+
+ cols#132,
+ lines#66,
+
+ bufsz#500,
+ cps#55,
+ orc#12,
+ orhi#120,
+ orl#8,
+ orvi#48,
+
+ cr=^M,
+ cud1=^J,
+ cuf1=\s,
+ ff=^L,
+ ht=^I,
+ hpa=%?%p1%{100}%<%t\EC%p1%02d%e%p1%{110}%<%t\ECA%p1%{100}%-%d%e%p1%{120}%<%t\ECB%p1%{110}%-%d%e%p1%{130}%<%t\ECC%p1%{120}%-%d%e%p1%{140}%<%t\ECD%p1%{130}%-%d%e%p1%{150}%<%t\ECE%p1%{140}%-%d%e%p1%{160}%<%t\ECF%p1%{150}%-%d%;,
+ vpa=%?%p1%{100}%<%t\EP%p1%02d%e%p1%{110}%<%t\EPA%p1%{100}%-%d%e%p1%{120}%<%t\EPB%p1%{110}%-%d%e%p1%{130}%<%t\EPC%p1%{120}%-%d%e%p1%{140}%<%t\EPD%p1%{130}%-%d%e%p1%{150}%<%t\EPE%p1%{140}%-%d%e%p1%{160}%<%t\EPF%p1%{150}%-%d%;,
+
+ chr=%?%p1%{100}%<%t\EE%p1%02d%e%p1%{110}%<%t\EEA%p1%{100}%-%d%e%p1%{120}%<%t\EEB%p1%{110}%-%d%e%p1%{130}%<%t\EEC%p1%{120}%-%d%e%p1%{140}%<%t\EED%p1%{130}%-%d%e%p1%{150}%<%t\EEE%p1%{140}%-%d%e%p1%{160}%<%t\EEF%p1%{150}%-%d%;,
+ cvr=%?%p1%{100}%<%t\EL%p1%02d%e%p1%{110}%<%t\ELA%p1%{100}%-%d%e%p1%{120}%<%t\ELB%p1%{110}%-%d%e%p1%{130}%<%t\ELC%p1%{120}%-%d%e%p1%{140}%<%t\ELD%p1%{130}%-%d%e%p1%{150}%<%t\ELE%p1%{140}%-%d%e%p1%{160}%<%t\ELF%p1%{150}%-%d%;,
+
+
+ is2=\E\015P\EW\E.\EL08\EE12\E%\E<,
+
+ smso=\EQ,
+ rmso=\ER,
+ smul=\EI,
+ rmul=\EJ,
+ bold=\EK3,
+ sshm=\EQ,
+ rshm=\ER,
+ sgr0=\ER\EM\EJ,
+ sgr=%?%p1%t\EQ%e\ER%;%?%p2%t\EI%e\EJ%;%?%p6%t\EK3%e\EM%;,
+
+ smgb=\E-,
+ smgl=\E9,
+ smgr=\E0,
+ smgt=\E+,
+
+# slines=,
+ u9=\EF%p1%02d,
+
+#
+# Graphics capabilities:
+#
+Gdaisy+lowres,
+
+#
+# We could use the graphics on/graphics off control sequences
+# (ESC G/ESC 4) but for these problems:
+#
+# - graphics mode gets turned off when a \r is received;
+# - printing a character doesn't cause motion, which
+# means that each ``cell'' must be followed by a space;
+# - to get the best aspect ratio, three horizontal dots
+# must be sent per ``cell'' (using the ESC 3 graphics mode
+# (1/60 instead of 1/120) alleviates this problem but
+# gives a worse aspect ratio).
+#
+# So instead we set the HMI and VMI to 1/40 and 1/48 inch,
+# respectively.
+#
+ npins#1,
+ spinv#48,
+ spinh#40,
+
+ porder=o\,o\,o\,o\,1\,1\,1\,o;32,
+
+# bitwin#
+ u1=1,
+# bitype#
+ u2=1,
+
+# birep=
+ u4=%?%p3%{32}%=%t\EH%p2%{3}%*%Px%gx%{256}%/%{64}%+%c%gx%{256}%m%{16}%/%{64}%+%c%gx%{16}%m%{64}%+%c%;,
+
+# defbi=
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\EL01\EE03%p1%{3}%*%Px\r\EH%gx%{256}%/%{64}%+%c%gx%{256}%m%{16}%/%{64}%+%c%gx%{16}%m%{64}%+%c\EV%p2%{256}%/%{64}%+%c%p2%{256}%m%{16}%/%{64}%+%c%p2%{16}%m%{64}%+%c\E>%;,
+
+# endbi=
+ u7=\EL08\EE12\E<,
+
+# binel=
+ u5=\n\r%p1%{3}%*%Px\EH%gx%{256}%/%{64}%+%c%gx%{256}%m%{16}%/%{64}%+%c%gx%{16}%m%{64}%+%c,
+
diff --git a/usr/src/cmd/lp/terminfo/dec.ti b/usr/src/cmd/lp/terminfo/dec.ti
new file mode 100644
index 0000000000..5cc0ae6d55
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/dec.ti
@@ -0,0 +1,130 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+
+######################################################################
+#
+# Generic entries for the various DEC printers and emulations.
+#
+# The Gdec+... entries are really for any ANSI X3.64 printer,
+# but "ansi" is already used for terminals. It would be more
+# work to do "use=ansi" because there are too many screen
+# oriented caps that would have to be removed.
+#
+
+#
+# Basic capabilities:
+#
+Gdec+basic,
+
+ cols#132,
+ lines#66,
+ it#8,
+
+ cpix,
+ orc#1,
+ orhi#10,
+ orl#2,
+ orvi#12,
+
+#
+# FIX? Are xhpa and xvpa really needed?
+ xhpa,
+ xvpa,
+
+ cr=^M,
+ ff=^L,
+ ht=^I,
+ cud1=^J,
+ cuf1=\s,
+ cuu1=\EM,
+ cud=\E[%p1%de,
+ cuf=\E[%p1%da,
+ hpa=\E[%p1%d`,
+ vpa=\E[%p1%dd,
+ nel=\EE,
+
+ is1=\Ec,
+ is2=\E[20l,
+
+ cpi=%?%p1%{10}%=%t\E[w%e%p1%{12}%=%t\E[2w%e%p1%{5}%=%t\E[5w%e%p1%{13}%=%p1%{14}%=%O%t\E[3w%e%p1%{16}%=%p1%{17}%=%O%t\E[4w%e%p1%{6}%=%t\E[6w%e%p1%{7}%=%t\E[7w%e%p1%{8}%=%t\E[8w%;,
+ lpi=%?%p1%{2}%=%t\E[4z%e%p1%{3}%=%t\E[5z%e%p1%{4}%=%t\E[6z%e%p1%{6}%=%t\E[z%e%p1%{8}%=%t\E[2z%e%p1%{12}%=%t\E[3z%;,
+
+ csnm=%?%p1%{0}%=%tusascii%e%p1%{1}%=%tenglish%e%p1%{2}%=%tfinnish%e%p1%{3}%=%tjapanese%e%p1%{4}%=%tnorwegian%e%p1%{5}%=%tswedish%e%p1%{6}%=%tgermanic%e%p1%{7}%=%tfrench%e%p1%{8}%=%tcanadian_french%e%p1%{9}%=%titalian%e%p1%{10}%=%tspanish%e%p1%{11}%=%tline%e%p1%{12}%=%tsecurity%e%p1%{13}%=%tebcdic%e%p1%{14}%=%tapl%e%p1%{15}%=%tmosaic%;,
+ scs=%?%p1%{0}%=%t\E(B%e%p1%{1}%=%t\E(A%e%p1%{2}%=%t\E(C%e%p1%{3}%=%t\E(D%e%p1%{4}%=%t\E(E%e%p1%{5}%=%t\E(H%e%p1%{6}%=%t\E(K%e%p1%{7}%=%t\E(R%e%p1%{8}%=%t\E(Q%e%p1%{9}%=%t\E(Y%e%p1%{10}%=%t\E(Z%e%p1%{11}%=%t\E(0%e%p1%{12}%=%t\E(1%e%p1%{13}%=%t\E(3%e%p1%{14}%=%t\E(8%e%p1%{15}%=%t\E(}%;,
+
+ sshm=\E[5m,
+ rshm=\E[m,
+
+ smgtp=\E[%p1%dr,
+ smgbp=\E[;%p1%dr,
+ smglp=\E[%{1}%p1%+%ds,
+ smgrp=\E[;%{1}%p1%+%ds,
+
+# slines=
+ u9=\E[%p1%dt,
+ slines=\E[%p1%dt,
+
+#
+# Graphics capabilities (low resolution, 6-pin):
+#
+Gdec+low,
+
+ npins#6,
+ spinv#72,
+ spinh#75,
+
+ porder=o\,o\,6\,5\,4\,3\,2\,1;63,
+
+ bitwin#1,
+ u1=1,
+ bitype#1,
+ u2=1,
+
+# birep=
+ u4=!%p2%d%p3%c,
+ birep=!%p2%d%p3%c,
+
+# defbi=
+# X is in 1/75 increments; set char spacing to 1/16.7
+# increments to allow us to get close; column is X*16.7/75.
+# Y is in 1/72 increments; set line spacing to 1/12
+# increments to allow us to get close; line is Y/6.
+ u6=%?%p5%{1}%=%t\E[4w\E[%p1%{167}%*%{750}%/%d`\E[w\E[3z\E[%p2%{6}%/%dd\E[z\EP0q%;,
+ defbi=%?%p5%{1}%=%t\E[4w\E[%p1%{167}%*%{750}%/%d`\E[w\E[3z\E[%p2%{6}%/%dd\E[z\EP0q%;,
+
+# endbi=
+ u7=^X,
+ endbi=^X,
+
+# binel=
+ u5=-,
+ binel=-,
+
+# bicr=
+ u3=$,
+ bicr=$,
+
diff --git a/usr/src/cmd/lp/terminfo/epson.ti b/usr/src/cmd/lp/terminfo/epson.ti
new file mode 100644
index 0000000000..8beceb1e74
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/epson.ti
@@ -0,0 +1,301 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Epson
+#
+
+#
+# Basic capabilities:
+#
+Gepson+basic,
+
+ cols#80,
+ lines#66,
+ it#8,
+
+ cpix,
+ orc#6,
+ orhi#60,
+ orl#30,
+ orvi#180,
+
+ cr=^M,
+ cud1=^J,
+ cuf1=\s,
+ cub1=\b,
+ ff=^L,
+ ht=^I,
+
+ cpi=%?%p1%{10}%=%t^R\EP%e%p1%{12}%=%t^R\EM%e%p1%{20}%=%t^O\EM%e%p1%{17}%=%t^O\EP%;,
+ cvr=%?%p1%{0}%>%p1%{256}%<%&%t\E3%p1%c%;,
+
+ is1=^Q^X,
+ is2=\E@\E%0\EO,
+
+ csnm=%?%p1%{0}%=%tusa%e%p1%{1}%=%tfrench%e%p1%{2}%=%tgerman%e%p1%{3}%=%tbritish%e%p1%{4}%=%tdanish%e%p1%{5}%=%tswedish%e%p1%{6}%=%titalian%e%p1%{7}%=%tspanish%e%p1%{8}%=%tjapanese%e%p1%{9}%=%tnorwegian%e%p1%{10}%=%tdanish2%e%p1%{11}%=%tspanish2%e%p1%{12}%=%tlatin_american%e%p1%{13}%=%tafrikaans%e%p1%{14}%=%tdutch%e%p1%{15}%=%tfrench_canadian%e%p1%{16}%=%tfrench2%e%p1%{17}%=%tbritish2%e%p1%{18}%=%tmulti_national%e%p1%{19}%=%tibmgraphics%;,
+ scs=%?%p1%{0}%=%t\ER\200%e%p1%{1}%=%t\ER\001%e%p1%{2}%=%t\ER\002%e%p1%{3}%=%t\ER\003%e%p1%{4}%=%t\ER\004%e%p1%{5}%=%t\ER\005%e%p1%{6}%=%t\ER\006%e%p1%{7}%=%t\ER\007%e%p1%{8}%=%t\ER\010%e%p1%{9}%=%t\ER\011%e%p1%{10}%=%t\ER\012%e%p1%{11}%=%t\ER\013%e%p1%{12}%=%t\ER\014%e%p1%{13}%=%t\ER\100%e%p1%{14}%=%t\ERA%e%p1%{15}%=%t\ERB%e%p1%{16}%=%t\ERC%e%p1%{17}%=%t\ERD%e%p1%{18}%=%t\E6%e%p1%{19}%=%t\Et1%;,
+
+ smso=\EE,
+ rmso=\EF,
+ smul=\E-1,
+ rmul=\E-0,
+ bold=\EG,
+ sshm=\EE,
+ rshm=\EF,
+ ssubm=\ES1,
+ rsubm=\ET,
+ ssupm=\ES0,
+ rsupm=\ET,
+ swidm=\EW1,
+ rwidm=\EW0,
+ sitm=\E4,
+ ritm=\E5,
+ sgr0=\EF\E-0\EH\ET\EW0\E5,
+ sgr=%?%p1%t\EE%e\EF%;%?%p2%t\E-1%e\E-0%;%?%p6%t\EG%e\EH%;,
+
+#
+# For now we can't set the margin in the first (0th) column
+# due to limitations in the Curses code. This should be changed
+# in the future. For now, shift right 1. Note that the right
+# margin is the last USEABLE column in Terminfo, but is 1
+# PAST that for the Epson.
+ smglp=%?%p1%{256}%<%t\El%p1%{1}%+%c%;,
+ smgrp=%?%p1%{256}%<%t\EQ%p1%{2}%+%c%;,
+
+# slines= u9 used for svr3.2
+ u9=%?%p1%{0}%>%p1%{128}%<%&%t\EC%p1%c%;,
+ slines=%?%p1%{0}%>%p1%{128}%<%&%t\EC%p1%d%;,
+
+ sdrfq=\Ex0,
+ snlq=\Ex1,
+ snrmq=\Ek1,
+
+#
+# Graphics capabilities:
+#
+Gepson+low,
+
+ npins#8,
+ spinv#60,
+ spinh#60,
+
+ porder=1\,2\,3\,4\,5\,6\,7\,8;0,
+
+ sbim=\EK%p1%{256}%m%c%p1%{256}%/%c,
+
+# u1 - u8 used for svr3.2
+ bitwin#1,
+ u1=1,
+ bitype#1,
+ u2=1,
+
+# defbi=
+# Set the line spacing to 8/60 inch (7.5 lines per inch)
+# to get 60 dots per inch vertically (7.5 lines/" * 8 pins/line).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 60 dots per inch horizontally this means 6
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ defbi=%?%p5%{1}%=%t\E3\030^R\EP\EB%p2%{8}%/%c$<>\ED%p1%{6}%/%c$<>\013\r\t%;,
+
+# endbi=
+ u7=\E3\036,
+ endbi=\E3\036,
+
+# binel=
+ u5=\n\r\t,
+ binel=\n\r\t,
+
+# bicr=
+ u3=\r\t,
+ bicr=\r\t,
+
+######################################################################
+#
+# Epson LQ-2500
+#
+
+#
+# Basic capabilities:
+#
+Gep2500+basic,
+
+ cols#136,
+ lines#66,
+ it#8,
+
+ cpix,
+ orc#6,
+ orhi#60,
+ orl#30,
+ orvi#180,
+
+ cr=^M,
+ cud1=^J,
+ cuf1=\s,
+ cub1=\b,
+ ff=^L,
+ ht=^I,
+
+ cpi=%?%p1%{10}%=%t^R\EP%e%p1%{12}%=%t^R\EM%e%p1%{20}%=%t^O\EM%e%p1%{17}%=%t^O\EP%;,
+ cvr=%?%p1%{0}%>%p1%{256}%<%&%t\E3%p1%c%;,
+
+ is1=^Q^X,
+ is2=\E@\E%0\EO,
+
+
+ csnm=%?%p1%{0}%=%tusa%e%p1%{1}%=%tfrench%e%p1%{2}%=%tgerman%e%p1%{3}%=%tbritish%e%p1%{4}%=%tdanish%e%p1%{5}%=%tswedish%e%p1%{6}%=%titalian%e%p1%{7}%=%tspanish%e%p1%{8}%=%tjapanese%e%p1%{9}%=%tnorwegian%e%p1%{10}%=%tdanish2%e%p1%{11}%=%tspanish2%e%p1%{12}%=%tlatin_american%e%p1%{13}%=%tibmgraphics%;,
+ scs=%?%p1%{0}%=%t\ER\200%e%p1%{1}%=%t\ER\001%e%p1%{2}%=%t\ER\002%e%p1%{3}%=%t\ER\003%e%p1%{4}%=%t\ER\004%e%p1%{5}%=%t\ER\005%e%p1%{6}%=%t\ER\006%e%p1%{7}%=%t\ER\007%e%p1%{8}%=%t\ER\010%e%p1%{9}%=%t\ER\011%e%p1%{10}%=%t\ER\012%e%p1%{11}%=%t\ER\013%e%p1%{12}%=%t\ER\014%e%p1%{13}%=%t\Et1%;,
+
+ smso=\EE,
+ rmso=\EF,
+ smul=\E-1,
+ rmul=\E-0,
+ bold=\EG,
+ sshm=\EE,
+ rshm=\EF,
+ ssubm=\ES1,
+ rsubm=\ET,
+ ssupm=\ES0,
+ rsupm=\ET,
+ swidm=\EW1,
+ rwidm=\EW0,
+ sitm=\E4,
+ ritm=\E5,
+ sgr0=\EF\E-0\EH\ET\EW0\E5,
+ sgr=%?%p1%t\EE%e\EF%;%?%p2%t\E-1%e\E-0%;%?%p6%t\EG%e\EH%;,
+
+#
+# For now we can't set the margin in the first (0th) column
+# due to limitations in the Curses code. This should be changed
+# in the future. For now, shift right 1. Note that the right
+# margin is the last USEABLE column in Terminfo, but is 1
+# PAST that for the Epson.
+ smglp=%?%p1%{256}%<%t\El%p1%{1}%+%c%;,
+ smgrp=%?%p1%{256}%<%t\EQ%p1%{2}%+%c%;,
+
+# slines=
+ u9=%?%p1%{0}%>%p1%{128}%<%&%t\EC%p1%c%;,
+ slines=%?%p1%{0}%>%p1%{128}%<%&%t\EC%p1%c%;,
+
+ sdrfq=\Ex0,
+ snlq=\Ex1,
+ snrmq=\Ek1,
+
+#
+# Graphics capabilities:
+#
+Gep2500+low,
+
+ npins#8,
+ spinv#60,
+ spinh#60,
+
+ porder=1\,2\,3\,4\,5\,6\,7\,8;0,
+
+ sbim=\EK%p1%{256}%m%c%p1%{256}%/%c,
+
+ bitwin#1,
+ u1=1,
+ bitype#1,
+ u2=1,
+
+# defbi=
+# Set the line spacing to 8/60 inch (7.5 lines per inch)
+# to get 60 dots per inch vertically (7.5 lines/" * 8 pins/line).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 60 dots per inch horizontally this means 6
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\E3\030^R\EP\EB%p2%{8}%/%c$<>\ED%p1%{6}%/%c$<>\013\r\t%;,
+ defbi=%?%p5%{1}%=%t\E3\030^R\EP\EB%p2%{8}%/%c$<>\ED%p1%{6}%/%c$<>\013\r\t%;,
+
+# endbi=
+ u7=\E3\036,
+ endbi=\E3\036,
+
+# binel=
+ u5=\n\r\t,
+ binel=\n\r\t,
+
+# bicr=
+ u3=\r\t,
+ bicr=\r\t,
+
+#
+# Graphics capabilities:
+#
+Gep2500+high,
+
+ npins#24,
+ spinv#180,
+ spinh#180,
+
+ porder=1\,2\,3\,4\,5\,6\,7\,8\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\,22\,23\,24;0,
+
+ sbim=\E*\047%p1%{256}%m%c%p1%{256}%/%c,
+
+# defbi=
+# Set the line spacing to 8/60 inch (7.5 lines per inch)
+# to get 180 dots per inch vertically (7.5 lines/" * 24 pins/line).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 180 dots per inch horizontally this means 18
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\E3\030^R\EP\EB%p2%{24}%/%c$<>\ED%p1%{18}%/%c$<>\013\r\t%;,
+ defbi=%?%p5%{1}%=%t\E3\030^R\EP\EB%p2%{24}%/%c$<>\ED%p1%{18}%/%c$<>\013\r\t%;,
+
+ use=Gep2500+low,
+
+#
+# Color capability:
+#
+Gep2500+color,
+
+ colors#3,
+
+# setcolor=
+ initc=%?%p1%{0}%=%t\Er0%;%?%p1%{1}%=%t\Er2%;%?%p1%{2}%=%t\Er1%;%?%p1%{3}%=%t\Er4%;,
+
+# colornm=
+ u8=%?%p1%{0}%=%tblack%;%?%p1%{1}%=%tcyan%;%?%p1%{2}%=%tmagenta%;%?%p1%{3}%=%tyellow%;%?%p1%{4}%=%torange=yellow+magenta%;%?%p1%{5}%=%tgreen=yellow+cyan%;%?%p1%{6}%=%tviolet=magenta+cyan%;%?%p1%{7}%=%tbrown=magenta+black%;,
+ colornm=%?%p1%{0}%=%tblack%;%?%p1%{1}%=%tcyan%;%?%p1%{2}%=%tmagenta%;%?%p1%{3}%=%tyellow%;%?%p1%{4}%=%torange=yellow+magenta%;%?%p1%{5}%=%tgreen=yellow+cyan%;%?%p1%{6}%=%tviolet=magenta+cyan%;%?%p1%{7}%=%tbrown=magenta+black%;,
+
diff --git a/usr/src/cmd/lp/terminfo/hplaser.ti b/usr/src/cmd/lp/terminfo/hplaser.ti
new file mode 100644
index 0000000000..4d887f99ab
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/hplaser.ti
@@ -0,0 +1,122 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+
+######################################################################
+#
+# Generic entry for the HP Laserjet printers and emulations:
+#
+
+#
+# Basic capabilities:
+#
+Ghplaser+basic,
+
+ cols#80,
+ lines#60,
+
+ orc#12,
+ orhi#120,
+ orl#8,
+ orvi#48,
+
+ cr=^M,
+ cud1=^J,
+ cuf1=\s,
+ cud=\E&a+%p1%dR,
+ cuf=\E&a+%p1%dC,
+ ff=^L,
+ hpa=\E&a%p1%dC,
+ vpa=\E&a%p1%dR,
+
+ cpi=%?%p1%{10}%=%t\E&k0S%e%p1%{17}%=%t\E&k2S%;,
+ chr=%?%p1%{0}%>%p1%{127}%<%t\E&k%p1%dH%;,
+ cvr=%?%p1%{0}%>%p1%{127}%<%t\E&l%p1%dC%;,
+ lpi=%?%p1%{1}%=%t\E&l1D%e%p1%{2}%=%t\E&l2D%e%p1%{3}%=%t\E&l3D%e%p1%{4}%=%t\E&l4D%e%p1%{6}%=%t\E&l6D%e%p1%{8}%=%t\E&l8D%e%p1%{12}%=%t\E&l12D%e%p1%{16}%=%t\E&l16D%e%p1%{24}%=%t\E&l24D%e%p1%{48}%=%t\E&l48D%;,
+
+ is2=\EE\E&k0G,
+ mgc=\E9,
+
+ rmul=\E&d\100,
+ ritm=\E(s0S,
+ smul=\E&dD,
+ sitm=\E(s1S,
+ smgtp=\E&l%p1%{1}%+%dE,
+ smgbp=\E&l%p1%{1}%+%dF,
+ smglp=\E&a%p1%dL,
+ smgrp=\E&a%p1%dM,
+
+#Set top margin at +2 offset
+ smgtp=\E&l%p1%dE,
+
+#Set page length u9 used for 3.2 slines for 4.0
+ u9=\E&l%p1P,
+ slines=\E&l%p1%dF,
+
+#
+# Graphics capabilities:
+#
+Ghplaser+high,
+
+ npins#8,
+ spinv#300,
+ spinh#300,
+
+ porder=1\,2\,3\,4\,5\,6\,7\,8;0,
+
+ sbim=\E*b%p1%dW,
+
+# u1 - u7 used for svr3.2
+# bitwin#,
+ u1=1,
+ bitwin#1,
+# bitype#
+ u2=2,
+ bitype#2,
+
+# defbi=
+# X (or Y) * scale * 12/5 == pos in decipoints (12/5 == 720/300)
+ u6=%?%p5%{0}%>%p5%{5}%<%&%t\E&a%p1%p5%*%{12}%*%{5}%/%dH\E&a%p2%p5%*%{12}%*%{5}%/%dV\E*t%{300}%p5%/%dR\E*r1A%;,
+ defbi=%?%p5%{0}%>%p5%{5}%<%&%t\E&a%p1%p5%*%{12}%*%{5}%/%dH\E&a%p2%p5%*%{12}%*%{5}%/%dV\E*t%{300}%p5%/%dR\E*r1A%;,
+
+# endbi=
+ u7=\E*rB,
+ endbi=\E*rB,
+
+Ghplaser+II,
+
+ cpi=%?%p1%{10}%=%t\E(s10H%e%p1%{16}%=%p1%{17}%=%O%t\E(s16.66H%e%;,
+
+ csnm=%?%p1%{0}%=%troman-8%e%p1%{1}%=%tibm-us%e%p1%{2}%=%tibm-dn%e%p1%{3}%=%tgerman%e%p1%{4}%=%tspanish%e%p1%{5}%=%tecma-94%e%p1%{6}%=%tiso2%e%p1%{7}%=%tiso4%e%p1%{8}%=%tiso6%e%p1%{9}%=%tiso10%e%p1%{10}%=%tiso11%e%p1%{11}%=%tiso14%e%p1%{12}%=%tiso15%e%p1%{13}%=%tiso16%e%p1%{14}%=%tiso17%e%p1%{15}%=%tiso21%e%p1%{16}%=%tiso25%e%p1%{17}%=%tiso57%e%p1%{18}%=%tiso60%e%p1%{19}%=%tiso61%e%p1%{20}%=%tiso69%e%p1%{21}%=%tiso84%e%p1%{22}%=%tiso85%;,
+
+ scs=%?%p1%{0}%=%t\E(8U%e%p1%{1}%=%t\E(10U%e%p1%{2}%=%t\E(11U%e%p1%{3}%=%t\E(0G%e%p1%{4}%=%t\E(1S%e%p1%{5}%=%t\E(0N%e%p1%{6}%=%t\E(2U%e%p1%{7}%=%t\E(1E%e%p1%{8}%=%t\E(0U%e%p1%{9}%=%t\E(3S%e%p1%{10}%=%t\E(0S%e%p1%{11}%=%t\E(0K%e%p1%{12}%=%t\E(0I%e%p1%{13}%=%t\E(4S%e%p1%{14}%=%t\E(2S%e%p1%{15}%=%t\E(1G%e%p1%{16}%=%t\E(0F%e%p1%{17}%=%t\E(2K%e%p1%{18}%=%t\E(0D%e%p1%{19}%=%t\E(1D%e%p1%{20}%=%t\E(1F%e%p1%{21}%=%t\E(5S%e%p1%{22}%=%t\E(6S%;,
+
+ use=Ghplaser+basic, use=Ghplaser+high,
+
diff --git a/usr/src/cmd/lp/terminfo/ibm.ti b/usr/src/cmd/lp/terminfo/ibm.ti
new file mode 100644
index 0000000000..e58aca21eb
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/ibm.ti
@@ -0,0 +1,353 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
+
+######################################################################
+#
+# Generic entries for the various IBM printers and emulations.
+#
+
+###################################
+#
+# IBM Graphics
+#
+
+#
+# Basic capabilities:
+#
+Gibmg+basic,
+
+ cols#80,
+ lines#66,
+ it#8,
+
+ cpix,
+ orc#1,
+ orhi#10,
+ orl#12,
+ orvi#72,
+
+ cr=^M,
+ ff=^L,
+ ht=^I,
+ cud1=^J,
+ cuf1=\s,
+
+ cpi=%?%p1%{10}%=%t^R%e%p1%{16}%=%p1%{17}%=%O%t^O%;,
+ cvr=%?%p1%{0}%>%p1%{256}%<%&%t\EA%p1%c\E2%;,
+
+ is1=^X,
+ is2=^R\EA\014\E2\EF\EH\EW0\ET\E-0\E7\EO\ECB,
+
+ csnm=%?%p1%{0}%=%tcharacter_set_1%e%p1%{1}%=%tcharacter_set_2%;,
+ scs=%?%p1%{0}%=%t\E7%e%p1%{2}%=%t\E6%;,
+
+ smso=\EE,
+ rmso=\EF,
+ smul=\E-1,
+ rmul=\E-0,
+ bold=\EG,
+ smacs=\E6,
+ rmacs=\E7,
+ sshm=\EE,
+ rshm=\EF,
+ ssubm=\ES1,
+ rsubm=\ET,
+ ssupm=\ES0,
+ rsupm=\ET,
+ swidm=\EW1,
+ rwidm=\EW0,
+ sgr0=\EF\E-0\EH\E7\ET\EW0,
+ sgr=%?%p1%t\EE%e\EF%;%?%p2%t\E-1%e\E-0%;%?%p6%t\EG%e\EH%;%?%p9%t\E6%e\E7%;,
+ sdrfq=\EH,
+ snlq=\EG,
+
+# slines= u9 used for svr3.2
+ u9=%?%p1%{0}%>%p1%{128}%<%&%t\EC%p1%c%;,
+ slines=%?%p1%{0}%>%p1%{128}%<%&%t\EC%p1%c%;,
+
+#
+# Graphics capabilities (low resolution, 9-pin):
+#
+Gibmg+low,
+
+ npins#8,
+ spinv#72,
+ spinh#60,
+
+ porder=1\,2\,3\,4\,5\,6\,7\,8;0,
+
+ sbim=\EK%p1%{256}%m%c%p1%{256}%/%c,
+
+ bitwin#1,
+ u1=1,
+ bitype#1,
+ u2=1,
+
+# defbi=
+# Set the line spacing to 8/72 inch (9 lines per inch)
+# to get 72 dots per inch vertically (9 lines/inch * 8 pins/line).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 60 dots per inch horizontally this means 6
+# dots per character.
+# The IBM Graphics doesn't have parameterized motion,
+# so we simulate it with linefeeds and spaces.
+# Assume we never need to move across more than 63 colums
+# or down more than 31 lines.
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\EA\010\E2^R%p2%{8}%/%Py%?%gy%{15}%>%t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%gy%{16}%-%Py%;%?%gy%{7}%>%t\n\n\n\n\n\n\n\n%gy%{8}%-%Py%;%?%gy%{3}%>%t\n\n\n\n%gy%{4}%-%Py%;%?%gy%{1}%>%t\n\n%gy%{2}%-%Py%;%?%gy%{0}%>%t\n%;\r%p1%{6}%/%Px%?%gx%{31}%>%t %gx%{32}%-%Px%;%?%gx%{15}%>%t %gx%{16}%-%Px%;%?%gx%{7}%>%t %gx%{8}%-%Px%;%?%gx%{3}%>%t %gx%{4}%-%Px%;%?%gx%{1}%>%t %gx%{2}%-%Px%;%?%gx%{0}%>%t %;%;,
+ defbi=%?%p5%{1}%=%t\EA\010\E2^R%p2%{8}%/%Py%?%gy%{15}%>%t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n%gy%{16}%-%Py%;%?%gy%{7}%>%t\n\n\n\n\n\n\n\n%gy%{8}%-%Py%;%?%gy%{3}%>%t\n\n\n\n%gy%{4}%-%Py%;%?%gy%{1}%>%t\n\n%gy%{2}%-%Py%;%?%gy%{0}%>%t\n%;\r%p1%{6}%/%Px%?%gx%{31}%>%t %gx%{32}%-%Px%;%?%gx%{15}%>%t %gx%{16}%-%Px%;%?%gx%{7}%>%t %gx%{8}%-%Px%;%?%gx%{3}%>%t %gx%{4}%-%Px%;%?%gx%{1}%>%t %gx%{2}%-%Px%;%?%gx%{0}%>%t %;%;,
+
+# endbi=
+ u7=\EA\014\E2,
+ endbi=\EA\014\E2,
+
+# binel=
+ u5=\n\r%p1%{6}%/%Px%?%gx%{31}%>%t %gx%{32}%-%Px%;%?%gx%{15}%>%t %gx%{16}%-%Px%;%?%gx%{7}%>%t %gx%{8}%-%Px%;%?%gx%{3}%>%t %gx%{4}%-%Px%;%?%gx%{1}%>%t %gx%{2}%-%Px%;%?%gx%{0}%>%t %;,
+ binel=\n\r%p1%{6}%/%Px%?%gx%{31}%>%t %gx%{32}%-%Px%;%?%gx%{15}%>%t %gx%{16}%-%Px%;%?%gx%{7}%>%t %gx%{8}%-%Px%;%?%gx%{3}%>%t %gx%{4}%-%Px%;%?%gx%{1}%>%t %gx%{2}%-%Px%;%?%gx%{0}%>%t %;,
+
+# bicr=
+ u3=\r%p1%{6}%/%Px%?%gx%{31}%>%t %gx%{32}%-%Px%;%?%gx%{15}%>%t %gx%{16}%-%Px%;%?%gx%{7}%>%t %gx%{8}%-%Px%;%?%gx%{3}%>%t %gx%{4}%-%Px%;%?%gx%{1}%>%t %gx%{2}%-%Px%;%?%gx%{0}%>%t %;,
+ bicr=\r%p1%{6}%/%Px%?%gx%{31}%>%t %gx%{32}%-%Px%;%?%gx%{15}%>%t %gx%{16}%-%Px%;%?%gx%{7}%>%t %gx%{8}%-%Px%;%?%gx%{3}%>%t %gx%{4}%-%Px%;%?%gx%{1}%>%t %gx%{2}%-%Px%;%?%gx%{0}%>%t %;,
+
+###################################
+#
+# IBM Color
+#
+
+#
+# Basic capabilities:
+#
+Gibmc+basic,
+
+ cub1=\b,
+
+ is1=^Q^X,
+ is2=^R\EA\014\E2\EF\EH\EW0\ET\E-0\E7\EO\ER\E50\EM0\EX^A\210\Eb\ECB,
+
+ cvr=%?%p1%{0}%>%p1%{256}%<%&%t\E3%p1%c%;,
+
+ smglp=\EX%p1%{1}%+%c%p2%{1}%+%c,
+
+ use=Gibmg+basic,
+
+#
+# Graphics capabilities (low resolution, 9-pin, 5:6 aspect ratio):
+#
+Gibmc+low+5x6,
+
+ spinv#84,
+ spinh#70,
+
+# defbi=
+# Set 5:6 aspect ratio.
+# Set the line spacing to 7/72 inch (10.29 lines per inch)
+# to get approximately 84 dots per inch vertically
+# (10.29 lines/inch * 8 pins/line equals 82.28 dots per inch).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 70 dots per inch horizontally this means 7
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\En^B\E1^R\EB%p2%{8}%/%c$<>\ED%p1%{7}%/%c$<>\013\r\t%;,
+ defbi=%?%p5%{1}%=%t\En^B\E1^R\EB%p2%{8}%/%c$<>\ED%p1%{7}%/%c$<>\013\r\t%;,
+
+# binel=
+ u5=\n\r\t,
+ binel=\n\r\t,
+
+# bicr=
+ u3=\r\t,
+ bicr=\r\t,
+
+ use=Gibmg+low,
+
+#
+# Graphics capabilities (low resolution, 9-pin, 1:1 aspect ratio):
+#
+Gibmc+low+1x1,
+
+ spinh#84,
+
+# defbi=
+# Set 1:1 aspect ratio.
+# Set the line spacing to 7/72 inch (10.29 lines per inch)
+# to get approximately 84 dots per inch vertically
+# (10.29 lines/inch * 8 pins/line equals 82.28 dots per inch).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 84 dots per inch horizontally this means 8.4
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\En^A\E1^R\EB%p2%{8}%/%c$<>\ED%p1%{10}%*%{84}%/%c$<>\013\r\t%;,
+ defbi=%?%p5%{1}%=%t\En^A\E1^R\EB%p2%{8}%/%c$<>\ED%p1%{10}%*%{84}%/%c$<>\013\r\t%;,
+
+ use=Gibmc+low+5x6,
+
+#
+# Color capability:
+#
+Gibmc+color,
+
+ colors#3,
+
+# setcolor=
+ initc=%?%p1%{0}%=%t\Eb%;%?%p1%{1}%=%t\Ec%;%?%p1%{2}%=%t\Em%;%?%p1%{3}%=%t\Ey%;,
+
+# colornm=
+ u8=%?%p1%{0}%=%tblack%;%?%p1%{1}%=%tcyan%;%?%p1%{2}%=%tmagenta%;%?%p1%{3}%=%tyellow%;%?%p1%{4}%=%torange=yellow+magenta%;%?%p1%{5}%=%tgreen=yellow+cyan%;%?%p1%{6}%=%tviolet=magenta+cyan%;%?%p1%{7}%=%tbrown=magenta+black%;,
+ colornm=%?%p1%{0}%=%tblack%;%?%p1%{1}%=%tcyan%;%?%p1%{2}%=%tmagenta%;%?%p1%{3}%=%tyellow%;%?%p1%{4}%=%torange=yellow+magenta%;%?%p1%{5}%=%tgreen=yellow+cyan%;%?%p1%{6}%=%tviolet=magenta+cyan%;%?%p1%{7}%=%tbrown=magenta+black%;,
+
+###################################
+#
+# IBM Proprinter XL:
+#
+# This printer appears to be a superset of the IBM Graphics
+# and IBM Color printers, with a 24-wire printhead. The entry
+# below uses the full capabilities of the superset and printhead.
+# The printer has an Alternate Graphics Mode (AGM) that changes
+# the vertical resolution from 1/216" to 1/180", and the graphics
+# aspect ratio from 5:6 to 1:1. HOWEVER, there does not appear to
+# be a control sequence that switches into this mode--it must be
+# done by hand!
+#
+
+#
+# Basic capabilities (printer not in AGM):
+#
+Gibmxl+basic,
+
+ orc#12,
+ orhi#120,
+ orl#36,
+ orvi#216,
+
+ cub1=\b,
+
+ cpi=%?%p1%{10}%=%t^R%e%p1%{12}%=%t\E:%e%p1%{17}%=%t^O%;,
+ cvr=%?%p1%{0}%>%p1%{256}%<%&%t\E3%p1%c%;,
+
+ is1=^Q^X,
+ is2=^R\EP0\EA\014\E2\EC\102\EO\ER\Eb\E50\EF\EH\EW0\ET\E-0\E_0\E7,
+ is3=\EX\001\120,
+
+ smglp=\EX%p1%{1}%+%c%p2%{1}%+%c,
+
+ use=Gibmg+basic,
+
+#
+# Basic capabilities (printer in AGM):
+#
+Gibmxlagm+basic,
+
+ orl#30,
+ orvi#180,
+
+ is2=^R\EP0\EA\012\E2\EC\102\EO\ER\Eb\E50\EF\EH\EW0\ET\E-0\E_0\E7,
+
+ use=Gibmxl+basic,
+
+#
+# Graphics capabilities (low resolution, 8-pin, 5:6 aspect ratio):
+#
+Gibmxl+low+5x6,
+
+ spinv#72,
+ spinh#60,
+
+# defbi=
+# Set the line spacing to 8/72 inch (9 lines per inch)
+# to get 72 dots per inch vertically (9 lines/" * 8 pins/line).
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 60 dots per inch horizontally this means 6
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\EA\010\E2^R\EB%p2%{8}%/%c$<>\ED%p1%{6}%/%c$<>\013\r\t%;,
+ defbi=%?%p5%{1}%=%t\EA\010\E2^R\EB%p2%{8}%/%c$<>\ED%p1%{6}%/%c$<>\013\r\t%;,
+
+ use=Gibmc+low+5x6,
+
+#
+# Graphics capabilities (low resolution, 8-pin, 1:1 aspect ratio):
+#
+Gibmxl+low+1x1,
+
+ spinv#60,
+
+# In AGM the "defbi" cap from Gibmxl+low+5x6 will work. The
+# line spacing will be 8/60 inch to get 60 dots per inch, using
+# the same control sequence.
+
+ use=Gibmxl+low+5x6,
+
+#
+# Graphics capabilities (high resolution, 24-pin, 5:6 aspect ratio):
+#
+# This doesn't work as the pin spacing doesn't get set to
+# 1/216 inch, but stays at 1/180 inch, even out of AGM.
+#
+
+#
+# Graphics capabilities (high resolution, 24-pin, 1:1 aspect ratio):
+#
+Gibmxl+high+1x1,
+
+ npins#24,
+ spinv#180,
+ spinh#180,
+
+ porder=1\,2\,3\,4\,5\,6\,7\,8\,9\,10\,11\,12\,13\,14\,15\,16\,17\,18\,19\,20\,21\,22\,23\,24;0,
+
+ sbim=\E*\047%p1%{256}%m%c%p1%{256}%/%c,
+
+# defbi=
+# Set the line spacing to 8/60 inch (7.5 lines per inch)
+# to get 180 dots per inch vertically (7.5 lines/" * 24 pins/line).
+# This requires the printer or emulation in Alternate Graphics Mode.
+# Set the character spacing to pica (1/10 inch or 10 characters
+# per inch); at 180 dots per inch horizontally this means 18
+# dots per character.
+# Set vertical and horizontal tab stops at the upper left corner
+# of the image, then tab to the upper left corner.
+# Note: $<> is a true null (only works with special Curses routine).
+# THIS ASSUMES WE START AT THE TOP OF THE PAGE! (although
+# maybe not in the first column.)
+ u6=%?%p5%{1}%=%t\EA\010\E2^R\EB%p2%{24}%/%c$<>\ED%p1%{18}%/%c$<>\013\r\t%;,
+ defbi=%?%p5%{1}%=%t\EA\010\E2^R\EB%p2%{24}%/%c$<>\ED%p1%{18}%/%c$<>\013\r\t%;,
+
+ use=Gibmc+low+5x6,
+
diff --git a/usr/src/cmd/lp/terminfo/unknown.ti b/usr/src/cmd/lp/terminfo/unknown.ti
new file mode 100644
index 0000000000..85f95a606e
--- /dev/null
+++ b/usr/src/cmd/lp/terminfo/unknown.ti
@@ -0,0 +1,30 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+# All Rights Reserved
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
+unknown,
+ am, gn,
+ cols#80,
+ bel=^G, cr=\r, cud1=\n, ind=\n,
diff --git a/usr/src/cmd/man/src/man.c b/usr/src/cmd/man/src/man.c
index f272ecab6e..a2ef30da5b 100644
--- a/usr/src/cmd/man/src/man.c
+++ b/usr/src/cmd/man/src/man.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, Josef 'Jeff' Sipek <jeffpc@31bits.net>. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T. */
@@ -530,10 +531,14 @@ doargs:
freev(pathv);
/*
- * Since we can't make use of GNU troff, set the path to ensure we
- * find the one in /usr/bin first.
+ * If the TROFF environment variable hasn't been set, set PATH to
+ * ensure that we find nroff in /usr/bin, regardless of the user's
+ * PATH. (If the TROFF environment variable has been set, we
+ * assume that the environment has been constructed to execute the
+ * the nroff/troff found in the PATH with any options that may be
+ * specific to that implementation -- e.g., groff.)
*/
- if (putenv("PATH=/usr/bin") != 0) {
+ if (getenv("TROFF") == NULL && putenv("PATH=/usr/bin") != 0) {
perror("putenv");
exit(1);
}
diff --git a/usr/src/cmd/mdb/Makefile.common b/usr/src/cmd/mdb/Makefile.common
index 4e282bf001..b78836c741 100644
--- a/usr/src/cmd/mdb/Makefile.common
+++ b/usr/src/cmd/mdb/Makefile.common
@@ -38,7 +38,8 @@ COMMON_MODULES_PROC = \
libuutil \
libzpool \
mdb_ds \
- mdb_test
+ mdb_test \
+ v8
#
# MDB modules used for debugging user processes which are only 32-bit
diff --git a/usr/src/cmd/mdb/common/mdb/mdb.h b/usr/src/cmd/mdb/common/mdb/mdb.h
index 7f712ad340..46ff90eff5 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb.h
+++ b/usr/src/cmd/mdb/common/mdb/mdb.h
@@ -21,6 +21,8 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_cmds.c b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
index e9829bd6c2..0badc9acf8 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_cmds.c
@@ -22,9 +22,6 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- */
-
-/*
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright (c) 2013 Joyent, Inc. All rights reserved.
* Copyright (c) 2013 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_ctf.c b/usr/src/cmd/mdb/common/mdb/mdb_ctf.c
index c8909f8a83..1f505ef8f1 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_ctf.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_ctf.c
@@ -1780,7 +1780,6 @@ mdb_ctf_synthetics_create_base(int kind)
return (0);
discard:
- err = set_errno(ctf_to_errno(ctf_errno(cp)));
(void) ctf_discard(cp);
return (err);
}
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_help.h b/usr/src/cmd/mdb/common/mdb/mdb_help.h
index 5d63683eba..92516a43dd 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_help.h
+++ b/usr/src/cmd/mdb/common/mdb/mdb_help.h
@@ -36,6 +36,7 @@ extern "C" {
#ifdef _MDB
+
extern int cmd_dmods(uintptr_t, uint_t, int, const mdb_arg_t *);
extern int cmd_dcmds(uintptr_t, uint_t, int, const mdb_arg_t *);
extern int cmd_walkers(uintptr_t, uint_t, int, const mdb_arg_t *);
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_modapi.h b/usr/src/cmd/mdb/common/mdb/mdb_modapi.h
index 9d08a18c69..c6b4956b3b 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_modapi.h
+++ b/usr/src/cmd/mdb/common/mdb/mdb_modapi.h
@@ -22,7 +22,7 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
- * Copyright (c) 2012 Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#ifndef _MDB_MODAPI_H
@@ -71,7 +71,13 @@ extern "C" {
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
+#ifdef MDB_API_VERSION
+#if (MDB_API_VERSION != 3 && MDB_API_VERSION != 4)
+#error "Only modapi versions three and four are supported."
+#endif
+#else /* !MDB_API_VERISON */
#define MDB_API_VERSION 4 /* Current API version number */
+#endif /* MDB_API_VERISON */
/*
* Debugger command function flags:
@@ -85,11 +91,6 @@ extern "C" {
#define DCMD_HDRSPEC(fl) (((fl) & DCMD_LOOPFIRST) || !((fl) & DCMD_LOOP))
/*
- * Debugger tab command function flags
- */
-#define DCMD_TAB_SPACE 0x01 /* Tab cb invoked with trailing space */
-
-/*
* Debugger command function return values:
*/
#define DCMD_OK 0 /* Dcmd completed successfully */
@@ -118,10 +119,18 @@ typedef struct mdb_arg {
} a_un;
} mdb_arg_t;
+#if (MDB_API_VERSION >= 4)
+/*
+ * Debugger tab command function flags
+ */
+#define DCMD_TAB_SPACE 0x01 /* Tab cb invoked with trailing space */
+
typedef struct mdb_tab_cookie mdb_tab_cookie_t;
-typedef int mdb_dcmd_f(uintptr_t, uint_t, int, const mdb_arg_t *);
typedef int mdb_dcmd_tab_f(mdb_tab_cookie_t *, uint_t, int,
const mdb_arg_t *);
+#endif /* MDB_API_VERSION >= 4 */
+
+typedef int mdb_dcmd_f(uintptr_t, uint_t, int, const mdb_arg_t *);
typedef struct mdb_dcmd {
const char *dc_name; /* Command name */
@@ -129,7 +138,9 @@ typedef struct mdb_dcmd {
const char *dc_descr; /* Description */
mdb_dcmd_f *dc_funcp; /* Command function */
void (*dc_help)(void); /* Command help function (or NULL) */
+#if (MDB_API_VERSION >= 4)
mdb_dcmd_tab_f *dc_tabp; /* Tab completion function */
+#endif
} mdb_dcmd_t;
#define WALK_ERR -1 /* Walk fatal error (terminate walk) */
@@ -346,6 +357,7 @@ typedef void (*mdb_callback_f)(void *);
extern void *mdb_callback_add(int, mdb_callback_f, void *);
extern void mdb_callback_remove(void *);
+#if (MDB_API_VERSION >= 4)
#define MDB_TABC_ALL_TYPES 0x1 /* Include array types in type output */
#define MDB_TABC_MEMBERS 0x2 /* Tab comp. types with members */
#define MDB_TABC_NOPOINT 0x4 /* Tab comp. everything but pointers */
@@ -370,6 +382,7 @@ extern int mdb_tab_typename(int *, const mdb_arg_t **, char *buf, size_t len);
*/
extern int mdb_tab_complete_mt(mdb_tab_cookie_t *, uint_t, int,
const mdb_arg_t *);
+#endif /* MDB_API_VERSION >= 4 */
extern size_t strlcat(char *, const char *, size_t);
extern char *strcat(char *, const char *);
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_module.h b/usr/src/cmd/mdb/common/mdb/mdb_module.h
index 4c6a54e28b..04cb3d1cee 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_module.h
+++ b/usr/src/cmd/mdb/common/mdb/mdb_module.h
@@ -22,6 +22,8 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_print.c b/usr/src/cmd/mdb/common/mdb/mdb_print.c
index e715b81d7d..781b94b805 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_print.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_print.c
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
@@ -2095,10 +2097,10 @@ cmd_print_tab_common(mdb_tab_cookie_t *mcp, uint_t flags, int argc,
/*
* This is the reason that tab completion was created. We're going to go
- * along and walk the delimiters until we find something a member that
- * we don't recognize, at which point we'll try and tab complete it.
- * Note that ::print takes multiple args, so this is going to operate on
- * whatever the last arg that we have is.
+ * along and walk the delimiters until we find something in a member
+ * that we don't recognize, at which point we'll try and tab complete
+ * it. Note that ::print takes multiple args, so this is going to
+ * operate on whatever the last arg that we have is.
*/
if (mdb_ctf_lookup_by_name(tn, &id) != 0)
return (1);
@@ -2108,11 +2110,11 @@ cmd_print_tab_common(mdb_tab_cookie_t *mcp, uint_t flags, int argc,
delim = parse_delimiter(&start);
/*
- * If we hit the case where we actually have no delimiters, than we need
+ * If we hit the case where we actually have no delimiters, then we need
* to make sure that we properly set up the fields the loops would.
*/
if (delim == MEMBER_DELIM_DONE)
- (void) mdb_snprintf(member, sizeof (member), "%s", start);
+ (void) mdb_snprintf(member, sizeof (member), start);
while (delim != MEMBER_DELIM_DONE) {
switch (delim) {
@@ -2169,7 +2171,7 @@ cmd_print_tab_common(mdb_tab_cookie_t *mcp, uint_t flags, int argc,
/*
* We are going to try to resolve this name as a member. There
- * are a few two different questions that we need to answer. The
+ * are a two different questions that we need to answer. The
* first is do we recognize this member. The second is are we at
* the end of the string. If we encounter a member that we don't
* recognize before the end, then we have to error out and can't
@@ -2199,6 +2201,7 @@ cmd_print_tab_common(mdb_tab_cookie_t *mcp, uint_t flags, int argc,
* already have in rid.
*/
return (mdb_tab_complete_member_by_id(mcp, rid, member));
+
}
int
@@ -2528,8 +2531,7 @@ print_help(void)
}
static int
-printf_signed(mdb_ctf_id_t id, uintptr_t addr, ulong_t off, char *fmt,
- boolean_t sign)
+printf_signed(mdb_ctf_id_t id, uintptr_t addr, ulong_t off, char *fmt, int sign)
{
ssize_t size;
mdb_ctf_id_t base;
@@ -2547,7 +2549,7 @@ printf_signed(mdb_ctf_id_t id, uintptr_t addr, ulong_t off, char *fmt,
} u;
if (mdb_ctf_type_resolve(id, &base) == -1) {
- mdb_warn("could not resolve type");
+ mdb_warn("could not resolve type\n");
return (DCMD_ABORT);
}
@@ -2557,7 +2559,7 @@ printf_signed(mdb_ctf_id_t id, uintptr_t addr, ulong_t off, char *fmt,
}
if (mdb_ctf_type_encoding(base, &e) != 0) {
- mdb_warn("could not get type encoding");
+ mdb_warn("could not get type encoding\n");
return (DCMD_ABORT);
}
@@ -2759,7 +2761,6 @@ printf_string(mdb_ctf_id_t id, uintptr_t addr, ulong_t off, char *fmt)
if (size != 1) {
mdb_warn("string format specifier requires "
"an array of characters\n");
- return (DCMD_ABORT);
}
bzero(buf, sizeof (buf));
@@ -2893,7 +2894,7 @@ cmd_printf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
if (argc == 0 || argv[0].a_type != MDB_TYPE_STRING) {
mdb_warn("expected a format string\n");
- return (DCMD_USAGE);
+ return (DCMD_ABORT);
}
/*
@@ -2902,12 +2903,6 @@ cmd_printf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
* subset of mdb_printf() format strings that we allow.
*/
fmt = argv[0].a_un.a_str;
- /*
- * 'dest' must be large enough to hold a copy of the format string,
- * plus a NUL and up to 2 additional characters for each conversion
- * in the format string. This gives us a bloat factor of 5/2 ~= 3.
- * e.g. "%d" (strlen of 2) --> "%lld\0" (need 5 bytes)
- */
dest = mdb_zalloc(strlen(fmt) * 3, UM_SLEEP | UM_GC);
fmts = mdb_zalloc(strlen(fmt) * sizeof (char *), UM_SLEEP | UM_GC);
funcs = mdb_zalloc(strlen(fmt) * sizeof (void *), UM_SLEEP | UM_GC);
@@ -3090,22 +3085,22 @@ static char _mdb_printf_help[] =
"\n"
" %% Prints the '%' symbol.\n"
" %a Prints the member in symbolic form.\n"
-" %d Prints the member as a decimal integer. If the member is a signed\n"
+" %d Prints the member as a decimal integer. If the member is a signed\n"
" integer type, the output will be signed.\n"
" %H Prints the member as a human-readable size.\n"
" %I Prints the member as an IPv4 address (must be 32-bit integer type).\n"
" %N Prints the member as an IPv6 address (must be of type in6_addr_t).\n"
" %o Prints the member as an unsigned octal integer.\n"
" %p Prints the member as a pointer, in hexadecimal.\n"
-" %q Prints the member in signed octal. Honk if you ever use this!\n"
-" %r Prints the member as an unsigned value in the current output radix.\n"
-" %R Prints the member as a signed value in the current output radix.\n"
+" %q Prints the member in signed octal. Honk if you ever use this!\n"
+" %r Prints the member as an unsigned value in the current output radix. \n"
+" %R Prints the member as a signed value in the current output radix. \n"
" %s Prints the member as a string (requires a pointer or an array of\n"
" characters).\n"
" %u Prints the member as an unsigned decimal integer.\n"
" %x Prints the member in hexadecimal.\n"
" %X Prints the member in hexadecimal, using the characters A-F as the\n"
-" digits for the values 10-15.\n"
+" digits for the values 10-15. \n"
" %Y Prints the member as a time_t as the string "
"'year month day HH:MM:SS'.\n"
"\n"
@@ -3118,13 +3113,13 @@ static char _mdb_printf_help[] =
"\n"
"The following flag specifers are recognized by ::printf:\n"
"\n"
-" %- Left-justify the output within the specified field width. If the\n"
+" %- Left-justify the output within the specified field width. If the\n"
" width of the output is less than the specified field width, the\n"
-" output will be padded with blanks on the right-hand side. Without\n"
+" output will be padded with blanks on the right-hand side. Without\n"
" %-, values are right-justified by default.\n"
"\n"
" %0 Zero-fill the output field if the output is right-justified and the\n"
-" width of the output is less than the specified field width. Without\n"
+" width of the output is less than the specified field width. Without\n"
" %0, right-justified values are prepended with blanks in order to\n"
" fill the field.\n"
"\n"
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_print.h b/usr/src/cmd/mdb/common/mdb/mdb_print.h
index 47b434c213..7449e8e71a 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_print.h
+++ b/usr/src/cmd/mdb/common/mdb/mdb_print.h
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_proc.c b/usr/src/cmd/mdb/common/mdb/mdb_proc.c
index 667bfe8c47..e3d9833a6b 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_proc.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_proc.c
@@ -2173,11 +2173,20 @@ static const mdb_walker_t pt_walkers[] = {
{ NULL }
};
+static int
+pt_agent_check(boolean_t *agent, const lwpstatus_t *psp)
+{
+ if (psp->pr_flags & PR_AGENT)
+ *agent = B_TRUE;
+
+ return (0);
+}
static void
pt_activate_common(mdb_tgt_t *t)
{
pt_data_t *pt = t->t_data;
+ boolean_t hasagent = B_FALSE;
GElf_Sym sym;
/*
@@ -2191,13 +2200,23 @@ pt_activate_common(mdb_tgt_t *t)
"library information will not be available\n");
}
- /*
- * If we have a libproc handle and libthread is loaded, attempt to load
- * and initialize the corresponding libthread_db. If this fails, fall
- * back to our native LWP implementation and issue a warning.
- */
- if (t->t_pshandle != NULL && Pstate(t->t_pshandle) != PS_IDLE)
+ if (t->t_pshandle != NULL) {
+ (void) Plwp_iter(t->t_pshandle,
+ (proc_lwp_f *)pt_agent_check, &hasagent);
+ }
+
+ if (hasagent) {
+ mdb_warn("agent lwp detected; forcing "
+ "lwp thread model (use ::tmodel to change)\n");
+ } else if (t->t_pshandle != NULL && Pstate(t->t_pshandle) != PS_IDLE) {
+ /*
+ * If we have a libproc handle and we do not have an agent LWP,
+ * look for the correct thread debugging library. (If we have
+ * an agent LWP, we leave the model as the raw LWP model to
+ * allow the agent LWP to be visible to the debugger.)
+ */
(void) Pobject_iter(t->t_pshandle, (proc_map_f *)thr_check, t);
+ }
/*
* If there's a global object named '_mdb_abort_info', assuming we're
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_tab.c b/usr/src/cmd/mdb/common/mdb/mdb_tab.c
index af32623470..66bd18586e 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_tab.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_tab.c
@@ -388,11 +388,6 @@ mdb_tab_size(mdb_tab_cookie_t *mcp)
return (mdb_nv_size(&mcp->mtc_nv));
}
-/*
- * Determine whether the specified name is a valid tab completion for
- * the given command. If the name is a valid tab completion then
- * it will be saved in the mdb_tab_cookie_t.
- */
void
mdb_tab_insert(mdb_tab_cookie_t *mcp, const char *name)
{
@@ -508,31 +503,18 @@ tab_complete_type(mdb_ctf_id_t id, void *arg)
mdb_tab_cookie_t *mcp = arg;
uint_t flags = (uint_t)(uintptr_t)mcp->mtc_cba;
- /*
- * CTF data includes types that mdb commands don't understand. Before
- * we resolve the actual type prune any entry that is a type we
- * don't care about.
- */
- switch (mdb_ctf_type_kind(id)) {
- case CTF_K_CONST:
- case CTF_K_RESTRICT:
- case CTF_K_VOLATILE:
- return (0);
- }
-
if (mdb_ctf_type_resolve(id, &rid) != 0)
return (1);
rkind = mdb_ctf_type_kind(rid);
-
- if ((flags & MDB_TABC_MEMBERS) && rkind != CTF_K_STRUCT &&
+ if (flags & MDB_TABC_MEMBERS && rkind != CTF_K_STRUCT &&
rkind != CTF_K_UNION)
return (0);
- if ((flags & MDB_TABC_NOPOINT) && rkind == CTF_K_POINTER)
+ if (flags & MDB_TABC_NOPOINT && rkind == CTF_K_POINTER)
return (0);
- if ((flags & MDB_TABC_NOARRAY) && rkind == CTF_K_ARRAY)
+ if (flags & MDB_TABC_NOARRAY && rkind == CTF_K_ARRAY)
return (0);
(void) mdb_ctf_type_name(id, buf, sizeof (buf));
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_termio.c b/usr/src/cmd/mdb/common/mdb/mdb_termio.c
index 5e36cda7ad..9f9571d925 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_termio.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_termio.c
@@ -22,6 +22,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_whatis.c b/usr/src/cmd/mdb/common/mdb/mdb_whatis.c
index 1b53a32d39..6a26a7dec9 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_whatis.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_whatis.c
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/cmd/mdb/common/modules/dtrace/dtrace.c b/usr/src/cmd/mdb/common/modules/dtrace/dtrace.c
index f484828b75..50ad2c3497 100644
--- a/usr/src/cmd/mdb/common/modules/dtrace/dtrace.c
+++ b/usr/src/cmd/mdb/common/modules/dtrace/dtrace.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -432,6 +433,7 @@ dtracemdb_bufsnap(dtrace_buffer_t *which, dtrace_bufdesc_t *desc)
desc->dtbd_size = bufsize;
desc->dtbd_drops = buf.dtb_drops;
desc->dtbd_errors = buf.dtb_errors;
+ desc->dtbd_timestamp = gethrtime();
return (0);
}
@@ -1273,19 +1275,19 @@ int
dtrace_helptrace_init(mdb_walk_state_t *wsp)
{
uint32_t next;
- int enabled;
+ uintptr_t buffer;
if (wsp->walk_addr != NULL) {
mdb_warn("dtrace_helptrace only supports global walks\n");
return (WALK_ERR);
}
- if (mdb_readvar(&enabled, "dtrace_helptrace_enabled") == -1) {
- mdb_warn("couldn't read 'dtrace_helptrace_enabled'");
+ if (mdb_readvar(&buffer, "dtrace_helptrace_buffer") == -1) {
+ mdb_warn("couldn't read 'dtrace_helptrace_buffer'");
return (WALK_ERR);
}
- if (!enabled) {
+ if (buffer == NULL) {
mdb_warn("helper tracing is not enabled\n");
return (WALK_ERR);
}
diff --git a/usr/src/cmd/mdb/common/modules/genunix/genunix.c b/usr/src/cmd/mdb/common/modules/genunix/genunix.c
index 5c36997799..786b898630 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/genunix.c
+++ b/usr/src/cmd/mdb/common/modules/genunix/genunix.c
@@ -113,10 +113,6 @@
*/
#define NINTR 16
-#define KILOS 10
-#define MEGS 20
-#define GIGS 30
-
#ifndef STACK_BIAS
#define STACK_BIAS 0
#endif
@@ -1904,24 +1900,24 @@ typedef struct datafmt {
} datafmt_t;
static datafmt_t kmemfmt[] = {
- { "cache ", "name ",
- "-------------------------", "%-25s " },
- { " buf", " size", "------", "%6u " },
- { " buf", "in use", "------", "%6u " },
- { " buf", " total", "------", "%6u " },
- { " memory", " in use", "----------", "%10lu%c " },
- { " alloc", " succeed", "---------", "%9u " },
- { "alloc", " fail", "-----", "%5u " },
+ { "cache ", "name ",
+ "------------------------------", "%-30s " },
+ { " buf", " size", "-----", "%5H " },
+ { " buf", " in use", "---------", "%9u " },
+ { " buf", " total", "---------", "%9u " },
+ { "memory", "in use", "------", "%6lH " },
+ { " alloc", " succeed", "----------", "%10u " },
+ { "alloc", " fail", "-----", "%5u" },
{ NULL, NULL, NULL, NULL }
};
static datafmt_t vmemfmt[] = {
- { "vmem ", "name ",
- "-------------------------", "%-*s " },
- { " memory", " in use", "----------", "%9llu%c " },
- { " memory", " total", "-----------", "%10llu%c " },
- { " memory", " import", "----------", "%9llu%c " },
- { " alloc", " succeed", "---------", "%9llu " },
+ { "vmem ", "name ",
+ "------------------------------", "%-*s " },
+ { " memory", " in use", "---------", "%9llH " },
+ { " memory", " total", "----------", "%10llH " },
+ { " memory", " import", "---------", "%9llH " },
+ { " alloc", " succeed", "----------", "%10llu " },
{ "alloc", " fail", "-----", "%5llu " },
{ NULL, NULL, NULL, NULL }
};
@@ -1973,15 +1969,9 @@ typedef struct kmastat_vmem {
int kv_fail;
} kmastat_vmem_t;
-typedef struct kmastat_args {
- kmastat_vmem_t **ka_kvpp;
- uint_t ka_shift;
-} kmastat_args_t;
-
static int
-kmastat_cache(uintptr_t addr, const kmem_cache_t *cp, kmastat_args_t *kap)
+kmastat_cache(uintptr_t addr, const kmem_cache_t *cp, kmastat_vmem_t **kvpp)
{
- kmastat_vmem_t **kvpp = kap->ka_kvpp;
kmastat_vmem_t *kv;
datafmt_t *dfp = kmemfmt;
int magsize;
@@ -2022,9 +2012,7 @@ out:
mdb_printf((dfp++)->fmt, cp->cache_bufsize);
mdb_printf((dfp++)->fmt, total - avail);
mdb_printf((dfp++)->fmt, total);
- mdb_printf((dfp++)->fmt, meminuse >> kap->ka_shift,
- kap->ka_shift == GIGS ? 'G' : kap->ka_shift == MEGS ? 'M' :
- kap->ka_shift == KILOS ? 'K' : 'B');
+ mdb_printf((dfp++)->fmt, meminuse);
mdb_printf((dfp++)->fmt, alloc);
mdb_printf((dfp++)->fmt, cp->cache_alloc_fail);
mdb_printf("\n");
@@ -2033,9 +2021,8 @@ out:
}
static int
-kmastat_vmem_totals(uintptr_t addr, const vmem_t *v, kmastat_args_t *kap)
+kmastat_vmem_totals(uintptr_t addr, const vmem_t *v, kmastat_vmem_t *kv)
{
- kmastat_vmem_t *kv = *kap->ka_kvpp;
size_t len;
while (kv != NULL && kv->kv_addr != addr)
@@ -2044,20 +2031,18 @@ kmastat_vmem_totals(uintptr_t addr, const vmem_t *v, kmastat_args_t *kap)
if (kv == NULL || kv->kv_alloc == 0)
return (WALK_NEXT);
- len = MIN(17, strlen(v->vm_name));
+ len = MIN(22, strlen(v->vm_name));
- mdb_printf("Total [%s]%*s %6s %6s %6s %10lu%c %9u %5u\n", v->vm_name,
- 17 - len, "", "", "", "",
- kv->kv_meminuse >> kap->ka_shift,
- kap->ka_shift == GIGS ? 'G' : kap->ka_shift == MEGS ? 'M' :
- kap->ka_shift == KILOS ? 'K' : 'B', kv->kv_alloc, kv->kv_fail);
+ mdb_printf("Total [%s]%*s %5s %9s %9s %6lH %10u %5u\n", v->vm_name,
+ 22 - len, "", "", "", "",
+ kv->kv_meminuse, kv->kv_alloc, kv->kv_fail);
return (WALK_NEXT);
}
/*ARGSUSED*/
static int
-kmastat_vmem(uintptr_t addr, const vmem_t *v, const uint_t *shiftp)
+kmastat_vmem(uintptr_t addr, const vmem_t *v, const void *ignored)
{
datafmt_t *dfp = vmemfmt;
const vmem_kstat_t *vkp = &v->vm_kstat;
@@ -2075,16 +2060,10 @@ kmastat_vmem(uintptr_t addr, const vmem_t *v, const uint_t *shiftp)
}
mdb_printf("%*s", ident, "");
- mdb_printf((dfp++)->fmt, 25 - ident, v->vm_name);
- mdb_printf((dfp++)->fmt, vkp->vk_mem_inuse.value.ui64 >> *shiftp,
- *shiftp == GIGS ? 'G' : *shiftp == MEGS ? 'M' :
- *shiftp == KILOS ? 'K' : 'B');
- mdb_printf((dfp++)->fmt, vkp->vk_mem_total.value.ui64 >> *shiftp,
- *shiftp == GIGS ? 'G' : *shiftp == MEGS ? 'M' :
- *shiftp == KILOS ? 'K' : 'B');
- mdb_printf((dfp++)->fmt, vkp->vk_mem_import.value.ui64 >> *shiftp,
- *shiftp == GIGS ? 'G' : *shiftp == MEGS ? 'M' :
- *shiftp == KILOS ? 'K' : 'B');
+ mdb_printf((dfp++)->fmt, 30 - ident, v->vm_name);
+ mdb_printf((dfp++)->fmt, vkp->vk_mem_inuse.value.ui64);
+ mdb_printf((dfp++)->fmt, vkp->vk_mem_total.value.ui64);
+ mdb_printf((dfp++)->fmt, vkp->vk_mem_import.value.ui64);
mdb_printf((dfp++)->fmt, vkp->vk_alloc.value.ui64);
mdb_printf((dfp++)->fmt, vkp->vk_fail.value.ui64);
@@ -2099,44 +2078,35 @@ kmastat(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
{
kmastat_vmem_t *kv = NULL;
datafmt_t *dfp;
- kmastat_args_t ka;
-
- ka.ka_shift = 0;
- if (mdb_getopts(argc, argv,
- 'k', MDB_OPT_SETBITS, KILOS, &ka.ka_shift,
- 'm', MDB_OPT_SETBITS, MEGS, &ka.ka_shift,
- 'g', MDB_OPT_SETBITS, GIGS, &ka.ka_shift, NULL) != argc)
- return (DCMD_USAGE);
for (dfp = kmemfmt; dfp->hdr1 != NULL; dfp++)
- mdb_printf("%s ", dfp->hdr1);
+ mdb_printf("%s%s", dfp == kmemfmt ? "" : " ", dfp->hdr1);
mdb_printf("\n");
for (dfp = kmemfmt; dfp->hdr1 != NULL; dfp++)
- mdb_printf("%s ", dfp->hdr2);
+ mdb_printf("%s%s", dfp == kmemfmt ? "" : " ", dfp->hdr2);
mdb_printf("\n");
for (dfp = kmemfmt; dfp->hdr1 != NULL; dfp++)
- mdb_printf("%s ", dfp->dashes);
+ mdb_printf("%s%s", dfp == kmemfmt ? "" : " ", dfp->dashes);
mdb_printf("\n");
- ka.ka_kvpp = &kv;
- if (mdb_walk("kmem_cache", (mdb_walk_cb_t)kmastat_cache, &ka) == -1) {
+ if (mdb_walk("kmem_cache", (mdb_walk_cb_t)kmastat_cache, &kv) == -1) {
mdb_warn("can't walk 'kmem_cache'");
return (DCMD_ERR);
}
for (dfp = kmemfmt; dfp->hdr1 != NULL; dfp++)
- mdb_printf("%s ", dfp->dashes);
+ mdb_printf("%s%s", dfp == kmemfmt ? "" : " ", dfp->dashes);
mdb_printf("\n");
- if (mdb_walk("vmem", (mdb_walk_cb_t)kmastat_vmem_totals, &ka) == -1) {
+ if (mdb_walk("vmem", (mdb_walk_cb_t)kmastat_vmem_totals, kv) == -1) {
mdb_warn("can't walk 'vmem'");
return (DCMD_ERR);
}
for (dfp = kmemfmt; dfp->hdr1 != NULL; dfp++)
- mdb_printf("%s ", dfp->dashes);
+ mdb_printf("%s%s", dfp == kmemfmt ? "" : " ", dfp->dashes);
mdb_printf("\n");
mdb_printf("\n");
@@ -2153,7 +2123,7 @@ kmastat(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
mdb_printf("%s ", dfp->dashes);
mdb_printf("\n");
- if (mdb_walk("vmem", (mdb_walk_cb_t)kmastat_vmem, &ka.ka_shift) == -1) {
+ if (mdb_walk("vmem", (mdb_walk_cb_t)kmastat_vmem, NULL) == -1) {
mdb_warn("can't walk 'vmem'");
return (DCMD_ERR);
}
@@ -3993,8 +3963,7 @@ static const mdb_dcmd_t dcmds[] = {
{ "freedby", ":", "given a thread, print its freed buffers", freedby },
{ "kmalog", "?[ fail | slab ]",
"display kmem transaction log and stack traces", kmalog },
- { "kmastat", "[-kmg]", "kernel memory allocator stats",
- kmastat },
+ { "kmastat", NULL, "kernel memory allocator stats", kmastat },
{ "kmausers", "?[-ef] [cache ...]", "current medium and large users "
"of the kmem allocator", kmausers, kmausers_help },
{ "kmem_cache", "?[-n name]",
@@ -4096,6 +4065,9 @@ static const mdb_dcmd_t dcmds[] = {
/* from netstack.c */
{ "netstack", "", "show stack instances", netstack },
+ { "netstackid2netstack", ":",
+ "translate a netstack id to its netstack_t",
+ netstackid2netstack },
/* from nvpair.c */
{ NVPAIR_DCMD_NAME, NVPAIR_DCMD_USAGE, NVPAIR_DCMD_DESCR,
@@ -4186,6 +4158,10 @@ static const mdb_dcmd_t dcmds[] = {
pfiles_help },
/* from zone.c */
+ { "zid2zone", ":", "find the zone_t with the given zone id",
+ zid2zone },
+ { "zdid2zone", ":", "find the zone_t with the given zone debug id",
+ zdid2zone },
{ "zone", "?[-r [-v]]", "display kernel zone(s)", zoneprt },
{ "zsd", ":[-v] [zsd_key]", "display zone-specific-data entries for "
"selected zones", zsd },
diff --git a/usr/src/cmd/mdb/common/modules/genunix/netstack.c b/usr/src/cmd/mdb/common/modules/genunix/netstack.c
index 588bd6dbf3..d46bd85d1f 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/netstack.c
+++ b/usr/src/cmd/mdb/common/modules/genunix/netstack.c
@@ -21,10 +21,9 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_ks.h>
#include <mdb/mdb_ctf.h>
@@ -121,3 +120,30 @@ netstack(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
return (DCMD_OK);
}
+
+static int
+netstackid_lookup_cb(uintptr_t addr, const netstack_t *ns, void *arg)
+{
+ netstackid_t nid = *(uintptr_t *)arg;
+ if (ns->netstack_stackid == nid)
+ mdb_printf("%p\n", addr);
+
+ return (WALK_NEXT);
+}
+
+/*ARGSUSED*/
+int
+netstackid2netstack(uintptr_t addr, uint_t flags, int argc,
+ const mdb_arg_t *argv)
+{
+ if (!(flags & DCMD_ADDRSPEC) || argc != 0)
+ return (DCMD_USAGE);
+
+ if (mdb_walk("netstack", (mdb_walk_cb_t)netstackid_lookup_cb, &addr) ==
+ -1) {
+ mdb_warn("failed to walk zone");
+ return (DCMD_ERR);
+ }
+
+ return (DCMD_OK);
+}
diff --git a/usr/src/cmd/mdb/common/modules/genunix/netstack.h b/usr/src/cmd/mdb/common/modules/genunix/netstack.h
index 392565caca..f5773c36c1 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/netstack.h
+++ b/usr/src/cmd/mdb/common/modules/genunix/netstack.h
@@ -26,8 +26,6 @@
#ifndef _NETSTACK_H
#define _NETSTACK_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <mdb/mdb_modapi.h>
#ifdef __cplusplus
@@ -38,6 +36,7 @@ int netstack_walk_init(mdb_walk_state_t *);
int netstack_walk_step(mdb_walk_state_t *);
int netstack(uintptr_t, uint_t, int, const mdb_arg_t *);
+int netstackid2netstack(uintptr_t, uint_t, int, const mdb_arg_t *);
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/mdb/common/modules/genunix/zone.c b/usr/src/cmd/mdb/common/modules/genunix/zone.c
index 96f6b598ec..77ed2cbc48 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/zone.c
+++ b/usr/src/cmd/mdb/common/modules/genunix/zone.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <mdb/mdb_param.h>
@@ -33,9 +34,9 @@
#define ZONE_NAMELEN 20
#ifdef _LP64
-#define ZONE_PATHLEN 32
+#define ZONE_PATHLEN 25
#else
-#define ZONE_PATHLEN 40
+#define ZONE_PATHLEN 33
#endif
/*
@@ -54,6 +55,56 @@ char *zone_status_names[] = {
"dead" /* ZONE_IS_DEAD */
};
+static int
+zid_lookup_cb(uintptr_t addr, const zone_t *zone, void *arg)
+{
+ zoneid_t zid = *(uintptr_t *)arg;
+ if (zone->zone_id == zid)
+ mdb_printf("%p\n", addr);
+
+ return (WALK_NEXT);
+}
+
+/*ARGSUSED*/
+int
+zid2zone(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ if (!(flags & DCMD_ADDRSPEC) || argc != 0)
+ return (DCMD_USAGE);
+
+ if (mdb_walk("zone", (mdb_walk_cb_t)zid_lookup_cb, &addr) == -1) {
+ mdb_warn("failed to walk zone");
+ return (DCMD_ERR);
+ }
+
+ return (DCMD_OK);
+}
+
+static int
+zdid_lookup_cb(uintptr_t addr, const zone_t *zone, void *arg)
+{
+ zoneid_t zdid = *(uintptr_t *)arg;
+ if (zone->zone_did == zdid)
+ mdb_printf("%p\n", addr);
+
+ return (WALK_NEXT);
+}
+
+/*ARGSUSED*/
+int
+zdid2zone(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ if (!(flags & DCMD_ADDRSPEC) || argc != 0)
+ return (DCMD_USAGE);
+
+ if (mdb_walk("zone", (mdb_walk_cb_t)zdid_lookup_cb, &addr) == -1) {
+ mdb_warn("failed to walk zone");
+ return (DCMD_ERR);
+ }
+
+ return (DCMD_OK);
+}
+
int
zoneprt(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
{
@@ -96,10 +147,10 @@ zoneprt(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
*/
if (DCMD_HDRSPEC(flags)) {
if (ropt_given == FALSE)
- mdb_printf("%<u>%?s %6s %-13s %-20s %-s%</u>\n",
+ mdb_printf("%<u>%?s %4s %-13s %-19s %-s%</u>\n",
"ADDR", "ID", "STATUS", "NAME", "PATH");
else
- mdb_printf("%<u>%?s %6s %10s %10s %-20s%</u>\n",
+ mdb_printf("%<u>%?s %6s %10s %10s %-19s%</u>\n",
"ADDR", "ID", "REFS", "CREFS", "NAME");
}
@@ -138,7 +189,7 @@ zoneprt(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
statusp = zone_status_names[zn.zone_status];
else
statusp = "???";
- mdb_printf("%0?p %6d %-13s %-20s %s\n", addr, zn.zone_id,
+ mdb_printf("%0?p %4d %-13s %-19s %s\n", addr, zn.zone_id,
statusp, name, path);
} else {
/*
@@ -146,7 +197,7 @@ zoneprt(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
* Display the zone's subsystem-specific reference counts if
* the user specified the '-v' option.
*/
- mdb_printf("%0?p %6d %10u %10u %-20s\n", addr, zn.zone_id,
+ mdb_printf("%0?p %6d %10u %10u %-19s\n", addr, zn.zone_id,
zn.zone_ref, zn.zone_cred_ref, name);
if (vopt_given == TRUE) {
GElf_Sym subsys_names_sym;
@@ -384,7 +435,7 @@ zsd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
* Prepare to output the specified zone's ZSD information.
*/
if (DCMD_HDRSPEC(flags))
- mdb_printf("%<u>%-20s %?s %?s %8s%</u>\n", "ZONE", "KEY",
+ mdb_printf("%<u>%-19s %?s %?s %8s%</u>\n", "ZONE", "KEY",
"VALUE", "FLAGS");
len = mdb_readstr(name, ZONE_NAMELEN, (uintptr_t)zone.zone_name);
if (len > 0) {
@@ -393,7 +444,7 @@ zsd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
} else {
(void) strcpy(name, "??");
}
- mdb_printf("%-20s ", name);
+ mdb_printf("%-19s ", name);
/*
* Display the requested ZSD entries.
diff --git a/usr/src/cmd/mdb/common/modules/genunix/zone.h b/usr/src/cmd/mdb/common/modules/genunix/zone.h
index e0e5038527..94a383e41c 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/zone.h
+++ b/usr/src/cmd/mdb/common/modules/genunix/zone.h
@@ -27,14 +27,14 @@
#ifndef _ZONE_H
#define _ZONE_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <mdb/mdb_modapi.h>
#ifdef __cplusplus
extern "C" {
#endif
+extern int zid2zone(uintptr_t, uint_t, int argc, const mdb_arg_t *);
+extern int zdid2zone(uintptr_t, uint_t, int argc, const mdb_arg_t *);
extern int zoneprt(uintptr_t, uint_t, int argc, const mdb_arg_t *);
extern int zone_walk_init(mdb_walk_state_t *);
diff --git a/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c b/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c
new file mode 100644
index 0000000000..eaa443c225
--- /dev/null
+++ b/usr/src/cmd/mdb/common/modules/v8/mdb_v8.c
@@ -0,0 +1,4245 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * mdb(1M) module for debugging the V8 JavaScript engine. This implementation
+ * makes heavy use of metadata defined in the V8 binary for inspecting in-memory
+ * structures. Canned configurations can be manually loaded for V8 binaries
+ * that predate this metadata. See mdb_v8_cfg.c for details.
+ *
+ * NOTE: This dmod implementation (including this file and related headers and C
+ * files) exist in both the Node and illumos source trees. THESE SHOULD BE KEPT
+ * IN SYNC. The version in the Node tree is built directly into modern Node
+ * binaries as part of the build process, and the version in the illumos source
+ * tree is delivered with the OS for debugging Node binaries that predate
+ * support for including the dmod directly in the binary. Note too that these
+ * files have different licenses to match their corresponding repositories.
+ */
+
+/*
+ * We hard-code our MDB_API_VERSION to be 3 to allow this module to be
+ * compiled on systems with higher version numbers, but still allow the
+ * resulting binary object to be used on older systems. (We do not make use
+ * of functionality present in versions later than 3.) This is particularly
+ * important for mdb_v8 because (1) it's used in particular to debug
+ * application-level software and (2) it has a history of rapid evolution.
+ */
+#define MDB_API_VERSION 3
+
+#include <sys/mdb_modapi.h>
+#include <assert.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <libproc.h>
+#include <sys/avl.h>
+#include <alloca.h>
+
+#include "v8dbg.h"
+#include "v8cfg.h"
+
+#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
+
+/*
+ * The "v8_class" and "v8_field" structures describe the C++ classes used to
+ * represent V8 heap objects.
+ */
+typedef struct v8_class {
+ struct v8_class *v8c_next; /* list linkage */
+ struct v8_class *v8c_parent; /* parent class (inheritance) */
+ struct v8_field *v8c_fields; /* array of class fields */
+ size_t v8c_start; /* offset of first class field */
+ size_t v8c_end; /* offset of first subclass field */
+ char v8c_name[64]; /* heap object class name */
+} v8_class_t;
+
+typedef struct v8_field {
+ struct v8_field *v8f_next; /* list linkage */
+ ssize_t v8f_offset; /* field offset */
+ char v8f_name[64]; /* field name */
+ boolean_t v8f_isbyte; /* 1-byte int field */
+ boolean_t v8f_isstr; /* NUL-terminated string */
+} v8_field_t;
+
+/*
+ * Similarly, the "v8_enum" structure describes an enum from V8.
+ */
+typedef struct {
+ char v8e_name[64];
+ uint_t v8e_value;
+} v8_enum_t;
+
+/*
+ * During configuration, the dmod updates these globals with the actual set of
+ * classes, types, and frame types based on the debug metadata.
+ */
+static v8_class_t *v8_classes;
+
+static v8_enum_t v8_types[128];
+static int v8_next_type;
+
+static v8_enum_t v8_frametypes[16];
+static int v8_next_frametype;
+
+static int v8_silent;
+
+/*
+ * The following constants describe offsets from the frame pointer that are used
+ * to inspect each stack frame. They're initialized from the debug metadata.
+ */
+static ssize_t V8_OFF_FP_CONTEXT;
+static ssize_t V8_OFF_FP_MARKER;
+static ssize_t V8_OFF_FP_FUNCTION;
+static ssize_t V8_OFF_FP_ARGS;
+
+/*
+ * The following constants are used by macros defined in heap-dbg-common.h to
+ * examine the types of various V8 heap objects. In general, the macros should
+ * be preferred to using the constants directly. The values of these constants
+ * are initialized from the debug metadata.
+ */
+static intptr_t V8_FirstNonstringType;
+static intptr_t V8_IsNotStringMask;
+static intptr_t V8_StringTag;
+static intptr_t V8_NotStringTag;
+static intptr_t V8_StringEncodingMask;
+static intptr_t V8_TwoByteStringTag;
+static intptr_t V8_AsciiStringTag;
+static intptr_t V8_StringRepresentationMask;
+static intptr_t V8_SeqStringTag;
+static intptr_t V8_ConsStringTag;
+static intptr_t V8_SlicedStringTag;
+static intptr_t V8_ExternalStringTag;
+static intptr_t V8_FailureTag;
+static intptr_t V8_FailureTagMask;
+static intptr_t V8_HeapObjectTag;
+static intptr_t V8_HeapObjectTagMask;
+static intptr_t V8_SmiTag;
+static intptr_t V8_SmiTagMask;
+static intptr_t V8_SmiValueShift;
+static intptr_t V8_SmiShiftSize;
+static intptr_t V8_PointerSizeLog2;
+
+static intptr_t V8_ISSHARED_SHIFT;
+static intptr_t V8_DICT_SHIFT;
+static intptr_t V8_DICT_PREFIX_SIZE;
+static intptr_t V8_DICT_ENTRY_SIZE;
+static intptr_t V8_DICT_START_INDEX;
+static intptr_t V8_PROP_IDX_CONTENT;
+static intptr_t V8_PROP_IDX_FIRST;
+static intptr_t V8_PROP_TYPE_FIELD;
+static intptr_t V8_PROP_FIRST_PHANTOM;
+static intptr_t V8_PROP_TYPE_MASK;
+static intptr_t V8_PROP_DESC_KEY;
+static intptr_t V8_PROP_DESC_DETAILS;
+static intptr_t V8_PROP_DESC_VALUE;
+static intptr_t V8_PROP_DESC_SIZE;
+static intptr_t V8_TRANSITIONS_IDX_DESC;
+
+static intptr_t V8_TYPE_JSOBJECT = -1;
+static intptr_t V8_TYPE_JSARRAY = -1;
+static intptr_t V8_TYPE_FIXEDARRAY = -1;
+
+/*
+ * Although we have this information in v8_classes, the following offsets are
+ * defined explicitly because they're used directly in code below.
+ */
+static ssize_t V8_OFF_CODE_INSTRUCTION_SIZE;
+static ssize_t V8_OFF_CODE_INSTRUCTION_START;
+static ssize_t V8_OFF_CONSSTRING_FIRST;
+static ssize_t V8_OFF_CONSSTRING_SECOND;
+static ssize_t V8_OFF_EXTERNALSTRING_RESOURCE;
+static ssize_t V8_OFF_FIXEDARRAY_DATA;
+static ssize_t V8_OFF_FIXEDARRAY_LENGTH;
+static ssize_t V8_OFF_HEAPNUMBER_VALUE;
+static ssize_t V8_OFF_HEAPOBJECT_MAP;
+static ssize_t V8_OFF_JSARRAY_LENGTH;
+static ssize_t V8_OFF_JSDATE_VALUE;
+static ssize_t V8_OFF_JSFUNCTION_SHARED;
+static ssize_t V8_OFF_JSOBJECT_ELEMENTS;
+static ssize_t V8_OFF_JSOBJECT_PROPERTIES;
+static ssize_t V8_OFF_MAP_CONSTRUCTOR;
+static ssize_t V8_OFF_MAP_INOBJECT_PROPERTIES;
+static ssize_t V8_OFF_MAP_INSTANCE_ATTRIBUTES;
+static ssize_t V8_OFF_MAP_INSTANCE_DESCRIPTORS;
+static ssize_t V8_OFF_MAP_INSTANCE_SIZE;
+static ssize_t V8_OFF_MAP_BIT_FIELD3;
+static ssize_t V8_OFF_MAP_TRANSITIONS;
+static ssize_t V8_OFF_ODDBALL_TO_STRING;
+static ssize_t V8_OFF_SCRIPT_LINE_ENDS;
+static ssize_t V8_OFF_SCRIPT_NAME;
+static ssize_t V8_OFF_SEQASCIISTR_CHARS;
+static ssize_t V8_OFF_SEQONEBYTESTR_CHARS;
+static ssize_t V8_OFF_SEQTWOBYTESTR_CHARS;
+static ssize_t V8_OFF_SHAREDFUNCTIONINFO_CODE;
+static ssize_t V8_OFF_SHAREDFUNCTIONINFO_FUNCTION_TOKEN_POSITION;
+static ssize_t V8_OFF_SHAREDFUNCTIONINFO_INFERRED_NAME;
+static ssize_t V8_OFF_SHAREDFUNCTIONINFO_LENGTH;
+static ssize_t V8_OFF_SHAREDFUNCTIONINFO_SCRIPT;
+static ssize_t V8_OFF_SHAREDFUNCTIONINFO_NAME;
+static ssize_t V8_OFF_SLICEDSTRING_PARENT;
+static ssize_t V8_OFF_SLICEDSTRING_OFFSET;
+static ssize_t V8_OFF_STRING_LENGTH;
+
+#define NODE_OFF_EXTSTR_DATA 0x4 /* see node_string.h */
+
+#define V8_CONSTANT_OPTIONAL 1
+#define V8_CONSTANT_HASFALLBACK 2
+
+#define V8_CONSTANT_MAJORSHIFT 3
+#define V8_CONSTANT_MAJORMASK ((1 << 4) - 1)
+#define V8_CONSTANT_MAJOR(flags) \
+ (((flags) >> V8_CONSTANT_MAJORSHIFT) & V8_CONSTANT_MAJORMASK)
+
+#define V8_CONSTANT_MINORSHIFT 7
+#define V8_CONSTANT_MINORMASK ((1 << 9) - 1)
+#define V8_CONSTANT_MINOR(flags) \
+ (((flags) >> V8_CONSTANT_MINORSHIFT) & V8_CONSTANT_MINORMASK)
+
+#define V8_CONSTANT_FALLBACK(maj, min) \
+ (V8_CONSTANT_OPTIONAL | V8_CONSTANT_HASFALLBACK | \
+ ((maj) << V8_CONSTANT_MAJORSHIFT) | ((min) << V8_CONSTANT_MINORSHIFT))
+
+/*
+ * Table of constants used directly by this file.
+ */
+typedef struct v8_constant {
+ intptr_t *v8c_valp;
+ const char *v8c_symbol;
+ uint32_t v8c_flags;
+ intptr_t v8c_fallback;
+} v8_constant_t;
+
+static v8_constant_t v8_constants[] = {
+ { &V8_OFF_FP_CONTEXT, "v8dbg_off_fp_context" },
+ { &V8_OFF_FP_FUNCTION, "v8dbg_off_fp_function" },
+ { &V8_OFF_FP_MARKER, "v8dbg_off_fp_marker" },
+ { &V8_OFF_FP_ARGS, "v8dbg_off_fp_args" },
+
+ { &V8_FirstNonstringType, "v8dbg_FirstNonstringType" },
+ { &V8_IsNotStringMask, "v8dbg_IsNotStringMask" },
+ { &V8_StringTag, "v8dbg_StringTag" },
+ { &V8_NotStringTag, "v8dbg_NotStringTag" },
+ { &V8_StringEncodingMask, "v8dbg_StringEncodingMask" },
+ { &V8_TwoByteStringTag, "v8dbg_TwoByteStringTag" },
+ { &V8_AsciiStringTag, "v8dbg_AsciiStringTag" },
+ { &V8_StringRepresentationMask, "v8dbg_StringRepresentationMask" },
+ { &V8_SeqStringTag, "v8dbg_SeqStringTag" },
+ { &V8_ConsStringTag, "v8dbg_ConsStringTag" },
+ { &V8_SlicedStringTag, "v8dbg_SlicedStringTag",
+ V8_CONSTANT_FALLBACK(0, 0), 0x3 },
+ { &V8_ExternalStringTag, "v8dbg_ExternalStringTag" },
+ { &V8_FailureTag, "v8dbg_FailureTag" },
+ { &V8_FailureTagMask, "v8dbg_FailureTagMask" },
+ { &V8_HeapObjectTag, "v8dbg_HeapObjectTag" },
+ { &V8_HeapObjectTagMask, "v8dbg_HeapObjectTagMask" },
+ { &V8_SmiTag, "v8dbg_SmiTag" },
+ { &V8_SmiTagMask, "v8dbg_SmiTagMask" },
+ { &V8_SmiValueShift, "v8dbg_SmiValueShift" },
+ { &V8_SmiShiftSize, "v8dbg_SmiShiftSize",
+#ifdef _LP64
+ V8_CONSTANT_FALLBACK(0, 0), 31 },
+#else
+ V8_CONSTANT_FALLBACK(0, 0), 0 },
+#endif
+ { &V8_PointerSizeLog2, "v8dbg_PointerSizeLog2" },
+
+ { &V8_DICT_SHIFT, "v8dbg_dict_shift",
+ V8_CONSTANT_FALLBACK(3, 13), 24 },
+ { &V8_DICT_PREFIX_SIZE, "v8dbg_dict_prefix_size",
+ V8_CONSTANT_FALLBACK(3, 11), 2 },
+ { &V8_DICT_ENTRY_SIZE, "v8dbg_dict_entry_size",
+ V8_CONSTANT_FALLBACK(3, 11), 3 },
+ { &V8_DICT_START_INDEX, "v8dbg_dict_start_index",
+ V8_CONSTANT_FALLBACK(3, 11), 3 },
+ { &V8_ISSHARED_SHIFT, "v8dbg_isshared_shift",
+ V8_CONSTANT_FALLBACK(3, 11), 0 },
+ { &V8_PROP_IDX_FIRST, "v8dbg_prop_idx_first" },
+ { &V8_PROP_TYPE_FIELD, "v8dbg_prop_type_field" },
+ { &V8_PROP_FIRST_PHANTOM, "v8dbg_prop_type_first_phantom" },
+ { &V8_PROP_TYPE_MASK, "v8dbg_prop_type_mask" },
+ { &V8_PROP_IDX_CONTENT, "v8dbg_prop_idx_content",
+ V8_CONSTANT_OPTIONAL },
+ { &V8_PROP_DESC_KEY, "v8dbg_prop_desc_key",
+ V8_CONSTANT_FALLBACK(0, 0), 0 },
+ { &V8_PROP_DESC_DETAILS, "v8dbg_prop_desc_details",
+ V8_CONSTANT_FALLBACK(0, 0), 1 },
+ { &V8_PROP_DESC_VALUE, "v8dbg_prop_desc_value",
+ V8_CONSTANT_FALLBACK(0, 0), 2 },
+ { &V8_PROP_DESC_SIZE, "v8dbg_prop_desc_size",
+ V8_CONSTANT_FALLBACK(0, 0), 3 },
+ { &V8_TRANSITIONS_IDX_DESC, "v8dbg_transitions_idx_descriptors",
+ V8_CONSTANT_OPTIONAL },
+};
+
+static int v8_nconstants = sizeof (v8_constants) / sizeof (v8_constants[0]);
+
+typedef struct v8_offset {
+ ssize_t *v8o_valp;
+ const char *v8o_class;
+ const char *v8o_member;
+ boolean_t v8o_optional;
+ intptr_t v8o_fallback;
+} v8_offset_t;
+
+static v8_offset_t v8_offsets[] = {
+ { &V8_OFF_CODE_INSTRUCTION_SIZE,
+ "Code", "instruction_size" },
+ { &V8_OFF_CODE_INSTRUCTION_START,
+ "Code", "instruction_start" },
+ { &V8_OFF_CONSSTRING_FIRST,
+ "ConsString", "first" },
+ { &V8_OFF_CONSSTRING_SECOND,
+ "ConsString", "second" },
+ { &V8_OFF_EXTERNALSTRING_RESOURCE,
+ "ExternalString", "resource" },
+ { &V8_OFF_FIXEDARRAY_DATA,
+ "FixedArray", "data" },
+ { &V8_OFF_FIXEDARRAY_LENGTH,
+ "FixedArray", "length" },
+ { &V8_OFF_HEAPNUMBER_VALUE,
+ "HeapNumber", "value" },
+ { &V8_OFF_HEAPOBJECT_MAP,
+ "HeapObject", "map" },
+ { &V8_OFF_JSARRAY_LENGTH,
+ "JSArray", "length" },
+ { &V8_OFF_JSDATE_VALUE,
+ "JSDate", "value", B_TRUE },
+ { &V8_OFF_JSFUNCTION_SHARED,
+ "JSFunction", "shared" },
+ { &V8_OFF_JSOBJECT_ELEMENTS,
+ "JSObject", "elements" },
+ { &V8_OFF_JSOBJECT_PROPERTIES,
+ "JSObject", "properties" },
+ { &V8_OFF_MAP_CONSTRUCTOR,
+ "Map", "constructor" },
+ { &V8_OFF_MAP_INOBJECT_PROPERTIES,
+ "Map", "inobject_properties" },
+ { &V8_OFF_MAP_INSTANCE_ATTRIBUTES,
+ "Map", "instance_attributes" },
+ { &V8_OFF_MAP_INSTANCE_DESCRIPTORS,
+ "Map", "instance_descriptors", B_TRUE },
+ { &V8_OFF_MAP_TRANSITIONS,
+ "Map", "transitions", B_TRUE },
+ { &V8_OFF_MAP_INSTANCE_SIZE,
+ "Map", "instance_size" },
+ { &V8_OFF_MAP_BIT_FIELD3,
+ "Map", "bit_field3", B_TRUE },
+ { &V8_OFF_ODDBALL_TO_STRING,
+ "Oddball", "to_string" },
+ { &V8_OFF_SCRIPT_LINE_ENDS,
+ "Script", "line_ends" },
+ { &V8_OFF_SCRIPT_NAME,
+ "Script", "name" },
+ { &V8_OFF_SEQASCIISTR_CHARS,
+ "SeqAsciiString", "chars", B_TRUE },
+ { &V8_OFF_SEQONEBYTESTR_CHARS,
+ "SeqOneByteString", "chars", B_TRUE },
+ { &V8_OFF_SEQTWOBYTESTR_CHARS,
+ "SeqTwoByteString", "chars", B_TRUE },
+ { &V8_OFF_SHAREDFUNCTIONINFO_CODE,
+ "SharedFunctionInfo", "code" },
+ { &V8_OFF_SHAREDFUNCTIONINFO_FUNCTION_TOKEN_POSITION,
+ "SharedFunctionInfo", "function_token_position" },
+ { &V8_OFF_SHAREDFUNCTIONINFO_INFERRED_NAME,
+ "SharedFunctionInfo", "inferred_name" },
+ { &V8_OFF_SHAREDFUNCTIONINFO_LENGTH,
+ "SharedFunctionInfo", "length" },
+ { &V8_OFF_SHAREDFUNCTIONINFO_NAME,
+ "SharedFunctionInfo", "name" },
+ { &V8_OFF_SHAREDFUNCTIONINFO_SCRIPT,
+ "SharedFunctionInfo", "script" },
+ { &V8_OFF_SLICEDSTRING_OFFSET,
+ "SlicedString", "offset" },
+ { &V8_OFF_SLICEDSTRING_PARENT,
+ "SlicedString", "parent", B_TRUE },
+ { &V8_OFF_STRING_LENGTH,
+ "String", "length" },
+};
+
+static int v8_noffsets = sizeof (v8_offsets) / sizeof (v8_offsets[0]);
+
+static uintptr_t v8_major;
+static uintptr_t v8_minor;
+static uintptr_t v8_build;
+static uintptr_t v8_patch;
+
+static int autoconf_iter_symbol(mdb_symbol_t *, void *);
+static v8_class_t *conf_class_findcreate(const char *);
+static v8_field_t *conf_field_create(v8_class_t *, const char *, size_t);
+static char *conf_next_part(char *, char *);
+static int conf_update_parent(const char *);
+static int conf_update_field(v8_cfg_t *, const char *);
+static int conf_update_enum(v8_cfg_t *, const char *, const char *,
+ v8_enum_t *);
+static int conf_update_type(v8_cfg_t *, const char *);
+static int conf_update_frametype(v8_cfg_t *, const char *);
+static void conf_class_compute_offsets(v8_class_t *);
+
+static int read_typebyte(uint8_t *, uintptr_t);
+static int heap_offset(const char *, const char *, ssize_t *);
+
+/*
+ * Invoked when this dmod is initially loaded to load the set of classes, enums,
+ * and other constants from the metadata in the target binary.
+ */
+static int
+autoconfigure(v8_cfg_t *cfgp)
+{
+ v8_class_t *clp;
+ v8_enum_t *ep;
+ struct v8_constant *cnp;
+ int ii;
+ int failed = 0;
+
+ assert(v8_classes == NULL);
+
+ /*
+ * Iterate all global symbols looking for metadata.
+ */
+ if (cfgp->v8cfg_iter(cfgp, autoconf_iter_symbol, cfgp) != 0) {
+ mdb_warn("failed to autoconfigure V8 support\n");
+ return (-1);
+ }
+
+ /*
+ * By now we've configured all of the classes so we can update the
+ * "start" and "end" fields in each class with information from its
+ * parent class.
+ */
+ for (clp = v8_classes; clp != NULL; clp = clp->v8c_next) {
+ if (clp->v8c_end != (size_t)-1)
+ continue;
+
+ conf_class_compute_offsets(clp);
+ };
+
+ /*
+ * Load various constants used directly in the module.
+ */
+ for (ii = 0; ii < v8_nconstants; ii++) {
+ cnp = &v8_constants[ii];
+
+ if (cfgp->v8cfg_readsym(cfgp,
+ cnp->v8c_symbol, cnp->v8c_valp) != -1) {
+ continue;
+ }
+
+ if (!(cnp->v8c_flags & V8_CONSTANT_OPTIONAL)) {
+ mdb_warn("failed to read \"%s\"", cnp->v8c_symbol);
+ failed++;
+ continue;
+ }
+
+ if (!(cnp->v8c_flags & V8_CONSTANT_HASFALLBACK) ||
+ v8_major < V8_CONSTANT_MAJOR(cnp->v8c_flags) ||
+ (v8_major == V8_CONSTANT_MAJOR(cnp->v8c_flags) &&
+ v8_minor < V8_CONSTANT_MINOR(cnp->v8c_flags))) {
+ *cnp->v8c_valp = -1;
+ continue;
+ }
+
+ /*
+ * We have a fallback -- and we know that the version satisfies
+ * the fallback's version constraints; use the fallback value.
+ */
+ *cnp->v8c_valp = cnp->v8c_fallback;
+ }
+
+ /*
+ * Load type values for well-known classes that we use a lot.
+ */
+ for (ep = v8_types; ep->v8e_name[0] != '\0'; ep++) {
+ if (strcmp(ep->v8e_name, "JSObject") == 0)
+ V8_TYPE_JSOBJECT = ep->v8e_value;
+
+ if (strcmp(ep->v8e_name, "JSArray") == 0)
+ V8_TYPE_JSARRAY = ep->v8e_value;
+
+ if (strcmp(ep->v8e_name, "FixedArray") == 0)
+ V8_TYPE_FIXEDARRAY = ep->v8e_value;
+ }
+
+ if (V8_TYPE_JSOBJECT == -1) {
+ mdb_warn("couldn't find JSObject type\n");
+ failed++;
+ }
+
+ if (V8_TYPE_JSARRAY == -1) {
+ mdb_warn("couldn't find JSArray type\n");
+ failed++;
+ }
+
+ if (V8_TYPE_FIXEDARRAY == -1) {
+ mdb_warn("couldn't find FixedArray type\n");
+ failed++;
+ }
+
+ /*
+ * Finally, load various class offsets.
+ */
+ for (ii = 0; ii < v8_noffsets; ii++) {
+ struct v8_offset *offp = &v8_offsets[ii];
+ const char *klass = offp->v8o_class;
+
+again:
+ if (heap_offset(klass, offp->v8o_member, offp->v8o_valp) == 0)
+ continue;
+
+ if (strcmp(klass, "FixedArray") == 0) {
+ /*
+ * The V8 included in node v0.6 uses a FixedArrayBase
+ * class to contain the "length" field, while the one
+ * in v0.4 has no such base class and stores the field
+ * directly in FixedArray; if we failed to derive
+ * the offset from FixedArray, try FixedArrayBase.
+ */
+ klass = "FixedArrayBase";
+ goto again;
+ }
+
+ if (offp->v8o_optional) {
+ *offp->v8o_valp = -1;
+ continue;
+ }
+
+ mdb_warn("couldn't find class \"%s\", field \"%s\"\n",
+ offp->v8o_class, offp->v8o_member);
+ failed++;
+ }
+
+ if (!((V8_OFF_SEQASCIISTR_CHARS != -1) ^
+ (V8_OFF_SEQONEBYTESTR_CHARS != -1))) {
+ mdb_warn("expected exactly one of SeqAsciiString and "
+ "SeqOneByteString to be defined\n");
+ failed++;
+ }
+
+ if (V8_OFF_SEQONEBYTESTR_CHARS != -1)
+ V8_OFF_SEQASCIISTR_CHARS = V8_OFF_SEQONEBYTESTR_CHARS;
+
+ if (V8_OFF_SEQTWOBYTESTR_CHARS == -1)
+ V8_OFF_SEQTWOBYTESTR_CHARS = V8_OFF_SEQASCIISTR_CHARS;
+
+ if (V8_OFF_SLICEDSTRING_PARENT == -1)
+ V8_OFF_SLICEDSTRING_PARENT = V8_OFF_SLICEDSTRING_OFFSET -
+ sizeof (uintptr_t);
+
+ return (failed ? -1 : 0);
+}
+
+/* ARGSUSED */
+static int
+autoconf_iter_symbol(mdb_symbol_t *symp, void *arg)
+{
+ v8_cfg_t *cfgp = arg;
+
+ if (strncmp(symp->sym_name, "v8dbg_parent_",
+ sizeof ("v8dbg_parent_") - 1) == 0)
+ return (conf_update_parent(symp->sym_name));
+
+ if (strncmp(symp->sym_name, "v8dbg_class_",
+ sizeof ("v8dbg_class_") - 1) == 0)
+ return (conf_update_field(cfgp, symp->sym_name));
+
+ if (strncmp(symp->sym_name, "v8dbg_type_",
+ sizeof ("v8dbg_type_") - 1) == 0)
+ return (conf_update_type(cfgp, symp->sym_name));
+
+ if (strncmp(symp->sym_name, "v8dbg_frametype_",
+ sizeof ("v8dbg_frametype_") - 1) == 0)
+ return (conf_update_frametype(cfgp, symp->sym_name));
+
+ return (0);
+}
+
+/*
+ * Extracts the next field of a string whose fields are separated by "__" (as
+ * the V8 metadata symbols are).
+ */
+static char *
+conf_next_part(char *buf, char *start)
+{
+ char *pp;
+
+ if ((pp = strstr(start, "__")) == NULL) {
+ mdb_warn("malformed symbol name: %s\n", buf);
+ return (NULL);
+ }
+
+ *pp = '\0';
+ return (pp + sizeof ("__") - 1);
+}
+
+static v8_class_t *
+conf_class_findcreate(const char *name)
+{
+ v8_class_t *clp, *iclp, *prev = NULL;
+ int cmp;
+
+ for (iclp = v8_classes; iclp != NULL; iclp = iclp->v8c_next) {
+ if ((cmp = strcmp(iclp->v8c_name, name)) == 0)
+ return (iclp);
+
+ if (cmp > 0)
+ break;
+
+ prev = iclp;
+ }
+
+ if ((clp = mdb_zalloc(sizeof (*clp), UM_NOSLEEP)) == NULL)
+ return (NULL);
+
+ (void) strlcpy(clp->v8c_name, name, sizeof (clp->v8c_name));
+ clp->v8c_end = (size_t)-1;
+ clp->v8c_next = iclp;
+
+ if (prev != NULL) {
+ prev->v8c_next = clp;
+ } else {
+ v8_classes = clp;
+ }
+
+ return (clp);
+}
+
+static v8_field_t *
+conf_field_create(v8_class_t *clp, const char *name, size_t offset)
+{
+ v8_field_t *flp, *iflp;
+
+ if ((flp = mdb_zalloc(sizeof (*flp), UM_NOSLEEP)) == NULL)
+ return (NULL);
+
+ (void) strlcpy(flp->v8f_name, name, sizeof (flp->v8f_name));
+ flp->v8f_offset = offset;
+
+ if (clp->v8c_fields == NULL || clp->v8c_fields->v8f_offset > offset) {
+ flp->v8f_next = clp->v8c_fields;
+ clp->v8c_fields = flp;
+ return (flp);
+ }
+
+ for (iflp = clp->v8c_fields; iflp->v8f_next != NULL;
+ iflp = iflp->v8f_next) {
+ if (iflp->v8f_next->v8f_offset > offset)
+ break;
+ }
+
+ flp->v8f_next = iflp->v8f_next;
+ iflp->v8f_next = flp;
+ return (flp);
+}
+
+/*
+ * Given a "v8dbg_parent_X__Y", symbol, update the parent of class X to class Y.
+ * Note that neither class necessarily exists already.
+ */
+static int
+conf_update_parent(const char *symbol)
+{
+ char *pp, *qq;
+ char buf[128];
+ v8_class_t *clp, *pclp;
+
+ (void) strlcpy(buf, symbol, sizeof (buf));
+ pp = buf + sizeof ("v8dbg_parent_") - 1;
+ qq = conf_next_part(buf, pp);
+
+ if (qq == NULL)
+ return (-1);
+
+ clp = conf_class_findcreate(pp);
+ pclp = conf_class_findcreate(qq);
+
+ if (clp == NULL || pclp == NULL) {
+ mdb_warn("mdb_v8: out of memory\n");
+ return (-1);
+ }
+
+ clp->v8c_parent = pclp;
+ return (0);
+}
+
+/*
+ * Given a "v8dbg_class_CLASS__FIELD__TYPE", symbol, save field "FIELD" into
+ * class CLASS with the offset described by the symbol. Note that CLASS does
+ * not necessarily exist already.
+ */
+static int
+conf_update_field(v8_cfg_t *cfgp, const char *symbol)
+{
+ v8_class_t *clp;
+ v8_field_t *flp;
+ intptr_t offset;
+ char *pp, *qq, *tt;
+ char buf[128];
+
+ (void) strlcpy(buf, symbol, sizeof (buf));
+
+ pp = buf + sizeof ("v8dbg_class_") - 1;
+ qq = conf_next_part(buf, pp);
+
+ if (qq == NULL || (tt = conf_next_part(buf, qq)) == NULL)
+ return (-1);
+
+ if (cfgp->v8cfg_readsym(cfgp, symbol, &offset) == -1) {
+ mdb_warn("failed to read symbol \"%s\"", symbol);
+ return (-1);
+ }
+
+ if ((clp = conf_class_findcreate(pp)) == NULL ||
+ (flp = conf_field_create(clp, qq, (size_t)offset)) == NULL)
+ return (-1);
+
+ if (strcmp(tt, "int") == 0)
+ flp->v8f_isbyte = B_TRUE;
+
+ if (strcmp(tt, "char") == 0)
+ flp->v8f_isstr = B_TRUE;
+
+ return (0);
+}
+
+static int
+conf_update_enum(v8_cfg_t *cfgp, const char *symbol, const char *name,
+ v8_enum_t *enp)
+{
+ intptr_t value;
+
+ if (cfgp->v8cfg_readsym(cfgp, symbol, &value) == -1) {
+ mdb_warn("failed to read symbol \"%s\"", symbol);
+ return (-1);
+ }
+
+ enp->v8e_value = (int)value;
+ (void) strlcpy(enp->v8e_name, name, sizeof (enp->v8e_name));
+ return (0);
+}
+
+/*
+ * Given a "v8dbg_type_TYPENAME" constant, save the type name in v8_types. Note
+ * that this enum has multiple integer values with the same string label.
+ */
+static int
+conf_update_type(v8_cfg_t *cfgp, const char *symbol)
+{
+ char *klass;
+ v8_enum_t *enp;
+ char buf[128];
+
+ if (v8_next_type > sizeof (v8_types) / sizeof (v8_types[0])) {
+ mdb_warn("too many V8 types\n");
+ return (-1);
+ }
+
+ (void) strlcpy(buf, symbol, sizeof (buf));
+
+ klass = buf + sizeof ("v8dbg_type_") - 1;
+ if (conf_next_part(buf, klass) == NULL)
+ return (-1);
+
+ enp = &v8_types[v8_next_type++];
+ return (conf_update_enum(cfgp, symbol, klass, enp));
+}
+
+/*
+ * Given a "v8dbg_frametype_TYPENAME" constant, save the frame type in
+ * v8_frametypes.
+ */
+static int
+conf_update_frametype(v8_cfg_t *cfgp, const char *symbol)
+{
+ const char *frametype;
+ v8_enum_t *enp;
+
+ if (v8_next_frametype >
+ sizeof (v8_frametypes) / sizeof (v8_frametypes[0])) {
+ mdb_warn("too many V8 frame types\n");
+ return (-1);
+ }
+
+ enp = &v8_frametypes[v8_next_frametype++];
+ frametype = symbol + sizeof ("v8dbg_frametype_") - 1;
+ return (conf_update_enum(cfgp, symbol, frametype, enp));
+}
+
+/*
+ * Now that all classes have been loaded, update the "start" and "end" fields of
+ * each class based on the values of its parent class.
+ */
+static void
+conf_class_compute_offsets(v8_class_t *clp)
+{
+ v8_field_t *flp;
+
+ assert(clp->v8c_start == 0);
+ assert(clp->v8c_end == (size_t)-1);
+
+ if (clp->v8c_parent != NULL) {
+ if (clp->v8c_parent->v8c_end == (size_t)-1)
+ conf_class_compute_offsets(clp->v8c_parent);
+
+ clp->v8c_start = clp->v8c_parent->v8c_end;
+ }
+
+ if (clp->v8c_fields == NULL) {
+ clp->v8c_end = clp->v8c_start;
+ return;
+ }
+
+ for (flp = clp->v8c_fields; flp->v8f_next != NULL; flp = flp->v8f_next)
+ ;
+
+ if (flp == NULL)
+ clp->v8c_end = clp->v8c_start;
+ else
+ clp->v8c_end = flp->v8f_offset + sizeof (uintptr_t);
+}
+
+/*
+ * Utility functions
+ */
+#define JSSTR_NONE 0
+#define JSSTR_NUDE JSSTR_NONE
+#define JSSTR_VERBOSE 0x1
+#define JSSTR_QUOTED 0x2
+#define JSSTR_ISASCII 0x4
+
+static int jsstr_print(uintptr_t, uint_t, char **, size_t *);
+static boolean_t jsobj_is_undefined(uintptr_t addr);
+
+static const char *
+enum_lookup_str(v8_enum_t *enums, int val, const char *dflt)
+{
+ v8_enum_t *ep;
+
+ for (ep = enums; ep->v8e_name[0] != '\0'; ep++) {
+ if (ep->v8e_value == val)
+ return (ep->v8e_name);
+ }
+
+ return (dflt);
+}
+
+static void
+enum_print(v8_enum_t *enums)
+{
+ v8_enum_t *itp;
+
+ for (itp = enums; itp->v8e_name[0] != '\0'; itp++)
+ mdb_printf("%-30s = 0x%02x\n", itp->v8e_name, itp->v8e_value);
+}
+
+/*
+ * b[v]snprintf behave like [v]snprintf(3c), except that they update the buffer
+ * and length arguments based on how much buffer space is used by the operation.
+ * This makes it much easier to combine multiple calls in sequence without
+ * worrying about buffer overflow.
+ */
+static size_t
+bvsnprintf(char **bufp, size_t *buflenp, const char *format, va_list alist)
+{
+ size_t rv, len;
+
+ if (*buflenp == 0)
+ return (vsnprintf(NULL, 0, format, alist));
+
+ rv = vsnprintf(*bufp, *buflenp, format, alist);
+
+ len = MIN(rv, *buflenp);
+ *buflenp -= len;
+ *bufp += len;
+
+ return (len);
+}
+
+static size_t
+bsnprintf(char **bufp, size_t *buflenp, const char *format, ...)
+{
+ va_list alist;
+ size_t rv;
+
+ va_start(alist, format);
+ rv = bvsnprintf(bufp, buflenp, format, alist);
+ va_end(alist);
+
+ return (rv);
+}
+
+static void
+v8_warn(const char *format, ...)
+{
+ char buf[512];
+ va_list alist;
+ int len;
+
+ if (v8_silent)
+ return;
+
+ va_start(alist, format);
+ (void) vsnprintf(buf, sizeof (buf), format, alist);
+ va_end(alist);
+
+ /*
+ * This is made slightly annoying because we need to effectively
+ * preserve the original format string to allow for mdb to use the
+ * new-line at the end to indicate that strerror should be elided.
+ */
+ if ((len = strlen(format)) > 0 && format[len - 1] == '\n') {
+ buf[strlen(buf) - 1] = '\0';
+ mdb_warn("%s\n", buf);
+ } else {
+ mdb_warn("%s", buf);
+ }
+}
+
+/*
+ * Returns in "offp" the offset of field "field" in C++ class "klass".
+ */
+static int
+heap_offset(const char *klass, const char *field, ssize_t *offp)
+{
+ v8_class_t *clp;
+ v8_field_t *flp;
+
+ for (clp = v8_classes; clp != NULL; clp = clp->v8c_next) {
+ if (strcmp(klass, clp->v8c_name) == 0)
+ break;
+ }
+
+ if (clp == NULL)
+ return (-1);
+
+ for (flp = clp->v8c_fields; flp != NULL; flp = flp->v8f_next) {
+ if (strcmp(field, flp->v8f_name) == 0)
+ break;
+ }
+
+ if (flp == NULL)
+ return (-1);
+
+ *offp = V8_OFF_HEAP(flp->v8f_offset);
+ return (0);
+}
+
+/*
+ * Assuming "addr" is an instance of the C++ heap class "klass", read into *valp
+ * the pointer-sized value of field "field".
+ */
+static int
+read_heap_ptr(uintptr_t *valp, uintptr_t addr, ssize_t off)
+{
+ if (mdb_vread(valp, sizeof (*valp), addr + off) == -1) {
+ v8_warn("failed to read offset %d from %p", off, addr);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*
+ * Like read_heap_ptr, but assume the field is an SMI and store the actual value
+ * into *valp rather than the encoded representation.
+ */
+static int
+read_heap_smi(uintptr_t *valp, uintptr_t addr, ssize_t off)
+{
+ if (read_heap_ptr(valp, addr, off) != 0)
+ return (-1);
+
+ if (!V8_IS_SMI(*valp)) {
+ v8_warn("expected SMI, got %p\n", *valp);
+ return (-1);
+ }
+
+ *valp = V8_SMI_VALUE(*valp);
+
+ return (0);
+}
+
+static int
+read_heap_double(double *valp, uintptr_t addr, ssize_t off)
+{
+ if (mdb_vread(valp, sizeof (*valp), addr + off) == -1) {
+ v8_warn("failed to read heap value at %p", addr + off);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*
+ * Assuming "addr" refers to a FixedArray, return a newly-allocated array
+ * representing its contents.
+ */
+static int
+read_heap_array(uintptr_t addr, uintptr_t **retp, size_t *lenp, int flags)
+{
+ uint8_t type;
+ uintptr_t len;
+
+ if (!V8_IS_HEAPOBJECT(addr))
+ return (-1);
+
+ if (read_typebyte(&type, addr) != 0)
+ return (-1);
+
+ if (type != V8_TYPE_FIXEDARRAY)
+ return (-1);
+
+ if (read_heap_smi(&len, addr, V8_OFF_FIXEDARRAY_LENGTH) != 0)
+ return (-1);
+
+ *lenp = len;
+
+ if (len == 0) {
+ *retp = NULL;
+ return (0);
+ }
+
+ if ((*retp = mdb_zalloc(len * sizeof (uintptr_t), flags)) == NULL)
+ return (-1);
+
+ if (mdb_vread(*retp, len * sizeof (uintptr_t),
+ addr + V8_OFF_FIXEDARRAY_DATA) == -1) {
+ if (!(flags & UM_GC))
+ mdb_free(*retp, len * sizeof (uintptr_t));
+
+ *retp = NULL;
+ return (-1);
+ }
+
+ return (0);
+}
+
+static int
+read_heap_byte(uint8_t *valp, uintptr_t addr, ssize_t off)
+{
+ if (mdb_vread(valp, sizeof (*valp), addr + off) == -1) {
+ v8_warn("failed to read heap value at %p", addr + off);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*
+ * Given a heap object, returns in *valp the byte describing the type of the
+ * object. This is shorthand for first retrieving the Map at the start of the
+ * heap object and then retrieving the type byte from the Map object.
+ */
+static int
+read_typebyte(uint8_t *valp, uintptr_t addr)
+{
+ uintptr_t mapaddr;
+ ssize_t off = V8_OFF_HEAPOBJECT_MAP;
+
+ if (mdb_vread(&mapaddr, sizeof (mapaddr), addr + off) == -1) {
+ v8_warn("failed to read type of %p", addr);
+ return (-1);
+ }
+
+ if (!V8_IS_HEAPOBJECT(mapaddr)) {
+ v8_warn("object map is not a heap object\n");
+ return (-1);
+ }
+
+ if (read_heap_byte(valp, mapaddr, V8_OFF_MAP_INSTANCE_ATTRIBUTES) == -1)
+ return (-1);
+
+ return (0);
+}
+
+/*
+ * Given a heap object, returns in *valp the size of the object. For
+ * variable-size objects, returns an undefined value.
+ */
+static int
+read_size(size_t *valp, uintptr_t addr)
+{
+ uintptr_t mapaddr;
+ uint8_t size;
+
+ if (read_heap_ptr(&mapaddr, addr, V8_OFF_HEAPOBJECT_MAP) != 0)
+ return (-1);
+
+ if (!V8_IS_HEAPOBJECT(mapaddr)) {
+ v8_warn("heap object map is not itself a heap object\n");
+ return (-1);
+ }
+
+ if (read_heap_byte(&size, mapaddr, V8_OFF_MAP_INSTANCE_SIZE) != 0)
+ return (-1);
+
+ *valp = size << V8_PointerSizeLog2;
+ return (0);
+}
+
+/*
+ * Assuming "addr" refers to a FixedArray that is implementing a
+ * StringDictionary, iterate over its contents calling the specified function
+ * with key and value.
+ */
+static int
+read_heap_dict(uintptr_t addr,
+ int (*func)(const char *, uintptr_t, void *), void *arg)
+{
+ uint8_t type;
+ uintptr_t len;
+ char buf[512];
+ char *bufp;
+ int rval = -1;
+ uintptr_t *dict, ndict, i;
+ const char *typename;
+
+ if (read_heap_array(addr, &dict, &ndict, UM_SLEEP) != 0)
+ return (-1);
+
+ if (V8_DICT_ENTRY_SIZE < 2) {
+ v8_warn("dictionary entry size (%d) is too small for a "
+ "key and value\n", V8_DICT_ENTRY_SIZE);
+ goto out;
+ }
+
+ for (i = V8_DICT_START_INDEX + V8_DICT_PREFIX_SIZE; i < ndict;
+ i += V8_DICT_ENTRY_SIZE) {
+ /*
+ * The layout here is key, value, details. (This is hardcoded
+ * in Dictionary<Shape, Key>::SetEntry().)
+ */
+ if (jsobj_is_undefined(dict[i]))
+ continue;
+
+ if (read_typebyte(&type, dict[i]) != 0)
+ goto out;
+
+ typename = enum_lookup_str(v8_types, type, NULL);
+
+ if (typename != NULL && strcmp(typename, "Oddball") == 0) {
+ /*
+ * In some cases, the key can (apparently) be a hole;
+ * assume that any Oddball in the key field falls into
+ * this case and skip over it.
+ */
+ continue;
+ }
+
+ if (!V8_TYPE_STRING(type))
+ goto out;
+
+ bufp = buf;
+ len = sizeof (buf);
+
+ if (jsstr_print(dict[i], JSSTR_NUDE, &bufp, &len) != 0)
+ goto out;
+
+ if (func(buf, dict[i + 1], arg) == -1)
+ goto out;
+ }
+
+ rval = 0;
+out:
+ mdb_free(dict, ndict * sizeof (uintptr_t));
+
+ return (rval);
+}
+
+/*
+ * Returns in "buf" a description of the type of "addr" suitable for printing.
+ */
+static int
+obj_jstype(uintptr_t addr, char **bufp, size_t *lenp, uint8_t *typep)
+{
+ uint8_t typebyte;
+ uintptr_t strptr;
+ const char *typename;
+
+ if (V8_IS_FAILURE(addr)) {
+ if (typep)
+ *typep = 0;
+ (void) bsnprintf(bufp, lenp, "'Failure' object");
+ return (0);
+ }
+
+ if (V8_IS_SMI(addr)) {
+ if (typep)
+ *typep = 0;
+ (void) bsnprintf(bufp, lenp, "SMI: value = %d",
+ V8_SMI_VALUE(addr));
+ return (0);
+ }
+
+ if (read_typebyte(&typebyte, addr) != 0)
+ return (-1);
+
+ if (typep)
+ *typep = typebyte;
+
+ typename = enum_lookup_str(v8_types, typebyte, "<unknown>");
+ (void) bsnprintf(bufp, lenp, typename);
+
+ if (strcmp(typename, "Oddball") == 0) {
+ if (read_heap_ptr(&strptr, addr,
+ V8_OFF_ODDBALL_TO_STRING) != -1) {
+ (void) bsnprintf(bufp, lenp, ": \"");
+ (void) jsstr_print(strptr, JSSTR_NUDE, bufp, lenp);
+ (void) bsnprintf(bufp, lenp, "\"");
+ }
+ }
+
+ return (0);
+}
+
+/*
+ * Print out the fields of the given object that come from the given class.
+ */
+static int
+obj_print_fields(uintptr_t baddr, v8_class_t *clp)
+{
+ v8_field_t *flp;
+ uintptr_t addr, value;
+ int rv;
+ char *bufp;
+ size_t len;
+ uint8_t type;
+ char buf[256];
+
+ for (flp = clp->v8c_fields; flp != NULL; flp = flp->v8f_next) {
+ bufp = buf;
+ len = sizeof (buf);
+
+ addr = baddr + V8_OFF_HEAP(flp->v8f_offset);
+
+ if (flp->v8f_isstr) {
+ if (mdb_readstr(buf, sizeof (buf), addr) == -1) {
+ mdb_printf("%p %s (unreadable)\n",
+ addr, flp->v8f_name);
+ continue;
+ }
+
+ mdb_printf("%p %s = \"%s\"\n",
+ addr, flp->v8f_name, buf);
+ continue;
+ }
+
+ if (flp->v8f_isbyte) {
+ uint8_t sv;
+ if (mdb_vread(&sv, sizeof (sv), addr) == -1) {
+ mdb_printf("%p %s (unreadable)\n",
+ addr, flp->v8f_name);
+ continue;
+ }
+
+ mdb_printf("%p %s = 0x%x\n", addr, flp->v8f_name, sv);
+ continue;
+ }
+
+ rv = mdb_vread((void *)&value, sizeof (value), addr);
+
+ if (rv != sizeof (value) ||
+ obj_jstype(value, &bufp, &len, &type) != 0) {
+ mdb_printf("%p %s (unreadable)\n", addr, flp->v8f_name);
+ continue;
+ }
+
+ if (type != 0 && V8_TYPE_STRING(type)) {
+ (void) bsnprintf(&bufp, &len, ": ");
+ (void) jsstr_print(value, JSSTR_QUOTED, &bufp, &len);
+ }
+
+ mdb_printf("%p %s = %p (%s)\n", addr, flp->v8f_name, value,
+ buf);
+ }
+
+ return (DCMD_OK);
+}
+
+/*
+ * Print out all fields of the given object, starting with the root of the class
+ * hierarchy and working down the most specific type.
+ */
+static int
+obj_print_class(uintptr_t addr, v8_class_t *clp)
+{
+ int rv = 0;
+
+ /*
+ * If we have no fields, we just print a simple inheritance hierarchy.
+ * If we have fields but our parent doesn't, our header includes the
+ * inheritance hierarchy.
+ */
+ if (clp->v8c_end == 0) {
+ mdb_printf("%s ", clp->v8c_name);
+
+ if (clp->v8c_parent != NULL) {
+ mdb_printf("< ");
+ (void) obj_print_class(addr, clp->v8c_parent);
+ }
+
+ return (0);
+ }
+
+ mdb_printf("%p %s", addr, clp->v8c_name);
+
+ if (clp->v8c_start == 0 && clp->v8c_parent != NULL) {
+ mdb_printf(" < ");
+ (void) obj_print_class(addr, clp->v8c_parent);
+ }
+
+ mdb_printf(" {\n");
+ (void) mdb_inc_indent(4);
+
+ if (clp->v8c_start > 0 && clp->v8c_parent != NULL)
+ rv = obj_print_class(addr, clp->v8c_parent);
+
+ rv |= obj_print_fields(addr, clp);
+ (void) mdb_dec_indent(4);
+ mdb_printf("}\n");
+
+ return (rv);
+}
+
+/*
+ * Print the ASCII string for the given JS string, expanding ConsStrings and
+ * ExternalStrings as needed.
+ */
+static int jsstr_print_seq(uintptr_t, uint_t, char **, size_t *, size_t,
+ ssize_t);
+static int jsstr_print_cons(uintptr_t, uint_t, char **, size_t *);
+static int jsstr_print_sliced(uintptr_t, uint_t, char **, size_t *);
+static int jsstr_print_external(uintptr_t, uint_t, char **, size_t *);
+
+static int
+jsstr_print(uintptr_t addr, uint_t flags, char **bufp, size_t *lenp)
+{
+ uint8_t typebyte;
+ int err = 0;
+ char *lbufp;
+ size_t llen;
+ char buf[64];
+ boolean_t verbose = flags & JSSTR_VERBOSE ? B_TRUE : B_FALSE;
+
+ if (read_typebyte(&typebyte, addr) != 0)
+ return (0);
+
+ if (!V8_TYPE_STRING(typebyte)) {
+ (void) bsnprintf(bufp, lenp, "<not a string>");
+ return (0);
+ }
+
+ if (verbose) {
+ lbufp = buf;
+ llen = sizeof (buf);
+ (void) obj_jstype(addr, &lbufp, &llen, NULL);
+ mdb_printf("%s\n", buf);
+ (void) mdb_inc_indent(4);
+ }
+
+ if (V8_STRENC_ASCII(typebyte))
+ flags |= JSSTR_ISASCII;
+ else
+ flags &= ~JSSTR_ISASCII;
+
+ if (V8_STRREP_SEQ(typebyte))
+ err = jsstr_print_seq(addr, flags, bufp, lenp, 0, -1);
+ else if (V8_STRREP_CONS(typebyte))
+ err = jsstr_print_cons(addr, flags, bufp, lenp);
+ else if (V8_STRREP_EXT(typebyte))
+ err = jsstr_print_external(addr, flags, bufp, lenp);
+ else if (V8_STRREP_SLICED(typebyte))
+ err = jsstr_print_sliced(addr, flags, bufp, lenp);
+ else {
+ (void) bsnprintf(bufp, lenp, "<unknown string type>");
+ err = -1;
+ }
+
+ if (verbose)
+ (void) mdb_dec_indent(4);
+
+ return (err);
+}
+
+static int
+jsstr_print_seq(uintptr_t addr, uint_t flags, char **bufp, size_t *lenp,
+ size_t sliceoffset, ssize_t slicelen)
+{
+ /*
+ * To allow the caller to allocate a very large buffer for strings,
+ * we'll allocate a buffer sized based on our input, making it at
+ * least enough space for our ellipsis and at most 256K.
+ */
+ uintptr_t i, nstrchrs, nreadbytes, nreadoffset, blen, nstrbytes;
+ boolean_t verbose = flags & JSSTR_VERBOSE ? B_TRUE : B_FALSE;
+ boolean_t quoted = flags & JSSTR_QUOTED ? B_TRUE : B_FALSE;
+ char *buf;
+ uint16_t chrval;
+
+ blen = MIN(*lenp, 256 * 1024);
+ buf = alloca(blen);
+
+ if (read_heap_smi(&nstrchrs, addr, V8_OFF_STRING_LENGTH) != 0)
+ return (-1);
+
+ if (slicelen != -1)
+ nstrchrs = slicelen;
+
+ if ((flags & JSSTR_ISASCII) != 0) {
+ nstrbytes = nstrchrs;
+ nreadoffset = sliceoffset;
+ } else {
+ nstrbytes = 2 * nstrchrs;
+ nreadoffset = 2 * sliceoffset;
+ }
+
+ nreadbytes = nstrbytes + sizeof ("\"\"") <= blen ? nstrbytes :
+ blen - sizeof ("\"\"[...]");
+
+ if (verbose)
+ mdb_printf("length: %d chars (%d bytes), "
+ "will read %d bytes from offset %d\n",
+ nstrchrs, nstrbytes, nreadbytes, nreadoffset);
+
+ if (nstrbytes == 0) {
+ (void) bsnprintf(bufp, lenp, "%s%s",
+ quoted ? "\"" : "", quoted ? "\"" : "");
+ return (0);
+ }
+
+ buf[0] = '\0';
+
+ if ((flags & JSSTR_ISASCII) != 0) {
+ if (mdb_readstr(buf, nreadbytes + 1,
+ addr + V8_OFF_SEQASCIISTR_CHARS + nreadoffset) == -1) {
+ v8_warn("failed to read SeqString data");
+ return (-1);
+ }
+
+ if (nreadbytes != nstrbytes)
+ (void) strlcat(buf, "[...]", blen);
+
+ (void) bsnprintf(bufp, lenp, "%s%s%s",
+ quoted ? "\"" : "", buf, quoted ? "\"" : "");
+ } else {
+ if (mdb_readstr(buf, nreadbytes,
+ addr + V8_OFF_SEQTWOBYTESTR_CHARS + nreadoffset) == -1) {
+ v8_warn("failed to read SeqTwoByteString data");
+ return (-1);
+ }
+
+ (void) bsnprintf(bufp, lenp, "%s", quoted ? "\"" : "");
+ for (i = 0; i < nreadbytes; i += 2) {
+ chrval = *((uint16_t *)(buf + i));
+ (void) bsnprintf(bufp, lenp, "%c",
+ (isascii(chrval) || chrval == 0) ?
+ (char)chrval : '?');
+ }
+ if (nreadbytes != nstrbytes)
+ (void) bsnprintf(bufp, lenp, "[...]");
+ (void) bsnprintf(bufp, lenp, "%s", quoted ? "\"" : "");
+ }
+
+ return (0);
+}
+
+static int
+jsstr_print_cons(uintptr_t addr, uint_t flags, char **bufp, size_t *lenp)
+{
+ boolean_t verbose = flags & JSSTR_VERBOSE ? B_TRUE : B_FALSE;
+ boolean_t quoted = flags & JSSTR_QUOTED ? B_TRUE : B_FALSE;
+ uintptr_t ptr1, ptr2;
+
+ if (read_heap_ptr(&ptr1, addr, V8_OFF_CONSSTRING_FIRST) != 0 ||
+ read_heap_ptr(&ptr2, addr, V8_OFF_CONSSTRING_SECOND) != 0)
+ return (-1);
+
+ if (verbose) {
+ mdb_printf("ptr1: %p\n", ptr1);
+ mdb_printf("ptr2: %p\n", ptr2);
+ }
+
+ if (quoted)
+ (void) bsnprintf(bufp, lenp, "\"");
+
+ if (jsstr_print(ptr1, verbose, bufp, lenp) != 0)
+ return (-1);
+
+ if (jsstr_print(ptr2, verbose, bufp, lenp) != 0)
+ return (-1);
+
+ if (quoted)
+ (void) bsnprintf(bufp, lenp, "\"");
+
+ return (0);
+}
+
+static int
+jsstr_print_sliced(uintptr_t addr, uint_t flags, char **bufp, size_t *lenp)
+{
+ uintptr_t parent, offset, length;
+ uint8_t typebyte;
+ boolean_t verbose = flags & JSSTR_VERBOSE ? B_TRUE : B_FALSE;
+ boolean_t quoted = flags & JSSTR_QUOTED ? B_TRUE : B_FALSE;
+ uint_t newflags;
+
+ if (read_heap_ptr(&parent, addr, V8_OFF_SLICEDSTRING_PARENT) != 0 ||
+ read_heap_smi(&offset, addr, V8_OFF_SLICEDSTRING_OFFSET) != 0 ||
+ read_heap_smi(&length, addr, V8_OFF_STRING_LENGTH) != 0)
+ return (-1);
+
+ if (verbose)
+ mdb_printf("parent: %p, offset = %d, length = %d\n",
+ parent, offset, length);
+
+ if (read_typebyte(&typebyte, parent) != 0) {
+ v8_warn("SlicedString %s: failed to read parent's type", addr);
+ (void) bsnprintf(bufp, lenp, "<sliced string>");
+ return (0);
+ }
+
+ if (!V8_STRREP_SEQ(typebyte)) {
+ v8_warn("SlicedString %s: parent is not a sequential string",
+ addr);
+ (void) bsnprintf(bufp, lenp, "<sliced string>");
+ return (0);
+ }
+
+ if (quoted)
+ (void) bsnprintf(bufp, lenp, "\"");
+
+ newflags = verbose ? JSSTR_VERBOSE : 0;
+ if (V8_STRENC_ASCII(typebyte))
+ newflags |= JSSTR_ISASCII;
+ if (jsstr_print_seq(parent, newflags, bufp, lenp, offset, length) != 0)
+ return (-1);
+
+ if (quoted)
+ (void) bsnprintf(bufp, lenp, "\"");
+
+ return (0);
+}
+
+static int
+jsstr_print_external(uintptr_t addr, uint_t flags, char **bufp, size_t *lenp)
+{
+ uintptr_t ptr1, ptr2;
+ size_t blen = *lenp + 1;
+ char *buf = alloca(blen);
+ boolean_t quoted = flags & JSSTR_QUOTED ? B_TRUE : B_FALSE;
+
+ if ((flags & JSSTR_ISASCII) == 0) {
+ (void) bsnprintf(bufp, lenp, "<external two-byte string>");
+ return (0);
+ }
+
+ if (flags & JSSTR_VERBOSE)
+ mdb_printf("assuming Node.js string\n");
+
+ if (read_heap_ptr(&ptr1, addr, V8_OFF_EXTERNALSTRING_RESOURCE) != 0)
+ return (-1);
+
+ if (mdb_vread(&ptr2, sizeof (ptr2),
+ ptr1 + NODE_OFF_EXTSTR_DATA) == -1) {
+ v8_warn("failed to read node external pointer: %p",
+ ptr1 + NODE_OFF_EXTSTR_DATA);
+ return (-1);
+ }
+
+ if (mdb_readstr(buf, blen, ptr2) == -1) {
+ v8_warn("failed to read ExternalString data");
+ return (-1);
+ }
+
+ if (buf[0] != '\0' && !isascii(buf[0])) {
+ v8_warn("failed to read ExternalString ascii data\n");
+ return (-1);
+ }
+
+ (void) bsnprintf(bufp, lenp, "%s%s%s",
+ quoted ? "\"" : "", buf, quoted ? "\"" : "");
+
+ return (0);
+}
+
+/*
+ * Returns true if the given address refers to the "undefined" object. Returns
+ * false on failure (since we shouldn't fail on the actual "undefined" value).
+ */
+static boolean_t
+jsobj_is_undefined(uintptr_t addr)
+{
+ uint8_t type;
+ uintptr_t strptr;
+ const char *typename;
+ char buf[16];
+ char *bufp = buf;
+ size_t len = sizeof (buf);
+
+ v8_silent++;
+
+ if (read_typebyte(&type, addr) != 0) {
+ v8_silent--;
+ return (B_FALSE);
+ }
+
+ v8_silent--;
+
+ typename = enum_lookup_str(v8_types, type, "<unknown>");
+ if (strcmp(typename, "Oddball") != 0)
+ return (B_FALSE);
+
+ if (read_heap_ptr(&strptr, addr, V8_OFF_ODDBALL_TO_STRING) == -1)
+ return (B_FALSE);
+
+ if (jsstr_print(strptr, JSSTR_NUDE, &bufp, &len) != 0)
+ return (B_FALSE);
+
+ return (strcmp(buf, "undefined") == 0);
+}
+
+static int
+jsobj_properties(uintptr_t addr,
+ int (*func)(const char *, uintptr_t, void *), void *arg)
+{
+ uintptr_t ptr, map;
+ uintptr_t *props = NULL, *descs = NULL, *content = NULL, *trans;
+ size_t size, nprops, ndescs, ncontent, ntrans;
+ ssize_t ii, rndescs;
+ uint8_t type, ninprops;
+ int rval = -1;
+ size_t ps = sizeof (uintptr_t);
+ ssize_t off;
+
+ /*
+ * Objects have either "fast" properties represented with a FixedArray
+ * or slow properties represented with a Dictionary.
+ */
+ if (mdb_vread(&ptr, ps, addr + V8_OFF_JSOBJECT_PROPERTIES) == -1)
+ return (-1);
+
+ if (read_typebyte(&type, ptr) != 0)
+ return (-1);
+
+ if (type != V8_TYPE_FIXEDARRAY) {
+ /*
+ * If our properties aren't a fixed array, we'll emit a member
+ * that contains the type name, but with a NULL value.
+ */
+ char buf[256];
+
+ (void) mdb_snprintf(buf, sizeof (buf), "<%s>",
+ enum_lookup_str(v8_types, type, "unknown"));
+
+ return (func(buf, NULL, arg));
+ }
+
+ /*
+ * To iterate the properties, we need to examine the instance
+ * descriptors of the associated Map object. Depending on the version
+ * of V8, this might be found directly from the map -- or indirectly
+ * via the transitions array.
+ */
+ if (mdb_vread(&map, ps, addr + V8_OFF_HEAPOBJECT_MAP) == -1)
+ goto err;
+
+ if (V8_DICT_SHIFT != -1) {
+ uintptr_t bit_field3;
+
+ if (mdb_vread(&bit_field3, sizeof (bit_field3),
+ map + V8_OFF_MAP_BIT_FIELD3) == -1)
+ goto err;
+
+ if (V8_SMI_VALUE(bit_field3) & (1 << V8_DICT_SHIFT))
+ return (read_heap_dict(ptr, func, arg));
+ } else if (V8_OFF_MAP_INSTANCE_DESCRIPTORS != -1) {
+ uintptr_t bit_field3;
+
+ if (mdb_vread(&bit_field3, sizeof (bit_field3),
+ map + V8_OFF_MAP_INSTANCE_DESCRIPTORS) == -1)
+ goto err;
+
+ if (V8_SMI_VALUE(bit_field3) == (1 << V8_ISSHARED_SHIFT)) {
+ /*
+ * On versions of V8 prior to that used in 0.10,
+ * the instance descriptors were overloaded to also
+ * be bit_field3 -- and there was no way from that
+ * field to infer a dictionary type. Because we
+ * can't determine if the map is actually the
+ * hash_table_map, we assume that if it's an object
+ * that has kIsShared set, that it is in fact a
+ * dictionary -- an assumption that is assuredly in
+ * error in some cases.
+ */
+ return (read_heap_dict(ptr, func, arg));
+ }
+ }
+
+ if (read_heap_array(ptr, &props, &nprops, UM_SLEEP) != 0)
+ goto err;
+
+ if ((off = V8_OFF_MAP_INSTANCE_DESCRIPTORS) == -1) {
+ if (V8_OFF_MAP_TRANSITIONS == -1 ||
+ V8_TRANSITIONS_IDX_DESC == -1 ||
+ V8_PROP_IDX_CONTENT != -1) {
+ mdb_warn("missing instance_descriptors, but did "
+ "not find expected transitions array metadata; "
+ "cannot read properties\n");
+ goto err;
+ }
+
+ off = V8_OFF_MAP_TRANSITIONS;
+ }
+
+ if (mdb_vread(&ptr, ps, map + off) == -1)
+ goto err;
+
+ if (V8_OFF_MAP_INSTANCE_DESCRIPTORS == -1) {
+ if (read_heap_array(ptr, &trans, &ntrans, UM_SLEEP) != 0)
+ goto err;
+
+ ptr = trans[V8_TRANSITIONS_IDX_DESC];
+ mdb_free(trans, ntrans * sizeof (uintptr_t));
+ }
+
+ if (read_heap_array(ptr, &descs, &ndescs, UM_SLEEP) != 0)
+ goto err;
+
+ if (read_size(&size, addr) != 0)
+ size = 0;
+
+ if (mdb_vread(&ninprops, 1, map + V8_OFF_MAP_INOBJECT_PROPERTIES) == -1)
+ goto err;
+
+ if (V8_PROP_IDX_CONTENT != -1 && V8_PROP_IDX_CONTENT < ndescs &&
+ read_heap_array(descs[V8_PROP_IDX_CONTENT], &content,
+ &ncontent, UM_SLEEP) != 0)
+ goto err;
+
+ if (V8_PROP_IDX_CONTENT == -1) {
+ /*
+ * On node v0.8 and later, the content is not stored in an
+ * orthogonal FixedArray, but rather with the descriptors.
+ */
+ content = descs;
+ ncontent = ndescs;
+ rndescs = ndescs > V8_PROP_IDX_FIRST ?
+ (ndescs - V8_PROP_IDX_FIRST) / V8_PROP_DESC_SIZE : 0;
+ } else {
+ rndescs = ndescs - V8_PROP_IDX_FIRST;
+ }
+
+ for (ii = 0; ii < rndescs; ii++) {
+ uintptr_t keyidx, validx, detidx, baseidx;
+ char buf[1024];
+ intptr_t val;
+ size_t len = sizeof (buf);
+ char *c = buf;
+
+ if (V8_PROP_IDX_CONTENT != -1) {
+ /*
+ * In node versions prior to v0.8, this was hardcoded
+ * in the V8 implementation, so we hardcode it here
+ * as well.
+ */
+ keyidx = ii + V8_PROP_IDX_FIRST;
+ validx = ii << 1;
+ detidx = (ii << 1) + 1;
+ } else {
+ baseidx = V8_PROP_IDX_FIRST + (ii * V8_PROP_DESC_SIZE);
+ keyidx = baseidx + V8_PROP_DESC_KEY;
+ validx = baseidx + V8_PROP_DESC_VALUE;
+ detidx = baseidx + V8_PROP_DESC_DETAILS;
+ }
+
+ if (detidx >= ncontent) {
+ v8_warn("property descriptor %d: detidx (%d) "
+ "out of bounds for content array (length %d)\n",
+ ii, detidx, ncontent);
+ continue;
+ }
+
+ if (!V8_DESC_ISFIELD(content[detidx]))
+ continue;
+
+ if (keyidx >= ndescs) {
+ v8_warn("property descriptor %d: keyidx (%d) "
+ "out of bounds for descriptor array (length %d)\n",
+ ii, keyidx, ndescs);
+ continue;
+ }
+
+ if (jsstr_print(descs[keyidx], JSSTR_NUDE, &c, &len) != 0)
+ continue;
+
+ val = (intptr_t)content[validx];
+
+ if (!V8_IS_SMI(val)) {
+ v8_warn("object %p: property descriptor %d: value "
+ "index value is not an SMI: %p\n", addr, ii, val);
+ continue;
+ }
+
+ val = V8_SMI_VALUE(val) - ninprops;
+
+ if (val < 0) {
+ /* property is stored directly in the object */
+ if (mdb_vread(&ptr, sizeof (ptr), addr + V8_OFF_HEAP(
+ size + val * sizeof (uintptr_t))) == -1) {
+ v8_warn("failed to read in-object "
+ "property at %p\n", addr + V8_OFF_HEAP(
+ size + val * sizeof (uintptr_t)));
+ continue;
+ }
+ } else {
+ /* property should be in "props" array */
+ if (val >= nprops) {
+ v8_warn("property descriptor %d: value index "
+ "value (%d) out of bounds (%d)\n", ii, val,
+ nprops);
+ continue;
+ }
+
+ ptr = props[val];
+ }
+
+ if (func(buf, ptr, arg) != 0)
+ goto err;
+ }
+
+ rval = 0;
+err:
+ if (props != NULL)
+ mdb_free(props, nprops * sizeof (uintptr_t));
+
+ if (descs != NULL)
+ mdb_free(descs, ndescs * sizeof (uintptr_t));
+
+ if (content != NULL && V8_PROP_IDX_CONTENT != -1)
+ mdb_free(content, ncontent * sizeof (uintptr_t));
+
+ return (rval);
+}
+
+/*
+ * Given the line endings table in "lendsp", computes the line number for the
+ * given token position and print the result into "buf". If "lendsp" is
+ * undefined, prints the token position instead.
+ */
+static int
+jsfunc_lineno(uintptr_t lendsp, uintptr_t tokpos, char *buf, size_t buflen)
+{
+ uintptr_t size, bufsz, lower, upper, ii = 0;
+ uintptr_t *data;
+
+ if (jsobj_is_undefined(lendsp)) {
+ /*
+ * The token position is an SMI, but it comes in as its raw
+ * value so we can more easily compare it to values in the line
+ * endings table. If we're just printing the position directly,
+ * we must convert it here.
+ */
+ mdb_snprintf(buf, buflen, "position %d", V8_SMI_VALUE(tokpos));
+ return (0);
+ }
+
+ if (read_heap_smi(&size, lendsp, V8_OFF_FIXEDARRAY_LENGTH) != 0)
+ return (-1);
+
+ bufsz = size * sizeof (data[0]);
+
+ if ((data = mdb_alloc(bufsz, UM_NOSLEEP)) == NULL) {
+ v8_warn("failed to alloc %d bytes for FixedArray data", bufsz);
+ return (-1);
+ }
+
+ if (mdb_vread(data, bufsz, lendsp + V8_OFF_FIXEDARRAY_DATA) != bufsz) {
+ v8_warn("failed to read FixedArray data");
+ mdb_free(data, bufsz);
+ return (-1);
+ }
+
+ lower = 0;
+ upper = size - 1;
+
+ if (tokpos > data[upper]) {
+ (void) strlcpy(buf, "position out of range", buflen);
+ mdb_free(data, bufsz);
+ return (0);
+ }
+
+ if (tokpos <= data[0]) {
+ (void) strlcpy(buf, "line 1", buflen);
+ mdb_free(data, bufsz);
+ return (0);
+ }
+
+ while (upper >= 1) {
+ ii = (lower + upper) >> 1;
+ if (tokpos > data[ii])
+ lower = ii + 1;
+ else if (tokpos <= data[ii - 1])
+ upper = ii - 1;
+ else
+ break;
+ }
+
+ (void) mdb_snprintf(buf, buflen, "line %d", ii + 1);
+ mdb_free(data, bufsz);
+ return (0);
+}
+
+/*
+ * Given a SharedFunctionInfo object, prints into bufp a name of the function
+ * suitable for printing. This function attempts to infer a name for anonymous
+ * functions.
+ */
+static int
+jsfunc_name(uintptr_t funcinfop, char **bufp, size_t *lenp)
+{
+ uintptr_t ptrp;
+ char *bufs = *bufp;
+
+ if (read_heap_ptr(&ptrp, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_NAME) != 0 ||
+ jsstr_print(ptrp, JSSTR_NUDE, bufp, lenp) != 0)
+ return (-1);
+
+ if (*bufp != bufs)
+ return (0);
+
+ if (read_heap_ptr(&ptrp, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_INFERRED_NAME) != 0) {
+ (void) bsnprintf(bufp, lenp, "<anonymous>");
+ return (0);
+ }
+
+ (void) bsnprintf(bufp, lenp, "<anonymous> (as ");
+ bufs = *bufp;
+
+ if (jsstr_print(ptrp, JSSTR_NUDE, bufp, lenp) != 0)
+ return (-1);
+
+ if (*bufp == bufs)
+ (void) bsnprintf(bufp, lenp, "<anon>");
+
+ (void) bsnprintf(bufp, lenp, ")");
+
+ return (0);
+}
+
+/*
+ * JavaScript-level object printing
+ */
+typedef struct jsobj_print {
+ char **jsop_bufp;
+ size_t *jsop_lenp;
+ int jsop_indent;
+ uint64_t jsop_depth;
+ boolean_t jsop_printaddr;
+ uintptr_t jsop_baseaddr;
+ int jsop_nprops;
+ const char *jsop_member;
+ boolean_t jsop_found;
+} jsobj_print_t;
+
+static int jsobj_print_number(uintptr_t, jsobj_print_t *);
+static int jsobj_print_oddball(uintptr_t, jsobj_print_t *);
+static int jsobj_print_jsobject(uintptr_t, jsobj_print_t *);
+static int jsobj_print_jsarray(uintptr_t, jsobj_print_t *);
+static int jsobj_print_jsfunction(uintptr_t, jsobj_print_t *);
+static int jsobj_print_jsdate(uintptr_t, jsobj_print_t *);
+
+static int
+jsobj_print(uintptr_t addr, jsobj_print_t *jsop)
+{
+ uint8_t type;
+ const char *klass;
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+
+ const struct {
+ char *name;
+ int (*func)(uintptr_t, jsobj_print_t *);
+ } table[] = {
+ { "HeapNumber", jsobj_print_number },
+ { "Oddball", jsobj_print_oddball },
+ { "JSObject", jsobj_print_jsobject },
+ { "JSArray", jsobj_print_jsarray },
+ { "JSFunction", jsobj_print_jsfunction },
+ { "JSDate", jsobj_print_jsdate },
+ { NULL }
+ }, *ent;
+
+ if (jsop->jsop_baseaddr != NULL && jsop->jsop_member == NULL)
+ (void) bsnprintf(bufp, lenp, "%p: ", jsop->jsop_baseaddr);
+
+ if (jsop->jsop_printaddr && jsop->jsop_member == NULL)
+ (void) bsnprintf(bufp, lenp, "%p: ", addr);
+
+ if (V8_IS_SMI(addr)) {
+ (void) bsnprintf(bufp, lenp, "%d", V8_SMI_VALUE(addr));
+ return (0);
+ }
+
+ if (!V8_IS_HEAPOBJECT(addr)) {
+ v8_warn("not a heap object: %p\n", addr);
+ return (-1);
+ }
+
+ if (read_typebyte(&type, addr) != 0)
+ return (-1);
+
+ if (V8_TYPE_STRING(type)) {
+ if (jsstr_print(addr, JSSTR_QUOTED, bufp, lenp) == -1)
+ return (-1);
+
+ return (0);
+ }
+
+ klass = enum_lookup_str(v8_types, type, "<unknown>");
+
+ for (ent = &table[0]; ent->name != NULL; ent++) {
+ if (strcmp(klass, ent->name) == 0)
+ return (ent->func(addr, jsop));
+ }
+
+ v8_warn("%p: unknown JavaScript object type \"%s\"\n", addr, klass);
+ return (-1);
+}
+
+static int
+jsobj_print_number(uintptr_t addr, jsobj_print_t *jsop)
+{
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+ double numval;
+
+ if (read_heap_double(&numval, addr, V8_OFF_HEAPNUMBER_VALUE) == -1)
+ return (-1);
+
+ if (numval == (long long)numval)
+ (void) bsnprintf(bufp, lenp, "%lld", (long long)numval);
+ else
+ (void) bsnprintf(bufp, lenp, "%e", numval);
+
+ return (0);
+}
+
+static int
+jsobj_print_oddball(uintptr_t addr, jsobj_print_t *jsop)
+{
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+ uintptr_t strptr;
+
+ if (read_heap_ptr(&strptr, addr, V8_OFF_ODDBALL_TO_STRING) != 0)
+ return (-1);
+
+ return (jsstr_print(strptr, JSSTR_NUDE, bufp, lenp));
+}
+
+static int
+jsobj_print_prop(const char *desc, uintptr_t val, void *arg)
+{
+ jsobj_print_t *jsop = arg, descend;
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+
+ (void) bsnprintf(bufp, lenp, "%s\n%*s%s: ", jsop->jsop_nprops == 0 ?
+ "{" : "", jsop->jsop_indent + 4, "", desc);
+
+ descend = *jsop;
+ descend.jsop_depth--;
+ descend.jsop_indent += 4;
+
+ (void) jsobj_print(val, &descend);
+ (void) bsnprintf(bufp, lenp, ",");
+
+ jsop->jsop_nprops++;
+
+ return (0);
+}
+
+static int
+jsobj_print_prop_member(const char *desc, uintptr_t val, void *arg)
+{
+ jsobj_print_t *jsop = arg, descend;
+ const char *member = jsop->jsop_member, *next = member;
+ int rv;
+
+ for (; *next != '\0' && *next != '.' && *next != '['; next++)
+ continue;
+
+ if (*member == '[') {
+ mdb_warn("cannot use array indexing on an object\n");
+ return (-1);
+ }
+
+ if (strncmp(member, desc, next - member) != 0)
+ return (0);
+
+ if (desc[next - member] != '\0')
+ return (0);
+
+ /*
+ * This property matches the desired member; descend.
+ */
+ descend = *jsop;
+
+ if (*next == '\0') {
+ descend.jsop_member = NULL;
+ descend.jsop_found = B_TRUE;
+ } else {
+ descend.jsop_member = *next == '.' ? next + 1 : next;
+ }
+
+ rv = jsobj_print(val, &descend);
+ jsop->jsop_found = descend.jsop_found;
+
+ return (rv);
+}
+
+static int
+jsobj_print_jsobject(uintptr_t addr, jsobj_print_t *jsop)
+{
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+
+ if (jsop->jsop_member != NULL)
+ return (jsobj_properties(addr, jsobj_print_prop_member, jsop));
+
+ if (jsop->jsop_depth == 0) {
+ (void) bsnprintf(bufp, lenp, "[...]");
+ return (0);
+ }
+
+ jsop->jsop_nprops = 0;
+
+ if (jsobj_properties(addr, jsobj_print_prop, jsop) != 0)
+ return (-1);
+
+ if (jsop->jsop_nprops > 0) {
+ (void) bsnprintf(bufp, lenp, "\n%*s", jsop->jsop_indent, "");
+ } else if (jsop->jsop_nprops == 0) {
+ (void) bsnprintf(bufp, lenp, "{");
+ } else {
+ (void) bsnprintf(bufp, lenp, "{ /* unknown property */ ");
+ }
+
+ (void) bsnprintf(bufp, lenp, "}");
+
+ return (0);
+}
+
+static int
+jsobj_print_jsarray_member(uintptr_t addr, jsobj_print_t *jsop)
+{
+ uintptr_t *elts;
+ jsobj_print_t descend;
+ uintptr_t ptr;
+ const char *member = jsop->jsop_member, *end, *p;
+ size_t elt = 0, place = 1, len, rv;
+
+ if (read_heap_ptr(&ptr, addr, V8_OFF_JSOBJECT_ELEMENTS) != 0 ||
+ read_heap_array(ptr, &elts, &len, UM_SLEEP | UM_GC) != 0)
+ return (-1);
+
+ if (*member != '[') {
+ mdb_warn("expected bracketed array index; "
+ "found '%s'\n", member);
+ return (-1);
+ }
+
+ if ((end = strchr(member, ']')) == NULL) {
+ mdb_warn("missing array index terminator\n");
+ return (-1);
+ }
+
+ /*
+ * We know where our array index ends; convert it to an integer
+ * by stepping through it from least significant digit to most.
+ */
+ for (p = end - 1; p > member; p--) {
+ if (*p < '0' || *p > '9') {
+ mdb_warn("illegal array index at '%c'\n", *p);
+ return (-1);
+ }
+
+ elt += (*p - '0') * place;
+ place *= 10;
+ }
+
+ if (place == 1) {
+ mdb_warn("missing array index\n");
+ return (-1);
+ }
+
+ if (elt >= len) {
+ mdb_warn("array index %d exceeds size of %d\n", elt, len);
+ return (-1);
+ }
+
+ descend = *jsop;
+
+ switch (*(++end)) {
+ case '\0':
+ descend.jsop_member = NULL;
+ descend.jsop_found = B_TRUE;
+ break;
+
+ case '.':
+ descend.jsop_member = end + 1;
+ break;
+
+ case '[':
+ descend.jsop_member = end;
+ break;
+
+ default:
+ mdb_warn("illegal character '%c' following "
+ "array index terminator\n", *end);
+ return (-1);
+ }
+
+ rv = jsobj_print(elts[elt], &descend);
+ jsop->jsop_found = descend.jsop_found;
+
+ return (rv);
+}
+
+static int
+jsobj_print_jsarray(uintptr_t addr, jsobj_print_t *jsop)
+{
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+ int indent = jsop->jsop_indent;
+ jsobj_print_t descend;
+ uintptr_t ptr;
+ uintptr_t *elts;
+ size_t ii, len;
+
+ if (jsop->jsop_member != NULL)
+ return (jsobj_print_jsarray_member(addr, jsop));
+
+ if (jsop->jsop_depth == 0) {
+ (void) bsnprintf(bufp, lenp, "[...]");
+ return (0);
+ }
+
+ if (read_heap_ptr(&ptr, addr, V8_OFF_JSOBJECT_ELEMENTS) != 0 ||
+ read_heap_array(ptr, &elts, &len, UM_SLEEP | UM_GC) != 0)
+ return (-1);
+
+ if (len == 0) {
+ (void) bsnprintf(bufp, lenp, "[]");
+ return (0);
+ }
+
+ descend = *jsop;
+ descend.jsop_depth--;
+ descend.jsop_indent += 4;
+
+ if (len == 1) {
+ (void) bsnprintf(bufp, lenp, "[ ");
+ (void) jsobj_print(elts[0], &descend);
+ (void) bsnprintf(bufp, lenp, " ]");
+ return (0);
+ }
+
+ (void) bsnprintf(bufp, lenp, "[\n");
+
+ for (ii = 0; ii < len; ii++) {
+ (void) bsnprintf(bufp, lenp, "%*s", indent + 4, "");
+ (void) jsobj_print(elts[ii], &descend);
+ (void) bsnprintf(bufp, lenp, ",\n");
+ }
+
+ (void) bsnprintf(bufp, lenp, "%*s", indent, "");
+ (void) bsnprintf(bufp, lenp, "]");
+
+ return (0);
+}
+
+static int
+jsobj_print_jsfunction(uintptr_t addr, jsobj_print_t *jsop)
+{
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+ uintptr_t shared;
+
+ if (read_heap_ptr(&shared, addr, V8_OFF_JSFUNCTION_SHARED) != 0)
+ return (-1);
+
+ (void) bsnprintf(bufp, lenp, "function ");
+ return (jsfunc_name(shared, bufp, lenp) != 0);
+}
+
+static int
+jsobj_print_jsdate(uintptr_t addr, jsobj_print_t *jsop)
+{
+ char **bufp = jsop->jsop_bufp;
+ size_t *lenp = jsop->jsop_lenp;
+ char buf[128];
+ uintptr_t value;
+ uint8_t type;
+ double numval;
+
+ if (V8_OFF_JSDATE_VALUE == -1) {
+ (void) bsnprintf(bufp, lenp, "<JSDate>", buf);
+ return (0);
+ }
+
+ if (read_heap_ptr(&value, addr, V8_OFF_JSDATE_VALUE) != 0)
+ return (-1);
+
+ if (read_typebyte(&type, value) != 0)
+ return (-1);
+
+ if (strcmp(enum_lookup_str(v8_types, type, ""), "HeapNumber") != 0)
+ return (-1);
+
+ if (read_heap_double(&numval, value, V8_OFF_HEAPNUMBER_VALUE) == -1)
+ return (-1);
+
+ mdb_snprintf(buf, sizeof (buf), "%Y",
+ (time_t)((long long)numval / MILLISEC));
+ (void) bsnprintf(bufp, lenp, "%lld (%s)", (long long)numval, buf);
+
+ return (0);
+}
+
+/*
+ * dcmd implementations
+ */
+
+/* ARGSUSED */
+static int
+dcmd_v8classes(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ v8_class_t *clp;
+
+ for (clp = v8_classes; clp != NULL; clp = clp->v8c_next)
+ mdb_printf("%s\n", clp->v8c_name);
+
+ return (DCMD_OK);
+}
+
+static int
+do_v8code(uintptr_t addr, boolean_t opt_d)
+{
+ uintptr_t instrlen;
+ ssize_t instroff = V8_OFF_CODE_INSTRUCTION_START;
+
+ if (read_heap_ptr(&instrlen, addr, V8_OFF_CODE_INSTRUCTION_SIZE) != 0)
+ return (DCMD_ERR);
+
+ mdb_printf("code: %p\n", addr);
+ mdb_printf("instructions: [%p, %p)\n", addr + instroff,
+ addr + instroff + instrlen);
+
+ if (!opt_d)
+ return (DCMD_OK);
+
+ mdb_set_dot(addr + instroff);
+
+ do {
+ (void) mdb_inc_indent(8); /* gets reset by mdb_eval() */
+
+ /*
+ * This is absolutely awful. We want to disassemble the above
+ * range of instructions. Because we don't know how many there
+ * are, we can't use "::dis". We resort to evaluating "./i",
+ * but then we need to advance "." by the size of the
+ * instruction just printed. The only way to do that is by
+ * printing out "+", but we don't want that to show up, so we
+ * redirect it to /dev/null.
+ */
+ if (mdb_eval("/i") != 0 ||
+ mdb_eval("+=p ! cat > /dev/null") != 0) {
+ (void) mdb_dec_indent(8);
+ v8_warn("failed to disassemble at %p", mdb_get_dot());
+ return (DCMD_ERR);
+ }
+ } while (mdb_get_dot() < addr + instroff + instrlen);
+
+ (void) mdb_dec_indent(8);
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8code(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ boolean_t opt_d = B_FALSE;
+
+ if (mdb_getopts(argc, argv, 'd', MDB_OPT_SETBITS, B_TRUE, &opt_d,
+ NULL) != argc)
+ return (DCMD_USAGE);
+
+ return (do_v8code(addr, opt_d));
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8function(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ uint8_t type;
+ uintptr_t funcinfop, scriptp, lendsp, tokpos, namep, codep;
+ char *bufp;
+ size_t len;
+ boolean_t opt_d = B_FALSE;
+ char buf[512];
+
+ if (mdb_getopts(argc, argv, 'd', MDB_OPT_SETBITS, B_TRUE, &opt_d,
+ NULL) != argc)
+ return (DCMD_USAGE);
+
+ if (read_typebyte(&type, addr) != 0)
+ return (DCMD_ERR);
+
+ if (strcmp(enum_lookup_str(v8_types, type, ""), "JSFunction") != 0) {
+ v8_warn("%p is not an instance of JSFunction\n", addr);
+ return (DCMD_ERR);
+ }
+
+ if (read_heap_ptr(&funcinfop, addr, V8_OFF_JSFUNCTION_SHARED) != 0 ||
+ read_heap_ptr(&tokpos, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_FUNCTION_TOKEN_POSITION) != 0 ||
+ read_heap_ptr(&scriptp, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_SCRIPT) != 0 ||
+ read_heap_ptr(&namep, scriptp, V8_OFF_SCRIPT_NAME) != 0 ||
+ read_heap_ptr(&lendsp, scriptp, V8_OFF_SCRIPT_LINE_ENDS) != 0)
+ return (DCMD_ERR);
+
+ bufp = buf;
+ len = sizeof (buf);
+ if (jsfunc_name(funcinfop, &bufp, &len) != 0)
+ return (DCMD_ERR);
+
+ mdb_printf("%p: JSFunction: %s\n", addr, buf);
+
+ bufp = buf;
+ len = sizeof (buf);
+ mdb_printf("defined at ");
+
+ if (jsstr_print(namep, JSSTR_NUDE, &bufp, &len) == 0)
+ mdb_printf("%s ", buf);
+
+ if (jsfunc_lineno(lendsp, tokpos, buf, sizeof (buf)) == 0)
+ mdb_printf("%s", buf);
+
+ mdb_printf("\n");
+
+ if (read_heap_ptr(&codep,
+ funcinfop, V8_OFF_SHAREDFUNCTIONINFO_CODE) != 0)
+ return (DCMD_ERR);
+
+ return (do_v8code(codep, opt_d));
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8frametypes(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ enum_print(v8_frametypes);
+ return (DCMD_OK);
+}
+
+static void
+dcmd_v8print_help(void)
+{
+ mdb_printf(
+ "Prints out \".\" (a V8 heap object) as an instance of its C++\n"
+ "class. With no arguments, the appropriate class is detected\n"
+ "automatically. The 'class' argument overrides this to print an\n"
+ "object as an instance of the given class. The list of known\n"
+ "classes can be viewed with ::jsclasses.");
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8print(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ const char *rqclass;
+ v8_class_t *clp;
+ char *bufp;
+ size_t len;
+ uint8_t type;
+ char buf[256];
+
+ if (argc < 1) {
+ /*
+ * If no type was specified, determine it automatically.
+ */
+ bufp = buf;
+ len = sizeof (buf);
+ if (obj_jstype(addr, &bufp, &len, &type) != 0)
+ return (DCMD_ERR);
+
+ if (type == 0) {
+ /* For SMI or Failure, just print out the type. */
+ mdb_printf("%s\n", buf);
+ return (DCMD_OK);
+ }
+
+ if ((rqclass = enum_lookup_str(v8_types, type, NULL)) == NULL) {
+ v8_warn("object has unknown type\n");
+ return (DCMD_ERR);
+ }
+ } else {
+ if (argv[0].a_type != MDB_TYPE_STRING)
+ return (DCMD_USAGE);
+
+ rqclass = argv[0].a_un.a_str;
+ }
+
+ for (clp = v8_classes; clp != NULL; clp = clp->v8c_next) {
+ if (strcmp(rqclass, clp->v8c_name) == 0)
+ break;
+ }
+
+ if (clp == NULL) {
+ v8_warn("unknown class '%s'\n", rqclass);
+ return (DCMD_USAGE);
+ }
+
+ return (obj_print_class(addr, clp));
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8type(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ char buf[64];
+ char *bufp = buf;
+ size_t len = sizeof (buf);
+
+ if (obj_jstype(addr, &bufp, &len, NULL) != 0)
+ return (DCMD_ERR);
+
+ mdb_printf("0x%p: %s\n", addr, buf);
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8types(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ enum_print(v8_types);
+ return (DCMD_OK);
+}
+
+static int
+load_current_context(uintptr_t *fpp, uintptr_t *raddrp)
+{
+ mdb_reg_t regfp, regip;
+
+#ifdef __amd64
+ if (mdb_getareg(1, "rbp", &regfp) != 0 ||
+ mdb_getareg(1, "rip", &regip) != 0) {
+#else
+#ifdef __i386
+ if (mdb_getareg(1, "ebp", &regfp) != 0 ||
+ mdb_getareg(1, "eip", &regip) != 0) {
+#else
+#error Unrecognized microprocessor
+#endif
+#endif
+ v8_warn("failed to load current context");
+ return (-1);
+ }
+
+ if (fpp != NULL)
+ *fpp = (uintptr_t)regfp;
+
+ if (raddrp != NULL)
+ *raddrp = (uintptr_t)regip;
+
+ return (0);
+}
+
+static int
+do_jsframe_special(uintptr_t fptr, uintptr_t raddr, char *prop)
+{
+ uintptr_t ftype;
+ const char *ftypename;
+
+ /*
+ * First see if this looks like a native frame rather than a JavaScript
+ * frame. We check this by asking MDB to print the return address
+ * symbolically. If that works, we assume this was NOT a V8 frame,
+ * since those are never in the symbol table.
+ */
+ if (mdb_snprintf(NULL, 0, "%A", raddr) > 1) {
+ if (prop != NULL)
+ return (0);
+
+ mdb_printf("%p %a\n", fptr, raddr);
+ return (0);
+ }
+
+ /*
+ * Figure out what kind of frame this is using the same algorithm as
+ * V8's ComputeType function. First, look for an ArgumentsAdaptorFrame.
+ */
+ if (mdb_vread(&ftype, sizeof (ftype), fptr + V8_OFF_FP_CONTEXT) != -1 &&
+ V8_IS_SMI(ftype) &&
+ (ftypename = enum_lookup_str(v8_frametypes, V8_SMI_VALUE(ftype),
+ NULL)) != NULL && strstr(ftypename, "ArgumentsAdaptor") != NULL) {
+ if (prop != NULL)
+ return (0);
+
+ mdb_printf("%p %a <%s>\n", fptr, raddr, ftypename);
+ return (0);
+ }
+
+ /*
+ * Other special frame types are indicated by a marker.
+ */
+ if (mdb_vread(&ftype, sizeof (ftype), fptr + V8_OFF_FP_MARKER) != -1 &&
+ V8_IS_SMI(ftype)) {
+ if (prop != NULL)
+ return (0);
+
+ ftypename = enum_lookup_str(v8_frametypes, V8_SMI_VALUE(ftype),
+ NULL);
+
+ if (ftypename != NULL)
+ mdb_printf("%p %a <%s>\n", fptr, raddr, ftypename);
+ else
+ mdb_printf("%p %a\n", fptr, raddr);
+
+ return (0);
+ }
+
+ return (-1);
+}
+
+static int
+do_jsframe(uintptr_t fptr, uintptr_t raddr, boolean_t verbose,
+ char *func, char *prop)
+{
+ uintptr_t funcp, funcinfop, tokpos, scriptp, lendsp, ptrp;
+ uintptr_t ii, nargs;
+ const char *typename;
+ char *bufp;
+ size_t len;
+ uint8_t type;
+ char buf[256];
+
+ /*
+ * Check for non-JavaScript frames first.
+ */
+ if (func == NULL && do_jsframe_special(fptr, raddr, prop) == 0)
+ return (DCMD_OK);
+
+ /*
+ * At this point we assume we're looking at a JavaScript frame. As with
+ * native frames, fish the address out of the parent frame.
+ */
+ if (mdb_vread(&funcp, sizeof (funcp),
+ fptr + V8_OFF_FP_FUNCTION) == -1) {
+ v8_warn("failed to read stack at %p",
+ fptr + V8_OFF_FP_FUNCTION);
+ return (DCMD_ERR);
+ }
+
+ /*
+ * Check if this thing is really a JSFunction at all. For some frames,
+ * it's a Code object, presumably indicating some internal frame.
+ */
+ v8_silent++;
+
+ if (read_typebyte(&type, funcp) != 0 ||
+ (typename = enum_lookup_str(v8_types, type, NULL)) == NULL) {
+ v8_silent--;
+
+ if (func != NULL || prop != NULL)
+ return (DCMD_OK);
+
+ mdb_printf("%p %a\n", fptr, raddr);
+ return (DCMD_OK);
+ }
+
+ v8_silent--;
+
+ if (strcmp("Code", typename) == 0) {
+ if (func != NULL || prop != NULL)
+ return (DCMD_OK);
+
+ mdb_printf("%p %a internal (Code: %p)\n", fptr, raddr, funcp);
+ return (DCMD_OK);
+ }
+
+ if (strcmp("JSFunction", typename) != 0) {
+ if (func != NULL || prop != NULL)
+ return (DCMD_OK);
+
+ mdb_printf("%p %a unknown (%s: %p)", fptr, raddr, typename,
+ funcp);
+ return (DCMD_OK);
+ }
+
+ if (read_heap_ptr(&funcinfop, funcp, V8_OFF_JSFUNCTION_SHARED) != 0)
+ return (DCMD_ERR);
+
+ bufp = buf;
+ len = sizeof (buf);
+ if (jsfunc_name(funcinfop, &bufp, &len) != 0)
+ return (DCMD_ERR);
+
+ if (func != NULL && strcmp(buf, func) != 0)
+ return (DCMD_OK);
+
+ if (prop == NULL)
+ mdb_printf("%p %a %s (%p)\n", fptr, raddr, buf, funcp);
+
+ if (!verbose && prop == NULL)
+ return (DCMD_OK);
+
+ /*
+ * Although the token position is technically an SMI, we're going to
+ * byte-compare it to other SMI values so we don't want decode it here.
+ */
+ if (read_heap_ptr(&tokpos, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_FUNCTION_TOKEN_POSITION) != 0)
+ return (DCMD_ERR);
+
+ if (read_heap_ptr(&scriptp, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_SCRIPT) != 0)
+ return (DCMD_ERR);
+
+ if (read_heap_ptr(&ptrp, scriptp, V8_OFF_SCRIPT_NAME) != 0)
+ return (DCMD_ERR);
+
+ bufp = buf;
+ len = sizeof (buf);
+ (void) jsstr_print(ptrp, JSSTR_NUDE, &bufp, &len);
+
+ if (prop != NULL && strcmp(prop, "file") == 0) {
+ mdb_printf("%s\n", buf);
+ return (DCMD_OK);
+ }
+
+ if (prop == NULL) {
+ (void) mdb_inc_indent(4);
+ mdb_printf("file: %s\n", buf);
+ }
+
+ if (read_heap_ptr(&lendsp, scriptp, V8_OFF_SCRIPT_LINE_ENDS) != 0)
+ return (DCMD_ERR);
+
+ (void) jsfunc_lineno(lendsp, tokpos, buf, sizeof (buf));
+
+ if (prop != NULL && strcmp(prop, "posn") == 0) {
+ mdb_printf("%s\n", buf);
+ return (DCMD_OK);
+ }
+
+ if (prop == NULL)
+ mdb_printf("posn: %s\n", buf);
+
+ if (read_heap_smi(&nargs, funcinfop,
+ V8_OFF_SHAREDFUNCTIONINFO_LENGTH) == 0) {
+ for (ii = 0; ii < nargs; ii++) {
+ uintptr_t argptr;
+ char arg[10];
+
+ if (mdb_vread(&argptr, sizeof (argptr),
+ fptr + V8_OFF_FP_ARGS + (nargs - ii - 1) *
+ sizeof (uintptr_t)) == -1)
+ continue;
+
+ (void) snprintf(arg, sizeof (arg), "arg%d", ii + 1);
+
+ if (prop != NULL) {
+ if (strcmp(arg, prop) != 0)
+ continue;
+
+ mdb_printf("%p\n", argptr);
+ return (DCMD_OK);
+ }
+
+ bufp = buf;
+ len = sizeof (buf);
+ (void) obj_jstype(argptr, &bufp, &len, NULL);
+
+ mdb_printf("arg%d: %p (%s)\n", (ii + 1), argptr, buf);
+ }
+ }
+
+ if (prop != NULL) {
+ mdb_warn("unknown frame property '%s'\n", prop);
+ return (DCMD_ERR);
+ }
+
+ (void) mdb_dec_indent(4);
+
+ return (DCMD_OK);
+}
+
+typedef struct findjsobjects_prop {
+ struct findjsobjects_prop *fjsp_next;
+ char fjsp_desc[1];
+} findjsobjects_prop_t;
+
+typedef struct findjsobjects_instance {
+ uintptr_t fjsi_addr;
+ struct findjsobjects_instance *fjsi_next;
+} findjsobjects_instance_t;
+
+typedef struct findjsobjects_obj {
+ findjsobjects_prop_t *fjso_props;
+ findjsobjects_prop_t *fjso_last;
+ size_t fjso_nprops;
+ findjsobjects_instance_t fjso_instances;
+ int fjso_ninstances;
+ avl_node_t fjso_node;
+ struct findjsobjects_obj *fjso_next;
+ boolean_t fjso_malformed;
+ char fjso_constructor[80];
+} findjsobjects_obj_t;
+
+typedef struct findjsobjects_stats {
+ int fjss_heapobjs;
+ int fjss_cached;
+ int fjss_typereads;
+ int fjss_jsobjs;
+ int fjss_objects;
+ int fjss_arrays;
+ int fjss_uniques;
+} findjsobjects_stats_t;
+
+typedef struct findjsobjects_reference {
+ uintptr_t fjsrf_addr;
+ char *fjsrf_desc;
+ size_t fjsrf_index;
+ struct findjsobjects_reference *fjsrf_next;
+} findjsobjects_reference_t;
+
+typedef struct findjsobjects_referent {
+ avl_node_t fjsr_node;
+ uintptr_t fjsr_addr;
+ findjsobjects_reference_t *fjsr_head;
+ findjsobjects_reference_t *fjsr_tail;
+ struct findjsobjects_referent *fjsr_next;
+} findjsobjects_referent_t;
+
+typedef struct findjsobjects_state {
+ uintptr_t fjs_addr;
+ uintptr_t fjs_size;
+ boolean_t fjs_verbose;
+ boolean_t fjs_brk;
+ boolean_t fjs_allobjs;
+ boolean_t fjs_initialized;
+ boolean_t fjs_marking;
+ boolean_t fjs_referred;
+ avl_tree_t fjs_tree;
+ avl_tree_t fjs_referents;
+ findjsobjects_referent_t *fjs_head;
+ findjsobjects_referent_t *fjs_tail;
+ findjsobjects_obj_t *fjs_current;
+ findjsobjects_obj_t *fjs_objects;
+ findjsobjects_stats_t fjs_stats;
+} findjsobjects_state_t;
+
+findjsobjects_obj_t *
+findjsobjects_alloc(uintptr_t addr)
+{
+ findjsobjects_obj_t *obj;
+
+ obj = mdb_zalloc(sizeof (findjsobjects_obj_t), UM_SLEEP);
+ obj->fjso_instances.fjsi_addr = addr;
+ obj->fjso_ninstances = 1;
+
+ return (obj);
+}
+
+void
+findjsobjects_free(findjsobjects_obj_t *obj)
+{
+ findjsobjects_prop_t *prop, *next;
+
+ for (prop = obj->fjso_props; prop != NULL; prop = next) {
+ next = prop->fjsp_next;
+ mdb_free(prop, sizeof (findjsobjects_prop_t) +
+ strlen(prop->fjsp_desc));
+ }
+
+ mdb_free(obj, sizeof (findjsobjects_obj_t));
+}
+
+int
+findjsobjects_cmp(findjsobjects_obj_t *lhs, findjsobjects_obj_t *rhs)
+{
+ findjsobjects_prop_t *lprop, *rprop;
+ int rv;
+
+ lprop = lhs->fjso_props;
+ rprop = rhs->fjso_props;
+
+ while (lprop != NULL && rprop != NULL) {
+ if ((rv = strcmp(lprop->fjsp_desc, rprop->fjsp_desc)) != 0)
+ return (rv > 0 ? 1 : -1);
+
+ lprop = lprop->fjsp_next;
+ rprop = rprop->fjsp_next;
+ }
+
+ if (lprop != NULL)
+ return (1);
+
+ if (rprop != NULL)
+ return (-1);
+
+ if (lhs->fjso_nprops > rhs->fjso_nprops)
+ return (1);
+
+ if (lhs->fjso_nprops < rhs->fjso_nprops)
+ return (-1);
+
+ rv = strcmp(lhs->fjso_constructor, rhs->fjso_constructor);
+
+ return (rv < 0 ? -1 : rv > 0 ? 1 : 0);
+}
+
+int
+findjsobjects_cmp_referents(findjsobjects_referent_t *lhs,
+ findjsobjects_referent_t *rhs)
+{
+ if (lhs->fjsr_addr < rhs->fjsr_addr)
+ return (-1);
+
+ if (lhs->fjsr_addr > rhs->fjsr_addr)
+ return (1);
+
+ return (0);
+}
+
+int
+findjsobjects_cmp_ninstances(const void *l, const void *r)
+{
+ findjsobjects_obj_t *lhs = *((findjsobjects_obj_t **)l);
+ findjsobjects_obj_t *rhs = *((findjsobjects_obj_t **)r);
+ size_t lprod = lhs->fjso_ninstances * lhs->fjso_nprops;
+ size_t rprod = rhs->fjso_ninstances * rhs->fjso_nprops;
+
+ if (lprod < rprod)
+ return (-1);
+
+ if (lprod > rprod)
+ return (1);
+
+ if (lhs->fjso_ninstances < rhs->fjso_ninstances)
+ return (-1);
+
+ if (lhs->fjso_ninstances > rhs->fjso_ninstances)
+ return (1);
+
+ if (lhs->fjso_nprops < rhs->fjso_nprops)
+ return (-1);
+
+ if (lhs->fjso_nprops > rhs->fjso_nprops)
+ return (1);
+
+ return (0);
+}
+
+/*ARGSUSED*/
+int
+findjsobjects_prop(const char *desc, uintptr_t val, void *arg)
+{
+ findjsobjects_state_t *fjs = arg;
+ findjsobjects_obj_t *current = fjs->fjs_current;
+ findjsobjects_prop_t *prop;
+
+ if (desc == NULL)
+ desc = "<unknown>";
+
+ prop = mdb_zalloc(sizeof (findjsobjects_prop_t) +
+ strlen(desc), UM_SLEEP);
+
+ strcpy(prop->fjsp_desc, desc);
+
+ if (current->fjso_last != NULL) {
+ current->fjso_last->fjsp_next = prop;
+ } else {
+ current->fjso_props = prop;
+ }
+
+ current->fjso_last = prop;
+ current->fjso_nprops++;
+ current->fjso_malformed =
+ val == NULL && current->fjso_nprops == 1 && desc[0] == '<';
+
+ return (0);
+}
+
+static void
+findjsobjects_constructor(findjsobjects_obj_t *obj)
+{
+ char *bufp = obj->fjso_constructor;
+ size_t len = sizeof (obj->fjso_constructor);
+ uintptr_t map, funcinfop;
+ uintptr_t addr = obj->fjso_instances.fjsi_addr;
+ uint8_t type;
+
+ v8_silent++;
+
+ if (read_heap_ptr(&map, addr, V8_OFF_HEAPOBJECT_MAP) != 0 ||
+ read_heap_ptr(&addr, map, V8_OFF_MAP_CONSTRUCTOR) != 0)
+ goto out;
+
+ if (read_typebyte(&type, addr) != 0)
+ goto out;
+
+ if (strcmp(enum_lookup_str(v8_types, type, ""), "JSFunction") != 0)
+ goto out;
+
+ if (read_heap_ptr(&funcinfop, addr, V8_OFF_JSFUNCTION_SHARED) != 0)
+ goto out;
+
+ if (jsfunc_name(funcinfop, &bufp, &len) != 0)
+ goto out;
+out:
+ v8_silent--;
+}
+
+int
+findjsobjects_range(findjsobjects_state_t *fjs, uintptr_t addr, uintptr_t size)
+{
+ uintptr_t limit;
+ findjsobjects_stats_t *stats = &fjs->fjs_stats;
+ uint8_t type;
+ int jsobject = V8_TYPE_JSOBJECT, jsarray = V8_TYPE_JSARRAY;
+ caddr_t range = mdb_alloc(size, UM_SLEEP);
+ uintptr_t base = addr, mapaddr;
+
+ if (mdb_vread(range, size, addr) == -1)
+ return (0);
+
+ for (limit = addr + size; addr < limit; addr++) {
+ findjsobjects_instance_t *inst;
+ findjsobjects_obj_t *obj;
+ avl_index_t where;
+
+ if (V8_IS_SMI(addr))
+ continue;
+
+ if (!V8_IS_HEAPOBJECT(addr))
+ continue;
+
+ stats->fjss_heapobjs++;
+
+ mapaddr = *((uintptr_t *)((uintptr_t)range +
+ (addr - base) + V8_OFF_HEAPOBJECT_MAP));
+
+ if (!V8_IS_HEAPOBJECT(mapaddr))
+ continue;
+
+ mapaddr += V8_OFF_MAP_INSTANCE_ATTRIBUTES;
+ stats->fjss_typereads++;
+
+ if (mapaddr >= base && mapaddr < base + size) {
+ stats->fjss_cached++;
+
+ type = *((uint8_t *)((uintptr_t)range +
+ (mapaddr - base)));
+ } else {
+ if (mdb_vread(&type, sizeof (uint8_t), mapaddr) == -1)
+ continue;
+ }
+
+ if (type != jsobject && type != jsarray)
+ continue;
+
+ stats->fjss_jsobjs++;
+
+ fjs->fjs_current = findjsobjects_alloc(addr);
+
+ if (type == jsobject) {
+ if (jsobj_properties(addr,
+ findjsobjects_prop, fjs) != 0) {
+ findjsobjects_free(fjs->fjs_current);
+ fjs->fjs_current = NULL;
+ continue;
+ }
+
+ findjsobjects_constructor(fjs->fjs_current);
+ stats->fjss_objects++;
+ } else {
+ uintptr_t ptr;
+ size_t *nprops = &fjs->fjs_current->fjso_nprops;
+ ssize_t len = V8_OFF_JSARRAY_LENGTH;
+ ssize_t elems = V8_OFF_JSOBJECT_ELEMENTS;
+ ssize_t flen = V8_OFF_FIXEDARRAY_LENGTH;
+ uintptr_t nelems;
+ uint8_t t;
+
+ if (read_heap_smi(nprops, addr, len) != 0 ||
+ read_heap_ptr(&ptr, addr, elems) != 0 ||
+ !V8_IS_HEAPOBJECT(ptr) ||
+ read_typebyte(&t, ptr) != 0 ||
+ t != V8_TYPE_FIXEDARRAY ||
+ read_heap_smi(&nelems, ptr, flen) != 0 ||
+ nelems < *nprops) {
+ findjsobjects_free(fjs->fjs_current);
+ fjs->fjs_current = NULL;
+ continue;
+ }
+
+ strcpy(fjs->fjs_current->fjso_constructor, "Array");
+ stats->fjss_arrays++;
+ }
+
+ /*
+ * Now determine if we already have an object matching our
+ * properties. If we don't, we'll add our new object; if we
+ * do we'll merely enqueue our instance.
+ */
+ obj = avl_find(&fjs->fjs_tree, fjs->fjs_current, &where);
+
+ if (obj == NULL) {
+ avl_add(&fjs->fjs_tree, fjs->fjs_current);
+ fjs->fjs_current->fjso_next = fjs->fjs_objects;
+ fjs->fjs_objects = fjs->fjs_current;
+ fjs->fjs_current = NULL;
+ stats->fjss_uniques++;
+ continue;
+ }
+
+ findjsobjects_free(fjs->fjs_current);
+ fjs->fjs_current = NULL;
+
+ inst = mdb_alloc(sizeof (findjsobjects_instance_t), UM_SLEEP);
+ inst->fjsi_addr = addr;
+ inst->fjsi_next = obj->fjso_instances.fjsi_next;
+ obj->fjso_instances.fjsi_next = inst;
+ obj->fjso_ninstances++;
+ }
+
+ mdb_free(range, size);
+
+ return (0);
+}
+
+static int
+findjsobjects_mapping(findjsobjects_state_t *fjs, const prmap_t *pmp,
+ const char *name)
+{
+ if (name != NULL && !(fjs->fjs_brk && (pmp->pr_mflags & MA_BREAK)))
+ return (0);
+
+ if (fjs->fjs_addr != NULL && (fjs->fjs_addr < pmp->pr_vaddr ||
+ fjs->fjs_addr >= pmp->pr_vaddr + pmp->pr_size))
+ return (0);
+
+ return (findjsobjects_range(fjs, pmp->pr_vaddr, pmp->pr_size));
+}
+
+static void
+findjsobjects_references_add(findjsobjects_state_t *fjs, uintptr_t val,
+ const char *desc, size_t index)
+{
+ findjsobjects_referent_t search, *referent;
+ findjsobjects_reference_t *reference;
+
+ search.fjsr_addr = val;
+
+ if ((referent = avl_find(&fjs->fjs_referents, &search, NULL)) == NULL)
+ return;
+
+ reference = mdb_zalloc(sizeof (*reference), UM_SLEEP | UM_GC);
+ reference->fjsrf_addr = fjs->fjs_addr;
+
+ if (desc != NULL) {
+ reference->fjsrf_desc =
+ mdb_alloc(strlen(desc) + 1, UM_SLEEP | UM_GC);
+ (void) strcpy(reference->fjsrf_desc, desc);
+ } else {
+ reference->fjsrf_index = index;
+ }
+
+ if (referent->fjsr_head == NULL) {
+ referent->fjsr_head = reference;
+ } else {
+ referent->fjsr_tail->fjsrf_next = reference;
+ }
+
+ referent->fjsr_tail = reference;
+}
+
+static int
+findjsobjects_references_prop(const char *desc, uintptr_t val, void *arg)
+{
+ findjsobjects_references_add(arg, val, desc, -1);
+
+ return (0);
+}
+
+static void
+findjsobjects_references_array(findjsobjects_state_t *fjs,
+ findjsobjects_obj_t *obj)
+{
+ findjsobjects_instance_t *inst = &obj->fjso_instances;
+ uintptr_t *elts;
+ size_t i, len;
+
+ for (; inst != NULL; inst = inst->fjsi_next) {
+ uintptr_t addr = inst->fjsi_addr, ptr;
+
+ if (read_heap_ptr(&ptr, addr, V8_OFF_JSOBJECT_ELEMENTS) != 0 ||
+ read_heap_array(ptr, &elts, &len, UM_SLEEP) != 0)
+ continue;
+
+ fjs->fjs_addr = addr;
+
+ for (i = 0; i < len; i++)
+ findjsobjects_references_add(fjs, elts[i], NULL, i);
+
+ mdb_free(elts, len * sizeof (uintptr_t));
+ }
+}
+
+static void
+findjsobjects_referent(findjsobjects_state_t *fjs, uintptr_t addr)
+{
+ findjsobjects_referent_t search, *referent;
+
+ search.fjsr_addr = addr;
+
+ if (avl_find(&fjs->fjs_referents, &search, NULL) != NULL) {
+ assert(fjs->fjs_marking);
+ mdb_warn("%p is already marked; ignoring\n", addr);
+ return;
+ }
+
+ referent = mdb_zalloc(sizeof (findjsobjects_referent_t), UM_SLEEP);
+ referent->fjsr_addr = addr;
+
+ avl_add(&fjs->fjs_referents, referent);
+
+ if (fjs->fjs_tail != NULL) {
+ fjs->fjs_tail->fjsr_next = referent;
+ } else {
+ fjs->fjs_head = referent;
+ }
+
+ fjs->fjs_tail = referent;
+
+ if (fjs->fjs_marking)
+ mdb_printf("findjsobjects: marked %p\n", addr);
+}
+
+static void
+findjsobjects_references(findjsobjects_state_t *fjs)
+{
+ findjsobjects_reference_t *reference;
+ findjsobjects_referent_t *referent;
+ avl_tree_t *referents = &fjs->fjs_referents;
+ findjsobjects_obj_t *obj;
+ void *cookie = NULL;
+ uintptr_t addr;
+
+ fjs->fjs_referred = B_FALSE;
+
+ v8_silent++;
+
+ /*
+ * First traverse over all objects and arrays, looking for references
+ * to our designated referent(s).
+ */
+ for (obj = fjs->fjs_objects; obj != NULL; obj = obj->fjso_next) {
+ findjsobjects_instance_t *head = &obj->fjso_instances, *inst;
+
+ if (obj->fjso_nprops != 0 && obj->fjso_props == NULL) {
+ findjsobjects_references_array(fjs, obj);
+ continue;
+ }
+
+ for (inst = head; inst != NULL; inst = inst->fjsi_next) {
+ fjs->fjs_addr = inst->fjsi_addr;
+
+ (void) jsobj_properties(inst->fjsi_addr,
+ findjsobjects_references_prop, fjs);
+ }
+ }
+
+ v8_silent--;
+ fjs->fjs_addr = NULL;
+
+ /*
+ * Now go over our referent(s), reporting any references that we have
+ * accumulated.
+ */
+ for (referent = fjs->fjs_head; referent != NULL;
+ referent = referent->fjsr_next) {
+ addr = referent->fjsr_addr;
+
+ if ((reference = referent->fjsr_head) == NULL) {
+ mdb_printf("%p is not referred to by a "
+ "known object.\n", addr);
+ continue;
+ }
+
+ for (; reference != NULL; reference = reference->fjsrf_next) {
+ mdb_printf("%p referred to by %p",
+ addr, reference->fjsrf_addr);
+
+ if (reference->fjsrf_desc == NULL) {
+ mdb_printf("[%d]\n", reference->fjsrf_index);
+ } else {
+ mdb_printf(".%s\n", reference->fjsrf_desc);
+ }
+ }
+ }
+
+ /*
+ * Finally, destroy our referent nodes.
+ */
+ while ((referent = avl_destroy_nodes(referents, &cookie)) != NULL)
+ mdb_free(referent, sizeof (findjsobjects_referent_t));
+
+ fjs->fjs_head = NULL;
+ fjs->fjs_tail = NULL;
+}
+
+static findjsobjects_instance_t *
+findjsobjects_instance(findjsobjects_state_t *fjs, uintptr_t addr,
+ findjsobjects_instance_t **headp)
+{
+ findjsobjects_obj_t *obj;
+
+ for (obj = fjs->fjs_objects; obj != NULL; obj = obj->fjso_next) {
+ findjsobjects_instance_t *head = &obj->fjso_instances, *inst;
+
+ for (inst = head; inst != NULL; inst = inst->fjsi_next) {
+ if (inst->fjsi_addr == addr) {
+ *headp = head;
+ return (inst);
+ }
+ }
+ }
+
+ return (NULL);
+}
+
+/*ARGSUSED*/
+static void
+findjsobjects_match_all(findjsobjects_obj_t *obj, const char *ignored)
+{
+ mdb_printf("%p\n", obj->fjso_instances.fjsi_addr);
+}
+
+static void
+findjsobjects_match_propname(findjsobjects_obj_t *obj, const char *propname)
+{
+ findjsobjects_prop_t *prop;
+
+ for (prop = obj->fjso_props; prop != NULL; prop = prop->fjsp_next) {
+ if (strcmp(prop->fjsp_desc, propname) == 0) {
+ mdb_printf("%p\n", obj->fjso_instances.fjsi_addr);
+ return;
+ }
+ }
+}
+
+static void
+findjsobjects_match_constructor(findjsobjects_obj_t *obj,
+ const char *constructor)
+{
+ if (strcmp(constructor, obj->fjso_constructor) == 0)
+ mdb_printf("%p\n", obj->fjso_instances.fjsi_addr);
+}
+
+static int
+findjsobjects_match(findjsobjects_state_t *fjs, uintptr_t addr,
+ uint_t flags, void (*func)(findjsobjects_obj_t *, const char *),
+ const char *match)
+{
+ findjsobjects_obj_t *obj;
+
+ if (!(flags & DCMD_ADDRSPEC)) {
+ for (obj = fjs->fjs_objects; obj != NULL;
+ obj = obj->fjso_next) {
+ if (obj->fjso_malformed && !fjs->fjs_allobjs)
+ continue;
+
+ func(obj, match);
+ }
+
+ return (DCMD_OK);
+ }
+
+ /*
+ * First, look for the specified address among the representative
+ * objects.
+ */
+ for (obj = fjs->fjs_objects; obj != NULL; obj = obj->fjso_next) {
+ if (obj->fjso_instances.fjsi_addr == addr) {
+ func(obj, match);
+ return (DCMD_OK);
+ }
+ }
+
+ /*
+ * We didn't find it among the representative objects; iterate over
+ * all objects.
+ */
+ for (obj = fjs->fjs_objects; obj != NULL; obj = obj->fjso_next) {
+ findjsobjects_instance_t *head = &obj->fjso_instances, *inst;
+
+ for (inst = head; inst != NULL; inst = inst->fjsi_next) {
+ if (inst->fjsi_addr == addr) {
+ func(obj, match);
+ return (DCMD_OK);
+ }
+ }
+ }
+
+ mdb_warn("%p does not correspond to a known object\n", addr);
+ return (DCMD_ERR);
+}
+
+static void
+findjsobjects_print(findjsobjects_obj_t *obj)
+{
+ int col = 19 + (sizeof (uintptr_t) * 2) + strlen("..."), len;
+ uintptr_t addr = obj->fjso_instances.fjsi_addr;
+ findjsobjects_prop_t *prop;
+
+ mdb_printf("%?p %8d %8d ",
+ addr, obj->fjso_ninstances, obj->fjso_nprops);
+
+ if (obj->fjso_constructor[0] != '\0') {
+ mdb_printf("%s%s", obj->fjso_constructor,
+ obj->fjso_props != NULL ? ": " : "");
+ col += strlen(obj->fjso_constructor) + 2;
+ }
+
+ for (prop = obj->fjso_props; prop != NULL; prop = prop->fjsp_next) {
+ if (col + (len = strlen(prop->fjsp_desc) + 2) < 80) {
+ mdb_printf("%s%s", prop->fjsp_desc,
+ prop->fjsp_next != NULL ? ", " : "");
+ col += len;
+ } else {
+ mdb_printf("...");
+ break;
+ }
+ }
+
+ mdb_printf("\n", col);
+}
+
+static void
+dcmd_findjsobjects_help(void)
+{
+ mdb_printf("%s\n\n",
+"Finds all JavaScript objects in the V8 heap via brute force iteration over\n"
+"all mapped anonymous memory. (This can take up to several minutes on large\n"
+"dumps.) The output consists of representative objects, the number of\n"
+"instances of that object and the number of properties on the object --\n"
+"followed by the constructor and first few properties of the objects. Once\n"
+"run, subsequent calls to ::findjsobjects use cached data. If provided an\n"
+"address (and in the absence of -r, described below), ::findjsobjects treats\n"
+"the address as that of a representative object, and lists all instances of\n"
+"that object (that is, all objects that have a matching property signature).");
+
+ mdb_dec_indent(2);
+ mdb_printf("%<b>OPTIONS%</b>\n");
+ mdb_inc_indent(2);
+
+ mdb_printf("%s\n",
+" -b Include the heap denoted by the brk(2) (normally excluded)\n"
+" -c cons Display representative objects with the specified constructor\n"
+" -p prop Display representative objects that have the specified property\n"
+" -l List all objects that match the representative object\n"
+" -m Mark specified object for later reference determination via -r\n"
+" -r Find references to the specified and/or marked object(s)\n"
+" -v Provide verbose statistics\n");
+}
+
+static int
+dcmd_findjsobjects(uintptr_t addr,
+ uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ static findjsobjects_state_t fjs;
+ static findjsobjects_stats_t *stats = &fjs.fjs_stats;
+ findjsobjects_obj_t *obj;
+ struct ps_prochandle *Pr;
+ boolean_t references = B_FALSE, listlike = B_FALSE;
+ const char *propname = NULL;
+ const char *constructor = NULL;
+
+ fjs.fjs_verbose = B_FALSE;
+ fjs.fjs_brk = B_FALSE;
+ fjs.fjs_marking = B_FALSE;
+ fjs.fjs_allobjs = B_FALSE;
+
+ if (mdb_getopts(argc, argv,
+ 'a', MDB_OPT_SETBITS, B_TRUE, &fjs.fjs_allobjs,
+ 'b', MDB_OPT_SETBITS, B_TRUE, &fjs.fjs_brk,
+ 'c', MDB_OPT_STR, &constructor,
+ 'l', MDB_OPT_SETBITS, B_TRUE, &listlike,
+ 'm', MDB_OPT_SETBITS, B_TRUE, &fjs.fjs_marking,
+ 'p', MDB_OPT_STR, &propname,
+ 'r', MDB_OPT_SETBITS, B_TRUE, &references,
+ 'v', MDB_OPT_SETBITS, B_TRUE, &fjs.fjs_verbose,
+ NULL) != argc)
+ return (DCMD_USAGE);
+
+ if (!fjs.fjs_initialized) {
+ avl_create(&fjs.fjs_tree,
+ (int(*)(const void *, const void *))findjsobjects_cmp,
+ sizeof (findjsobjects_obj_t),
+ offsetof(findjsobjects_obj_t, fjso_node));
+
+ avl_create(&fjs.fjs_referents,
+ (int(*)(const void *, const void *))
+ findjsobjects_cmp_referents,
+ sizeof (findjsobjects_referent_t),
+ offsetof(findjsobjects_referent_t, fjsr_node));
+
+ fjs.fjs_initialized = B_TRUE;
+ }
+
+ if (avl_is_empty(&fjs.fjs_tree)) {
+ findjsobjects_obj_t **sorted;
+ int nobjs, i;
+ hrtime_t start = gethrtime();
+
+ if (mdb_get_xdata("pshandle", &Pr, sizeof (Pr)) == -1) {
+ mdb_warn("couldn't read pshandle xdata");
+ return (DCMD_ERR);
+ }
+
+ v8_silent++;
+
+ if (Pmapping_iter(Pr,
+ (proc_map_f *)findjsobjects_mapping, &fjs) != 0) {
+ v8_silent--;
+ return (DCMD_ERR);
+ }
+
+ if ((nobjs = avl_numnodes(&fjs.fjs_tree)) != 0) {
+ /*
+ * We have the objects -- now sort them.
+ */
+ sorted = mdb_alloc(nobjs * sizeof (void *),
+ UM_SLEEP | UM_GC);
+
+ for (obj = fjs.fjs_objects, i = 0; obj != NULL;
+ obj = obj->fjso_next, i++) {
+ sorted[i] = obj;
+ }
+
+ qsort(sorted, avl_numnodes(&fjs.fjs_tree),
+ sizeof (void *), findjsobjects_cmp_ninstances);
+
+ for (i = 1, fjs.fjs_objects = sorted[0]; i < nobjs; i++)
+ sorted[i - 1]->fjso_next = sorted[i];
+
+ sorted[nobjs - 1]->fjso_next = NULL;
+ }
+
+ v8_silent--;
+
+ if (fjs.fjs_verbose) {
+ const char *f = "findjsobjects: %30s => %d\n";
+ int elapsed = (int)((gethrtime() - start) / NANOSEC);
+
+ mdb_printf(f, "elapsed time (seconds)", elapsed);
+ mdb_printf(f, "heap objects", stats->fjss_heapobjs);
+ mdb_printf(f, "type reads", stats->fjss_typereads);
+ mdb_printf(f, "cached reads", stats->fjss_cached);
+ mdb_printf(f, "JavaScript objects", stats->fjss_jsobjs);
+ mdb_printf(f, "processed objects", stats->fjss_objects);
+ mdb_printf(f, "processed arrays", stats->fjss_arrays);
+ mdb_printf(f, "unique objects", stats->fjss_uniques);
+ }
+ }
+
+ if (listlike && !(flags & DCMD_ADDRSPEC)) {
+ if (propname != NULL || constructor != NULL) {
+ char opt = propname != NULL ? 'p' : 'c';
+
+ mdb_warn("cannot specify -l with -%c; instead, pipe "
+ "output of ::findjsobjects -%c to "
+ "::findjsobjects -l\n", opt, opt);
+ return (DCMD_ERR);
+ }
+
+ return (findjsobjects_match(&fjs, addr, flags,
+ findjsobjects_match_all, NULL));
+ }
+
+ if (propname != NULL) {
+ if (constructor != NULL) {
+ mdb_warn("cannot specify both a property name "
+ "and a constructor\n");
+ return (DCMD_ERR);
+ }
+
+ return (findjsobjects_match(&fjs, addr, flags,
+ findjsobjects_match_propname, propname));
+ }
+
+ if (constructor != NULL) {
+ return (findjsobjects_match(&fjs, addr, flags,
+ findjsobjects_match_constructor, constructor));
+ }
+
+ if (references && !(flags & DCMD_ADDRSPEC) &&
+ avl_is_empty(&fjs.fjs_referents)) {
+ mdb_warn("must specify or mark an object to find references\n");
+ return (DCMD_ERR);
+ }
+
+ if (fjs.fjs_marking && !(flags & DCMD_ADDRSPEC)) {
+ mdb_warn("must specify an object to mark\n");
+ return (DCMD_ERR);
+ }
+
+ if (references && fjs.fjs_marking) {
+ mdb_warn("can't both mark an object and find its references\n");
+ return (DCMD_ERR);
+ }
+
+ if (flags & DCMD_ADDRSPEC) {
+ findjsobjects_instance_t *inst, *head;
+
+ /*
+ * If we've been passed an address, it's to either list like
+ * objects (-l), mark an object (-m) or find references to the
+ * specified/marked objects (-r). (Note that the absence of
+ * any of these options implies -l.)
+ */
+ inst = findjsobjects_instance(&fjs, addr, &head);
+
+ if (inst == NULL) {
+ mdb_warn("%p is not a valid object\n", addr);
+ return (DCMD_ERR);
+ }
+
+ if (!references && !fjs.fjs_marking) {
+ for (inst = head; inst != NULL; inst = inst->fjsi_next)
+ mdb_printf("%p\n", inst->fjsi_addr);
+
+ return (DCMD_OK);
+ }
+
+ if (!listlike) {
+ findjsobjects_referent(&fjs, inst->fjsi_addr);
+ } else {
+ for (inst = head; inst != NULL; inst = inst->fjsi_next)
+ findjsobjects_referent(&fjs, inst->fjsi_addr);
+ }
+ }
+
+ if (references)
+ findjsobjects_references(&fjs);
+
+ if (references || fjs.fjs_marking)
+ return (DCMD_OK);
+
+ mdb_printf("%?s %8s %8s %s\n", "OBJECT",
+ "#OBJECTS", "#PROPS", "CONSTRUCTOR: PROPS");
+
+ for (obj = fjs.fjs_objects; obj != NULL; obj = obj->fjso_next) {
+ if (obj->fjso_malformed && !fjs.fjs_allobjs)
+ continue;
+
+ findjsobjects_print(obj);
+ }
+
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_jsframe(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ uintptr_t fptr, raddr;
+ boolean_t opt_v = B_FALSE, opt_i = B_FALSE;
+ char *opt_f = NULL, *opt_p = NULL;
+
+ if (mdb_getopts(argc, argv,
+ 'v', MDB_OPT_SETBITS, B_TRUE, &opt_v,
+ 'i', MDB_OPT_SETBITS, B_TRUE, &opt_i,
+ 'f', MDB_OPT_STR, &opt_f,
+ 'p', MDB_OPT_STR, &opt_p, NULL) != argc)
+ return (DCMD_USAGE);
+
+ /*
+ * As with $C, we assume we are given a *pointer* to the frame pointer
+ * for a frame, rather than the actual frame pointer for the frame of
+ * interest. This is needed to show the instruction pointer, which is
+ * actually stored with the next frame. For debugging, this can be
+ * overridden with the "-i" option (for "immediate").
+ */
+ if (opt_i)
+ return (do_jsframe(addr, 0, opt_v, opt_f, opt_p));
+
+ if (mdb_vread(&raddr, sizeof (raddr),
+ addr + sizeof (uintptr_t)) == -1) {
+ mdb_warn("failed to read return address from %p",
+ addr + sizeof (uintptr_t));
+ return (DCMD_ERR);
+ }
+
+ if (mdb_vread(&fptr, sizeof (fptr), addr) == -1) {
+ mdb_warn("failed to read frame pointer from %p", addr);
+ return (DCMD_ERR);
+ }
+
+ if (fptr == NULL)
+ return (DCMD_OK);
+
+ return (do_jsframe(fptr, raddr, opt_v, opt_f, opt_p));
+}
+
+/* ARGSUSED */
+static int
+dcmd_jsprint(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ char *buf, *bufp;
+ size_t bufsz = 262144, len = bufsz;
+ jsobj_print_t jsop;
+ boolean_t opt_b = B_FALSE;
+ int rv, i;
+
+ bzero(&jsop, sizeof (jsop));
+ jsop.jsop_depth = 2;
+ jsop.jsop_printaddr = B_FALSE;
+
+ i = mdb_getopts(argc, argv,
+ 'a', MDB_OPT_SETBITS, B_TRUE, &jsop.jsop_printaddr,
+ 'b', MDB_OPT_SETBITS, B_TRUE, &opt_b,
+ 'd', MDB_OPT_UINT64, &jsop.jsop_depth, NULL);
+
+ if (opt_b)
+ jsop.jsop_baseaddr = addr;
+
+ do {
+ if (i != argc) {
+ const mdb_arg_t *member = &argv[i++];
+
+ if (member->a_type != MDB_TYPE_STRING)
+ return (DCMD_USAGE);
+
+ jsop.jsop_member = member->a_un.a_str;
+ }
+
+ for (;;) {
+ if ((buf = bufp =
+ mdb_zalloc(bufsz, UM_NOSLEEP)) == NULL)
+ return (DCMD_ERR);
+
+ jsop.jsop_bufp = &bufp;
+ jsop.jsop_lenp = &len;
+
+ rv = jsobj_print(addr, &jsop);
+
+ if (len > 0)
+ break;
+
+ mdb_free(buf, bufsz);
+ bufsz <<= 1;
+ len = bufsz;
+ }
+
+ if (jsop.jsop_member == NULL && rv != 0)
+ return (DCMD_ERR);
+
+ if (jsop.jsop_member && !jsop.jsop_found) {
+ if (jsop.jsop_baseaddr)
+ (void) mdb_printf("%p: ", jsop.jsop_baseaddr);
+
+ (void) mdb_printf("undefined%s",
+ i < argc ? " " : "");
+ } else {
+ (void) mdb_printf("%s%s", buf, i < argc &&
+ !isspace(buf[strlen(buf) - 1]) ? " " : "");
+ }
+
+ mdb_free(buf, bufsz);
+ jsop.jsop_found = B_FALSE;
+ jsop.jsop_baseaddr = NULL;
+ } while (i < argc);
+
+ mdb_printf("\n");
+
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8field(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ v8_class_t *clp;
+ v8_field_t *flp;
+ const char *klass, *field;
+ uintptr_t offset = 0;
+
+ /*
+ * We may be invoked with either two arguments (class and field name) or
+ * three (an offset to save).
+ */
+ if (argc != 2 && argc != 3)
+ return (DCMD_USAGE);
+
+ if (argv[0].a_type != MDB_TYPE_STRING ||
+ argv[1].a_type != MDB_TYPE_STRING)
+ return (DCMD_USAGE);
+
+ klass = argv[0].a_un.a_str;
+ field = argv[1].a_un.a_str;
+
+ if (argc == 3) {
+ if (argv[2].a_type != MDB_TYPE_STRING)
+ return (DCMD_USAGE);
+
+ offset = mdb_strtoull(argv[2].a_un.a_str);
+ }
+
+ for (clp = v8_classes; clp != NULL; clp = clp->v8c_next)
+ if (strcmp(clp->v8c_name, klass) == 0)
+ break;
+
+ if (clp == NULL) {
+ (void) mdb_printf("error: no such class: \"%s\"", klass);
+ return (DCMD_ERR);
+ }
+
+ for (flp = clp->v8c_fields; flp != NULL; flp = flp->v8f_next)
+ if (strcmp(field, flp->v8f_name) == 0)
+ break;
+
+ if (flp == NULL) {
+ if (argc == 2) {
+ mdb_printf("error: no such field in class \"%s\": "
+ "\"%s\"", klass, field);
+ return (DCMD_ERR);
+ }
+
+ flp = conf_field_create(clp, field, offset);
+ if (flp == NULL) {
+ mdb_warn("failed to create field");
+ return (DCMD_ERR);
+ }
+ } else if (argc == 3) {
+ flp->v8f_offset = offset;
+ }
+
+ mdb_printf("%s::%s at offset 0x%x\n", klass, field, flp->v8f_offset);
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8array(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ uint8_t type;
+ uintptr_t *array;
+ size_t ii, len;
+
+ if (read_typebyte(&type, addr) != 0)
+ return (DCMD_ERR);
+
+ if (type != V8_TYPE_FIXEDARRAY) {
+ mdb_warn("%p is not an instance of FixedArray\n", addr);
+ return (DCMD_ERR);
+ }
+
+ if (read_heap_array(addr, &array, &len, UM_SLEEP | UM_GC) != 0)
+ return (DCMD_ERR);
+
+ for (ii = 0; ii < len; ii++)
+ mdb_printf("%p\n", array[ii]);
+
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_jsstack(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ uintptr_t raddr;
+ boolean_t opt_v;
+ char *opt_f = NULL, *opt_p = NULL;
+
+ if (mdb_getopts(argc, argv,
+ 'v', MDB_OPT_SETBITS, B_TRUE, &opt_v,
+ 'f', MDB_OPT_STR, &opt_f,
+ 'p', MDB_OPT_STR, &opt_p,
+ NULL) != argc)
+ return (DCMD_USAGE);
+
+ /*
+ * The "::jsframe" walker iterates the valid frame pointers, but the
+ * "::jsframe" dcmd looks at the frame after the one it was given, so we
+ * have to explicitly examine the top frame here.
+ */
+ if (!(flags & DCMD_ADDRSPEC)) {
+ if (load_current_context(&addr, &raddr) != 0 ||
+ do_jsframe(addr, raddr, opt_v, opt_f, opt_p) != 0)
+ return (DCMD_ERR);
+ }
+
+ if (mdb_pwalk_dcmd("jsframe", "jsframe", argc, argv, addr) == -1)
+ return (DCMD_ERR);
+
+ return (DCMD_OK);
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8str(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ boolean_t opt_v = B_FALSE;
+ char buf[512 * 1024];
+ char *bufp;
+ size_t len;
+
+ if (mdb_getopts(argc, argv, 'v', MDB_OPT_SETBITS, B_TRUE, &opt_v,
+ NULL) != argc)
+ return (DCMD_USAGE);
+
+ bufp = buf;
+ len = sizeof (buf);
+ if (jsstr_print(addr, (opt_v ? JSSTR_VERBOSE : JSSTR_NONE) |
+ JSSTR_QUOTED, &bufp, &len) != 0)
+ return (DCMD_ERR);
+
+ mdb_printf("%s\n", buf);
+ return (DCMD_OK);
+}
+
+static void
+dcmd_v8load_help(void)
+{
+ v8_cfg_t *cfp, **cfgpp;
+
+ mdb_printf(
+ "To traverse in-memory V8 structures, the V8 dmod requires\n"
+ "configuration that describes the layout of various V8 structures\n"
+ "in memory. Normally, this information is pulled from metadata\n"
+ "in the target binary. However, it's possible to use the module\n"
+ "with a binary not built with metadata by loading one of the\n"
+ "canned configurations.\n\n");
+
+ mdb_printf("Available configurations:\n");
+
+ (void) mdb_inc_indent(4);
+
+ for (cfgpp = v8_cfgs; *cfgpp != NULL; cfgpp++) {
+ cfp = *cfgpp;
+ mdb_printf("%-10s %s\n", cfp->v8cfg_name, cfp->v8cfg_label);
+ }
+
+ (void) mdb_dec_indent(4);
+}
+
+/* ARGSUSED */
+static int
+dcmd_v8load(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ v8_cfg_t *cfgp = NULL, **cfgpp;
+
+ if (v8_classes != NULL) {
+ mdb_warn("v8 module already configured\n");
+ return (DCMD_ERR);
+ }
+
+ if (argc < 1 || argv->a_type != MDB_TYPE_STRING)
+ return (DCMD_USAGE);
+
+ for (cfgpp = v8_cfgs; *cfgpp != NULL; cfgpp++) {
+ cfgp = *cfgpp;
+ if (strcmp(argv->a_un.a_str, cfgp->v8cfg_name) == 0)
+ break;
+ }
+
+ if (cfgp == NULL || cfgp->v8cfg_name == NULL) {
+ mdb_warn("unknown configuration: \"%s\"\n", argv->a_un.a_str);
+ return (DCMD_ERR);
+ }
+
+ if (autoconfigure(cfgp) == -1) {
+ mdb_warn("autoconfigure failed\n");
+ return (DCMD_ERR);
+ }
+
+ mdb_printf("V8 dmod configured based on %s\n", cfgp->v8cfg_name);
+ return (DCMD_OK);
+}
+
+static int
+walk_jsframes_init(mdb_walk_state_t *wsp)
+{
+ if (wsp->walk_addr != NULL)
+ return (WALK_NEXT);
+
+ if (load_current_context(&wsp->walk_addr, NULL) != 0)
+ return (WALK_ERR);
+
+ return (WALK_NEXT);
+}
+
+static int
+walk_jsframes_step(mdb_walk_state_t *wsp)
+{
+ uintptr_t addr, next;
+ int rv;
+
+ addr = wsp->walk_addr;
+ rv = wsp->walk_callback(wsp->walk_addr, NULL, wsp->walk_cbdata);
+
+ if (rv != WALK_NEXT)
+ return (rv);
+
+ if (mdb_vread(&next, sizeof (next), addr) == -1)
+ return (WALK_ERR);
+
+ if (next == NULL)
+ return (WALK_DONE);
+
+ wsp->walk_addr = next;
+ return (WALK_NEXT);
+}
+
+typedef struct jsprop_walk_data {
+ int jspw_nprops;
+ int jspw_current;
+ uintptr_t *jspw_props;
+} jsprop_walk_data_t;
+
+/*ARGSUSED*/
+static int
+walk_jsprop_nprops(const char *desc, uintptr_t val, void *arg)
+{
+ jsprop_walk_data_t *jspw = arg;
+ jspw->jspw_nprops++;
+
+ return (0);
+}
+
+/*ARGSUSED*/
+static int
+walk_jsprop_props(const char *desc, uintptr_t val, void *arg)
+{
+ jsprop_walk_data_t *jspw = arg;
+ jspw->jspw_props[jspw->jspw_current++] = val;
+
+ return (0);
+}
+
+static int
+walk_jsprop_init(mdb_walk_state_t *wsp)
+{
+ jsprop_walk_data_t *jspw;
+ uintptr_t addr;
+ uint8_t type;
+
+ if ((addr = wsp->walk_addr) == NULL) {
+ mdb_warn("'jsprop' does not support global walks\n");
+ return (WALK_ERR);
+ }
+
+ if (!V8_IS_HEAPOBJECT(addr) || read_typebyte(&type, addr) != 0 ||
+ type != V8_TYPE_JSOBJECT) {
+ mdb_warn("%p is not a JSObject\n", addr);
+ return (WALK_ERR);
+ }
+
+ jspw = mdb_zalloc(sizeof (jsprop_walk_data_t), UM_SLEEP | UM_GC);
+
+ if (jsobj_properties(addr, walk_jsprop_nprops, jspw) == -1) {
+ mdb_warn("couldn't iterate over properties for %p\n", addr);
+ return (WALK_ERR);
+ }
+
+ jspw->jspw_props = mdb_zalloc(jspw->jspw_nprops *
+ sizeof (uintptr_t), UM_SLEEP | UM_GC);
+
+ if (jsobj_properties(addr, walk_jsprop_props, jspw) == -1) {
+ mdb_warn("couldn't iterate over properties for %p\n", addr);
+ return (WALK_ERR);
+ }
+
+ jspw->jspw_current = 0;
+ wsp->walk_data = jspw;
+
+ return (WALK_NEXT);
+}
+
+static int
+walk_jsprop_step(mdb_walk_state_t *wsp)
+{
+ jsprop_walk_data_t *jspw = wsp->walk_data;
+ int rv;
+
+ if (jspw->jspw_current >= jspw->jspw_nprops)
+ return (WALK_DONE);
+
+ if ((rv = wsp->walk_callback(jspw->jspw_props[jspw->jspw_current++],
+ NULL, wsp->walk_cbdata)) != WALK_NEXT)
+ return (rv);
+
+ return (WALK_NEXT);
+}
+
+/*
+ * MDB linkage
+ */
+
+static const mdb_dcmd_t v8_mdb_dcmds[] = {
+ /*
+ * Commands to inspect JavaScript-level state
+ */
+ { "jsframe", ":[-iv] [-f function] [-p property]",
+ "summarize a JavaScript stack frame", dcmd_jsframe },
+ { "jsprint", ":[-ab] [-d depth] [member]", "print a JavaScript object",
+ dcmd_jsprint },
+ { "jsstack", "[-v] [-f function] [-p property]",
+ "print a JavaScript stacktrace", dcmd_jsstack },
+ { "findjsobjects", "?[-vb] [-r | -c cons | -p prop]", "find JavaScript "
+ "objects", dcmd_findjsobjects, dcmd_findjsobjects_help },
+
+ /*
+ * Commands to inspect V8-level state
+ */
+ { "v8array", ":", "print elements of a V8 FixedArray",
+ dcmd_v8array },
+ { "v8classes", NULL, "list known V8 heap object C++ classes",
+ dcmd_v8classes },
+ { "v8code", ":[-d]", "print information about a V8 Code object",
+ dcmd_v8code },
+ { "v8field", "classname fieldname offset",
+ "manually add a field to a given class", dcmd_v8field },
+ { "v8function", ":[-d]", "print JSFunction object details",
+ dcmd_v8function },
+ { "v8load", "version", "load canned config for a specific V8 version",
+ dcmd_v8load, dcmd_v8load_help },
+ { "v8frametypes", NULL, "list known V8 frame types",
+ dcmd_v8frametypes },
+ { "v8print", ":[class]", "print a V8 heap object",
+ dcmd_v8print, dcmd_v8print_help },
+ { "v8str", ":[-v]", "print the contents of a V8 string",
+ dcmd_v8str },
+ { "v8type", ":", "print the type of a V8 heap object",
+ dcmd_v8type },
+ { "v8types", NULL, "list known V8 heap object types",
+ dcmd_v8types },
+
+ { NULL }
+};
+
+static const mdb_walker_t v8_mdb_walkers[] = {
+ { "jsframe", "walk V8 JavaScript stack frames",
+ walk_jsframes_init, walk_jsframes_step },
+ { "jsprop", "walk property values for an object",
+ walk_jsprop_init, walk_jsprop_step },
+ { NULL }
+};
+
+static mdb_modinfo_t v8_mdb = { MDB_API_VERSION, v8_mdb_dcmds, v8_mdb_walkers };
+
+static void
+configure(void)
+{
+ char *success;
+ v8_cfg_t *cfgp = NULL;
+ GElf_Sym sym;
+
+ if (mdb_readsym(&v8_major, sizeof (v8_major),
+ "_ZN2v88internal7Version6major_E") == -1 ||
+ mdb_readsym(&v8_minor, sizeof (v8_minor),
+ "_ZN2v88internal7Version6minor_E") == -1 ||
+ mdb_readsym(&v8_build, sizeof (v8_build),
+ "_ZN2v88internal7Version6build_E") == -1 ||
+ mdb_readsym(&v8_patch, sizeof (v8_patch),
+ "_ZN2v88internal7Version6patch_E") == -1) {
+ mdb_warn("failed to determine V8 version");
+ return;
+ }
+
+ mdb_printf("V8 version: %d.%d.%d.%d\n",
+ v8_major, v8_minor, v8_build, v8_patch);
+
+ /*
+ * First look for debug metadata embedded within the binary, which may
+ * be present in recent V8 versions built with postmortem metadata.
+ */
+ if (mdb_lookup_by_name("v8dbg_SmiTag", &sym) == 0) {
+ cfgp = &v8_cfg_target;
+ success = "Autoconfigured V8 support from target";
+ } else if (v8_major == 3 && v8_minor == 1 && v8_build == 8) {
+ cfgp = &v8_cfg_04;
+ success = "Configured V8 support based on node v0.4";
+ } else if (v8_major == 3 && v8_minor == 6 && v8_build == 6) {
+ cfgp = &v8_cfg_06;
+ success = "Configured V8 support based on node v0.6";
+ } else {
+ mdb_printf("mdb_v8: target has no debug metadata and "
+ "no existing config found\n");
+ return;
+ }
+
+ if (autoconfigure(cfgp) != 0) {
+ mdb_warn("failed to autoconfigure from target; "
+ "commands may have incorrect results!\n");
+ return;
+ }
+
+ mdb_printf("%s\n", success);
+}
+
+static void
+enable_demangling(void)
+{
+ const char *symname = "_ZN2v88internal7Version6major_E";
+ GElf_Sym sym;
+ char buf[64];
+
+ /*
+ * Try to determine whether C++ symbol demangling has been enabled. If
+ * not, enable it.
+ */
+ if (mdb_lookup_by_name("_ZN2v88internal7Version6major_E", &sym) != 0)
+ return;
+
+ (void) mdb_snprintf(buf, sizeof (buf), "%a", sym.st_value);
+ if (strstr(buf, symname) != NULL)
+ (void) mdb_eval("$G");
+}
+
+const mdb_modinfo_t *
+_mdb_init(void)
+{
+ configure();
+ enable_demangling();
+ return (&v8_mdb);
+}
diff --git a/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c b/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c
new file mode 100644
index 0000000000..d907242435
--- /dev/null
+++ b/usr/src/cmd/mdb/common/modules/v8/mdb_v8_cfg.c
@@ -0,0 +1,728 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * mdb_v8_cfg.c: canned configurations for previous V8 versions.
+ *
+ * The functions and data defined here enable this dmod to support debugging
+ * Node.js binaries that predated V8's built-in postmortem debugging support.
+ */
+
+#include "v8cfg.h"
+
+/*ARGSUSED*/
+static int
+v8cfg_target_iter(v8_cfg_t *cfgp, int (*func)(mdb_symbol_t *, void *),
+ void *arg)
+{
+ return (mdb_symbol_iter(MDB_OBJ_EVERY, MDB_DYNSYM,
+ MDB_BIND_GLOBAL | MDB_TYPE_OBJECT | MDB_TYPE_FUNC,
+ func, arg));
+}
+
+/*ARGSUSED*/
+static int
+v8cfg_target_readsym(v8_cfg_t *cfgp, const char *name, intptr_t *valp)
+{
+ int val, rval;
+
+ if ((rval = mdb_readsym(&val, sizeof (val), name)) != -1)
+ *valp = (intptr_t)val;
+
+ return (rval);
+}
+
+/*
+ * Analog of mdb_symbol_iter() for a canned configuration.
+ */
+static int
+v8cfg_canned_iter(v8_cfg_t *cfgp, int (*func)(mdb_symbol_t *, void *),
+ void *arg)
+{
+ v8_cfg_symbol_t *v8sym;
+ mdb_symbol_t mdbsym;
+ int rv;
+
+ for (v8sym = cfgp->v8cfg_symbols; v8sym->v8cs_name != NULL; v8sym++) {
+ mdbsym.sym_name = v8sym->v8cs_name;
+ mdbsym.sym_object = NULL;
+ mdbsym.sym_sym = NULL;
+ mdbsym.sym_table = 0;
+ mdbsym.sym_id = 0;
+
+ if ((rv = func(&mdbsym, arg)) != 0)
+ return (rv);
+ }
+
+ return (0);
+}
+
+/*
+ * Analog of mdb_readsym() for a canned configuration.
+ */
+static int
+v8cfg_canned_readsym(v8_cfg_t *cfgp, const char *name, intptr_t *valp)
+{
+ v8_cfg_symbol_t *v8sym;
+
+ for (v8sym = cfgp->v8cfg_symbols; v8sym->v8cs_name != NULL; v8sym++) {
+ if (strcmp(name, v8sym->v8cs_name) == 0)
+ break;
+ }
+
+ if (v8sym->v8cs_name == NULL)
+ return (-1);
+
+ *valp = v8sym->v8cs_value;
+ return (0);
+}
+
+/*
+ * Canned configuration for the V8 bundled with Node.js v0.4.8 and later.
+ */
+static v8_cfg_symbol_t v8_symbols_node_04[] = {
+ { "v8dbg_type_AccessCheckInfo__ACCESS_CHECK_INFO_TYPE", 0x91 },
+ { "v8dbg_type_AccessorInfo__ACCESSOR_INFO_TYPE", 0x90 },
+ { "v8dbg_type_BreakPointInfo__BREAK_POINT_INFO_TYPE", 0x9b },
+ { "v8dbg_type_ByteArray__BYTE_ARRAY_TYPE", 0x86 },
+ { "v8dbg_type_CallHandlerInfo__CALL_HANDLER_INFO_TYPE", 0x93 },
+ { "v8dbg_type_Code__CODE_TYPE", 0x81 },
+ { "v8dbg_type_CodeCache__CODE_CACHE_TYPE", 0x99 },
+ { "v8dbg_type_ConsString__CONS_ASCII_STRING_TYPE", 0x5 },
+ { "v8dbg_type_ConsString__CONS_ASCII_SYMBOL_TYPE", 0x45 },
+ { "v8dbg_type_ConsString__CONS_STRING_TYPE", 0x1 },
+ { "v8dbg_type_ConsString__CONS_SYMBOL_TYPE", 0x41 },
+ { "v8dbg_type_DebugInfo__DEBUG_INFO_TYPE", 0x9a },
+ { "v8dbg_type_ExternalAsciiString__EXTERNAL_ASCII_STRING_TYPE", 0x6 },
+ { "v8dbg_type_ExternalAsciiString__EXTERNAL_ASCII_SYMBOL_TYPE", 0x46 },
+ { "v8dbg_type_ExternalByteArray__EXTERNAL_BYTE_ARRAY_TYPE", 0x88 },
+ { "v8dbg_type_ExternalFloatArray__EXTERNAL_FLOAT_ARRAY_TYPE", 0x8e },
+ { "v8dbg_type_ExternalIntArray__EXTERNAL_INT_ARRAY_TYPE", 0x8c },
+ { "v8dbg_type_ExternalShortArray__EXTERNAL_SHORT_ARRAY_TYPE", 0x8a },
+ { "v8dbg_type_ExternalString__EXTERNAL_STRING_TYPE", 0x2 },
+ { "v8dbg_type_ExternalString__EXTERNAL_SYMBOL_TYPE", 0x42 },
+ { "v8dbg_type_ExternalUnsignedByteArray__"
+ "EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE", 0x89 },
+ { "v8dbg_type_ExternalUnsignedIntArray__"
+ "EXTERNAL_UNSIGNED_INT_ARRAY_TYPE", 0x8d },
+ { "v8dbg_type_ExternalUnsignedShortArray__"
+ "EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE", 0x8b },
+ { "v8dbg_type_FixedArray__FIXED_ARRAY_TYPE", 0x9c },
+ { "v8dbg_type_FunctionTemplateInfo__"
+ "FUNCTION_TEMPLATE_INFO_TYPE", 0x94 },
+ { "v8dbg_type_HeapNumber__HEAP_NUMBER_TYPE", 0x84 },
+ { "v8dbg_type_InterceptorInfo__INTERCEPTOR_INFO_TYPE", 0x92 },
+ { "v8dbg_type_JSArray__JS_ARRAY_TYPE", 0xa5 },
+ { "v8dbg_type_JSBuiltinsObject__JS_BUILTINS_OBJECT_TYPE", 0xa3 },
+ { "v8dbg_type_JSFunction__JS_FUNCTION_TYPE", 0xa7 },
+ { "v8dbg_type_JSGlobalObject__JS_GLOBAL_OBJECT_TYPE", 0xa2 },
+ { "v8dbg_type_JSGlobalPropertyCell__"
+ "JS_GLOBAL_PROPERTY_CELL_TYPE", 0x83 },
+ { "v8dbg_type_JSGlobalProxy__JS_GLOBAL_PROXY_TYPE", 0xa4 },
+ { "v8dbg_type_JSMessageObject__JS_MESSAGE_OBJECT_TYPE", 0x9e },
+ { "v8dbg_type_JSObject__JS_OBJECT_TYPE", 0xa0 },
+ { "v8dbg_type_JSRegExp__JS_REGEXP_TYPE", 0xa6 },
+ { "v8dbg_type_JSValue__JS_VALUE_TYPE", 0x9f },
+ { "v8dbg_type_Map__MAP_TYPE", 0x80 },
+ { "v8dbg_type_ObjectTemplateInfo__OBJECT_TEMPLATE_INFO_TYPE", 0x95 },
+ { "v8dbg_type_Oddball__ODDBALL_TYPE", 0x82 },
+ { "v8dbg_type_Script__SCRIPT_TYPE", 0x98 },
+ { "v8dbg_type_SeqAsciiString__ASCII_STRING_TYPE", 0x4 },
+ { "v8dbg_type_SeqAsciiString__ASCII_SYMBOL_TYPE", 0x44 },
+ { "v8dbg_type_SharedFunctionInfo__SHARED_FUNCTION_INFO_TYPE", 0x9d },
+ { "v8dbg_type_SignatureInfo__SIGNATURE_INFO_TYPE", 0x96 },
+ { "v8dbg_type_String__STRING_TYPE", 0x0 },
+ { "v8dbg_type_String__SYMBOL_TYPE", 0x40 },
+ { "v8dbg_type_TypeSwitchInfo__TYPE_SWITCH_INFO_TYPE", 0x97 },
+
+ { "v8dbg_class_AccessCheckInfo__data__Object", 0xc },
+ { "v8dbg_class_AccessCheckInfo__indexed_callback__Object", 0x8 },
+ { "v8dbg_class_AccessCheckInfo__named_callback__Object", 0x4 },
+ { "v8dbg_class_AccessorInfo__data__Object", 0xc },
+ { "v8dbg_class_AccessorInfo__flag__Smi", 0x14 },
+ { "v8dbg_class_AccessorInfo__getter__Object", 0x4 },
+ { "v8dbg_class_AccessorInfo__name__Object", 0x10 },
+ { "v8dbg_class_AccessorInfo__setter__Object", 0x8 },
+ { "v8dbg_class_BreakPointInfo__break_point_objects__Object", 0x10 },
+ { "v8dbg_class_BreakPointInfo__code_position__Smi", 0x4 },
+ { "v8dbg_class_BreakPointInfo__source_position__Smi", 0x8 },
+ { "v8dbg_class_BreakPointInfo__statement_position__Smi", 0xc },
+ { "v8dbg_class_ByteArray__length__SMI", 0x4 },
+ { "v8dbg_class_CallHandlerInfo__callback__Object", 0x4 },
+ { "v8dbg_class_CallHandlerInfo__data__Object", 0x8 },
+ { "v8dbg_class_Code__deoptimization_data__FixedArray", 0xc },
+ { "v8dbg_class_Code__instruction_size__int", 0x4 },
+ { "v8dbg_class_Code__instruction_start__int", 0x20 },
+ { "v8dbg_class_Code__relocation_info__ByteArray", 0x8 },
+ { "v8dbg_class_CodeCache__default_cache__FixedArray", 0x4 },
+ { "v8dbg_class_CodeCache__normal_type_cache__Object", 0x8 },
+ { "v8dbg_class_ConsString__first__String", 0xc },
+ { "v8dbg_class_ConsString__second__String", 0x10 },
+ { "v8dbg_class_DebugInfo__break_points__FixedArray", 0x14 },
+ { "v8dbg_class_DebugInfo__code__Code", 0xc },
+ { "v8dbg_class_DebugInfo__original_code__Code", 0x8 },
+ { "v8dbg_class_DebugInfo__shared__SharedFunctionInfo", 0x4 },
+ { "v8dbg_class_ExternalString__resource__Object", 0xc },
+ { "v8dbg_class_FixedArray__data__uintptr_t", 0x8 },
+ { "v8dbg_class_FixedArray__length__SMI", 0x4 },
+ { "v8dbg_class_FunctionTemplateInfo__access_check_info__Object", 0x38 },
+ { "v8dbg_class_FunctionTemplateInfo__call_code__Object", 0x10 },
+ { "v8dbg_class_FunctionTemplateInfo__class_name__Object", 0x2c },
+ { "v8dbg_class_FunctionTemplateInfo__flag__Smi", 0x3c },
+ { "v8dbg_class_FunctionTemplateInfo__"
+ "indexed_property_handler__Object", 0x24 },
+ { "v8dbg_class_FunctionTemplateInfo__"
+ "instance_call_handler__Object", 0x34 },
+ { "v8dbg_class_FunctionTemplateInfo__instance_template__Object", 0x28 },
+ { "v8dbg_class_FunctionTemplateInfo__"
+ "named_property_handler__Object", 0x20 },
+ { "v8dbg_class_FunctionTemplateInfo__parent_template__Object", 0x1c },
+ { "v8dbg_class_FunctionTemplateInfo__"
+ "property_accessors__Object", 0x14 },
+ { "v8dbg_class_FunctionTemplateInfo__"
+ "prototype_template__Object", 0x18 },
+ { "v8dbg_class_FunctionTemplateInfo__serial_number__Object", 0xc },
+ { "v8dbg_class_FunctionTemplateInfo__signature__Object", 0x30 },
+ { "v8dbg_class_GlobalObject__builtins__JSBuiltinsObject", 0xc },
+ { "v8dbg_class_GlobalObject__global_context__Context", 0x10 },
+ { "v8dbg_class_GlobalObject__global_receiver__JSObject", 0x14 },
+ { "v8dbg_class_HeapNumber__value__SMI", 0x4 },
+ { "v8dbg_class_HeapObject__map__Map", 0x0 },
+ { "v8dbg_class_InterceptorInfo__data__Object", 0x18 },
+ { "v8dbg_class_InterceptorInfo__deleter__Object", 0x10 },
+ { "v8dbg_class_InterceptorInfo__enumerator__Object", 0x14 },
+ { "v8dbg_class_InterceptorInfo__getter__Object", 0x4 },
+ { "v8dbg_class_InterceptorInfo__query__Object", 0xc },
+ { "v8dbg_class_InterceptorInfo__setter__Object", 0x8 },
+ { "v8dbg_class_JSArray__length__Object", 0xc },
+ { "v8dbg_class_JSFunction__literals__FixedArray", 0x1c },
+ { "v8dbg_class_JSFunction__next_function_link__Object", 0x20 },
+ { "v8dbg_class_JSFunction__prototype_or_initial_map__Object", 0x10 },
+ { "v8dbg_class_JSFunction__shared__SharedFunctionInfo", 0x14 },
+ { "v8dbg_class_JSGlobalProxy__context__Object", 0xc },
+ { "v8dbg_class_JSMessageObject__arguments__JSArray", 0x10 },
+ { "v8dbg_class_JSMessageObject__end_position__SMI", 0x24 },
+ { "v8dbg_class_JSMessageObject__script__Object", 0x14 },
+ { "v8dbg_class_JSMessageObject__stack_frames__Object", 0x1c },
+ { "v8dbg_class_JSMessageObject__stack_trace__Object", 0x18 },
+ { "v8dbg_class_JSMessageObject__start_position__SMI", 0x20 },
+ { "v8dbg_class_JSMessageObject__type__String", 0xc },
+ { "v8dbg_class_JSObject__elements__Object", 0x8 },
+ { "v8dbg_class_JSObject__properties__FixedArray", 0x4 },
+ { "v8dbg_class_JSRegExp__data__Object", 0xc },
+ { "v8dbg_class_JSValue__value__Object", 0xc },
+ { "v8dbg_class_Map__code_cache__Object", 0x18 },
+ { "v8dbg_class_Map__constructor__Object", 0x10 },
+ { "v8dbg_class_Map__inobject_properties__int", 0x5 },
+ { "v8dbg_class_Map__instance_size__int", 0x4 },
+ { "v8dbg_class_Map__instance_attributes__int", 0x8 },
+ { "v8dbg_class_Map__instance_descriptors__DescriptorArray", 0x14 },
+ { "v8dbg_class_ObjectTemplateInfo__constructor__Object", 0xc },
+ { "v8dbg_class_ObjectTemplateInfo__"
+ "internal_field_count__Object", 0x10 },
+ { "v8dbg_class_Oddball__to_number__Object", 0x8 },
+ { "v8dbg_class_Oddball__to_string__String", 0x4 },
+ { "v8dbg_class_Script__column_offset__Smi", 0x10 },
+ { "v8dbg_class_Script__compilation_type__Smi", 0x24 },
+ { "v8dbg_class_Script__context_data__Object", 0x18 },
+ { "v8dbg_class_Script__data__Object", 0x14 },
+ { "v8dbg_class_Script__eval_from_instructions_offset__Smi", 0x34 },
+ { "v8dbg_class_Script__eval_from_shared__Object", 0x30 },
+ { "v8dbg_class_Script__id__Object", 0x2c },
+ { "v8dbg_class_Script__line_ends__Object", 0x28 },
+ { "v8dbg_class_Script__line_offset__Smi", 0xc },
+ { "v8dbg_class_Script__name__Object", 0x8 },
+ { "v8dbg_class_Script__source__Object", 0x4 },
+ { "v8dbg_class_Script__type__Smi", 0x20 },
+ { "v8dbg_class_Script__wrapper__Proxy", 0x1c },
+ { "v8dbg_class_SeqAsciiString__chars__char", 0xc },
+ { "v8dbg_class_SharedFunctionInfo__code__Code", 0x8 },
+ { "v8dbg_class_SharedFunctionInfo__compiler_hints__SMI", 0x50 },
+ { "v8dbg_class_SharedFunctionInfo__construct_stub__Code", 0x10 },
+ { "v8dbg_class_SharedFunctionInfo__debug_info__Object", 0x20 },
+ { "v8dbg_class_SharedFunctionInfo__end_position__SMI", 0x48 },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "expected_nof_properties__SMI", 0x3c },
+ { "v8dbg_class_SharedFunctionInfo__formal_parameter_count__SMI", 0x38 },
+ { "v8dbg_class_SharedFunctionInfo__function_data__Object", 0x18 },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "function_token_position__SMI", 0x4c },
+ { "v8dbg_class_SharedFunctionInfo__inferred_name__String", 0x24 },
+ { "v8dbg_class_SharedFunctionInfo__initial_map__Object", 0x28 },
+ { "v8dbg_class_SharedFunctionInfo__instance_class_name__Object", 0x14 },
+ { "v8dbg_class_SharedFunctionInfo__length__SMI", 0x34 },
+ { "v8dbg_class_SharedFunctionInfo__name__Object", 0x4 },
+ { "v8dbg_class_SharedFunctionInfo__num_literals__SMI", 0x40 },
+ { "v8dbg_class_SharedFunctionInfo__opt_count__SMI", 0x58 },
+ { "v8dbg_class_SharedFunctionInfo__script__Object", 0x1c },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "start_position_and_type__SMI", 0x44 },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "this_property_assignments__Object", 0x2c },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "this_property_assignments_count__SMI", 0x54 },
+ { "v8dbg_class_SignatureInfo__args__Object", 0x8 },
+ { "v8dbg_class_SignatureInfo__receiver__Object", 0x4 },
+ { "v8dbg_class_String__length__SMI", 0x4 },
+ { "v8dbg_class_TemplateInfo__property_list__Object", 0x8 },
+ { "v8dbg_class_TemplateInfo__tag__Object", 0x4 },
+ { "v8dbg_class_TypeSwitchInfo__types__Object", 0x4 },
+
+ { "v8dbg_parent_AccessCheckInfo__Struct", 0x0 },
+ { "v8dbg_parent_AccessorInfo__Struct", 0x0 },
+ { "v8dbg_parent_BreakPointInfo__Struct", 0x0 },
+ { "v8dbg_parent_ByteArray__HeapObject", 0x0 },
+ { "v8dbg_parent_CallHandlerInfo__Struct", 0x0 },
+ { "v8dbg_parent_Code__HeapObject", 0x0 },
+ { "v8dbg_parent_CodeCache__Struct", 0x0 },
+ { "v8dbg_parent_ConsString__String", 0x0 },
+ { "v8dbg_parent_DebugInfo__Struct", 0x0 },
+ { "v8dbg_parent_DeoptimizationInputData__FixedArray", 0x0 },
+ { "v8dbg_parent_DeoptimizationOutputData__FixedArray", 0x0 },
+ { "v8dbg_parent_DescriptorArray__FixedArray", 0x0 },
+ { "v8dbg_parent_ExternalArray__HeapObject", 0x0 },
+ { "v8dbg_parent_ExternalAsciiString__ExternalString", 0x0 },
+ { "v8dbg_parent_ExternalByteArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalFloatArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalIntArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalShortArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalString__String", 0x0 },
+ { "v8dbg_parent_ExternalTwoByteString__ExternalString", 0x0 },
+ { "v8dbg_parent_ExternalUnsignedByteArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalUnsignedIntArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalUnsignedShortArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_Failure__MaybeObject", 0x0 },
+ { "v8dbg_parent_FixedArray__HeapObject", 0x0 },
+ { "v8dbg_parent_FunctionTemplateInfo__TemplateInfo", 0x0 },
+ { "v8dbg_parent_GlobalObject__JSObject", 0x0 },
+ { "v8dbg_parent_HeapNumber__HeapObject", 0x0 },
+ { "v8dbg_parent_HeapObject__Object", 0x0 },
+ { "v8dbg_parent_InterceptorInfo__Struct", 0x0 },
+ { "v8dbg_parent_JSArray__JSObject", 0x0 },
+ { "v8dbg_parent_JSBuiltinsObject__GlobalObject", 0x0 },
+ { "v8dbg_parent_JSFunction__JSObject", 0x0 },
+ { "v8dbg_parent_JSFunctionResultCache__FixedArray", 0x0 },
+ { "v8dbg_parent_JSGlobalObject__GlobalObject", 0x0 },
+ { "v8dbg_parent_JSGlobalPropertyCell__HeapObject", 0x0 },
+ { "v8dbg_parent_JSGlobalProxy__JSObject", 0x0 },
+ { "v8dbg_parent_JSMessageObject__JSObject", 0x0 },
+ { "v8dbg_parent_JSObject__HeapObject", 0x0 },
+ { "v8dbg_parent_JSRegExp__JSObject", 0x0 },
+ { "v8dbg_parent_JSRegExpResult__JSArray", 0x0 },
+ { "v8dbg_parent_JSValue__JSObject", 0x0 },
+ { "v8dbg_parent_Map__HeapObject", 0x0 },
+ { "v8dbg_parent_NormalizedMapCache__FixedArray", 0x0 },
+ { "v8dbg_parent_Object__MaybeObject", 0x0 },
+ { "v8dbg_parent_ObjectTemplateInfo__TemplateInfo", 0x0 },
+ { "v8dbg_parent_Oddball__HeapObject", 0x0 },
+ { "v8dbg_parent_Script__Struct", 0x0 },
+ { "v8dbg_parent_SeqAsciiString__SeqString", 0x0 },
+ { "v8dbg_parent_SeqString__String", 0x0 },
+ { "v8dbg_parent_SeqTwoByteString__SeqString", 0x0 },
+ { "v8dbg_parent_SharedFunctionInfo__HeapObject", 0x0 },
+ { "v8dbg_parent_SignatureInfo__Struct", 0x0 },
+ { "v8dbg_parent_Smi__Object", 0x0 },
+ { "v8dbg_parent_String__HeapObject", 0x0 },
+ { "v8dbg_parent_Struct__HeapObject", 0x0 },
+ { "v8dbg_parent_TemplateInfo__Struct", 0x0 },
+ { "v8dbg_parent_TypeSwitchInfo__Struct", 0x0 },
+
+ { "v8dbg_frametype_ArgumentsAdaptorFrame", 0x8 },
+ { "v8dbg_frametype_ConstructFrame", 0x7 },
+ { "v8dbg_frametype_EntryConstructFrame", 0x2 },
+ { "v8dbg_frametype_EntryFrame", 0x1 },
+ { "v8dbg_frametype_ExitFrame", 0x3 },
+ { "v8dbg_frametype_InternalFrame", 0x6 },
+ { "v8dbg_frametype_JavaScriptFrame", 0x4 },
+ { "v8dbg_frametype_OptimizedFrame", 0x5 },
+
+ { "v8dbg_off_fp_context", -0x4 },
+ { "v8dbg_off_fp_function", -0x8 },
+ { "v8dbg_off_fp_marker", -0x8 },
+ { "v8dbg_off_fp_args", 0x8 },
+
+ { "v8dbg_prop_idx_content", 0x0 },
+ { "v8dbg_prop_idx_first", 0x2 },
+ { "v8dbg_prop_type_field", 0x1 },
+ { "v8dbg_prop_type_first_phantom", 0x6 },
+ { "v8dbg_prop_type_mask", 0xf },
+
+ { "v8dbg_AsciiStringTag", 0x4 },
+ { "v8dbg_ConsStringTag", 0x1 },
+ { "v8dbg_ExternalStringTag", 0x2 },
+ { "v8dbg_FailureTag", 0x3 },
+ { "v8dbg_FailureTagMask", 0x3 },
+ { "v8dbg_FirstNonstringType", 0x80 },
+ { "v8dbg_HeapObjectTag", 0x1 },
+ { "v8dbg_HeapObjectTagMask", 0x3 },
+ { "v8dbg_IsNotStringMask", 0x80 },
+ { "v8dbg_NotStringTag", 0x80 },
+ { "v8dbg_SeqStringTag", 0x0 },
+ { "v8dbg_SmiTag", 0x0 },
+ { "v8dbg_SmiTagMask", 0x1 },
+ { "v8dbg_SmiValueShift", 0x1 },
+ { "v8dbg_StringEncodingMask", 0x4 },
+ { "v8dbg_StringRepresentationMask", 0x3 },
+ { "v8dbg_StringTag", 0x0 },
+ { "v8dbg_TwoByteStringTag", 0x0 },
+ { "v8dbg_PointerSizeLog2", 0x2 },
+
+ { NULL }
+};
+
+/*
+ * Canned configuration for the V8 bundled with Node.js v0.6.5.
+ */
+static v8_cfg_symbol_t v8_symbols_node_06[] = {
+ { "v8dbg_type_AccessCheckInfo__ACCESS_CHECK_INFO_TYPE", 0x93 },
+ { "v8dbg_type_AccessorInfo__ACCESSOR_INFO_TYPE", 0x92 },
+ { "v8dbg_type_BreakPointInfo__BREAK_POINT_INFO_TYPE", 0x9e },
+ { "v8dbg_type_ByteArray__BYTE_ARRAY_TYPE", 0x86 },
+ { "v8dbg_type_CallHandlerInfo__CALL_HANDLER_INFO_TYPE", 0x95 },
+ { "v8dbg_type_Code__CODE_TYPE", 0x81 },
+ { "v8dbg_type_CodeCache__CODE_CACHE_TYPE", 0x9b },
+ { "v8dbg_type_ConsString__CONS_ASCII_STRING_TYPE", 0x5 },
+ { "v8dbg_type_ConsString__CONS_ASCII_SYMBOL_TYPE", 0x45 },
+ { "v8dbg_type_ConsString__CONS_STRING_TYPE", 0x1 },
+ { "v8dbg_type_ConsString__CONS_SYMBOL_TYPE", 0x41 },
+ { "v8dbg_type_DebugInfo__DEBUG_INFO_TYPE", 0x9d },
+ { "v8dbg_type_ExternalAsciiString__EXTERNAL_ASCII_STRING_TYPE", 0x6 },
+ { "v8dbg_type_ExternalAsciiString__EXTERNAL_ASCII_SYMBOL_TYPE", 0x46 },
+ { "v8dbg_type_ExternalByteArray__EXTERNAL_BYTE_ARRAY_TYPE", 0x87 },
+ { "v8dbg_type_ExternalDoubleArray__EXTERNAL_DOUBLE_ARRAY_TYPE", 0x8e },
+ { "v8dbg_type_ExternalFloatArray__EXTERNAL_FLOAT_ARRAY_TYPE", 0x8d },
+ { "v8dbg_type_ExternalIntArray__EXTERNAL_INT_ARRAY_TYPE", 0x8b },
+ { "v8dbg_type_ExternalPixelArray__EXTERNAL_PIXEL_ARRAY_TYPE", 0x8f },
+ { "v8dbg_type_ExternalShortArray__EXTERNAL_SHORT_ARRAY_TYPE", 0x89 },
+ { "v8dbg_type_ExternalTwoByteString__EXTERNAL_STRING_TYPE", 0x2 },
+ { "v8dbg_type_ExternalTwoByteString__EXTERNAL_SYMBOL_TYPE", 0x42 },
+ { "v8dbg_type_ExternalUnsignedByteArray__"
+ "EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE", 0x88 },
+ { "v8dbg_type_ExternalUnsignedIntArray__"
+ "EXTERNAL_UNSIGNED_INT_ARRAY_TYPE", 0x8c },
+ { "v8dbg_type_ExternalUnsignedShortArray__"
+ "EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE", 0x8a },
+ { "v8dbg_type_FixedArray__FIXED_ARRAY_TYPE", 0x9f },
+ { "v8dbg_type_FixedDoubleArray__FIXED_DOUBLE_ARRAY_TYPE", 0x90 },
+ { "v8dbg_type_Foreign__FOREIGN_TYPE", 0x85 },
+ { "v8dbg_type_FunctionTemplateInfo__FUNCTION_TEMPLATE_INFO_TYPE",
+ 0x96 },
+ { "v8dbg_type_HeapNumber__HEAP_NUMBER_TYPE", 0x84 },
+ { "v8dbg_type_InterceptorInfo__INTERCEPTOR_INFO_TYPE", 0x94 },
+ { "v8dbg_type_JSArray__JS_ARRAY_TYPE", 0xa8 },
+ { "v8dbg_type_JSBuiltinsObject__JS_BUILTINS_OBJECT_TYPE", 0xa6 },
+ { "v8dbg_type_JSFunction__JS_FUNCTION_TYPE", 0xac },
+ { "v8dbg_type_JSFunctionProxy__JS_FUNCTION_PROXY_TYPE", 0xad },
+ { "v8dbg_type_JSGlobalObject__JS_GLOBAL_OBJECT_TYPE", 0xa5 },
+ { "v8dbg_type_JSGlobalPropertyCell__JS_GLOBAL_PROPERTY_CELL_TYPE",
+ 0x83 },
+ { "v8dbg_type_JSMessageObject__JS_MESSAGE_OBJECT_TYPE", 0xa1 },
+ { "v8dbg_type_JSObject__JS_OBJECT_TYPE", 0xa3 },
+ { "v8dbg_type_JSProxy__JS_PROXY_TYPE", 0xa9 },
+ { "v8dbg_type_JSRegExp__JS_REGEXP_TYPE", 0xab },
+ { "v8dbg_type_JSValue__JS_VALUE_TYPE", 0xa2 },
+ { "v8dbg_type_JSWeakMap__JS_WEAK_MAP_TYPE", 0xaa },
+ { "v8dbg_type_Map__MAP_TYPE", 0x80 },
+ { "v8dbg_type_ObjectTemplateInfo__OBJECT_TEMPLATE_INFO_TYPE", 0x97 },
+ { "v8dbg_type_Oddball__ODDBALL_TYPE", 0x82 },
+ { "v8dbg_type_PolymorphicCodeCache__POLYMORPHIC_CODE_CACHE_TYPE",
+ 0x9c },
+ { "v8dbg_type_Script__SCRIPT_TYPE", 0x9a },
+ { "v8dbg_type_SeqAsciiString__ASCII_STRING_TYPE", 0x4 },
+ { "v8dbg_type_SeqAsciiString__ASCII_SYMBOL_TYPE", 0x44 },
+ { "v8dbg_type_SeqTwoByteString__STRING_TYPE", 0x0 },
+ { "v8dbg_type_SeqTwoByteString__SYMBOL_TYPE", 0x40 },
+ { "v8dbg_type_SharedFunctionInfo__SHARED_FUNCTION_INFO_TYPE", 0xa0 },
+ { "v8dbg_type_SignatureInfo__SIGNATURE_INFO_TYPE", 0x98 },
+ { "v8dbg_type_SlicedString__SLICED_ASCII_STRING_TYPE", 0x7 },
+ { "v8dbg_type_SlicedString__SLICED_STRING_TYPE", 0x3 },
+ { "v8dbg_type_TypeSwitchInfo__TYPE_SWITCH_INFO_TYPE", 0x99 },
+
+ { "v8dbg_class_AccessCheckInfo__data__Object", 0xc },
+ { "v8dbg_class_AccessCheckInfo__indexed_callback__Object", 0x8 },
+ { "v8dbg_class_AccessCheckInfo__named_callback__Object", 0x4 },
+ { "v8dbg_class_AccessorInfo__data__Object", 0xc },
+ { "v8dbg_class_AccessorInfo__flag__Smi", 0x14 },
+ { "v8dbg_class_AccessorInfo__getter__Object", 0x4 },
+ { "v8dbg_class_AccessorInfo__name__Object", 0x10 },
+ { "v8dbg_class_AccessorInfo__setter__Object", 0x8 },
+ { "v8dbg_class_BreakPointInfo__break_point_objects__Object", 0x10 },
+ { "v8dbg_class_BreakPointInfo__code_position__Smi", 0x4 },
+ { "v8dbg_class_BreakPointInfo__source_position__Smi", 0x8 },
+ { "v8dbg_class_BreakPointInfo__statement_position__Smi", 0xc },
+ { "v8dbg_class_CallHandlerInfo__callback__Object", 0x4 },
+ { "v8dbg_class_CallHandlerInfo__data__Object", 0x8 },
+ { "v8dbg_class_Code__deoptimization_data__FixedArray", 0xc },
+ { "v8dbg_class_Code__instruction_size__int", 0x4 },
+ { "v8dbg_class_Code__instruction_start__int", 0x20 },
+ { "v8dbg_class_Code__next_code_flushing_candidate__Object", 0x10 },
+ { "v8dbg_class_Code__relocation_info__ByteArray", 0x8 },
+ { "v8dbg_class_CodeCache__default_cache__FixedArray", 0x4 },
+ { "v8dbg_class_CodeCache__normal_type_cache__Object", 0x8 },
+ { "v8dbg_class_ConsString__first__String", 0xc },
+ { "v8dbg_class_ConsString__second__String", 0x10 },
+ { "v8dbg_class_DebugInfo__break_points__FixedArray", 0x14 },
+ { "v8dbg_class_DebugInfo__code__Code", 0xc },
+ { "v8dbg_class_DebugInfo__original_code__Code", 0x8 },
+ { "v8dbg_class_DebugInfo__shared__SharedFunctionInfo", 0x4 },
+ { "v8dbg_class_ExternalString__resource__Object", 0xc },
+ { "v8dbg_class_FixedArray__data__uintptr_t", 0x8 },
+ { "v8dbg_class_FixedArrayBase__length__SMI", 0x4 },
+ { "v8dbg_class_FunctionTemplateInfo__access_check_info__Object", 0x38 },
+ { "v8dbg_class_FunctionTemplateInfo__call_code__Object", 0x10 },
+ { "v8dbg_class_FunctionTemplateInfo__class_name__Object", 0x2c },
+ { "v8dbg_class_FunctionTemplateInfo__flag__Smi", 0x3c },
+ { "v8dbg_class_FunctionTemplateInfo__indexed_property_handler__Object",
+ 0x24 },
+ { "v8dbg_class_FunctionTemplateInfo__instance_call_handler__Object",
+ 0x34 },
+ { "v8dbg_class_FunctionTemplateInfo__instance_template__Object", 0x28 },
+ { "v8dbg_class_FunctionTemplateInfo__named_property_handler__Object",
+ 0x20 },
+ { "v8dbg_class_FunctionTemplateInfo__parent_template__Object", 0x1c },
+ { "v8dbg_class_FunctionTemplateInfo__property_accessors__Object",
+ 0x14 },
+ { "v8dbg_class_FunctionTemplateInfo__prototype_template__Object",
+ 0x18 },
+ { "v8dbg_class_FunctionTemplateInfo__serial_number__Object", 0xc },
+ { "v8dbg_class_FunctionTemplateInfo__signature__Object", 0x30 },
+ { "v8dbg_class_GlobalObject__builtins__JSBuiltinsObject", 0xc },
+ { "v8dbg_class_GlobalObject__global_context__Context", 0x10 },
+ { "v8dbg_class_GlobalObject__global_receiver__JSObject", 0x14 },
+ { "v8dbg_class_HeapNumber__value__double", 0x4 },
+ { "v8dbg_class_HeapObject__map__Map", 0x0 },
+ { "v8dbg_class_InterceptorInfo__data__Object", 0x18 },
+ { "v8dbg_class_InterceptorInfo__deleter__Object", 0x10 },
+ { "v8dbg_class_InterceptorInfo__enumerator__Object", 0x14 },
+ { "v8dbg_class_InterceptorInfo__getter__Object", 0x4 },
+ { "v8dbg_class_InterceptorInfo__query__Object", 0xc },
+ { "v8dbg_class_InterceptorInfo__setter__Object", 0x8 },
+ { "v8dbg_class_JSArray__length__Object", 0xc },
+ { "v8dbg_class_JSFunction__literals__FixedArray", 0x1c },
+ { "v8dbg_class_JSFunction__next_function_link__Object", 0x20 },
+ { "v8dbg_class_JSFunction__prototype_or_initial_map__Object", 0x10 },
+ { "v8dbg_class_JSFunction__shared__SharedFunctionInfo", 0x14 },
+ { "v8dbg_class_JSFunctionProxy__call_trap__Object", 0x8 },
+ { "v8dbg_class_JSFunctionProxy__construct_trap__Object", 0xc },
+ { "v8dbg_class_JSGlobalProxy__context__Object", 0xc },
+ { "v8dbg_class_JSMessageObject__arguments__JSArray", 0x10 },
+ { "v8dbg_class_JSMessageObject__end_position__SMI", 0x24 },
+ { "v8dbg_class_JSMessageObject__script__Object", 0x14 },
+ { "v8dbg_class_JSMessageObject__stack_frames__Object", 0x1c },
+ { "v8dbg_class_JSMessageObject__stack_trace__Object", 0x18 },
+ { "v8dbg_class_JSMessageObject__start_position__SMI", 0x20 },
+ { "v8dbg_class_JSMessageObject__type__String", 0xc },
+ { "v8dbg_class_JSObject__elements__Object", 0x8 },
+ { "v8dbg_class_JSObject__properties__FixedArray", 0x4 },
+ { "v8dbg_class_JSProxy__handler__Object", 0x4 },
+ { "v8dbg_class_JSRegExp__data__Object", 0xc },
+ { "v8dbg_class_JSValue__value__Object", 0xc },
+ { "v8dbg_class_JSWeakMap__next__Object", 0x10 },
+ { "v8dbg_class_JSWeakMap__table__ObjectHashTable", 0xc },
+ { "v8dbg_class_Map__code_cache__Object", 0x18 },
+ { "v8dbg_class_Map__constructor__Object", 0x10 },
+ { "v8dbg_class_Map__inobject_properties__int", 0x5 },
+ { "v8dbg_class_Map__instance_attributes__int", 0x8 },
+ { "v8dbg_class_Map__instance_descriptors__FixedArray", 0x14 },
+ { "v8dbg_class_Map__instance_size__int", 0x4 },
+ { "v8dbg_class_Map__prototype_transitions__FixedArray", 0x1c },
+ { "v8dbg_class_ObjectTemplateInfo__constructor__Object", 0xc },
+ { "v8dbg_class_ObjectTemplateInfo__internal_field_count__Object",
+ 0x10 },
+ { "v8dbg_class_Oddball__to_number__Object", 0x8 },
+ { "v8dbg_class_Oddball__to_string__String", 0x4 },
+ { "v8dbg_class_PolymorphicCodeCache__cache__Object", 0x4 },
+ { "v8dbg_class_Script__column_offset__Smi", 0x10 },
+ { "v8dbg_class_Script__compilation_type__Smi", 0x24 },
+ { "v8dbg_class_Script__context_data__Object", 0x18 },
+ { "v8dbg_class_Script__data__Object", 0x14 },
+ { "v8dbg_class_Script__eval_from_instructions_offset__Smi", 0x34 },
+ { "v8dbg_class_Script__eval_from_shared__Object", 0x30 },
+ { "v8dbg_class_Script__id__Object", 0x2c },
+ { "v8dbg_class_Script__line_ends__Object", 0x28 },
+ { "v8dbg_class_Script__line_offset__Smi", 0xc },
+ { "v8dbg_class_Script__name__Object", 0x8 },
+ { "v8dbg_class_Script__source__Object", 0x4 },
+ { "v8dbg_class_Script__type__Smi", 0x20 },
+ { "v8dbg_class_Script__wrapper__Foreign", 0x1c },
+ { "v8dbg_class_SeqAsciiString__chars__char", 0xc },
+ { "v8dbg_class_SharedFunctionInfo__code__Code", 0x8 },
+ { "v8dbg_class_SharedFunctionInfo__compiler_hints__SMI", 0x50 },
+ { "v8dbg_class_SharedFunctionInfo__construct_stub__Code", 0x10 },
+ { "v8dbg_class_SharedFunctionInfo__debug_info__Object", 0x20 },
+ { "v8dbg_class_SharedFunctionInfo__end_position__SMI", 0x48 },
+ { "v8dbg_class_SharedFunctionInfo__expected_nof_properties__SMI",
+ 0x3c },
+ { "v8dbg_class_SharedFunctionInfo__formal_parameter_count__SMI", 0x38 },
+ { "v8dbg_class_SharedFunctionInfo__function_data__Object", 0x18 },
+ { "v8dbg_class_SharedFunctionInfo__function_token_position__SMI",
+ 0x4c },
+ { "v8dbg_class_SharedFunctionInfo__inferred_name__String", 0x24 },
+ { "v8dbg_class_SharedFunctionInfo__initial_map__Object", 0x28 },
+ { "v8dbg_class_SharedFunctionInfo__instance_class_name__Object", 0x14 },
+ { "v8dbg_class_SharedFunctionInfo__length__SMI", 0x34 },
+ { "v8dbg_class_SharedFunctionInfo__name__Object", 0x4 },
+ { "v8dbg_class_SharedFunctionInfo__num_literals__SMI", 0x40 },
+ { "v8dbg_class_SharedFunctionInfo__opt_count__SMI", 0x58 },
+ { "v8dbg_class_SharedFunctionInfo__script__Object", 0x1c },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "start_position_and_type__SMI", 0x44 },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "this_property_assignments__Object", 0x2c },
+ { "v8dbg_class_SharedFunctionInfo__"
+ "this_property_assignments_count__SMI", 0x54 },
+ { "v8dbg_class_SignatureInfo__args__Object", 0x8 },
+ { "v8dbg_class_SignatureInfo__receiver__Object", 0x4 },
+ { "v8dbg_class_SlicedString__offset__SMI", 0x10 },
+ { "v8dbg_class_String__length__SMI", 0x4 },
+ { "v8dbg_class_TemplateInfo__property_list__Object", 0x8 },
+ { "v8dbg_class_TemplateInfo__tag__Object", 0x4 },
+ { "v8dbg_class_TypeSwitchInfo__types__Object", 0x4 },
+
+ { "v8dbg_parent_AccessCheckInfo__Struct", 0x0 },
+ { "v8dbg_parent_AccessorInfo__Struct", 0x0 },
+ { "v8dbg_parent_BreakPointInfo__Struct", 0x0 },
+ { "v8dbg_parent_ByteArray__FixedArrayBase", 0x0 },
+ { "v8dbg_parent_CallHandlerInfo__Struct", 0x0 },
+ { "v8dbg_parent_Code__HeapObject", 0x0 },
+ { "v8dbg_parent_CodeCache__Struct", 0x0 },
+ { "v8dbg_parent_ConsString__String", 0x0 },
+ { "v8dbg_parent_DebugInfo__Struct", 0x0 },
+ { "v8dbg_parent_DeoptimizationInputData__FixedArray", 0x0 },
+ { "v8dbg_parent_DeoptimizationOutputData__FixedArray", 0x0 },
+ { "v8dbg_parent_DescriptorArray__FixedArray", 0x0 },
+ { "v8dbg_parent_ExternalArray__FixedArrayBase", 0x0 },
+ { "v8dbg_parent_ExternalAsciiString__ExternalString", 0x0 },
+ { "v8dbg_parent_ExternalByteArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalDoubleArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalFloatArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalIntArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalPixelArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalShortArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalString__String", 0x0 },
+ { "v8dbg_parent_ExternalTwoByteString__ExternalString", 0x0 },
+ { "v8dbg_parent_ExternalUnsignedByteArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalUnsignedIntArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_ExternalUnsignedShortArray__ExternalArray", 0x0 },
+ { "v8dbg_parent_Failure__MaybeObject", 0x0 },
+ { "v8dbg_parent_FixedArray__FixedArrayBase", 0x0 },
+ { "v8dbg_parent_FixedArrayBase__HeapObject", 0x0 },
+ { "v8dbg_parent_FixedDoubleArray__FixedArrayBase", 0x0 },
+ { "v8dbg_parent_Foreign__HeapObject", 0x0 },
+ { "v8dbg_parent_FunctionTemplateInfo__TemplateInfo", 0x0 },
+ { "v8dbg_parent_GlobalObject__JSObject", 0x0 },
+ { "v8dbg_parent_HashTable__FixedArray", 0x0 },
+ { "v8dbg_parent_HeapNumber__HeapObject", 0x0 },
+ { "v8dbg_parent_HeapObject__Object", 0x0 },
+ { "v8dbg_parent_InterceptorInfo__Struct", 0x0 },
+ { "v8dbg_parent_JSArray__JSObject", 0x0 },
+ { "v8dbg_parent_JSBuiltinsObject__GlobalObject", 0x0 },
+ { "v8dbg_parent_JSFunction__JSObject", 0x0 },
+ { "v8dbg_parent_JSFunctionProxy__JSProxy", 0x0 },
+ { "v8dbg_parent_JSFunctionResultCache__FixedArray", 0x0 },
+ { "v8dbg_parent_JSGlobalObject__GlobalObject", 0x0 },
+ { "v8dbg_parent_JSGlobalPropertyCell__HeapObject", 0x0 },
+ { "v8dbg_parent_JSMessageObject__JSObject", 0x0 },
+ { "v8dbg_parent_JSObject__JSReceiver", 0x0 },
+ { "v8dbg_parent_JSProxy__JSReceiver", 0x0 },
+ { "v8dbg_parent_JSReceiver__HeapObject", 0x0 },
+ { "v8dbg_parent_JSRegExp__JSObject", 0x0 },
+ { "v8dbg_parent_JSRegExpResult__JSArray", 0x0 },
+ { "v8dbg_parent_JSValue__JSObject", 0x0 },
+ { "v8dbg_parent_JSWeakMap__JSObject", 0x0 },
+ { "v8dbg_parent_Map__HeapObject", 0x0 },
+ { "v8dbg_parent_NormalizedMapCache__FixedArray", 0x0 },
+ { "v8dbg_parent_ObjectTemplateInfo__TemplateInfo", 0x0 },
+ { "v8dbg_parent_Oddball__HeapObject", 0x0 },
+ { "v8dbg_parent_PolymorphicCodeCache__Struct", 0x0 },
+ { "v8dbg_parent_Script__Struct", 0x0 },
+ { "v8dbg_parent_SeqAsciiString__SeqString", 0x0 },
+ { "v8dbg_parent_SeqString__String", 0x0 },
+ { "v8dbg_parent_SeqTwoByteString__SeqString", 0x0 },
+ { "v8dbg_parent_SharedFunctionInfo__HeapObject", 0x0 },
+ { "v8dbg_parent_SignatureInfo__Struct", 0x0 },
+ { "v8dbg_parent_SlicedString__String", 0x0 },
+ { "v8dbg_parent_Smi__Object", 0x0 },
+ { "v8dbg_parent_String__HeapObject", 0x0 },
+ { "v8dbg_parent_Struct__HeapObject", 0x0 },
+ { "v8dbg_parent_TemplateInfo__Struct", 0x0 },
+ { "v8dbg_parent_TypeSwitchInfo__Struct", 0x0 },
+
+ { "v8dbg_frametype_ArgumentsAdaptorFrame", 0x8 },
+ { "v8dbg_frametype_ConstructFrame", 0x7 },
+ { "v8dbg_frametype_EntryConstructFrame", 0x2 },
+ { "v8dbg_frametype_EntryFrame", 0x1 },
+ { "v8dbg_frametype_ExitFrame", 0x3 },
+ { "v8dbg_frametype_InternalFrame", 0x6 },
+ { "v8dbg_frametype_JavaScriptFrame", 0x4 },
+ { "v8dbg_frametype_OptimizedFrame", 0x5 },
+
+ { "v8dbg_off_fp_args", 0x8 },
+ { "v8dbg_off_fp_context", -0x4 },
+ { "v8dbg_off_fp_function", -0x8 },
+ { "v8dbg_off_fp_marker", -0x8 },
+
+ { "v8dbg_prop_idx_content", 0x1 },
+ { "v8dbg_prop_idx_first", 0x3 },
+ { "v8dbg_prop_type_field", 0x1 },
+ { "v8dbg_prop_type_first_phantom", 0x6 },
+ { "v8dbg_prop_type_mask", 0xf },
+
+ { "v8dbg_AsciiStringTag", 0x4 },
+ { "v8dbg_PointerSizeLog2", 0x2 },
+ { "v8dbg_SeqStringTag", 0x0 },
+ { "v8dbg_SmiTag", 0x0 },
+ { "v8dbg_SmiTagMask", 0x1 },
+ { "v8dbg_SmiValueShift", 0x1 },
+ { "v8dbg_StringEncodingMask", 0x4 },
+ { "v8dbg_StringRepresentationMask", 0x3 },
+ { "v8dbg_StringTag", 0x0 },
+ { "v8dbg_TwoByteStringTag", 0x0 },
+ { "v8dbg_ConsStringTag", 0x1 },
+ { "v8dbg_ExternalStringTag", 0x2 },
+ { "v8dbg_FailureTag", 0x3 },
+ { "v8dbg_FailureTagMask", 0x3 },
+ { "v8dbg_FirstNonstringType", 0x80 },
+ { "v8dbg_HeapObjectTag", 0x1 },
+ { "v8dbg_HeapObjectTagMask", 0x3 },
+ { "v8dbg_IsNotStringMask", 0x80 },
+ { "v8dbg_NotStringTag", 0x80 },
+
+ { NULL },
+};
+
+v8_cfg_t v8_cfg_04 = { "node-0.4", "node v0.4", v8_symbols_node_04,
+ v8cfg_canned_iter, v8cfg_canned_readsym };
+
+v8_cfg_t v8_cfg_06 = { "node-0.6", "node v0.6", v8_symbols_node_06,
+ v8cfg_canned_iter, v8cfg_canned_readsym };
+
+v8_cfg_t *v8_cfgs[] = {
+ &v8_cfg_04,
+ &v8_cfg_06,
+ NULL
+};
+
+v8_cfg_t v8_cfg_target = { NULL, NULL, NULL, v8cfg_target_iter,
+ v8cfg_target_readsym };
diff --git a/usr/src/cmd/mdb/common/modules/v8/v8cfg.h b/usr/src/cmd/mdb/common/modules/v8/v8cfg.h
new file mode 100644
index 0000000000..9e722b0e2b
--- /dev/null
+++ b/usr/src/cmd/mdb/common/modules/v8/v8cfg.h
@@ -0,0 +1,55 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * v8cfg.h: canned configurations for previous V8 versions
+ */
+
+#ifndef V8CFG_H
+#define V8CFG_H
+
+#include <sys/types.h>
+#include <sys/mdb_modapi.h>
+
+typedef struct {
+ const char *v8cs_name; /* symbol name */
+ intptr_t v8cs_value; /* symbol value */
+} v8_cfg_symbol_t;
+
+typedef struct v8_cfg {
+ const char *v8cfg_name; /* canned config name */
+ const char *v8cfg_label; /* description */
+ v8_cfg_symbol_t *v8cfg_symbols; /* actual symbol values */
+
+ int (*v8cfg_iter)(struct v8_cfg *, int (*)(mdb_symbol_t *, void *),
+ void *);
+ int (*v8cfg_readsym)(struct v8_cfg *, const char *, intptr_t *);
+} v8_cfg_t;
+
+extern v8_cfg_t v8_cfg_04;
+extern v8_cfg_t v8_cfg_06;
+extern v8_cfg_t v8_cfg_target;
+extern v8_cfg_t *v8_cfgs[];
+
+#endif /* V8CFG_H */
diff --git a/usr/src/cmd/mdb/common/modules/v8/v8dbg.h b/usr/src/cmd/mdb/common/modules/v8/v8dbg.h
new file mode 100644
index 0000000000..36a30a79ef
--- /dev/null
+++ b/usr/src/cmd/mdb/common/modules/v8/v8dbg.h
@@ -0,0 +1,83 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * v8dbg.h: macros for use by V8 heap inspection tools. The consumer must
+ * define values for various tags and shifts. The MDB module gets these
+ * constants from information encoded in the binary itself.
+ */
+
+#ifndef _V8DBG_H
+#define _V8DBG_H
+
+/*
+ * Recall that while V8 heap objects are always 4-byte aligned, heap object
+ * pointers always have the last bit set. So when looking for a field nominally
+ * at offset X, one must be sure to clear the tag bit first.
+ */
+#define V8_OFF_HEAP(x) ((x) - V8_HeapObjectTag)
+
+/*
+ * Determine whether a given pointer refers to a SMI, Failure, or HeapObject.
+ */
+#define V8_IS_SMI(ptr) (((ptr) & V8_SmiTagMask) == V8_SmiTag)
+#define V8_IS_FAILURE(ptr) (((ptr) & V8_FailureTagMask) == V8_FailureTag)
+#define V8_IS_HEAPOBJECT(ptr) \
+ (((ptr) & V8_HeapObjectTagMask) == V8_HeapObjectTag)
+
+/*
+ * Extract the value of a SMI "pointer". Recall that small integers are stored
+ * using the upper 31 bits.
+ */
+#define V8_SMI_VALUE(smi) ((smi) >> (V8_SmiValueShift + V8_SmiShiftSize))
+
+/*
+ * Determine the encoding and representation of a V8 string.
+ */
+#define V8_TYPE_STRING(type) (((type) & V8_IsNotStringMask) == V8_StringTag)
+
+#define V8_STRENC_ASCII(type) \
+ (((type) & V8_StringEncodingMask) == V8_AsciiStringTag)
+
+#define V8_STRREP_SEQ(type) \
+ (((type) & V8_StringRepresentationMask) == V8_SeqStringTag)
+#define V8_STRREP_CONS(type) \
+ (((type) & V8_StringRepresentationMask) == V8_ConsStringTag)
+#define V8_STRREP_SLICED(type) \
+ (((type) & V8_StringRepresentationMask) == V8_SlicedStringTag)
+#define V8_STRREP_EXT(type) \
+ (((type) & V8_StringRepresentationMask) == V8_ExternalStringTag)
+
+/*
+ * Several of the following constants and transformations are hardcoded in V8 as
+ * well, so there's no way to extract them programmatically from the binary.
+ */
+#define V8_DESC_KEYIDX(x) ((x) + V8_PROP_IDX_FIRST)
+#define V8_DESC_VALIDX(x) ((x) << 1)
+#define V8_DESC_DETIDX(x) (((x) << 1) + 1)
+
+#define V8_DESC_ISFIELD(x) \
+ ((V8_SMI_VALUE(x) & V8_PROP_TYPE_MASK) == V8_PROP_TYPE_FIELD)
+
+#endif /* _V8DBG_H */
diff --git a/usr/src/cmd/mdb/i86pc/modules/unix/unix.c b/usr/src/cmd/mdb/i86pc/modules/unix/unix.c
index d774cde91f..b63876f1f8 100644
--- a/usr/src/cmd/mdb/i86pc/modules/unix/unix.c
+++ b/usr/src/cmd/mdb/i86pc/modules/unix/unix.c
@@ -22,6 +22,10 @@
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
+ */
+
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_ctf.h>
#include <sys/cpuvar.h>
@@ -36,6 +40,8 @@
#include <sys/mutex_impl.h>
#include "i86mmu.h"
#include <sys/apix.h>
+#include <sys/x86_archext.h>
+#include <sys/bitmap.h>
#define TT_HDLR_WIDTH 17
@@ -745,6 +751,137 @@ ptable_help(void)
"-m Interpret the PFN as an MFN (machine frame number)\n");
}
+/*
+ * NSEC_SHIFT is replicated here (it is not defined in a header file),
+ * but for amusement, the reader is directed to the comment that explains
+ * the rationale for this particular value on x86. Spoiler: the value is
+ * selected to accommodate 60 MHz Pentiums! (And a confession: if the voice
+ * in that comment sounds too familiar, it's because your author also wrote
+ * that code -- some fifteen years prior to this writing in 2011...)
+ */
+#define NSEC_SHIFT 5
+
+/*ARGSUSED*/
+static int
+scalehrtime_cmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+{
+ uint32_t nsec_scale;
+ hrtime_t tsc = addr, hrt;
+ unsigned int *tscp = (unsigned int *)&tsc;
+ uintptr_t scalehrtimef;
+ uint64_t scale;
+ GElf_Sym sym;
+
+ if (!(flags & DCMD_ADDRSPEC)) {
+ if (argc != 1)
+ return (DCMD_USAGE);
+
+ switch (argv[0].a_type) {
+ case MDB_TYPE_STRING:
+ tsc = mdb_strtoull(argv[0].a_un.a_str);
+ break;
+ case MDB_TYPE_IMMEDIATE:
+ tsc = argv[0].a_un.a_val;
+ break;
+ default:
+ return (DCMD_USAGE);
+ }
+ }
+
+ if (mdb_readsym(&scalehrtimef,
+ sizeof (scalehrtimef), "scalehrtimef") == -1) {
+ mdb_warn("couldn't read 'scalehrtimef'");
+ return (DCMD_ERR);
+ }
+
+ if (mdb_lookup_by_name("tsc_scalehrtime", &sym) == -1) {
+ mdb_warn("couldn't find 'tsc_scalehrtime'");
+ return (DCMD_ERR);
+ }
+
+ if (sym.st_value != scalehrtimef) {
+ mdb_warn("::scalehrtime requires that scalehrtimef "
+ "be set to tsc_scalehrtime\n");
+ return (DCMD_ERR);
+ }
+
+ if (mdb_readsym(&nsec_scale, sizeof (nsec_scale), "nsec_scale") == -1) {
+ mdb_warn("couldn't read 'nsec_scale'");
+ return (DCMD_ERR);
+ }
+
+ scale = (uint64_t)nsec_scale;
+
+ hrt = ((uint64_t)tscp[1] * scale) << NSEC_SHIFT;
+ hrt += ((uint64_t)tscp[0] * scale) >> (32 - NSEC_SHIFT);
+
+ mdb_printf("0x%llx\n", hrt);
+
+ return (DCMD_OK);
+}
+
+/*
+ * The x86 feature set is implemented as a bitmap array. That bitmap array is
+ * stored across a number of uchars based on the BT_SIZEOFMAP(NUM_X86_FEATURES)
+ * macro. We have the names for each of these features in unix's text segment
+ * so we do not have to duplicate them and instead just look them up.
+ */
+/*ARGSUSED*/
+static int
+x86_featureset_cmd(uintptr_t addr, uint_t flags, int argc,
+ const mdb_arg_t *argv)
+{
+ uchar_t *fset;
+ GElf_Sym sym;
+ uintptr_t nptr;
+ char name[128];
+ int ii;
+
+ size_t sz = sizeof (uchar_t) * BT_SIZEOFMAP(NUM_X86_FEATURES);
+
+ if (argc != 0)
+ return (DCMD_USAGE);
+
+ if (mdb_lookup_by_name("x86_feature_names", &sym) == -1) {
+ mdb_warn("couldn't find x86_feature_names");
+ return (DCMD_ERR);
+ }
+
+ fset = mdb_zalloc(sz, UM_NOSLEEP);
+ if (fset == NULL) {
+ mdb_warn("failed to allocate memory for x86_featureset");
+ return (DCMD_ERR);
+ }
+
+ if (mdb_readvar(fset, "x86_featureset") != sz) {
+ mdb_warn("failed to read x86_featureset");
+ mdb_free(fset, sz);
+ return (DCMD_ERR);
+ }
+
+ for (ii = 0; ii < NUM_X86_FEATURES; ii++) {
+ if (!BT_TEST((ulong_t *)fset, ii))
+ continue;
+
+ if (mdb_vread(&nptr, sizeof (char *), sym.st_value +
+ sizeof (void *) * ii) != sizeof (char *)) {
+ mdb_warn("failed to read feature array %d", ii);
+ mdb_free(fset, sz);
+ return (DCMD_ERR);
+ }
+
+ if (mdb_readstr(name, sizeof (name), nptr) == -1) {
+ mdb_warn("failed to read feature %d", ii);
+ mdb_free(fset, sz);
+ return (DCMD_ERR);
+ }
+ mdb_printf("%s\n", name);
+ }
+
+ mdb_free(fset, sz);
+ return (DCMD_OK);
+}
+
static const mdb_dcmd_t dcmds[] = {
{ "gate_desc", ":", "dump a gate descriptor", gate_desc },
{ "idt", ":[-v]", "dump an IDT", idt },
@@ -765,6 +902,10 @@ static const mdb_dcmd_t dcmds[] = {
{ "mfntopfn", ":", "convert hypervisor machine page to physical page",
mfntopfn_dcmd },
{ "memseg_list", ":", "show memseg list", memseg_list },
+ { "scalehrtime", ":",
+ "scale an unscaled high-res time", scalehrtime_cmd },
+ { "x86_featureset", NULL, "dump the x86_featureset vector",
+ x86_featureset_cmd },
{ NULL }
};
diff --git a/usr/src/cmd/mdb/intel/amd64/libumem/Makefile b/usr/src/cmd/mdb/intel/amd64/libumem/Makefile
index 704ff65873..ae22217a1b 100644
--- a/usr/src/cmd/mdb/intel/amd64/libumem/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/libumem/Makefile
@@ -22,6 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
MODULE = libumem.so
MDBTGT = proc
diff --git a/usr/src/cmd/mdb/intel/amd64/v8/Makefile b/usr/src/cmd/mdb/intel/amd64/v8/Makefile
new file mode 100644
index 0000000000..cf74ba1d1c
--- /dev/null
+++ b/usr/src/cmd/mdb/intel/amd64/v8/Makefile
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+MODULE = v8.so
+MDBTGT = proc
+
+MODSRCS_DIR = ../../../common/modules/v8
+
+MODSRCS = mdb_v8.c mdb_v8_cfg.c
+
+include ../../../../Makefile.cmd
+include ../../../../Makefile.cmd.64
+include ../../Makefile.amd64
+include ../../../Makefile.module
+
+dmod/$(MODULE) := LDLIBS += -lproc -lavl
+
+%.o: $(MODSRCS_DIR)/%.c
+ $(COMPILE.c) $<
+ $(CTFCONVERT_O)
+
+%.ln: $(MODSRCS_DIR)/%.c
+ $(LINT.c) -c $<
diff --git a/usr/src/cmd/mdb/intel/ia32/libumem/Makefile b/usr/src/cmd/mdb/intel/ia32/libumem/Makefile
index a1ab338f40..bde1be90ac 100644
--- a/usr/src/cmd/mdb/intel/ia32/libumem/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/libumem/Makefile
@@ -22,6 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
MODULE = libumem.so
MDBTGT = proc
diff --git a/usr/src/cmd/mdb/intel/ia32/v8/Makefile b/usr/src/cmd/mdb/intel/ia32/v8/Makefile
new file mode 100644
index 0000000000..c84532289e
--- /dev/null
+++ b/usr/src/cmd/mdb/intel/ia32/v8/Makefile
@@ -0,0 +1,44 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+MODULE = v8.so
+MDBTGT = proc
+
+MODSRCS_DIR = ../../../common/modules/v8
+
+MODSRCS = mdb_v8.c mdb_v8_cfg.c
+
+include ../../../../Makefile.cmd
+include ../../Makefile.ia32
+include ../../../Makefile.module
+
+dmod/$(MODULE) := LDLIBS += -lproc -lavl
+
+%.o: $(MODSRCS_DIR)/%.c
+ $(COMPILE.c) $<
+ $(CTFCONVERT_O)
+
+%.ln: $(MODSRCS_DIR)/%.c
+ $(LINT.c) -c $<
diff --git a/usr/src/cmd/mdb/sparc/v7/libumem/Makefile b/usr/src/cmd/mdb/sparc/v7/libumem/Makefile
index 906d05d5ea..0488e6739a 100644
--- a/usr/src/cmd/mdb/sparc/v7/libumem/Makefile
+++ b/usr/src/cmd/mdb/sparc/v7/libumem/Makefile
@@ -22,6 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
MODULE = libumem.so
MDBTGT = proc
diff --git a/usr/src/cmd/mdb/sparc/v9/libumem/Makefile b/usr/src/cmd/mdb/sparc/v9/libumem/Makefile
index 09ea0473c6..87ce977423 100644
--- a/usr/src/cmd/mdb/sparc/v9/libumem/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/libumem/Makefile
@@ -22,6 +22,7 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
MODULE = libumem.so
MDBTGT = proc
diff --git a/usr/src/cmd/mdb/test/mtest.sh b/usr/src/cmd/mdb/test/mtest.sh
index f21d0faa21..f21d0faa21 100644..100755
--- a/usr/src/cmd/mdb/test/mtest.sh
+++ b/usr/src/cmd/mdb/test/mtest.sh
diff --git a/usr/src/cmd/mdb/test/typedef/tst.dellist.mdb.out b/usr/src/cmd/mdb/test/typedef/tst.dellist.mdb.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/usr/src/cmd/mdb/test/typedef/tst.dellist.mdb.out
diff --git a/usr/src/cmd/mdb/test/typedef/tst.emptylist.mdb.out b/usr/src/cmd/mdb/test/typedef/tst.emptylist.mdb.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/usr/src/cmd/mdb/test/typedef/tst.emptylist.mdb.out
diff --git a/usr/src/cmd/nicstat/Makefile b/usr/src/cmd/nicstat/Makefile
new file mode 100644
index 0000000000..935011119a
--- /dev/null
+++ b/usr/src/cmd/nicstat/Makefile
@@ -0,0 +1,31 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc. All rights reserved.
+#
+
+PROG = nicstat
+
+include ../Makefile.cmd
+
+all: $(PROG)
+
+install: all .WAIT $(ROOTPROG)
+
+clean:
+
+$(ROOTBINPROG): $(PROG)
+ $(INS.file)
+
+lint:
+
+include ../Makefile.targ
diff --git a/usr/src/cmd/nicstat/nicstat.pl b/usr/src/cmd/nicstat/nicstat.pl
new file mode 100644
index 0000000000..29e62f1ffd
--- /dev/null
+++ b/usr/src/cmd/nicstat/nicstat.pl
@@ -0,0 +1,422 @@
+#!/usr/perl5/bin/perl -w
+#
+# nicstat - print network traffic, Kbyte/s read and written.
+# Solaris 8+, Perl (Sun::Solaris::Kstat).
+#
+# "netstat -i" only gives a packet count, this program gives Kbytes.
+#
+# 04-Apr-2011, ver 1.00J
+#
+# USAGE: nicstat [-hsz] [-i int[,int...]] | [interval [count]]
+#
+# -h # help
+# -s # print summary output
+# -z # skip zero lines
+# -i int[,int...] # print these instances only
+# eg,
+# nicstat # print summary since boot
+# nicstat 1 # print continually, every 1 second
+# nicstat 1 5 # print 5 times, every 1 second
+# nicstat -i hme0 # only examine hme0
+#
+# This prints out the KB/s transferred for all the network cards (NICs),
+# including packet counts and average sizes. The first line is the summary
+# data since boot.
+#
+# FIELDS:
+# Int Interface
+# rKB/s read Kbytes/s
+# wKB/s write Kbytes/s
+# rPk/s read Packets/s
+# wPk/s write Packets/s
+# rAvs read Average size, bytes
+# wAvs write Average size, bytes
+# %Util %Utilisation (r or w/ifspeed)
+# Sat Saturation (defer, nocanput, norecvbuf, noxmtbuf)
+#
+# NOTES:
+#
+# - Some unusual network cards may not provide all the details to Kstat,
+# (or provide different symbols). Check for newer versions of this program,
+# and the @Network array in the code below.
+# - Utilisation is based on bytes transferred divided by speed of the interface
+# (if the speed is known). It should be impossible to reach 100% as there
+# are overheads due to bus negotiation and timing.
+# - Loopback interfaces may only provide packet counts (if anything), and so
+# bytes and %util will always be zero. Newer versions of Solaris (newer than
+# Solaris 10 6/06) may provide loopback byte stats.
+# - Saturation is determined by counting read and write errors caused by the
+# interface running at saturation. This approach is not ideal, and the value
+# reported is often lower than it should be (eg, 0.0). Reading the rKB/s and
+# wKB/s fields may be more useful.
+#
+# SEE ALSO:
+# nicstat.c # the C version, also on my website
+# kstat -n hme0 [interval [count]] # or qfe0, ...
+# netstat -iI hme0 [interval [count]]
+# se netstat.se [interval] # SE Toolkit
+# se nx.se [interval] # SE Toolkit
+#
+# COPYRIGHT: Copyright (c) 2013 Brendan Gregg.
+#
+# 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 docs/cddl1.txt or
+# http://opensource.org/licenses/CDDL-1.0.
+# 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 docs/cddl1.txt.
+# 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
+#
+# Author: Brendan Gregg [Sydney, Australia]
+#
+# 18-Jul-2004 Brendan Gregg Created this.
+# 07-Jan-2005 " " added saturation value.
+# 07-Jan-2005 " " added summary style (from Peter Tribble).
+# 23-Jan-2006 " " Tweaked style.
+# 11-Aug-2006 " " Improved output neatness.
+# 30-Sep-2006 " " Added loopback, tweaked output.
+# 04-Apr-2011 brendan@joyent.com Updated for smartmachines.
+
+use strict;
+use Getopt::Std;
+use Sun::Solaris::Kstat;
+my $Kstat = Sun::Solaris::Kstat->new();
+
+
+#
+# Process command line args
+#
+usage() if defined $ARGV[0] and $ARGV[0] eq "--help";
+getopts('hi:sz') or usage();
+usage() if defined $main::opt_h;
+my $STYLE = defined $main::opt_s ? $main::opt_s : 0;
+my $SKIPZERO = defined $main::opt_z ? $main::opt_z : 0;
+
+# process [interval [count]],
+my ($interval, $loop_max);
+if (defined $ARGV[0]) {
+ $interval = $ARGV[0];
+ $loop_max = defined $ARGV[1] ? $ARGV[1] : 2**32;
+ usage() if $interval == 0;
+}
+else {
+ $interval = 1;
+ $loop_max = 1;
+}
+
+# check for -i,
+my %NetworkOnly; # network interfaces to print
+my $NETWORKONLY = 0; # match on network interfaces
+if (defined $main::opt_i) {
+ foreach my $net (split /,/, $main::opt_i) {
+ $NetworkOnly{$net} = 1;
+ }
+ $NETWORKONLY = 1;
+}
+
+# globals,
+my $loop = 0; # current loop number
+my $PAGESIZE = 20; # max lines per header
+my $line = $PAGESIZE; # counter for lines printed
+my %NetworkNames; # Kstat network interfaces
+my %NetworkData; # network interface data
+my %NetworkDataOld; # network interface data
+$main::opt_h = 0;
+$| = 1; # autoflush
+
+# kstat "link" module includes:
+my @Network = qw(dmfe bge be bnx ce eri external ge hme igb ige internal ixgbe le ppp qfe rtls);
+my %Network;
+$Network{$_} = 1 foreach (@Network);
+my $ZONENAME = `/usr/bin/zonename`;
+chomp $ZONENAME;
+
+### Determine network interfaces
+unless (find_nets()) {
+ if ($NETWORKONLY) {
+ print STDERR "ERROR1: $main::opt_i matched no network interfaces.\n";
+ }
+ else {
+ print STDERR "ERROR1: No network interfaces found!\n";
+ }
+ exit 1;
+}
+
+
+#
+# Main
+#
+while (1) {
+
+ ### Print Header
+ if ($line >= $PAGESIZE) {
+ if ($STYLE == 0) {
+ printf "%8s %12s %7s %7s %7s %7s %7s %7s %6s %5s\n",
+ "Time", "Int", "rKB/s", "wKB/s", "rPk/s", "wPk/s", "rAvs",
+ "wAvs", "%Util", "Sat";
+ }
+ elsif ($STYLE == 1) {
+ printf "%8s %12s %14s %14s\n", "Time", "Int", "rKB/s", "wKB/s";
+ }
+
+ $line = 0;
+ }
+
+ ### Get new data
+ my (@NetworkData) = fetch_net_data();
+
+ foreach my $network_data (@NetworkData) {
+
+ ### Extract values
+ my ($int, $rbytes, $wbytes, $rpackets, $wpackets, $speed, $sat, $time)
+ = split /:/, $network_data;
+
+ ### Retrieve old values
+ my ($old_rbytes, $old_wbytes, $old_rpackets, $old_wpackets, $old_sat,
+ $old_time);
+ if (defined $NetworkDataOld{$int}) {
+ ($old_rbytes, $old_wbytes, $old_rpackets, $old_wpackets,
+ $old_sat, $old_time) = split /:/, $NetworkDataOld{$int};
+ }
+ else {
+ $old_rbytes = $old_wbytes = $old_rpackets = $old_wpackets
+ = $old_sat = $old_time = 0;
+ }
+
+ #
+ # Calculate statistics
+ #
+
+ # delta time
+ my $tdiff = $time - $old_time;
+
+ # per second values
+ my $rbps = ($rbytes - $old_rbytes) / $tdiff;
+ my $wbps = ($wbytes - $old_wbytes) / $tdiff;
+ my $rkps = $rbps / 1024;
+ my $wkps = $wbps / 1024;
+ my $rpps = ($rpackets - $old_rpackets) / $tdiff;
+ my $wpps = ($wpackets - $old_wpackets) / $tdiff;
+ my $ravs = $rpps > 0 ? $rbps / $rpps : 0;
+ my $wavs = $wpps > 0 ? $wbps / $wpps : 0;
+
+ # skip zero lines if asked
+ next if $SKIPZERO and ($rbps + $wbps) == 0;
+
+ # % utilisation
+ my $util;
+ if ($speed > 0) {
+ # the following has a mysterious "800", it is 100
+ # for the % conversion, and 8 for bytes2bits.
+ my $rutil = $rbps * 800 / $speed;
+ my $wutil = $wbps * 800 / $speed;
+ $util = $rutil > $wutil ? $rutil : $wutil;
+ $util = 100 if $util > 100;
+ }
+ else {
+ $util = 0;
+ }
+
+ # saturation per sec
+ my $sats = ($sat - $old_sat) / $tdiff;
+
+ #
+ # Print statistics
+ #
+ if ($rbps ne "") {
+ my @Time = localtime();
+
+ if ($STYLE == 0) {
+ printf "%02d:%02d:%02d %12s ",
+ $Time[2], $Time[1], $Time[0], $int;
+ print_neat($rkps);
+ print_neat($wkps);
+ print_neat($rpps);
+ print_neat($wpps);
+ print_neat($ravs);
+ print_neat($wavs);
+ printf "%6.2f %5.2f\n", $util, $sats;
+ }
+ elsif ($STYLE == 1) {
+ printf "%02d:%02d:%02d %12s %14.3f %14.3f\n",
+ $Time[2], $Time[1], $Time[0], $int, $rkps, $wkps;
+ }
+
+ $line++;
+
+ # for multiple interfaces, always print the header
+ $line += $PAGESIZE if @NetworkData > 1;
+ }
+
+ ### Store old values
+ $NetworkDataOld{$int}
+ = "$rbytes:$wbytes:$rpackets:$wpackets:$sat:$time";
+ }
+
+ ### Check for end
+ last if ++$loop == $loop_max;
+
+ ### Interval
+ sleep $interval;
+}
+
+
+# find_nets - walk Kstat to discover network interfaces.
+#
+# This walks %Kstat and populates a %NetworkNames with discovered
+# network interfaces.
+#
+sub find_nets {
+ my $found = 0;
+
+ ### Loop over all Kstat modules
+ foreach my $module (keys %$Kstat) {
+ my $Modules = $Kstat->{$module};
+
+ foreach my $instance (keys %$Modules) {
+ my $Instances = $Modules->{$instance};
+
+ foreach my $name (keys %$Instances) {
+
+ ### Skip interface if asked
+ if ($NETWORKONLY) {
+ next unless $NetworkOnly{$name};
+ }
+
+ my $Names = $Instances->{$name};
+
+ # Check this is a network device.
+ # Matching on ifspeed has been more reliable than "class"
+ # we also match loopback and "link" interfaces.
+ if (defined $$Names{ifspeed} || $module eq "lo"
+ || $module eq "link") {
+ next if $name eq "mac";
+ if ($module eq "link") {
+ my $nname = $name;
+ $nname =~ s/\d+$//;
+ next unless defined $Network{$nname}
+ or $ZONENAME eq $nname
+ or $ZONENAME eq "global";
+ }
+ ### Save network interface
+ $NetworkNames{$name} = $Names;
+ $found++;
+ }
+ }
+ }
+ }
+
+ return $found;
+}
+
+# fetch - fetch Kstat data for the network interfaces.
+#
+# This uses the interfaces in %NetworkNames and returns useful Kstat data.
+# The Kstat values used are rbytes64, obytes64, ipackets64, opackets64
+# (or the 32 bit versions if the 64 bit values are not there).
+#
+sub fetch_net_data {
+ my ($rbytes, $wbytes, $rpackets, $wpackets, $speed, $time);
+ my @NetworkData = ();
+
+ $Kstat->update();
+
+ ### Loop over previously found network interfaces
+ foreach my $name (sort keys %NetworkNames) {
+ my $Names = $NetworkNames{$name};
+
+ if (defined $$Names{opackets}) {
+
+ ### Fetch write bytes
+ if (defined $$Names{obytes64}) {
+ $rbytes = $$Names{rbytes64};
+ $wbytes = $$Names{obytes64};
+ }
+ elsif (defined $$Names{obytes}) {
+ $rbytes = $$Names{rbytes};
+ $wbytes = $$Names{obytes};
+ } else {
+ $rbytes = $wbytes = 0;
+ }
+
+ ### Fetch read bytes
+ if (defined $$Names{opackets64}) {
+ $rpackets = $$Names{ipackets64};
+ $wpackets = $$Names{opackets64};
+ }
+ else {
+ $rpackets = $$Names{ipackets};
+ $wpackets = $$Names{opackets};
+ }
+
+ ### Fetch interface speed
+ if (defined $$Names{ifspeed}) {
+ $speed = $$Names{ifspeed};
+ }
+ else {
+ # if we can't fetch the speed, print the
+ # %Util as 0.0 . To do this we,
+ $speed = 2 ** 48;
+ }
+
+ ### Determine saturation value
+ my $sat = 0;
+ if (defined $$Names{nocanput} or defined $$Names{norcvbuf}) {
+ $sat += defined $$Names{defer} ? $$Names{defer} : 0;
+ $sat += defined $$Names{nocanput} ? $$Names{nocanput} : 0;
+ $sat += defined $$Names{norcvbuf} ? $$Names{norcvbuf} : 0;
+ $sat += defined $$Names{noxmtbuf} ? $$Names{noxmtbuf} : 0;
+ }
+
+ ### use the last snaptime value,
+ $time = $$Names{snaptime};
+
+ ### store data
+ push @NetworkData, "$name:$rbytes:$wbytes:" .
+ "$rpackets:$wpackets:$speed:$sat:$time";
+ }
+ }
+
+ return @NetworkData;
+}
+
+# print_neat - print a float with decimal places if appropriate.
+#
+# This specifically keeps the width to 7 characters, if possible, plus
+# a trailing space.
+#
+sub print_neat {
+ my $num = shift;
+ if ($num >= 100000) {
+ printf "%7d ", $num;
+ } elsif ($num >= 100) {
+ printf "%7.1f ", $num;
+ } else {
+ printf "%7.2f ", $num;
+ }
+}
+
+# usage - print usage and exit.
+#
+sub usage {
+ print STDERR <<END;
+USAGE: nicstat [-hsz] [-i int[,int...]] | [interval [count]]
+ eg, nicstat # print summary since boot
+ nicstat 1 # print continually every 1 second
+ nicstat 1 5 # print 5 times, every 1 second
+ nicstat -s # summary output
+ nicstat -i hme0 # print hme0 only
+END
+ exit 1;
+}
diff --git a/usr/src/cmd/nscd/Makefile b/usr/src/cmd/nscd/Makefile
index aa478fa3b0..1e51819bb2 100644
--- a/usr/src/cmd/nscd/Makefile
+++ b/usr/src/cmd/nscd/Makefile
@@ -29,6 +29,7 @@ MANIFEST= name-service-cache.xml
SVCMETHOD= svc-nscd
include ../Makefile.cmd
+include ../Makefile.ctf
ROOTMANIFESTDIR= $(ROOTSVCSYSTEM)
diff --git a/usr/src/cmd/nscd/svc-nscd b/usr/src/cmd/nscd/svc-nscd
index 0c6aa1bc4b..78b318bf87 100644
--- a/usr/src/cmd/nscd/svc-nscd
+++ b/usr/src/cmd/nscd/svc-nscd
@@ -23,8 +23,8 @@
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2012 Joyent, Inc. All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
. /lib/svc/share/smf_include.sh
@@ -51,7 +51,7 @@ if (smf_is_system_labeled); then
$SMF_FMRI`
fi
if [ "$duration" != "transient" ]; then
- ( while true ; do sleep 3600 ; done ) &
+ exit $SMF_EXIT_NODAEMON
fi
# The real daemon is not started in non-global zones,
diff --git a/usr/src/cmd/passwd/Makefile b/usr/src/cmd/passwd/Makefile
index 561357a16c..079e8b6050 100644
--- a/usr/src/cmd/passwd/Makefile
+++ b/usr/src/cmd/passwd/Makefile
@@ -33,6 +33,8 @@ lint := LDLIBS += -lpasswdutil
LDFLAGS += $(ZIGNORE)
LDLIBS += -lbsm -lpam -lnsl
+CPPFLAGS += -D__EXTENSIONS__
+
FILEMODE = 06555
XGETFLAGS += -a -x $(PROG).xcl
diff --git a/usr/src/cmd/perl/Makefile b/usr/src/cmd/perl/Makefile
index 73217fa083..b238abdc17 100644
--- a/usr/src/cmd/perl/Makefile
+++ b/usr/src/cmd/perl/Makefile
@@ -32,7 +32,7 @@ clean := TARGET = clean
test := TARGET = test
# PERL_LEGACY is versions of Perl still delivered through ON
-PERL_VERSIONS = 5.10.0
+PERL_VERSIONS = 5.12
.PARALLEL: $(PERL_VERSIONS)
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/PerlGcc/Makefile.PL b/usr/src/cmd/perl/contrib/Sun/Solaris/PerlGcc/Makefile.PL
index cbd36eb367..2f9a9dfeb1 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/PerlGcc/Makefile.PL
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/PerlGcc/Makefile.PL
@@ -22,6 +22,9 @@
#
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
+#
+# Copyright 2011 Joyent Inc
+#
require 5.8.4;
use strict;
@@ -51,6 +54,12 @@ my $pver = sprintf('%vd', $^V);
# Figure out the appropriate Config.pm. Use an older version if necessary.
my $perlarch = ($arch eq "sparc") ? "sun4-solaris-64int":"i86pc-solaris-64int";
+if (! -d "/usr/perl5/$pver") {
+ my ($maj, $min, $micro);
+ ($maj, $min, $micro) = split(/\./, $pver, 3);
+ $pver = join(".", $maj, $min);
+}
+
my $configpm = "/usr/perl5/$pver/lib/$perlarch/Config.pm";
if (! -f $configpm) {
my $p = "config/$pver";
diff --git a/usr/src/cmd/perl/skel/Makefile b/usr/src/cmd/perl/skel/Makefile
index 73f9ebdcbd..d759f6e91f 100644
--- a/usr/src/cmd/perl/skel/Makefile
+++ b/usr/src/cmd/perl/skel/Makefile
@@ -31,7 +31,7 @@ KEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES
# staging area to postprocess and install the result to $(ROOT)
STAGE = $(SRC)/cmd/perl/$(PERL_VERSION)/staging
-PERL=/usr/perl5/$(PERL_VERSION)/bin/perl
+PERL=$(ADJUNCT_PROTO)/usr/perl5/$(PERL_VERSION)/bin/perl
PERL_MM_ARGS = INSTALLDIRS=perl CC='$(CC)' LD='$(CC)'
diff --git a/usr/src/cmd/prstat/prsort.c b/usr/src/cmd/prstat/prsort.c
index cf7c250fe1..39ea28d893 100644
--- a/usr/src/cmd/prstat/prsort.c
+++ b/usr/src/cmd/prstat/prsort.c
@@ -22,10 +22,9 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libintl.h>
#include <stdlib.h>
#include <string.h>
@@ -38,10 +37,11 @@
void
list_alloc(list_t *list, int size)
{
- if (size > 0) {
- list->l_size = size;
+ list->l_size = size;
+ if (size > 0)
list->l_ptrs = Zalloc(sizeof (void *) * (size + 1));
- }
+ else
+ list->l_ptrs = NULL;
}
void
@@ -208,8 +208,11 @@ list_preinsert(list_t *list, void *ptr)
void
list_sort(list_t *list)
{
- (void) memset(list->l_ptrs, 0, sizeof (void *) * list->l_size);
list->l_used = 0;
+ if (list->l_size == 0)
+ return;
+
+ (void) memset(list->l_ptrs, 0, sizeof (void *) * list->l_size);
if (list->l_type == LT_LWPS) {
lwp_info_t *lwp = list->l_head;
diff --git a/usr/src/cmd/prstat/prstat.c b/usr/src/cmd/prstat/prstat.c
index 91a5eede04..8e4e18aafc 100644
--- a/usr/src/cmd/prstat/prstat.c
+++ b/usr/src/cmd/prstat/prstat.c
@@ -26,6 +26,7 @@
* Use is subject to license terms.
*
* Portions Copyright 2009 Chad Mynhier
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -236,7 +237,12 @@ list_getsize(list_t *list)
size_t i;
uint_t flags = 0;
int ret;
- size_t physmem = sysconf(_SC_PHYS_PAGES) * pagesize;
+ size_t physmem;
+
+ if (!(opts.o_outpmode & OPT_VMUSAGE))
+ return;
+
+ physmem = sysconf(_SC_PHYS_PAGES) * pagesize;
/*
* Determine what swap/rss results to calculate. getvmusage() will
@@ -367,6 +373,9 @@ list_print(list_t *list)
double loadavg[3] = {0, 0, 0};
int i, lwpid;
+ if (list->l_size == 0)
+ return;
+
if (foreach_element(&set_tbl, &loadavg, psetloadavg) == 0) {
/*
* If processor sets aren't specified, we display system-wide
@@ -1160,7 +1169,10 @@ setmovecur()
return;
}
if (opts.o_outpmode & OPT_SPLIT) {
- n = opts.o_ntop + opts.o_nbottom + 2;
+ if (opts.o_ntop == 0)
+ n = opts.o_nbottom + 1;
+ else
+ n = opts.o_ntop + opts.o_nbottom + 2;
} else {
if (opts.o_outpmode & OPT_USERS)
n = opts.o_nbottom + 1;
@@ -1380,7 +1392,7 @@ main(int argc, char **argv)
pagesize = sysconf(_SC_PAGESIZE);
while ((opt = getopt(argc, argv,
- "vcd:HmarRLtu:U:n:p:C:P:h:s:S:j:k:TJWz:Z")) != (int)EOF) {
+ "vVcd:HmarRLtu:U:n:p:C:P:h:s:S:j:k:TJWz:Z")) != (int)EOF) {
switch (opt) {
case 'r':
opts.o_outpmode |= OPT_NORESOLVE;
@@ -1434,6 +1446,8 @@ main(int argc, char **argv)
opts.o_ntop = Atoi(p);
if (p = strtok(NULL, ","))
opts.o_nbottom = Atoi(p);
+ else if (opts.o_ntop == 0)
+ opts.o_nbottom = 5;
opts.o_outpmode &= ~OPT_FULLSCREEN;
break;
case 's':
@@ -1458,6 +1472,9 @@ main(int argc, char **argv)
while (p = strtok(NULL, ", "))
add_uid(&ruid_tbl, p);
break;
+ case 'V':
+ opts.o_outpmode |= OPT_VMUSAGE;
+ break;
case 'p':
fill_table(&pid_tbl, optarg, 'p');
break;
@@ -1499,7 +1516,9 @@ main(int argc, char **argv)
if ((opts.o_outpmode & OPT_USERS) &&
!(opts.o_outpmode & OPT_SPLIT))
opts.o_nbottom = opts.o_ntop;
- if (opts.o_ntop == 0 || opts.o_nbottom == 0)
+ if (!(opts.o_outpmode & OPT_SPLIT) && opts.o_ntop == 0)
+ Die(gettext("invalid argument for -n\n"));
+ if (opts.o_nbottom == 0)
Die(gettext("invalid argument for -n\n"));
if (!(opts.o_outpmode & OPT_SPLIT) && (opts.o_outpmode & OPT_USERS) &&
((opts.o_outpmode & (OPT_PSINFO | OPT_MSACCT))))
diff --git a/usr/src/cmd/prstat/prstat.h b/usr/src/cmd/prstat/prstat.h
index 293123c5b9..bf38b3e2bd 100644
--- a/usr/src/cmd/prstat/prstat.h
+++ b/usr/src/cmd/prstat/prstat.h
@@ -26,6 +26,7 @@
* Use is subject to license terms.
*
* Portions Copyright 2009 Chad Mynhier
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#ifndef _PRSTAT_H
@@ -72,6 +73,7 @@ extern "C" {
#define OPT_ZONES 0x2000 /* report about zones */
#define OPT_PSETS 0x4000 /* report for specified psets */
#define OPT_LGRP 0x8000 /* report home lgroups */
+#define OPT_VMUSAGE 0x10000 /* print accurate, but expensive RSS */
#define OPT_UDATE 0x20000 /* print unix timestamp */
#define OPT_DDATE 0x40000 /* print timestamp in date(1) format */
#define OPT_NORESOLVE 0x80000 /* no nsswitch lookups */
diff --git a/usr/src/cmd/prstat/prutil.c b/usr/src/cmd/prstat/prutil.c
index 0f9cbd6c4d..7def1bd40b 100644
--- a/usr/src/cmd/prstat/prutil.c
+++ b/usr/src/cmd/prstat/prutil.c
@@ -25,6 +25,7 @@
* Use is subject to license terms.
*
* Portions Copyright 2009 Chad Mynhier
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -108,7 +109,7 @@ void
Usage()
{
(void) fprintf(stderr, gettext(
- "Usage:\tprstat [-acHJLmrRtTvWZ] [-u euidlist] [-U uidlist]\n"
+ "Usage:\tprstat [-acHJLmrRtTvVWZ] [-u euidlist] [-U uidlist]\n"
"\t[-p pidlist] [-P cpulist] [-C psrsetlist] [-h lgrouplist]\n"
"\t[-j projidlist] [-k taskidlist] [-z zoneidlist]\n"
"\t[-s key | -S key] [-n nprocs[,nusers]] [-d d|u]\n"
diff --git a/usr/src/cmd/prtconf/prtconf.c b/usr/src/cmd/prtconf/prtconf.c
index 551144976e..0982f1d40b 100644
--- a/usr/src/cmd/prtconf/prtconf.c
+++ b/usr/src/cmd/prtconf/prtconf.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2011, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -168,7 +169,7 @@ cleanup_path(const char *input_path, char *path)
#ifdef DEBUG
static const char *optstring = "abcdDvVxpPFf:M:dLuC";
#else
-static const char *optstring = "abcdDvVxpPFf:uC";
+static const char *optstring = "abcdDvVxmpPFf:uC";
#endif /* DEBUG */
int
@@ -201,6 +202,9 @@ main(int argc, char *argv[])
case 'v':
++opts.o_verbose;
break;
+ case 'm':
+ ++opts.o_memory;
+ break;
case 'p':
++opts.o_prominfo;
break;
@@ -338,34 +342,42 @@ main(int argc, char *argv[])
return (0);
}
- ret = sysinfo(SI_HW_PROVIDER, hw_provider, sizeof (hw_provider));
- /*
- * If 0 bytes are returned (the system returns '1', for the \0),
- * we're probably on x86, default to Oracle.
- */
- if (ret <= 1) {
- (void) strncpy(hw_provider, "Oracle Corporation",
+ if (!opts.o_memory) {
+ ret = sysinfo(SI_HW_PROVIDER, hw_provider,
sizeof (hw_provider));
+ /*
+ * If 0 bytes are returned (the system returns '1', for the \0),
+ * we're probably on x86, and there has been no si-hw-provider
+ * set in /etc/bootrc, default to Joyent.
+ */
+ if (ret <= 1) {
+ (void) strncpy(hw_provider, "Joyent",
+ sizeof (hw_provider));
+ }
+ (void) printf("System Configuration: %s %s\n", hw_provider,
+ opts.o_uts.machine);
}
- (void) printf("System Configuration: %s %s\n", hw_provider,
- opts.o_uts.machine);
pagesize = sysconf(_SC_PAGESIZE);
npages = sysconf(_SC_PHYS_PAGES);
- (void) printf("Memory size: ");
- if (pagesize == -1 || npages == -1)
- (void) printf("unable to determine\n");
- else {
- const int64_t kbyte = 1024;
+ if (pagesize == -1 || npages == -1) {
+ if (opts.o_memory) {
+ (void) printf("0\n");
+ return (1);
+ } else {
+ (void) printf("Memory size: unable to determine\n");
+ }
+ } else {
const int64_t mbyte = 1024 * 1024;
int64_t ii = (int64_t)pagesize * npages;
- if (ii >= mbyte)
- (void) printf("%ld Megabytes\n",
+ if (opts.o_memory) {
+ (void) printf("%ld\n", (long)((ii+mbyte-1) / mbyte));
+ return (0);
+ } else {
+ (void) printf("Memory size: %ld Megabytes\n",
(long)((ii+mbyte-1) / mbyte));
- else
- (void) printf("%ld Kilobytes\n",
- (long)((ii+kbyte-1) / kbyte));
+ }
}
if (opts.o_prominfo) {
diff --git a/usr/src/cmd/prtconf/prtconf.h b/usr/src/cmd/prtconf/prtconf.h
index 5f9abe968c..0284cc8af1 100644
--- a/usr/src/cmd/prtconf/prtconf.h
+++ b/usr/src/cmd/prtconf/prtconf.h
@@ -54,6 +54,7 @@ struct prt_opts {
int o_drv_name;
int o_pseudodevs;
int o_fbname;
+ int o_memory;
int o_noheader;
int o_prominfo;
int o_productinfo;
diff --git a/usr/src/cmd/psrset/psrset.c b/usr/src/cmd/psrset/psrset.c
index 35585499a9..41724137ef 100644
--- a/usr/src/cmd/psrset/psrset.c
+++ b/usr/src/cmd/psrset/psrset.c
@@ -22,6 +22,9 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
/*
* psrset - create and manage processor sets
@@ -41,6 +44,7 @@
#include <procfs.h>
#include <libproc.h>
#include <stdarg.h>
+#include <zone.h>
#if !defined(TEXT_DOMAIN) /* should be defined by cc -D */
#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */
@@ -69,6 +73,8 @@ static char nflag;
static char fflag;
static char Fflag;
static char eflag;
+static char zflag;
+static const char *zname;
extern int pset_assign_forced(psetid_t, processorid_t, psetid_t *);
@@ -128,7 +134,7 @@ rele_proc(struct ps_prochandle *Pr)
}
static void
-bind_err(psetid_t pset, id_t pid, id_t lwpid, int err)
+bind_err(psetid_t pset, const char *zname, id_t pid, id_t lwpid, int err)
{
char *msg;
@@ -145,7 +151,9 @@ bind_err(psetid_t pset, id_t pid, id_t lwpid, int err)
}
errno = err;
- if (lwpid == -1)
+ if (zname != NULL)
+ warn(gettext("cannot %s zone %s"), msg, zname);
+ else if (lwpid == -1)
warn(gettext("cannot %s pid %d"), msg, pid);
else
warn(gettext("cannot %s lwpid %d/%d"), msg, pid, lwpid);
@@ -281,7 +289,7 @@ bind_lwp(id_t pid, id_t lwpid, psetid_t pset)
psetid_t old_pset;
if (pset_bind_lwp(pset, lwpid, pid, &old_pset) != 0) {
- bind_err(pset, pid, lwpid, errno);
+ bind_err(pset, NULL, pid, lwpid, errno);
errors = ERR_FAIL;
}
if (errors != ERR_FAIL) {
@@ -491,7 +499,7 @@ query_all_proc(psinfo_t *psinfo, lwpsinfo_t *lwpsinfo, void *arg)
*/
if (errno == ESRCH)
return (0);
- bind_err(PS_QUERY, pid, -1, errno);
+ bind_err(PS_QUERY, NULL, pid, -1, errno);
errors = ERR_FAIL;
return (0);
}
@@ -542,6 +550,7 @@ usage(void)
"\t%1$s -r [-F] processor_id ...\n"
"\t%1$s -p [processorid ...]\n"
"\t%1$s -b processor_set_id pid[/lwpids] ...\n"
+ "\t%1$s -b -z zonename processor_set_id\n"
"\t%1$s -u pid[/lwpids] ...\n"
"\t%1$s -q [pid[/lwpids] ...]\n"
"\t%1$s -U [processor_set_id] ...\n"
@@ -574,23 +583,23 @@ do_lwps(id_t pid, const char *range, psetid_t pset)
if ((fd = open(procfile, O_RDONLY)) < 0) {
if (errno == ENOENT)
errno = ESRCH;
- bind_err(pset, pid, -1, errno);
+ bind_err(pset, NULL, pid, -1, errno);
return (ERR_FAIL);
}
if (pread(fd, &header, sizeof (header), 0) != sizeof (header)) {
(void) close(fd);
- bind_err(pset, pid, -1, errno);
+ bind_err(pset, NULL, pid, -1, errno);
return (ERR_FAIL);
}
nent = header.pr_nent;
size = header.pr_entsize * nent;
ptr = lpsinfo = malloc(size);
if (lpsinfo == NULL) {
- bind_err(pset, pid, -1, errno);
+ bind_err(pset, NULL, pid, -1, errno);
return (ERR_FAIL);
}
if (pread(fd, lpsinfo, size, sizeof (header)) != size) {
- bind_err(pset, pid, -1, errno);
+ bind_err(pset, NULL, pid, -1, errno);
free(lpsinfo);
(void) close(fd);
return (ERR_FAIL);
@@ -635,6 +644,7 @@ main(int argc, char *argv[])
id_t pid;
processorid_t cpu;
psetid_t pset, old_pset;
+ zoneid_t zid;
char *errptr;
progname = argv[0]; /* put actual command name in messages */
@@ -642,7 +652,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_ALL, ""); /* setup localization */
(void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "cdFarpibqQuUnfe")) != EOF) {
+ while ((c = getopt(argc, argv, "cdFarpibqQuUnfez:")) != EOF) {
switch (c) {
case 'c':
cflag = 1;
@@ -693,6 +703,19 @@ main(int argc, char *argv[])
case 'n':
nflag = 1;
break;
+ case 'z':
+ if (!bflag) {
+ warn(gettext("-z can only be used after -b\n"));
+ return (usage());
+ }
+ if (zflag) {
+ warn(gettext("-z can only be specified "
+ "once\n"));
+ return (usage());
+ }
+ zflag = 1;
+ zname = optarg;
+ break;
default:
return (usage());
}
@@ -859,9 +882,28 @@ main(int argc, char *argv[])
/*
* Perform function for each pid/lwpid specified.
*/
- if (argc == 0) {
+ if (argc == 0 && !zflag) {
warn(gettext("must specify at least one pid\n"));
return (usage());
+ } else if (argc > 0 && zflag) {
+ warn(gettext("cannot specify extra pids with -z\n"));
+ return (usage());
+ }
+
+ if (zflag) {
+ zid = getzoneidbyname(zname);
+ if (zid < 0) {
+ warn(gettext("invalid zone name: %s\n"),
+ zname);
+ errors = ERR_FAIL;
+ } else if (pset_bind(pset, P_ZONEID, zid,
+ &old_pset) < 0) {
+ bind_err(pset, zname, -1, -1, errno);
+ errors = ERR_FAIL;
+ } else {
+ (void) printf(gettext("zone %s: bound to %d\n"),
+ zname, pset);
+ }
}
/*
@@ -902,7 +944,7 @@ main(int argc, char *argv[])
*/
if (pset_bind(pset, P_PID, pid,
&old_pset) < 0) {
- bind_err(pset, pid, -1, errno);
+ bind_err(pset, NULL, pid, -1, errno);
errors = ERR_FAIL;
continue;
}
diff --git a/usr/src/cmd/ptools/Makefile.bld b/usr/src/cmd/ptools/Makefile.bld
index f5b50f5ea1..9b8716f590 100644
--- a/usr/src/cmd/ptools/Makefile.bld
+++ b/usr/src/cmd/ptools/Makefile.bld
@@ -26,6 +26,8 @@
PROG:sh = basename `cd ..; pwd`
+include ../../../Makefile.ctf
+
OBJS = $(PROG).o
SRCS = ../$(PROG).c
@@ -99,12 +101,15 @@ INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
elfcap.o: $(ELFCAP)/elfcap.c
$(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
+ $(POST_PROCESS_O)
pmap_common.o: $(PMAP)/pmap_common.c
$(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
+ $(POST_PROCESS_O)
%.o: ../%.c
$(COMPILE.c) $<
+ $(POST_PROCESS_O)
all: $(PROG)
diff --git a/usr/src/cmd/ptools/ptime/ptime.c b/usr/src/cmd/ptools/ptime/ptime.c
index bc862cddb8..c3a05ff51c 100644
--- a/usr/src/cmd/ptools/ptime/ptime.c
+++ b/usr/src/cmd/ptools/ptime/ptime.c
@@ -24,6 +24,9 @@
*
* Portions Copyright 2008 Chad Mynhier
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <stdio.h>
#include <stdlib.h>
@@ -55,16 +58,39 @@ static char procname[64];
static int Fflag;
static int mflag;
static int errflg;
+static int pflag;
+
+static int
+ptime_pid(const char *pidstr)
+{
+ struct ps_prochandle *Pr;
+ pid_t pid;
+ int gret;
+
+ if ((Pr = proc_arg_grab(pidstr, PR_ARG_PIDS,
+ Fflag | PGRAB_RDONLY, &gret)) == NULL) {
+ (void) fprintf(stderr, "%s: cannot examine %s: %s\n",
+ command, pidstr, Pgrab_error(gret));
+ return (1);
+ }
+
+ pid = Pstatus(Pr)->pr_pid;
+ (void) sprintf(procname, "%d", (int)pid); /* for perr() */
+ (void) look(pid);
+ Prelease(Pr, 0);
+ return (0);
+}
int
main(int argc, char **argv)
{
- int opt;
+ int opt, exit;
pid_t pid;
struct siginfo info;
int status;
int gret;
struct ps_prochandle *Pr;
+ char *pp, *np;
if ((command = strrchr(argv[0], '/')) != NULL)
command++;
@@ -80,6 +106,7 @@ main(int argc, char **argv)
mflag = 1;
break;
case 'p':
+ pflag = 1;
pidarg = optarg;
break;
default:
@@ -93,63 +120,70 @@ main(int argc, char **argv)
if (((pidarg != NULL) ^ (argc < 1)) || errflg) {
(void) fprintf(stderr,
- "usage:\t%s [-mh] [-p pid | command [ args ... ]]\n",
+ "usage:\t%s [-mh] [-p pidlist | command [ args ... ]]\n",
command);
(void) fprintf(stderr,
" (time a command using microstate accounting)\n");
return (1);
}
- if (pidarg != NULL) {
- if ((Pr = proc_arg_grab(pidarg, PR_ARG_PIDS,
- Fflag | PGRAB_RDONLY, &gret)) == NULL) {
- (void) fprintf(stderr, "%s: cannot examine %s: %s\n",
- command, pidarg, Pgrab_error(gret));
- return (1);
- }
- } else {
- if ((Pr = Pcreate(argv[0], &argv[0], &gret, NULL, 0)) == NULL) {
- (void) fprintf(stderr, "%s: failed to exec %s: %s\n",
- command, argv[0], Pcreate_error(gret));
- return (1);
- }
- if (Psetrun(Pr, 0, 0) == -1) {
- (void) fprintf(stderr, "%s: failed to set running %s: "
- "%s\n", command, argv[0], strerror(errno));
- return (1);
+ if (pflag) {
+ exit = 0;
+ (void) signal(SIGINT, SIG_IGN);
+ (void) signal(SIGQUIT, SIG_IGN);
+ pp = pidarg;
+ if ((np = strchr(pp, ' ')) != NULL ||
+ (np = strchr(pp, ',')) != NULL)
+ pflag++;
+ while (np != NULL) {
+ *np = '\0';
+ exit |= ptime_pid(pp);
+ pp = np + 1;
+ np = strchr(pp, ' ');
+ if (np == NULL)
+ np = strchr(pp, ',');
}
+ exit |= ptime_pid(pp);
+ return (exit);
+ }
+
+
+ if ((Pr = Pcreate(argv[0], &argv[0], &gret, NULL, 0)) == NULL) {
+ (void) fprintf(stderr, "%s: failed to exec %s: %s\n",
+ command, argv[0], Pcreate_error(gret));
+ return (1);
+ }
+ if (Psetrun(Pr, 0, 0) == -1) {
+ (void) fprintf(stderr, "%s: failed to set running %s: "
+ "%s\n", command, argv[0], strerror(errno));
+ return (1);
}
pid = Pstatus(Pr)->pr_pid;
+
(void) sprintf(procname, "%d", (int)pid); /* for perr() */
(void) signal(SIGINT, SIG_IGN);
(void) signal(SIGQUIT, SIG_IGN);
- if (pidarg == NULL)
- (void) waitid(P_PID, pid, &info, WEXITED | WNOWAIT);
+ (void) waitid(P_PID, pid, &info, WEXITED | WNOWAIT);
(void) look(pid);
- if (pidarg != NULL) {
- Prelease(Pr, 0);
- return (0);
- } else {
- (void) waitpid(pid, &status, 0);
+ (void) waitpid(pid, &status, 0);
- if (WIFEXITED(status))
- return (WEXITSTATUS(status));
+ if (WIFEXITED(status))
+ return (WEXITSTATUS(status));
- if (WIFSIGNALED(status)) {
- int sig = WTERMSIG(status);
- char name[SIG2STR_MAX];
+ if (WIFSIGNALED(status)) {
+ int sig = WTERMSIG(status);
+ char name[SIG2STR_MAX];
- (void) fprintf(stderr, "%s: command terminated "
- "abnormally by %s\n", command,
- proc_signame(sig, name, sizeof (name)));
- }
-
- return (status | WCOREFLG); /* see time(1) */
+ (void) fprintf(stderr, "%s: command terminated "
+ "abnormally by %s\n", command,
+ proc_signame(sig, name, sizeof (name)));
}
+
+ return (status | WCOREFLG); /* see time(1) */
}
static int
@@ -187,6 +221,9 @@ look(pid_t pid)
tsadd(&sys, &sys, &pup->pr_ttime);
(void) fprintf(stderr, "\n");
+ if (pflag > 1)
+ (void) fprintf(stderr, "%d:\t%.70s\n",
+ (int)psinfo.pr_pid, psinfo.pr_psargs);
prtime("real", &real);
prtime("user", &user);
prtime("sys", &sys);
diff --git a/usr/src/cmd/rcap/common/utils.c b/usr/src/cmd/rcap/common/utils.c
index 799fdcef23..dd511c7c50 100644
--- a/usr/src/cmd/rcap/common/utils.c
+++ b/usr/src/cmd/rcap/common/utils.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#include <sys/param.h>
@@ -257,77 +258,3 @@ xatoi(char *p)
return (i);
}
}
-
-/*
- * get_running_zones() calls zone_list(2) to find out how many zones are
- * running. It then calls zone_list(2) again to fetch the list of running
- * zones (stored in *zents).
- */
-int
-get_running_zones(uint_t *nzents, zone_entry_t **zents)
-{
- zoneid_t *zids;
- uint_t nzents_saved;
- int i;
- zone_entry_t *zentp;
- zone_state_t zstate;
-
- *zents = NULL;
- if (zone_list(NULL, nzents) != 0) {
- warn(gettext("could not get zoneid list\n"));
- return (E_ERROR);
- }
-
-again:
- if (*nzents == 0)
- return (E_SUCCESS);
-
- if ((zids = (zoneid_t *)calloc(*nzents, sizeof (zoneid_t))) == NULL) {
- warn(gettext("out of memory: zones will not be capped\n"));
- return (E_ERROR);
- }
-
- nzents_saved = *nzents;
-
- if (zone_list(zids, nzents) != 0) {
- warn(gettext("could not get zone list\n"));
- free(zids);
- return (E_ERROR);
- }
- if (*nzents != nzents_saved) {
- /* list changed, try again */
- free(zids);
- goto again;
- }
-
- *zents = calloc(*nzents, sizeof (zone_entry_t));
- if (*zents == NULL) {
- warn(gettext("out of memory: zones will not be capped\n"));
- free(zids);
- return (E_ERROR);
- }
-
- zentp = *zents;
- for (i = 0; i < *nzents; i++) {
- char name[ZONENAME_MAX];
-
- if (getzonenamebyid(zids[i], name, sizeof (name)) < 0) {
- warn(gettext("could not get name for "
- "zoneid %d\n"), zids[i]);
- continue;
- }
-
- (void) strlcpy(zentp->zname, name, sizeof (zentp->zname));
- zentp->zid = zids[i];
- if (zone_get_state(name, &zstate) != Z_OK ||
- zstate != ZONE_STATE_RUNNING)
- continue;
-
-
- zentp++;
- }
- *nzents = zentp - *zents;
-
- free(zids);
- return (E_SUCCESS);
-}
diff --git a/usr/src/cmd/rcap/common/utils.h b/usr/src/cmd/rcap/common/utils.h
index 7196cfb4ce..cf2e17c080 100644
--- a/usr/src/cmd/rcap/common/utils.h
+++ b/usr/src/cmd/rcap/common/utils.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#ifndef _UTILS_H
@@ -98,7 +99,6 @@ extern void vdprintfe(int, const char *, va_list);
extern void dprintfe(int, char *, ...);
extern void hrt2ts(hrtime_t, timestruc_t *);
extern int xatoi(char *);
-extern int get_running_zones(uint_t *, zone_entry_t **);
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/rcap/rcapadm/rcapadm.c b/usr/src/cmd/rcap/rcapadm/rcapadm.c
index 92888b2071..b92115469a 100644
--- a/usr/src/cmd/rcap/rcapadm/rcapadm.c
+++ b/usr/src/cmd/rcap/rcapadm/rcapadm.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -145,20 +146,29 @@ out:
scf_handle_destroy(h);
}
+static int
+set_zone_cap(char *zonename, uint64_t mcap)
+{
+ char cmd[128 + ZONENAME_MAX];
+
+ (void) snprintf(cmd, sizeof (cmd), "/usr/bin/prctl -r "
+ "-n zone.max-physical-memory -v %llu -i zone %s", mcap, zonename);
+ return (system(cmd));
+}
+
/*
* Update the in-kernel memory cap for the specified zone.
*/
static int
update_zone_mcap(char *zonename, char *maxrss)
{
- zoneid_t zone_id;
uint64_t num;
if (getzoneid() != GLOBAL_ZONEID || zonecfg_in_alt_root())
return (E_SUCCESS);
/* get the running zone from the kernel */
- if ((zone_id = getzoneidbyname(zonename)) == -1) {
+ if (getzoneidbyname(zonename) == -1) {
(void) fprintf(stderr, gettext("zone '%s' must be running\n"),
zonename);
return (E_ERROR);
@@ -169,7 +179,7 @@ update_zone_mcap(char *zonename, char *maxrss)
return (E_ERROR);
}
- if (zone_setattr(zone_id, ZONE_ATTR_PHYS_MCAP, &num, 0) == -1) {
+ if (set_zone_cap(zonename, num) == -1) {
(void) fprintf(stderr, gettext("could not set memory "
"cap for zone '%s'\n"), zonename);
return (E_ERROR);
diff --git a/usr/src/cmd/rcap/rcapd/rcapd_collection_zone.c b/usr/src/cmd/rcap/rcapd/rcapd_collection_zone.c
index db86aa6276..88403dda37 100644
--- a/usr/src/cmd/rcap/rcapd/rcapd_collection_zone.c
+++ b/usr/src/cmd/rcap/rcapd/rcapd_collection_zone.c
@@ -21,16 +21,17 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <procfs.h>
#include <project.h>
#include <stdlib.h>
#include <strings.h>
#include <zone.h>
#include <libzonecfg.h>
+#include <dirent.h>
+#include <libproc.h>
#include "rcapd.h"
#include "utils.h"
@@ -39,61 +40,117 @@ extern boolean_t gz_capped;
/* round up to next y = 2^n */
#define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
-static void
-update_zone(zone_entry_t *zent, void *walk_data)
+static struct ps_prochandle *
+grab_zone_proc(zoneid_t zid)
{
- void(*update_notification_cb)(char *, char *, int, uint64_t, int) =
- (void(*)(char *, char *, int, uint64_t, int))walk_data;
- int changes;
- int64_t max_rss;
+ DIR *dirp;
+ struct dirent *dentp;
+ int pid, pid_self, tmp;
+ psinfo_t psinfo;
+ struct ps_prochandle *pr = NULL;
+
+ pid_self = getpid();
+
+ if ((dirp = opendir("/proc")) == NULL)
+ return (NULL);
+
+ while (dentp = readdir(dirp)) {
+ pid = atoi(dentp->d_name);
+
+ /* Skip self */
+ if (pid == pid_self)
+ continue;
+
+ if (proc_get_psinfo(pid, &psinfo) != 0)
+ continue;
+
+ if (psinfo.pr_zoneid != zid)
+ continue;
+
+ /* attempt to grab process */
+ if ((pr = Pgrab(pid, 0, &tmp)) != NULL) {
+ if (Psetflags(pr, PR_RLC) != 0) {
+ Prelease(pr, 0);
+ }
+ if (Pcreate_agent(pr) == 0) {
+ if (pr_getzoneid(pr) != zid) {
+ Prelease(pr, 0);
+ continue;
+ }
+
+ (void) closedir(dirp);
+ return (pr);
+ } else {
+ Prelease(pr, 0);
+ }
+ }
+ }
+
+ (void) closedir(dirp);
+ return (NULL);
+}
+
+static uint64_t
+get_zone_cap(zoneid_t zid)
+{
+ rctlblk_t *rblk;
uint64_t mcap;
- lcollection_t *lcol;
- rcid_t colid;
+ struct ps_prochandle *pr;
- if (zone_getattr(zent->zid, ZONE_ATTR_PHYS_MCAP, &mcap,
- sizeof (mcap)) != -1 && mcap != 0)
- max_rss = ROUNDUP(mcap, 1024) / 1024;
- else
- max_rss = 0;
-
- if (zent->zid == GLOBAL_ZONEID) {
- if (max_rss > 0)
- gz_capped = B_TRUE;
- else
- gz_capped = B_FALSE;
+ if ((rblk = (rctlblk_t *)malloc(rctlblk_size())) == NULL)
+ return (UINT64_MAX);
+
+ if ((pr = grab_zone_proc(zid)) == NULL) {
+ free(rblk);
+ return (UINT64_MAX);
}
+ if (pr_getrctl(pr, "zone.max-physical-memory", NULL, rblk,
+ RCTL_FIRST)) {
+ Pdestroy_agent(pr);
+ Prelease(pr, 0);
+ free(rblk);
+ return (UINT64_MAX);
+ }
- colid.rcid_type = RCIDT_ZONE;
- colid.rcid_val = zent->zid;
+ Pdestroy_agent(pr);
+ Prelease(pr, 0);
- lcol = lcollection_insert_update(&colid, max_rss, zent->zname,
- &changes);
- if (update_notification_cb != NULL)
- update_notification_cb("zone", zent->zname, changes, max_rss,
- (lcol != NULL) ? lcol->lcol_mark : 0);
+ mcap = rctlblk_get_value(rblk);
+ free(rblk);
+ return (mcap);
}
-
+/*
+ * For zones, rcapd only caps the global zone, since each non-global zone
+ * caps itself.
+ */
/* ARGSUSED */
void
lcollection_update_zone(lcollection_update_type_t ut,
void(*update_notification_cb)(char *, char *, int, uint64_t, int))
{
- int i;
- uint_t nzents;
- zone_entry_t *zents;
-
- /*
- * Enumerate running zones.
- */
- if (get_running_zones(&nzents, &zents) != 0)
- return;
-
- for (i = 0; i < nzents; i++) {
- update_zone(&zents[i], (void *)update_notification_cb);
+ int changes;
+ int64_t max_rss;
+ uint64_t mcap;
+ lcollection_t *lcol;
+ rcid_t colid;
+ mcap = get_zone_cap(GLOBAL_ZONEID);
+ if (mcap != 0 && mcap != UINT64_MAX) {
+ max_rss = ROUNDUP(mcap, 1024) / 1024;
+ gz_capped = B_TRUE;
+ } else {
+ max_rss = UINT64_MAX / 1024;
+ gz_capped = B_FALSE;
}
- free(zents);
+ colid.rcid_type = RCIDT_ZONE;
+ colid.rcid_val = GLOBAL_ZONEID;
+
+ lcol = lcollection_insert_update(&colid, max_rss, GLOBAL_ZONENAME,
+ &changes);
+ if (update_notification_cb != NULL)
+ update_notification_cb("zone", GLOBAL_ZONENAME, changes,
+ max_rss, (lcol != NULL) ? lcol->lcol_mark : 0);
}
diff --git a/usr/src/cmd/rcap/rcapd/rcapd_scanner.c b/usr/src/cmd/rcap/rcapd/rcapd_scanner.c
index b39811b552..254bb9e922 100644
--- a/usr/src/cmd/rcap/rcapd/rcapd_scanner.c
+++ b/usr/src/cmd/rcap/rcapd/rcapd_scanner.c
@@ -21,6 +21,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -551,7 +552,7 @@ pageout(pid_t pid, struct ps_prochandle *Pr, caddr_t start, caddr_t end)
errno = 0;
res = pr_memcntl(Pr, start, (end - start), MC_SYNC,
- (caddr_t)(MS_ASYNC | MS_INVALIDATE), 0, 0);
+ (caddr_t)(MS_ASYNC | MS_INVALCURPROC), 0, 0);
debug_high("pr_memcntl [%p-%p): %d", (void *)start, (void *)end, res);
/*
diff --git a/usr/src/cmd/rcap/rcapstat/rcapstat.c b/usr/src/cmd/rcap/rcapstat/rcapstat.c
index fb83f861ae..c97b6a14f7 100644
--- a/usr/src/cmd/rcap/rcapstat/rcapstat.c
+++ b/usr/src/cmd/rcap/rcapstat/rcapstat.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -72,6 +73,8 @@ typedef struct col {
static col_t *col_head;
static int ncol;
+#define RCAPD_NA "rcapd is not active (try zonememstat)\n"
+
static col_t *
col_find(rcid_t id)
{
@@ -152,7 +155,7 @@ read_stats(rcid_type_t stat_type)
struct stat st;
if ((fd = open(STAT_FILE_DEFAULT, O_RDONLY)) < 0) {
- warn(gettext("rcapd is not active\n"));
+ warn(gettext(RCAPD_NA));
return (E_ERROR);
}
@@ -173,7 +176,7 @@ read_stats(rcid_type_t stat_type)
pid = hdr.rs_pid;
(void) snprintf(procfile, 20, "/proc/%lld/psinfo", pid);
if ((proc_fd = open(procfile, O_RDONLY)) < 0) {
- warn(gettext("rcapd is not active\n"));
+ warn(gettext(RCAPD_NA));
(void) close(fd);
return (E_ERROR);
}
diff --git a/usr/src/cmd/rcm_daemon/Makefile.com b/usr/src/cmd/rcm_daemon/Makefile.com
index 4b12d1cd27..59e6e49371 100644
--- a/usr/src/cmd/rcm_daemon/Makefile.com
+++ b/usr/src/cmd/rcm_daemon/Makefile.com
@@ -56,7 +56,6 @@ COMMON_MOD_SRC = \
$(COMMON)/pool_rcm.c \
$(COMMON)/mpxio_rcm.c \
$(COMMON)/ip_anon_rcm.c \
- $(COMMON)/svm_rcm.c \
$(COMMON)/bridge_rcm.c
sparc_MOD_SRC = $(COMMON)/ttymux_rcm.c
@@ -82,7 +81,6 @@ COMMON_MOD_OBJ = \
pool_rcm.o \
mpxio_rcm.o \
ip_anon_rcm.o \
- svm_rcm.o \
bridge_rcm.o
sparc_MOD_OBJ = ttymux_rcm.o
@@ -103,7 +101,6 @@ COMMON_RCM_MODS = \
SUNW_pool_rcm.so \
SUNW_mpxio_rcm.so \
SUNW_ip_anon_rcm.so \
- SUNW_svm_rcm.so \
SUNW_bridge_rcm.so
sparc_RCM_MODS = SUNW_ttymux_rcm.so
@@ -132,7 +129,6 @@ LINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
LDLIBS_MODULES =
SUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
-SUNW_svm_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lmeta
SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
SUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
diff --git a/usr/src/cmd/sed/main.c b/usr/src/cmd/sed/main.c
index 204583b877..dc3ef02619 100644
--- a/usr/src/cmd/sed/main.c
+++ b/usr/src/cmd/sed/main.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com>
* Copyright (c) 2011 Gary Mills
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 1992 Diomidis Spinellis.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -42,9 +42,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <getopt.h>
#include <libgen.h>
-#include <libintl.h>
#include <limits.h>
#include <locale.h>
#include <regex.h>
@@ -53,6 +51,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <libintl.h>
#include "defs.h"
#include "extern.h"
@@ -107,11 +106,6 @@ static char tmpfname[PATH_MAX]; /* Temporary file name (for in-place editing) */
static const char *inplace; /* Inplace edit file extension. */
ulong_t linenum;
-static const struct option lopts[] = {
- {"in-place", optional_argument, NULL, 'i'},
- {NULL, 0, NULL, 0}
-};
-
static void add_compunit(enum e_cut, char *);
static void add_file(char *);
static void usage(void);
@@ -133,18 +127,14 @@ main(int argc, char *argv[])
fflag = 0;
inplace = NULL;
- while ((c = getopt_long(argc, argv, "EI::ae:f:i::lnr", lopts, NULL)) !=
- -1)
+ while ((c = getopt(argc, argv, "EI:ae:f:i:lnr")) != -1)
switch (c) {
case 'r': /* Gnu sed compat */
case 'E':
rflags = REG_EXTENDED;
break;
case 'I':
- if (optarg != NULL)
- inplace = optarg;
- else
- inplace = "";
+ inplace = optarg;
ispan = 1; /* span across input files */
break;
case 'a':
@@ -161,10 +151,7 @@ main(int argc, char *argv[])
add_compunit(CU_FILE, optarg);
break;
case 'i':
- if (optarg != NULL)
- inplace = optarg;
- else
- inplace = "";
+ inplace = optarg;
ispan = 0; /* don't span across input files */
break;
case 'l':
@@ -205,8 +192,8 @@ main(int argc, char *argv[])
static void
usage(void)
{
- (void) fputs(_("usage: sed script [-Ealn] [-i[extension]] [file...]\n"
- " sed [-Ealn] [-i[extension]] [-e script]... "
+ (void) fputs(_("usage: sed script [-Ealn] [-i extension] [file...]\n"
+ " sed [-Ealn] [-i extension] [-e script]... "
"[-f script_file]... [file...]\n"),
stderr);
exit(1);
diff --git a/usr/src/cmd/sendmail/src/Makefile b/usr/src/cmd/sendmail/src/Makefile
index 92223ef71a..bb4664ead3 100644
--- a/usr/src/cmd/sendmail/src/Makefile
+++ b/usr/src/cmd/sendmail/src/Makefile
@@ -46,7 +46,7 @@ LDFLAGS += $(MAPFILES:%=-M%)
LDLIBS += ../libsmutil/libsmutil.a ../libsm/libsm.a -lresolv -lsocket \
-lnsl ../db/libdb.a -lldap -lsldap -lwrap -lumem \
- -lssl -lcrypto -lsasl
+ -lsunw_ssl -lsunw_crypto -lsasl
INCPATH= -I. -I../include -I../db
diff --git a/usr/src/cmd/sgs/elfdump/Makefile.targ b/usr/src/cmd/sgs/elfdump/Makefile.targ
index 5eda4d1b47..b763a3faf0 100644
--- a/usr/src/cmd/sgs/elfdump/Makefile.targ
+++ b/usr/src/cmd/sgs/elfdump/Makefile.targ
@@ -60,6 +60,8 @@ delete:
package \
install: all $(VAR_SGSBINPROG) $(VAR_SGSCCSLINK)
+ -$(RM) $(ROOTPROG)
+ -$(LN) $(ISAEXEC) $(ROOTPROG)
.PARALLEL: $(LINTOUT32) $(LINTOUT64)
diff --git a/usr/src/cmd/sgs/elfdump/amd64/Makefile b/usr/src/cmd/sgs/elfdump/amd64/Makefile
index 906b6b6754..fdcf09abed 100644
--- a/usr/src/cmd/sgs/elfdump/amd64/Makefile
+++ b/usr/src/cmd/sgs/elfdump/amd64/Makefile
@@ -39,6 +39,8 @@ LINTFLAGS64 += $(VAR_LINTFLAGS64)
VAR_SGSBINPROG= $(VAR_SGSBINPROG64)
VAR_SGSCCSLINK= $(VAR_SGSCCSLINK64)
+install: all $(ROOTPROG64)
+
include ../Makefile.targ
include ../../Makefile.sub.64
diff --git a/usr/src/cmd/sgs/elfdump/i386/Makefile b/usr/src/cmd/sgs/elfdump/i386/Makefile
index 607c8a31ce..31fd227274 100644
--- a/usr/src/cmd/sgs/elfdump/i386/Makefile
+++ b/usr/src/cmd/sgs/elfdump/i386/Makefile
@@ -30,4 +30,6 @@ include ../Makefile.com
.KEEP_STATE:
+install: all $(ROOTPROG32)
+
include ../Makefile.targ
diff --git a/usr/src/cmd/sgs/lex/common/main.c b/usr/src/cmd/sgs/lex/common/main.c
index 17ba4808a4..a1fd526cf9 100644
--- a/usr/src/cmd/sgs/lex/common/main.c
+++ b/usr/src/cmd/sgs/lex/common/main.c
@@ -30,11 +30,15 @@
/* Copyright 1976, Bell Telephone Laboratories, Inc. */
+/* Copyright (c) 2013, joyent, Inc. All rights reserved. */
+
#include <string.h>
#include "once.h"
#include "sgs.h"
#include <locale.h>
#include <limits.h>
+#include <unistd.h>
+#include <libgen.h>
static wchar_t L_INITIAL[] = {'I', 'N', 'I', 'T', 'I', 'A', 'L', 0};
static void get1core(void);
@@ -46,6 +50,25 @@ static void get3core(void);
static void free3core(void);
#endif
+static int
+lex_construct_path(char *buf, size_t size, const char *file, int type)
+{
+ int ret;
+ char origin[PATH_MAX];
+
+ if (type != 0) {
+ ret = readlink("/proc/self/path/a.out", origin, PATH_MAX - 1);
+ if (ret < 0)
+ error(
+ "lex: failed to read origin from /proc\n");
+ origin[ret] = '\0';
+ return (snprintf(buf, size, "%s/../%s/%s", dirname(origin),
+ NBASE, file));
+ }
+
+ return (snprintf(buf, size, "%s/%s/%s", NPREFIX, NBASE, file));
+}
+
int
main(int argc, char **argv)
{
@@ -53,6 +76,7 @@ main(int argc, char **argv)
int c;
char *apath = NULL;
char *ypath;
+ char pathbuf[PATH_MAX];
Boolean eoption = 0, woption = 0;
sargv = argv;
@@ -224,6 +248,11 @@ main(int argc, char **argv)
free3core();
#endif
+ /*
+ * Try to find the file relative to $ORIGIN. Note that we don't touch
+ * antyhing related to -Y. In fact, unfortunately it's always been
+ * ignored it seems.
+ */
if (handleeuc) {
if (ratfor)
error("Ratfor is not supported by -w or -e option.");
@@ -232,9 +261,19 @@ main(int argc, char **argv)
else
ypath = ratfor ? RATNAME : CNAME;
- if (apath != NULL)
- ypath = strcat(apath, strrchr(ypath, '/'));
- fother = fopen(ypath, "r");
+ if (apath == NULL) {
+ (void) lex_construct_path(pathbuf, sizeof (pathbuf), ypath, 1);
+ fother = fopen(pathbuf, "r");
+ if (fother == NULL) {
+ (void) lex_construct_path(pathbuf, sizeof (pathbuf),
+ ypath, 0);
+ fother = fopen(pathbuf, "r");
+ }
+ } else {
+ apath = strcat(apath, "/");
+ ypath = strcat(apath, ypath);
+ fother = fopen(ypath, "r");
+ }
if (fother == NULL)
error("Lex driver missing, file %s", ypath);
while ((i = getc(fother)) != EOF)
diff --git a/usr/src/cmd/sgs/lex/common/once.h b/usr/src/cmd/sgs/lex/common/once.h
index 014ca00b17..9e4b0e5e00 100644
--- a/usr/src/cmd/sgs/lex/common/once.h
+++ b/usr/src/cmd/sgs/lex/common/once.h
@@ -26,11 +26,11 @@
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
+/* Copyright (c) 2013, joyent, Inc. All rights reserved. */
+
#ifndef _ONCE_H
#define _ONCE_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ldefs.h"
/* once.c */
@@ -73,9 +73,11 @@ int peek = '\n'; /* next input character */
CHR *pushptr = pushc;
CHR *slptr = slist;
-#define CNAME "/usr/share/lib/ccs/ncform"
-#define RATNAME "/usr/share/lib/ccs/nrform"
-#define EUCNAME "/usr/share/lib/ccs/nceucform"
+#define NPREFIX "/usr"
+#define NBASE "/share/lib/ccs/"
+#define CNAME "ncform"
+#define RATNAME "nrform"
+#define EUCNAME "nceucform"
int ccount = 1;
int casecount = 1;
diff --git a/usr/src/cmd/sgs/lorder/lorder.sh b/usr/src/cmd/sgs/lorder/lorder.sh
index 4b518e3d61..bea4cd4804 100644
--- a/usr/src/cmd/sgs/lorder/lorder.sh
+++ b/usr/src/cmd/sgs/lorder/lorder.sh
@@ -36,7 +36,7 @@ else
fi
trap "rm -f $TDIR/$$symdef $TDIR/$$symref $TDIR/$$tmp; exit" 1 2 13 15
PFX=
-WHERE=/usr/ccs/bin
+WHERE=/usr/bin
USAGE="Usage: ${PFX}lorder file ..."
for i in "$@"
diff --git a/usr/src/cmd/sgs/yacc/common/dextern.h b/usr/src/cmd/sgs/yacc/common/dextern.h
index e90aa60468..54b441cac4 100644
--- a/usr/src/cmd/sgs/yacc/common/dextern.h
+++ b/usr/src/cmd/sgs/yacc/common/dextern.h
@@ -26,11 +26,13 @@
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
#ifndef _DEXTERN_H
#define _DEXTERN_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <inttypes.h>
#include <ctype.h>
@@ -42,6 +44,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <wctype.h>
+#include <limits.h>
#ifdef __cplusplus
extern "C" {
@@ -301,6 +304,12 @@ extern int wscmp(const wchar_t *, const wchar_t *);
extern char *parser;
+#ifndef PBUFSIZE
+#define PBUFSIZE PATH_MAX
+#endif
+
+extern char pbuf[PBUFSIZE];
+
/* default settings for a number of macros */
/* name of yacc tempfiles */
@@ -324,7 +333,11 @@ extern char *parser;
#endif
#ifndef PARSER
-#define PARSER "/usr/share/lib/ccs/yaccpar"
+#define PARSER "/share/lib/ccs/yaccpar"
+#endif
+
+#ifndef PARSERPREFIX
+#define PARSERPREFIX "/usr"
#endif
/*
diff --git a/usr/src/cmd/sgs/yacc/common/y1.c b/usr/src/cmd/sgs/yacc/common/y1.c
index 845f82d367..0e67d9047b 100644
--- a/usr/src/cmd/sgs/yacc/common/y1.c
+++ b/usr/src/cmd/sgs/yacc/common/y1.c
@@ -26,7 +26,9 @@
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include "dextern.h"
#include <sys/param.h>
@@ -34,6 +36,7 @@
#include <unistd.h>
#include <locale.h>
#include <stdarg.h> /* For error() */
+#include <libgen.h>
static void mktbls(void);
static void others(void);
@@ -236,6 +239,25 @@ mktbls()
lsetsize = INIT_LSIZE + 1;
}
+static int
+yacc_assemble_path(char *buf, size_t size, const char *file, int type)
+{
+ int ret;
+ char origin[PATH_MAX];
+
+ if (type != 0) {
+ ret = readlink("/proc/self/path/a.out", origin, PATH_MAX - 1);
+ if (ret < 0)
+ error(gettext(
+ "yacc: failed to read origin from /proc\n"));
+ origin[ret] = '\0';
+ return (snprintf(buf, size, "%s/../%s", dirname(origin),
+ file));
+ }
+
+ return (snprintf(buf, size, "%s/%s", PARSERPREFIX, file));
+}
+
/* put out other arrays, copy the parsers */
static void
others()
@@ -244,7 +266,17 @@ others()
int c, i, j;
int tmpline;
- finput = fopen(parser, "r");
+ if (parser == NULL) {
+ parser = pbuf;
+ (void) yacc_assemble_path(pbuf, PBUFSIZE, PARSER, 1);
+ finput = fopen(parser, "r");
+ if (finput == NULL) {
+ (void) yacc_assemble_path(pbuf, PBUFSIZE, PARSER, 0);
+ finput = fopen(parser, "r");
+ }
+ } else {
+ finput = fopen(parser, "r");
+ }
if (finput == NULL)
/*
* TRANSLATION_NOTE -- This is a message from yacc.
diff --git a/usr/src/cmd/sgs/yacc/common/y2.c b/usr/src/cmd/sgs/yacc/common/y2.c
index 3599d40904..ca8dcc61f5 100644
--- a/usr/src/cmd/sgs/yacc/common/y2.c
+++ b/usr/src/cmd/sgs/yacc/common/y2.c
@@ -26,7 +26,9 @@
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include "dextern.h"
#include "sgs.h"
@@ -60,7 +62,8 @@ char *infile; /* input file name */
static int numbval; /* value of an input number */
static int toksize = NAMESIZE;
static wchar_t *tokname; /* input token name */
-char *parser = PARSER; /* location of common parser */
+char *parser = NULL; /* location of common parser */
+char pbuf[PBUFSIZE];
static void finact(void);
static wchar_t *cstash(wchar_t *);
diff --git a/usr/src/cmd/ssh/Makefile b/usr/src/cmd/ssh/Makefile
index a36a9fb762..62f30b3f36 100644
--- a/usr/src/cmd/ssh/Makefile
+++ b/usr/src/cmd/ssh/Makefile
@@ -77,7 +77,7 @@ check: $(CHECKHDRS)
_msg:
$(RM) $(POFILE)
$(TOUCH) $(POFILE)
- $(MAKE) $(POFILE) XGETTEXT=/usr/bin/gxgettext
+ $(MAKE) $(POFILE) XGETTEXT=$(GNUXGETTEXT)
$(CP) $(POFILE) $(MSGFILE)
$(CP) $(MSGFILE) $(MSGDOMAIN)
diff --git a/usr/src/cmd/ssh/include/key.h b/usr/src/cmd/ssh/include/key.h
index 862b2d81d4..ec4993a9c1 100644
--- a/usr/src/cmd/ssh/include/key.h
+++ b/usr/src/cmd/ssh/include/key.h
@@ -39,11 +39,17 @@ extern "C" {
typedef struct Key Key;
enum types {
- KEY_RSA1,
- KEY_RSA,
- KEY_DSA,
+ KEY_RSA1,
+ KEY_RSA,
+ KEY_DSA,
+ KEY_ECDSA,
+ KEY_RSA_CERT,
+ KEY_DSA_CERT,
+ KEY_ECDSA_CERT,
+ KEY_RSA_CERT_V00,
+ KEY_DSA_CERT_V00,
KEY_NULL,
- KEY_UNSPEC
+ KEY_UNSPEC
};
enum fp_type {
SSH_FP_SHA1,
@@ -87,6 +93,7 @@ int key_names_valid2(const char *);
int key_sign(Key *, u_char **, u_int *, u_char *, u_int);
int key_verify(Key *, u_char *, u_int, u_char *, u_int);
+int key_type_plain(int type);
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/cmd/ssh/include/servconf.h b/usr/src/cmd/ssh/include/servconf.h
index a66c6415cb..9a32544c2a 100644
--- a/usr/src/cmd/ssh/include/servconf.h
+++ b/usr/src/cmd/ssh/include/servconf.h
@@ -167,6 +167,7 @@ typedef struct {
char *pre_userauth_hook;
char *pam_service_prefix;
char *pam_service_name;
+ char *pubkey_plugin;
} ServerOptions;
diff --git a/usr/src/cmd/ssh/libssh/Makefile.com b/usr/src/cmd/ssh/libssh/Makefile.com
index 569afe7207..4017af7905 100644
--- a/usr/src/cmd/ssh/libssh/Makefile.com
+++ b/usr/src/cmd/ssh/libssh/Makefile.com
@@ -94,7 +94,7 @@ LIBS = $(LIBRARY) $(LINTLIB)
# Define LDLIBS conditionally for lintcheck, rather than in general, since
# we're building an archive library which itself links to nothing, we just
# want lint to know about these libraries.
-lintcheck := LDLIBS += -lcrypto -lz -lsocket -lnsl -lc
+lintcheck := LDLIBS += -lsunw_crypto -lz -lsocket -lnsl -lc
$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
POFILE_DIR = ../..
diff --git a/usr/src/cmd/ssh/libssh/common/canohost.c b/usr/src/cmd/ssh/libssh/common/canohost.c
index 2d427b9e8d..87aab396cf 100644
--- a/usr/src/cmd/ssh/libssh/common/canohost.c
+++ b/usr/src/cmd/ssh/libssh/common/canohost.c
@@ -73,9 +73,6 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
NULL, 0, NI_NAMEREQD) != 0) {
/* Host name not found. Use ip address. */
-#if 0
- log("Could not reverse map address %.100s.", ntop);
-#endif
return xstrdup(ntop);
}
@@ -206,36 +203,6 @@ get_socket_address(int socket, int remote, int flags)
return (xstrdup(result));
}
-#if 0
-static char *
-get_socket_address(int socket, int remote, int flags)
-{
- struct sockaddr_storage addr;
- socklen_t addrlen;
- char ntop[NI_MAXHOST];
-
- /* Get IP address of client. */
- addrlen = sizeof(addr);
- memset(&addr, 0, sizeof(addr));
-
- if (remote) {
- if (getpeername(socket, (struct sockaddr *)&addr, &addrlen)
- < 0)
- return NULL;
- } else {
- if (getsockname(socket, (struct sockaddr *)&addr, &addrlen)
- < 0)
- return NULL;
- }
- /* Get the address in ascii. */
- if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
- NULL, 0, flags) != 0) {
- error("get_socket_ipaddr: getnameinfo %d failed", flags);
- return NULL;
- }
- return xstrdup(ntop);
-}
-#endif
char *
get_peer_ipaddr(int socket)
@@ -388,4 +355,4 @@ inet_ntop_native(int af, const void *src, char *dst, size_t size)
}
return (result);
-}
+}
diff --git a/usr/src/cmd/ssh/libssh/common/key.c b/usr/src/cmd/ssh/libssh/common/key.c
index f648d3b640..8ee2583d93 100644
--- a/usr/src/cmd/ssh/libssh/common/key.c
+++ b/usr/src/cmd/ssh/libssh/common/key.c
@@ -874,3 +874,20 @@ key_demote(Key *k)
return (pk);
}
+
+int
+key_type_plain(int type)
+{
+ switch (type) {
+ case KEY_RSA_CERT_V00:
+ case KEY_RSA_CERT:
+ return KEY_RSA;
+ case KEY_DSA_CERT_V00:
+ case KEY_DSA_CERT:
+ return KEY_DSA;
+ case KEY_ECDSA_CERT:
+ return KEY_ECDSA;
+ default:
+ return type;
+ }
+}
diff --git a/usr/src/cmd/ssh/sftp-server/Makefile b/usr/src/cmd/ssh/sftp-server/Makefile
index c2bdf26c1e..f49dde54ee 100644
--- a/usr/src/cmd/ssh/sftp-server/Makefile
+++ b/usr/src/cmd/ssh/sftp-server/Makefile
@@ -31,7 +31,7 @@ SRCS = $(OBJS:.o=.c)
include ../../Makefile.cmd
include ../Makefile.ssh-common
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lsunw_crypto
POFILE_DIR = ..
diff --git a/usr/src/cmd/ssh/sftp/Makefile b/usr/src/cmd/ssh/sftp/Makefile
index 8bd8bb4ac3..f3c0ea7a75 100644
--- a/usr/src/cmd/ssh/sftp/Makefile
+++ b/usr/src/cmd/ssh/sftp/Makefile
@@ -35,7 +35,7 @@ SRCS = $(OBJS:.o=.c)
include ../../Makefile.cmd
include ../Makefile.ssh-common
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lcrypto -ltecla
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lsunw_crypto -ltecla
POFILE_DIR = ..
diff --git a/usr/src/cmd/ssh/ssh-add/Makefile b/usr/src/cmd/ssh/ssh-add/Makefile
index 1fb132f741..3235839e06 100644
--- a/usr/src/cmd/ssh/ssh-add/Makefile
+++ b/usr/src/cmd/ssh/ssh-add/Makefile
@@ -32,7 +32,7 @@ SRCS = $(OBJS:.o=.c)
include ../../Makefile.cmd
include ../Makefile.ssh-common
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lsunw_crypto
POFILE_DIR= ..
diff --git a/usr/src/cmd/ssh/ssh-agent/Makefile b/usr/src/cmd/ssh/ssh-agent/Makefile
index 3d4a366c17..ab2e1eb49d 100644
--- a/usr/src/cmd/ssh/ssh-agent/Makefile
+++ b/usr/src/cmd/ssh/ssh-agent/Makefile
@@ -32,7 +32,7 @@ SRCS = $(OBJS:.o=.c)
include ../../Makefile.cmd
include ../Makefile.ssh-common
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lsunw_crypto
POFILE_DIR= ..
diff --git a/usr/src/cmd/ssh/ssh-keygen/Makefile b/usr/src/cmd/ssh/ssh-keygen/Makefile
index f92c437045..0c90716768 100644
--- a/usr/src/cmd/ssh/ssh-keygen/Makefile
+++ b/usr/src/cmd/ssh/ssh-keygen/Makefile
@@ -32,7 +32,7 @@ SRCS = $(OBJS:.o=.c)
include ../../Makefile.cmd
include ../Makefile.ssh-common
-LDLIBS += $(SSH_COMMON_LDLIBS) -lcrypto -lsocket
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsunw_crypto -lsocket
POFILE_DIR= ..
diff --git a/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c b/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
index ebad79b0f8..c79e76ae36 100644
--- a/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
+++ b/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
@@ -11,7 +11,7 @@
* called by a name other than "ssh" or "Secure Shell".
*/
-/* $OpenBSD: ssh-keygen.c,v 1.160 2007/01/21 01:41:54 stevesk Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.205 2011/01/11 06:13:10 djm Exp $ */
#include "includes.h"
#include <openssl/evp.h>
@@ -76,9 +76,14 @@ char *identity_new_passphrase = NULL;
/* This is set to the new comment if given on the command line. */
char *identity_comment = NULL;
-/* Dump public key file in format used by real and the original SSH 2 */
-int convert_to_ssh2 = 0;
-int convert_from_ssh2 = 0;
+/* Conversion to/from various formats */
+int convert_to = 0;
+int convert_from = 0;
+enum {
+ FMT_RFC4716,
+ FMT_PKCS8,
+ FMT_PEM
+} convert_format = FMT_RFC4716;
int print_public = 0;
char *key_type_name = NULL;
@@ -154,41 +159,105 @@ load_identity(char *filename)
#define SSH_COM_PRIVATE_KEY_MAGIC 0x3f6ff9eb
static void
-do_convert_to_ssh2(struct passwd *pw)
+do_convert_to_ssh2(struct passwd *pw, Key *k)
{
- Key *k;
u_int len;
u_char *blob;
- struct stat st;
+ char comment[61];
- if (!have_identity)
- ask_filename(pw, gettext("Enter file in which the key is"));
- if (stat(identity_file, &st) < 0) {
- perror(identity_file);
+ if (key_to_blob(k, &blob, &len) <= 0) {
+ fprintf(stderr, "key_to_blob failed\n");
exit(1);
}
+ /* Comment + surrounds must fit into 72 chars (RFC 4716 sec 3.3) */
+ snprintf(comment, sizeof(comment),
+ "%u-bit %s, converted by %s@%s from OpenSSH",
+ key_size(k), key_type(k),
+ pw->pw_name, hostname);
+
+ fprintf(stdout, "%s\n", SSH_COM_PUBLIC_BEGIN);
+ fprintf(stdout, "Comment: \"%s\"\n", comment);
+ dump_base64(stdout, blob, len);
+ fprintf(stdout, "%s\n", SSH_COM_PUBLIC_END);
+ key_free(k);
+ xfree(blob);
+ exit(0);
+}
+
+static void
+do_convert_to_pkcs8(Key *k)
+{
+ switch (key_type_plain(k->type)) {
+ case KEY_RSA:
+ if (!PEM_write_RSA_PUBKEY(stdout, k->rsa))
+ fatal("PEM_write_RSA_PUBKEY failed");
+ break;
+ case KEY_DSA:
+ if (!PEM_write_DSA_PUBKEY(stdout, k->dsa))
+ fatal("PEM_write_DSA_PUBKEY failed");
+ break;
+ default:
+ fatal("%s: unsupported key type %s", __func__, key_type(k));
+ }
+ exit(0);
+}
+
+static void
+do_convert_to_pem(Key *k)
+{
+ switch (key_type_plain(k->type)) {
+ case KEY_RSA:
+ if (!PEM_write_RSAPublicKey(stdout, k->rsa))
+ fatal("PEM_write_RSAPublicKey failed");
+ break;
+ case KEY_DSA:
+ if (!PEM_write_DSA_PUBKEY(stdout, k->dsa))
+ fatal("PEM_write_DSAPublicKey failed");
+ break;
+ default:
+ fatal("%s: unsupported key type %s", __func__, key_type(k));
+ }
+ exit(0);
+}
+
+static void
+do_convert_to(struct passwd *pw)
+{
+ Key *k;
+ struct stat st;
+
+ if (!have_identity)
+ ask_filename(pw, "Enter file in which the key is");
+ if (stat(identity_file, &st) < 0)
+ fatal("%s: %s: %s", __progname, identity_file, strerror(errno));
if ((k = key_load_public(identity_file, NULL)) == NULL) {
if ((k = load_identity(identity_file)) == NULL) {
- fprintf(stderr, gettext("load failed\n"));
+ fprintf(stderr, "load failed\n");
exit(1);
}
}
- if (key_to_blob(k, &blob, &len) <= 0) {
- fprintf(stderr, gettext("key_to_blob failed\n"));
+ if (k->type == KEY_RSA1) {
+ fprintf(stderr, "version 1 keys are not supported\n");
exit(1);
}
- fprintf(stdout, "%s\n", SSH_COM_PUBLIC_BEGIN);
- fprintf(stdout, gettext(
- "Comment: \"%u-bit %s, converted from OpenSSH by %s@%s\"\n"),
- key_size(k), key_type(k),
- pw->pw_name, hostname);
- dump_base64(stdout, blob, len);
- fprintf(stdout, "%s\n", SSH_COM_PUBLIC_END);
- key_free(k);
- xfree(blob);
+
+ switch (convert_format) {
+ case FMT_RFC4716:
+ do_convert_to_ssh2(pw, k);
+ break;
+ case FMT_PKCS8:
+ do_convert_to_pkcs8(k);
+ break;
+ case FMT_PEM:
+ do_convert_to_pem(k);
+ break;
+ default:
+ fatal("%s: unknown key format %d", __func__, convert_format);
+ }
exit(0);
}
+
static void
buffer_get_bignum_bits(Buffer *b, BIGNUM *value)
{
@@ -327,24 +396,16 @@ get_line(FILE *fp, char *line, size_t len)
}
static void
-do_convert_from_ssh2(struct passwd *pw)
+do_convert_from_ssh2(struct passwd *pw, Key **k, int *private)
{
- Key *k;
int blen;
u_int len;
char line[1024];
u_char blob[8096];
char encoded[8096];
- struct stat st;
- int escaped = 0, private = 0, ok;
+ int escaped = 0;
FILE *fp;
- if (!have_identity)
- ask_filename(pw, gettext("Enter file in which the key is"));
- if (stat(identity_file, &st) < 0) {
- perror(identity_file);
- exit(1);
- }
fp = fopen(identity_file, "r");
if (fp == NULL) {
perror(identity_file);
@@ -357,7 +418,7 @@ do_convert_from_ssh2(struct passwd *pw)
if (strncmp(line, "----", 4) == 0 ||
strstr(line, ": ") != NULL) {
if (strstr(line, SSH_COM_PRIVATE_BEGIN) != NULL)
- private = 1;
+ *private = 1;
if (strstr(line, " END ") != NULL) {
break;
}
@@ -382,26 +443,117 @@ do_convert_from_ssh2(struct passwd *pw)
fprintf(stderr, gettext("uudecode failed.\n"));
exit(1);
}
- k = private ?
+ *k = *private ?
do_convert_private_ssh2_from_blob(blob, blen) :
key_from_blob(blob, blen);
- if (k == NULL) {
+ if (*k == NULL) {
fprintf(stderr, gettext("decode blob failed.\n"));
exit(1);
}
- ok = private ?
- (k->type == KEY_DSA ?
- PEM_write_DSAPrivateKey(stdout, k->dsa, NULL, NULL, 0, NULL, NULL) :
- PEM_write_RSAPrivateKey(stdout, k->rsa, NULL, NULL, 0, NULL, NULL)) :
- key_write(k, stdout);
+ fclose(fp);
+}
+
+static void
+do_convert_from_pkcs8(Key **k, int *private)
+{
+ EVP_PKEY *pubkey;
+ FILE *fp;
+
+ if ((fp = fopen(identity_file, "r")) == NULL)
+ fatal("%s: %s: %s", __progname, identity_file, strerror(errno));
+ if ((pubkey = PEM_read_PUBKEY(fp, NULL, NULL, NULL)) == NULL) {
+ fatal("%s: %s is not a recognised public key format", __func__,
+ identity_file);
+ }
+ fclose(fp);
+ switch (EVP_PKEY_type(pubkey->type)) {
+ case EVP_PKEY_RSA:
+ *k = key_new(KEY_UNSPEC);
+ (*k)->type = KEY_RSA;
+ (*k)->rsa = EVP_PKEY_get1_RSA(pubkey);
+ break;
+ case EVP_PKEY_DSA:
+ *k = key_new(KEY_UNSPEC);
+ (*k)->type = KEY_DSA;
+ (*k)->dsa = EVP_PKEY_get1_DSA(pubkey);
+ break;
+ default:
+ fatal("%s: unsupported pubkey type %d", __func__,
+ EVP_PKEY_type(pubkey->type));
+ }
+ EVP_PKEY_free(pubkey);
+ return;
+}
+
+static void
+do_convert_from_pem(Key **k, int *private)
+{
+ FILE *fp;
+ RSA *rsa;
+
+ if ((fp = fopen(identity_file, "r")) == NULL)
+ fatal("%s: %s: %s", __progname, identity_file, strerror(errno));
+ if ((rsa = PEM_read_RSAPublicKey(fp, NULL, NULL, NULL)) != NULL) {
+ *k = key_new(KEY_UNSPEC);
+ (*k)->type = KEY_RSA;
+ (*k)->rsa = rsa;
+ fclose(fp);
+ return;
+ }
+ fatal("%s: unrecognised raw private key format", __func__);
+}
+
+static void
+do_convert_from(struct passwd *pw)
+{
+ Key *k = NULL;
+ int private = 0, ok = 0;
+ struct stat st;
+
+ if (!have_identity)
+ ask_filename(pw, "Enter file in which the key is");
+ if (stat(identity_file, &st) < 0)
+ fatal("%s: %s: %s", __progname, identity_file, strerror(errno));
+
+ switch (convert_format) {
+ case FMT_RFC4716:
+ do_convert_from_ssh2(pw, &k, &private);
+ break;
+ case FMT_PKCS8:
+ do_convert_from_pkcs8(&k, &private);
+ break;
+ case FMT_PEM:
+ do_convert_from_pem(&k, &private);
+ break;
+ default:
+ fatal("%s: unknown key format %d", __func__, convert_format);
+ }
+
+ if (!private)
+ ok = key_write(k, stdout);
+ if (ok)
+ fprintf(stdout, "\n");
+ else {
+ switch (k->type) {
+ case KEY_DSA:
+ ok = PEM_write_DSAPrivateKey(stdout, k->dsa, NULL,
+ NULL, 0, NULL, NULL);
+ break;
+ case KEY_RSA:
+ ok = PEM_write_RSAPrivateKey(stdout, k->rsa, NULL,
+ NULL, 0, NULL, NULL);
+ break;
+ default:
+ fatal("%s: unsupported key type %s", __func__,
+ key_type(k));
+ }
+ }
+
if (!ok) {
- fprintf(stderr, gettext("key write failed"));
+ fprintf(stderr, "key write failed\n");
exit(1);
}
key_free(k);
- if (!private)
- fprintf(stdout, "\n");
- fclose(fp);
exit(0);
}
@@ -917,12 +1069,13 @@ usage(void)
" -B Show bubblebabble digest of key file.\n"
" -c Change comment in private and public key files.\n"
" -C comment Provide new comment.\n"
- " -e Convert OpenSSH to IETF SECSH key file.\n"
+ " -e Convert OpenSSH to foreign format key file.\n"
" -f filename Filename of the key file.\n"
" -F hostname Find hostname in known hosts file.\n"
" -H Hash names in known_hosts file.\n"
- " -i Convert IETF SECSH to OpenSSH key file.\n"
+ " -i Convert foreign format to OpenSSH key file.\n"
" -l Show fingerprint of key file.\n"
+ " -m key_fmt Conversion format for -e/-i (PEM|PKCS8|RFC4716).\n"
" -N phrase Provide new passphrase.\n"
" -p Change passphrase of private key file.\n"
" -P phrase Provide old passphrase.\n"
@@ -974,7 +1127,7 @@ main(int argc, char **argv)
exit(1);
}
-#define GETOPT_ARGS "BcdeHilpqxXyb:C:f:F:N:P:R:t:"
+#define GETOPT_ARGS "BcdeHilpqxXyb:C:f:F:m:N:P:R:t:"
while ((opt = getopt(argc, argv, GETOPT_ARGS)) != -1) {
switch (opt) {
@@ -1002,6 +1155,22 @@ main(int argc, char **argv)
case 'B':
print_bubblebabble = 1;
break;
+ case 'm':
+ if (strcasecmp(optarg, "RFC4716") == 0 ||
+ strcasecmp(optarg, "ssh2") == 0) {
+ convert_format = FMT_RFC4716;
+ break;
+ }
+ if (strcasecmp(optarg, "PKCS8") == 0) {
+ convert_format = FMT_PKCS8;
+ break;
+ }
+ if (strcasecmp(optarg, "PEM") == 0) {
+ convert_format = FMT_PEM;
+ break;
+ }
+ fatal("Unsupported conversion format \"%s\"", optarg);
+ /*NOTREACHED*/
case 'p':
change_passphrase = 1;
break;
@@ -1027,12 +1196,12 @@ main(int argc, char **argv)
case 'e':
case 'x':
/* export key */
- convert_to_ssh2 = 1;
+ convert_to = 1;
break;
case 'i':
case 'X':
/* import key */
- convert_from_ssh2 = 1;
+ convert_from = 1;
break;
case 'y':
print_public = 1;
@@ -1064,10 +1233,10 @@ main(int argc, char **argv)
do_change_passphrase(pw);
if (change_comment)
do_change_comment(pw);
- if (convert_to_ssh2)
- do_convert_to_ssh2(pw);
- if (convert_from_ssh2)
- do_convert_from_ssh2(pw);
+ if (convert_to)
+ do_convert_to(pw);
+ if (convert_from)
+ do_convert_from(pw);
if (print_public)
do_print_public(pw);
diff --git a/usr/src/cmd/ssh/ssh-keyscan/Makefile b/usr/src/cmd/ssh/ssh-keyscan/Makefile
index 9e2fd17160..90428880a3 100644
--- a/usr/src/cmd/ssh/ssh-keyscan/Makefile
+++ b/usr/src/cmd/ssh/ssh-keyscan/Makefile
@@ -32,7 +32,7 @@ SRCS = $(OBJS:.o=.c)
include ../../Makefile.cmd
include ../Makefile.ssh-common
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz -lsunw_crypto
POFILE_DIR= ..
diff --git a/usr/src/cmd/ssh/ssh-keysign/Makefile b/usr/src/cmd/ssh/ssh-keysign/Makefile
index e31ae681a1..649935a050 100644
--- a/usr/src/cmd/ssh/ssh-keysign/Makefile
+++ b/usr/src/cmd/ssh/ssh-keysign/Makefile
@@ -36,7 +36,7 @@ include ../Makefile.ssh-common
FILEMODE= 04555
-LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz -lcrypto
+LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket -lnsl -lz -lsunw_crypto
POFILE_DIR= ..
diff --git a/usr/src/cmd/ssh/ssh/Makefile b/usr/src/cmd/ssh/ssh/Makefile
index 7bdd4f6be5..2d77334497 100644
--- a/usr/src/cmd/ssh/ssh/Makefile
+++ b/usr/src/cmd/ssh/ssh/Makefile
@@ -40,7 +40,7 @@ include ../Makefile.ssh-common
LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket \
-lnsl \
-lz \
- -lcrypto \
+ -lsunw_crypto \
-lgss
POFILE_DIR= ..
diff --git a/usr/src/cmd/ssh/sshd/Makefile b/usr/src/cmd/ssh/sshd/Makefile
index a52e9b1cc8..4c82633347 100644
--- a/usr/src/cmd/ssh/sshd/Makefile
+++ b/usr/src/cmd/ssh/sshd/Makefile
@@ -75,7 +75,7 @@ LDLIBS += $(SSH_COMMON_LDLIBS) -lsocket \
-lpam \
-lbsm \
-lwrap \
- -lcrypto \
+ -lsunw_crypto \
-lgss \
-lcontract
MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
diff --git a/usr/src/cmd/ssh/sshd/auth2-pubkey.c b/usr/src/cmd/ssh/sshd/auth2-pubkey.c
index 658634c195..c1c5f540e4 100644
--- a/usr/src/cmd/ssh/sshd/auth2-pubkey.c
+++ b/usr/src/cmd/ssh/sshd/auth2-pubkey.c
@@ -26,6 +26,8 @@
* Use is subject to license terms.
*/
+#include <dlfcn.h>
+
#include "includes.h"
RCSID("$OpenBSD: auth2-pubkey.c,v 1.2 2002/05/31 11:35:15 markus Exp $");
@@ -54,6 +56,13 @@ extern ServerOptions options;
extern u_char *session_id2;
extern int session_id2_len;
+/* global plugin function requirements */
+static const char *RSA_SYM_NAME = "sshd_user_rsa_key_allowed";
+static const char *DSA_SYM_NAME = "sshd_user_rsa_key_allowed";
+typedef int (*RSA_SYM)(struct passwd *, RSA *, const char *);
+typedef int (*DSA_SYM)(struct passwd *, DSA *, const char *);
+
+
static void
userauth_pubkey(Authctxt *authctxt)
{
@@ -309,7 +318,98 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
return found_key;
}
-/* check whether given key is in .ssh/authorized_keys* */
+/**
+ * Checks whether or not access is allowed based on a plugin specified
+ * in sshd_config (PubKeyPlugin).
+ *
+ * Note that this expects a symbol in the loaded library that takes
+ * the current user (pwd entry), the current RSA key and it's fingerprint.
+ * The symbol is expected to return 1 on success and 0 on failure.
+ *
+ * While we could optimize this code to dlopen once in the process' lifetime,
+ * sshd is already a slow beast, so this is really not a concern.
+ * The overhead is basically a rounding error compared to everything else, and
+ * it keeps this code minimally invasive.
+ */
+static int
+user_key_allowed_from_plugin(struct passwd *pw, Key *key)
+{
+ RSA_SYM rsa_sym = NULL;
+ DSA_SYM dsa_sym = NULL;
+ char *fp = NULL;
+ void *handle = NULL;
+ int success = 0;
+
+ if (options.pubkey_plugin == NULL || pw == NULL || key == NULL ||
+ (key->type != KEY_RSA && key->type != KEY_RSA1 &&
+ key->type != KEY_DSA && key->type != KEY_ECDSA))
+ return success;
+
+ handle = dlopen(options.pubkey_plugin, RTLD_NOW);
+ if ((handle == NULL)) {
+ debug("Unable to open library %s: %s", options.pubkey_plugin,
+ dlerror());
+ goto out;
+ }
+
+ fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
+ if (fp == NULL) {
+ debug("failed to generate fingerprint");
+ goto out;
+ }
+
+ switch (key->type) {
+ case KEY_RSA1:
+ case KEY_RSA:
+ rsa_sym = (RSA_SYM)dlsym(handle, RSA_SYM_NAME);
+ if (rsa_sym == NULL) {
+ debug("Unable to resolve symbol %s: %s", RSA_SYM_NAME,
+ dlerror());
+ goto out;
+ }
+ debug2("Invoking %s from %s", RSA_SYM_NAME,
+ options.pubkey_plugin);
+ success = (*rsa_sym)(pw, key->rsa, fp);
+ break;
+ case KEY_DSA:
+ case KEY_ECDSA:
+ dsa_sym = (DSA_SYM)dlsym(handle, RSA_SYM_NAME);
+ if (dsa_sym == NULL) {
+ debug("Unable to resolve symbol %s: %s", DSA_SYM_NAME,
+ dlerror());
+ goto out;
+ }
+ debug2("Invoking %s from %s", DSA_SYM_NAME,
+ options.pubkey_plugin);
+ success = (*dsa_sym)(pw, key->dsa, fp);
+ break;
+ default:
+ debug2("user_key_plugins only support RSA keys");
+ }
+
+ debug("sshd_plugin returned: %d", success);
+
+out:
+ if (handle != NULL) {
+ dlclose(handle);
+ dsa_sym = NULL;
+ rsa_sym = NULL;
+ handle = NULL;
+ }
+
+ if (success)
+ verbose("Found matching %s key: %s", key_type(key), fp);
+
+ if (fp != NULL) {
+ xfree(fp);
+ fp = NULL;
+ }
+
+ return success;
+}
+
+
+/* check whether given key is in .ssh/authorized_keys or a plugin */
int
user_key_allowed(struct passwd *pw, Key *key)
{
@@ -329,6 +429,13 @@ user_key_allowed(struct passwd *pw, Key *key)
file = authorized_keys_file2(pw);
success = user_key_allowed2(pw, key, file);
xfree(file);
+
+ if (success)
+ return success;
+
+ /* try from a plugin */
+ success = user_key_allowed_from_plugin(pw, key);
+
return success;
}
diff --git a/usr/src/cmd/ssh/sshd/servconf.c b/usr/src/cmd/ssh/sshd/servconf.c
index 516466bbc1..16f1dcecf7 100644
--- a/usr/src/cmd/ssh/sshd/servconf.c
+++ b/usr/src/cmd/ssh/sshd/servconf.c
@@ -155,6 +155,7 @@ initialize_server_options(ServerOptions *options)
options->pre_userauth_hook = NULL;
options->pam_service_name = NULL;
options->pam_service_prefix = NULL;
+ options->pubkey_plugin = NULL;
}
#ifdef HAVE_DEFOPEN
@@ -419,13 +420,14 @@ typedef enum {
sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression,
sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
- sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups,
+ sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
sBanner, sVerifyReverseMapping, sHostbasedAuthentication,
sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
sMaxAuthTries, sMaxAuthTriesLog, sUsePrivilegeSeparation,
sLookupClientHostnames, sUseOpenSSLEngine, sChrootDirectory,
sPreUserauthHook, sMatch, sPAMServicePrefix, sPAMServiceName,
+ sMaxStartups, sPubKeyPlugin,
sDeprecated
} ServerOpCodes;
@@ -532,6 +534,7 @@ static struct {
{ "match", sMatch, SSHCFG_ALL },
{ "pamserviceprefix", sPAMServicePrefix, SSHCFG_GLOBAL },
{ "pamservicename", sPAMServiceName, SSHCFG_GLOBAL },
+ { "pubkeyplugin", sPubKeyPlugin, SSHCFG_ALL },
{ NULL, sBadOption, 0 }
};
@@ -1356,6 +1359,10 @@ parse_flag:
options->pam_service_name = xstrdup(arg);
break;
+ case sPubKeyPlugin:
+ charptr = &options->pubkey_plugin;
+ goto parse_filename;
+
default:
fatal("%s line %d: Missing handler for opcode %s (%d)",
filename, linenum, arg, opcode);
diff --git a/usr/src/cmd/ssh/sshd/sshlogin.c b/usr/src/cmd/ssh/sshd/sshlogin.c
index c21877355c..c2bd3bacb7 100644
--- a/usr/src/cmd/ssh/sshd/sshlogin.c
+++ b/usr/src/cmd/ssh/sshd/sshlogin.c
@@ -101,8 +101,7 @@ record_login(pid_t pid, const char *ttyname, const char *progname,
fatal_cleanup();
}
}
- remote_name_or_ip = get_remote_name_or_ip(utmp_len,
- options.verify_reverse_mapping);
+ remote_name_or_ip = get_remote_ipaddr();
initialized = 1;
}
diff --git a/usr/src/cmd/stat/Makefile b/usr/src/cmd/stat/Makefile
index d5356ae42d..faffc6a437 100644
--- a/usr/src/cmd/stat/Makefile
+++ b/usr/src/cmd/stat/Makefile
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2011, 2012, Joyent, Inc. All rights reserved.
# Use is subject to license terms.
#
# cmd/stat/Makefile
@@ -27,7 +27,14 @@
include ../Makefile.cmd
-SUBDIRS= iostat mpstat vmstat fsstat kstat
+SUBDIRS= arcstat \
+ fsstat \
+ iostat \
+ kstat \
+ mpstat \
+ vfsstat \
+ vmstat \
+ ziostat
all := TARGET = all
install := TARGET = install
diff --git a/usr/src/cmd/stat/arcstat/Makefile b/usr/src/cmd/stat/arcstat/Makefile
new file mode 100644
index 0000000000..3dc3630bc0
--- /dev/null
+++ b/usr/src/cmd/stat/arcstat/Makefile
@@ -0,0 +1,41 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+include $(SRC)/cmd/Makefile.cmd
+
+PROG= arcstat
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+install: all .WAIT $(ROOTPROG)
+
+clean:
+
+$(ROOTBINPROG): $(PROG)
+ $(INS.file)
+
+lint:
+
+include $(SRC)/cmd/Makefile.targ
diff --git a/usr/src/cmd/stat/arcstat/arcstat.pl b/usr/src/cmd/stat/arcstat/arcstat.pl
new file mode 100644
index 0000000000..19f85a6c31
--- /dev/null
+++ b/usr/src/cmd/stat/arcstat/arcstat.pl
@@ -0,0 +1,332 @@
+#!/usr/perl5/bin/perl -w
+#
+# Print out ZFS ARC Statistics exported via kstat(1)
+# For a definition of fields, or usage, use arctstat.pl -v
+#
+# This script is a fork of the original arcstat.pl (0.1) by
+# Neelakanth Nadgir, originally published on his Sun blog on
+# 09/18/2007
+# http://blogs.sun.com/realneel/entry/zfs_arc_statistics
+#
+# This version aims to improve upon the original by adding features
+# and fixing bugs as needed. This version is maintained by
+# Mike Harsch and is hosted in a public open source repository:
+# http://github.com/mharsch/arcstat
+#
+# Comments, Questions, or Suggestions are always welcome.
+# Contact the maintainer at ( mike at harschsystems dot com )
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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
+#
+#
+# Fields have a fixed width. Every interval, we fill the "v"
+# hash with its corresponding value (v[field]=value) using calculate().
+# @hdr is the array of fields that needs to be printed, so we
+# just iterate over this array and print the values using our pretty printer.
+
+use strict;
+use POSIX qw(strftime);
+use Sun::Solaris::Kstat;
+use Getopt::Long;
+use IO::Handle;
+
+my %cols = (# HDR => [Size, Scale, Description]
+ "time" =>[8, -1, "Time"],
+ "hits" =>[4, 1000, "ARC reads per second"],
+ "miss" =>[4, 1000, "ARC misses per second"],
+ "read" =>[4, 1000, "Total ARC accesses per second"],
+ "hit%" =>[4, 100, "ARC Hit percentage"],
+ "miss%" =>[5, 100, "ARC miss percentage"],
+ "dhit" =>[4, 1000, "Demand Data hits per second"],
+ "dmis" =>[4, 1000, "Demand Data misses per second"],
+ "dh%" =>[3, 100, "Demand Data hit percentage"],
+ "dm%" =>[3, 100, "Demand Data miss percentage"],
+ "phit" =>[4, 1000, "Prefetch hits per second"],
+ "pmis" =>[4, 1000, "Prefetch misses per second"],
+ "ph%" =>[3, 100, "Prefetch hits percentage"],
+ "pm%" =>[3, 100, "Prefetch miss percentage"],
+ "mhit" =>[4, 1000, "Metadata hits per second"],
+ "mmis" =>[4, 1000, "Metadata misses per second"],
+ "mread" =>[4, 1000, "Metadata accesses per second"],
+ "mh%" =>[3, 100, "Metadata hit percentage"],
+ "mm%" =>[3, 100, "Metadata miss percentage"],
+ "arcsz" =>[5, 1024, "ARC Size"],
+ "c" =>[4, 1024, "ARC Target Size"],
+ "mfu" =>[4, 1000, "MFU List hits per second"],
+ "mru" =>[4, 1000, "MRU List hits per second"],
+ "mfug" =>[4, 1000, "MFU Ghost List hits per second"],
+ "mrug" =>[4, 1000, "MRU Ghost List hits per second"],
+ "eskip" =>[5, 1000, "evict_skip per second"],
+ "mtxmis" =>[6, 1000, "mutex_miss per second"],
+ "rmis" =>[4, 1000, "recycle_miss per second"],
+ "dread" =>[5, 1000, "Demand data accesses per second"],
+ "pread" =>[5, 1000, "Prefetch accesses per second"],
+ "l2hits" =>[6, 1000, "L2ARC hits per second"],
+ "l2miss" =>[6, 1000, "L2ARC misses per second"],
+ "l2read" =>[6, 1000, "Total L2ARC accesses per second"],
+ "l2hit%" =>[6, 100, "L2ARC access hit percentage"],
+ "l2miss%" =>[7, 100, "L2ARC access miss percentage"],
+ "l2size" =>[6, 1024, "Size of the L2ARC"],
+ "l2bytes" =>[7, 1024, "bytes read per second from the L2ARC"],
+);
+my %v=();
+my @hdr = qw(time read miss miss% dmis dm% pmis pm% mmis mm% arcsz c);
+my @xhdr = qw(time mfu mru mfug mrug eskip mtxmis rmis dread pread read);
+my $int = 1; # Print stats every 1 second by default
+my $count = 1; # Print stats since boot and exit
+my $hdr_intr = 20; # Print header every 20 lines of output
+my $opfile = "";
+my $sep = " "; # Default seperator is 2 spaces
+my $version = "0.4";
+my $l2exist = 0;
+my $cmd = "Usage: arcstat [-hvx] [-f fields] [-o file] [interval [count]]\n";
+my %cur;
+my %d;
+my $out;
+my $kstat = Sun::Solaris::Kstat->new();
+STDOUT->autoflush;
+
+sub detailed_usage {
+ print STDERR "$cmd\n";
+ print STDERR "Field definitions are as follows:\n";
+ foreach my $hdr (keys %cols) {
+ print STDERR sprintf("%11s : %s\n", $hdr, $cols{$hdr}[2]);
+ }
+ exit(1);
+}
+
+sub usage {
+ print STDERR "$cmd\n";
+ print STDERR "\t -x : Print extended stats\n";
+ print STDERR "\t -v : Show field headers and definitions\n";
+ print STDERR "\t -f : Specify specific fields to print (see -v)\n";
+ print STDERR "\t -o : Print stats to file\n";
+ print STDERR "\t -s : Specify a seperator\n\nExamples:\n";
+ print STDERR "\tarcstat -o /tmp/a.log 2 10\n";
+ print STDERR "\tarcstat -s , -o /tmp/a.log 2 10\n";
+ print STDERR "\tarcstat -v\n";
+ print STDERR "\tarcstat -f time,hit%,dh%,ph%,mh%\n";
+ exit(1);
+}
+
+sub init {
+ my $desired_cols;
+ my $xflag = '';
+ my $hflag = '';
+ my $vflag;
+ my $res = GetOptions('x' => \$xflag,
+ 'o=s' => \$opfile,
+ 'help|h|?' => \$hflag,
+ 'v' => \$vflag,
+ 's=s' => \$sep,
+ 'f=s' => \$desired_cols);
+ if (defined $ARGV[0] && defined $ARGV[1]) {
+ $int = $ARGV[0];
+ $count = $ARGV[1];
+ } elsif (defined $ARGV[0]) {
+ $int = $ARGV[0];
+ $count = 0;
+ }
+ usage() if !$res or $hflag or ($xflag and $desired_cols);
+ detailed_usage() if $vflag;
+ @hdr = @xhdr if $xflag; #reset headers to xhdr
+
+ # check if L2ARC exists
+ snap_stats();
+ if (defined $cur{"l2_size"}) {
+ $l2exist = 1;
+ }
+
+ if ($desired_cols) {
+ @hdr = split(/[ ,]+/, $desired_cols);
+ # Now check if they are valid fields
+ my @invalid = ();
+ my @incompat = ();
+ foreach my $ele (@hdr) {
+ if (not exists($cols{$ele})) {
+ push(@invalid, $ele);
+ } elsif (($l2exist == 0) && ($ele =~ /^l2/)) {
+ printf("No L2ARC here\n", $ele);
+ push(@incompat, $ele);
+ }
+ }
+ if (scalar @invalid > 0) {
+ print STDERR "Invalid column definition! -- "
+ . "@invalid\n\n";
+ usage();
+ }
+
+ if (scalar @incompat > 0) {
+ print STDERR "Incompatible field specified -- "
+ . "@incompat\n\n";
+ usage();
+ }
+ }
+ if ($opfile) {
+ open($out, ">$opfile") ||die "Cannot open $opfile for writing";
+ $out->autoflush;
+ select $out;
+ }
+
+}
+
+# Capture kstat statistics. We maintain 3 hashes, prev, cur, and
+# d (delta). As their names imply they maintain the previous, current,
+# and delta (cur - prev) statistics.
+sub snap_stats {
+ my %prev = %cur;
+ if ($kstat->update()) {
+ printf("<State Changed>\n");
+ }
+ my $hashref_cur = $kstat->{"zfs"}{0}{"arcstats"};
+ %cur = %$hashref_cur;
+ foreach my $key (keys %cur) {
+ next if $key =~ /class/;
+ if (defined $prev{$key}) {
+ $d{$key} = $cur{$key} - $prev{$key};
+ } else {
+ $d{$key} = $cur{$key};
+ }
+ }
+}
+
+# Pretty print num. Arguments are width, scale, and num
+sub prettynum {
+ my @suffix=(' ','K', 'M', 'G', 'T');
+ my $num = $_[2] || 0;
+ my $scale = $_[1];
+ my $sz = $_[0];
+ my $index = 0;
+ my $save = 0;
+
+ if ($scale == -1) { #special case for date field
+ return sprintf("%s", $num);
+ } elsif (($num > 0) && ($num < 1)) { #rounding error. return 0
+ $num = 0;
+ }
+
+ while ($num > $scale and $index < 5) {
+ $save = $num;
+ $num = $num/$scale;
+ $index++;
+ }
+
+ return sprintf("%*d", $sz, $num) if ($index == 0);
+ if (($save / $scale) < 10) {
+ return sprintf("%*.1f%s", $sz - 1, $num,$suffix[$index]);
+ } else {
+ return sprintf("%*d%s", $sz - 1, $num,$suffix[$index]);
+ }
+}
+
+sub print_values {
+ foreach my $col (@hdr) {
+ printf("%s%s", prettynum($cols{$col}[0], $cols{$col}[1],
+ $v{$col}), $sep);
+ }
+ printf("\n");
+}
+
+sub print_header {
+ foreach my $col (@hdr) {
+ printf("%*s%s", $cols{$col}[0], $col, $sep);
+ }
+ printf("\n");
+}
+
+sub calculate {
+ %v=();
+ $v{"time"} = strftime("%H:%M:%S", localtime);
+ $v{"hits"} = $d{"hits"}/$int;
+ $v{"miss"} = $d{"misses"}/$int;
+ $v{"read"} = $v{"hits"} + $v{"miss"};
+ $v{"hit%"} = 100*$v{"hits"}/$v{"read"} if $v{"read"} > 0;
+ $v{"miss%"} = 100 - $v{"hit%"} if $v{"read"} > 0;
+
+ $v{"dhit"} = ($d{"demand_data_hits"} +
+ $d{"demand_metadata_hits"})/$int;
+ $v{"dmis"} = ($d{"demand_data_misses"} +
+ $d{"demand_metadata_misses"})/$int;
+
+ $v{"dread"} = $v{"dhit"} + $v{"dmis"};
+ $v{"dh%"} = 100 * $v{"dhit"}/$v{"dread"} if $v{"dread"} > 0;
+ $v{"dm%"} = 100 - $v{"dh%"} if $v{"dread"} > 0;
+
+ $v{"phit"}=($d{"prefetch_data_hits"} +
+ $d{"prefetch_metadata_hits"})/$int;
+ $v{"pmis"}=($d{"prefetch_data_misses"}
+ +$d{"prefetch_metadata_misses"})/$int;
+
+ $v{"pread"} = $v{"phit"} + $v{"pmis"};
+ $v{"ph%"} = 100 * $v{"phit"}/$v{"pread"} if $v{"pread"} > 0;
+ $v{"pm%"} = 100 - $v{"ph%"} if $v{"pread"} > 0;
+
+ $v{"mhit"}=($d{"prefetch_metadata_hits"} +
+ $d{"demand_metadata_hits"})/$int;
+ $v{"mmis"}=($d{"prefetch_metadata_misses"}
+ +$d{"demand_metadata_misses"})/$int;
+
+ $v{"mread"} = $v{"mhit"} + $v{"mmis"};
+ $v{"mh%"} = 100 * $v{"mhit"}/$v{"mread"} if $v{"mread"} > 0;
+ $v{"mm%"} = 100 - $v{"mh%"} if $v{"mread"} > 0;
+
+ $v{"arcsz"} = $cur{"size"};
+ $v{"c"} = $cur{"c"};
+ $v{"mfu"} = $d{"hits"}/$int;
+ $v{"mru"} = $d{"mru_hits"}/$int;
+ $v{"mrug"} = $d{"mru_ghost_hits"}/$int;
+ $v{"mfug"} = $d{"mru_ghost_hits"}/$int;
+ $v{"eskip"} = $d{"evict_skip"}/$int;
+ $v{"rmiss"} = $d{"recycle_miss"}/$int;
+ $v{"mtxmis"} = $d{"mutex_miss"}/$int;
+
+ if ($l2exist) {
+ $v{"l2hits"} = $d{"l2_hits"}/$int;
+ $v{"l2miss"} = $d{"l2_misses"}/$int;
+ $v{"l2read"} = $v{"l2hits"} + $v{"l2miss"};
+ $v{"l2hit%"} = 100 * $v{"l2hits"}/$v{"l2read"}
+ if $v{"l2read"} > 0;
+
+ $v{"l2miss%"} = 100 - $v{"l2hit%"} if $v{"l2read"} > 0;
+ $v{"l2size"} = $cur{"l2_size"};
+ $v{"l2bytes"} = $d{"l2_read_bytes"}/$int;
+ }
+}
+
+sub main {
+ my $i = 0;
+ my $count_flag = 0;
+
+ init();
+ if ($count > 0) { $count_flag = 1; }
+ while (1) {
+ print_header() if ($i == 0);
+ snap_stats();
+ calculate();
+ print_values();
+ last if ($count_flag == 1 && $count-- <= 1);
+ $i = ($i == $hdr_intr) ? 0 : $i+1;
+ sleep($int);
+ }
+ close($out) if defined $out;
+}
+
+&main;
diff --git a/usr/src/cmd/stat/vfsstat/Makefile b/usr/src/cmd/stat/vfsstat/Makefile
new file mode 100644
index 0000000000..04b5085243
--- /dev/null
+++ b/usr/src/cmd/stat/vfsstat/Makefile
@@ -0,0 +1,41 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+include $(SRC)/cmd/Makefile.cmd
+
+PROG= vfsstat
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+install: all .WAIT $(ROOTPROG)
+
+clean:
+
+$(ROOTBINPROG): $(PROG)
+ $(INS.file)
+
+lint:
+
+include $(SRC)/cmd/Makefile.targ
diff --git a/usr/src/cmd/stat/vfsstat/vfsstat.pl b/usr/src/cmd/stat/vfsstat/vfsstat.pl
new file mode 100644
index 0000000000..a3780b8e63
--- /dev/null
+++ b/usr/src/cmd/stat/vfsstat/vfsstat.pl
@@ -0,0 +1,227 @@
+#!/usr/perl5/bin/perl -w
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011 Joyent, Inc.
+#
+# vfsstat - report VFS statistics per zone
+#
+# USAGE: vfsstat [-hIMrzZ] [interval [count]]
+# -h # help
+# -I # print results per interval (where applicable)
+# -M # print results in MB/s
+# -r # print data in comma-separated format
+# -z # hide zones with no VFS activity
+# -Z # print data for all zones
+#
+# eg, vfsstat # print summary since zone boot
+# vfsstat 1 # print continually every 1 second
+# vfsstat 1 5 # print 5 times, every 1 second
+#
+# NOTES:
+#
+# - The calculations and output fields emulate those from iostat(1M) as closely
+# as possible. When only one zone is actively performing disk I/O, the
+# results from iostat(1M) in the global zone and vfsstat in the local zone
+# should be almost identical. Note that many VFS read operations are handled
+# by the ARC, so vfsstat and iostat(1M) will be similar only when most
+# requests are missing in the ARC.
+#
+# - As with iostat(1M), a result of 100% for VFS read and write utilization does
+# not mean that the syscall layer is fully saturated. Instead, that
+# measurement just shows that at least one operation was pending over the last
+# quanta of time examined. Since the VFS layer can process more than one
+# operation concurrently, this measurement will frequently be 100% but the VFS
+# layer can still accept additional requests.
+#
+# - This script is based on Brendan Gregg's K9Toolkit examples:
+#
+# http://www.brendangregg.com/k9toolkit.html
+#
+
+use Getopt::Std;
+use Sun::Solaris::Kstat;
+my $Kstat = Sun::Solaris::Kstat->new();
+
+# Process command line args
+usage() if defined $ARGV[0] and $ARGV[0] eq "--help";
+getopts('hIMrzZ') or usage();
+usage() if defined $main::opt_h;
+$main::opt_h = 0;
+
+my $USE_MB = defined $main::opt_M ? $main::opt_M : 0;
+my $USE_INTERVAL = defined $main::opt_I ? $main::opt_I : 0;
+my $USE_COMMA = defined $main::opt_r ? $main::opt_r : 0;
+my $HIDE_ZEROES = defined $main::opt_z ? $main::opt_z : 0;
+my $ALL_ZONES = defined $main::opt_Z ? $main::opt_Z : 0;
+
+my ($interval, $count);
+if ( defined($ARGV[0]) ) {
+ $interval = $ARGV[0];
+ $count = defined ($ARGV[1]) ? $ARGV[1] : 2**32;
+ usage() if ($interval == 0);
+} else {
+ $interval = 1;
+ $count = 1;
+}
+
+my $HEADER_FMT = $USE_COMMA ?
+ "r/%s,w/%s,%sr/%s,%sw/%s,ractv,wactv,read_t,writ_t,%%r,%%w," .
+ "d/%s,del_t,zone\n" :
+ " r/%s w/%s %sr/%s %sw/%s ractv wactv read_t writ_t " .
+ "%%r %%w d/%s del_t zone\n";
+my $DATA_FMT = $USE_COMMA ?
+ "%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d,%d,%.1f,%.1f,%s,%d\n" :
+ "%5.1f %5.1f %5.1f %5.1f %5.1f %5.1f %6.1f %6.1f %3d %3d " .
+ "%5.1f %6.1f %s (%d)\n";
+
+my $BYTES_PREFIX = $USE_MB ? "M" : "k";
+my $BYTES_DIVISOR = $USE_MB ? 1024 * 1024 : 1024;
+my $INTERVAL_SUFFIX = $USE_INTERVAL ? "i" : "s";
+my $NANOSEC = 1000000000;
+
+my @fields = ( 'reads', 'writes', 'nread', 'nwritten', 'rtime', 'wtime',
+ 'rlentime', 'wlentime', 'delay_cnt', 'delay_time', 'snaptime' );
+
+chomp(my $curzone = (`/sbin/zonename`));
+
+my %old = ();
+my $rows_printed = 0;
+
+for (my $ii = 0; $ii < $count; $ii++) {
+ # Read list of visible zones and their zone IDs
+ my @zones = ();
+ my %zoneids = ();
+ my $zoneadm = `zoneadm list -p | cut -d: -f1,2`;
+ @lines = split(/\n/, $zoneadm);
+ foreach $line (@lines) {
+ @tok = split(/:/, $line);
+ $zoneids->{$tok[1]} = $tok[0];
+ push(@zones, $tok[1]);
+ }
+
+ $Kstat->update();
+
+ # Print the column header every 20 rows
+ if ($rows_printed == 0 || $ALL_ZONES) {
+ printf($HEADER_FMT, $INTERVAL_SUFFIX, $INTERVAL_SUFFIX,
+ $BYTES_PREFIX, $INTERVAL_SUFFIX, $BYTES_PREFIX,
+ $INTERVAL_SUFFIX, $INTERVAL_SUFFIX);
+ }
+
+ $rows_printed = $rows_printed >= 20 ? 0 : $rows_printed + 1;
+
+ foreach $zone (@zones) {
+ if ((!$ALL_ZONES) && ($zone ne $curzone)) {
+ next;
+ }
+
+ if (! defined $old->{$zone}) {
+ $old->{$zone} = ();
+ foreach $field (@fields) { $old->{$zone}->{$field} = 0; }
+ }
+
+ #
+ # Kstats have a 30-character limit (KSTAT_STRLEN) on their
+ # names, so if the zone name exceeds that limit, use the first
+ # 30 characters.
+ #
+ my $trimmed_zone = substr($zone, 0, 30);
+ my $zoneid = $zoneids->{$zone};
+
+ print_stats($zone, $zoneid,
+ $Kstat->{'zone_vfs'}{$zoneid}{$trimmed_zone}, $old->{$zone});
+ }
+
+ sleep ($interval);
+}
+
+exit(0);
+
+sub print_stats {
+ my $zone = $_[0];
+ my $zoneid = $_[1];
+ my $data = $_[2];
+ my $old = $_[3];
+
+ my $etime = $data->{'snaptime'} -
+ ($old->{'snaptime'} > 0 ? $old->{'snaptime'} : $data->{'crtime'});
+
+ # Calculate basic statistics
+ my $rate_divisor = $USE_INTERVAL ? 1 : $etime;
+ my $reads = ($data->{'reads'} - $old->{'reads'}) / $rate_divisor;
+ my $writes = ($data->{'writes'} - $old->{'writes'}) / $rate_divisor;
+ my $nread = ($data->{'nread'} - $old->{'nread'}) /
+ $rate_divisor / $BYTES_DIVISOR;
+ my $nwritten = ($data->{'nwritten'} - $old->{'nwritten'}) /
+ $rate_divisor / $BYTES_DIVISOR;
+
+ # Calculate transactions per second
+ my $r_tps = ($data->{'reads'} - $old->{'reads'}) / $etime;
+ my $w_tps = ($data->{'writes'} - $old->{'writes'}) / $etime;
+
+ # Calculate average length of active queue
+ my $r_actv = (($data->{'rlentime'} - $old->{'rlentime'}) / $NANOSEC) /
+ $etime;
+ my $w_actv = (($data->{'wlentime'} - $old->{'wlentime'}) / $NANOSEC) /
+ $etime;
+
+ # Calculate average service time
+ # multiply by 1000 to convert to usecs for conssistency with del_t
+ my $read_t = ($r_tps > 0 ? $r_actv * (1000 / $r_tps) : 0.0) * 1000;
+ my $writ_t = ($w_tps > 0 ? $w_actv * (1000 / $w_tps) : 0.0) * 1000;
+
+ # Calculate I/O throttle delay metrics
+ my $delays = $data->{'delay_cnt'} - $old->{'delay_cnt'};
+ my $d_tps = $delays / $etime;
+ my $del_t = $delays > 0 ?
+ ($data->{'delay_time'} - $old->{'delay_time'}) / $delays : 0.0;
+
+ # Calculate the % time the VFS layer is active
+ my $r_b_pct = ((($data->{'rtime'} - $old->{'rtime'}) / $NANOSEC) /
+ $etime) * 100;
+ my $w_b_pct = ((($data->{'wtime'} - $old->{'wtime'}) / $NANOSEC) /
+ $etime) * 100;
+
+ if (! $HIDE_ZEROES || $reads != 0.0 || $writes != 0.0 ||
+ $nread != 0.0 || $nwritten != 0.0) {
+ printf($DATA_FMT, $reads, $writes, $nread, $nwritten, $r_actv,
+ $w_actv, $read_t, $writ_t, $r_b_pct, $w_b_pct,
+ $d_tps, $del_t, substr($zone, 0, 8), $zoneid);
+ }
+
+ # Save current calculations for next loop
+ foreach (@fields) { $old->{$_} = $data->{$_}; }
+}
+
+sub usage {
+ print STDERR <<END;
+USAGE: vfsstat [-hIMrzZ] [interval [count]]
+ eg, vfsstat # print summary since zone boot
+ vfsstat 1 # print continually every 1 second
+ vfsstat 1 5 # print 5 times, every 1 second
+ vfsstat -I # print results per interval (where applicable)
+ vfsstat -M # print results in MB/s
+ vfsstat -r # print results in comma-separated format
+ vfsstat -z # hide zones with no VFS activity
+ vfsstat -Z # print results for all zones
+END
+ exit 1;
+}
diff --git a/usr/src/cmd/stat/ziostat/Makefile b/usr/src/cmd/stat/ziostat/Makefile
new file mode 100644
index 0000000000..c338b59678
--- /dev/null
+++ b/usr/src/cmd/stat/ziostat/Makefile
@@ -0,0 +1,41 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+include $(SRC)/cmd/Makefile.cmd
+
+PROG= ziostat
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+install: all .WAIT $(ROOTPROG)
+
+clean:
+
+$(ROOTBINPROG): $(PROG)
+ $(INS.file)
+
+lint:
+
+include $(SRC)/cmd/Makefile.targ
diff --git a/usr/src/cmd/stat/ziostat/ziostat.pl b/usr/src/cmd/stat/ziostat/ziostat.pl
new file mode 100755
index 0000000000..cf95d2f5a5
--- /dev/null
+++ b/usr/src/cmd/stat/ziostat/ziostat.pl
@@ -0,0 +1,204 @@
+#!/usr/perl5/bin/perl -w
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011 Joyent, Inc.
+#
+# ziostat - report I/O statistics per zone
+#
+# USAGE: ziostat [-hIMrzZ] [interval [count]]
+# -h # help
+# -I # print results per interval (where applicable)
+# -M # print results in MB/s
+# -r # print data in comma-separated format
+# -z # hide zones with no ZFS I/O activity
+# -Z # print data for all zones
+#
+# eg, ziostat # print summary since zone boot
+# ziostat 1 # print continually every 1 second
+# ziostat 1 5 # print 5 times, every 1 second
+#
+# NOTES:
+#
+# - The calculations and output fields emulate those from iostat(1M) as closely
+# as possible. When only one zone is actively performing disk I/O, the
+# results from iostat(1M) in the global zone and ziostat in the local zone
+# should be almost identical.
+#
+# - As with iostat(1M), a result of 100% for disk utilization does not mean that
+# the disk is fully saturated. Instead, that measurement just shows that at
+# least one operation was pending over the last quanta of time examined.
+# Since disk devices can process more than one operation concurrently, this
+# measurement will frequently be 100% but the disk can still offer higher
+# performance.
+#
+# - This script is based on Brendan Gregg's K9Toolkit examples:
+#
+# http://www.brendangregg.com/k9toolkit.html
+#
+
+use Getopt::Std;
+use Sun::Solaris::Kstat;
+my $Kstat = Sun::Solaris::Kstat->new();
+
+# Process command line args
+usage() if defined $ARGV[0] and $ARGV[0] eq "--help";
+getopts('hIMrzZ') or usage();
+usage() if defined $main::opt_h;
+$main::opt_h = 0;
+
+my $USE_MB = defined $main::opt_M ? $main::opt_M : 0;
+my $USE_INTERVAL = defined $main::opt_I ? $main::opt_I : 0;
+my $USE_COMMA = defined $main::opt_r ? $main::opt_r : 0;
+my $HIDE_ZEROES = defined $main::opt_z ? $main::opt_z : 0;
+my $ALL_ZONES = defined $main::opt_Z ? $main::opt_Z : 0;
+
+my ($interval, $count);
+if ( defined($ARGV[0]) ) {
+ $interval = $ARGV[0];
+ $count = defined ($ARGV[1]) ? $ARGV[1] : 2**32;
+ usage() if ($interval == 0);
+} else {
+ $interval = 1;
+ $count = 1;
+}
+
+my $HEADER_FMT = $USE_COMMA ?
+ "r/%s,%sr/%s,actv,wsvc_t,asvc_t,%%b,zone\n" :
+ " r/%s %sr/%s actv wsvc_t asvc_t %%b zone\n";
+my $DATA_FMT = $USE_COMMA ?
+ "%.1f,%.1f,%.1f,%.1f,%.1f,%d,%s,%d\n" :
+ " %6.1f %6.1f %6.1f %6.1f %6.1f %3d %s (%d)\n";
+
+my $BYTES_PREFIX = $USE_MB ? "M" : "k";
+my $BYTES_DIVISOR = $USE_MB ? 1024 * 1024 : 1024;
+my $INTERVAL_SUFFIX = $USE_INTERVAL ? "i" : "s";
+my $NANOSEC = 1000000000;
+
+my @fields = ( 'reads', 'nread', 'waittime', 'rtime', 'rlentime', 'snaptime' );
+
+chomp(my $curzone = (`/sbin/zonename`));
+
+# Read list of visible zones and their zone IDs
+my @zones = ();
+my %zoneids = ();
+my $zoneadm = `zoneadm list -p | cut -d: -f1,2`;
+@lines = split(/\n/, $zoneadm);
+foreach $line (@lines) {
+ @tok = split(/:/, $line);
+ $zoneids->{$tok[1]} = $tok[0];
+ push(@zones, $tok[1]);
+}
+
+my %old = ();
+my $rows_printed = 0;
+
+$Kstat->update();
+
+for (my $ii = 0; $ii < $count; $ii++) {
+ # Print the column header every 20 rows
+ if ($rows_printed == 0 || $ALL_ZONES) {
+ printf($HEADER_FMT, $INTERVAL_SUFFIX, $BYTES_PREFIX,
+ $INTERVAL_SUFFIX, $INTERVAL_SUFFIX);
+ }
+
+ $rows_printed = $rows_printed >= 20 ? 0 : $rows_printed + 1;
+
+ foreach $zone (@zones) {
+ if ((!$ALL_ZONES) && ($zone ne $curzone)) {
+ next;
+ }
+
+ if (! defined $old->{$zone}) {
+ $old->{$zone} = ();
+ foreach $field (@fields) { $old->{$zone}->{$field} = 0; }
+ }
+
+ #
+ # Kstats have a 30-character limit (KSTAT_STRLEN) on their
+ # names, so if the zone name exceeds that limit, use the first
+ # 30 characters.
+ #
+ my $trimmed_zone = substr($zone, 0, 30);
+ my $zoneid = $zoneids->{$zone};
+
+ print_stats($zone, $zoneid,
+ $Kstat->{'zone_zfs'}{$zoneid}{$trimmed_zone}, $old->{$zone});
+ }
+
+ sleep ($interval);
+ $Kstat->update();
+}
+
+sub print_stats {
+ my $zone = $_[0];
+ my $zoneid = $_[1];
+ my $data = $_[2];
+ my $old = $_[3];
+
+ my $etime = $data->{'snaptime'} -
+ ($old->{'snaptime'} > 0 ? $old->{'snaptime'} : $data->{'crtime'});
+
+ # Calculate basic statistics
+ my $rate_divisor = $USE_INTERVAL ? 1 : $etime;
+ my $reads = ($data->{'reads'} - $old->{'reads'}) / $rate_divisor;
+ my $nread = ($data->{'nread'} - $old->{'nread'}) /
+ $rate_divisor / $BYTES_DIVISOR;
+
+ # Calculate overall transactions per second
+ my $ops = $data->{'reads'} - $old->{'reads'};
+ my $tps = $ops / $etime;
+
+ # Calculate average length of disk run queue
+ my $actv = (($data->{'rlentime'} - $old->{'rlentime'}) / $NANOSEC) /
+ $etime;
+
+ # Calculate average disk wait and service times
+ my $wsvc = $ops > 0 ? (($data->{'waittime'} - $old->{'waittime'}) /
+ 1000000) / $ops : 0.0;
+ my $asvc = $tps > 0 ? $actv * (1000 / $tps) : 0.0;
+
+ # Calculate the % time the disk run queue is active
+ my $b_pct = ((($data->{'rtime'} - $old->{'rtime'}) / $NANOSEC) /
+ $etime) * 100;
+
+ if (! $HIDE_ZEROES || $reads != 0.0 || $nread != 0.0 ) {
+ printf($DATA_FMT, $reads, $nread, $actv, $wsvc, $asvc,
+ $b_pct, substr($zone, 0, 8), $zoneid);
+ }
+
+ # Save current calculations for next loop
+ foreach (@fields) { $old->{$_} = $data->{$_}; }
+}
+
+sub usage {
+ print STDERR <<END;
+USAGE: ziostat [-hIMrzZ] [interval [count]]
+ eg, ziostat # print summary since zone boot
+ ziostat 1 # print continually every 1 second
+ ziostat 1 5 # print 5 times, every 1 second
+ ziostat -I # print results per interval (where applicable)
+ ziostat -M # print results in MB/s
+ ziostat -r # print results in comma-separated format
+ ziostat -z # hide zones with no ZFS I/O activity
+ ziostat -Z # print results for all zones
+END
+ exit 1;
+}
diff --git a/usr/src/cmd/svc/configd/rc_node.c b/usr/src/cmd/svc/configd/rc_node.c
index 3cc30e3e67..149f2a6cb5 100644
--- a/usr/src/cmd/svc/configd/rc_node.c
+++ b/usr/src/cmd/svc/configd/rc_node.c
@@ -23,6 +23,9 @@
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
/*
* rc_node.c - In-memory SCF object management
diff --git a/usr/src/cmd/svc/milestone/net-routing-setup b/usr/src/cmd/svc/milestone/net-routing-setup
index 6ab1a6c7f0..545004b147 100644
--- a/usr/src/cmd/svc/milestone/net-routing-setup
+++ b/usr/src/cmd/svc/milestone/net-routing-setup
@@ -21,11 +21,15 @@
#
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
# This script configures IP routing.
. /lib/svc/share/smf_include.sh
+set -o xtrace
+
#
# In a shared-IP zone we need this service to be up, but all of the work
# it tries to do is irrelevant (and will actually lead to the service
@@ -156,7 +160,8 @@ fi
# however, as persistent daemon state is now controlled by SMF.
#
ipv4_routing_set=`/usr/bin/svcprop -p routeadm/ipv4-routing-set $SMF_FMRI`
-if [ -z "$defrouters" ]; then
+if [ -z "$defrouters" ] && \
+ [ `/usr/bin/bootparams | grep "^smartos"` != "" ]; then
#
# Set default value for ipv4-routing to enabled. If routeadm -e/-d
# has not yet been run by the administrator, we apply this default.
@@ -210,5 +215,11 @@ if [ -f /etc/inet/static_routes ]; then
done
fi
+#
+# Log the result
+#
+echo "Routing setup complete:"
+/usr/bin/netstat -rn
+
# Clear exit status.
exit $SMF_EXIT_OK
diff --git a/usr/src/cmd/svc/milestone/network-location.xml b/usr/src/cmd/svc/milestone/network-location.xml
index aad337f42f..709e9df8f3 100644
--- a/usr/src/cmd/svc/milestone/network-location.xml
+++ b/usr/src/cmd/svc/milestone/network-location.xml
@@ -106,7 +106,7 @@
-->
<dependency
name='manifest-import'
- grouping='require_all'
+ grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/manifest-import:default' />
diff --git a/usr/src/cmd/svc/milestone/network-routing-setup.xml b/usr/src/cmd/svc/milestone/network-routing-setup.xml
index b34d578e2a..85a74756da 100644
--- a/usr/src/cmd/svc/milestone/network-routing-setup.xml
+++ b/usr/src/cmd/svc/milestone/network-routing-setup.xml
@@ -40,11 +40,19 @@
<!-- loopback/physical network configuration is required -->
<dependency
- name='network'
- grouping='optional_all'
+ name='loopback'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/network/loopback' />
+ </dependency>
+
+ <dependency
+ name='physical'
+ grouping='require_all'
restart_on='none'
type='service'>
- <service_fmri value='svc:/milestone/network' />
+ <service_fmri value='svc:/network/physical' />
</dependency>
<!-- usr filesystem required to run routing-related commands -->
diff --git a/usr/src/cmd/svc/milestone/network.xml b/usr/src/cmd/svc/milestone/network.xml
index 75b5578f44..48386ebf73 100644
--- a/usr/src/cmd/svc/milestone/network.xml
+++ b/usr/src/cmd/svc/milestone/network.xml
@@ -54,6 +54,14 @@
<service_fmri value='svc:/network/physical' />
</dependency>
+ <dependency
+ name='routing-setup'
+ grouping='require_all'
+ restart_on='none'
+ type='service'>
+ <service_fmri value='svc:/network/routing-setup' />
+ </dependency>
+
<exec_method
type='method'
name='start'
diff --git a/usr/src/cmd/svc/milestone/single-user.xml b/usr/src/cmd/svc/milestone/single-user.xml
index cbb93fd3b3..a9eb0cfa7e 100644
--- a/usr/src/cmd/svc/milestone/single-user.xml
+++ b/usr/src/cmd/svc/milestone/single-user.xml
@@ -95,7 +95,7 @@
<dependency
name='manifests'
- grouping='require_all'
+ grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/manifest-import' />
diff --git a/usr/src/cmd/svc/shell/smf_include.sh b/usr/src/cmd/svc/shell/smf_include.sh
index d0dc387246..02c9532763 100644
--- a/usr/src/cmd/svc/shell/smf_include.sh
+++ b/usr/src/cmd/svc/shell/smf_include.sh
@@ -22,6 +22,7 @@
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2012 Joyent, Inc. All rights reserved.
#
smf_present () {
@@ -234,7 +235,12 @@ smf_kill_contract() {
# SMF_EXIT_ERR_OTHER, although not defined, encompasses all non-zero
# exit status values.
#
+# The SMF_EXIT_NODAEMON exit status should be used when a method does not
+# need to run any persistent process. This indicates success, abandons the
+# contract, and allows dependencies to be met.
+#
SMF_EXIT_OK=0
+SMF_EXIT_NODAEMON=94
SMF_EXIT_ERR_FATAL=95
SMF_EXIT_ERR_CONFIG=96
SMF_EXIT_MON_DEGRADE=97
diff --git a/usr/src/cmd/svc/startd/graph.c b/usr/src/cmd/svc/startd/graph.c
index 7fbf17a6ec..c8e0872ff8 100644
--- a/usr/src/cmd/svc/startd/graph.c
+++ b/usr/src/cmd/svc/startd/graph.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -141,6 +142,8 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <fm/libfmevent.h>
#include <libscf.h>
#include <libscf_priv.h>
@@ -4875,6 +4878,20 @@ vertex_subgraph_dependencies_shutdown(scf_handle_t *h, graph_vertex_t *v,
was_up = up_state(old_state);
now_up = up_state(v->gv_state);
+ if (halting != -1 && old_state == RESTARTER_STATE_DISABLED &&
+ v->gv_state != RESTARTER_STATE_DISABLED) {
+ /*
+ * We're halting and we have a svc which is transitioning to
+ * offline in parallel. This leads to a race condition where
+ * gt_enter_offline might re-enable the svc after we disabled
+ * it. Since we're halting, we want to ensure no svc ever
+ * transitions out of the disabled state. In this case, modify
+ * the flags to keep us on the halting path.
+ */
+ was_up = 0;
+ now_up = 0;
+ }
+
if (!was_up && now_up) {
++non_subgraph_svcs;
} else if (was_up && !now_up) {
@@ -6827,6 +6844,7 @@ repository_event_thread(void *unused)
char *fmri = startd_alloc(max_scf_fmri_size);
char *pg_name = startd_alloc(max_scf_value_size);
int r;
+ int fd;
h = libscf_handle_create_bound_loop();
@@ -6849,6 +6867,14 @@ retry:
goto retry;
}
+ if ((fd = open("/etc/svc/volatile/startd.ready", O_RDONLY | O_CREAT,
+ S_IRUSR)) < 0) {
+ log_error(LOG_WARNING, "Couldn't create startd.ready file\n",
+ SCF_GROUP_FRAMEWORK, scf_strerror(scf_error()));
+ } else {
+ (void) close(fd);
+ }
+
/*CONSTCOND*/
while (1) {
ssize_t res;
diff --git a/usr/src/cmd/svc/startd/method.c b/usr/src/cmd/svc/startd/method.c
index cc9ce6768c..c3cd0144c1 100644
--- a/usr/src/cmd/svc/startd/method.c
+++ b/usr/src/cmd/svc/startd/method.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Joyent Inc.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/*
@@ -100,34 +100,18 @@ static uint_t method_events[] = {
* method_record_start(restarter_inst_t *)
* Record a service start for rate limiting. Place the current time
* in the circular array of instance starts.
+ *
+ * Save the critical_failure_period and critical_failure_allowed with either
+ * the defaults or the svc properties startd/critical_failure_count and
+ * startd/critical_failure_period.
+ * ri_crit_fail_allowed is capped at RINST_START_TIMES.
*/
static void
method_record_start(restarter_inst_t *inst)
{
- int index = inst->ri_start_index++ % RINST_START_TIMES;
-
- inst->ri_start_time[index] = gethrtime();
-}
-
-/*
- * method_rate_critical(restarter_inst_t *)
- * Return true if the average start interval is less than the permitted
- * interval. The implicit interval defaults to RINST_FAILURE_RATE_NS and
- * RINST_START_TIMES but may be overridden with the svc properties
- * startd/critical_failure_count and startd/critical_failure_period
- * which represent the number of failures to consider and the amount of
- * time in seconds in which that number may occur, respectively. Note that
- * this time is measured as of the transition to 'enabled' rather than wall
- * clock time.
- * Implicit success if insufficient measurements for an average exist.
- */
-int
-method_rate_critical(restarter_inst_t *inst)
-{
+ int index;
+ uint_t critical_failure_allowed = RINST_START_TIMES;
hrtime_t critical_failure_period;
- uint_t critical_failure_count = RINST_START_TIMES;
- uint_t n = inst->ri_start_index;
- hrtime_t avg_ns = 0;
uint64_t scf_fr, scf_st;
scf_propvec_t *prop = NULL;
scf_propvec_t restart_critical[] = {
@@ -151,17 +135,48 @@ method_rate_critical(restarter_inst_t *inst)
* in seconds but tracked in ns
*/
critical_failure_period = (hrtime_t)scf_fr * NANOSEC;
- critical_failure_count = (uint_t)scf_st;
+ critical_failure_allowed = (uint_t)scf_st;
+
+ if (critical_failure_allowed > RINST_START_TIMES)
+ critical_failure_allowed = RINST_START_TIMES;
+ if (critical_failure_allowed < 1)
+ critical_failure_allowed = 1;
+
}
- if (inst->ri_start_index < critical_failure_count)
+
+ inst->ri_crit_fail_allowed = critical_failure_allowed;
+ inst->ri_crit_fail_period = critical_failure_period;
+
+ index = inst->ri_start_index++ % critical_failure_allowed;
+ inst->ri_start_time[index] = gethrtime();
+}
+
+/*
+ * method_rate_critical(restarter_inst_t *)
+ * Return true if the number of failures within the interval
+ * ri_crit_fail_period exceeds ri_crit_fail_allowed. The allowed failure
+ * count defaults to RINST_START_TIMES and the implicit interval defaults
+ * to RINST_FAILURE_RATE_NS but may be overridden with the svc properties
+ * startd/critical_failure_count and startd/critical_failure_period which
+ * represent the acceptable number of failures and the amount of time in
+ * seconds in which that number may occur, respectively. Note that this time
+ * is measured as of the transition to 'enabled' rather than wall clock
+ * time. Implicitly not critical if insufficient failures have occured.
+ */
+int
+method_rate_critical(restarter_inst_t *inst)
+{
+ uint_t n = inst->ri_start_index;
+ uint_t fail_allowed = inst->ri_crit_fail_allowed;
+ hrtime_t diff_ns;
+
+ if (n < fail_allowed)
return (0);
- avg_ns =
- (inst->ri_start_time[(n - 1) % critical_failure_count] -
- inst->ri_start_time[n % critical_failure_count]) /
- (critical_failure_count - 1);
+ diff_ns = inst->ri_start_time[(n - 1) % fail_allowed] -
+ inst->ri_start_time[n % fail_allowed];
- return (avg_ns < critical_failure_period);
+ return (diff_ns < inst->ri_crit_fail_period);
}
/*
@@ -989,7 +1004,8 @@ method_run(restarter_inst_t **instp, int type, int *exit_code)
goto contract_out;
}
- if (!WIFEXITED(ret_status)) {
+ if (!WIFEXITED(ret_status) &&
+ WEXITSTATUS(ret_status) != SMF_EXIT_NODAEMON) {
/*
* If method didn't exit itself (it was killed by an
* external entity, etc.), consider the entire
@@ -1018,7 +1034,7 @@ method_run(restarter_inst_t **instp, int type, int *exit_code)
}
*exit_code = WEXITSTATUS(ret_status);
- if (*exit_code != 0) {
+ if (*exit_code != 0 && *exit_code != SMF_EXIT_NODAEMON) {
log_error(LOG_WARNING,
"%s: Method \"%s\" failed with exit status %d.\n",
inst->ri_i.i_fmri, method, WEXITSTATUS(ret_status));
@@ -1027,6 +1043,7 @@ method_run(restarter_inst_t **instp, int type, int *exit_code)
log_instance(inst, B_TRUE, "Method \"%s\" exited with status "
"%d.", mname, *exit_code);
+ /* Note: we will take this path for SMF_EXIT_NODAEMON */
if (*exit_code != 0)
goto contract_out;
@@ -1073,7 +1090,10 @@ assured_kill:
}
contract_out:
- /* Abandon contracts for transient methods & methods that fail. */
+ /*
+ * Abandon contracts for transient methods, methods that exit with
+ * SMF_EXIT_NODAEMON & methods that fail.
+ */
transient = method_is_transient(inst, type);
if ((transient || *exit_code != 0 || result != 0) &&
(restarter_is_kill_method(method) < 0))
@@ -1169,7 +1189,7 @@ retry:
r = method_run(&inst, info->sf_method_type, &exit_code);
- if (r == 0 && exit_code == 0) {
+ if (r == 0 && (exit_code == 0 || exit_code == SMF_EXIT_NODAEMON)) {
/* Success! */
assert(inst->ri_i.i_next_state != RESTARTER_STATE_NONE);
@@ -1187,6 +1207,12 @@ retry:
else
method_remove_contract(inst, B_TRUE, B_TRUE);
}
+
+ /*
+ * For methods that exit with SMF_EXIT_NODAEMON, we already
+ * called method_remove_contract in method_run.
+ */
+
/*
* We don't care whether the handle was rebound because this is
* the last thing we do with it.
diff --git a/usr/src/cmd/svc/startd/restarter.c b/usr/src/cmd/svc/startd/restarter.c
index 6adb323289..53271ab039 100644
--- a/usr/src/cmd/svc/startd/restarter.c
+++ b/usr/src/cmd/svc/startd/restarter.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -1572,6 +1572,22 @@ event_from_tty(scf_handle_t *h, restarter_inst_t *rip)
return (ret);
}
+static boolean_t
+restart_dump(scf_handle_t *h, restarter_inst_t *rip)
+{
+ scf_instance_t *inst;
+ boolean_t ret = B_FALSE;
+
+ if (libscf_fmri_get_instance(h, rip->ri_i.i_fmri, &inst))
+ return (-1);
+
+ if (restarter_inst_dump(inst) == 1)
+ ret = B_TRUE;
+
+ scf_instance_destroy(inst);
+ return (ret);
+}
+
static void
maintain_instance(scf_handle_t *h, restarter_inst_t *rip, int immediate,
restarter_str_t reason)
@@ -1865,8 +1881,14 @@ again:
* Stop the instance. If it can be restarted,
* the graph engine will send a new event.
*/
- if (stop_instance(h, inst, RSTOP_RESTART) == 0)
+ if (restart_dump(h, inst)) {
+ (void) contract_kill(
+ inst->ri_i.i_primary_ctid, SIGABRT,
+ inst->ri_i.i_fmri);
+ } else if (stop_instance(h, inst,
+ RSTOP_RESTART) == 0) {
reset_start_times(inst);
+ }
}
break;
diff --git a/usr/src/cmd/svc/startd/startd.c b/usr/src/cmd/svc/startd/startd.c
index 6e3ea9876b..c3705c0c5c 100644
--- a/usr/src/cmd/svc/startd/startd.c
+++ b/usr/src/cmd/svc/startd/startd.c
@@ -42,6 +42,136 @@
* engine commands by executing methods, updating the repository, and sending
* feedback (mostly state updates) to the graph engine.
*
+ * Overview of the SMF Architecture
+ *
+ * There are a few different components that make up SMF and are responsible
+ * for different pieces of functionality that are used:
+ *
+ * svc.startd(1M): A daemon that is in charge of starting, stopping, and
+ * restarting services and instances
+ * svc.configd: A daemon that manages the repository that stores information,
+ * property groups, and state of the different services and instances
+ * libscf(3LIB): A C library that provides the glue for communicating,
+ * accessing, and updating information about services and instances
+ * svccfg(1M): A utility to add and remove services as well as change the
+ * properties associated with different services and instances.
+ * svcadm(1M): A utility to control the different instance of a service. You
+ * can use this to enable and disable them among some other useful things.
+ * svcs(1): A utility that reports on the status of various services on the
+ * system
+ *
+ * The following block diagram explains how these components communicate:
+ *
+ * The SMF Block Diagram
+ * Repository
+ * This attempts to show ___________ __________
+ * the relations between | | SQL | |
+ * the different pieces | configd |<----------->| SQLite |
+ * that make SMF work and | | Transaction | |
+ * users/administrators ----------- ----------
+ * call into. /|\ /|\
+ * | |
+ * door_call(3C)| | door_call(3C)
+ * | |
+ * \|/ \|/
+ * ____________ __________ __________ ____________
+ * | | | | | | | svccfg |
+ * | startd |<--->| libscf | | libscf |<---->| svcadm |
+ * | | | (3LIB) | | (3LIB) | | svcs |
+ * ------------ ---------- ---------- ------------
+ * /|\ /|\
+ * | | fork(2)/exec(2)
+ * | | libcontract(3LIB)
+ * \|/ \|/ Various System/User services
+ * ---------------------------------------------------------------------
+ * | system/filesystem/local:default system/coreadm:default |
+ * | network/lookpback:default system/zones:default |
+ * | network/ntp:default system/cron:default |
+ * | smartdc/agent/ca/cainstsvc:default network/ssh:default |
+ * | appliance/kit/akd:default system/svc/restarter:default |
+ * ---------------------------------------------------------------------
+ *
+ * Chatting with configd and sharing repository information
+ *
+ * As you run commands with svcs, svccfg, and svcadm, they are all creating a
+ * libscf handle to communicate with configd. As calls are made via libscf they
+ * ultimately go and talk to configd to get information. However, how we
+ * actually are talking to configd is not as straightforward as it appears.
+ *
+ * When configd starts up it creates a door located at
+ * /etc/svc/volatile/repository_door. This door runs the routine called
+ * main_switcher() from usr/src/cmd/svc/configd/maindoor.c. When you first
+ * invoke svc(cfg|s|adm), one of the first things that occurs is creating a
+ * scf_handle_t and binding it to configd by calling scf_handle_bind(). This
+ * function makes a door call to configd and gets returned a new file
+ * descriptor. This file descriptor is itself another door which calls into
+ * configd's client_switcher(). This is the door that is actually used when
+ * getting and fetching properties, and many other useful things.
+ *
+ * svc.startd needs a way to notice the changes that occur to the repository.
+ * For example, if you enabled a service that was not previously running, it's
+ * up to startd to notice that this has happened, check dependencies, and
+ * eventually start up the service. The way it gets these notifications is via
+ * a thread who's sole purpose in life is to call _scf_notify_wait(). This
+ * function acts like poll(2) but for changes that occur in the repository.
+ * Once this thread gets the event, it dispatches the event appropriately.
+ *
+ * The Events of svc.startd
+ *
+ * svc.startd has to handle a lot of complexity. Understanding how you go from
+ * getting the notification that a service was enabled to actually enabling it
+ * is not obvious from a cursory glance. The first thing to keep in mind is
+ * that startd maintains a graph of all the related services and instances so
+ * it can keep track of what is enabled, what dependencies exist, etc. all so
+ * that it can answer the question of what is affected by a change. Internally
+ * there are a lot of different queues for events, threads to process these
+ * queues, and different paths to have events enter these queues. What follows
+ * is a diagram that attempts to explain some of those paths, though it's
+ * important to note that for some of these pieces, such as the graph and
+ * vertex events, there are many additional ways and code paths these threads
+ * and functions can take. And yes, restarter_event_enqueue() is not the same
+ * thing as restarter_queue_event().
+ *
+ * Threads/Functions Queues Threads/Functions
+ *
+ * called by various
+ * ------------------ --------- ---------------
+ * --->| graph_protocol | graph_event | graph | graph_event_ | graph_event |
+ * --->| _send_event() |------------>| event |----------------->| _thread |
+ * ------------------ _enqueue() | queue | dequeue() ---------------
+ * --------- |
+ * _scf_notify_wait() vertex_send_event()|
+ * | \|/
+ * | -------------------- ----------------------
+ * |->| repository_event | vertex_send_event() | restarter_protocol |
+ * | _thread |----------------------------->| _send_event() |
+ * -------------------- ----------------------
+ * | | out to other
+ * restarter_ restarter_ | | restarters
+ * event_dequeue() ------------- event_ | | not startd
+ * |----------------| restarter |<------------| |------------->
+ * \|/ | event | enqueue()
+ * ------------------- | queue | |------------------>
+ * | restarter_event | ------------- ||----------------->
+ * | _thread | |||---------------->
+ * ------------------- ||| start/stop inst
+ * | ---------------- ----------------------
+ * | | instance | | restarter_process_ |
+ * |-------------->| event |------>| events |
+ * restarter_ | queue | | per-instance lwp |
+ * queue_event() ---------------- ----------------------
+ * ||| various funcs
+ * ||| controlling
+ * ||| instance state
+ * |||--------------->
+ * ||---------------->
+ * |----------------->
+ *
+ * What's important to take away is that there is a queue for each instance on
+ * the system that handles events related to dealing directly with that
+ * instance and that events can be added to it because of changes to properties
+ * that are made to configd and acted upon asynchronously by startd.
+ *
* Error handling
*
* In general, when svc.startd runs out of memory it reattempts a few times,
diff --git a/usr/src/cmd/svc/startd/startd.h b/usr/src/cmd/svc/startd/startd.h
index c1062e45e0..e204fb829f 100644
--- a/usr/src/cmd/svc/startd/startd.h
+++ b/usr/src/cmd/svc/startd/startd.h
@@ -405,7 +405,7 @@ typedef enum {
#define RINST_RETAKE_MASK 0x0f000000
-#define RINST_START_TIMES 5 /* failures to consider */
+#define RINST_START_TIMES 10 /* up to 10 fails to consider */
#define RINST_FAILURE_RATE_NS 600000000000LL /* 1 failure/10 minutes */
#define RINST_WT_SVC_FAILURE_RATE_NS NANOSEC /* 1 failure/second */
@@ -427,6 +427,8 @@ typedef struct restarter_inst {
hrtime_t ri_start_time[RINST_START_TIMES];
uint_t ri_start_index; /* times started */
+ uint_t ri_crit_fail_allowed;
+ hrtime_t ri_crit_fail_period;
uu_list_node_t ri_link;
pthread_mutex_t ri_lock;
diff --git a/usr/src/cmd/svc/svcadm/Makefile b/usr/src/cmd/svc/svcadm/Makefile
index cc0cc160bf..1a6a0dd35c 100644
--- a/usr/src/cmd/svc/svcadm/Makefile
+++ b/usr/src/cmd/svc/svcadm/Makefile
@@ -21,6 +21,7 @@
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2012, Joyent, Inc. All rights reserved.
#
PROG = svcadm
@@ -49,7 +50,11 @@ $(PROG): $(OBJS)
$(POFILE): $(POFILES)
cat $(POFILES) > $(POFILE)
-install: all $(ROOTUSRSBINPROG)
+install: all $(ROOTSBINPROG) $(ROOTUSRSBINPROG)
+
+$(ROOTUSRSBINPROG):
+ -$(RM) $@
+ -$(SYMLINK) ../../sbin/$(PROG) $@
clean:
$(RM) $(OBJS)
diff --git a/usr/src/cmd/svc/svcadm/svcadm.c b/usr/src/cmd/svc/svcadm/svcadm.c
index f3d34acc03..74734c21e4 100644
--- a/usr/src/cmd/svc/svcadm/svcadm.c
+++ b/usr/src/cmd/svc/svcadm/svcadm.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -63,6 +63,8 @@
#define EXIT_SVC_FAILURE 3
#define EXIT_DEP_FAILURE 4
+#define WALK_FLAGS (SCF_WALK_UNIPARTIAL | SCF_WALK_MULTIPLE)
+
/*
* How long we will wait (in seconds) for a service to change state
* before re-checking its dependencies.
@@ -71,7 +73,7 @@
#ifndef NDEBUG
#define bad_error(func, err) { \
- uu_warn("%s:%d: %s() failed with unexpected error %d.\n", \
+ pr_warn("%s:%d: %s() failed with unexpected error %d.\n", \
__FILE__, __LINE__, (func), (err)); \
abort(); \
}
@@ -99,6 +101,9 @@ static const char *emsg_no_service;
static int exit_status = 0;
static int verbose = 0;
static char *scratch_fmri;
+static char *g_zonename = NULL;
+static char svcstate[80];
+static boolean_t svcsearch = B_FALSE;
static struct ht_elt **visited;
@@ -106,6 +111,7 @@ void do_scfdie(int lineno) __NORETURN;
static void usage_milestone(void) __NORETURN;
static void set_astring_prop(const char *, const char *, const char *,
uint32_t, const char *, const char *);
+static void pr_warn(const char *format, ...);
/*
* Visitors from synch.c, needed for enable -s and disable -s.
@@ -145,13 +151,14 @@ static void
usage()
{
(void) fprintf(stderr, gettext(
- "Usage: %1$s [-v] [-z zone] [cmd [args ... ]]\n\n"
- "\t%1$s enable [-rst] <service> ...\t- enable and online service(s)\n"
- "\t%1$s disable [-st] <service> ...\t- disable and offline service(s)\n"
- "\t%1$s restart <service> ...\t\t- restart specified service(s)\n"
- "\t%1$s refresh <service> ...\t\t- re-read service configuration\n"
- "\t%1$s mark [-It] <state> <service> ...\t- set maintenance state\n"
- "\t%1$s clear <service> ...\t\t- clear maintenance state\n"
+ "Usage: %1$s [-S <state>] [-v] [-Z | -z zone] [cmd [args ... ]]\n\n"
+ "\t%1$s enable [-rst] [<service> ...]\t- enable and online service(s)\n"
+ "\t%1$s disable [-st] [<service> ...]\t- disable and offline "
+ "service(s)\n"
+ "\t%1$s restart [-d] [<service> ...]\t- restart specified service(s)\n"
+ "\t%1$s refresh [<service> ...]\t\t- re-read service configuration\n"
+ "\t%1$s mark [-It] <state> [<service> ...] - set maintenance state\n"
+ "\t%1$s clear [<service> ...]\t\t- clear maintenance state\n"
"\t%1$s milestone [-d] <milestone>\t- advance to a service milestone\n"
"\n\t"
"Services can be specified using an FMRI, abbreviation, or fnmatch(5)\n"
@@ -1681,6 +1688,15 @@ set_fmri_enabled(void *data, scf_walkinfo_t *wip)
assert(wip->inst != NULL);
assert(wip->pg == NULL);
+ if (svcsearch) {
+ char state[MAX_SCF_STATE_STRING_SZ];
+
+ if (inst_get_state(wip->inst, state, wip->fmri, NULL) != 0)
+ return (0);
+ if (strcmp(state, svcstate) != 0)
+ return (0);
+ }
+
if (flags & SET_RECURSIVE) {
char *fmri_buf = malloc(max_scf_fmri_sz);
if (fmri_buf == NULL)
@@ -1857,6 +1873,9 @@ clear_instance(void *data, scf_walkinfo_t *wip)
if (inst_get_state(wip->inst, state, wip->fmri, NULL) != 0)
return (0);
+ if (svcsearch && strcmp(state, svcstate) != 0)
+ return (0);
+
if (strcmp(state, SCF_STATE_STRING_MAINT) == 0) {
set_inst_action(wip->fmri, wip->inst, SCF_PROPERTY_MAINT_OFF);
} else if (strcmp(state, SCF_STATE_STRING_DEGRADED) ==
@@ -1877,6 +1896,15 @@ set_fmri_action(void *action, scf_walkinfo_t *wip)
{
assert(wip->inst != NULL && wip->pg == NULL);
+ if (svcsearch) {
+ char state[MAX_SCF_STATE_STRING_SZ];
+
+ if (inst_get_state(wip->inst, state, wip->fmri, NULL) != 0)
+ return (0);
+ if (strcmp(state, svcstate) != 0)
+ return (0);
+ }
+
set_inst_action(wip->fmri, wip->inst, action);
return (0);
@@ -1899,6 +1927,9 @@ force_degraded(void *data, scf_walkinfo_t *wip)
return (0);
}
+ if (svcsearch && strcmp(state, svcstate) != 0)
+ return (0);
+
if (strcmp(state, SCF_STATE_STRING_ONLINE) != 0) {
uu_warn(gettext("Instance \"%s\" is not online.\n"), wip->fmri);
exit_status = 1;
@@ -1917,6 +1948,15 @@ force_maintenance(void *data, scf_walkinfo_t *wip)
int flags = (int)data;
const char *prop;
+ if (svcsearch) {
+ char state[MAX_SCF_STATE_STRING_SZ];
+
+ if (inst_get_state(wip->inst, state, wip->fmri, NULL) != 0)
+ return (0);
+ if (strcmp(state, svcstate) != 0)
+ return (0);
+ }
+
if (flags & MARK_IMMEDIATE) {
prop = (flags & MARK_TEMPORARY) ?
SCF_PROPERTY_MAINT_ON_IMMTEMP :
@@ -2069,6 +2109,31 @@ validate_milestone(const char *milestone)
/* NOTREACHED */
}
+/*PRINTFLIKE1*/
+static void
+pr_warn(const char *format, ...)
+{
+ const char *pname = uu_getpname();
+ va_list alist;
+
+ va_start(alist, format);
+
+ if (pname != NULL)
+ (void) fprintf(stderr, "%s", pname);
+
+ if (g_zonename != NULL)
+ (void) fprintf(stderr, " (%s)", g_zonename);
+
+ (void) fprintf(stderr, ": ");
+
+ (void) vfprintf(stderr, format, alist);
+
+ if (strrchr(format, '\n') == NULL)
+ (void) fprintf(stderr, ": %s\n", strerror(errno));
+
+ va_end(alist);
+}
+
/*ARGSUSED*/
static void
quiet(const char *fmt, ...)
@@ -2082,6 +2147,13 @@ main(int argc, char *argv[])
int o;
int err;
int sw_back;
+ boolean_t do_zones = B_FALSE;
+ boolean_t do_a_zone = B_FALSE;
+ char zonename[ZONENAME_MAX];
+ uint_t nzents = 0, zent = 0;
+ zoneid_t *zids = NULL;
+ int orig_optind, orig_argc;
+ char **orig_argv;
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
@@ -2100,47 +2172,69 @@ main(int argc, char *argv[])
if (scratch_fmri == NULL)
uu_die(emsg_nomem);
- h = scf_handle_create(SCF_VERSION);
- if (h == NULL)
- scfdie();
-
- while ((o = getopt(argc, argv, "vz:")) != -1) {
+ while ((o = getopt(argc, argv, "S:vZz:")) != -1) {
switch (o) {
+ case 'S':
+ (void) strlcpy(svcstate, optarg, sizeof (svcstate));
+ svcsearch = B_TRUE;
+ break;
+
case 'v':
verbose = 1;
break;
- case 'z': {
- scf_value_t *zone;
-
+ case 'z':
if (getzoneid() != GLOBAL_ZONEID)
uu_die(gettext("svcadm -z may only be used "
"from the global zone\n"));
+ if (do_zones)
+ usage();
- if ((zone = scf_value_create(h)) == NULL)
- scfdie();
-
- if (scf_value_set_astring(zone, optarg) != SCF_SUCCESS)
- scfdie();
+ (void) strlcpy(zonename, optarg, sizeof (zonename));
+ do_a_zone = B_TRUE;
+ break;
- if (scf_handle_decorate(h, "zone", zone) != SCF_SUCCESS)
- uu_die(gettext("invalid zone '%s'\n"), optarg);
+ case 'Z':
+ if (getzoneid() != GLOBAL_ZONEID)
+ uu_die(gettext("svcadm -Z may only be used "
+ "from the global zone\n"));
+ if (do_a_zone)
+ usage();
- scf_value_destroy(zone);
+ do_zones = B_TRUE;
break;
- }
default:
usage();
}
}
- if (scf_handle_bind(h) == -1)
- uu_die(gettext("Couldn't bind to configuration repository: "
- "%s.\n"), scf_strerror(scf_error()));
+ while (do_zones) {
+ uint_t found;
- if (optind >= argc)
- usage();
+ if (zone_list(NULL, &nzents) != 0)
+ uu_die(gettext("could not get number of zones"));
+
+ if ((zids = malloc(nzents * sizeof (zoneid_t))) == NULL) {
+ uu_die(gettext("could not allocate array for "
+ "%d zone IDs"), nzents);
+ }
+
+ found = nzents;
+
+ if (zone_list(zids, &found) != 0)
+ uu_die(gettext("could not get zone list"));
+
+ /*
+ * If the number of zones has not changed between our calls to
+ * zone_list(), we're done -- otherwise, we must free our array
+ * of zone IDs and take another lap.
+ */
+ if (found == nzents)
+ break;
+
+ free(zids);
+ }
emsg_permission_denied = gettext("%s: Permission denied.\n");
emsg_nomem = gettext("Out of memory.\n");
@@ -2152,6 +2246,79 @@ main(int argc, char *argv[])
"property (permission denied).\n");
emsg_no_service = gettext("No such service \"%s\".\n");
+ orig_optind = optind;
+ orig_argc = argc;
+ orig_argv = argv;
+
+again:
+ h = scf_handle_create(SCF_VERSION);
+ if (h == NULL)
+ scfdie();
+
+ if (do_zones) {
+ zone_status_t status;
+
+ if (zone_getattr(zids[zent], ZONE_ATTR_STATUS, &status,
+ sizeof (status)) < 0 || status != ZONE_IS_RUNNING) {
+ /*
+ * If this zone is not running or we cannot
+ * get its status, we do not want to attempt
+ * to bind an SCF handle to it, lest we
+ * accidentally interfere with a zone that
+ * is not yet running by looking up a door
+ * to its svc.configd (which could potentially
+ * block a mount with an EBUSY).
+ */
+ zent++;
+ goto nextzone;
+ }
+
+ if (getzonenamebyid(zids[zent++], zonename,
+ sizeof (zonename)) < 0) {
+ uu_warn(gettext("could not get name for "
+ "zone %d; ignoring"), zids[zent - 1]);
+ goto nextzone;
+ }
+
+ g_zonename = zonename;
+ }
+
+ if (do_a_zone || do_zones) {
+ scf_value_t *zone;
+
+ if ((zone = scf_value_create(h)) == NULL)
+ scfdie();
+
+ if (scf_value_set_astring(zone, zonename) != SCF_SUCCESS)
+ scfdie();
+
+ if (scf_handle_decorate(h, "zone", zone) != SCF_SUCCESS) {
+ if (do_a_zone) {
+ uu_die(gettext("invalid zone '%s'\n"), optarg);
+ } else {
+ scf_value_destroy(zone);
+ goto nextzone;
+ }
+ }
+
+ scf_value_destroy(zone);
+ }
+
+ if (scf_handle_bind(h) == -1) {
+ if (do_zones)
+ goto nextzone;
+
+ uu_die(gettext("Couldn't bind to configuration repository: "
+ "%s.\n"), scf_strerror(scf_error()));
+ }
+
+ optind = orig_optind;
+ argc = orig_argc;
+ argv = orig_argv;
+
+ if (optind >= argc)
+ usage();
+
if (strcmp(argv[optind], "enable") == 0) {
int flags = SET_ENABLED;
int wait = 0;
@@ -2176,7 +2343,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (argc <= 0)
+ if (argc == 0 && !svcsearch)
+ usage();
+
+ if (argc > 0 && svcsearch)
usage();
/*
@@ -2185,18 +2355,18 @@ main(int argc, char *argv[])
* squelch output the second time we walk fmris; we saw
* the errors the first time.
*/
- if ((err = scf_walk_fmri(h, argc, argv, 0, set_fmri_enabled,
- (void *)flags, &error, uu_warn)) != 0) {
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ set_fmri_enabled, (void *)flags, &error, pr_warn)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
} else if (wait && exit_status == 0 &&
- (err = scf_walk_fmri(h, argc, argv, 0, wait_fmri_enabled,
- (void *)flags, &error, quiet)) != 0) {
+ (err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ wait_fmri_enabled, (void *)flags, &error, quiet)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
}
@@ -2226,7 +2396,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (argc <= 0)
+ if (argc == 0 && !svcsearch)
+ usage();
+
+ if (argc > 0 && svcsearch)
usage();
/*
@@ -2235,18 +2408,19 @@ main(int argc, char *argv[])
* squelch output the second time we walk fmris; we saw
* the errors the first time.
*/
- if ((err = scf_walk_fmri(h, argc, argv, 0, set_fmri_enabled,
- (void *)flags, &exit_status, uu_warn)) != 0) {
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ set_fmri_enabled, (void *)flags, &exit_status,
+ pr_warn)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
} else if (wait && exit_status == 0 &&
- (err = scf_walk_fmri(h, argc, argv, 0, wait_fmri_disabled,
- (void *)flags, &error, quiet)) != 0) {
+ (err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ wait_fmri_disabled, (void *)flags, &error, quiet)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
}
@@ -2255,29 +2429,62 @@ main(int argc, char *argv[])
exit_status = error;
} else if (strcmp(argv[optind], "restart") == 0) {
+ boolean_t do_dump = B_FALSE;
+
++optind;
- if (optind >= argc)
+ while ((o = getopt(argc, argv, "d")) != -1) {
+ if (o == 'd')
+ do_dump = B_TRUE;
+ else if (o == '?')
+ usage();
+ else {
+ assert(0);
+ abort();
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc == 0 && !svcsearch)
+ usage();
+
+ if (argc > 0 && svcsearch)
usage();
- if ((err = scf_walk_fmri(h, argc - optind, argv + optind, 0,
- set_fmri_action, (void *)SCF_PROPERTY_RESTART,
- &exit_status, uu_warn)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ if (do_dump) {
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ set_fmri_action, (void *)SCF_PROPERTY_DODUMP,
+ &exit_status, pr_warn)) != 0) {
+ pr_warn(gettext("failed to iterate over "
+ "instances: %s\n"), scf_strerror(err));
+ exit_status = UU_EXIT_FATAL;
+ }
+ }
+
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ set_fmri_action, (void *)SCF_PROPERTY_RESTART, &exit_status,
+ pr_warn)) != 0) {
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
}
} else if (strcmp(argv[optind], "refresh") == 0) {
++optind;
+ argc -= optind;
+ argv += optind;
- if (optind >= argc)
+ if (argc == 0 && !svcsearch)
+ usage();
+
+ if (argc > 0 && svcsearch)
usage();
- if ((err = scf_walk_fmri(h, argc - optind, argv + optind, 0,
- set_fmri_action, (void *)SCF_PROPERTY_REFRESH,
- &exit_status, uu_warn)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ set_fmri_action, (void *)SCF_PROPERTY_REFRESH, &exit_status,
+ pr_warn)) != 0) {
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(scf_error()));
exit_status = UU_EXIT_FATAL;
}
@@ -2316,10 +2523,19 @@ main(int argc, char *argv[])
usage();
}
- if ((err = scf_walk_fmri(h, argc - optind - 1,
- argv + optind + 1, 0, callback, NULL, &exit_status,
- uu_warn)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ optind++;
+ argc -= optind;
+ argv += optind;
+
+ if (argc == 0 && !svcsearch)
+ usage();
+
+ if (argc > 0 && svcsearch)
+ usage();
+
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS, callback,
+ NULL, &exit_status, pr_warn)) != 0) {
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"),
scf_strerror(err));
exit_status = UU_EXIT_FATAL;
@@ -2327,13 +2543,25 @@ main(int argc, char *argv[])
} else if (strcmp(argv[optind], "clear") == 0) {
++optind;
+ argc -= optind;
+ argv += optind;
- if (optind >= argc)
+ if (argc == 0 && !svcsearch)
usage();
- if ((err = scf_walk_fmri(h, argc - optind, argv + optind, 0,
- clear_instance, NULL, &exit_status, uu_warn)) != 0) {
- uu_warn(gettext("failed to iterate over "
+ if (svcsearch) {
+ if (argc > 0)
+ usage();
+ if (strcmp(svcstate, SCF_STATE_STRING_MAINT) != 0 &&
+ strcmp(svcstate, SCF_STATE_STRING_DEGRADED) != 0)
+ uu_die(gettext("State must be '%s' or '%s'\n"),
+ SCF_STATE_STRING_MAINT,
+ SCF_STATE_STRING_DEGRADED);
+ }
+
+ if ((err = scf_walk_fmri(h, argc, argv, WALK_FLAGS,
+ clear_instance, NULL, &exit_status, pr_warn)) != 0) {
+ pr_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
}
@@ -2389,7 +2617,7 @@ main(int argc, char *argv[])
break;
}
- uu_warn("failed to backup repository: %s\n", reason);
+ pr_warn("failed to backup repository: %s\n", reason);
exit_status = UU_EXIT_FATAL;
}
} else if (strcmp(argv[optind], "_smf_repository_switch") == 0) {
@@ -2443,7 +2671,7 @@ main(int argc, char *argv[])
/* NOTREACHED */
}
- uu_warn("failed to switch repository: %s\n", reason);
+ pr_warn("failed to switch repository: %s\n", reason);
exit_status = UU_EXIT_FATAL;
}
} else {
@@ -2452,7 +2680,10 @@ main(int argc, char *argv[])
if (scf_handle_unbind(h) == -1)
scfdie();
+nextzone:
scf_handle_destroy(h);
+ if (do_zones && zent < nzents)
+ goto again;
return (exit_status);
}
diff --git a/usr/src/cmd/svc/svccfg/svccfg_libscf.c b/usr/src/cmd/svc/svccfg/svccfg_libscf.c
index b43dedbd81..077a77f114 100644
--- a/usr/src/cmd/svc/svccfg/svccfg_libscf.c
+++ b/usr/src/cmd/svc/svccfg/svccfg_libscf.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
*/
@@ -44,6 +45,7 @@
#include <stdarg.h>
#include <string.h>
#include <strings.h>
+#include <time.h>
#include <unistd.h>
#include <wait.h>
#include <poll.h>
@@ -241,6 +243,9 @@ static const char *emsg_dpt_no_dep;
static int li_only = 0;
static int no_refresh = 0;
+/* how long in ns we should wait between checks for a pg */
+static uint64_t pg_timeout = 100 * (NANOSEC / MILLISEC);
+
/* import globals, to minimize allocations */
static scf_scope_t *imp_scope = NULL;
static scf_service_t *imp_svc = NULL, *imp_tsvc = NULL;
@@ -6751,6 +6756,205 @@ connaborted:
}
/*
+ * When an instance is imported we end up telling configd about it. Once we tell
+ * configd about these changes, startd eventually notices. If this is a new
+ * instance, the manifest may not specify the SCF_PG_RESTARTER (restarter)
+ * property group. However, many of the other tools expect that this property
+ * group exists and has certain values.
+ *
+ * These values are added asynchronously by startd. We should not return from
+ * this routine until we can verify that the property group we need is there.
+ *
+ * Before we go ahead and verify this, we have to ask ourselves an
+ * important question: Is the early manifest service currently running?
+ * Because if is running and invoked us, then the service will never get
+ * a restarter property because svc.startd is blocked on EMI finishing
+ * before it lets itself fully connect to svc.configd. Of course, this
+ * means that this race condition is in fact impossible to 100%
+ * eliminate.
+ *
+ * svc.startd makes sure that EMI only runs once and has succeeded by
+ * checking the state of the EMI instance. If it is online it bails out
+ * and makes sure that it doesn't run again. In this case, we're going
+ * to do something similar, only if the state is online, then we're
+ * going to actually verify. EMI always has to be present, but it
+ * can be explicitly disabled to reduce the amount of damage it can cause. If
+ * EMI has been disabled then we no longer have to worry about the implicit race
+ * condition and can go ahead and check things. If EMI is in some tate that
+ * isn't online or disabled and isn't runinng, then we assume that things are
+ * rather bad and we're not going to get in your way, even if the rest of SMF
+ * does.
+ *
+ * Returns 0 on success or returns an errno.
+ */
+#ifndef NATIVE_BUILD
+static int
+lscf_instance_verify(scf_scope_t *scope, entity_t *svc, entity_t *inst)
+{
+ int ret, err;
+ struct timespec ts;
+ char *emi_state;
+
+ /*
+ * smf_get_state does not distinguish between its different failure
+ * modes: memory allocation failures and SMF internal failures.
+ */
+ if ((emi_state = smf_get_state(SCF_INSTANCE_EMI)) == NULL)
+ return (EAGAIN);
+
+ /*
+ * As per the block comment for this function check the state of EMI
+ */
+ if (strcmp(emi_state, SCF_STATE_STRING_ONLINE) != 0 &&
+ strcmp(emi_state, SCF_STATE_STRING_DISABLED) != 0) {
+ warn(gettext("Not validating instance %s:%s because EMI's "
+ "state is %s\n"), svc->sc_name, inst->sc_name, emi_state);
+ free(emi_state);
+ return (0);
+ }
+
+ free(emi_state);
+
+ /*
+ * First we have to get the property.
+ */
+ if ((ret = scf_scope_get_service(scope, svc->sc_name, imp_svc)) != 0) {
+ ret = scf_error();
+ warn(gettext("Failed to look up service: %s\n"), svc->sc_name);
+ return (ret);
+ }
+
+ /*
+ * We should always be able to get the instance. It should already
+ * exist because we just created it or got it. There probably is a
+ * slim chance that someone may have come in and deleted it though from
+ * under us.
+ */
+ if ((ret = scf_service_get_instance(imp_svc, inst->sc_name, imp_inst))
+ != 0) {
+ ret = scf_error();
+ warn(gettext("Failed to verify instance: %s\n"), inst->sc_name);
+ switch (ret) {
+ case SCF_ERROR_DELETED:
+ err = ENODEV;
+ break;
+ case SCF_ERROR_CONNECTION_BROKEN:
+ warn(gettext("Lost repository connection\n"));
+ err = ECONNABORTED;
+ break;
+ case SCF_ERROR_NOT_FOUND:
+ warn(gettext("Instance \"%s\" disappeared out from "
+ "under us.\n"), inst->sc_name);
+ err = ENOENT;
+ break;
+ default:
+ bad_error("scf_service_get_instance", ret);
+ }
+
+ return (err);
+ }
+
+ /*
+ * An astute observer may want to use _scf_wait_pg which would notify us
+ * of a property group change, unfortunately that does not work if the
+ * property group in question does not exist. So instead we have to
+ * manually poll and ask smf the best way to get to it.
+ */
+ while ((ret = scf_instance_get_pg(imp_inst, SCF_PG_RESTARTER, imp_pg))
+ != SCF_SUCCESS) {
+ ret = scf_error();
+ if (ret != SCF_ERROR_NOT_FOUND) {
+ warn(gettext("Failed to get restarter property "
+ "group for instance: %s\n"), inst->sc_name);
+ switch (ret) {
+ case SCF_ERROR_DELETED:
+ err = ENODEV;
+ break;
+ case SCF_ERROR_CONNECTION_BROKEN:
+ warn(gettext("Lost repository connection\n"));
+ err = ECONNABORTED;
+ break;
+ default:
+ bad_error("scf_service_get_instance", ret);
+ }
+
+ return (err);
+ }
+
+ ts.tv_sec = pg_timeout / NANOSEC;
+ ts.tv_nsec = pg_timeout % NANOSEC;
+
+ (void) nanosleep(&ts, NULL);
+ }
+
+ /*
+ * svcadm also expects that the SCF_PROPERTY_STATE property is present.
+ * So in addition to the property group being present, we need to wait
+ * for the property to be there in some form.
+ *
+ * Note that a property group is a frozen snapshot in time. To properly
+ * get beyond this, you have to refresh the property group each time.
+ */
+ while ((ret = scf_pg_get_property(imp_pg, SCF_PROPERTY_STATE,
+ imp_prop)) != 0) {
+
+ ret = scf_error();
+ if (ret != SCF_ERROR_NOT_FOUND) {
+ warn(gettext("Failed to get property %s from the "
+ "restarter property group of instance %s\n"),
+ SCF_PROPERTY_STATE, inst->sc_name);
+ switch (ret) {
+ case SCF_ERROR_CONNECTION_BROKEN:
+ warn(gettext("Lost repository connection\n"));
+ err = ECONNABORTED;
+ break;
+ case SCF_ERROR_DELETED:
+ err = ENODEV;
+ break;
+ default:
+ bad_error("scf_pg_get_property", ret);
+ }
+
+ return (err);
+ }
+
+ ts.tv_sec = pg_timeout / NANOSEC;
+ ts.tv_nsec = pg_timeout % NANOSEC;
+
+ (void) nanosleep(&ts, NULL);
+
+ ret = scf_instance_get_pg(imp_inst, SCF_PG_RESTARTER, imp_pg);
+ if (ret != SCF_SUCCESS) {
+ warn(gettext("Failed to get restarter property "
+ "group for instance: %s\n"), inst->sc_name);
+ switch (ret) {
+ case SCF_ERROR_DELETED:
+ err = ENODEV;
+ break;
+ case SCF_ERROR_CONNECTION_BROKEN:
+ warn(gettext("Lost repository connection\n"));
+ err = ECONNABORTED;
+ break;
+ default:
+ bad_error("scf_service_get_instance", ret);
+ }
+
+ return (err);
+ }
+ }
+
+ /*
+ * We don't have to free the property groups or other values that we got
+ * because we stored them in global variables that are allocated and
+ * freed by the routines that call into these functions. Unless of
+ * course the rest of the code here that we are basing this on is
+ * mistaken.
+ */
+ return (0);
+}
+#endif
+
+/*
* If the service is missing, create it, import its properties, and import the
* instances. Since the service is brand new, it should be empty, and if we
* run into any existing entities (SCF_ERROR_EXISTS), abort.
@@ -6834,6 +7038,7 @@ lscf_service_import(void *v, void *pvt)
int fresh = 0;
scf_snaplevel_t *running;
int have_ge = 0;
+ boolean_t retried = B_FALSE;
const char * const ts_deleted = gettext("Temporary service svc:/%s "
"was deleted unexpectedly.\n");
@@ -6889,6 +7094,7 @@ lscf_service_import(void *v, void *pvt)
return (UU_WALK_ERROR);
}
+retry:
if (scf_scope_add_service(imp_scope, imp_tsname, imp_tsvc) != 0) {
switch (scf_error()) {
case SCF_ERROR_CONNECTION_BROKEN:
@@ -6898,6 +7104,11 @@ lscf_service_import(void *v, void *pvt)
return (stash_scferror(lcbdata));
case SCF_ERROR_EXISTS:
+ if (!retried) {
+ lscf_delete(imp_tsname, 0);
+ retried = B_TRUE;
+ goto retry;
+ }
warn(gettext(
"Temporary service \"%s\" must be deleted before "
"this manifest can be imported.\n"), imp_tsname);
@@ -8122,7 +8333,36 @@ lscf_bundle_import(bundle_t *bndl, const char *filename, uint_t flags)
goto progress;
result = 0;
+
+ /*
+ * This snippet of code assumes that we are running svccfg as we
+ * normally do -- witih svc.startd running. Of course, that is
+ * not actually the case all the time because we also use a
+ * varient of svc.configd and svcccfg which are only meant to
+ * run during the build process. During this time we have no
+ * svc.startd, so this check would hang the build process.
+ */
+#ifndef NATIVE_BUILD
+ /*
+ * Verify that the restarter group is preset
+ */
+ for (svc = uu_list_first(bndl->sc_bundle_services);
+ svc != NULL;
+ svc = uu_list_next(bndl->sc_bundle_services, svc)) {
+
+ insts = svc->sc_u.sc_service.sc_service_instances;
+
+ for (inst = uu_list_first(insts);
+ inst != NULL;
+ inst = uu_list_next(insts, inst)) {
+ if (lscf_instance_verify(imp_scope, svc,
+ inst) != 0)
+ goto progress;
+ }
+ }
+#endif
goto out;
+
}
if (uu_error() != UU_ERROR_CALLBACK_FAILED)
@@ -10630,6 +10870,10 @@ int
lscf_service_export(char *fmri, const char *filename, int flags)
{
struct export_args args;
+ char *fmridup;
+ const char *scope, *svc, *inst;
+ size_t cblen = 3 * max_scf_name_len;
+ char *canonbuf = alloca(cblen);
int ret, err;
lscf_prep_hndl();
@@ -10638,6 +10882,29 @@ lscf_service_export(char *fmri, const char *filename, int flags)
args.filename = filename;
args.flags = flags;
+ /*
+ * If some poor user has passed an exact instance FMRI, of the sort
+ * one might cut and paste from svcs(1) or an error message, warn
+ * and chop off the instance instead of failing.
+ */
+ fmridup = alloca(strlen(fmri) + 1);
+ (void) strcpy(fmridup, fmri);
+ if (strncmp(fmridup, SCF_FMRI_SVC_PREFIX,
+ sizeof (SCF_FMRI_SVC_PREFIX) -1) == 0 &&
+ scf_parse_svc_fmri(fmridup, &scope, &svc, &inst, NULL, NULL) == 0 &&
+ inst != NULL) {
+ (void) strlcpy(canonbuf, "svc:/", cblen);
+ if (strcmp(scope, SCF_FMRI_LOCAL_SCOPE) != 0) {
+ (void) strlcat(canonbuf, "/", cblen);
+ (void) strlcat(canonbuf, scope, cblen);
+ }
+ (void) strlcat(canonbuf, svc, cblen);
+ fmri = canonbuf;
+
+ warn(gettext("Only services may be exported; ignoring "
+ "instance portion of argument.\n"));
+ }
+
err = 0;
if ((ret = scf_walk_fmri(g_hndl, 1, (char **)&fmri,
SCF_WALK_SERVICE | SCF_WALK_NOINSTANCE, export_callback,
diff --git a/usr/src/cmd/svc/svcs/Makefile b/usr/src/cmd/svc/svcs/Makefile
index 0e9fc52652..2ea89818c0 100644
--- a/usr/src/cmd/svc/svcs/Makefile
+++ b/usr/src/cmd/svc/svcs/Makefile
@@ -34,7 +34,7 @@ include ../../Makefile.cmd
include ../../Makefile.ctf
POFILE = $(PROG)_all.po
-LDLIBS += -lcontract -lscf -luutil -lumem -lnvpair -lzonecfg
+LDLIBS += -lcontract -lscf -luutil -lumem -lnvpair -lzonecfg -lsasl
CPPFLAGS += -I ../common
lint := LINTFLAGS = -mux
diff --git a/usr/src/cmd/svc/svcs/explain.c b/usr/src/cmd/svc/svcs/explain.c
index 42fca80172..eed9733abc 100644
--- a/usr/src/cmd/svc/svcs/explain.c
+++ b/usr/src/cmd/svc/svcs/explain.c
@@ -200,6 +200,7 @@ static char *emsg_invalid_dep;
extern scf_handle_t *h;
extern char *g_zonename;
+extern char *g_zonealias;
/* ARGSUSED */
static int
@@ -2000,6 +2001,9 @@ print_service(inst_t *svcp, int verbose)
if (g_zonename != NULL)
(void) printf(gettext(" Zone: %s\n"), g_zonename);
+ if (g_zonealias != NULL)
+ (void) printf(gettext(" Alias: %s\n"), g_zonealias);
+
stime = svcp->stime.tv_sec;
tmp = localtime(&stime);
diff --git a/usr/src/cmd/svc/svcs/svcs.c b/usr/src/cmd/svc/svcs/svcs.c
index 049dec9d30..b4882d1776 100644
--- a/usr/src/cmd/svc/svcs/svcs.c
+++ b/usr/src/cmd/svc/svcs/svcs.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -59,6 +59,7 @@
#include <sys/ctfs.h>
#include <sys/stat.h>
+#include <sasl/saslutil.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -134,6 +135,9 @@ static int first_paragraph = 1; /* For -l mode. */
static char *common_name_buf; /* Sized for maximal length value. */
char *locale; /* Current locale. */
char *g_zonename; /* zone being operated upon */
+char *g_zonealias; /* alias for zone, if any */
+static char g_aliasdec[MAXPATHLEN / 4 * 3]; /* decoded zone alias buffer */
+static char g_aliasbuf[MAXPATHLEN]; /* base64 encoded zone alias buffer */
/*
* Pathname storage for path generated from the fmri.
@@ -240,7 +244,25 @@ ht_free(void)
static void
ht_init(void)
{
- assert(ht_buckets == NULL);
+ if (ht_buckets != NULL) {
+ /*
+ * If we already have a hash table (e.g., because we are
+ * processing multiple zones), destroy it before creating
+ * a new one.
+ */
+ struct ht_elem *elem, *next;
+ int i;
+
+ for (i = 0; i < ht_buckets_num; i++) {
+ for (elem = ht_buckets[i]; elem != NULL; elem = next) {
+ next = elem->next;
+ free((char *)elem->fmri);
+ free(elem);
+ }
+ }
+
+ free(ht_buckets);
+ }
ht_buckets_num = 8;
ht_buckets = safe_malloc(sizeof (*ht_buckets) * ht_buckets_num);
@@ -553,7 +575,7 @@ get_restarter_time_prop(scf_instance_t *inst, const char *pname,
int r;
r = inst_get_single_val(inst, SCF_PG_RESTARTER, pname, SCF_TYPE_TIME,
- tvp, NULL, ok_if_empty ? EMPTY_OK : 0, 0, 1);
+ tvp, 0, ok_if_empty ? EMPTY_OK : 0, 0, 1);
return (r == 0 ? 0 : -1);
}
@@ -1002,13 +1024,14 @@ reverse_bytes(char *buf, size_t len)
/* CTID */
#define CTID_COLUMN_WIDTH 6
+#define CTID_COLUMN_BUFSIZE 20 /* max ctid_t + space + \0 */
static void
sprint_ctid(char **buf, scf_walkinfo_t *wip)
{
int r;
uint64_t c;
- size_t newsize = (*buf ? strlen(*buf) : 0) + CTID_COLUMN_WIDTH + 2;
+ size_t newsize = (*buf ? strlen(*buf) : 0) + CTID_COLUMN_BUFSIZE;
char *newbuf = safe_malloc(newsize);
int restarter_spec;
@@ -1649,7 +1672,7 @@ sprint_stime(char **buf, scf_walkinfo_t *wip)
SCF_PROPERTY_STATE_TIMESTAMP, &tv, 0);
} else {
r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP,
- SCF_TYPE_TIME, &tv, NULL, 0);
+ SCF_TYPE_TIME, &tv, 0, 0);
}
if (r != 0) {
@@ -1701,7 +1724,7 @@ sortkey_stime(char *buf, int reverse, scf_walkinfo_t *wip)
SCF_PROPERTY_STATE_TIMESTAMP, &tv, 0);
else
r = pg_get_single_val(wip->pg, SCF_PROPERTY_STATE_TIMESTAMP,
- SCF_TYPE_TIME, &tv, NULL, 0);
+ SCF_TYPE_TIME, &tv, 0, 0);
if (r == 0) {
int64_t sec;
@@ -2513,7 +2536,7 @@ print_detailed(void *unused, scf_walkinfo_t *wip)
gettext("next_state"), buf);
if (pg_get_single_val(rpg, SCF_PROPERTY_STATE_TIMESTAMP,
- SCF_TYPE_TIME, &tv, NULL, 0) == 0) {
+ SCF_TYPE_TIME, &tv, 0, 0) == 0) {
stime = tv.tv_sec;
tmp = localtime(&stime);
for (tbsz = 50; ; tbsz *= 2) {
@@ -3662,6 +3685,24 @@ again:
assert(opt_zone == NULL || zids == NULL);
if (opt_zone == NULL) {
+ zone_status_t status;
+
+ if (zone_getattr(zids[zent], ZONE_ATTR_STATUS,
+ &status, sizeof (status)) < 0 ||
+ status != ZONE_IS_RUNNING) {
+ /*
+ * If this zone is not running or we cannot
+ * get its status, we do not want to attempt
+ * to bind an SCF handle to it, lest we
+ * accidentally interfere with a zone that
+ * is not yet running by looking up a door
+ * to its svc.configd (which could potentially
+ * block a mount with an EBUSY).
+ */
+ zent++;
+ goto nextzone;
+ }
+
if (getzonenamebyid(zids[zent++],
zonename, sizeof (zonename)) < 0) {
uu_warn(gettext("could not get name for "
@@ -3684,18 +3725,46 @@ again:
uu_die(gettext("invalid zone '%s'\n"), g_zonename);
scf_value_destroy(zone);
+
+ /*
+ * On SmartOS, there may be a base64-encoded string attribute
+ * named 'alias' associated with this zone. This alias is
+ * useful, so we attempt to make it available when we are
+ * displaying -xZ output. If it's not available or not
+ * decodable, we just ignore it.
+ */
+ if (g_zonename != NULL) {
+ unsigned len;
+ struct zone_attrtab zattrs;
+ zone_dochandle_t zhdl = zonecfg_init_handle();
+
+ bzero(&zattrs, sizeof (zattrs));
+ (void) strcpy(zattrs.zone_attr_name, "alias");
+
+ if (zhdl != NULL &&
+ zonecfg_get_handle(g_zonename, zhdl) == Z_OK &&
+ zonecfg_lookup_attr(zhdl, &zattrs) == Z_OK &&
+ zonecfg_get_attr_string(&zattrs, g_aliasbuf,
+ sizeof (g_aliasbuf)) == Z_OK &&
+ sasl_decode64(g_aliasbuf, strlen(g_aliasbuf),
+ g_aliasdec, sizeof (g_aliasdec), &len) == SASL_OK) {
+ g_aliasdec[len] = '\0';
+ g_zonealias = g_aliasdec;
+ } else {
+ g_zonealias = NULL;
+ }
+ zonecfg_fini_handle(zhdl);
+ }
}
if (scf_handle_bind(h) == -1) {
if (g_zonename != NULL) {
- uu_warn(gettext("Could not bind to repository "
+ if (show_zones)
+ goto nextzone;
+
+ uu_die(gettext("Could not bind to repository "
"server for zone %s: %s\n"), g_zonename,
scf_strerror(scf_error()));
-
- if (!show_zones)
- return (UU_EXIT_FATAL);
-
- goto nextzone;
}
uu_die(gettext("Could not bind to repository server: %s. "
@@ -3754,7 +3823,7 @@ again:
if (opt_mode == 'L') {
if ((err = scf_walk_fmri(h, argc, argv, SCF_WALK_MULTIPLE,
- print_log, NULL, &exit_status, uu_warn)) != 0) {
+ print_log, NULL, errarg, errfunc)) != 0) {
uu_warn(gettext("failed to iterate over "
"instances: %s\n"), scf_strerror(err));
exit_status = UU_EXIT_FATAL;
diff --git a/usr/src/cmd/svr4pkg/pkgadd/Makefile b/usr/src/cmd/svr4pkg/pkgadd/Makefile
index 66e6abb737..b1b4168a7c 100644
--- a/usr/src/cmd/svr4pkg/pkgadd/Makefile
+++ b/usr/src/cmd/svr4pkg/pkgadd/Makefile
@@ -35,7 +35,7 @@ ROOTLINKS= $(ROOTUSRSBIN)/pkgask
include $(SRC)/cmd/svr4pkg/Makefile.svr4pkg
LDLIBS += -lpkg -linstzones -ladm
-LDLIBS += -lcrypto -lwanboot
+LDLIBS += -lsunw_crypto -lwanboot
.KEEP_STATE:
diff --git a/usr/src/cmd/svr4pkg/pkgadm/Makefile b/usr/src/cmd/svr4pkg/pkgadm/Makefile
index 620e32cf0d..c4970c3b91 100644
--- a/usr/src/cmd/svr4pkg/pkgadm/Makefile
+++ b/usr/src/cmd/svr4pkg/pkgadm/Makefile
@@ -35,7 +35,7 @@ OBJS= addcert.o \
include $(SRC)/cmd/svr4pkg/Makefile.svr4pkg
-LDLIBS += -lpkg -ladm -lcrypto -lgen
+LDLIBS += -lpkg -ladm -lsunw_crypto -lgen
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/tail/Makefile b/usr/src/cmd/tail/Makefile
index 293920cfd1..e660cedf2d 100644
--- a/usr/src/cmd/tail/Makefile
+++ b/usr/src/cmd/tail/Makefile
@@ -21,6 +21,7 @@ OBJS= forward.o misc.o read.o reverse.o tail.o
SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
+include ../Makefile.ctf
CLOBBERFILES= $(PROG)
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
@@ -43,6 +44,10 @@ $(PROG): $(OBJS)
$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
+%.o: %.c
+ $(COMPILE.c) $<
+ $(POST_PROCESS_O)
+
install: all .WAIT $(ROOTPROG) $(ROOTXPG4PROG)
$(ROOTXPG4PROG):
diff --git a/usr/src/cmd/truss/print.c b/usr/src/cmd/truss/print.c
index f49197a7f6..f6e4fd0bb8 100644
--- a/usr/src/cmd/truss/print.c
+++ b/usr/src/cmd/truss/print.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -870,7 +871,9 @@ prt_mc4(private_t *pri, int raw, long val) /* print memcntl() (4th) argument */
return;
case MC_SYNC:
- if ((val & ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE)) == 0) {
+ if ((val &
+ ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE|MS_INVALCURPROC))
+ == 0) {
*(s = pri->code_buf) = '\0';
if (val & MS_SYNC)
(void) strlcat(s, "|MS_SYNC", CBSIZE);
@@ -879,6 +882,9 @@ prt_mc4(private_t *pri, int raw, long val) /* print memcntl() (4th) argument */
if (val & MS_INVALIDATE)
(void) strlcat(s, "|MS_INVALIDATE",
CBSIZE);
+ if (val & MS_INVALCURPROC)
+ (void) strlcat(s, "|MS_INVALCURPROC",
+ CBSIZE);
}
break;
@@ -2440,7 +2446,10 @@ prt_zga(private_t *pri, int raw, long val)
case ZONE_ATTR_BOOTARGS: s = "ZONE_ATTR_BOOTARGS"; break;
case ZONE_ATTR_BRAND: s = "ZONE_ATTR_BRAND"; break;
case ZONE_ATTR_FLAGS: s = "ZONE_ATTR_FLAGS"; break;
- case ZONE_ATTR_PHYS_MCAP: s = "ZONE_ATTR_PHYS_MCAP"; break;
+ case ZONE_ATTR_DID: s = "ZONE_ATTR_DID"; break;
+ case ZONE_ATTR_PMCAP_NOVER: s = "ZONE_ATTR_PMCAP_NOVER"; break;
+ case ZONE_ATTR_PMCAP_PAGEOUT: s = "ZONE_ATTR_PMCAP_PAGEOUT";
+ break;
}
}
diff --git a/usr/src/cmd/vi/port/Makefile b/usr/src/cmd/vi/port/Makefile
index 268dd752a6..8e223d98e8 100644
--- a/usr/src/cmd/vi/port/Makefile
+++ b/usr/src/cmd/vi/port/Makefile
@@ -75,6 +75,9 @@ $(XPG6) := CFLAGS += -DXPG4 -DXPG6 -I$(SRC)/lib/libc/inc
CPPFLAGS += -DUSG -DSTDIO -DVMUNIX -DTABS=8 -DSINGLE -DTAG_STACK
+# vi intentionally uses foo[-1] as a sentinal value to q*column()
+$(__GNUC4)CERRWARN += -_gcc=-Wno-array-bounds
+
# vi maintains its own versions of various routines from libc and libcurses,
# so localize all symbols to avoid name space collisions.
LDFLAGS += $(MAPFILE.NGB:%=-M%)
diff --git a/usr/src/cmd/vi/port/ex_cmdsub.c b/usr/src/cmd/vi/port/ex_cmdsub.c
index 0260d334fe..00bdcefccb 100644
--- a/usr/src/cmd/vi/port/ex_cmdsub.c
+++ b/usr/src/cmd/vi/port/ex_cmdsub.c
@@ -1735,7 +1735,7 @@ char *prompt;
/* In ex mode, let the system hassle with setting no echo */
if (!inopen)
- return (unsigned char *)getpass(prompt);
+ return (unsigned char *)getpass((const char *)prompt);
viprintf("%s", prompt); flush();
for (p=pbuf; (c = getkey())!='\n' && c!=EOF && c!='\r';) {
if (p < &pbuf[8])
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c
index 89f7071bf3..e2db6b1688 100644
--- a/usr/src/cmd/zfs/zfs_main.c
+++ b/usr/src/cmd/zfs/zfs_main.c
@@ -224,7 +224,7 @@ get_usage(zfs_help_t idx)
"<filesystem|volume>@<snap>[%<snap>][,...]\n"
"\tdestroy <filesystem|volume>#<bookmark>\n"));
case HELP_GET:
- return (gettext("\tget [-rHp] [-d max] "
+ return (gettext("\tget [-crHp] [-d max] "
"[-o \"all\" | field[,...]]\n"
"\t [-t type[,...]] [-s source[,...]]\n"
"\t <\"all\" | property[,...]> "
@@ -573,8 +573,9 @@ finish_progress(char *done)
free(pt_header);
pt_header = NULL;
}
+
/*
- * zfs clone [-p] [-o prop=value] ... <snap> <fs | vol>
+ * zfs clone [-Fp] [-o prop=value] ... <snap> <fs | vol>
*
* Given an existing dataset, create a writable copy whose initial contents
* are the same as the source. The newly created dataset maintains a
@@ -582,12 +583,18 @@ finish_progress(char *done)
* the clone exists.
*
* The '-p' flag creates all the non-existing ancestors of the target first.
+ *
+ * The '-F' flag retries the zfs_mount() operation as long as zfs_mount() is
+ * still returning EBUSY. Any callers which specify -F should be careful to
+ * ensure that no other process has a persistent hold on the mountpoint's
+ * directory.
*/
static int
zfs_do_clone(int argc, char **argv)
{
zfs_handle_t *zhp = NULL;
boolean_t parents = B_FALSE;
+ boolean_t keeptrying = B_FALSE;
nvlist_t *props;
int ret = 0;
int c;
@@ -596,8 +603,11 @@ zfs_do_clone(int argc, char **argv)
nomem();
/* check options */
- while ((c = getopt(argc, argv, "o:p")) != -1) {
+ while ((c = getopt(argc, argv, "Fo:p")) != -1) {
switch (c) {
+ case 'F':
+ keeptrying = B_TRUE;
+ break;
case 'o':
if (parseprop(props))
return (1);
@@ -658,9 +668,14 @@ zfs_do_clone(int argc, char **argv)
clone = zfs_open(g_zfs, argv[1], ZFS_TYPE_DATASET);
if (clone != NULL) {
- if (zfs_get_type(clone) != ZFS_TYPE_VOLUME)
- if ((ret = zfs_mount(clone, NULL, 0)) == 0)
+ if (zfs_get_type(clone) != ZFS_TYPE_VOLUME) {
+ while ((ret = zfs_mount(clone, NULL, 0)) != 0) {
+ if (!keeptrying || errno != EBUSY)
+ break;
+ }
+ if (ret == 0)
ret = zfs_share(clone);
+ }
zfs_close(clone);
}
}
@@ -884,12 +899,13 @@ badusage:
}
/*
- * zfs destroy [-rRf] <fs, vol>
+ * zfs destroy [-rRfF] <fs, vol>
* zfs destroy [-rRd] <snap>
*
* -r Recursively destroy all children
* -R Recursively destroy all dependents, including clones
* -f Force unmounting of any dependents
+ * -F Continue retrying on seeing EBUSY
* -d If we can't destroy now, mark for deferred destruction
*
* Destroys the given dataset. By default, it will unmount any filesystems,
@@ -899,6 +915,7 @@ badusage:
typedef struct destroy_cbdata {
boolean_t cb_first;
boolean_t cb_force;
+ boolean_t cb_wait;
boolean_t cb_recurse;
boolean_t cb_error;
boolean_t cb_doclones;
@@ -982,13 +999,18 @@ out:
static int
destroy_callback(zfs_handle_t *zhp, void *data)
{
- destroy_cbdata_t *cb = data;
+ destroy_cbdata_t *cbp = data;
+ struct timespec ts;
+ int err = 0;
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 500 * (NANOSEC / MILLISEC);
const char *name = zfs_get_name(zhp);
- if (cb->cb_verbose) {
- if (cb->cb_parsable) {
+ if (cbp->cb_verbose) {
+ if (cbp->cb_parsable) {
(void) printf("destroy\t%s\n", name);
- } else if (cb->cb_dryrun) {
+ } else if (cbp->cb_dryrun) {
(void) printf(gettext("would destroy %s\n"),
name);
} else {
@@ -1003,13 +1025,10 @@ destroy_callback(zfs_handle_t *zhp, void *data)
*/
if (strchr(zfs_get_name(zhp), '/') == NULL &&
zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) {
- zfs_close(zhp);
- return (0);
- }
- if (cb->cb_dryrun) {
- zfs_close(zhp);
- return (0);
+ goto out;
}
+ if (cbp->cb_dryrun)
+ goto out;
/*
* We batch up all contiguous snapshots (even of different
@@ -1018,23 +1037,66 @@ destroy_callback(zfs_handle_t *zhp, void *data)
* because we must delete a clone before its origin.
*/
if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) {
- fnvlist_add_boolean(cb->cb_batchedsnaps, name);
- } else {
- int error = zfs_destroy_snaps_nvl(g_zfs,
- cb->cb_batchedsnaps, B_FALSE);
- fnvlist_free(cb->cb_batchedsnaps);
- cb->cb_batchedsnaps = fnvlist_alloc();
-
- if (error != 0 ||
- zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 ||
- zfs_destroy(zhp, cb->cb_defer_destroy) != 0) {
- zfs_close(zhp);
- return (-1);
+ fnvlist_add_boolean(cbp->cb_batchedsnaps, name);
+ goto out;
+ }
+
+ if (cbp->cb_wait)
+ libzfs_print_on_error(g_zfs, B_FALSE);
+
+ /*
+ * Unless instructed to retry on EBUSY, bail out on the first error.
+ * When retrying, try every 500ms until either succeeding or seeing a
+ * non-EBUSY error code.
+ */
+ while ((err = zfs_destroy_snaps_nvl(g_zfs,
+ cbp->cb_batchedsnaps, B_FALSE)) != 0) {
+ if (cbp->cb_wait && libzfs_errno(g_zfs) == EZFS_BUSY) {
+ nanosleep(&ts, NULL);
+ continue;
}
+ (void) fprintf(stderr, "%s: %s\n",
+ libzfs_error_action(g_zfs),
+ libzfs_error_description(g_zfs));
+ break;
}
+ fnvlist_free(cbp->cb_batchedsnaps);
+ cbp->cb_batchedsnaps = fnvlist_alloc();
+
+ if (err != 0)
+ goto out;
+
+ while ((err = zfs_unmount(zhp, NULL,
+ cbp->cb_force ? MS_FORCE : 0)) != 0) {
+ if (cbp->cb_wait && libzfs_errno(g_zfs) == EZFS_BUSY) {
+ (void) nanosleep(&ts, NULL);
+ continue;
+ }
+ (void) fprintf(stderr, "%s: %s\n",
+ libzfs_error_action(g_zfs),
+ libzfs_error_description(g_zfs));
+ break;
+ }
+
+ if (err != 0)
+ goto out;
+
+ while ((err = zfs_destroy(zhp, cbp->cb_defer_destroy)) != 0) {
+ if (cbp->cb_wait && libzfs_errno(g_zfs) == EZFS_BUSY) {
+ (void) nanosleep(&ts, NULL);
+ continue;
+ }
+ (void) fprintf(stderr, "%s: %s\n",
+ libzfs_error_action(g_zfs),
+ libzfs_error_description(g_zfs));
+ break;
+ }
+
+out:
+ libzfs_print_on_error(g_zfs, B_TRUE);
zfs_close(zhp);
- return (0);
+ return (err);
}
static int
@@ -1190,7 +1252,7 @@ zfs_do_destroy(int argc, char **argv)
zfs_type_t type = ZFS_TYPE_DATASET;
/* check options */
- while ((c = getopt(argc, argv, "vpndfrR")) != -1) {
+ while ((c = getopt(argc, argv, "vpndfFrR")) != -1) {
switch (c) {
case 'v':
cb.cb_verbose = B_TRUE;
@@ -1209,6 +1271,9 @@ zfs_do_destroy(int argc, char **argv)
case 'f':
cb.cb_force = B_TRUE;
break;
+ case 'F':
+ cb.cb_wait = B_TRUE;
+ break;
case 'r':
cb.cb_recurse = B_TRUE;
break;
@@ -1579,8 +1644,11 @@ zfs_do_get(int argc, char **argv)
cb.cb_type = ZFS_TYPE_DATASET;
/* check options */
- while ((c = getopt(argc, argv, ":d:o:s:rt:Hp")) != -1) {
+ while ((c = getopt(argc, argv, ":d:o:s:rt:Hcp")) != -1) {
switch (c) {
+ case 'c':
+ libzfs_set_cachedprops(g_zfs, B_TRUE);
+ break;
case 'p':
cb.cb_literal = B_TRUE;
break;
@@ -3004,6 +3072,7 @@ zfs_do_list(int argc, char **argv)
int types = ZFS_TYPE_DATASET;
boolean_t types_specified = B_FALSE;
char *fields = NULL;
+ zprop_list_t *pl;
list_cbdata_t cb = { 0 };
char *value;
int limit = 0;
@@ -3114,6 +3183,18 @@ zfs_do_list(int argc, char **argv)
!= 0)
usage(B_FALSE);
+ /*
+ * The default set of properties contains only properties which can be
+ * retrieved from the set of cached properties. If any user-specfied
+ * properties cannot be retrieved from that set, unset the cachedprops
+ * flags on the ZFS handle.
+ */
+ libzfs_set_cachedprops(g_zfs, B_TRUE);
+ for (pl = cb.cb_proplist; pl != NULL; pl = pl->pl_next) {
+ if (zfs_prop_cacheable(pl->pl_prop))
+ libzfs_set_cachedprops(g_zfs, B_FALSE);
+ }
+
cb.cb_first = B_TRUE;
ret = zfs_for_each(argc, argv, flags, types, sortcol, &cb.cb_proplist,
diff --git a/usr/src/cmd/zic/README.illumos b/usr/src/cmd/zic/README.illumos
new file mode 100644
index 0000000000..27799b3bff
--- /dev/null
+++ b/usr/src/cmd/zic/README.illumos
@@ -0,0 +1,52 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2014 Joyent, Inc. All rights reserved.
+#
+
+How to update the TZ database information.
+
+Welcome! You've probably heard that some aspect of time has changed and
+you're wondering what to do. The first thing to do is to grab the latest
+version of the time database which can currently be found at:
+
+http://www.iana.org/time-zones
+
+You'll need the data tarball. Most data files are used in the gate
+direcetly; however, a few have slightly different names. The following
+commands assume that you're inside of the directory you extracted the
+time zone files.
+
+$ cp africa antarctica asia australasia backward etcetera europe \
+northamerica pacificnew southamerica systemv $CODEMGR_WS/usr/src/cmd/zic
+
+Next you need to copy the country tab and the zone tab files. These have
+different names in our source tree.
+
+$ cp iso3166.tab $CODEMGR_WS/usr/src/cmd/zic/country.tab
+$ cp zone.tab $CODEMGR_WS/usr/src/cmd/zic/zone.tab.txt
+
+Now, you need to manaully fix up the zone_sun.tab. zone_sun.tab has
+additional different zone names that the original does not. As things
+are changed and removed, or coordinates updated, the same should be done
+in zone_sun.tab. The simplest way known to deal with it today is
+something like the following:
+
+$ cd $CODEMGR_WS/usr/src/cmd/zic
+$ vimdiff zone.tab.txt zone_sun.tab
+
+And as you see things that show up as egregiously different, do a 'git
+diff zone.tab.txt' and see what changed and fix zone_sun.tab
+appropriately. Usually this means deleting removed entries and adding
+new ones.
+
+Once that's all set, you should be good to go.
diff --git a/usr/src/cmd/zic/africa b/usr/src/cmd/zic/africa
index 87f57c650a..029e5c2246 100644
--- a/usr/src/cmd/zic/africa
+++ b/usr/src/cmd/zic/africa
@@ -1,13 +1,12 @@
# <pre>
-# @(#)africa 8.33
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
+# tz@iana.org for general use in the future).
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2013-02-21):
#
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -26,6 +25,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
@@ -117,8 +120,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 1912
1:00 - WAT
# Botswana
+# From Paul Eggert (2013-02-21):
+# Milne says they were regulated by the Cape Town Signal in 1899;
+# assume they switched to 2:00 when Cape Town did.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Gaborone 1:43:40 - LMT 1885
+ 1:30 - SAST 1903 Mar
2:00 - CAT 1943 Sep 19 2:00
2:00 1:00 CAST 1944 Mar 19 2:00
2:00 - CAT
@@ -190,6 +197,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
# Egypt
+# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh
+# observatory; round to nearest. Milne also says that the official time for
+# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
+# did not apply to Cairo, Alexandria, or Port Said.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Egypt 1940 only - Jul 15 0:00 1:00 S
Rule Egypt 1940 only - Oct 1 0:00 0 -
@@ -238,7 +250,7 @@ Rule Egypt 2006 only - Sep 21 23:00s 0 -
# I received a mail from an airline which says that the daylight
# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
# From Jesper Norgaard Welen (2007-08-15): [The following agree:]
-# http://www.nentjes.info/Bill/bill5.htm
+# http://www.nentjes.info/Bill/bill5.htm
# http://www.timeanddate.com/worldclock/city.html?n=53
# From Steffen Thorsen (2007-09-04): The official information...:
# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
@@ -292,18 +304,18 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 -
# in September.
# From Steffen Thorsen (2009-08-11):
-# We have been able to confirm the August change with the Egyptian Cabinet
+# We have been able to confirm the August change with the Egyptian Cabinet
# Information and Decision Support Center:
# <a href="http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html">
# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
# </a>
-#
+#
# The Middle East News Agency
# <a href="http://www.mena.org.eg/index.aspx">
# http://www.mena.org.eg/index.aspx
# </a>
# also reports "Egypt starts winter time on August 21"
-# today in article numbered "71, 11/08/2009 12:25 GMT."
+# today in article numbered "71, 11/08/2009 12:25 GMT."
# Only the title above is available without a subscription to their service,
# and can be found by searching for "winter" in their search engine
# (at least today).
@@ -330,7 +342,7 @@ Rule Egypt 2010 only - Sep 10 0:00 1:00 S
Rule Egypt 2010 only - Sep lastThu 23:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Africa/Cairo 2:05:00 - LMT 1900 Oct
+Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
2:00 Egypt EE%sT
# Equatorial Guinea
@@ -425,6 +437,28 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# Libya
+# From Even Scharning (2012-11-10):
+# Libya set their time one hour back at 02:00 on Saturday November 10.
+# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
+# Here is an official source [in Arabic]: http://ls.ly/fb6Yc
+#
+# Steffen Thorsen forwarded a translation (2012-11-10) in
+# http://mm.icann.org/pipermail/tz/2012-November/018451.html
+#
+# From Tim Parenti (2012-11-11):
+# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
+# The DST rules planned for 2013 and onward roughly mirror those of Europe
+# (either two days before them or five days after them, so as to fall on
+# lastFri instead of lastSun).
+
+# From Even Scharning (2013-10-25):
+# The scheduled end of DST in Libya on Friday, October 25, 2013 was
+# cancelled yesterday....
+# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
+#
+# From Paul Eggert (2013-10-25):
+# For now, assume they're reverting to the pre-2012 rules of permanent UTC+2.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Libya 1951 only - Oct 14 2:00 1:00 S
Rule Libya 1952 only - Jan 1 0:00 0 -
@@ -439,16 +473,21 @@ Rule Libya 1986 only - Apr 4 0:00 1:00 S
Rule Libya 1986 only - Oct 3 0:00 0 -
Rule Libya 1987 1989 - Apr 1 0:00 1:00 S
Rule Libya 1987 1989 - Oct 1 0:00 0 -
+Rule Libya 1997 only - Apr 4 0:00 1:00 S
+Rule Libya 1997 only - Oct 4 0:00 0 -
+Rule Libya 2013 only - Mar lastFri 1:00 1:00 S
+Rule Libya 2013 only - Oct lastFri 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Tripoli 0:52:44 - LMT 1920
1:00 Libya CE%sT 1959
2:00 - EET 1982
1:00 Libya CE%sT 1990 May 4
-# The following entries are from Shanks & Pottenger;
+# The 1996 and 1997 entries are from Shanks & Pottenger;
# the IATA SSIM data contain some obvious errors.
2:00 - EET 1996 Sep 30
- 1:00 - CET 1997 Apr 4
- 1:00 1:00 CEST 1997 Oct 4
+ 1:00 Libya CE%sT 1997 Oct 4
+ 2:00 - EET 2012 Nov 10 2:00
+ 1:00 Libya CE%sT 2013 Oct 25 2:00
2:00 - EET
# Madagascar
@@ -482,7 +521,7 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# From Steffen Thorsen (2008-06-25):
# Mauritius plans to observe DST from 2008-11-01 to 2009-03-31 on a trial
# basis....
-# It seems that Mauritius observed daylight saving time from 1982-10-10 to
+# It seems that Mauritius observed daylight saving time from 1982-10-10 to
# 1983-03-20 as well, but that was not successful....
# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
@@ -506,12 +545,12 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# than previously announced (2008-11-01 to 2009-03-31). The new start
# date is 2008-10-26 at 02:00 and the new end date is 2009-03-27 (no time
# given, but it is probably at either 2 or 3 wall clock time).
-#
-# A little strange though, since the article says that they moved the date
-# to align itself with Europe and USA which also change time on that date,
-# but that means they have not paid attention to what happened in
-# USA/Canada last year (DST ends first Sunday in November). I also wonder
-# why that they end on a Friday, instead of aligning with Europe which
+#
+# A little strange though, since the article says that they moved the date
+# to align itself with Europe and USA which also change time on that date,
+# but that means they have not paid attention to what happened in
+# USA/Canada last year (DST ends first Sunday in November). I also wonder
+# why that they end on a Friday, instead of aligning with Europe which
# changes two days later.
# From Alex Krivenyshev (2008-07-11):
@@ -570,7 +609,7 @@ Zone Africa/Nouakchott -1:03:48 - LMT 1912
# </a>
# From Arthur David Olson (2009-07-11):
-# The "mauritius-dst-will-not-repeat" wrapup includes this:
+# The "mauritius-dst-will-not-repeat" wrapup includes this:
# "The trial ended on March 29, 2009, when the clocks moved back by one hour
# at 2am (or 02:00) local time..."
@@ -654,18 +693,9 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
# </a>
-# From Alex Krivenyshev (2008-05-09):
-# Is Western Sahara (part which administrated by Morocco) going to follow
-# Morocco DST changes? Any information? What about other part of
-# Western Sahara - under administration of POLISARIO Front (also named
-# SADR Saharawi Arab Democratic Republic)?
-
-# From Arthur David Olson (2008-05-09):
-# XXX--guess that it is only Morocco for now; guess only 2008 for now.
-
# From Steffen Thorsen (2008-08-27):
-# Morocco will change the clocks back on the midnight between August 31
-# and September 1. They originally planned to observe DST to near the end
+# Morocco will change the clocks back on the midnight between August 31
+# and September 1. They originally planned to observe DST to near the end
# of September:
#
# One article about it (in French):
@@ -768,6 +798,110 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
# also been like that in the past.
+# From Alexander Krivenyshev (2012-03-09):
+# According to Infom&eacute;diaire web site from Morocco (infomediaire.ma),
+# on March 9, 2012, (in French) Heure l&eacute;gale:
+# Le Maroc adopte officiellement l'heure d'&eacute;t&eacute;
+# <a href="http://www.infomediaire.ma/news/maroc/heure-l%C3%A9gale-le-maroc-adopte-officiellement-lheure-d%C3%A9t%C3%A9">
+# http://www.infomediaire.ma/news/maroc/heure-l%C3%A9gale-le-maroc-adopte-officiellement-lheure-d%C3%A9t%C3%A9
+# </a>
+# Governing Council adopted draft decree, that Morocco DST starts on
+# the last Sunday of March (March 25, 2012) and ends on
+# last Sunday of September (September 30, 2012)
+# except the month of Ramadan.
+# or (brief)
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco06.html">
+# http://www.worldtimezone.com/dst_news/dst_news_morocco06.html
+# </a>
+
+# From Arthur David Olson (2012-03-10):
+# The infomediaire.ma source indicates that the system is to be in
+# effect every year. It gives 03H00 as the "fall back" time of day;
+# it lacks a "spring forward" time of day; assume 2:00 XXX.
+# Wait on specifying the Ramadan exception for details about
+# start date, start time of day, end date, and end time of day XXX.
+
+# From Christophe Tropamer (2012-03-16):
+# Seen Morocco change again:
+# <a href="http://www.le2uminutes.com/actualite.php">
+# http://www.le2uminutes.com/actualite.php
+# </a>
+# "...&agrave; partir du dernier dimance d'avril et non fins mars,
+# comme annonc&eacute; pr&eacute;c&eacute;demment."
+
+# From Milamber Space Network (2012-07-17):
+# The official return to GMT is announced by the Moroccan government:
+# <a href="http://www.mmsp.gov.ma/fr/actualites.aspx?id=288">
+# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288 [in French]
+# </a>
+#
+# Google translation, lightly edited:
+# Back to the standard time of the Kingdom (GMT)
+# Pursuant to Decree No. 2-12-126 issued on 26 Jumada (I) 1433 (April 18,
+# 2012) and in accordance with the order of Mr. President of the
+# Government No. 3-47-12 issued on 24 Sha'ban (11 July 2012), the Ministry
+# of Public Service and Administration Modernization announces the return
+# of the legal time of the Kingdom (GMT) from Friday, July 20, 2012 until
+# Monday, August 20, 2012. So the time will be delayed by 60 minutes from
+# 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes
+# August 20, 2012 from 2:00 am.
+
+# From Paul Eggert (2013-03-06):
+# Morocco's daylight-saving transitions due to Ramadan seem to be
+# announced a bit in advance. On 2012-07-11 the Moroccan government
+# announced that year's Ramadan daylight-saving transitions would be
+# 2012-07-20 and 2012-08-20; see
+# <http://www.mmsp.gov.ma/fr/actualites.aspx?id=288>.
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Steffen Thorsen (2013-09-28):
+# Morocco extends DST by one month, on very short notice, just 1 day
+# before it was going to end. There is a new decree (2.13.781) for
+# this, where DST from now on goes from last Sunday of March at 02:00
+# to last Sunday of October at 03:00, similar to EU rules. Official
+# source (French):
+# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013
+# Another source (specifying the time for start and end in the decree):
+# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
+
+# From Paul Eggert (2013-10-03):
+# To estimate what the Moroccan government will do in future years,
+# transition dates for 2014 through 2038 were determined by running
+# the following program under GNU Emacs 24.3:
+#
+# (let ((islamic-year 1435))
+# (while (< islamic-year 1461)
+# (let ((a
+# (calendar-gregorian-from-absolute
+# (calendar-islamic-to-absolute (list 9 1 islamic-year))))
+# (b
+# (calendar-gregorian-from-absolute
+# (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
+# (insert
+# (format
+# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n"
+# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n")
+# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
+# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
+# (setq islamic-year (+ 1 islamic-year))))
+#
+# with spring-forward transitions removed for 2023-2025, when the
+# normal spring-forward date falls during the estimated Ramadan; with
+# all transitions removed for 2026-2035, where the estimated Ramadan
+# falls entirely outside daylight-saving time; and with fall-back
+# transitions removed for 2036-2037, where the normal fall-back
+# date falls during the estimated Ramadan. Normally, the table would
+# stop after 2037 because 32-bit time_t values roll around early in 2038,
+# but that would imply a prediction of perpetual DST after March 2038
+# due to the year-2037 glitches. So, this table instead stops after
+# 2038, the first non-glitchy year after the 32-bit rollover.
+# An advantage of stopping after 2038 is that it lets zic guess
+# TZ='WET0WEST,M3.5.0,M10.5.0/3' for time stamps far in the future.
+
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 S
@@ -793,15 +927,62 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S
Rule Morocco 2010 only - Aug 8 0:00 0 -
Rule Morocco 2011 only - Apr 3 0:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 -
+Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S
+Rule Morocco 2012 only - Sep 30 3:00 0 -
+Rule Morocco 2012 only - Jul 20 3:00 0 -
+Rule Morocco 2012 only - Aug 20 2:00 1:00 S
+Rule Morocco 2013 only - Jul 7 3:00 0 -
+Rule Morocco 2013 only - Aug 10 2:00 1:00 S
+Rule Morocco 2013 2035 - Oct lastSun 3:00 0 -
+Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S
+Rule Morocco 2014 only - Jun 29 3:00 0 -
+Rule Morocco 2014 only - Jul 29 2:00 1:00 S
+Rule Morocco 2015 only - Jun 18 3:00 0 -
+Rule Morocco 2015 only - Jul 18 2:00 1:00 S
+Rule Morocco 2016 only - Jun 7 3:00 0 -
+Rule Morocco 2016 only - Jul 7 2:00 1:00 S
+Rule Morocco 2017 only - May 27 3:00 0 -
+Rule Morocco 2017 only - Jun 26 2:00 1:00 S
+Rule Morocco 2018 only - May 16 3:00 0 -
+Rule Morocco 2018 only - Jun 15 2:00 1:00 S
+Rule Morocco 2019 only - May 6 3:00 0 -
+Rule Morocco 2019 only - Jun 5 2:00 1:00 S
+Rule Morocco 2020 only - Apr 24 3:00 0 -
+Rule Morocco 2020 only - May 24 2:00 1:00 S
+Rule Morocco 2021 only - Apr 13 3:00 0 -
+Rule Morocco 2021 only - May 13 2:00 1:00 S
+Rule Morocco 2022 only - Apr 3 3:00 0 -
+Rule Morocco 2022 only - May 3 2:00 1:00 S
+Rule Morocco 2023 only - Apr 22 2:00 1:00 S
+Rule Morocco 2024 only - Apr 10 2:00 1:00 S
+Rule Morocco 2025 only - Mar 31 2:00 1:00 S
+Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
+Rule Morocco 2036 only - Oct 21 3:00 0 -
+Rule Morocco 2037 only - Oct 11 3:00 0 -
+Rule Morocco 2038 only - Sep 30 3:00 0 -
+Rule Morocco 2038 only - Oct 30 2:00 1:00 S
+Rule Morocco 2038 max - Oct lastSun 3:00 0 -
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
0:00 Morocco WE%sT 1984 Mar 16
1:00 - CET 1986
0:00 Morocco WE%sT
+
# Western Sahara
+#
+# From Gwillim Law (2013-10-22):
+# A correspondent who is usually well informed about time zone matters
+# ... says that Western Sahara observes daylight saving time, just as
+# Morocco does.
+#
+# From Paul Eggert (2013-10-23):
+# Assume that this has been true since Western Sahara switched to GMT,
+# since most of it was then controlled by Morocco.
+
Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan
-1:00 - WAT 1976 Apr 14
- 0:00 - WET
+ 0:00 Morocco WE%sT
# Mozambique
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -820,7 +1001,7 @@ Zone Africa/Maputo 2:10:20 - LMT 1903 Mar
# Forecasting Riaan van Zyl explained that the far eastern parts of
# the country are close to 40 minutes earlier in sunrise than the rest
# of the country.
-#
+#
# From Paul Eggert (2007-03-31):
# Apparently the Caprivi Strip informally observes Botswana time, but
# we have no details. In the meantime people there can use Africa/Gaborone.
@@ -958,9 +1139,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931
3:00 - EAT
# South Sudan
-Zone Africa/Juba 2:06:24 - LMT 1931
- 2:00 Sudan CA%sT 2000 Jan 15 12:00
- 3:00 - EAT
+Link Africa/Khartoum Africa/Juba
# Swaziland
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
diff --git a/usr/src/cmd/zic/antarctica b/usr/src/cmd/zic/antarctica
index d19fbde0fc..5333b7b3d4 100644
--- a/usr/src/cmd/zic/antarctica
+++ b/usr/src/cmd/zic/antarctica
@@ -1,5 +1,4 @@
# <pre>
-# @(#)antarctica 8.9
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -17,9 +16,9 @@
#
# Except for the French entries,
# I made up all time zone abbreviations mentioned here; corrections welcome!
-# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
+# FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
-# These rules are stolen from the `southamerica' file.
+# These rules are stolen from the 'southamerica' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule ArgAQ 1964 1966 - Mar 1 0:00 0 -
Rule ArgAQ 1964 1966 - Oct 15 0:00 1:00 S
@@ -42,36 +41,17 @@ Rule ChileAQ 1997 only - Mar 30 3:00u 0 -
Rule ChileAQ 1998 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 1998 only - Sep 27 4:00u 1:00 S
Rule ChileAQ 1999 only - Apr 4 3:00u 0 -
-Rule ChileAQ 1999 max - Oct Sun>=9 4:00u 1:00 S
-Rule ChileAQ 2000 max - Mar Sun>=9 3:00u 0 -
-
-# These rules are stolen from the `australasia' file.
-Rule AusAQ 1917 only - Jan 1 0:01 1:00 -
-Rule AusAQ 1917 only - Mar 25 2:00 0 -
-Rule AusAQ 1942 only - Jan 1 2:00 1:00 -
-Rule AusAQ 1942 only - Mar 29 2:00 0 -
-Rule AusAQ 1942 only - Sep 27 2:00 1:00 -
-Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 -
-Rule AusAQ 1943 only - Oct 3 2:00 1:00 -
-Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 -
-Rule ATAQ 1968 only - Mar lastSun 2:00s 0 -
-Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 -
-Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 -
-Rule ATAQ 1972 only - Feb lastSun 2:00s 0 -
-Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 -
-Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 -
-Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 -
-Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 -
-Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 -
-Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 -
-Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 -
-Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 -
-Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 -
-Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 -
-Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 -
-Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 -
-Rule ATAQ 2007 only - Mar lastSun 2:00s 0 -
-Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
+Rule ChileAQ 1999 2010 - Oct Sun>=9 4:00u 1:00 S
+Rule ChileAQ 2000 2007 - Mar Sun>=9 3:00u 0 -
+# N.B.: the end of March 29 in Chile is March 30 in Universal time,
+# which is used below in specifying the transition.
+Rule ChileAQ 2008 only - Mar 30 3:00u 0 -
+Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
+Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
+Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
+Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
+Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 -
+Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
# Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
@@ -114,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
# </a>
# From Steffen Thorsen (2010-03-10):
-# We got these changes from the Australian Antarctic Division:
-# - Macquarie Island will stay on UTC+11 for winter and therefore not
-# switch back from daylight savings time when other parts of Australia do
-# on 4 April.
+# We got these changes from the Australian Antarctic Division: ...
#
# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
# The change to UTC+11 is being considered as a regular summer thing but
@@ -128,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
#
# - Mawson station stays on UTC+5.
#
-# In addition to the Rule changes for Casey/Davis, it means that Macquarie
-# will no longer be like Hobart and will have to have its own Zone created.
-#
# Background:
# <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
@@ -142,23 +116,21 @@ Zone Antarctica/Casey 0 - zzz 1969
# Western (Aus) Standard Time
11:00 - CAST 2010 Mar 5 2:00
# Casey Time
+ 8:00 - WST 2011 Oct 28 2:00
+ 11:00 - CAST 2012 Feb 21 17:00u
8:00 - WST
Zone Antarctica/Davis 0 - zzz 1957 Jan 13
7:00 - DAVT 1964 Nov # Davis Time
0 - zzz 1969 Feb
7:00 - DAVT 2009 Oct 18 2:00
5:00 - DAVT 2010 Mar 10 20:00u
+ 7:00 - DAVT 2011 Oct 28 2:00
+ 5:00 - DAVT 2012 Feb 21 20:00u
7:00 - DAVT
Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
6:00 - MAWT 2009 Oct 18 2:00
# Mawson Time
5:00 - MAWT
-Zone Antarctica/Macquarie 0 - zzz 1911
- 10:00 - EST 1916 Oct 1 2:00
- 10:00 1:00 EST 1917 Feb
- 10:00 AusAQ EST 1967
- 10:00 ATAQ EST 2010 Apr 4 3:00
- 11:00 - MIST # Macquarie Island Time
# References:
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
# Casey Weather (1998-02-26)
@@ -256,9 +228,10 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 29
# Scott Island (never inhabited)
#
# year-round base
-# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
+# Scott Base, Ross Island, since 1957-01.
+# See Pacific/Auckland.
#
-# These rules for New Zealand are stolen from the `australasia' file.
+# These rules for New Zealand are stolen from the 'australasia' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D
Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D
@@ -296,11 +269,11 @@ Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S
# From Lee Hotz (2001-03-08):
# I queried the folks at Columbia who spent the summer at Vostok and this is
# what they had to say about time there:
-# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
+# "in the US Camp (East Camp) we have been on New Zealand (McMurdo)
# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
# of GMT). This is a time zone I think two hours east of Moscow. The
-# natural time zone is in between the two: 8 hours ahead of GMT.''
+# natural time zone is in between the two: 8 hours ahead of GMT."
#
# From Paul Eggert (2001-05-04):
# This seems to be hopelessly confusing, so I asked Lee Hotz about it
@@ -365,16 +338,8 @@ Zone Antarctica/Palmer 0 - zzz 1965
-4:00 ChileAQ CL%sT
#
#
-# McMurdo, Ross Island, since 1955-12
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Antarctica/McMurdo 0 - zzz 1956
- 12:00 NZAQ NZ%sT
-#
-# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
-#
-# From Paul Eggert (1996-09-03):
-# Normally it wouldn't have a separate entry, since it's like the
-# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
+# McMurdo Station, Ross Island, since 1955-12
+# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
#
# From Chris Carrier (1996-06-27):
# Siple, the first commander of the South Pole station,
@@ -396,4 +361,4 @@ Zone Antarctica/McMurdo 0 - zzz 1956
# we have to go around and set them back 5 minutes or so.
# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
#
-Link Antarctica/McMurdo Antarctica/South_Pole
+# See 'australasia' for Antarctica/McMurdo.
diff --git a/usr/src/cmd/zic/asia b/usr/src/cmd/zic/asia
index 925cc36f0f..2867e643c6 100644
--- a/usr/src/cmd/zic/asia
+++ b/usr/src/cmd/zic/asia
@@ -1,12 +1,12 @@
-# @(#)asia 8.69
+# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
+# tz@iana.org for general use in the future).
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2013-08-11):
#
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -25,6 +25,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
@@ -40,11 +44,11 @@
# 4:00 GST Gulf*
# 5:30 IST India
# 7:00 ICT Indochina*
-# 7:00 WIT west Indonesia
-# 8:00 CIT central Indonesia
+# 7:00 WIB west Indonesia (Waktu Indonesia Barat)
+# 8:00 WITA central Indonesia (Waktu Indonesia Tengah)
# 8:00 CST China
# 9:00 CJT Central Japanese Time (1896/1937)*
-# 9:00 EIT east Indonesia
+# 9:00 WIT east Indonesia (Waktu Indonesia Timur)
# 9:00 JST JDT Japan
# 9:00 KST KDT Korea
# 9:30 CST (Australian) Central Standard Time
@@ -77,10 +81,6 @@ Rule RussiaAsia 1993 max - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1993 1995 - Sep lastSun 2:00s 0 -
Rule RussiaAsia 1996 max - Oct lastSun 2:00s 0 -
-# From Arthur David Olson (2011-06-15):
-# While Russia abandoned DST in 2011, Armenia may choose to
-# follow Russia's "old" rules.
-
# Afghanistan
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Kabul 4:36:48 - LMT 1890
@@ -97,6 +97,21 @@ Zone Asia/Kabul 4:36:48 - LMT 1890
# in 1996, though it did use DST in 1995. IATA SSIM (1991/1998) reports that
# Armenia switched from 3:00 to 4:00 in 1998 and observed DST after 1991,
# but started switching at 3:00s in 1998.
+
+# From Arthur David Olson (2011-06-15):
+# While Russia abandoned DST in 2011, Armenia may choose to
+# follow Russia's "old" rules.
+
+# From Alexander Krivenyshev (2012-02-10):
+# According to News Armenia, on Feb 9, 2012,
+# http://newsarmenia.ru/society/20120209/42609695.html
+#
+# The Armenia National Assembly adopted final reading of Amendments to the
+# Law "On procedure of calculation time on the territory of the Republic of
+# Armenia" according to which Armenia [is] abolishing Daylight Saving Time.
+# or
+# (brief)
+# http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
3:00 - YERT 1957 Mar # Yerevan Time
@@ -104,7 +119,8 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
3:00 1:00 YERST 1991 Sep 23 # independence
3:00 RussiaAsia AM%sT 1995 Sep 24 2:00s
4:00 - AMT 1997
- 4:00 RussiaAsia AM%sT
+ 4:00 RussiaAsia AM%sT 2012 Mar 25 2:00s
+ 4:00 - AMT
# Azerbaijan
# From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
@@ -169,15 +185,15 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # Al Manamah
# </a>
# From A. N. M. Kamrus Saadat (2009-06-15):
-# Finally we've got the official mail regarding DST start time where DST start
-# time is mentioned as Jun 19 2009, 23:00 from BTRC (Bangladesh
-# Telecommunication Regulatory Commission).
+# Finally we've got the official mail regarding DST start time where DST start
+# time is mentioned as Jun 19 2009, 23:00 from BTRC (Bangladesh
+# Telecommunication Regulatory Commission).
#
# No DST end date has been announced yet.
# From Alexander Krivenyshev (2009-09-25):
-# Bangladesh won't go back to Standard Time from October 1, 2009,
-# instead it will continue DST measure till the cabinet makes a fresh decision.
+# Bangladesh won't go back to Standard Time from October 1, 2009,
+# instead it will continue DST measure till the cabinet makes a fresh decision.
#
# Following report by same newspaper-"The Daily Star Friday":
# "DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1"
@@ -191,8 +207,8 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # Al Manamah
# From Steffen Thorsen (2009-10-13):
# IANS (Indo-Asian News Service) now reports:
-# Bangladesh has decided that the clock advanced by an hour to make
-# maximum use of daylight hours as an energy saving measure would
+# Bangladesh has decided that the clock advanced by an hour to make
+# maximum use of daylight hours as an energy saving measure would
# "continue for an indefinite period."
#
# One of many places where it is published:
@@ -220,7 +236,7 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # Al Manamah
# From Alexander Krivenyshev (2010-03-22):
# According to Bangladesh newspaper "The Daily Star,"
-# Cabinet cancels Daylight Saving Time
+# Cabinet cancels Daylight Saving Time
# <a href="http://www.thedailystar.net/newDesign/latest_news.php?nid=22817">
# http://www.thedailystar.net/newDesign/latest_news.php?nid=22817
# </a>
@@ -267,9 +283,12 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
8:00 - BNT
# Burma / Myanmar
+
+# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
- 6:24:36 - RMT 1920 # Rangoon Mean Time?
+ 6:24:40 - RMT 1920 # Rangoon Mean Time?
6:30 - BURT 1942 May # Burma Time
9:00 - JST 1945 May 3
6:30 - MMT # Myanmar Time
@@ -348,11 +367,11 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# observing daylight saving time in 1986.
#
# From Thomas S. Mullaney (2008-02-11):
-# I think you're combining two subjects that need to treated
-# separately: daylight savings (which, you're correct, wasn't
-# implemented until the 1980s) and the unified time zone centered near
-# Beijing (which was implemented in 1949). Briefly, there was also a
-# "Lhasa Time" in Tibet and "Urumqi Time" in Xinjiang. The first was
+# I think you're combining two subjects that need to treated
+# separately: daylight savings (which, you're correct, wasn't
+# implemented until the 1980s) and the unified time zone centered near
+# Beijing (which was implemented in 1949). Briefly, there was also a
+# "Lhasa Time" in Tibet and "Urumqi Time" in Xinjiang. The first was
# ceased, and the second eventually recognized (again, in the 1980s).
#
# From Paul Eggert (2008-06-30):
@@ -372,7 +391,8 @@ Zone Asia/Harbin 8:26:44 - LMT 1928 # or Haerbin
8:00 PRC C%sT
# Zhongyuan Time ("Central plain Time")
# most of China
-Zone Asia/Shanghai 8:05:52 - LMT 1928
+# Milne gives 8:05:56.7; round to nearest.
+Zone Asia/Shanghai 8:05:57 - LMT 1928
8:00 Shang C%sT 1949
8:00 PRC C%sT
# Long-shu Time (probably due to Long and Shu being two names of that area)
@@ -469,6 +489,10 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
8:00 PRC C%sT
+# Hong Kong (Xianggang)
+
+# Milne gives 7:36:41.7; round this.
+
# From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the...DST rule for Hong
# Kong. [According] to the DST record from Hong Kong Observatory (actually,
@@ -489,7 +513,7 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
# as of 2009-10-28:
# Year Period
# 1941 1 Apr to 30 Sep
-# 1942 Whole year
+# 1942 Whole year
# 1943 Whole year
# 1944 Whole year
# 1945 Whole year
@@ -535,7 +559,6 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
# The Japanese surrender of Hong Kong was signed 1945-09-15.
# For lack of anything better, use start of those days as the transition times.
-# Hong Kong (Xianggang)
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule HK 1941 only - Apr 1 3:30 1:00 S
Rule HK 1941 only - Sep 30 3:30 0 -
@@ -557,7 +580,7 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S
Rule HK 1979 only - May Sun>=8 3:30 1:00 S
Rule HK 1979 only - Oct Sun>=16 3:30 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30
+Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
8:00 HK HK%sT 1941 Dec 25
9:00 - JST 1945 Sep 15
8:00 HK HK%sT
@@ -580,16 +603,16 @@ Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30
# From Arthur David Olson (2010-04-07):
# Here's Google's translation of the table at the bottom of the "summert.htm" page:
# Decade Name Start and end date
-# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time May 1 to September 30
-# 41 years of the Republic of China (AD 1952) Daylight Saving Time March 1 to October 31
-# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time April 1 to October 31
-# In the 44 years to 45 years (AD 1955-1956 years) Daylight Saving Time April 1 to September 30
-# Republic of China 46 years to 48 years (AD 1957-1959) Summer Time April 1 to September 30
-# Republic of China 49 years to 50 years (AD 1960-1961) Summer Time June 1 to September 30
-# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time
-# Republic of China 63 years to 64 years (1974-1975 AD) Daylight Saving Time April 1 to September 30
-# Republic of China 65 years to 67 years (1976-1978 AD) Stop Daylight Saving Time
-# Republic of China 68 years (AD 1979) Daylight Saving Time July 1 to September 30
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time May 1 to September 30
+# 41 years of the Republic of China (AD 1952) Daylight Saving Time March 1 to October 31
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time April 1 to October 31
+# In the 44 years to 45 years (AD 1955-1956 years) Daylight Saving Time April 1 to September 30
+# Republic of China 46 years to 48 years (AD 1957-1959) Summer Time April 1 to September 30
+# Republic of China 49 years to 50 years (AD 1960-1961) Summer Time June 1 to September 30
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time
+# Republic of China 63 years to 64 years (1974-1975 AD) Daylight Saving Time April 1 to September 30
+# Republic of China 65 years to 67 years (1976-1978 AD) Stop Daylight Saving Time
+# Republic of China 68 years (AD 1979) Daylight Saving Time July 1 to September 30
# Republic of China since 69 years (AD 1980) Stop Daylight Saving Time
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -634,6 +657,9 @@ Zone Asia/Macau 7:34:20 - LMT 1912
###############################################################################
# Cyprus
+#
+# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT.
+#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 -
@@ -730,7 +756,7 @@ Zone Asia/Dili 8:22:20 - LMT 1912
8:00 - TLT 1942 Feb 21 23:00 # E Timor Time
9:00 - JST 1945 Sep 23
9:00 - TLT 1976 May 3
- 8:00 - CIT 2000 Sep 17 00:00
+ 8:00 - WITA 2000 Sep 17 00:00
9:00 - TLT
# India
@@ -767,36 +793,53 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
# (Hollandia). For now, assume all Indonesian locations other than Jayapura
# switched on 1945-09-23.
#
+# From Paul Eggert (2013-08-11):
+# Normally the tz database uses English-language abbreviations, but in
+# Indonesia it's typical to use Indonesian-language abbreviations even
+# when writing in English. For example, see the English-language
+# summary published by the Time and Frequency Laboratory of the
+# Research Center for Calibration, Instrumentation and Metrology,
+# Indonesia, <http://time.kim.lipi.go.id/time-eng.php> (2006-09-29).
+# The abbreviations are:
+#
+# WIB - UTC+7 - Waktu Indonesia Barat (Indonesia western time)
+# WITA - UTC+8 - Waktu Indonesia Tengah (Indonesia central time)
+# WIT - UTC+9 - Waktu Indonesia Timur (Indonesia eastern time)
+#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
+# Java, Sumatra
Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10
# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
# but this must be a typo.
- 7:07:12 - JMT 1923 Dec 31 23:47:12 # Jakarta
+ 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia
7:20 - JAVT 1932 Nov # Java Time
- 7:30 - WIT 1942 Mar 23
+ 7:30 - WIB 1942 Mar 23
9:00 - JST 1945 Sep 23
- 7:30 - WIT 1948 May
- 8:00 - WIT 1950 May
- 7:30 - WIT 1964
- 7:00 - WIT
+ 7:30 - WIB 1948 May
+ 8:00 - WIB 1950 May
+ 7:30 - WIB 1964
+ 7:00 - WIB
+# west and central Borneo
Zone Asia/Pontianak 7:17:20 - LMT 1908 May
7:17:20 - PMT 1932 Nov # Pontianak MT
- 7:30 - WIT 1942 Jan 29
+ 7:30 - WIB 1942 Jan 29
9:00 - JST 1945 Sep 23
- 7:30 - WIT 1948 May
- 8:00 - WIT 1950 May
- 7:30 - WIT 1964
- 8:00 - CIT 1988 Jan 1
- 7:00 - WIT
+ 7:30 - WIB 1948 May
+ 8:00 - WIB 1950 May
+ 7:30 - WIB 1964
+ 8:00 - WITA 1988 Jan 1
+ 7:00 - WIB
+# Sulawesi, Lesser Sundas, east and south Borneo
Zone Asia/Makassar 7:57:36 - LMT 1920
7:57:36 - MMT 1932 Nov # Macassar MT
- 8:00 - CIT 1942 Feb 9
+ 8:00 - WITA 1942 Feb 9
9:00 - JST 1945 Sep 23
- 8:00 - CIT
+ 8:00 - WITA
+# Maluku Islands, West Papua, Papua
Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
- 9:00 - EIT 1944 Sep 1
+ 9:00 - WIT 1944 Sep 1
9:30 - CST 1964
- 9:00 - EIT
+ 9:00 - WIT
# Iran
@@ -1158,15 +1201,15 @@ Rule Zion 2004 only - Sep 22 1:00 0 S
#
# ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps
-# From Paul Eggert (2005-02-22):
+# From Paul Eggert (2012-10-26):
# I used Ephraim Silverberg's dst-israel.el program
# <ftp://ftp.cs.huji.ac.il/pub/tz/software/dst-israel.el> (2005-02-20)
# along with Ed Reingold's cal-hebrew in GNU Emacs 21.4,
-# to generate the transitions in this list.
+# to generate the transitions from 2005 through 2012.
# (I replaced "lastFri" with "Fri>=26" by hand.)
-# The spring transitions below all correspond to the following Rule:
+# The spring transitions all correspond to the following Rule:
#
-# Rule Zion 2005 max - Mar Fri>=26 2:00 1:00 D
+# Rule Zion 2005 2012 - Mar Fri>=26 2:00 1:00 D
#
# but older zic implementations (e.g., Solaris 8) do not support
# "Fri>=26" to mean April 1 in years like 2005, so for now we list the
@@ -1183,42 +1226,24 @@ Rule Zion 2009 only - Sep 27 2:00 0 S
Rule Zion 2010 only - Sep 12 2:00 0 S
Rule Zion 2011 only - Apr 1 2:00 1:00 D
Rule Zion 2011 only - Oct 2 2:00 0 S
-Rule Zion 2012 2015 - Mar Fri>=26 2:00 1:00 D
+Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D
Rule Zion 2012 only - Sep 23 2:00 0 S
-Rule Zion 2013 only - Sep 8 2:00 0 S
-Rule Zion 2014 only - Sep 28 2:00 0 S
-Rule Zion 2015 only - Sep 20 2:00 0 S
-Rule Zion 2016 only - Apr 1 2:00 1:00 D
-Rule Zion 2016 only - Oct 9 2:00 0 S
-Rule Zion 2017 2021 - Mar Fri>=26 2:00 1:00 D
-Rule Zion 2017 only - Sep 24 2:00 0 S
-Rule Zion 2018 only - Sep 16 2:00 0 S
-Rule Zion 2019 only - Oct 6 2:00 0 S
-Rule Zion 2020 only - Sep 27 2:00 0 S
-Rule Zion 2021 only - Sep 12 2:00 0 S
-Rule Zion 2022 only - Apr 1 2:00 1:00 D
-Rule Zion 2022 only - Oct 2 2:00 0 S
-Rule Zion 2023 2032 - Mar Fri>=26 2:00 1:00 D
-Rule Zion 2023 only - Sep 24 2:00 0 S
-Rule Zion 2024 only - Oct 6 2:00 0 S
-Rule Zion 2025 only - Sep 28 2:00 0 S
-Rule Zion 2026 only - Sep 20 2:00 0 S
-Rule Zion 2027 only - Oct 10 2:00 0 S
-Rule Zion 2028 only - Sep 24 2:00 0 S
-Rule Zion 2029 only - Sep 16 2:00 0 S
-Rule Zion 2030 only - Oct 6 2:00 0 S
-Rule Zion 2031 only - Sep 21 2:00 0 S
-Rule Zion 2032 only - Sep 12 2:00 0 S
-Rule Zion 2033 only - Apr 1 2:00 1:00 D
-Rule Zion 2033 only - Oct 2 2:00 0 S
-Rule Zion 2034 2037 - Mar Fri>=26 2:00 1:00 D
-Rule Zion 2034 only - Sep 17 2:00 0 S
-Rule Zion 2035 only - Oct 7 2:00 0 S
-Rule Zion 2036 only - Sep 28 2:00 0 S
-Rule Zion 2037 only - Sep 13 2:00 0 S
+
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law. The next day, the changes passed the First Reading
+# in the Knesset. The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March. DST ends at 02:00 on the last Sunday of October.
+
+# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
+Rule Zion 2013 max - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Jerusalem 2:20:56 - LMT 1880
+Zone Asia/Jerusalem 2:20:54 - LMT 1880
2:20:40 - JMT 1918 # Jerusalem Mean Time?
2:00 Zion I%sT
@@ -1350,6 +1375,28 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# From Arthur David Olson (2009-04-06):
# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
+# From Steffen Thorsen (2012-10-25):
+# Yesterday the government in Jordan announced that they will not
+# switch back to standard time this winter, so the will stay on DST
+# until about the same time next year (at least).
+# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950
+
+# From Steffen Thorsen (2013-12-11):
+# Jordan Times and other sources say that Jordan is going back to
+# UTC+2 on 2013-12-19 at midnight:
+# http://jordantimes.com/govt-decides-to-switch-back-to-wintertime
+# Official, in Arabic:
+# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14
+# ... Our background/permalink about it
+# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
+# ...
+# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P
+# ... says midnight for the coming one and 1:00 for the ones in the future
+# (and they will use DST again next year, using the normal schedule).
+
+# From Paul Eggert (2013-12-11):
+# As Steffen suggested, consider the past 21-month experiment to be DST.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Jordan 1973 only - Jun 6 0:00 1:00 S
Rule Jordan 1973 1975 - Oct 1 0:00 0 -
@@ -1374,11 +1421,14 @@ Rule Jordan 1995 1998 - Sep Fri>=15 0:00s 0 -
Rule Jordan 1999 only - Jul 1 0:00s 1:00 S
Rule Jordan 1999 2002 - Sep lastFri 0:00s 0 -
Rule Jordan 2000 2001 - Mar lastThu 0:00s 1:00 S
-Rule Jordan 2002 max - Mar lastThu 24:00 1:00 S
+Rule Jordan 2002 2012 - Mar lastThu 24:00 1:00 S
Rule Jordan 2003 only - Oct 24 0:00s 0 -
Rule Jordan 2004 only - Oct 15 0:00s 0 -
Rule Jordan 2005 only - Sep lastFri 0:00s 0 -
-Rule Jordan 2006 max - Oct lastFri 0:00s 0 -
+Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 -
+Rule Jordan 2013 only - Dec 20 0:00 0 -
+Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S
+Rule Jordan 2014 max - Oct lastFri 0:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Amman 2:23:44 - LMT 1931
2:00 Jordan EE%sT
@@ -1781,8 +1831,11 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
5:45 - NPT # Nepal Time
# Oman
+
+# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Muscat 3:54:20 - LMT 1920
+Zone Asia/Muscat 3:54:24 - LMT 1920
4:00 - GST
# Pakistan
@@ -1823,15 +1876,15 @@ Zone Asia/Muscat 3:54:20 - LMT 1920
# shown 8 per cent higher consumption of electricity.
# From Alex Krivenyshev (2008-05-15):
-#
-# Here is an article that Pakistan plan to introduce Daylight Saving Time
+#
+# Here is an article that Pakistan plan to introduce Daylight Saving Time
# on June 1, 2008 for 3 months.
-#
-# "... The federal cabinet on Wednesday announced a new conservation plan to help
-# reduce load shedding by approving the closure of commercial centres at 9pm and
-# moving clocks forward by one hour for the next three months.
+#
+# "... The federal cabinet on Wednesday announced a new conservation plan to help
+# reduce load shedding by approving the closure of commercial centres at 9pm and
+# moving clocks forward by one hour for the next three months.
# ...."
-#
+#
# <a href="http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html">
# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
# </a>
@@ -1891,7 +1944,7 @@ Zone Asia/Muscat 3:54:20 - LMT 1920
# Government has decided to restore the previous time by moving the
# clocks backward by one hour from October 1. A formal announcement to
# this effect will be made after the Prime Minister grants approval in
-# this regard."
+# this regard."
# <a href="http://www.thenews.com.pk/updates.asp?id=87168">
# http://www.thenews.com.pk/updates.asp?id=87168
# </a>
@@ -2029,8 +2082,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# occurred before our cutoff date of 1970.
# However, as we get more information, we may need to add entries
# for parts of the West Bank as they transitioned from Israel's rules
-# to Palestine's rules. If you have more info about this, please
-# send it to tz@elsie.nci.nih.gov for incorporation into future editions.
+# to Palestine's rules.
# From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time,
# forwarded by Ephraim Silverberg:
@@ -2187,7 +2239,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# <a href="http://www.maannews.net/eng/ViewDetails.aspx?ID=306795">
# http://www.maannews.net/eng/ViewDetails.aspx?ID=306795
# </a>
-# the clocks were set back one hour at 2010-08-11 00:00:00 local time in
+# the clocks were set back one hour at 2010-08-11 00:00:00 local time in
# Gaza and the West Bank.
# Some more background info:
# <a href="http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html">
@@ -2226,7 +2278,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# The rules for Egypt are stolen from the `africa' file.
# From Steffen Thorsen (2011-09-30):
-# West Bank did end Daylight Saving Time this morning/midnight (2011-09-30
+# West Bank did end Daylight Saving Time this morning/midnight (2011-09-30
# 00:00).
# So West Bank and Gaza now have the same time again.
#
@@ -2235,6 +2287,47 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://www.maannews.net/eng/ViewDetails.aspx?ID=424808
# </a>
+# From Steffen Thorsen (2012-03-26):
+# Palestinian news sources tell that both Gaza and West Bank will start DST
+# on Friday (Thursday midnight, 2012-03-29 24:00).
+# Some of many sources in Arabic:
+# <a href="http://www.samanews.com/index.php?act=Show&id=122638">
+# http://www.samanews.com/index.php?act=Show&id=122638
+# </a>
+#
+# <a href="http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html">
+# http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html
+# </a>
+#
+# Our brief summary:
+# <a href="http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html">
+# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
+# </a>
+
+# From Steffen Thorsen (2013-03-26):
+# The following news sources tells that Palestine will "start daylight saving
+# time from midnight on Friday, March 29, 2013" (translated).
+# [These are in Arabic and are for Gaza and for Ramallah, respectively.]
+# http://www.samanews.com/index.php?act=Show&id=154120
+# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
+
+# From Steffen Thorsen (2013-09-24):
+# The Gaza and West Bank are ending DST Thursday at midnight
+# (2013-09-27 00:00:00) (one hour earlier than last year...).
+# This source in English, says "that winter time will go into effect
+# at midnight on Thursday in the West Bank and Gaza Strip":
+# http://english.wafa.ps/index.php?action=detail&id=23246
+# official source...:
+# http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252
+
+# From Paul Eggert (2013-09-24):
+# For future dates, guess the last Thursday in March at 24:00 through
+# the first Friday on or after September 21 at 00:00. This is consistent with
+# the predictions in today's editions of the following URLs,
+# which are for Gaza and Hebron respectively:
+# http://www.timeanddate.com/worldclock/timezone.html?n=702
+# http://www.timeanddate.com/worldclock/timezone.html?n=2364
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 -
@@ -2247,17 +2340,21 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0:00 1:00 S
Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 -
Rule Palestine 2004 only - Oct 1 1:00 0 -
Rule Palestine 2005 only - Oct 4 2:00 0 -
-Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S
+Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S
Rule Palestine 2006 only - Sep 22 0:00 0 -
Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
-Rule Palestine 2008 only - Aug lastFri 0:00 0 -
-Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S
-Rule Palestine 2009 only - Sep Fri>=1 2:00 0 -
-Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S
+Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S
+Rule Palestine 2008 only - Sep 1 0:00 0 -
+Rule Palestine 2009 only - Sep Fri>=1 1:00 0 -
+Rule Palestine 2010 only - Mar 26 0:00 1:00 S
Rule Palestine 2010 only - Aug 11 0:00 0 -
-
-# From Arthur David Olson (2011-09-20):
-# 2011 transitions per http://www.timeanddate.com as of 2011-09-20.
+Rule Palestine 2011 only - Apr 1 0:01 1:00 S
+Rule Palestine 2011 only - Aug 1 0:00 0 -
+Rule Palestine 2011 only - Aug 30 0:00 1:00 S
+Rule Palestine 2011 only - Sep 30 0:00 0 -
+Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S
+Rule Palestine 2012 only - Sep 21 1:00 0 -
+Rule Palestine 2013 max - Sep Fri>=21 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
@@ -2265,22 +2362,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999
- 2:00 Palestine EE%sT 2011 Apr 2 12:01
- 2:00 1:00 EEST 2011 Aug 1
- 2:00 - EET
+ 2:00 Palestine EE%sT 2008 Aug 29 0:00
+ 2:00 - EET 2008 Sep
+ 2:00 Palestine EE%sT 2010
+ 2:00 - EET 2010 Mar 27 0:01
+ 2:00 Palestine EE%sT 2011 Aug 1
+ 2:00 - EET 2012
+ 2:00 Palestine EE%sT
Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
2:00 Zion EET 1948 May 15
2:00 EgyptAsia EE%sT 1967 Jun 5
2:00 Zion I%sT 1996
2:00 Jordan EE%sT 1999
- 2:00 Palestine EE%sT 2008 Aug
- 2:00 1:00 EEST 2008 Sep
- 2:00 Palestine EE%sT 2011 Apr 1 12:01
- 2:00 1:00 EEST 2011 Aug 1
- 2:00 - EET 2011 Aug 30
- 2:00 1:00 EEST 2011 Sep 30 3:00
- 2:00 - EET
+ 2:00 Palestine EE%sT
# Paracel Is
# no information
@@ -2349,6 +2444,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
# no information
# Sri Lanka
+
+# From Paul Eggert (2013-02-21):
+# Milne says "Madras mean time use from May 1, 1898. Prior to this Colombo
+# mean time, 5h. 4m. 21.9s. F., was used." But 5:04:21.9 differs considerably
+# from Colombo's meridian 5:19:24, so for now ignore Milne and stick with
+# Shanks and Pottenger.
+
# From Paul Eggert (1996-09-03):
# "Sri Lanka advances clock by an hour to avoid blackout"
# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
@@ -2468,24 +2570,24 @@ Rule Syria 2006 only - Sep 22 0:00 0 -
Rule Syria 2007 only - Mar lastFri 0:00 1:00 S
# From Jesper Norgard (2007-10-27):
# The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
+# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sense than
# having it between Wednesday and Thursday (two workdays in Syria) since the
# weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
# it is implemented at midnight of the last workday before weekend...
-#
+#
# From Steffen Thorsen (2007-10-27):
# Jesper Norgaard Welen wrote:
-#
+#
# > "Winter local time in Syria will be observed at midnight of Thursday 1
# > November 2007, and the clock will be put back 1 hour."
-#
+#
# I found confirmation on this in this gov.sy-article (Arabic):
# http://wehda.alwehda.gov.sy/_print_veiw.asp?FileName=12521710520070926111247
-#
+#
# which using Google's translate tools says:
-# Council of Ministers also approved the commencement of work on
-# identifying the winter time as of Friday, 2/11/2007 where the 60th
+# Council of Ministers also approved the commencement of work on
+# identifying the winter time as of Friday, 2/11/2007 where the 60th
# minute delay at midnight Thursday 1/11/2007.
Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
@@ -2551,8 +2653,8 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# </a>
# From Steffen Thorsen (2009-10-27):
-# The Syrian Arab News Network on 2009-09-29 reported that Syria will
-# revert back to winter (standard) time on midnight between Thursday
+# The Syrian Arab News Network on 2009-09-29 reported that Syria will
+# revert back to winter (standard) time on midnight between Thursday
# 2009-10-29 and Friday 2009-10-30:
# <a href="http://www.sana.sy/ara/2/2009/09/29/247012.htm">
# http://www.sana.sy/ara/2/2009/09/29/247012.htm (Arabic)
@@ -2571,10 +2673,28 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# http://sns.sy/sns/?path=news/read/11421 (Arabic)
# </a>
+# From Steffen Thorsen (2012-03-26):
+# Today, Syria's government announced that they will start DST early on Friday
+# (00:00). This is a bit earlier than the past two years.
+#
+# From Syrian Arab News Agency, in Arabic:
+# <a href="http://www.sana.sy/ara/2/2012/03/26/408215.htm">
+# http://www.sana.sy/ara/2/2012/03/26/408215.htm
+# </a>
+#
+# Our brief summary:
+# <a href="http://www.timeanddate.com/news/time/syria-dst-2012.html">
+# http://www.timeanddate.com/news/time/syria-dst-2012.html
+# </a>
+
+# From Arthur David Olson (2012-03-27):
+# Assume last Friday in March going forward XXX.
+
Rule Syria 2008 only - Apr Fri>=1 0:00 1:00 S
Rule Syria 2008 only - Nov 1 0:00 0 -
Rule Syria 2009 only - Mar lastFri 0:00 1:00 S
-Rule Syria 2010 max - Apr Fri>=1 0:00 1:00 S
+Rule Syria 2010 2011 - Apr Fri>=1 0:00 1:00 S
+Rule Syria 2012 max - Mar lastFri 0:00 1:00 S
Rule Syria 2009 max - Oct lastFri 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -2630,6 +2750,12 @@ Zone Asia/Tashkent 4:37:12 - LMT 1924 May 2
# Vietnam
+# From Paul Eggert (2013-02-21):
+# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being
+# used in Lower Laos, Cambodia, and Annam. But this is quite a ways
+# from Saigon's location. For now, ignore this and stick with Shanks
+# and Pottenger.
+
# From Arthur David Olson (2008-03-18):
# The English-language name of Vietnam's most populous city is "Ho Chi Min City";
# we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
@@ -2643,6 +2769,10 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9
7:00 - ICT
# Yemen
+
+# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
+# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Aden 3:00:48 - LMT 1950
+Zone Asia/Aden 2:59:54 - LMT 1950
3:00 - AST
diff --git a/usr/src/cmd/zic/australasia b/usr/src/cmd/zic/australasia
index 930beed32e..8685d00464 100644
--- a/usr/src/cmd/zic/australasia
+++ b/usr/src/cmd/zic/australasia
@@ -1,5 +1,4 @@
# <pre>
-# @(#)australasia 8.28
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -219,9 +218,32 @@ Zone Australia/Lord_Howe 10:36:20 - LMT 1895 Feb
# no times are set
#
# Macquarie
-# permanent occupation (scientific station) since 1948;
-# sealing and penguin oil station operated 1888/1917
-# like Australia/Hobart
+# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948;
+# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the
+# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island
+# <http://www.parks.tas.gov.au/index.aspx?base=1828>
+# <http://www.parks.tas.gov.au/index.aspx?base=1831>.
+# Guess that it was like Australia/Hobart while inhabited before 2010.
+#
+# From Steffen Thorsen (2010-03-10):
+# We got these changes from the Australian Antarctic Division:
+# - Macquarie Island will stay on UTC+11 for winter and therefore not
+# switch back from daylight savings time when other parts of Australia do
+# on 4 April.
+#
+# From Arthur David Olson (2013-05-23):
+# The 1919 transition is overspecified below so pre-2013 zics
+# will produce a binary file with an EST-type as the first 32-bit type;
+# this is required for correct handling of times before 1916 by
+# pre-2013 versions of localtime.
+Zone Antarctica/Macquarie 0 - zzz 1899 Nov
+ 10:00 - EST 1916 Oct 1 2:00
+ 10:00 1:00 EST 1917 Feb
+ 10:00 Aus EST 1919 Apr 1 0:00s
+ 0 - zzz 1948 Mar 25
+ 10:00 Aus EST 1967
+ 10:00 AT EST 2010 Apr 4 3:00
+ 11:00 - MIST # Macquarie I Standard Time
# Christmas
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -247,6 +269,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
6:30 - CCT # Cocos Islands Time
# Fiji
+
+# Milne gives 11:55:44 for Suva.
+
# From Alexander Krivenyshev (2009-11-10):
# According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST
# from November 29th 2009 to April 25th 2010.
@@ -284,9 +309,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# </a>
# From Alexander Krivenyshev (2010-10-24):
-# According to Radio Fiji and Fiji Times online, Fiji will end DST 3
+# According to Radio Fiji and Fiji Times online, Fiji will end DST 3
# weeks earlier than expected - on March 6, 2011, not March 27, 2011...
-# Here is confirmation from Government of the Republic of the Fiji Islands,
+# Here is confirmation from Government of the Republic of the Fiji Islands,
# Ministry of Information (fiji.gov.fj) web site:
# <a href="http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=2608:daylight-savings&catid=71:press-releases&Itemid=155">
# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=2608:daylight-savings&catid=71:press-releases&Itemid=155
@@ -297,28 +322,59 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# </a>
# From Steffen Thorsen (2011-10-03):
-# Now the dates have been confirmed, and at least our start date
+# Now the dates have been confirmed, and at least our start date
# assumption was correct (end date was one week wrong).
#
# <a href="http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=4966:daylight-saving-starts-in-fiji&catid=71:press-releases&Itemid=155">
# www.fiji.gov.fj/index.php?option=com_content&view=article&id=4966:daylight-saving-starts-in-fiji&catid=71:press-releases&Itemid=155
# </a>
# which says
-# Members of the public are reminded to change their time to one hour in
-# advance at 2am to 3am on October 23, 2011 and one hour back at 3am to
+# Members of the public are reminded to change their time to one hour in
+# advance at 2am to 3am on October 23, 2011 and one hour back at 3am to
# 2am on February 26 next year.
+# From Ken Rylander (2011-10-24)
+# Another change to the Fiji DST end date. In the TZ database the end date for
+# Fiji DST 2012, is currently Feb 26. This has been changed to Jan 22.
+#
+# <a href="http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155">
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=5017:amendments-to-daylight-savings&catid=71:press-releases&Itemid=155
+# </a>
+# states:
+#
+# The end of daylight saving scheduled initially for the 26th of February 2012
+# has been brought forward to the 22nd of January 2012.
+# The commencement of daylight saving will remain unchanged and start
+# on the 23rd of October, 2011.
+
+# From the Fiji Government Online Portal (2012-08-21) via Steffen Thorsen:
+# The Minister for Labour, Industrial Relations and Employment Mr Jone Usamate
+# today confirmed that Fiji will start daylight savings at 2 am on Sunday 21st
+# October 2012 and end at 3 am on Sunday 20th January 2013.
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155
+
+# From the Fijian Government Media Center (2013-08-30) via David Wheeler:
+# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am
+# on Sunday 19th January, 2014.... move clocks forward by one hour from 2am
+# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx
+#
+# From Paul Eggert (2013-09-09):
+# For now, guess that Fiji springs forward the Sunday before the fourth
+# Monday in October. This matches both recent practice and
+# timeanddate.com's current spring-forward prediction.
+# For the January 2014 transition we guessed right while timeanddate.com
+# guessed wrong, so leave the fall-back prediction alone.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S
Rule Fiji 1999 2000 - Feb lastSun 3:00 0 -
Rule Fiji 2009 only - Nov 29 2:00 1:00 S
Rule Fiji 2010 only - Mar lastSun 3:00 0 -
-Rule Fiji 2010 only - Oct 24 2:00 1:00 S
+Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S
Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
-Rule Fiji 2011 only - Oct 23 2:00 1:00 S
-Rule Fiji 2012 only - Feb 26 3:00 0 -
+Rule Fiji 2012 max - Jan Sun>=18 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva
+Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time
# French Polynesia
@@ -440,6 +496,7 @@ Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2
Zone Pacific/Chatham 12:13:48 - LMT 1957 Jan 1
12:45 Chatham CHA%sT
+Link Pacific/Auckland Antarctica/McMurdo
# Auckland Is
# uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers,
@@ -545,7 +602,7 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
# From David Zuelke (2011-05-09):
# Subject: Samoa to move timezone from east to west of international date line
-#
+#
# <a href="http://www.morningstar.co.uk/uk/markets/newsfeeditem.aspx?id=138501958347963">
# http://www.morningstar.co.uk/uk/markets/newsfeeditem.aspx?id=138501958347963
# </a>
@@ -602,6 +659,28 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
# Dateline Change skip Friday 30th Dec 2011
# Thursday 29th December 2011 23:59:59 Hours
# Saturday 31st December 2011 00:00:00 Hours
+#
+# Clarification by Tim Parenti (2012-01-03):
+# Although Samoa has used Daylight Saving Time in the 2010-2011 and 2011-2012
+# seasons, there is not yet any indication that this trend will continue on
+# a regular basis. For now, we have explicitly listed the transitions below.
+#
+# From Nicky (2012-09-10):
+# Daylight Saving Time commences on Sunday 30th September 2012 and
+# ends on Sunday 7th of April 2013.
+#
+# Please find link below for more information.
+# http://www.mcil.gov.ws/mcil_publications.html
+#
+# That publication also includes dates for Summer of 2013/4 as well
+# which give the impression of a pattern in selecting dates for the
+# future, so for now, we will guess this will continue.
+
+# Western Samoa
+# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule WS 2012 max - Sep lastSun 3:00 1 D
+Rule WS 2012 max - Apr Sun>=1 4:00 0 -
+# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
-11:26:56 - LMT 1911
-11:30 - SAMT 1950 # Samoa Time
@@ -609,8 +688,8 @@ Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
-11:00 1:00 WSDT 2011 Apr 2 4:00
-11:00 - WST 2011 Sep 24 3:00
-11:00 1:00 WSDT 2011 Dec 30
- 13:00 1:00 WSDT 2012 Apr 1 4:00
- 13:00 - WST
+ 13:00 1:00 WSDT 2012 Apr Sun>=1 4:00
+ 13:00 WS WS%sT
# Solomon Is
# excludes Bougainville, for which see Papua New Guinea
@@ -619,9 +698,28 @@ Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara
11:00 - SBT # Solomon Is Time
# Tokelau Is
+#
+# From Gwillim Law (2011-12-29)
+# A correspondent informed me that Tokelau, like Samoa, will be skipping
+# December 31 this year ...
+#
+# From Steffen Thorsen (2012-07-25)
+# ... we double checked by calling hotels and offices based in Tokelau asking
+# about the time there, and they all told a time that agrees with UTC+13....
+# Shanks says UTC-10 from 1901 [but] ... there is a good chance the change
+# actually was to UTC-11 back then.
+#
+# From Paul Eggert (2012-07-25)
+# A Google Books snippet of Appendix to the Journals of the House of
+# Representatives of New Zealand, Session 1948,
+# <http://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
+# was "11 hours slow on G.M.T." Go with Thorsen and assume Shanks & Pottenger
+# are off by an hour starting in 1901.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fakaofo -11:24:56 - LMT 1901
- -10:00 - TKT # Tokelau Time
+ -11:00 - TKT 2011 Dec 30 # Tokelau Time
+ 13:00 - TKT
# Tonga
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -648,7 +746,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901
# 1886-1891; Baker was similar but exact dates are not known.
# Inhabited by civilians 1935-1942; U.S. military bases 1943-1944;
# uninhabited thereafter.
-# Howland observed Hawaii Standard Time (UTC-10:30) in 1937;
+# Howland observed Hawaii Standard Time (UT-10:30) in 1937;
# see page 206 of Elgen M. Long and Marie K. Long,
# Amelia Earhart: the Mystery Solved, Simon & Schuster (2000).
# So most likely Howland and Baker observed Hawaii Time from 1935
@@ -661,8 +759,17 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901
# no information; was probably like Pacific/Kiritimati
# Johnston
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Pacific/Johnston -10:00 - HST
+#
+# From Paul Eggert (2013-09-03):
+# In his memoirs of June 6th to October 4, 1945
+# <http://www.315bw.org/Herb_Bach.htm> (2005), Herbert C. Bach writes,
+# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM
+# Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and
+# confirms that Johnston kept the same time as Honolulu in summer 1945.
+# We have no better information, so for now, assume this has been true
+# indefinitely into the past.
+#
+# See 'northamerica' for Pacific/Johnston.
# Kingman
# uninhabited
@@ -718,9 +825,9 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
+# tz@iana.org for general use in the future).
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2013-02-21):
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
@@ -738,6 +845,10 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
@@ -1302,22 +1413,22 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# See "southeast Australia" above for 2008 and later.
# From Steffen Thorsen (2009-04-28):
-# According to the official press release, South Australia's extended daylight
-# saving period will continue with the same rules as used during the 2008-2009
+# According to the official press release, South Australia's extended daylight
+# saving period will continue with the same rules as used during the 2008-2009
# summer (southern hemisphere).
-#
+#
# From
# <a href="http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf">
# http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf
# </a>
-# The extended daylight saving period that South Australia has been trialling
+# The extended daylight saving period that South Australia has been trialling
# for over the last year is now set to be ongoing.
-# Daylight saving will continue to start on the first Sunday in October each
+# Daylight saving will continue to start on the first Sunday in October each
# year and finish on the first Sunday in April the following year.
-# Industrial Relations Minister, Paul Caica, says this provides South Australia
-# with a consistent half hour time difference with NSW, Victoria, Tasmania and
+# Industrial Relations Minister, Paul Caica, says this provides South Australia
+# with a consistent half hour time difference with NSW, Victoria, Tasmania and
# the ACT for all 52 weeks of the year...
-#
+#
# We have a wrap-up here:
# <a href="http://www.timeanddate.com/news/time/south-australia-extends-dst.html">
# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
@@ -1389,12 +1500,12 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# From Paul Eggert (2000-01-08):
# IATA SSIM (1999-09) says DST ends 0100 local time. Go with McDow.
-# From the BBC World Service (1998-10-31 11:32 UTC):
+# From the BBC World Service in
+# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
# The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents. But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
+# improve productivity and reduce road accidents.... [T]he move is also
+# intended to boost Fiji's ability to attract tourists to witness the dawning
+# of the new millennium.
# http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
# reports that Fiji has discontinued DST.
@@ -1539,7 +1650,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
# From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
+# Tonga's director of tourism, who is also secretary of the National Millennium
# Committee, has a plan to get Tonga back in front.
# He has proposed a one-off move to tropical daylight saving for Tonga from
# October to March, which has won approval in principle from the Tongan
diff --git a/usr/src/cmd/zic/backward b/usr/src/cmd/zic/backward
index b8e5911651..06fb192eb1 100644
--- a/usr/src/cmd/zic/backward
+++ b/usr/src/cmd/zic/backward
@@ -1,5 +1,4 @@
# <pre>
-# @(#)backward 8.10
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -23,15 +22,17 @@ Link America/Kentucky/Louisville America/Louisville
Link America/Argentina/Mendoza America/Mendoza
Link America/Rio_Branco America/Porto_Acre
Link America/Argentina/Cordoba America/Rosario
-Link America/St_Thomas America/Virgin
+Link America/Denver America/Shiprock
+Link America/Port_of_Spain America/Virgin
+Link Pacific/Auckland Antarctica/South_Pole
Link Asia/Ashgabat Asia/Ashkhabad
+Link Asia/Kolkata Asia/Calcutta
Link Asia/Chongqing Asia/Chungking
Link Asia/Dhaka Asia/Dacca
Link Asia/Kathmandu Asia/Katmandu
-Link Asia/Kolkata Asia/Calcutta
Link Asia/Macau Asia/Macao
-Link Asia/Jerusalem Asia/Tel_Aviv
Link Asia/Ho_Chi_Minh Asia/Saigon
+Link Asia/Jerusalem Asia/Tel_Aviv
Link Asia/Thimphu Asia/Thimbu
Link Asia/Makassar Asia/Ujung_Pandang
Link Asia/Ulaanbaatar Asia/Ulan_Bator
@@ -67,6 +68,7 @@ Link America/Havana Cuba
Link Africa/Cairo Egypt
Link Europe/Dublin Eire
Link Europe/London Europe/Belfast
+Link Europe/Chisinau Europe/Tiraspol
Link Europe/London GB
Link Europe/London GB-Eire
Link Etc/GMT GMT+0
@@ -88,10 +90,10 @@ Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo
Link Asia/Shanghai PRC
+Link Pacific/Pohnpei Pacific/Ponape
Link Pacific/Pago_Pago Pacific/Samoa
-Link Pacific/Chuuk Pacific/Yap
Link Pacific/Chuuk Pacific/Truk
-Link Pacific/Pohnpei Pacific/Ponape
+Link Pacific/Chuuk Pacific/Yap
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
Link Asia/Taipei ROC
diff --git a/usr/src/cmd/zic/country.tab b/usr/src/cmd/zic/country.tab
index 950c40f1db..a1e4b42e44 100644
--- a/usr/src/cmd/zic/country.tab
+++ b/usr/src/cmd/zic/country.tab
@@ -1,18 +1,15 @@
-# <pre>
-# @(#)iso3166.tab 8.11
+# ISO 3166 alpha-2 country codes
+#
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
-# ISO 3166 alpha-2 country codes
#
-# From Paul Eggert (2006-09-27):
+# From Paul Eggert (2013-05-27):
#
# This file contains a table with the following columns:
# 1. ISO 3166-1 alpha-2 country code, current as of
-# ISO 3166-1 Newsletter VI-1 (2007-09-21). See:
-# <a href="http://www.iso.org/iso/en/prods-services/iso3166ma/index.html">
-# ISO 3166 Maintenance agency (ISO 3166/MA)
-# </a>.
-# 2. The usual English name for the country,
+# ISO 3166-1 Newsletter VI-15 (2013-05-10). See: Updates on ISO 3166
+# http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
+# 2. The usual English name for the coded region,
# chosen so that alphabetic sorting of subsets produces helpful lists.
# This is not the same as the English name in the ISO 3166 tables.
#
@@ -21,11 +18,12 @@
#
# Lines beginning with `#' are comments.
#
-# From Arthur David Olson (2011-08-17):
-# Resynchronized today with the ISO 3166 site (adding SS for South Sudan).
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs. It is not intended
+# to take or endorse any position on legal or territorial claims.
#
#country-
-#code country name
+#code name of country, territory, area, or subdivision
AD Andorra
AE United Arab Emirates
AF Afghanistan
@@ -55,7 +53,7 @@ BL St Barthelemy
BM Bermuda
BN Brunei
BO Bolivia
-BQ Bonaire Sint Eustatius & Saba
+BQ Caribbean Netherlands
BR Brazil
BS Bahamas
BT Bhutan
@@ -236,7 +234,7 @@ SR Suriname
SS South Sudan
ST Sao Tome & Principe
SV El Salvador
-SX Sint Maarten
+SX St Maarten (Dutch part)
SY Syria
SZ Swaziland
TC Turks & Caicos Is
diff --git a/usr/src/cmd/zic/etcetera b/usr/src/cmd/zic/etcetera
index f8eb4b58e6..9ba7f7bdd9 100644
--- a/usr/src/cmd/zic/etcetera
+++ b/usr/src/cmd/zic/etcetera
@@ -1,5 +1,4 @@
# <pre>
-# @(#)etcetera 8.3
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -32,9 +31,9 @@ Link Etc/GMT Etc/GMT0
# even though this is the opposite of what many people expect.
# POSIX has positive signs west of Greenwich, but many people expect
# positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses
-# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC
+# the abbreviation "GMT+4" and corresponds to 4 hours behind UT
# (i.e. west of Greenwich) even though many people would expect it to
-# mean 4 hours ahead of UTC (i.e. east of Greenwich).
+# mean 4 hours ahead of UT (i.e. east of Greenwich).
#
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
# TZ='<GMT-4>+4'; if you want time zone abbreviations conforming to
diff --git a/usr/src/cmd/zic/europe b/usr/src/cmd/zic/europe
index 22bdd3648b..a7b1676538 100644
--- a/usr/src/cmd/zic/europe
+++ b/usr/src/cmd/zic/europe
@@ -1,11 +1,10 @@
# <pre>
-# @(#)europe 8.39
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
+# tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
@@ -31,13 +30,19 @@
# William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03)
#
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>. He writes:
+# "It is requested that corrections and additions to these tables
+# may be sent to Mr. John Milne, Royal Geographical Society,
+# Savile Row, London." Nowadays please email them to tz@iana.org.
+#
# Brazil's Departamento Servico da Hora (DSH),
# <a href="http://pcdsh01.on.br/HISTHV.htm">
# History of Summer Time
# </a> (1998-09-21, in Portuguese)
#
-# I invented the abbreviations marked `*' in the following table;
+# I invented the abbreviations marked '*' in the following table;
# the rest are from earlier versions of this file, or from other sources.
# Corrections are welcome!
# std dst 2dst
@@ -91,7 +96,7 @@
# and a sketch map showing some of the sightlines involved. One paragraph
# of the text said:
#
-# `An old stone obelisk marking a forgotten terrestrial meridian stands
+# 'An old stone obelisk marking a forgotten terrestrial meridian stands
# beside the river at Kew. In the 18th century, before time and longitude
# was standardised by the Royal Observatory in Greenwich, scholars observed
# this stone and the movement of stars from Kew Observatory nearby. They
@@ -135,7 +140,7 @@
# From Paul Eggert (2003-09-27):
# Summer Time was first seriously proposed by William Willett (1857-1915),
# a London builder and member of the Royal Astronomical Society
-# who circulated a pamphlet ``The Waste of Daylight'' (1907)
+# who circulated a pamphlet "The Waste of Daylight" (1907)
# that proposed advancing clocks 20 minutes on each of four Sundays in April,
# and retarding them by the same amount on four Sundays in September.
# A bill was drafted in 1909 and introduced in Parliament several times,
@@ -160,10 +165,10 @@
# </a>
# From Paul Eggert (1996-09-03):
-# The OED Supplement says that the English originally said ``Daylight Saving''
+# The OED Supplement says that the English originally said "Daylight Saving"
# when they were debating the adoption of DST in 1908; but by 1916 this
# term appears only in quotes taken from DST's opponents, whereas the
-# proponents (who eventually won the argument) are quoted as using ``Summer''.
+# proponents (who eventually won the argument) are quoted as using "Summer".
# From Arthur David Olson (1989-01-19):
#
@@ -203,17 +208,23 @@
# which could not be said to run counter to any official description.
# From Paul Eggert (2000-10-02):
-# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common
+# Howse writes (p 157) 'DBST' too, but 'BDST' seems to have been common
# and follows the more usual convention of putting the location name first,
-# so we use `BDST'.
+# so we use 'BDST'.
# Peter Ilieve (1998-04-19) described at length
# the history of summer time legislation in the United Kingdom.
# Since 1998 Joseph S. Myers has been updating
# and extending this list, which can be found in
-# <a href="http://student.cusu.cam.ac.uk/~jsm28/british-time/">
+# http://student.cusu.cam.ac.uk/~jsm28/british-time/
+# <a href="http://www.polyomino.org.uk/british-time/">
# History of legal time in Britain
# </a>
+# Rob Crowther (2012-01-04) reports that that URL no longer
+# exists, and the article can now be found at:
+# <a href="http://www.polyomino.org.uk/british-time/">
+# http://www.polyomino.org.uk/british-time/
+# </a>
# From Joseph S. Myers (1998-01-06):
#
@@ -420,6 +431,8 @@ Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT
Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT
# Summer Time Order 1997 (S.I. 1997/2982)
# See EU for rules starting in 1996.
+#
+# Use Europe/London for Jersey, Guernsey, and the Isle of Man.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s
@@ -512,7 +525,7 @@ Rule C-Eur 1944 only - Oct 2 2:00s 0 -
# It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
# 2:00 standard time, e.g. 3:00 local time. However there are no
# countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
+# affected are apparently these fictitious zones that translate acronyms
# CET and MET:
#
# Zone CET 1:00 C-Eur CE%sT
@@ -569,12 +582,12 @@ Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# According to Kremlin press service, Russian President Dmitry Medvedev
# signed a federal law "On calculation of time" on June 9, 2011.
# According to the law Russia is abolishing daylight saving time.
-#
-# Medvedev signed a law "On the Calculation of Time" (in russian):
+#
+# Medvedev signed a law "On the Calculation of Time" (in russian):
# <a href="http://bmockbe.ru/events/?ID=7583">
# http://bmockbe.ru/events/?ID=7583
# </a>
-#
+#
# Medvedev signed a law on the calculation of the time (in russian):
# <a href="http://www.regnum.ru/news/polit/1413906.html">
# http://www.regnum.ru/news/polit/1413906.html
@@ -661,6 +674,8 @@ Zone Europe/Andorra 0:06:04 - LMT 1901
# Austria
+# Milne says Vienna time was 1:05:21.
+
# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
# 1945-11-18, but the Austrian Federal Office of Metrology and
# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
@@ -678,7 +693,7 @@ Rule Austria 1948 only - Apr 18 2:00s 1:00 S
Rule Austria 1980 only - Apr 6 0:00 1:00 S
Rule Austria 1980 only - Sep 28 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Europe/Vienna 1:05:20 - LMT 1893 Apr
+Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
1:00 C-Eur CE%sT 1920
1:00 Austria CE%sT 1940 Apr 1 2:00s
1:00 C-Eur CE%sT 1945 Apr 2 2:00s
@@ -784,7 +799,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880
1:00 EU CE%sT
# Bosnia and Herzegovina
-# see Serbia
+# See Europe/Belgrade.
# Bulgaria
#
@@ -812,10 +827,10 @@ Zone Europe/Sofia 1:33:16 - LMT 1880
2:00 EU EE%sT
# Croatia
-# see Serbia
+# See Europe/Belgrade.
# Cyprus
-# Please see the `asia' file for Asia/Nicosia.
+# Please see the 'asia' file for Asia/Nicosia.
# Czech Republic
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -832,6 +847,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850
1:00 C-Eur CE%sT 1944 Sep 17 2:00s
1:00 Czech CE%sT 1979
1:00 EU CE%sT
+# Use Europe/Prague also for Slovakia.
# Denmark, Faroe Islands, and Greenland
@@ -995,12 +1011,12 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base
# From Peter Ilieve (1996-10-28):
# [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s,
# but a relative confirms that Estonia still switches at 02:00s, writing:]
-# ``I do not [know] exactly but there are some little different
+# "I do not [know] exactly but there are some little different
# (confusing) rules for International Air and Railway Transport Schedules
# conversion in Sunday connected with end of summer time in Estonia....
# A discussion is running about the summer time efficiency and effect on
# human physiology. It seems that Estonia maybe will not change to
-# summer time next spring.''
+# summer time next spring."
# From Peter Ilieve (1998-11-04), heavily edited:
# <a href="http://trip.rk.ee/cgi-bin/thw?${BASE}=akt&${OOHTML}=rtd&TA=1998&TO=1&AN=1390">
@@ -1055,7 +1071,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
# Well, here in Helsinki we're just changing from summer time to regular one,
# and it's supposed to change at 4am...
-# From Janne Snabb (2010-0715):
+# From Janne Snabb (2010-07-15):
#
# I noticed that the Finland data is not accurate for years 1981 and 1982.
# During these two first trial years the DST adjustment was made one hour
@@ -1112,7 +1128,7 @@ Link Europe/Helsinki Europe/Mariehamn
#
-# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman.
+# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule France 1916 only - Jun 14 23:00s 1:00 S
Rule France 1916 1919 - Oct Sun>=1 23:00s 0 -
@@ -1151,10 +1167,10 @@ Rule France 1940 only - Feb 25 2:00 1:00 S
# write that they were used in Monaco and in many French locations.
# Le Corre writes that the upper limit of the free zone was Arneguy, Orthez,
# Mont-de-Marsan, Bazas, Langon, Lamotte-Montravel, Marouil, La
-# Rochefoucault, Champagne-Mouton, La Roche-Posay, La Haye-Decartes,
+# Rochefoucault, Champagne-Mouton, La Roche-Posay, La Haye-Descartes,
# Loches, Montrichard, Vierzon, Bourges, Moulins, Digoin,
# Paray-le-Monial, Montceau-les-Mines, Chalons-sur-Saone, Arbois,
-# Dole, Morez, St-Claude, and Collognes (Haute-Savioe).
+# Dole, Morez, St-Claude, and Collonges (Haute-Savoie).
Rule France 1941 only - May 5 0:00 2:00 M # Midsummer
# Shanks & Pottenger say this transition occurred at Oct 6 1:00,
# but go with Denis Excoffier (1997-12-12),
@@ -1234,6 +1250,21 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Apr
1:00 Germany CE%sT 1980
1:00 EU CE%sT
+# From Tobias Conradi (2011-09-12):
+# Busingen <http://www.buesingen.de>, surrounded by the Swiss canton
+# Schaffhausen, did not start observing DST in 1980 as the rest of DE
+# (West Germany at that time) and DD (East Germany at that time) did.
+# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
+# which in turn is covered by the zone Europe/Berlin.
+#
+# Source for the time in Busingen 1980:
+# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
+
+# From Arthur David Olson (2012-03-03):
+# Busingen and Zurich have shared clocks since 1970.
+
+Link Europe/Zurich Europe/Busingen
+
# Georgia
# Please see the "asia" file for Asia/Tbilisi.
# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
@@ -1387,7 +1418,7 @@ Zone Atlantic/Reykjavik -1:27:24 - LMT 1837
# <a href="http://toi.iriti.cnr.it/uk/ienitlt.html">
# Day-light Saving Time in Italy (2006-02-03)
# </a>
-# (`FP' below), taken from an Italian National Electrotechnical Institute
+# ('FP' below), taken from an Italian National Electrotechnical Institute
# publication. When the three sources disagree, guess who's right, as follows:
#
# year FP Shanks&P. (S) Whitman (W) Go with:
@@ -1533,10 +1564,22 @@ Zone Europe/Riga 1:36:24 - LMT 1880
2:00 EU EE%sT
# Liechtenstein
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun
- 1:00 - CET 1981
- 1:00 EU CE%sT
+
+# From Paul Eggert (2013-09-09):
+# Shanks & Pottenger say Vaduz is like Zurich.
+
+# From Alois Treindl (2013-09-18):
+# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf
+# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942.
+# I ... translate only the last two paragraphs:
+# ... during second world war, in the years 1941 and 1942, Liechtenstein
+# introduced daylight saving time, adapting to Switzerland. From 1943 on
+# central European time was in force throughout the year.
+# From a report of the duke's government to the high council,
+# regarding the introduction of a time law, of 31 May 1977.
+
+Link Europe/Zurich Europe/Vaduz
+
# Lithuania
@@ -1624,7 +1667,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
1:00 EU CE%sT
# Macedonia
-# see Serbia
+# See Europe/Belgrade.
# Malta
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -1678,6 +1721,18 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
# a pre-1880 LMT offset of 1:58:32.
#
# (which agrees with the earlier entry that had been removed)
+#
+# From Alexander Krivenyshev (2011-10-26)
+# NO need to divide Moldova into two timezones at this point.
+# As of today, Transnistria (Pridnestrovie)- Tiraspol reversed its own
+# decision to abolish DST this winter.
+# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
+# Tiraspol will go back to winter time on October 30, 2011.
+# News from Moldova (in russian):
+# <a href="http://ru.publika.md/link_317061.html">
+# http://ru.publika.md/link_317061.html
+# </a>
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Chisinau 1:55:20 - LMT 1880
@@ -1694,21 +1749,6 @@ Zone Europe/Chisinau 1:55:20 - LMT 1880
# See Romania commentary for the guessed 1997 transition to EU rules.
2:00 EU EE%sT
-Zone Europe/Tiraspol 1:58:32 - LMT 1880
- 1:55 - CMT 1918 Feb 15 # Chisinau MT
- 1:44:24 - BMT 1931 Jul 24 # Bucharest MT
- 2:00 Romania EE%sT 1940 Aug 15
- 2:00 1:00 EEST 1941 Jul 17
- 1:00 C-Eur CE%sT 1944 Aug 24
- 3:00 Russia MSK/MSD 1990
- 3:00 - MSK 1990 May 6
- 2:00 - EET 1991
- 2:00 Russia EE%sT 1992
- 2:00 E-Eur EE%sT 1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
- 2:00 EU EE%sT 2011 Mar lastSun 1:00u
- 3:00 - FET # Further-eastern European Time
-
# Monaco
# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
# more precise 0:09:21.
@@ -1720,7 +1760,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
1:00 EU CE%sT
# Montenegro
-# see Serbia
+# See Europe/Belgrade.
# Netherlands
@@ -1835,7 +1875,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
# before 1895, and therefore probably changed the local time somewhere
# between 1895 and 1925 (inclusive).
-# From Paul Eggert (2001-05-01):
+# From Paul Eggert (2013-09-04):
#
# Actually, Jan Mayen was never occupied by Germany during World War II,
# so it must have diverged from Oslo time during the war, as Oslo was
@@ -1846,7 +1886,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
# 1941 with a small Norwegian garrison and continued operations despite
# frequent air ttacks from Germans. In 1943 the Americans established a
# radiolocating station on the island, called "Atlantic City". Possibly
-# the UTC offset changed during the war, but I think it unlikely that
+# the UT offset changed during the war, but I think it unlikely that
# Jan Mayen used German daylight-saving rules.
#
# Svalbard is more complicated, as it was raided in August 1941 by an
@@ -1859,9 +1899,8 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
# the German armed forces at the Svalbard weather station code-named
# Haudegen did not surrender to the Allies until September 1945.
#
-# All these events predate our cutoff date of 1970. Unless we can
-# come up with more definitive info about the timekeeping during the
-# war years it's probably best just do...the following for now:
+# All these events predate our cutoff date of 1970, so use Europe/Oslo
+# for these regions.
Link Europe/Oslo Arctic/Longyearbyen
# Poland
@@ -2041,6 +2080,70 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# Russia
+# From Alexander Krivenyshev (2011-09-15):
+# Based on last Russian Government Decree # 725 on August 31, 2011
+# (Government document
+# <a href="http://www.government.ru/gov/results/16355/print/">
+# http://www.government.ru/gov/results/16355/print/
+# </a>
+# in Russian)
+# there are few corrections have to be made for some Russian time zones...
+# All updated Russian Time Zones were placed in table and translated to English
+# by WorldTimeZone.com at the link below:
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia36.htm">
+# http://www.worldtimezone.com/dst_news/dst_news_russia36.htm
+# </a>
+
+# From Sanjeev Gupta (2011-09-27):
+# Scans of [Decree #23 of January 8, 1992] are available at:
+# <a href="http://government.consultant.ru/page.aspx?1223966">
+# http://government.consultant.ru/page.aspx?1223966
+# They are in Cyrillic letters (presumably Russian).
+
+# From Arthur David Olson (2012-05-09):
+# Regarding the instant when clocks in time-zone-shifting parts of Russia
+# changed in September 2011:
+#
+# One source is
+# < a href="http://government.ru/gov/results/16355/>
+# http://government.ru/gov/results/16355/
+# </a>
+# which, according to translate.google.com, begins "Decree of August 31,
+# 2011 No 725" and contains no other dates or "effective date" information.
+#
+# Another source is
+# <a href="http://www.rg.ru/2011/09/06/chas-zona-dok.html">
+# http://www.rg.ru/2011/09/06/chas-zona-dok.html
+# </a>
+# which, according to translate.google.com, begins "Resolution of the
+# Government of the Russian Federation on August 31, 2011 N 725" and also
+# contains "Date first official publication: September 6, 2011 Posted on:
+# in the 'RG' - Federal Issue number 5573 September 6, 2011" but which
+# does not contain any "effective date" information.
+#
+# Another source is
+# <a href="http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7">
+# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
+# </a>
+# which, in note 8, contains "Resolution #725 of August 31, 2011...
+# Effective as of after 7 days following the day of the official publication"
+# but which does not contain any reference to September 6, 2011.
+#
+# The Wikipedia article refers to
+# <a href="http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896">
+# http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896
+# </a>
+# which seems to copy the text of the government.ru page.
+#
+# Tobias Conradi combines Wikipedia's
+# "as of after 7 days following the day of the official publication"
+# with www.rg.ru's "Date of first official publication: September 6, 2011" to get
+# September 13, 2011 as the cutover date (unusually, a Tuesday, as Tobias Conradi notes).
+#
+# None of the sources indicates a time of day for changing clocks.
+#
+# Go with 2011-09-13 0:00s.
+
# From Paul Eggert (2006-03-22):
# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
@@ -2055,7 +2158,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# so we (Novosibirsk) simply did not switch.
#
# From Andrey A. Chernov (1996-10-04):
-# `MSK' and `MSD' were born and used initially on Moscow computers with
+# 'MSK' and 'MSD' were born and used initially on Moscow computers with
# UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group)....
# The next step was the UUCP network, the Relcom predecessor
# (used mainly for mail), and MSK/MSD was actively used there.
@@ -2268,14 +2371,32 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15
# [parts of] Respublika Sakha (Yakutiya).
# From Oscar van Vlijmen (2009-11-29):
-# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij,
-# Ust'-Yanskij.
+# The Sakha districts are: Bulunskij, Verkhoyanskij, ... Ust'-Yanskij.
Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15
9:00 - VLAT 1930 Jun 21 # Vladivostok Time
10:00 Russia VLA%sT 1991 Mar 31 2:00s
9:00 Russia VLA%sST 1992 Jan 19 2:00s
10:00 Russia VLA%sT 2011 Mar 27 2:00s
11:00 - VLAT
+
+# From Arthur David Olson (2012-05-09):
+# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time
+# in 2011.
+#
+# From Paul Eggert (2012-11-25):
+# Shanks and Pottenger (2003) has Khandyga on Yakutsk time.
+# Make a wild guess that it switched to Vladivostok time in 2004.
+# This transition is no doubt wrong, but we have no better info.
+#
+Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
+ 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
+ 9:00 Russia YAK%sT 1991 Mar 31 2:00s
+ 8:00 Russia YAK%sT 1992 Jan 19 2:00s
+ 9:00 Russia YAK%sT 2004
+ 10:00 Russia VLA%sT 2011 Mar 27 2:00s
+ 11:00 - VLAT 2011 Sep 13 0:00s # Decree 725?
+ 10:00 - YAKT
+
#
# Sakhalinskaya oblast'.
# The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
@@ -2294,14 +2415,26 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
# From Oscar van Vlijmen (2009-11-29):
# The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij,
-# Nizhnekolymskij, Ojmyakonskij, Srednekolymskij.
+# Nizhnekolymskij, ... Srednekolymskij.
Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
10:00 - MAGT 1930 Jun 21 # Magadan Time
11:00 Russia MAG%sT 1991 Mar 31 2:00s
10:00 Russia MAG%sT 1992 Jan 19 2:00s
11:00 Russia MAG%sT 2011 Mar 27 2:00s
12:00 - MAGT
-#
+
+# From Arthur David Olson (2012-05-09):
+# Ojmyakonskij and the Kuril Islands switched from
+# Magadan time to Vladivostok time in 2011.
+Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
+ 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
+ 9:00 Russia YAKT 1981 Apr 1
+ 11:00 Russia MAG%sT 1991 Mar 31 2:00s
+ 10:00 Russia MAG%sT 1992 Jan 19 2:00s
+ 11:00 Russia MAG%sT 2011 Mar 27 2:00s
+ 12:00 - MAGT 2011 Sep 13 0:00s # Decree 725?
+ 11:00 - VLAT
+
# From Oscar van Vlijmen (2001-08-25): [This region consists of]
# Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
#
@@ -2324,6 +2457,9 @@ Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2
11:00 Russia ANA%sT 2011 Mar 27 2:00s
12:00 - ANAT
+# San Marino
+# See Europe/Rome.
+
# Serbia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Belgrade 1:22:00 - LMT 1884
@@ -2346,7 +2482,7 @@ Link Europe/Belgrade Europe/Zagreb # Croatia
Link Europe/Prague Europe/Bratislava
# Slovenia
-# see Serbia
+# See Europe/Belgrade.
# Spain
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -2480,7 +2616,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
# and their performance improved enormously. Communities began to keep
# mean time in preference to apparent time -- Geneva from 1780 ....
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-# From Whitman (who writes ``Midnight?''):
+# From Whitman (who writes "Midnight?"):
# Rule Swiss 1940 only - Nov 2 0:00 1:00 S
# Rule Swiss 1940 only - Dec 31 0:00 0 -
# From Shanks & Pottenger:
@@ -2525,23 +2661,53 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
# The 1940 rules must be deleted.
#
# One further detail for Switzerland, which is probably out of scope for
-# most users of tzdata:
-# The zone file
-# Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
-# 0:29:44 - BMT 1894 Jun #Bern Mean Time
-# 1:00 Swiss CE%sT 1981
-# 1:00 EU CE%sT
+# most users of tzdata: The [Europe/Zurich zone] ...
# describes all of Switzerland correctly, with the exception of
# the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not
# follow Bern Mean Time but kept its own local mean time.
# To represent this, an extra zone would be needed.
+#
+# From Alois Treindl (2013-09-11):
+# The Federal regulations say
+# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html
+# ... the meridian for Bern mean time ... is 7 degrees 26'22.50".
+# Expressed in time, it is 0h29m45.5s.
+
+# From Pierre-Yves Berger (2013-09-11):
+# the "Circulaire du conseil federal" (December 11 1893)
+# <http://www.amtsdruckschriften.bar.admin.ch/viewOrigDoc.do?id=10071353> ...
+# clearly states that the [1894-06-01] change should be done at midnight
+# but if no one is present after 11 at night, could be postponed until one
+# hour before the beginning of service.
+
+# From Paul Eggert (2013-09-11):
+# Round BMT to the nearest even second, 0:29:46.
+#
+# We can find no reliable source for Shanks's assertion that all of Switzerland
+# except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12. This book:
+#
+# Jakob Messerli. Gleichmassig, punktlich, schnell: Zeiteinteilung und
+# Zeitgebrauch in der Schweiz im 19. Jahrhundert. Chronos, Zurich 1995,
+# ISBN 3-905311-68-2, OCLC 717570797.
+#
+# suggests that the transition was more gradual, and that the Swiss did not
+# agree about civil time during the transition. The timekeeping it gives the
+# most detail for is postal and telegraph time: here, federal legislation (the
+# "Bundesgesetz uber die Erstellung von elektrischen Telegraphen") passed on
+# 1851-11-23, and an official implementation notice was published 1853-07-16
+# (Bundesblatt 1853, Bd. II, S. 859). On p 72 Messerli writes that in
+# practice since July 1853 Bernese time was used in "all postal and telegraph
+# offices in Switzerland from Geneva to St. Gallen and Basel to Chiasso"
+# (Google translation). For now, model this transition as occurring on
+# 1853-07-16, though it probably occurred at some other date in Zurich, and
+# legal civil time probably changed at still some other transition date.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S
Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
- 0:29:44 - BMT 1894 Jun # Bern Mean Time
+Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
+ 0:29:46 - BMT 1894 Jun # Bern Mean Time
1:00 Swiss CE%sT 1981
1:00 EU CE%sT
@@ -2575,11 +2741,11 @@ Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
# http://www.alomaliye.com/bkk_2002_3769.htm
# From G&ouml;kdeniz Karada&#x011f; (2011-03-10):
-#
+#
# According to the articles linked below, Turkey will change into summer
# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
# This change is due to a nationwide exam on 27th.
-#
+#
# <a href="http://www.worldbulletin.net/?aType=haber&ArticleID=70872">
# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
# </a>
@@ -2660,9 +2826,9 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine
#
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
# via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
+# BTW, I've found the official document on this matter. It's government
# regulations number 509, May 13, 1996. In my poor translation it says:
# "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
# of March at 3am the time is changing to 4am and each last Sunday of
@@ -2696,7 +2862,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# time this year after all.
#
# From Udo Schwedt (2011-10-18):
-# As far as I understand, the recent change to the Ukranian time zone
+# As far as I understand, the recent change to the Ukrainian time zone
# (Europe/Kiev) to introduce permanent daylight saving time (similar
# to Russia) was reverted today:
#
@@ -2765,7 +2931,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
# From Paul Eggert (2006-03-22):
# The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
# from Kiev to Moscow time sometime after the January 1994 elections.
-# Shanks (1999) says ``date of change uncertain'', but implies that it happened
+# Shanks (1999) says "date of change uncertain", but implies that it happened
# sometime between the 1994 DST switches. Shanks & Pottenger simply say
# 1994-09-25 03:00, but that can't be right. For now, guess it
# changed in May.
@@ -2779,6 +2945,9 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
3:00 - MSK 1997 Mar lastSun 1:00u
2:00 EU EE%sT
+# Vatican City
+# See Europe/Rome.
+
###############################################################################
# One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from
diff --git a/usr/src/cmd/zic/northamerica b/usr/src/cmd/zic/northamerica
index 68a7cd5191..83c521b830 100644
--- a/usr/src/cmd/zic/northamerica
+++ b/usr/src/cmd/zic/northamerica
@@ -1,5 +1,4 @@
# <pre>
-# @(#)northamerica 8.50
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
@@ -7,7 +6,7 @@
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
+# tz@iana.org for general use in the future).
# From Paul Eggert (1999-03-22):
# A reliable and entertaining source about time zones is
@@ -21,7 +20,7 @@
# Howse writes (pp 121-125) that time zones were invented by
# Professor Charles Ferdinand Dowd (1825-1904),
# Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
-# His pamphlet ``A System of National Time for Railroads'' (1870)
+# His pamphlet "A System of National Time for Railroads" (1870)
# was the result of his proposals at the Convention of Railroad Trunk Lines
# in New York City (1869-10). His 1870 proposal was based on Washington, DC,
# but in 1872-05 he moved the proposed origin to Greenwich.
@@ -41,8 +40,8 @@
# From Paul Eggert (2001-03-06):
# Daylight Saving Time was first suggested as a joke by Benjamin Franklin
-# in his whimsical essay ``An Economical Project for Diminishing the Cost
-# of Light'' published in the Journal de Paris (1784-04-26).
+# in his whimsical essay "An Economical Project for Diminishing the Cost
+# of Light" published in the Journal de Paris (1784-04-26).
# Not everyone is happy with the results:
#
# I don't really care how time is reckoned so long as there is some
@@ -168,8 +167,8 @@ Zone PST8PDT -8:00 US P%sT
# of the Aleutian islands. No DST.
# From Paul Eggert (1995-12-19):
-# The tables below use `NST', not `NT', for Nome Standard Time.
-# I invented `CAWT' for Central Alaska War Time.
+# The tables below use 'NST', not 'NT', for Nome Standard Time.
+# I invented 'CAWT' for Central Alaska War Time.
# From U. S. Naval Observatory (1989-01-19):
# USA EASTERN 5 H BEHIND UTC NEW YORK, WASHINGTON
@@ -238,9 +237,9 @@ Zone PST8PDT -8:00 US P%sT
# H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
# (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
# U.S.C. 260a(a)) is amended--
-# (1) by striking `first Sunday of April' and inserting `second
+# (1) by striking 'first Sunday of April' and inserting 'second
# Sunday of March'; and
-# (2) by striking `last Sunday of October' and inserting `first
+# (2) by striking 'last Sunday of October' and inserting 'first
# Sunday of November'.
# (b) Effective Date- Subsection (a) shall take effect 1 year after the
# date of enactment of this Act or March 1, 2007, whichever is later.
@@ -479,7 +478,7 @@ Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
-8:00 US P%sT 1946
-8:00 - PST 1969
-8:00 US P%sT 1980 Apr 27 2:00
- -9:00 US Y%sT 1980 Oct 26 2:00
+ -9:00 US Y%sT 1980 Oct 26 2:00
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
@@ -601,6 +600,8 @@ Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 #Schmitt&Cox
-10:30 - HST 1947 Jun 8 2:00 #Schmitt&Cox+2
-10:00 - HST
+Link Pacific/Honolulu Pacific/Johnston
+
# Now we turn to US areas that have diverged from the consensus since 1970.
# Arizona mostly uses MST.
@@ -637,8 +638,9 @@ Zone America/Phoenix -7:28:18 - LMT 1883 Nov 18 11:31:42
# Navajo Nation participates in the Daylight Saving Time policy, due to its
# large size and location in three states." (The "only" means that other
# tribal nations don't use DST.)
-
-Link America/Denver America/Shiprock
+#
+# From Paul Eggert (2013-08-26):
+# See America/Denver for a zone appropriate for the Navajo Nation.
# Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
# Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
@@ -678,13 +680,13 @@ Zone America/Boise -7:44:49 - LMT 1883 Nov 18 12:15:11
# and Switzerland counties have their own time zone histories as noted below.
#
# Shanks partitioned Indiana into 345 regions, each with its own time history,
-# and wrote ``Even newspaper reports present contradictory information.''
+# and wrote "Even newspaper reports present contradictory information."
# Those Hoosiers! Such a flighty and changeable people!
# Fortunately, most of the complexity occurred before our cutoff date of 1970.
#
# Other than Indianapolis, the Indiana place names are so nondescript
-# that they would be ambiguous if we left them at the `America' level.
-# So we reluctantly put them all in a subdirectory `America/Indiana'.
+# that they would be ambiguous if we left them at the 'America' level.
+# So we reluctantly put them all in a subdirectory 'America/Indiana'.
# From Paul Eggert (2005-08-16):
# http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
@@ -948,8 +950,8 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
# This story is too entertaining to be false, so go with Howse over Shanks.
#
# From Paul Eggert (2001-03-06):
-# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
-# one hour in 1914.'' This change is not in Shanks. We have no more
+# Garland (1927) writes "Cleveland and Detroit advanced their clocks
+# one hour in 1914." This change is not in Shanks. We have no more
# info, so omit this for now.
#
# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
@@ -989,7 +991,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# occupied 1857/1900 by the Navassa Phosphate Co
# US lighthouse 1917/1996-09
# currently uninhabited
-# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
+# see Mark Fineman, "An Isle Rich in Guano and Discord",
# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
# Jimmy Skaggs, _The Great Guano Rush_ (1994).
@@ -1020,7 +1022,10 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03)
#
-# See the `europe' file for Greenland.
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
+# See the 'europe' file for Greenland.
# Canada
@@ -1120,9 +1125,26 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# For now, assume all of DST-observing Canada will fall into line with the
# new US DST rules,
+# From Chris Walton (2011-12-01)
+# In the first of Tammy Hardwick's articles
+# <a href="http://www.ilovecreston.com/?p=articles&t=spec&ar=260">
+# http://www.ilovecreston.com/?p=articles&t=spec&ar=260
+# </a>
+# she quotes the Friday November 1/1918 edition of the Creston Review.
+# The quote includes these two statements:
+# 'Sunday the CPR went back to the old system of time...'
+# '... The daylight saving scheme was dropped all over Canada at the same time,'
+# These statements refer to a transition from daylight time to standard time
+# that occurred nationally on Sunday October 27/1918. This transition was
+# also documented in the Saturday October 26/1918 edition of the Toronto Star.
+
+# In light of that evidence, we alter the date from the earlier believed
+# Oct 31, to Oct 27, 1918 (and Sunday is a more likely transition day
+# than Thursday) in all Canadian rulesets.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Canada 1918 only - Apr 14 2:00 1:00 D
-Rule Canada 1918 only - Oct 31 2:00 0 S
+Rule Canada 1918 only - Oct 27 2:00 0 S
Rule Canada 1942 only - Feb 9 2:00 1:00 W # War
Rule Canada 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule Canada 1945 only - Sep 30 2:00 0 S
@@ -1204,7 +1226,7 @@ Zone America/St_Johns -3:30:52 - LMT 1884
# most of east Labrador
-# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
+# The name 'Happy Valley-Goose Bay' is too long; use 'Goose Bay'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Valley-Goose Bay
-3:30:52 - NST 1918
@@ -1321,25 +1343,27 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9
# Quebec
-# From Paul Eggert (2006-07-09):
-# Shanks & Pottenger write that since 1970 most of Quebec has been
-# like Montreal.
+# From Paul Eggert (2013-08-30):
+# Since 1970 most of Quebec has been like Toronto.
+# However, because earlier versions of the tz database mistakenly relied on data
+# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
+# a separate entry was created for most of Quebec. We're loath to lose
+# its pre-1970 info, even though the tz database is normally limited to
+# zones that differ after 1970, so keep this otherwise out-of-scope entry.
-# From Paul Eggert (2006-06-27):
# Matthews and Vincent (1998) also write that Quebec east of the -63
# meridian is supposed to observe AST, but residents as far east as
# Natashquan use EST/EDT, and residents east of Natashquan use AST.
-# In "Official time in Quebec" the Quebec department of justice writes in
-# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
-# that "The residents of the Municipality of the
-# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
-# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
-# written and use Atlantic standard time all year round. The same applies to
-# the residents of the Native facilities along the lower North Shore."
-# <http://www.assnat.qc.ca/eng/37legislature2/Projets-loi/Publics/06-a002.htm>
+# The Quebec department of justice writes in
+# "The situation in Minganie and Basse-Cote-Nord"
+# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
+# that the coastal strip from just east of Natashquan to Blanc-Sablon
+# observes Atlantic standard time all year round.
+# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
# says this common practice was codified into law as of 2007.
# For lack of better info, guess this practice began around 1970, contra to
# Shanks & Pottenger who have this region observing AST/ADT.
+# for post-1970 data America/Puerto_Rico.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Mont 1917 only - Mar 25 2:00 1:00 D
@@ -1383,7 +1407,6 @@ Zone America/Montreal -4:54:16 - LMT 1884
-5:00 Mont E%sT 1974
-5:00 Canada E%sT
-
# Ontario
# From Paul Eggert (2006-07-09):
@@ -1602,7 +1625,7 @@ Zone America/Thunder_Bay -5:57:00 - LMT 1895
-6:00 - CST 1910
-5:00 - EST 1942
-5:00 Canada E%sT 1970
- -5:00 Mont E%sT 1973
+ -5:00 Toronto E%sT 1973
-5:00 - EST 1974
-5:00 Canada E%sT
Zone America/Nipigon -5:53:04 - LMT 1895
@@ -1645,7 +1668,7 @@ Zone America/Atikokan -6:06:28 - LMT 1895
Rule Winn 1916 only - Apr 23 0:00 1:00 D
Rule Winn 1916 only - Sep 17 0:00 0 S
Rule Winn 1918 only - Apr 14 2:00 1:00 D
-Rule Winn 1918 only - Oct 31 2:00 0 S
+Rule Winn 1918 only - Oct 27 2:00 0 S
Rule Winn 1937 only - May 16 2:00 1:00 D
Rule Winn 1937 only - Sep 26 2:00 0 S
Rule Winn 1942 only - Feb 9 2:00 1:00 W # War
@@ -1728,7 +1751,7 @@ Zone America/Winnipeg -6:28:36 - LMT 1887 Jul 16
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Regina 1918 only - Apr 14 2:00 1:00 D
-Rule Regina 1918 only - Oct 31 2:00 0 S
+Rule Regina 1918 only - Oct 27 2:00 0 S
Rule Regina 1930 1934 - May Sun>=1 0:00 1:00 D
Rule Regina 1930 1934 - Oct Sun>=1 0:00 0 S
Rule Regina 1937 1941 - Apr Sun>=8 0:00 1:00 D
@@ -1765,7 +1788,7 @@ Zone America/Swift_Current -7:11:20 - LMT 1905 Sep
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Edm 1918 1919 - Apr Sun>=8 2:00 1:00 D
-Rule Edm 1918 only - Oct 31 2:00 0 S
+Rule Edm 1918 only - Oct 27 2:00 0 S
Rule Edm 1919 only - May 27 2:00 0 S
Rule Edm 1920 1923 - Apr lastSun 2:00 1:00 D
Rule Edm 1920 only - Oct lastSun 2:00 0 S
@@ -1795,9 +1818,68 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep
# Dawson Creek uses MST. Much of east BC is like Edmonton.
# Matthews and Vincent (1998) write that Creston is like Dawson Creek.
+# It seems though that (re: Creston) is not entirely correct:
+
+# From Chris Walton (2011-12-01):
+# There are two areas within the Canadian province of British Columbia
+# that do not currently observe daylight saving:
+# a) The Creston Valley (includes the town of Creston and surrounding area)
+# b) The eastern half of the Peace River Regional District
+# (includes the cities of Dawson Creek and Fort St. John)
+
+# Earlier this year I stumbled across a detailed article about the time
+# keeping history of Creston; it was written by Tammy Hardwick who is the
+# manager of the Creston & District Museum. The article was written in May 2009.
+# <a href="http://www.ilovecreston.com/?p=articles&t=spec&ar=260">
+# http://www.ilovecreston.com/?p=articles&t=spec&ar=260
+# </a>
+# According to the article, Creston has not changed its clocks since June 1918.
+# i.e. Creston has been stuck on UTC-7 for 93 years.
+# Dawson Creek, on the other hand, changed its clocks as recently as April 1972.
+
+# Unfortunately the exact date for the time change in June 1918 remains
+# unknown and will be difficult to ascertain. I e-mailed Tammy a few months
+# ago to ask if Sunday June 2 was a reasonable guess. She said it was just
+# as plausible as any other date (in June). She also said that after writing the
+# article she had discovered another time change in 1916; this is the subject
+# of another article which she wrote in October 2010.
+# <a href="http://www.creston.museum.bc.ca/index.php?module=comments&uop=view_comment&cm+id=56">
+# http://www.creston.museum.bc.ca/index.php?module=comments&uop=view_comment&cm+id=56
+# </a>
+
+# Here is a summary of the three clock change events in Creston's history:
+# 1. 1884 or 1885: adoption of Mountain Standard Time (GMT-7)
+# Exact date unknown
+# 2. Oct 1916: switch to Pacific Standard Time (GMT-8)
+# Exact date in October unknown; Sunday October 1 is a reasonable guess.
+# 3. June 1918: switch to Pacific Daylight Time (GMT-7)
+# Exact date in June unknown; Sunday June 2 is a reasonable guess.
+# note#1:
+# On Oct 27/1918 when daylight saving ended in the rest of Canada,
+# Creston did not change its clocks.
+# note#2:
+# During WWII when the Federal Government legislated a mandatory clock change,
+# Creston did not oblige.
+# note#3:
+# There is no guarantee that Creston will remain on Mountain Standard Time
+# (UTC-7) forever.
+# The subject was debated at least once this year by the town Council.
+# <a href="http://www.bclocalnews.com/kootenay_rockies/crestonvalleyadvance/news/116760809.html">
+# http://www.bclocalnews.com/kootenay_rockies/crestonvalleyadvance/news/116760809.html
+# </a>
+
+# During a period WWII, summer time (Daylight saying) was mandatory in Canada.
+# In Creston, that was handled by shifting the area to PST (-8:00) then applying
+# summer time to cause the offset to be -7:00, the same as it had been before
+# the change. It can be argued that the timezone abbreviation during this
+# period should be PDT rather than MST, but that doesn't seem important enough
+# (to anyone) to further complicate the rules.
+
+# The transition dates (and times) are guesses.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Vanc 1918 only - Apr 14 2:00 1:00 D
-Rule Vanc 1918 only - Oct 31 2:00 0 S
+Rule Vanc 1918 only - Oct 27 2:00 0 S
Rule Vanc 1942 only - Feb 9 2:00 1:00 W # War
Rule Vanc 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule Vanc 1945 only - Sep 30 2:00 0 S
@@ -1813,7 +1895,10 @@ Zone America/Dawson_Creek -8:00:56 - LMT 1884
-8:00 Canada P%sT 1947
-8:00 Vanc P%sT 1972 Aug 30 2:00
-7:00 - MST
-
+Zone America/Creston -7:46:04 - LMT 1884
+ -7:00 - MST 1916 Oct 1
+ -8:00 - PST 1918 Jun 2
+ -7:00 - MST
# Northwest Territories, Nunavut, Yukon
@@ -2127,7 +2212,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# From Paul Eggert (1996-06-12):
# For an English translation of the decree, see
# <a href="http://mexico-travel.com/extra/timezone_eng.html">
-# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
+# "Diario Oficial: Time Zone Changeover" (1996-01-04).
# </a>
# From Rives McDow (1998-10-08):
@@ -2464,9 +2549,7 @@ Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32
###############################################################################
# Anguilla
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Anguilla -4:12:16 - LMT 1912 Mar 2
- -4:00 - AST
+# See 'southamerica'.
# Antigua and Barbuda
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -2476,6 +2559,8 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
# Bahamas
#
+# For 1899 Milne gives -5:09:29.5; round that.
+#
# From Sue Williams (2006-12-07):
# The Bahamas announced about a month ago that they plan to change their DST
# rules to sync with the U.S. starting in 2007....
@@ -2485,11 +2570,14 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Nassau -5:09:24 - LMT 1912 Mar 2
+Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
-5:00 Bahamas E%sT 1976
-5:00 US E%sT
# Barbados
+
+# For 1899 Milne gives -3:58:29.2; round that.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Barb 1977 only - Jun 12 2:00 1:00 D
Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S
@@ -2497,8 +2585,8 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Barbados -3:58:28 - LMT 1924 # Bridgetown
- -3:58:28 - BMT 1932 # Bridgetown Mean Time
+Zone America/Barbados -3:58:29 - LMT 1924 # Bridgetown
+ -3:58:29 - BMT 1932 # Bridgetown Mean Time
-4:00 Barb A%sT
# Belize
@@ -2516,6 +2604,9 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# Bermuda
+# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower,
+# Bermuda dockyard, Ireland I; round that.
+
# From Dan Jones, reporting in The Royal Gazette (2006-06-26):
# Next year, however, clocks in the US will go forward on the second Sunday
@@ -2525,18 +2616,21 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Atlantic/Bermuda -4:19:04 - LMT 1930 Jan 1 2:00 # Hamilton
+Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton
-4:00 - AST 1974 Apr 28 2:00
- -4:00 Bahamas A%sT 1976
+ -4:00 Canada A%sT 1976
-4:00 US A%sT
# Cayman Is
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
- -5:07:12 - KMT 1912 Feb # Kingston Mean Time
+ -5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST
# Costa Rica
+
+# Milne gives -5:36:13.3 as San Jose mean time; round to nearest.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S
@@ -2545,16 +2639,21 @@ Rule CR 1991 1992 - Jan Sat>=15 0:00 1:00 D
# go with Shanks & Pottenger.
Rule CR 1991 only - Jul 1 0:00 0 S
Rule CR 1992 only - Mar 15 0:00 0 S
-# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
+# There are too many San Joses elsewhere, so we'll use 'Costa Rica'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
- -5:36:20 - SJMT 1921 Jan 15 # San Jose Mean Time
+Zone America/Costa_Rica -5:36:13 - LMT 1890 # San Jose
+ -5:36:13 - SJMT 1921 Jan 15 # San Jose Mean Time
-6:00 CR C%sT
# Coco
# no information; probably like America/Costa_Rica
# Cuba
+# From Paul Eggert (2013-02-21):
+# Milne gives -5:28:50.45 for the observatory at Havana, -5:29:23.57
+# for the port, and -5:30 for meteorological observations.
+# For now, stick with Shanks & Pottenger.
+
# From Arthur David Olson (1999-03-29):
# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
# the Cuban National Team and the Baltimore Orioles was carried live on
@@ -2566,6 +2665,11 @@ Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
# to DST--and one more hour on 1999-04-04--when the announcers will have
# returned to Baltimore, which switches on that date.)
+# From Steffen Thorsen (2013-11-11):
+# DST start in Cuba in 2004 ... does not follow the same rules as the
+# years before. The correct date should be Sunday 2004-03-28 00:00 ...
+# https://web.archive.org/web/20040402060750/http://www.granma.cu/espanol/2004/marzo/sab27/reloj.html
+
# From Evert van der Veer via Steffen Thorsen (2004-10-28):
# Cuba is not going back to standard time this year.
# From Paul Eggert (2006-03-22):
@@ -2595,20 +2699,20 @@ Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
# except that it switches at midnight standard time as usual.
#
# From Steffen Thorsen (2007-10-25):
-# Carlos Alberto Fonseca Arauz informed me that Cuba will end DST one week
+# Carlos Alberto Fonseca Arauz informed me that Cuba will end DST one week
# earlier - on the last Sunday of October, just like in 2006.
-#
+#
# He supplied these references:
-#
+#
# http://www.prensalatina.com.mx/article.asp?ID=%7B4CC32C1B-A9F7-42FB-8A07-8631AFC923AF%7D&language=ES
# http://actualidad.terra.es/sociedad/articulo/cuba_llama_ahorrar_energia_cambio_1957044.htm
-#
+#
# From Alex Kryvenishev (2007-10-25):
# Here is also article from Granma (Cuba):
-#
+#
# [Regira] el Horario Normal desde el [proximo] domingo 28 de octubre
# http://www.granma.cubaweb.cu/2007/10/24/nacional/artic07.html
-#
+#
# http://www.worldtimezone.com/dst_news/dst_news_cuba03.html
# From Arthur David Olson (2008-03-09):
@@ -2690,6 +2794,41 @@ Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html">
# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
# </a>
+#
+# From Steffen Thorsen (2011-10-30)
+# Cuba will end DST two weeks later this year. Instead of going back
+# tonight, it has been delayed to 2011-11-13 at 01:00.
+#
+# One source (Spanish)
+# <a href="http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html">
+# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
+# </a>
+#
+# Our page:
+# <a href="http://www.timeanddate.com/news/time/cuba-time-changes-2011.html">
+# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
+# </a>
+#
+# From Steffen Thorsen (2012-03-01)
+# According to Radio Reloj, Cuba will start DST on Midnight between March
+# 31 and April 1.
+#
+# Radio Reloj has the following info (Spanish):
+# <a href="http://www.radioreloj.cu/index.php/noticias-radio-reloj/71-miscelaneas/7529-cuba-aplicara-el-horario-de-verano-desde-el-1-de-abril">
+# http://www.radioreloj.cu/index.php/noticias-radio-reloj/71-miscelaneas/7529-cuba-aplicara-el-horario-de-verano-desde-el-1-de-abril
+# </a>
+#
+# Our info on it:
+# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html">
+# http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
+# </a>
+
+# From Steffen Thorsen (2012-11-03):
+# Radio Reloj and many other sources report that Cuba is changing back
+# to standard time on 2012-11-04:
+# http://www.radioreloj.cu/index.php/noticias-radio-reloj/36-nacionales/9961-regira-horario-normal-en-cuba-desde-el-domingo-cuatro-de-noviembre
+# From Paul Eggert (2012-11-03):
+# For now, assume the future rule is first Sunday in November.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cuba 1928 only - Jun 10 0:00 1:00 D
@@ -2720,13 +2859,17 @@ Rule Cuba 1996 only - Oct 6 0:00s 0 S
Rule Cuba 1997 only - Oct 12 0:00s 0 S
Rule Cuba 1998 1999 - Mar lastSun 0:00s 1:00 D
Rule Cuba 1998 2003 - Oct lastSun 0:00s 0 S
-Rule Cuba 2000 2004 - Apr Sun>=1 0:00s 1:00 D
-Rule Cuba 2006 max - Oct lastSun 0:00s 0 S
+Rule Cuba 2000 2003 - Apr Sun>=1 0:00s 1:00 D
+Rule Cuba 2004 only - Mar lastSun 0:00s 1:00 D
+Rule Cuba 2006 2010 - Oct lastSun 0:00s 0 S
Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D
Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D
Rule Cuba 2009 2010 - Mar Sun>=8 0:00s 1:00 D
Rule Cuba 2011 only - Mar Sun>=15 0:00s 1:00 D
-Rule Cuba 2012 max - Mar Sun>=8 0:00s 1:00 D
+Rule Cuba 2011 only - Nov 13 0:00s 0 S
+Rule Cuba 2012 only - Apr 1 0:00s 1:00 D
+Rule Cuba 2012 max - Nov Sun>=1 0:00s 0 S
+Rule Cuba 2013 max - Mar Sun>=8 0:00s 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Havana -5:29:28 - LMT 1890
@@ -2734,9 +2877,7 @@ Zone America/Havana -5:29:28 - LMT 1890
-5:00 Cuba C%sT
# Dominica
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Dominica -4:05:36 - LMT 1911 Jul 1 0:01 # Roseau
- -4:00 - AST
+# See 'southamerica'.
# Dominican Republic
@@ -2785,18 +2926,10 @@ Zone America/El_Salvador -5:56:48 - LMT 1921 # San Salvador
-6:00 Salv C%sT
# Grenada
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Grenada -4:07:00 - LMT 1911 Jul # St George's
- -4:00 - AST
-
# Guadeloupe
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Guadeloupe -4:06:08 - LMT 1911 Jun 8 # Pointe a Pitre
- -4:00 - AST
# St Barthelemy
-Link America/Guadeloupe America/St_Barthelemy
# St Martin (French part)
-Link America/Guadeloupe America/Marigot
+# See 'southamerica'.
# Guatemala
#
@@ -2860,6 +2993,26 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# From Stephen Colebourne (2007-02-22):
# Some IATA info: Haiti won't be having DST in 2007.
+# From Steffen Thorsen (2012-03-11):
+# According to several news sources, Haiti will observe DST this year,
+# apparently using the same start and end date as USA/Canada.
+# So this means they have already changed their time.
+#
+# http://www.alterpresse.org/spip.php?article12510
+# http://radiovision2000haiti.net/home/?p=13253
+#
+# From Arthur David Olson (2012-03-11):
+# The alterpresse.org source seems to show a US-style leap from 2:00 a.m. to
+# 3:00 a.m. rather than the traditional Haitian jump at midnight.
+# Assume a US-style fall back as well.
+
+# From Steffen Thorsen (2013-03-10):
+# It appears that Haiti is observing DST this year as well, same rules
+# as US/Canada. They did it last year as well, and it looks like they
+# are going to observe DST every year now...
+#
+# http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/
+# http://www.canalplushaiti.net/?p=6714
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Haiti 1983 only - May 8 0:00 1:00 D
@@ -2871,6 +3024,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D
Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S
Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D
Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S
+Rule Haiti 2012 max - Mar Sun>=8 2:00 1:00 D
+Rule Haiti 2012 max - Nov Sun>=1 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Port-au-Prince -4:49:20 - LMT 1890
-4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT
@@ -2917,17 +3072,12 @@ Zone America/Tegucigalpa -5:48:52 - LMT 1921 Apr
# Great Swan I ceded by US to Honduras in 1972
# Jamaica
-
-# From Bob Devine (1988-01-28):
-# Follows US rules.
-
-# From U. S. Naval Observatory (1989-01-19):
-# JAMAICA 5 H BEHIND UTC
-
-# From Shanks & Pottenger:
+# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
+# unspecified official document, and says "This time is used throughout the
+# island". Go with Milne. Round to the nearest second as required by zic.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Jamaica -5:07:12 - LMT 1890 # Kingston
- -5:07:12 - KMT 1912 Feb # Kingston Mean Time
+Zone America/Jamaica -5:07:11 - LMT 1890 # Kingston
+ -5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1974 Apr 28 2:00
-5:00 US E%sT 1984
-5:00 - EST
@@ -2941,12 +3091,7 @@ Zone America/Martinique -4:04:20 - LMT 1890 # Fort-de-France
-4:00 - AST
# Montserrat
-# From Paul Eggert (2006-03-22):
-# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
-# world.gazetteer.com says Cork Hill is the most populous location now.
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Montserrat -4:08:52 - LMT 1911 Jul 1 0:01 # Cork Hill
- -4:00 - AST
+# See 'southamerica'.
# Nicaragua
#
@@ -3020,7 +3165,7 @@ Zone America/Panama -5:18:08 - LMT 1890
-5:00 - EST
# Puerto Rico
-# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
+# There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan
-4:00 - AST 1942 May 3
@@ -3028,18 +3173,11 @@ Zone America/Puerto_Rico -4:24:25 - LMT 1899 Mar 28 12:00 # San Juan
-4:00 - AST
# St Kitts-Nevis
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/St_Kitts -4:10:52 - LMT 1912 Mar 2 # Basseterre
- -4:00 - AST
-
# St Lucia
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/St_Lucia -4:04:00 - LMT 1890 # Castries
- -4:04:00 - CMT 1912 # Castries Mean Time
- -4:00 - AST
+# See 'southamerica'.
# St Pierre and Miquelon
-# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
+# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
-4:00 - AST 1980 May
@@ -3047,10 +3185,7 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
-3:00 Canada PM%sT
# St Vincent and the Grenadines
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/St_Vincent -4:04:56 - LMT 1890 # Kingstown
- -4:04:56 - KMT 1912 # Kingstown Mean Time
- -4:00 - AST
+# See 'southamerica'.
# Turks and Caicos
#
@@ -3080,15 +3215,9 @@ Rule TC 2007 max - Mar Sun>=8 2:00 1:00 D
Rule TC 2007 max - Nov Sun>=1 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
- -5:07:12 - KMT 1912 Feb # Kingston Mean Time
+ -5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 TC E%sT
# British Virgin Is
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Tortola -4:18:28 - LMT 1911 Jul # Road Town
- -4:00 - AST
-
# Virgin Is
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/St_Thomas -4:19:44 - LMT 1911 Jul # Charlotte Amalie
- -4:00 - AST
+# See 'southamerica'.
diff --git a/usr/src/cmd/zic/pacificnew b/usr/src/cmd/zic/pacificnew
index e2512c1d1b..bccd852109 100644
--- a/usr/src/cmd/zic/pacificnew
+++ b/usr/src/cmd/zic/pacificnew
@@ -1,5 +1,4 @@
# <pre>
-# @(#)pacificnew 8.2
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
diff --git a/usr/src/cmd/zic/southamerica b/usr/src/cmd/zic/southamerica
index dc8fd3d447..2d77bf7b53 100644
--- a/usr/src/cmd/zic/southamerica
+++ b/usr/src/cmd/zic/southamerica
@@ -1,17 +1,20 @@
# <pre>
-# @(#)southamerica 8.52
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
+# tz@iana.org for general use in the future).
# From Paul Eggert (2006-03-22):
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM),
@@ -232,7 +235,7 @@ Rule Arg 2000 only - Mar 3 0:00 0 -
Rule Arg 2007 only - Dec 30 0:00 1:00 S
Rule Arg 2008 2009 - Mar Sun>=15 0:00 0 -
Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
-
+
# From Mariano Absatz (2004-05-21):
# Today it was officially published that the Province of Mendoza is changing
# its timezone this winter... starting tomorrow night....
@@ -322,9 +325,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# confirms what Alex Krivenyshev has earlier sent to the tz
# emailing list about that San Luis plans to return to standard
# time much earlier than the rest of the country. It also
-# confirms that upon request the provinces San Juan and Mendoza
-# refused to follow San Luis in this change.
-#
+# confirms that upon request the provinces San Juan and Mendoza
+# refused to follow San Luis in this change.
+#
# The change is supposed to take place Monday the 21.st at 0:00
# hours. As far as I understand it if this goes ahead, we need
# a new timezone for San Luis (although there are also documented
@@ -382,21 +385,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# <a/>
# is the official page for the Province Government).
#
-# There's also a note in only one of the major national papers (La Nación) at
-# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
+# There's also a note in only one of the major national papers ...
# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
-# </a>
-#
-# The press release says:
-# (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
-# atrasar una hora sus relojes.
-#
-# A partir de entonces, San Luis establecerá el huso horario propio de
-# la Provincia. De esta manera, durante el periodo del calendario anual
-# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
-# domingo de marzo y las 24:00 del segundo sábado de octubre.
-# Quick&dirty translation
-# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
+#
+# The press release says [quick and dirty translation]:
+# ... announced that next Sunday, at 00:00, Puntanos (the San Luis
# inhabitants) will have to turn back one hour their clocks
#
# Since then, San Luis will establish its own Province timezone. Thus,
@@ -458,6 +451,20 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# rules...San Luis is still using "Western ARgentina Time" and it got
# stuck on Summer daylight savings time even though the summer is over.
+# From Paul Eggert (2013-09-05):
+# Perhaps San Luis operates on the legal fiction that it is at UTC-4
+# with perpetual summer time, but ordinary usage typically seems to
+# just say it's at UTC-3; see, for example,
+# <http://es.wikipedia.org/wiki/Hora_oficial_argentina>.
+# We've documented similar situations as being plain changes to
+# standard time, so let's do that here too. This does not change UTC
+# offsets, only tm_isdst and the time zone abbreviations. One minor
+# plus is that this silences a zic complaint that there's no POSIX TZ
+# setting for time stamps past 2038.
+
+# From Paul Eggert (2013-02-21):
+# Milne says Cordoba time was -4:16:48.2. Round to the nearest second.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
#
# Buenos Aires (BA), Capital Federal (CF),
@@ -592,7 +599,7 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT 1894 Oct 31
# San Luis (SL)
Rule SanLuis 2008 2009 - Mar Sun>=8 0:00 0 -
-Rule SanLuis 2007 2009 - Oct Sun>=8 0:00 1:00 S
+Rule SanLuis 2007 2008 - Oct Sun>=8 0:00 1:00 S
Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
-4:16:48 - CMT 1920 May
@@ -608,7 +615,8 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT 1894 Oct 31
-3:00 - ART 2004 May 31
-4:00 - WART 2004 Jul 25
-3:00 Arg AR%sT 2008 Jan 21
- -4:00 SanLuis WAR%sT
+ -4:00 SanLuis WAR%sT 2009 Oct 11
+ -3:00 - ART
#
# Santa Cruz (SC)
Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
@@ -635,10 +643,7 @@ Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
-3:00 - ART
# Aruba
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Aruba -4:40:24 - LMT 1912 Feb 12 # Oranjestad
- -4:30 - ANT 1965 # Netherlands Antilles Time
- -4:00 - AST
+Link America/Curacao America/Aruba
# Bolivia
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -800,8 +805,8 @@ Zone America/La_Paz -4:32:36 - LMT 1890
#
# From Alexander Krivenyshev (2011-10-04):
# State Bahia will return to Daylight savings time this year after 8 years off.
-# The announcement was made by Governor Jaques Wagner in an interview to a
-# television station in Salvador.
+# The announcement was made by Governor Jaques Wagner in an interview to a
+# television station in Salvador.
# In Portuguese:
# <a href="http://g1.globo.com/bahia/noticia/2011/10/governador-jaques-wagner-confirma-horario-de-verao-na-bahia.html">
@@ -813,9 +818,9 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Guilherme Bernardes Rodrigues (2011-10-07):
# There is news in the media, however there is still no decree about it.
-# I just send a e-mail to Zulmira Brand�o at
+# I just send a e-mail to Zulmira Brandao at
# <a href="http://pcdsh01.on.br/">http://pcdsh01.on.br/</a> the
-# oficial agency about time in Brazil, and she confirmed that the old rule is
+# official agency about time in Brazil, and she confirmed that the old rule is
# still in force.
# From Guilherme Bernardes Rodrigues (2011-10-14)
@@ -830,6 +835,30 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# http://www.in.gov.br/visualiza/index.jsp?data=13/10/2011&jornal=1000&pagina=6&totalArquivos=6
# </a>
+# From Kelley Cook (2012-10-16):
+# The governor of state of Bahia in Brazil announced on Thursday that
+# due to public pressure, he is reversing the DST policy they implemented
+# last year and will not be going to Summer Time on October 21st....
+# http://www.correio24horas.com.br/r/artigo/apos-pressoes-wagner-suspende-horario-de-verao-na-bahia
+
+# From Rodrigo Severo (2012-10-16):
+# Tocantins state will have DST.
+# http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
+
+# From Steffen Thorsen (2013-09-20):
+# Tocantins in Brazil is very likely not to observe DST from October....
+# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
+# We will keep this article updated when this is confirmed:
+# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
+
+# From Steffen Thorsen (2013-10-17):
+# http://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
+# Senator Jorge Viana announced that Acre will change time zone on November 10.
+# He did not specify the time of the change, nor if western parts of Amazonas
+# will change as well.
+#
+# From Paul Eggert (2013-10-17):
+# For now, assume western Amazonas will change as well.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Decree <a href="http://pcdsh01.on.br/HV20466.htm">20,466</a> (1931-10-01)
@@ -966,7 +995,7 @@ Rule Brazil 2007 only - Feb 25 0:00 0 -
# adopted by the same states as before.
Rule Brazil 2007 only - Oct Sun>=8 0:00 1:00 S
# From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm">
# http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
# </a>
@@ -1049,6 +1078,8 @@ Zone America/Araguaina -3:12:48 - LMT 1914
-3:00 Brazil BR%sT 1990 Sep 17
-3:00 - BRT 1995 Sep 14
-3:00 Brazil BR%sT 2003 Sep 24
+ -3:00 - BRT 2012 Oct 21
+ -3:00 Brazil BR%sT 2013 Sep
-3:00 - BRT
#
# Alagoas (AL), Sergipe (SE)
@@ -1068,7 +1099,8 @@ Zone America/Maceio -2:22:52 - LMT 1914
Zone America/Bahia -2:34:04 - LMT 1914
-3:00 Brazil BR%sT 2003 Sep 24
-3:00 - BRT 2011 Oct 16
- -3:00 Brazil BR%sT
+ -3:00 Brazil BR%sT 2012 Oct 21
+ -3:00 - BRT
#
# Goias (GO), Distrito Federal (DF), Minas Gerais (MG),
# Espirito Santo (ES), Rio de Janeiro (RJ), Sao Paulo (SP), Parana (PR),
@@ -1116,13 +1148,15 @@ Zone America/Eirunepe -4:39:28 - LMT 1914
-5:00 - ACT 1993 Sep 28
-5:00 Brazil AC%sT 1994 Sep 22
-5:00 - ACT 2008 Jun 24 00:00
- -4:00 - AMT
+ -4:00 - AMT 2013 Nov 10
+ -5:00 - ACT
#
# Acre (AC)
Zone America/Rio_Branco -4:31:12 - LMT 1914
-5:00 Brazil AC%sT 1988 Sep 12
-5:00 - ACT 2008 Jun 24 00:00
- -4:00 - AMT
+ -4:00 - AMT 2013 Nov 10
+ -5:00 - ACT
# Chile
@@ -1160,7 +1194,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# Due to drought, Chile extends Daylight Time in three weeks. This
# is one-time change (Saturday 3/29 at 24:00 for America/Santiago
# and Saturday 3/29 at 22:00 for Pacific/Easter)
-# The Supreme Decree is located at
+# The Supreme Decree is located at
# <a href="http://www.shoa.cl/servicios/supremo316.pdf">
# http://www.shoa.cl/servicios/supremo316.pdf
# </a>
@@ -1171,7 +1205,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# From Jose Miguel Garrido (2008-03-05):
# ...
-# You could see the announces of the change on
+# You could see the announces of the change on
# <a href="http://www.shoa.cl/noticias/2008/04hora/hora.htm">
# http://www.shoa.cl/noticias/2008/04hora/hora.htm
# </a>.
@@ -1196,7 +1230,7 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
# </a>
#
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
# probably will be soon:
# <a href="http://www.horaoficial.cl/cambio.htm">
# http://www.horaoficial.cl/cambio.htm
@@ -1218,6 +1252,32 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# August, not in October as they have since 1968. This is a pilot plan
# which will be reevaluated in 2012.
+# From Mauricio Parada (2012-02-22), translated by Glenn Eychaner (2012-02-23):
+# As stated in the website of the Chilean Energy Ministry
+# http://www.minenergia.cl/ministerio/noticias/generales/gobierno-anuncia-fechas-de-cambio-de.html
+# The Chilean Government has decided to postpone the entrance into winter time
+# (to leave DST) from March 11 2012 to April 28th 2012. The decision has not
+# been yet formalized but it will within the next days.
+# Quote from the website communication:
+#
+# 6. For the year 2012, the dates of entry into winter time will be as follows:
+# a. Saturday April 28, 2012, clocks should go back 60 minutes; that is, at
+# 23:59:59, instead of passing to 0:00, the time should be adjusted to be 23:00
+# of the same day.
+# b. Saturday, September 1, 2012, clocks should go forward 60 minutes; that is,
+# at 23:59:59, instead of passing to 0:00, the time should be adjusted to be
+# 01:00 on September 2.
+
+# From Steffen Thorsen (2013-02-15):
+# According to several news sources, Chile has extended DST this year,
+# they will end DST later and start DST earlier than planned. They
+# hope to save energy. The new end date is 2013-04-28 00:00 and new
+# start date is 2013-09-08 00:00....
+# http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm
+
+# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
+# 'antarctica' file.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Chile 1927 1932 - Sep 1 0:00 1:00 S
Rule Chile 1928 1932 - Apr 1 0:00 0 -
@@ -1248,8 +1308,6 @@ Rule Chile 1998 only - Mar Sun>=9 3:00u 0 -
Rule Chile 1998 only - Sep 27 4:00u 1:00 S
Rule Chile 1999 only - Apr 4 3:00u 0 -
Rule Chile 1999 2010 - Oct Sun>=9 4:00u 1:00 S
-Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
-Rule Chile 2012 max - Oct Sun>=9 4:00u 1:00 S
Rule Chile 2000 2007 - Mar Sun>=9 3:00u 0 -
# N.B.: the end of March 29 in Chile is March 30 in Universal time,
# which is used below in specifying the transition.
@@ -1257,7 +1315,9 @@ Rule Chile 2008 only - Mar 30 3:00u 0 -
Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 -
-Rule Chile 2012 max - Mar Sun>=9 3:00u 0 -
+Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
+Rule Chile 2012 max - Apr Sun>=23 3:00u 0 -
+Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1279,17 +1339,23 @@ Zone Pacific/Easter -7:17:44 - LMT 1890
# San Felix, and Antarctic bases, are like America/Santiago.
# Colombia
+
+# Milne gives 4:56:16.4 for Bogota time in 1899; round to nearest. He writes,
+# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CO 1992 only - May 3 0:00 1:00 S
Rule CO 1993 only - Apr 4 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Bogota -4:56:20 - LMT 1884 Mar 13
- -4:56:20 - BMT 1914 Nov 23 # Bogota Mean Time
+Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
+ -4:56:16 - BMT 1914 Nov 23 # Bogota Mean Time
-5:00 CO CO%sT # Colombia Time
# Malpelo, Providencia, San Andres
# no information; probably like America/Bogota
# Curacao
+
+# Milne gives 4:35:46.9 for Curacao mean time; round to nearest.
#
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that The Bottom and Philipsburg have been at
@@ -1306,20 +1372,22 @@ Zone America/Bogota -4:56:20 - LMT 1884 Mar 13
# though, as far as we know.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Curacao -4:35:44 - LMT 1912 Feb 12 # Willemstad
+Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad
-4:30 - ANT 1965 # Netherlands Antilles Time
-4:00 - AST
# From Arthur David Olson (2011-06-15):
-# At least for now, use links for places with new iso3166 codes.
+# use links for places with new iso3166 codes.
# The name "Lower Prince's Quarter" is both longer than fourteen charaters
# and contains an apostrophe; use "Lower_Princes" below.
-Link America/Curacao America/Lower_Princes # Sint Maarten
-Link America/Curacao America/Kralendijk # Bonaire, Sint Estatius and Saba
+Link America/Curacao America/Lower_Princes # Sint Maarten
+Link America/Curacao America/Kralendijk # Caribbean Netherlands
# Ecuador
#
+# Milne says the Sentral and South American Telegraph Company used -5:24:15.
+#
# From Paul Eggert (2007-03-04):
# Apparently Ecuador had a failed experiment with DST in 1992.
# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
@@ -1403,6 +1471,21 @@ Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno
# will not revert to local mean time, but clocks will remain on Summer
# time (UTC/GMT - 3 hours) throughout the whole of 2011. Any long term
# change to local time following the trial period will be notified.
+#
+# From Andrew Newman (2012-02-24)
+# A letter from Justin McPhee, Chief Executive,
+# Cable & Wireless Falkland Islands (dated 2012-02-22)
+# states...
+# The current Atlantic/Stanley entry under South America expects the
+# clocks to go back to standard Falklands Time (FKT) on the 15th April.
+# The database entry states that in 2011 Stanley was staying on fixed
+# summer time on a trial basis only. FIG need to contact IANA and/or
+# the maintainers of the database to inform them we're adopting
+# the same policy this year and suggest recommendations for future years.
+#
+# For now we will assume permanent summer time for the Falklands
+# until advised differently (to apply for 2012 and beyond, after the 2011
+# experiment was apparently successful.)
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Falk 1937 1938 - Sep lastSun 0:00 1:00 S
Rule Falk 1938 1942 - Mar Sun>=19 0:00 0 -
@@ -1415,14 +1498,14 @@ Rule Falk 1984 only - Sep 16 0:00 1:00 S
Rule Falk 1985 2000 - Sep Sun>=9 0:00 1:00 S
Rule Falk 1986 2000 - Apr Sun>=16 0:00 0 -
Rule Falk 2001 2010 - Apr Sun>=15 2:00 0 -
-Rule Falk 2012 max - Apr Sun>=15 2:00 0 -
-Rule Falk 2001 max - Sep Sun>=1 2:00 1:00 S
+Rule Falk 2001 2010 - Sep Sun>=1 2:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Atlantic/Stanley -3:51:24 - LMT 1890
-3:51:24 - SMT 1912 Mar 12 # Stanley Mean Time
-4:00 Falk FK%sT 1983 May # Falkland Is Time
-3:00 Falk FK%sT 1985 Sep 15
- -4:00 Falk FK%sT
+ -4:00 Falk FK%sT 2010 Sep 5 02:00
+ -3:00 - FKST
# French Guiana
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1440,10 +1523,16 @@ Zone America/Guyana -3:52:40 - LMT 1915 Mar # Georgetown
-4:00 - GYT
# Paraguay
+#
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
# and autumn transitions are from 00:00 -> 23:00. Go with pre-1999
# editions of Shanks, and with the IATA, who say transitions occur at 00:00.
+#
+# From Waldemar Villamayor-Venialbo (2013-09-20):
+# No time of the day is established for the adjustment, so people normally
+# adjust their clocks at 0 hour of the given dates.
+#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Para 1975 1988 - Oct 1 0:00 1:00 S
Rule Para 1975 1978 - Mar 1 0:00 0 -
@@ -1510,7 +1599,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 -
# forward 60 minutes, in all the territory of the Paraguayan Republic.
# ...
Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S
-Rule Para 2010 max - Apr Sun>=8 0:00 0 -
+Rule Para 2010 2012 - Apr Sun>=8 0:00 0 -
+#
+# From Steffen Thorsen (2013-03-07):
+# Paraguay will end DST on 2013-03-24 00:00....
+# http://www.ande.gov.py/interna.php?id=1075
+#
+# From Carlos Raul Perasso (2013-03-15):
+# The change in Paraguay is now final. Decree number 10780
+# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf
+Rule Para 2013 max - Mar Sun>=22 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Asuncion -3:50:40 - LMT 1890
@@ -1568,6 +1666,19 @@ Zone America/Paramaribo -3:40:40 - LMT 1911
Zone America/Port_of_Spain -4:06:04 - LMT 1912 Mar 2
-4:00 - AST
+Link America/Port_of_Spain America/Anguilla
+Link America/Port_of_Spain America/Dominica
+Link America/Port_of_Spain America/Grenada
+Link America/Port_of_Spain America/Guadeloupe
+Link America/Port_of_Spain America/Marigot
+Link America/Port_of_Spain America/Montserrat
+Link America/Port_of_Spain America/St_Barthelemy
+Link America/Port_of_Spain America/St_Kitts
+Link America/Port_of_Spain America/St_Lucia
+Link America/Port_of_Spain America/St_Thomas
+Link America/Port_of_Spain America/St_Vincent
+Link America/Port_of_Spain America/Tortola
+
# Uruguay
# From Paul Eggert (1993-11-18):
# Uruguay wins the prize for the strangest peacetime manipulation of the rules.
@@ -1585,7 +1696,7 @@ Rule Uruguay 1937 1941 - Mar lastSun 0:00 0 -
# Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
Rule Uruguay 1937 1940 - Oct lastSun 0:00 0:30 HS
# Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
-# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
+# and 1943 Apr 13 "to present time"; go with Shanks & Pottenger.
Rule Uruguay 1941 only - Aug 1 0:00 0:30 HS
Rule Uruguay 1942 only - Jan 1 0:00 0 -
Rule Uruguay 1942 only - Dec 14 0:00 1:00 S
diff --git a/usr/src/cmd/zic/systemv b/usr/src/cmd/zic/systemv
index 767388d6aa..e651e8540d 100644
--- a/usr/src/cmd/zic/systemv
+++ b/usr/src/cmd/zic/systemv
@@ -1,5 +1,4 @@
# <pre>
-# @(#)systemv 8.2
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
diff --git a/usr/src/cmd/zic/zone.tab.txt b/usr/src/cmd/zic/zone.tab.txt
index 2bdf923077..fa4df5f688 100644
--- a/usr/src/cmd/zic/zone.tab.txt
+++ b/usr/src/cmd/zic/zone.tab.txt
@@ -1,27 +1,36 @@
-# <pre>
-# @(#)zone.tab 8.38
+# TZ zone descriptions
+#
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
-# TZ zone descriptions
+# From Paul Eggert (2013-08-14):
#
-# From Paul Eggert (1996-08-05):
+# This file contains a table where each row stands for an area that is
+# the intersection of a region identified by a country code and of a
+# zone where civil clocks have agreed since 1970. The columns of the
+# table are as follows:
#
-# This file contains a table with the following columns:
-# 1. ISO 3166 2-character country code. See the file `iso3166.tab'.
-# 2. Latitude and longitude of the zone's principal location
+# 1. ISO 3166 2-character country code. See the file 'iso3166.tab'.
+# 2. Latitude and longitude of the area's principal location
# in ISO 6709 sign-degrees-minutes-seconds format,
# either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
# first latitude (+ is north), then longitude (+ is east).
# 3. Zone name used in value of TZ environment variable.
+# Please see the 'Theory' file for how zone names are chosen.
+# If multiple zones overlap a country, each has a row in the
+# table, with column 1 being duplicated.
# 4. Comments; present if and only if the country has multiple rows.
#
# Columns are separated by a single tab.
# The table is sorted first by country, then an order within the country that
# (1) makes some geographical sense, and
-# (2) puts the most populous zones first, where that does not contradict (1).
+# (2) puts the most populous areas first, where that does not contradict (1).
+#
+# Lines beginning with '#' are comments.
#
-# Lines beginning with `#' are comments.
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs. It is not intended
+# to take or endorse any position on legal or territorial claims.
#
#country-
#code coordinates TZ comments
@@ -32,10 +41,8 @@ AG +1703-06148 America/Antigua
AI +1812-06304 America/Anguilla
AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
-AN +1211-06900 America/Curacao
AO -0848+01314 Africa/Luanda
-AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island
-AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole
+AQ -7750+16636 Antarctica/McMurdo McMurdo, South Pole, Scott (New Zealand time)
AQ -6734-06808 Antarctica/Rothera Rothera Station, Adelaide Island
AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
@@ -44,7 +51,6 @@ AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
-AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island
AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN)
@@ -60,6 +66,7 @@ AR -5448-06818 America/Argentina/Ushuaia Tierra del Fuego (TF)
AS -1416-17042 Pacific/Pago_Pago
AT +4813+01620 Europe/Vienna
AU -3133+15905 Australia/Lord_Howe Lord Howe Island
+AU -5430+15857 Antarctica/Macquarie Macquarie Island
AU -4253+14719 Australia/Hobart Tasmania - most locations
AU -3956+14352 Australia/Currie Tasmania - King Island
AU -3749+14458 Australia/Melbourne Victoria
@@ -87,6 +94,7 @@ BL +1753-06251 America/St_Barthelemy
BM +3217-06446 Atlantic/Bermuda
BN +0456+11455 Asia/Brunei
BO -1630-06809 America/La_Paz
+BQ +120903-0681636 America/Kralendijk
BR -0351-03225 America/Noronha Atlantic islands
BR -0127-04829 America/Belem Amapa, E Para
BR -0343-03830 America/Fortaleza NE Brazil (MA, PI, CE, RN, PB)
@@ -114,13 +122,12 @@ CA +4612-05957 America/Glace_Bay Atlantic Time - Nova Scotia - places that did n
CA +4606-06447 America/Moncton Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon Atlantic Standard Time - Quebec - Lower North Shore
-CA +4531-07334 America/Montreal Eastern Time - Quebec - most locations
-CA +4339-07923 America/Toronto Eastern Time - Ontario - most locations
+CA +4339-07923 America/Toronto Eastern Time - Ontario & Quebec - most locations
CA +4901-08816 America/Nipigon Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
CA +4823-08915 America/Thunder_Bay Eastern Time - Thunder Bay, Ontario
CA +6344-06828 America/Iqaluit Eastern Time - east Nunavut - most locations
CA +6608-06544 America/Pangnirtung Eastern Time - Pangnirtung, Nunavut
-CA +744144-0944945 America/Resolute Eastern Standard Time - Resolute, Nunavut
+CA +744144-0944945 America/Resolute Central Standard Time - Resolute, Nunavut
CA +484531-0913718 America/Atikokan Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
CA +624900-0920459 America/Rankin_Inlet Central Time - central Nunavut
CA +4953-09709 America/Winnipeg Central Time - Manitoba & west Ontario
@@ -131,6 +138,7 @@ CA +5333-11328 America/Edmonton Mountain Time - Alberta, east British Columbia &
CA +690650-1050310 America/Cambridge_Bay Mountain Time - west Nunavut
CA +6227-11421 America/Yellowknife Mountain Time - central Northwest Territories
CA +682059-1334300 America/Inuvik Mountain Time - west Northwest Territories
+CA +4906-11631 America/Creston Mountain Standard Time - Creston, British Columbia
CA +5946-12014 America/Dawson_Creek Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
CA +4916-12307 America/Vancouver Pacific Time - west British Columbia
CA +6043-13503 America/Whitehorse Pacific Time - south Yukon
@@ -155,10 +163,12 @@ CO +0436-07405 America/Bogota
CR +0956-08405 America/Costa_Rica
CU +2308-08222 America/Havana
CV +1455-02331 Atlantic/Cape_Verde
+CW +1211-06900 America/Curacao
CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia
CZ +5005+01426 Europe/Prague
-DE +5230+01322 Europe/Berlin
+DE +5230+01322 Europe/Berlin most locations
+DE +4742+00841 Europe/Busingen Busingen
DJ +1136+04309 Africa/Djibouti
DK +5540+01235 Europe/Copenhagen
DM +1518-06124 America/Dominica
@@ -211,10 +221,10 @@ HT +1832-07220 America/Port-au-Prince
HU +4730+01905 Europe/Budapest
ID -0610+10648 Asia/Jakarta Java & Sumatra
ID -0002+10920 Asia/Pontianak west & central Borneo
-ID -0507+11924 Asia/Makassar east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
-ID -0232+14042 Asia/Jayapura Irian Jaya & the Moluccas
+ID -0507+11924 Asia/Makassar east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
+ID -0232+14042 Asia/Jayapura west New Guinea (Irian Jaya) & Malukus (Moluccas)
IE +5320-00615 Europe/Dublin
-IL +3146+03514 Asia/Jerusalem
+IL +314650+0351326 Asia/Jerusalem
IM +5409-00428 Europe/Isle_of_Man
IN +2232+08822 Asia/Kolkata
IO -0720+07225 Indian/Chagos
@@ -223,7 +233,7 @@ IR +3540+05126 Asia/Tehran
IS +6409-02151 Atlantic/Reykjavik
IT +4154+01229 Europe/Rome
JE +4912-00207 Europe/Jersey
-JM +1800-07648 America/Jamaica
+JM +175805-0764736 America/Jamaica
JO +3157+03556 Asia/Amman
JP +353916+1394441 Asia/Tokyo
KE -0117+03649 Africa/Nairobi
@@ -318,7 +328,8 @@ PL +5215+02100 Europe/Warsaw
PM +4703-05620 America/Miquelon
PN -2504-13005 Pacific/Pitcairn
PR +182806-0660622 America/Puerto_Rico
-PS +3130+03428 Asia/Gaza
+PS +3130+03428 Asia/Gaza Gaza Strip
+PS +313200+0350542 Asia/Hebron West Bank
PT +3843-00908 Europe/Lisbon mainland
PT +3238-01654 Atlantic/Madeira Madeira Islands
PT +3744-02540 Atlantic/Azores Azores
@@ -331,7 +342,7 @@ RS +4450+02030 Europe/Belgrade
RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad
RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
-RU +5312+05009 Europe/Samara Moscow - Samara, Udmurtia
+RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals
RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk
@@ -339,8 +350,10 @@ RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
+RU +623923+1353314 Asia/Khandyga Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
+RU +643337+1431336 Asia/Ust-Nera Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka Moscow+08 - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 - Bering Sea
@@ -360,8 +373,10 @@ SM +4355+01228 Europe/San_Marino
SN +1440-01726 Africa/Dakar
SO +0204+04522 Africa/Mogadishu
SR +0550-05510 America/Paramaribo
+SS +0451+03136 Africa/Juba
ST +0020+00644 Africa/Sao_Tome
SV +1342-08912 America/El_Salvador
+SX +180305-0630250 America/Lower_Princes
SY +3330+03618 Asia/Damascus
SZ -2618+03106 Africa/Mbabane
TC +2128-07108 America/Grand_Turk
@@ -404,16 +419,18 @@ US +411745-0863730 America/Indiana/Knox Central Time - Indiana - Starke County
US +450628-0873651 America/Menominee Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
US +470659-1011757 America/North_Dakota/Center Central Time - North Dakota - Oliver County
US +465042-1012439 America/North_Dakota/New_Salem Central Time - North Dakota - Morton County (except Mandan area)
+US +471551-1014640 America/North_Dakota/Beulah Central Time - North Dakota - Mercer County
US +394421-1045903 America/Denver Mountain Time
US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon
-US +364708-1084111 America/Shiprock Mountain Time - Navajo
-US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona
+US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo)
US +340308-1181434 America/Los_Angeles Pacific Time
US +611305-1495401 America/Anchorage Alaska Time
US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
+US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle
US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
US +643004-1652423 America/Nome Alaska Time - west Alaska
US +515248-1763929 America/Adak Aleutian Islands
+US +550737-1313435 America/Metlakatla Metlakatla Time - Annette Island
US +211825-1575130 Pacific/Honolulu Hawaii
UY -3453-05611 America/Montevideo
UZ +3940+06648 Asia/Samarkand west Uzbekistan
diff --git a/usr/src/cmd/zic/zone_sun.tab b/usr/src/cmd/zic/zone_sun.tab
index 4e22a6f5ff..c25743e69d 100644
--- a/usr/src/cmd/zic/zone_sun.tab
+++ b/usr/src/cmd/zic/zone_sun.tab
@@ -1,5 +1,5 @@
# <pre>
-# @(#)zone.tab 8.50
+# @(#)zone.tab 8.55
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
@@ -33,8 +33,7 @@ AI +1812-06304 America/Anguilla -
AL +4120+01950 Europe/Tirane -
AM +4011+04430 Asia/Yerevan -
AO -0848+01314 Africa/Luanda -
-AQ -7750+16636 Antarctica/McMurdo - McMurdo Station, Ross Island
-AQ -9000+00000 Antarctica/South_Pole - Amundsen-Scott Station, South Pole
+AQ -7750+16636 Antarctica/McMurdo - McMurdo, South Pole, Scott (New Zealand time)
AQ -6734-06808 Antarctica/Rothera - Rothera Station, Adelaide Island
AQ -6448-06406 Antarctica/Palmer - Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson - Mawson Station, Holme Bay
@@ -43,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey - Casey Station, Bailey Peninsula
AQ -7824+10654 Antarctica/Vostok - Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville - Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa - Syowa Station, E Ongul I
-AQ -5430+15857 Antarctica/Macquarie - Macquarie Island Station, Macquarie Island
AR -3436-05827 America/Argentina/Buenos_Aires America/Buenos_Aires Buenos Aires (BA, CF)
AR -3124-06411 America/Argentina/Cordoba America/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF)
AR -2447-06525 America/Argentina/Salta - (SA, LP, NQ, RN)
@@ -59,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia - Tierra del Fuego (TF)
AS -1416-17042 Pacific/Pago_Pago US/Samoa
AT +4813+01620 Europe/Vienna -
AU -3133+15905 Australia/Lord_Howe Australia/LHI Lord Howe Island
+AU -5430+15857 Antarctica/Macquarie - Macquarie Island
AU -4253+14719 Australia/Hobart Australia/Tasmania Tasmania - most locations
AU -3956+14352 Australia/Currie - Tasmania - King Island
AU -3749+14458 Australia/Melbourne Australia/Victoria Victoria
@@ -114,7 +113,6 @@ CA +4612-05957 America/Glace_Bay - Atlantic Time - Nova Scotia - places that did
CA +4606-06447 America/Moncton - Atlantic Time - New Brunswick
CA +5320-06025 America/Goose_Bay - Atlantic Time - Labrador - most locations
CA +5125-05707 America/Blanc-Sablon - Atlantic Standard Time - Quebec - Lower North Shore
-CA +4531-07334 America/Montreal - Eastern Time - Quebec - most locations
CA +4339-07923 America/Toronto Canada/Eastern Eastern Time - Ontario - most locations
CA +4901-08816 America/Nipigon - Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
CA +4823-08915 America/Thunder_Bay - Eastern Time - Thunder Bay, Ontario
@@ -131,6 +129,7 @@ CA +5333-11328 America/Edmonton Canada/Mountain Mountain Time - Alberta, east Br
CA +690650-1050310 America/Cambridge_Bay - Mountain Time - west Nunavut
CA +6227-11421 America/Yellowknife - Mountain Time - central Northwest Territories
CA +682059-1334300 America/Inuvik - Mountain Time - west Northwest Territories
+CA +4906-11631 America/Creston - Mountain Standard Time - Creston, British Columbia
CA +5946-12014 America/Dawson_Creek - Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
CA +4916-12307 America/Vancouver Canada/Pacific Pacific Time - west British Columbia
CA +6043-13503 America/Whitehorse Canada/Yukon Pacific Time - south Yukon
@@ -160,6 +159,7 @@ CX -1025+10543 Indian/Christmas -
CY +3510+03322 Asia/Nicosia -
CZ +5005+01426 Europe/Prague -
DE +5230+01322 Europe/Berlin -
+DE +4742+00841 Europe/Busingen Busingen
DJ +1136+04309 Africa/Djibouti -
DK +5540+01235 Europe/Copenhagen -
DM +1518-06124 America/Dominica -
@@ -215,7 +215,7 @@ ID -0002+10920 Asia/Pontianak - west & central Borneo
ID -0507+11924 Asia/Makassar - east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
ID -0232+14042 Asia/Jayapura - west New Guinea (Irian Jaya) & Malukus (Moluccas)
IE +5320-00615 Europe/Dublin Eire
-IL +3146+03514 Asia/Jerusalem Israel
+IL +314650+0351326 Asia/Jerusalem Israel
IM +5409-00428 Europe/Isle_of_Man -
IN +2232+08822 Asia/Kolkata -
IO -0720+07225 Indian/Chagos -
@@ -224,7 +224,7 @@ IR +3540+05126 Asia/Tehran Iran
IS +6409-02151 Atlantic/Reykjavik Iceland
IT +4154+01229 Europe/Rome -
JE +4912-00207 Europe/Jersey -
-JM +1800-07648 America/Jamaica -
+JM +175805-0764736 America/Jamaica -
JO +3157+03556 Asia/Amman -
JP +353916+1394441 Asia/Tokyo Japan
KE -0117+03649 Africa/Nairobi -
@@ -258,7 +258,6 @@ LY +3254+01311 Africa/Tripoli Libya
MA +3339-00735 Africa/Casablanca -
MC +4342+00723 Europe/Monaco -
MD +4700+02850 Europe/Chisinau -
-MD +4651+02938 Europe/Tiraspol - Pridnestrovie
ME +4226+01916 Europe/Podgorica -
MF +1804-06305 America/Marigot -
MG -1855+04731 Indian/Antananarivo -
@@ -334,7 +333,7 @@ RS +4450+02030 Europe/Belgrade -
RU +5443+02030 Europe/Kaliningrad - Moscow-01 - Kaliningrad
RU +5545+03735 Europe/Moscow - Moscow+00 - west Russia
RU +4844+04425 Europe/Volgograd - Moscow+00 - Caspian Sea
-RU +5312+05009 Europe/Samara - Moscow - Samara, Udmurtia
+RU +5312+05009 Europe/Samara - Moscow+00 - Samara, Udmurtia
RU +5651+06036 Asia/Yekaterinburg - Moscow+02 - Urals
RU +5500+07324 Asia/Omsk - Moscow+03 - west Siberia
RU +5502+08255 Asia/Novosibirsk - Moscow+03 - Novosibirsk
@@ -342,8 +341,10 @@ RU +5345+08707 Asia/Novokuznetsk - Moscow+03 - Novokuznetsk
RU +5601+09250 Asia/Krasnoyarsk - Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk - Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk - Moscow+06 - Lena River
+RU +623923+1353314 Asia/Khandyga - Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok - Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin - Moscow+07 - Sakhalin Island
+RU +643337+1431336 Asia/Ust-Nera - Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan - Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka - Moscow+08 - Kamchatka
RU +6445+17729 Asia/Anadyr - Moscow+08 - Bering Sea
@@ -412,7 +413,6 @@ US +465042-1012439 America/North_Dakota/New_Salem - Central Time - North Dakota
US +471551-1014640 America/North_Dakota/Beulah - Central Time - North Dakota - Mercer County
US +394421-1045903 America/Denver US/Mountain Mountain Time
US +433649-1161209 America/Boise - Mountain Time - south Idaho & east Oregon
-US +364708-1084111 America/Shiprock - Mountain Time - Navajo
US +332654-1120424 America/Phoenix US/Arizona Mountain Standard Time - Arizona
US +340308-1181434 America/Los_Angeles US/Pacific Pacific Time
US +611305-1495401 America/Anchorage US/Alaska Alaska Time
diff --git a/usr/src/cmd/zoneadm/Makefile b/usr/src/cmd/zoneadm/Makefile
index 2b01078aec..fba7809c71 100644
--- a/usr/src/cmd/zoneadm/Makefile
+++ b/usr/src/cmd/zoneadm/Makefile
@@ -21,14 +21,18 @@
#
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
#
PROG= zoneadm
+SCRIPTS=
MANIFEST= zones.xml resource-mgmt.xml
SVCMETHOD= svc-zones svc-resource-mgmt
include ../Makefile.cmd
+include ../Makefile.ctf
+ROOTUSRSBINSCRIPTS= $(SCRIPTS:%=$(ROOTUSRSBIN)/%)
ROOTMANIFESTDIR= $(ROOTSVCSYSTEM)
OBJS= zoneadm.o zfs.o
@@ -42,13 +46,14 @@ CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
-all: $(PROG)
+all: $(PROG) $(SCRIPTS)
$(PROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
-install: all $(ROOTUSRSBINPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
+install: all $(ROOTUSRSBINPROG) $(ROOTUSRSBINSCRIPTS) $(ROOTMANIFEST) \
+ $(ROOTSVCMETHOD)
check: $(PROG).c $(CHKMANIFEST)
$(CSTYLE) -pP $(SRCS:%=%)
@@ -58,7 +63,7 @@ $(POFILE): $(POFILES)
$(CAT) $(POFILES) > $@
clean:
- $(RM) $(OBJS) $(POFILES)
+ $(RM) $(OBJS) $(POFILES) $(SCRIPTS)
lint: lint_SRCS
diff --git a/usr/src/cmd/zoneadm/zfs.c b/usr/src/cmd/zoneadm/zfs.c
index d27b9c4678..78c165ffd1 100644
--- a/usr/src/cmd/zoneadm/zfs.c
+++ b/usr/src/cmd/zoneadm/zfs.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -968,6 +968,7 @@ create_zfs_zonepath(char *zonepath)
zfs_handle_t *zhp;
char zfs_name[MAXPATHLEN];
nvlist_t *props = NULL;
+ int i;
if (path2name(zonepath, zfs_name, sizeof (zfs_name)) != Z_OK)
return;
@@ -1004,9 +1005,20 @@ create_zfs_zonepath(char *zonepath)
nvlist_free(props);
- if (zfs_mount(zhp, NULL, 0) != 0) {
+ /*
+ * A monitoring tool might race with us and touch the mountpoint just
+ * as we're trying to mount, blocking the mount. We wait and retry a
+ * few times to workaround this race.
+ */
+ for (i = 0; i < 5; i++) {
+ if (zfs_mount(zhp, NULL, 0) == 0)
+ break;
(void) fprintf(stderr, gettext("cannot mount ZFS dataset %s: "
"%s\n"), zfs_name, libzfs_error_description(g_zfs));
+ (void) sleep(1);
+ }
+
+ if (i >= 5) {
(void) zfs_destroy(zhp, B_FALSE);
} else {
if (chmod(zonepath, S_IRWXU) != 0) {
diff --git a/usr/src/cmd/zoneadm/zoneadm.c b/usr/src/cmd/zoneadm/zoneadm.c
index d0305b48a8..81cd59ad70 100644
--- a/usr/src/cmd/zoneadm/zoneadm.c
+++ b/usr/src/cmd/zoneadm/zoneadm.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent Inc. All rights reserved.
*/
/*
@@ -99,6 +100,7 @@ typedef struct zone_entry {
char zroot[MAXPATHLEN];
char zuuid[UUID_PRINTABLE_STRING_LENGTH];
zone_iptype_t ziptype;
+ zoneid_t zdid;
} zone_entry_t;
#define CLUSTER_BRAND_NAME "cluster"
@@ -434,6 +436,7 @@ zone_print(zone_entry_t *zent, boolean_t verbose, boolean_t parsable)
}
if (!verbose) {
char *cp, *clim;
+ char zdid[80];
if (!parsable) {
(void) printf("%s\n", zent->zname);
@@ -449,8 +452,12 @@ zone_print(zone_entry_t *zent, boolean_t verbose, boolean_t parsable)
(void) printf("%.*s\\:", clim - cp, cp);
cp = clim + 1;
}
- (void) printf("%s:%s:%s:%s\n", cp, zent->zuuid, zent->zbrand,
- ip_type_str);
+ if (zent->zdid == -1)
+ zdid[0] = '\0';
+ else
+ (void) snprintf(zdid, sizeof (zdid), "%d", zent->zdid);
+ (void) printf("%s:%s:%s:%s:%s\n", cp, zent->zuuid, zent->zbrand,
+ ip_type_str, zdid);
return;
}
if (zent->zstate_str != NULL) {
@@ -545,6 +552,22 @@ lookup_zone_info(const char *zone_name, zoneid_t zid, zone_entry_t *zent)
return (Z_OK);
}
+ if ((handle = zonecfg_init_handle()) == NULL) {
+ zperror2(zent->zname, gettext("could not init handle"));
+ return (Z_ERR);
+ }
+ if ((err = zonecfg_get_handle(zent->zname, handle)) != Z_OK) {
+ zperror2(zent->zname, gettext("could not get handle"));
+ zonecfg_fini_handle(handle);
+ return (Z_ERR);
+ }
+
+ if ((err = zonecfg_get_iptype(handle, &zent->ziptype)) != Z_OK) {
+ zperror2(zent->zname, gettext("could not get ip-type"));
+ zonecfg_fini_handle(handle);
+ return (Z_ERR);
+ }
+
/*
* There is a race condition where the zone could boot while
* we're walking the index file. In this case the zone state
@@ -565,25 +588,11 @@ lookup_zone_info(const char *zone_name, zoneid_t zid, zone_entry_t *zent)
zent->ziptype = ZS_EXCLUSIVE;
else
zent->ziptype = ZS_SHARED;
- return (Z_OK);
}
}
- if ((handle = zonecfg_init_handle()) == NULL) {
- zperror2(zent->zname, gettext("could not init handle"));
- return (Z_ERR);
- }
- if ((err = zonecfg_get_handle(zent->zname, handle)) != Z_OK) {
- zperror2(zent->zname, gettext("could not get handle"));
- zonecfg_fini_handle(handle);
- return (Z_ERR);
- }
+ zent->zdid = zonecfg_get_did(handle);
- if ((err = zonecfg_get_iptype(handle, &zent->ziptype)) != Z_OK) {
- zperror2(zent->zname, gettext("could not get ip-type"));
- zonecfg_fini_handle(handle);
- return (Z_ERR);
- }
zonecfg_fini_handle(handle);
return (Z_OK);
@@ -1004,8 +1013,12 @@ validate_zonepath(char *path, int cmd_num)
(void) printf(gettext("WARNING: %s is on a temporary "
"file system.\n"), rpath);
}
- if (crosscheck_zonepaths(rpath) != Z_OK)
- return (Z_ERR);
+ if (cmd_num != CMD_BOOT && cmd_num != CMD_REBOOT &&
+ cmd_num != CMD_READY) {
+ /* we checked when we installed, no need to check each boot */
+ if (crosscheck_zonepaths(rpath) != Z_OK)
+ return (Z_ERR);
+ }
/*
* Try to collect and report as many minor errors as possible
* before returning, so the user can learn everything that needs
@@ -1169,6 +1182,7 @@ static int
ready_func(int argc, char *argv[])
{
zone_cmd_arg_t zarg;
+ boolean_t debug = B_FALSE;
int arg;
if (zonecfg_in_alt_root()) {
@@ -1177,11 +1191,14 @@ ready_func(int argc, char *argv[])
}
optind = 0;
- if ((arg = getopt(argc, argv, "?")) != EOF) {
+ if ((arg = getopt(argc, argv, "?X")) != EOF) {
switch (arg) {
case '?':
sub_usage(SHELP_READY, CMD_READY);
return (optopt == '?' ? Z_OK : Z_USAGE);
+ case 'X':
+ debug = B_TRUE;
+ break;
default:
sub_usage(SHELP_READY, CMD_READY);
return (Z_USAGE);
@@ -1198,6 +1215,7 @@ ready_func(int argc, char *argv[])
return (Z_ERR);
zarg.cmd = Z_READY;
+ zarg.debug = debug;
if (zonecfg_call_zoneadmd(target_zone, &zarg, locale, B_TRUE) != 0) {
zerror(gettext("call to %s failed"), "zoneadmd");
return (Z_ERR);
@@ -1210,6 +1228,7 @@ boot_func(int argc, char *argv[])
{
zone_cmd_arg_t zarg;
boolean_t force = B_FALSE;
+ boolean_t debug = B_FALSE;
int arg;
if (zonecfg_in_alt_root()) {
@@ -1236,7 +1255,7 @@ boot_func(int argc, char *argv[])
* zoneadm -z myzone boot -- -s -v -m verbose.
*/
optind = 0;
- while ((arg = getopt(argc, argv, "?fs")) != EOF) {
+ while ((arg = getopt(argc, argv, "?fsX")) != EOF) {
switch (arg) {
case '?':
sub_usage(SHELP_BOOT, CMD_BOOT);
@@ -1248,6 +1267,9 @@ boot_func(int argc, char *argv[])
case 'f':
force = B_TRUE;
break;
+ case 'X':
+ debug = B_TRUE;
+ break;
default:
sub_usage(SHELP_BOOT, CMD_BOOT);
return (Z_USAGE);
@@ -1273,6 +1295,7 @@ boot_func(int argc, char *argv[])
if (verify_details(CMD_BOOT, argv) != Z_OK)
return (Z_ERR);
zarg.cmd = force ? Z_FORCEBOOT : Z_BOOT;
+ zarg.debug = debug;
if (zonecfg_call_zoneadmd(target_zone, &zarg, locale, B_TRUE) != 0) {
zerror(gettext("call to %s failed"), "zoneadmd");
return (Z_ERR);
@@ -1783,6 +1806,7 @@ static int
halt_func(int argc, char *argv[])
{
zone_cmd_arg_t zarg;
+ boolean_t debug = B_FALSE;
int arg;
if (zonecfg_in_alt_root()) {
@@ -1791,11 +1815,14 @@ halt_func(int argc, char *argv[])
}
optind = 0;
- if ((arg = getopt(argc, argv, "?")) != EOF) {
+ if ((arg = getopt(argc, argv, "?X")) != EOF) {
switch (arg) {
case '?':
sub_usage(SHELP_HALT, CMD_HALT);
return (optopt == '?' ? Z_OK : Z_USAGE);
+ case 'X':
+ debug = B_TRUE;
+ break;
default:
sub_usage(SHELP_HALT, CMD_HALT);
return (Z_USAGE);
@@ -1821,6 +1848,7 @@ halt_func(int argc, char *argv[])
return (Z_ERR);
zarg.cmd = Z_HALT;
+ zarg.debug = debug;
return ((zonecfg_call_zoneadmd(target_zone, &zarg, locale,
B_TRUE) == 0) ? Z_OK : Z_ERR);
}
@@ -1829,6 +1857,7 @@ static int
reboot_func(int argc, char *argv[])
{
zone_cmd_arg_t zarg;
+ boolean_t debug = B_FALSE;
int arg;
if (zonecfg_in_alt_root()) {
@@ -1837,11 +1866,14 @@ reboot_func(int argc, char *argv[])
}
optind = 0;
- if ((arg = getopt(argc, argv, "?")) != EOF) {
+ if ((arg = getopt(argc, argv, "?X")) != EOF) {
switch (arg) {
case '?':
sub_usage(SHELP_REBOOT, CMD_REBOOT);
return (optopt == '?' ? Z_OK : Z_USAGE);
+ case 'X':
+ debug = B_TRUE;
+ break;
default:
sub_usage(SHELP_REBOOT, CMD_REBOOT);
return (Z_USAGE);
@@ -1876,6 +1908,7 @@ reboot_func(int argc, char *argv[])
return (Z_ERR);
zarg.cmd = Z_REBOOT;
+ zarg.debug = debug;
return ((zonecfg_call_zoneadmd(target_zone, &zarg, locale, B_TRUE) == 0)
? Z_OK : Z_ERR);
}
@@ -2103,6 +2136,10 @@ verify_fs_special(struct zone_fstab *fstab)
if (strcmp(fstab->zone_fs_type, MNTTYPE_ZFS) == 0)
return (verify_fs_zfs(fstab));
+ if (strcmp(fstab->zone_fs_type, MNTTYPE_HYPRLOFS) == 0 &&
+ strcmp(fstab->zone_fs_special, "swap") == 0)
+ return (Z_OK);
+
if (stat64(fstab->zone_fs_special, &st) != 0) {
(void) fprintf(stderr, gettext("could not verify fs "
"%s: could not access %s: %s\n"), fstab->zone_fs_dir,
@@ -2506,7 +2543,6 @@ verify_handle(int cmd_num, zone_dochandle_t handle, char *argv[])
dladm_handle_t dh;
dladm_status_t status;
datalink_id_t linkid;
- char errmsg[DLADM_STRSIZE];
in_alt_root = zonecfg_in_alt_root();
if (in_alt_root)
@@ -2589,11 +2625,6 @@ verify_handle(int cmd_num, zone_dochandle_t handle, char *argv[])
dladm_close(dh);
}
if (status != DLADM_STATUS_OK) {
- (void) fprintf(stderr,
- gettext("WARNING: skipping network "
- "interface '%s': %s\n"),
- nwiftab.zone_nwif_physical,
- dladm_status2str(status, errmsg));
break;
}
dl_owner_zid = ALL_ZONES;
@@ -2677,6 +2708,61 @@ no_net:
return (return_code);
}
+/*
+ * Called when readying or booting a zone. We double check that the zone's
+ * debug ID is set and is unique. This covers the case of pre-existing zones
+ * with no ID. Also, its possible that a zone was migrated to this host
+ * and as a result it has a duplicate ID. In this case we preserve the ID
+ * of the first zone we match on in the index file (since it was there before
+ * the current zone) and we assign a new unique ID to the current zone.
+ * Return true if we assigned a new ID, indicating that the zone configuration
+ * needs to be saved.
+ */
+static boolean_t
+verify_fix_did(zone_dochandle_t handle)
+{
+ zoneid_t mydid;
+ zone_entry_t zent;
+ FILE *cookie;
+ char *name;
+ boolean_t fix = B_FALSE;
+
+ mydid = zonecfg_get_did(handle);
+ if (mydid == -1) {
+ zonecfg_set_did(handle);
+ return (B_TRUE);
+ }
+
+ /* Get the full list of zones from the configuration. */
+ cookie = setzoneent();
+ while ((name = getzoneent(cookie)) != NULL) {
+ if (strcmp(target_zone, name) == 0) {
+ free(name);
+ break; /* Once we find our entry, stop. */
+ }
+
+ if (strcmp(name, "global") == 0 ||
+ lookup_zone_info(name, ZONE_ID_UNDEFINED, &zent) != Z_OK) {
+ free(name);
+ continue;
+ }
+
+ free(name);
+ if (zent.zdid == mydid) {
+ fix = B_TRUE;
+ break;
+ }
+ }
+ endzoneent(cookie);
+
+ if (fix) {
+ zonecfg_set_did(handle);
+ return (B_TRUE);
+ }
+
+ return (B_FALSE);
+}
+
static int
verify_details(int cmd_num, char *argv[])
{
@@ -2736,6 +2822,18 @@ verify_details(int cmd_num, char *argv[])
if (verify_handle(cmd_num, handle, argv) != Z_OK)
return_code = Z_ERR;
+ if (cmd_num == CMD_READY || cmd_num == CMD_BOOT) {
+ int vcommit = 0, obscommit = 0;
+
+ vcommit = verify_fix_did(handle);
+ obscommit = zonecfg_fix_obsolete(handle);
+
+ if (vcommit || obscommit)
+ if (zonecfg_save(handle) != Z_OK)
+ (void) fprintf(stderr, gettext("Could not save "
+ "updated configuration.\n"));
+ }
+
zonecfg_fini_handle(handle);
if (return_code == Z_ERR)
(void) fprintf(stderr,
@@ -2821,6 +2919,7 @@ install_func(int argc, char *argv[])
int status;
boolean_t do_postinstall = B_FALSE;
boolean_t brand_help = B_FALSE;
+ boolean_t do_dataset = B_TRUE;
char opts[128];
if (target_zone == NULL) {
@@ -2896,6 +2995,12 @@ install_func(int argc, char *argv[])
}
/* Ignore unknown options - may be brand specific. */
break;
+ case 'x':
+ if (strcmp(optarg, "nodataset") == 0) {
+ do_dataset = B_FALSE;
+ continue; /* internal arg, don't pass thru */
+ }
+ break;
default:
/* Ignore unknown options - may be brand specific. */
break;
@@ -2948,7 +3053,8 @@ install_func(int argc, char *argv[])
goto done;
}
- create_zfs_zonepath(zonepath);
+ if (do_dataset)
+ create_zfs_zonepath(zonepath);
}
status = do_subproc(cmdbuf);
@@ -4911,6 +5017,7 @@ uninstall_func(int argc, char *argv[])
if (zonecfg_ping_zoneadmd(target_zone) == Z_OK) {
zone_cmd_arg_t zarg;
zarg.cmd = Z_NOTE_UNINSTALLING;
+ zarg.debug = B_FALSE;
/* we don't care too much if this fails, just plow on */
(void) zonecfg_call_zoneadmd(target_zone, &zarg, locale,
B_TRUE);
@@ -5026,6 +5133,7 @@ mount_func(int argc, char *argv[])
return (Z_ERR);
zarg.cmd = force ? Z_FORCEMOUNT : Z_MOUNT;
+ zarg.debug = B_FALSE;
zarg.bootbuf[0] = '\0';
if (zonecfg_call_zoneadmd(target_zone, &zarg, locale, B_TRUE) != 0) {
zerror(gettext("call to %s failed"), "zoneadmd");
@@ -5047,6 +5155,7 @@ unmount_func(int argc, char *argv[])
return (Z_ERR);
zarg.cmd = Z_UNMOUNT;
+ zarg.debug = B_FALSE;
if (zonecfg_call_zoneadmd(target_zone, &zarg, locale, B_TRUE) != 0) {
zerror(gettext("call to %s failed"), "zoneadmd");
return (Z_ERR);
@@ -5268,7 +5377,7 @@ apply_func(int argc, char *argv[])
priv_set_t *privset;
zoneid_t zoneid;
zone_dochandle_t handle;
- struct zone_mcaptab mcap;
+ uint64_t mcap;
char pool_err[128];
zoneid = getzoneid();
@@ -5359,19 +5468,12 @@ apply_func(int argc, char *argv[])
}
/*
- * If a memory cap is configured, set the cap in the kernel using
- * zone_setattr() and make sure the rcapd SMF service is enabled.
+ * If a memory cap is configured, make sure the rcapd SMF service is
+ * enabled.
*/
- if (zonecfg_getmcapent(handle, &mcap) == Z_OK) {
- uint64_t num;
+ if (zonecfg_get_aliased_rctl(handle, ALIAS_MAXPHYSMEM, &mcap) == Z_OK) {
char smf_err[128];
- num = (uint64_t)strtoll(mcap.zone_physmem_cap, NULL, 10);
- if (zone_setattr(zoneid, ZONE_ATTR_PHYS_MCAP, &num, 0) == -1) {
- zerror(gettext("could not set zone memory cap"));
- res = Z_ERR;
- }
-
if (zonecfg_enable_rcapd(smf_err, sizeof (smf_err)) != Z_OK) {
zerror(gettext("enabling system/rcap service failed: "
"%s"), smf_err);
diff --git a/usr/src/cmd/zoneadm/zones.xml b/usr/src/cmd/zoneadm/zones.xml
index e14424ac26..33ba71cd3e 100644
--- a/usr/src/cmd/zoneadm/zones.xml
+++ b/usr/src/cmd/zoneadm/zones.xml
@@ -23,8 +23,6 @@
CDDL HEADER END
- ident "%Z%%M% %I% %E% SMI"
-
NOTE: This service manifest is not editable; its contents will
be overwritten by package or patch operations, including
operating system upgrade. Make customizations in a different
@@ -54,11 +52,19 @@
<service_fmri value='svc:/milestone/multi-user-server' />
</dependency>
+ <dependency
+ name='metadata'
+ type='service'
+ grouping='require_all'
+ restart_on='none'>
+ <service_fmri value='svc:/system/smartdc/metadata' />
+ </dependency>
+
<exec_method
type='method'
name='start'
exec='/lib/svc/method/svc-zones %m'
- timeout_seconds='60'>
+ timeout_seconds='0'>
</exec_method>
<!--
diff --git a/usr/src/cmd/zoneadmd/Makefile b/usr/src/cmd/zoneadmd/Makefile
index 078d6c7b39..c3f6395905 100644
--- a/usr/src/cmd/zoneadmd/Makefile
+++ b/usr/src/cmd/zoneadmd/Makefile
@@ -18,56 +18,53 @@
#
# CDDL HEADER END
-
-#
-
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
#
PROG= zoneadmd
include ../Makefile.cmd
+include ../Makefile.ctf
-ROOTCMDDIR= $(ROOTLIB)/zones
-
-OBJS= zoneadmd.o zcons.o vplat.o
-SRCS = $(OBJS:.o=.c)
-POFILE=zoneadmd_all.po
-POFILES= $(OBJS:%.o=%.po)
+$(64ONLY)SUBDIRS= $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
-CFLAGS += $(CCVERBOSE)
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-uninitialized
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
+lint := TARGET = lint
-LDLIBS += -lsocket -lzonecfg -lnsl -ldevinfo -ldevice -lnvpair \
- -lgen -lbsm -lcontract -lzfs -luuid -lbrand -ldladm -ltsnet -ltsol \
- -linetutil
XGETFLAGS += -a -x zoneadmd.xcl
+ROOTUSRLIBZONES = $(ROOT)/usr/lib/zones
+
.KEEP_STATE:
.PARALLEL:
-all: $(PROG)
+all: $(SUBDIRS)
$(PROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
-install: all $(ROOTCMD)
-
-$(POFILE): $(POFILES)
- $(RM) $@
- $(CAT) $(POFILES) > $@
+install: $(SUBDIRS)
+ -$(RM) $(ROOTUSRLIBZONES)/$(PROG)
+ -$(LN) $(ISAEXEC) $(ROOTUSRLIBZONES)/$(PROG)
-clean:
- $(RM) $(OBJS)
+$(POFILE):
-lint: lint_SRCS
+clean clobebr lint: $(SUBDIRS)
check:
- $(CSTYLE) -p -P $(SRCS:%=%)
+ $(CSTYLE) -p -P *.c
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
include ../Makefile.targ
diff --git a/usr/src/cmd/zoneadmd/Makefile.com b/usr/src/cmd/zoneadmd/Makefile.com
new file mode 100644
index 0000000000..ed7afe64e9
--- /dev/null
+++ b/usr/src/cmd/zoneadmd/Makefile.com
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+PROG= zoneadmd
+
+include ../../Makefile.cmd
+include ../../Makefile.ctf
+
+ROOTCMDDIR= $(ROOTLIB)/zones
+
+OBJS= zoneadmd.o zcons.o vplat.o mcap.o
+
+CFLAGS += $(CCVERBOSE)
+LDLIBS += -lsocket -lzonecfg -lnsl -ldevinfo -ldevice -lnvpair \
+ -lgen -lbsm -lcontract -lzfs -luuid -lbrand -ldladm -ltsnet -ltsol \
+ -linetutil -lproc
+
+.KEEP_STATE:
+
+%.o: ../%.c
+ $(COMPILE.c) $<
+ $(POST_PROCESS_O)
+
+ROOTUSRLIBZONES = $(ROOT)/usr/lib/zones
+ROOTUSRLIBZONES32 = $(ROOTUSRLIBZONES)/$(MACH32)
+ROOTUSRLIBZONES64 = $(ROOTUSRLIBZONES)/$(MACH64)
+ROOTUSRLIBZONESPROG32 = $(ROOTUSRLIBZONES32)/$(PROG)
+ROOTUSRLIBZONESPROG64 = $(ROOTUSRLIBZONES64)/$(PROG)
+$(ROOTUSRLIBZONES32)/%: $(ROOTUSRLIBZONES32) %
+ $(INS.file)
+$(ROOTUSRLIBZONES64)/%: $(ROOTUSRLIBZONES64) %
+ $(INS.file)
+$(ROOTUSRLIBZONES32):
+ $(INS.dir)
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
+ $(POST_PROCESS)
+
+clean:
+ $(RM) $(OBJS)
+
+lint:
+ $(LINT.c) ../*.c $(LDLIBS)
+
+include ../../Makefile.targ
diff --git a/usr/src/cmd/zoneadmd/amd64/Makefile b/usr/src/cmd/zoneadmd/amd64/Makefile
new file mode 100644
index 0000000000..75ac51db32
--- /dev/null
+++ b/usr/src/cmd/zoneadmd/amd64/Makefile
@@ -0,0 +1,31 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+.KEEP_STATE:
+
+include ../Makefile.com
+include ../../Makefile.cmd.64
+
+install: all $(ROOTUSRLIBZONES64) $(ROOTUSRLIBZONESPROG64)
diff --git a/usr/src/cmd/zoneadmd/i386/Makefile b/usr/src/cmd/zoneadmd/i386/Makefile
new file mode 100644
index 0000000000..a8764e0638
--- /dev/null
+++ b/usr/src/cmd/zoneadmd/i386/Makefile
@@ -0,0 +1,30 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
+#
+
+.KEEP_STATE:
+
+include ../Makefile.com
+
+install: all $(ROOTUSRLIBZONES32) $(ROOTUSRLIBZONESPROG32)
diff --git a/usr/src/cmd/zoneadmd/mcap.c b/usr/src/cmd/zoneadmd/mcap.c
new file mode 100644
index 0000000000..9f5d61dada
--- /dev/null
+++ b/usr/src/cmd/zoneadmd/mcap.c
@@ -0,0 +1,1148 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * This file implements the code which runs a thread inside zoneadmd to cap
+ * the associated zone's physical memory. A thread to do this is started
+ * when the zone boots and is halted when the zone shuts down.
+ *
+ * Because of the way that the VM system is currently implemented, there is no
+ * way to go from the bottom up (page to process to zone). Thus, there is no
+ * obvious way to hook an rctl into the kernel's paging code to enforce a hard
+ * memory cap. Instead, we implement a soft physical memory cap which looks
+ * at the zone's overall rss and once it is over the cap, works from the top
+ * down (zone to process to page), looking at zone processes, to determine
+ * what to try to pageout to get the zone under its memory cap.
+ *
+ * The code uses the vm_getusage syscall to determine the zone's rss and
+ * checks that against the zone's zone.max-physical-memory rctl. Once the
+ * zone goes over its cap, then this thread will work through the zone's
+ * /proc process list, Pgrab-bing each process and stepping through the
+ * address space segments attempting to use pr_memcntl(...MS_INVALCURPROC...)
+ * to pageout pages, until the zone is again under its cap.
+ *
+ * Although zone memory capping is implemented as a soft cap by this user-level
+ * thread, the interfaces around memory caps that are exposed to the user are
+ * the standard ones; an rctl and kstats. This thread uses the rctl value
+ * to obtain the cap and works with the zone kernel code to update the kstats.
+ * If the implementation ever moves into the kernel, these exposed interfaces
+ * do not need to change.
+ *
+ * The thread adaptively sleeps, periodically checking the state of the
+ * zone. As the zone's rss gets closer to the cap, the thread will wake up
+ * more often to check the zone's status. Once the zone is over the cap,
+ * the thread will work to pageout until the zone is under the cap, as shown
+ * by updated vm_usage data.
+ *
+ * NOTE: The pagedata page maps (at least on x86) are not useful. Those flags
+ * are set by hrm_setbits() and on x86 that code path is only executed by
+ * segvn_pagelock -> hat_setstat -> hrm_setbits
+ * segvn_softunlock -^
+ * On SPARC there is an additional code path which may make this data
+ * useful (sfmmu_ttesync), but since it is not generic, we ignore the page
+ * maps. If we ever fix this issue, then we could generalize this mcap code to
+ * do more with the data on active pages.
+ *
+ * For debugging, touch the file {zonepath}/mcap_debug.log. This will
+ * cause the thread to start logging its actions into that file (it may take
+ * a minute or two if the thread is currently sleeping). Removing that
+ * file will cause logging to stop.
+ */
+
+#include <sys/mman.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <libproc.h>
+#include <limits.h>
+#include <procfs.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <time.h>
+#include <unistd.h>
+#include <sys/priocntl.h>
+#include <dirent.h>
+#include <zone.h>
+#include <libzonecfg.h>
+#include <thread.h>
+#include <values.h>
+#include <sys/vm_usage.h>
+#include <sys/resource.h>
+#include <sys/debug.h>
+#include <synch.h>
+#include <wait.h>
+#include <libcontract.h>
+#include <libcontract_priv.h>
+#include <sys/contract/process.h>
+#include "zoneadmd.h"
+
+ /* round up to next y = 2^n */
+#define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
+
+#define CAP_REFRESH ((uint64_t)300 * NANOSEC) /* every 5 minutes */
+
+/*
+ * zonecfg attribute tunables for memory capping.
+ * phys-mcap-cmd
+ * type: string
+ * specifies a command that can be run when over the cap
+ * phys-mcap-no-vmusage
+ * type: boolean
+ * true disables vm_getusage and just uses zone's proc. rss sum
+ * phys-mcap-no-pageout
+ * type: boolean
+ * true disables pageout when over
+ */
+#define TUNE_CMD "phys-mcap-cmd"
+#define TUNE_NVMU "phys-mcap-no-vmusage"
+#define TUNE_NPAGE "phys-mcap-no-pageout"
+
+static char zonename[ZONENAME_MAX];
+static char zonepath[MAXPATHLEN];
+static char zoneproc[MAXPATHLEN];
+static char debug_log[MAXPATHLEN];
+static zoneid_t zid;
+static mutex_t shutdown_mx;
+static cond_t shutdown_cv;
+static int shutting_down = 0;
+static thread_t mcap_tid;
+static FILE *debug_log_fp = NULL;
+static uint64_t zone_rss_cap; /* RSS cap(KB) */
+static char over_cmd[2 * BUFSIZ]; /* same size as zone_attr_value */
+static boolean_t skip_vmusage = B_FALSE;
+static boolean_t skip_pageout = B_FALSE;
+
+/*
+ * Structure to hold current state about a process address space that we're
+ * working on.
+ */
+typedef struct {
+ int pr_curr; /* the # of the mapping we're working on */
+ int pr_nmap; /* number of mappings in address space */
+ prxmap_t *pr_xmapp; /* process's xmap array */
+} proc_map_t;
+
+typedef struct zsd_vmusage64 {
+ id_t vmu_zoneid;
+ uint_t vmu_type;
+ id_t vmu_id;
+ /*
+ * An amd64 kernel will align the following uint64_t members, but a
+ * 32bit i386 process will not without help.
+ */
+ int vmu_align_next_members_on_8_bytes;
+ uint64_t vmu_rss_all;
+ uint64_t vmu_rss_private;
+ uint64_t vmu_rss_shared;
+ uint64_t vmu_swap_all;
+ uint64_t vmu_swap_private;
+ uint64_t vmu_swap_shared;
+} zsd_vmusage64_t;
+
+/*
+ * Output a debug log message.
+ */
+/*PRINTFLIKE1*/
+static void
+debug(char *fmt, ...)
+{
+ va_list ap;
+
+ if (debug_log_fp == NULL)
+ return;
+
+ va_start(ap, fmt);
+ (void) vfprintf(debug_log_fp, fmt, ap);
+ va_end(ap);
+ (void) fflush(debug_log_fp);
+}
+
+/*
+ * Like sleep(3C) but can be interupted by cond_signal which is posted when
+ * we're shutting down the mcap thread.
+ */
+static void
+sleep_shutdown(int secs)
+{
+ timestruc_t to;
+
+ to.tv_sec = secs;
+ to.tv_nsec = 0;
+
+ (void) mutex_lock(&shutdown_mx);
+ if (!shutting_down)
+ (void) cond_reltimedwait(&shutdown_cv, &shutdown_mx, &to);
+ (void) mutex_unlock(&shutdown_mx);
+}
+
+static boolean_t
+proc_issystem(pid_t pid)
+{
+ char pc_clname[PC_CLNMSZ];
+
+ if (priocntl(P_PID, pid, PC_GETXPARMS, NULL, PC_KY_CLNAME, pc_clname,
+ PC_KY_NULL) != -1)
+ return (strcmp(pc_clname, "SYS") == 0);
+
+ return (B_TRUE);
+}
+
+/*
+ * Fork a child that enters the zone and runs the "phys-mcap-cmd" command.
+ */
+static void
+run_over_cmd()
+{
+ int ctfd;
+ int err;
+ pid_t childpid;
+ siginfo_t info;
+ ctid_t ct;
+
+ /*
+ * Before we enter the zone, we need to create a new process contract
+ * for the child, as required by zone_enter().
+ */
+ if ((ctfd = open64("/system/contract/process/template", O_RDWR)) == -1)
+ return;
+ if (ct_tmpl_set_critical(ctfd, 0) != 0 ||
+ ct_tmpl_set_informative(ctfd, 0) != 0 ||
+ ct_pr_tmpl_set_fatal(ctfd, CT_PR_EV_HWERR) != 0 ||
+ ct_pr_tmpl_set_param(ctfd, CT_PR_PGRPONLY) != 0 ||
+ ct_tmpl_activate(ctfd) != 0) {
+ (void) close(ctfd);
+ return;
+ }
+
+ childpid = fork();
+ switch (childpid) {
+ case -1:
+ (void) ct_tmpl_clear(ctfd);
+ (void) close(ctfd);
+ break;
+ case 0: /* Child */
+ (void) ct_tmpl_clear(ctfd);
+ (void) close(ctfd);
+ if (zone_enter(zid) == -1)
+ _exit(errno);
+ err = system(over_cmd);
+ _exit(err);
+ break;
+ default: /* Parent */
+ if (contract_latest(&ct) == -1)
+ ct = -1;
+ (void) ct_tmpl_clear(ctfd);
+ (void) close(ctfd);
+ err = waitid(P_PID, childpid, &info, WEXITED);
+ (void) contract_abandon_id(ct);
+ if (err == -1 || info.si_status != 0)
+ debug("over_cmd failed");
+ break;
+ }
+}
+
+static struct ps_prochandle *
+control_proc(pid_t pid)
+{
+ int res;
+ struct ps_prochandle *ph;
+
+ /* Take control of the process. */
+ if ((ph = Pgrab(pid, 0, &res)) == NULL)
+ return (NULL);
+
+ if (Pcreate_agent(ph) != 0) {
+ (void) Prelease(ph, 0);
+ return (NULL);
+ }
+
+ /* Verify agent LWP is actually stopped. */
+ errno = 0;
+ while (Pstate(ph) == PS_RUN)
+ (void) Pwait(ph, 0);
+
+ if (Pstate(ph) != PS_STOP) {
+ Pdestroy_agent(ph);
+ (void) Prelease(ph, 0);
+ return (NULL);
+ }
+
+ return (ph);
+}
+
+/*
+ * Get the next mapping.
+ */
+static prxmap_t *
+nextmapping(proc_map_t *pmp)
+{
+ if (pmp->pr_xmapp == NULL || pmp->pr_curr >= pmp->pr_nmap)
+ return (NULL);
+
+ return (&pmp->pr_xmapp[pmp->pr_curr++]);
+}
+
+/*
+ * Initialize the proc_map_t to access the first mapping of an address space.
+ */
+static prxmap_t *
+init_map(proc_map_t *pmp, pid_t pid)
+{
+ int fd;
+ int res;
+ struct stat st;
+ char pathbuf[MAXPATHLEN];
+
+ bzero(pmp, sizeof (proc_map_t));
+ pmp->pr_nmap = -1;
+
+ (void) snprintf(pathbuf, sizeof (pathbuf), "%s/%d/xmap", zoneproc, pid);
+ if ((fd = open(pathbuf, O_RDONLY, 0)) < 0)
+ return (NULL);
+
+redo:
+ errno = 0;
+ if (fstat(fd, &st) != 0)
+ goto done;
+
+ if ((pmp->pr_xmapp = malloc(st.st_size)) == NULL) {
+ debug("cannot malloc() %ld bytes for xmap", st.st_size);
+ goto done;
+ }
+ (void) bzero(pmp->pr_xmapp, st.st_size);
+
+ errno = 0;
+ if ((res = read(fd, pmp->pr_xmapp, st.st_size)) != st.st_size) {
+ free(pmp->pr_xmapp);
+ pmp->pr_xmapp = NULL;
+ if (res > 0 || errno == E2BIG) {
+ goto redo;
+ } else {
+ debug("pid %ld cannot read xmap\n", pid);
+ goto done;
+ }
+ }
+
+ pmp->pr_nmap = st.st_size / sizeof (prxmap_t);
+done:
+ (void) close(fd);
+ return (nextmapping(pmp));
+}
+
+/*
+ * Attempt to page out a region of the given process's address space. May
+ * return nonzero if not all of the pages may are pageable, for any reason.
+ */
+static int
+pageout_mapping(struct ps_prochandle *Pr, prxmap_t *pmp)
+{
+ int res;
+
+ /*
+ * We particularly want to avoid the pr_memcntl on anonymous mappings
+ * which show 0 since that will pull them back off of the free list
+ * and increase the zone's RSS, even though the process itself has
+ * them freed up.
+ */
+ if (pmp->pr_mflags & MA_ANON && pmp->pr_anon == 0)
+ return (0);
+ else if (pmp->pr_mflags & MA_ISM || pmp->pr_mflags & MA_SHM)
+ return (0);
+
+ errno = 0;
+ res = pr_memcntl(Pr, (caddr_t)pmp->pr_vaddr, pmp->pr_size, MC_SYNC,
+ (caddr_t)(MS_ASYNC | MS_INVALCURPROC), 0, 0);
+
+ /*
+ * EBUSY indicates none of the pages have backing store allocated, or
+ * some pages were locked. Don't care about this.
+ */
+ if (res != 0 && errno == EBUSY)
+ res = 0;
+
+ return (res);
+}
+
+/*
+ * Compute the delta of the process RSS since the last call. If the
+ * psinfo cannot be obtained, no error is returned; its up to the caller to
+ * detect the process termination via other means.
+ */
+static int64_t
+rss_delta(int64_t *old_rss, int psfd)
+{
+ int64_t d_rss = 0;
+ psinfo_t psinfo;
+
+ if (pread(psfd, &psinfo, sizeof (psinfo_t), 0) == sizeof (psinfo_t)) {
+ d_rss = (int64_t)psinfo.pr_rssize - *old_rss;
+ *old_rss = (int64_t)psinfo.pr_rssize;
+ }
+
+ return (d_rss);
+}
+
+
+/*
+ * Work through a process paging out mappings until the whole address space was
+ * examined or the excess is < 0. Return our estimate of the updated excess.
+ */
+static int64_t
+pageout_process(pid_t pid, int64_t excess)
+{
+ int psfd;
+ prxmap_t *pxmap;
+ proc_map_t cur;
+ struct ps_prochandle *ph = NULL;
+ int unpageable_mappings;
+ int64_t sum_d_rss, sum_att, d_rss;
+ int64_t old_rss;
+ psinfo_t psinfo;
+ int incr_rss_check = 0;
+ char pathbuf[MAXPATHLEN];
+
+ (void) snprintf(pathbuf, sizeof (pathbuf), "%s/%d/psinfo", zoneproc,
+ pid);
+ if ((psfd = open(pathbuf, O_RDONLY, 0000)) < 0)
+ return (excess);
+
+ cur.pr_xmapp = NULL;
+
+ if (pread(psfd, &psinfo, sizeof (psinfo), 0) != sizeof (psinfo))
+ goto done;
+
+ old_rss = (int64_t)psinfo.pr_rssize;
+
+ /* If unscannable, skip it. */
+ if (psinfo.pr_nlwp == 0 || proc_issystem(pid)) {
+ debug("pid: %ld system process, skipping %s\n",
+ pid, psinfo.pr_psargs);
+ goto done;
+ }
+
+ /* If tiny RSS (16KB), skip it. */
+ if (old_rss <= 16) {
+ debug("pid: %ld skipping, RSS %lldKB %s\n",
+ pid, old_rss, psinfo.pr_psargs);
+ goto done;
+ }
+
+ /* Get segment residency information. */
+ pxmap = init_map(&cur, pid);
+
+ /* Skip process if it has no mappings. */
+ if (pxmap == NULL) {
+ debug("%ld: xmap unreadable; ignoring\n", pid);
+ goto done;
+ }
+
+ debug("pid %ld: nmap %d sz %dKB rss %lldKB %s\n",
+ pid, cur.pr_nmap, psinfo.pr_size, old_rss, psinfo.pr_psargs);
+
+ /* Take control of the process. */
+ if ((ph = control_proc(pid)) == NULL) {
+ debug("%ld: cannot control\n", pid);
+ goto done;
+ }
+
+ /*
+ * If the process RSS is not enough to erase the excess then no need
+ * to incrementally check the RSS delta after each pageout attempt.
+ * Instead check it after we've tried all of the segements.
+ */
+ if (excess - old_rss < 0)
+ incr_rss_check = 1;
+
+ /*
+ * Within the process's address space, attempt to page out mappings.
+ */
+ sum_att = sum_d_rss = 0;
+ unpageable_mappings = 0;
+ while (excess > 0 && pxmap != NULL && !shutting_down) {
+ /* Try to page out the mapping. */
+ if (pageout_mapping(ph, pxmap) < 0) {
+ debug("pid %ld: exited or unpageable\n", pid);
+ break;
+ }
+
+ /* attempted is the size of the mapping */
+ sum_att += pxmap->pr_size / 1024;
+
+ /*
+ * This processes RSS is potentially enough to clear the
+ * excess so check as we go along to see if we can stop
+ * paging out partway through the process.
+ */
+ if (incr_rss_check) {
+ d_rss = rss_delta(&old_rss, psfd);
+
+ /*
+ * If this pageout attempt was unsuccessful (the
+ * resident portion was not affected), then note it was
+ * unpageable. Mappings are unpageable when none of the
+ * pages paged out, such as when they are locked, or
+ * involved in asynchronous I/O.
+ */
+ if (d_rss >= 0) {
+ unpageable_mappings++;
+ } else {
+ excess += d_rss;
+ sum_d_rss += d_rss;
+ }
+ }
+
+ pxmap = nextmapping(&cur);
+ }
+
+ if (!incr_rss_check) {
+ d_rss = rss_delta(&old_rss, psfd);
+ if (d_rss < 0) {
+ excess += d_rss;
+ sum_d_rss += d_rss;
+ }
+ }
+
+ debug("pid %ld: unp %d att %lluKB drss %lldKB excess %lldKB\n",
+ pid, unpageable_mappings, (unsigned long long)sum_att,
+ (unsigned long long)sum_d_rss, (long long)excess);
+
+done:
+ /* If a process was grabbed, release it, destroying its agent. */
+ if (ph != NULL) {
+ Pdestroy_agent(ph);
+ (void) Prelease(ph, 0);
+ }
+
+ if (cur.pr_xmapp != NULL)
+ free(cur.pr_xmapp);
+
+ (void) close(psfd);
+
+ if (shutting_down)
+ return (0);
+
+ return (excess);
+}
+
+/*
+ * Get the zone's RSS data.
+ */
+static uint64_t
+get_mem_info(int age)
+{
+ uint64_t n = 1;
+ zsd_vmusage64_t buf;
+ uint64_t zone_rss;
+ DIR *pdir = NULL;
+ struct dirent *dent;
+
+ /*
+ * Start by doing the fast, cheap RSS calculation using the rss value
+ * in psinfo_t. Because that's per-process, it can lead to double
+ * counting some memory and overestimating how much is being used, but
+ * as long as that's not over the cap, then we don't need do the
+ * expensive calculation.
+ */
+ if (shutting_down)
+ return (0);
+
+ if ((pdir = opendir(zoneproc)) == NULL)
+ return (0);
+
+ zone_rss = 0;
+ while (!shutting_down && (dent = readdir(pdir)) != NULL) {
+ pid_t pid;
+ int psfd;
+ int64_t rss;
+ char pathbuf[MAXPATHLEN];
+ psinfo_t psinfo;
+
+ if (strcmp(".", dent->d_name) == 0 ||
+ strcmp("..", dent->d_name) == 0)
+ continue;
+
+ pid = atoi(dent->d_name);
+ if (pid == 0 || pid == 1)
+ continue;
+
+ (void) snprintf(pathbuf, sizeof (pathbuf), "%s/%d/psinfo",
+ zoneproc, pid);
+
+ rss = 0;
+ if ((psfd = open(pathbuf, O_RDONLY, 0000)) != -1) {
+ if (pread(psfd, &psinfo, sizeof (psinfo), 0) ==
+ sizeof (psinfo))
+ rss = (int64_t)psinfo.pr_rssize;
+
+ (void) close(psfd);
+ }
+
+ zone_rss += rss;
+ }
+
+ (void) closedir(pdir);
+
+ if (shutting_down)
+ return (0);
+
+ debug("fast rss %lluKB\n", zone_rss);
+ if (zone_rss <= zone_rss_cap || skip_vmusage) {
+ uint64_t zone_rss_bytes;
+
+ zone_rss_bytes = zone_rss * 1024;
+ /* Use the zone's approx. RSS in the kernel */
+ (void) zone_setattr(zid, ZONE_ATTR_RSS, &zone_rss_bytes, 0);
+ return (zone_rss);
+ }
+
+ buf.vmu_id = zid;
+
+ if (syscall(SYS_rusagesys, _RUSAGESYS_GETVMUSAGE, VMUSAGE_A_ZONE,
+ age, (uintptr_t)&buf, (uintptr_t)&n) != 0) {
+ debug("vmusage failed\n");
+ (void) sleep_shutdown(1);
+ return (0);
+ }
+
+ if (n > 1) {
+ /* This should never happen */
+ debug("vmusage returned more than one result\n");
+ (void) sleep_shutdown(1);
+ return (0);
+ }
+
+ if (buf.vmu_id != zid) {
+ /* This should never happen */
+ debug("vmusage returned the incorrect zone\n");
+ (void) sleep_shutdown(1);
+ return (0);
+ }
+
+ zone_rss = buf.vmu_rss_all / 1024;
+ return (zone_rss);
+}
+
+/*
+ * Needed to read the zones physical-memory-cap rctl.
+ */
+static struct ps_prochandle *
+grab_zone_proc()
+{
+ DIR *dirp;
+ struct dirent *dentp;
+ struct ps_prochandle *ph = NULL;
+ int tmp;
+
+ if ((dirp = opendir(zoneproc)) == NULL)
+ return (NULL);
+
+ while (!shutting_down && (dentp = readdir(dirp))) {
+ int pid;
+
+ if (strcmp(".", dentp->d_name) == 0 ||
+ strcmp("..", dentp->d_name) == 0)
+ continue;
+
+ pid = atoi(dentp->d_name);
+ /* attempt to grab process */
+ if ((ph = Pgrab(pid, 0, &tmp)) != NULL) {
+ if (Psetflags(ph, PR_RLC) == 0) {
+ if (Pcreate_agent(ph) == 0) {
+ (void) closedir(dirp);
+ return (ph);
+ }
+ }
+ Prelease(ph, 0);
+ }
+ }
+
+ (void) closedir(dirp);
+ return (NULL);
+}
+
+static uint64_t
+get_zone_cap()
+{
+ rctlblk_t *rblk;
+ uint64_t mcap;
+ struct ps_prochandle *ph;
+
+ if ((rblk = (rctlblk_t *)malloc(rctlblk_size())) == NULL)
+ return (UINT64_MAX);
+
+ if ((ph = grab_zone_proc()) == NULL) {
+ free(rblk);
+ return (UINT64_MAX);
+ }
+
+ if (pr_getrctl(ph, "zone.max-physical-memory", NULL, rblk,
+ RCTL_FIRST)) {
+ Pdestroy_agent(ph);
+ Prelease(ph, 0);
+ free(rblk);
+ return (UINT64_MAX);
+ }
+
+ Pdestroy_agent(ph);
+ Prelease(ph, 0);
+
+ mcap = rctlblk_get_value(rblk);
+ free(rblk);
+ return (mcap);
+}
+
+/*
+ * check_suspend is invoked at the beginning of every pass through the process
+ * list or after we've paged out enough so that we think the excess is under
+ * the cap. The purpose is to periodically check the zone's rss and return
+ * the excess when the zone is over the cap. The rest of the time this
+ * function will sleep, periodically waking up to check the current rss.
+ *
+ * The age parameter is used to tell us how old the cached rss data can be.
+ * When first starting up, the cached data can be older, but after we
+ * start paging out, we want current data.
+ *
+ * Depending on the percentage of penetration of the zone's rss into the
+ * cap we sleep for longer or shorter amounts and accept older cached
+ * vmusage data. This reduces the impact of this work on the system, which
+ * is important considering that each zone will be monitoring its rss.
+ */
+static int64_t
+check_suspend(int age, boolean_t new_cycle)
+{
+ static hrtime_t last_cap_read = 0;
+ static uint64_t addon;
+ static uint64_t lo_thresh; /* Thresholds for how long to sleep */
+ static uint64_t hi_thresh; /* when under the cap (80% & 90%). */
+ static uint64_t prev_zone_rss = 0;
+ static uint32_t pfdelay = 0; /* usec page fault delay when over */
+
+ /* Wait a second to give the async pageout a chance to catch up. */
+ (void) sleep_shutdown(1);
+
+ while (!shutting_down) {
+ int64_t new_excess;
+ int sleep_time;
+ hrtime_t now;
+ struct stat st;
+ uint64_t zone_rss; /* total RSS(KB) */
+
+ /*
+ * Check if the debug log files exists and enable or disable
+ * debug.
+ */
+ if (debug_log_fp == NULL) {
+ if (stat(debug_log, &st) == 0)
+ debug_log_fp = fopen(debug_log, "w");
+ } else {
+ if (stat(debug_log, &st) == -1) {
+ (void) fclose(debug_log_fp);
+ debug_log_fp = NULL;
+ }
+ }
+
+ /*
+ * If the CAP_REFRESH interval has passed, re-get the current
+ * cap in case it has been dynamically updated.
+ */
+ now = gethrtime();
+ if (now - last_cap_read > CAP_REFRESH) {
+ uint64_t mcap;
+
+ last_cap_read = now;
+
+ mcap = get_zone_cap();
+ if (mcap != 0 && mcap != UINT64_MAX)
+ zone_rss_cap = ROUNDUP(mcap, 1024) / 1024;
+ else
+ zone_rss_cap = UINT64_MAX;
+
+ lo_thresh = (uint64_t)(zone_rss_cap * .8);
+ hi_thresh = (uint64_t)(zone_rss_cap * .9);
+ addon = (uint64_t)(zone_rss_cap * 0.05);
+
+ debug("%s: %s\n", TUNE_CMD, over_cmd);
+ debug("%s: %d\n", TUNE_NVMU, skip_vmusage);
+ debug("%s: %d\n", TUNE_NPAGE, skip_pageout);
+ debug("current cap %lluKB lo %lluKB hi %lluKB\n",
+ zone_rss_cap, lo_thresh, hi_thresh);
+ }
+
+ /* No cap, nothing to do. */
+ if (zone_rss_cap == 0 || zone_rss_cap == UINT64_MAX) {
+ debug("no cap, sleep 120 seconds\n");
+ (void) sleep_shutdown(120);
+ continue;
+ }
+
+ zone_rss = get_mem_info(age);
+
+ /* calculate excess */
+ new_excess = zone_rss - zone_rss_cap;
+
+ debug("rss %lluKB, cap %lluKB, excess %lldKB\n",
+ zone_rss, zone_rss_cap, new_excess);
+
+ /*
+ * If necessary, updates stats.
+ */
+
+ /*
+ * If it looks like we did some paging out since last over the
+ * cap then update the kstat so we can approximate how much was
+ * paged out.
+ */
+ if (prev_zone_rss > zone_rss_cap && zone_rss < prev_zone_rss) {
+ uint64_t diff;
+
+ /* assume diff is num bytes we paged out */
+ diff = (prev_zone_rss - zone_rss) * 1024;
+
+ (void) zone_setattr(zid, ZONE_ATTR_PMCAP_PAGEOUT,
+ &diff, 0);
+ }
+ prev_zone_rss = zone_rss;
+
+ if (new_excess > 0) {
+ if (new_cycle) {
+ uint64_t n = 1;
+
+ /* Increment "nover" kstat. */
+ (void) zone_setattr(zid, ZONE_ATTR_PMCAP_NOVER,
+ &n, 0);
+ }
+
+ if (!skip_pageout) {
+ /*
+ * Tell the kernel to start throttling page
+ * faults by some number of usecs to help us
+ * catch up. If we are persistently over the
+ * cap the delay ramps up to a max of 2000usecs.
+ * Note that for delays less than 1 tick
+ * (i.e. all of these) we busy-wait in as_fault.
+ * delay faults/sec
+ * 125 8000
+ * 250 4000
+ * 500 2000
+ * 1000 1000
+ * 2000 500
+ */
+ if (pfdelay == 0)
+ pfdelay = 125;
+ else if (pfdelay < 2000)
+ pfdelay *= 2;
+
+ (void) zone_setattr(zid, ZONE_ATTR_PG_FLT_DELAY,
+ &pfdelay, 0);
+ }
+
+ /*
+ * Once we go over the cap, then we want to
+ * page out a little extra instead of stopping
+ * right at the cap. To do this we add 5% to
+ * the excess so that pageout_proces will work
+ * a little longer before stopping.
+ */
+ return ((int64_t)(new_excess + addon));
+ }
+
+ /*
+ * At this point we are under the cap.
+ *
+ * Tell the kernel to stop throttling page faults.
+ *
+ * Scale the amount of time we sleep before rechecking the
+ * zone's memory usage. Also, scale the accpetable age of
+ * cached results from vm_getusage. We do this based on the
+ * penetration into the capped limit.
+ */
+ if (pfdelay > 0) {
+ pfdelay = 0;
+ (void) zone_setattr(zid, ZONE_ATTR_PG_FLT_DELAY,
+ &pfdelay, 0);
+ }
+
+ if (zone_rss <= lo_thresh) {
+ sleep_time = 120;
+ age = 15;
+ } else if (zone_rss <= hi_thresh) {
+ sleep_time = 60;
+ age = 10;
+ } else {
+ sleep_time = 30;
+ age = 5;
+ }
+
+ debug("sleep %d seconds\n", sleep_time);
+ (void) sleep_shutdown(sleep_time);
+ }
+
+ /* Shutting down, tell the kernel so it doesn't throttle */
+ if (pfdelay > 0) {
+ pfdelay = 0;
+ (void) zone_setattr(zid, ZONE_ATTR_PG_FLT_DELAY, &pfdelay, 0);
+ }
+
+ return (0);
+}
+
+static void
+get_mcap_tunables()
+{
+ zone_dochandle_t handle;
+ struct zone_attrtab attr;
+
+ over_cmd[0] = '\0';
+ if ((handle = zonecfg_init_handle()) == NULL)
+ return;
+
+ if (zonecfg_get_handle(zonename, handle) != Z_OK)
+ goto done;
+
+ /* Reset to defaults in case rebooting and settings have changed */
+ over_cmd[0] = '\0';
+ skip_vmusage = B_FALSE;
+ skip_pageout = B_FALSE;
+
+ if (zonecfg_setattrent(handle) != Z_OK)
+ goto done;
+ while (zonecfg_getattrent(handle, &attr) == Z_OK) {
+ if (strcmp(TUNE_CMD, attr.zone_attr_name) == 0) {
+ (void) strlcpy(over_cmd, attr.zone_attr_value,
+ sizeof (over_cmd));
+ } else if (strcmp(TUNE_NVMU, attr.zone_attr_name) == 0) {
+ if (strcmp("true", attr.zone_attr_value) == 0)
+ skip_vmusage = B_TRUE;
+ } else if (strcmp(TUNE_NPAGE, attr.zone_attr_name) == 0) {
+ if (strcmp("true", attr.zone_attr_value) == 0)
+ skip_pageout = B_TRUE;
+ }
+ }
+ (void) zonecfg_endattrent(handle);
+
+done:
+ zonecfg_fini_handle(handle);
+}
+
+/* ARGSUSED */
+static int
+chk_proc_fs(void *data, const char *spec, const char *dir,
+ const char *fstype, const char *opt)
+{
+ if (spec != NULL && strcmp(spec, "/proc") == 0)
+ *((boolean_t *)data) = B_TRUE;
+
+ return (0);
+}
+
+static boolean_t
+has_proc()
+{
+ brand_handle_t bh;
+ boolean_t fnd = B_FALSE;
+
+ if ((bh = brand_open(brand_name)) != NULL) {
+ (void) brand_platform_iter_mounts(bh, chk_proc_fs, &fnd);
+ }
+
+ brand_close(bh);
+ return (fnd);
+}
+
+/*
+ * We run this loop for brands with no /proc to simply update the RSS, using the
+ * expensive sycall, every 5 minutes.
+ */
+static void
+no_procfs()
+{
+ uint64_t n;
+ zsd_vmusage64_t buf;
+
+ (void) sleep_shutdown(30);
+ while (!shutting_down) {
+ buf.vmu_id = zid;
+ n = 1;
+
+ (void) syscall(SYS_rusagesys, _RUSAGESYS_GETVMUSAGE,
+ VMUSAGE_A_ZONE, 60, (uintptr_t)&buf, (uintptr_t)&n);
+
+ (void) sleep_shutdown(300);
+ }
+}
+
+/*
+ * Thread that checks zone's memory usage and when over the cap, goes through
+ * the zone's process list trying to pageout processes to get under the cap.
+ */
+static void
+mcap_zone()
+{
+ DIR *pdir = NULL;
+ int age = 10; /* initial cached vmusage can be 10 secs. old */
+ int64_t excess;
+
+ debug("thread startup\n");
+
+ get_mcap_tunables();
+
+ /*
+ * If the zone has no /proc filesystem, we can't use the fast algorithm
+ * to check RSS or pageout any processes. All we can do is periodically
+ * update it's RSS kstat using the expensive sycall.
+ */
+ if (!has_proc()) {
+ no_procfs();
+ debug("thread shutdown\n");
+ return;
+ }
+
+ /*
+ * When first starting it is likely lots of other zones are starting
+ * too because the system is booting. Since we just started the zone
+ * we're not worried about being over the cap right away, so we let
+ * things settle a bit and tolerate some older data here to minimize
+ * the load on the system.
+ */
+ (void) sleep_shutdown(15); /* wait 15 secs. so the zone can get going */
+
+ /* Wait until zone's /proc is mounted */
+ while (!shutting_down) {
+ struct stat st;
+
+ if (stat(zoneproc, &st) == 0 &&
+ strcmp(st.st_fstype, "proc") == 0)
+ break;
+ sleep_shutdown(5);
+ }
+
+ /* Open zone's /proc and walk entries. */
+ while (!shutting_down) {
+ if ((pdir = opendir(zoneproc)) != NULL)
+ break;
+ sleep_shutdown(5);
+ }
+
+ while (!shutting_down) {
+ struct dirent *dirent;
+
+ /* Wait until we've gone over the cap. */
+ excess = check_suspend(age, B_TRUE);
+
+ debug("starting to scan, excess %lldk\n", (long long)excess);
+
+ /*
+ * After the initial startup, we want the age of the cached
+ * vmusage to be only 1 second old since we are checking
+ * the current state after we've gone over the cap and have
+ * paged out some processes.
+ */
+ age = 1;
+
+ if (over_cmd[0] != '\0') {
+ uint64_t zone_rss; /* total RSS(KB) */
+
+ debug("run phys_mcap_cmd: %s\n", over_cmd);
+ run_over_cmd();
+
+ zone_rss = get_mem_info(0);
+ excess = zone_rss - zone_rss_cap;
+ debug("rss %lluKB, cap %lluKB, excess %lldKB\n",
+ zone_rss, zone_rss_cap, excess);
+ if (excess <= 0)
+ continue;
+ }
+
+ while (!shutting_down && (dirent = readdir(pdir)) != NULL) {
+ pid_t pid;
+
+ if (strcmp(".", dirent->d_name) == 0 ||
+ strcmp("..", dirent->d_name) == 0)
+ continue;
+
+ pid = atoi(dirent->d_name);
+ if (pid == 0 || pid == 1)
+ continue;
+
+ if (skip_pageout)
+ (void) sleep_shutdown(2);
+ else
+ excess = pageout_process(pid, excess);
+
+ if (excess <= 0) {
+ debug("apparently under; excess %lld\n",
+ (long long)excess);
+ /* Double check the current excess */
+ excess = check_suspend(1, B_FALSE);
+ }
+ }
+
+ debug("process pass done; excess %lld\n", (long long)excess);
+ rewinddir(pdir);
+ }
+
+ if (pdir != NULL)
+ (void) closedir(pdir);
+ debug("thread shutdown\n");
+}
+
+void
+create_mcap_thread(zlog_t *zlogp, zoneid_t id)
+{
+ int res;
+
+ shutting_down = 0;
+ zid = id;
+ (void) getzonenamebyid(zid, zonename, sizeof (zonename));
+
+ if (zone_get_zonepath(zonename, zonepath, sizeof (zonepath)) != 0)
+ zerror(zlogp, B_FALSE, "zone %s missing zonepath", zonename);
+ (void) snprintf(zoneproc, sizeof (zoneproc), "%s/root/proc", zonepath);
+ (void) snprintf(debug_log, sizeof (debug_log), "%s/mcap_debug.log",
+ zonepath);
+
+ res = thr_create(NULL, NULL, (void *(*)(void *))mcap_zone, NULL, NULL,
+ &mcap_tid);
+ if (res != 0) {
+ zerror(zlogp, B_FALSE, "error %d creating memory cap thread",
+ res);
+ mcap_tid = 0;
+ }
+}
+
+void
+destroy_mcap_thread()
+{
+ if (mcap_tid != 0) {
+ shutting_down = 1;
+ (void) cond_signal(&shutdown_cv);
+ (void) thr_join(mcap_tid, NULL, NULL);
+ mcap_tid = 0;
+ }
+}
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c
index df81c54c96..9b7162206d 100644
--- a/usr/src/cmd/zoneadmd/vplat.c
+++ b/usr/src/cmd/zoneadmd/vplat.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
*/
/*
@@ -136,6 +137,9 @@
#define ALT_MOUNT(mount_cmd) ((mount_cmd) != Z_MNT_BOOT)
+/* Number of times to retry unmounting if it fails */
+#define UMOUNT_RETRIES 30
+
/* a reasonable estimate for the number of lwps per process */
#define LWPS_PER_PROCESS 10
@@ -157,11 +161,14 @@ static m_label_t *zlabel = NULL;
static m_label_t *zid_label = NULL;
static priv_set_t *zprivs = NULL;
+static char *DFLT_FS_ALLOWED = "hsfs,smbfs,nfs,nfs3,nfs4,nfsdyn";
+
/* from libsocket, not in any header file */
extern int getnetmaskbyaddr(struct in_addr, struct in_addr *);
/* from zoneadmd */
extern char query_hook[];
+extern char post_statechg_hook[];
/*
* For each "net" resource configured in zonecfg, we track a zone_addr_list_t
@@ -198,7 +205,7 @@ autofs_cleanup(zoneid_t zoneid)
/*
* Ask autofs to unmount all trigger nodes in the given zone.
*/
- return (_autofssys(AUTOFS_UNMOUNTALL, (void *)zoneid));
+ return (_autofssys(AUTOFS_UNMOUNTALL, (void *)((uintptr_t)zoneid)));
}
static void
@@ -589,6 +596,24 @@ root_to_lu(zlog_t *zlogp, char *zroot, size_t zrootlen, boolean_t isresolved)
}
/*
+ * Perform brand-specific cleanup if we are unable to unmount a FS.
+ */
+static void
+brand_umount_cleanup(zlog_t *zlogp, char *path)
+{
+ char cmdbuf[2 * MAXPATHLEN];
+
+ if (post_statechg_hook[0] == '\0')
+ return;
+
+ if (snprintf(cmdbuf, sizeof (cmdbuf), "%s %d %d %s", post_statechg_hook,
+ ZONE_STATE_DOWN, Z_UNMOUNT, path) > sizeof (cmdbuf))
+ return;
+
+ (void) do_subproc(zlogp, cmdbuf, NULL, B_FALSE);
+}
+
+/*
* The general strategy for unmounting filesystems is as follows:
*
* - Remote filesystems may be dead, and attempting to contact them as
@@ -621,6 +646,7 @@ static int
unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd)
{
int error = 0;
+ int fail = 0;
FILE *mnttab;
struct mnttab *mnts;
uint_t nmnt;
@@ -708,18 +734,39 @@ unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd)
if (umount2(path, MS_FORCE) == 0) {
unmounted = B_TRUE;
stuck = B_FALSE;
+ fail = 0;
} else {
/*
- * The first failure indicates a
- * mount we won't be able to get
- * rid of automatically, so we
- * bail.
+ * We may hit a failure here if there
+ * is an app in the GZ with an open
+ * pipe into the zone (commonly into
+ * the zone's /var/run). This type
+ * of app will notice the closed
+ * connection and cleanup, but it may
+ * take a while and we have no easy
+ * way to notice that. To deal with
+ * this case, we will wait and retry
+ * a few times before we give up.
*/
- error++;
- zerror(zlogp, B_FALSE,
- "unable to unmount '%s'", path);
- free_mnttable(mnts, nmnt);
- goto out;
+ fail++;
+ if (fail < (UMOUNT_RETRIES - 1)) {
+ zerror(zlogp, B_FALSE,
+ "unable to unmount '%s', "
+ "retrying in 2 seconds",
+ path);
+ (void) sleep(2);
+ } else if (fail > UMOUNT_RETRIES) {
+ error++;
+ zerror(zlogp, B_FALSE,
+ "unmount of '%s' failed",
+ path);
+ free_mnttable(mnts, nmnt);
+ goto out;
+ } else {
+ /* Try the hook 2 times */
+ brand_umount_cleanup(zlogp,
+ path);
+ }
}
}
/*
@@ -1057,23 +1104,10 @@ mount_one_dev_symlink_cb(void *arg, const char *source, const char *target)
int
vplat_get_iptype(zlog_t *zlogp, zone_iptype_t *iptypep)
{
- zone_dochandle_t handle;
-
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
- if (zonecfg_get_iptype(handle, iptypep) != Z_OK) {
+ if (zonecfg_get_iptype(snap_hndl, iptypep) != Z_OK) {
zerror(zlogp, B_FALSE, "invalid ip-type configuration");
- zonecfg_fini_handle(handle);
return (-1);
}
- zonecfg_fini_handle(handle);
return (0);
}
@@ -1086,14 +1120,13 @@ static int
mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd)
{
char brand[MAXNAMELEN];
- zone_dochandle_t handle = NULL;
brand_handle_t bh = NULL;
struct zone_devtab ztab;
di_prof_t prof = NULL;
int err;
int retval = -1;
zone_iptype_t iptype;
- const char *curr_iptype;
+ const char *curr_iptype = NULL;
if (di_prof_init(devpath, &prof)) {
zerror(zlogp, B_TRUE, "failed to initialize profile");
@@ -1128,6 +1161,8 @@ mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd)
curr_iptype = "exclusive";
break;
}
+ if (curr_iptype == NULL)
+ abort();
if (brand_platform_iter_devices(bh, zone_name,
mount_one_dev_device_cb, prof, curr_iptype) != 0) {
@@ -1142,28 +1177,19 @@ mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd)
}
/* Add user-specified devices and directories */
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_FALSE, "can't initialize zone handle");
- goto cleanup;
- }
- if (err = zonecfg_get_handle(zone_name, handle)) {
- zerror(zlogp, B_FALSE, "can't get handle for zone "
- "%s: %s", zone_name, zonecfg_strerror(err));
- goto cleanup;
- }
- if (err = zonecfg_setdevent(handle)) {
+ if ((err = zonecfg_setdevent(snap_hndl)) != 0) {
zerror(zlogp, B_FALSE, "%s: %s", zone_name,
zonecfg_strerror(err));
goto cleanup;
}
- while (zonecfg_getdevent(handle, &ztab) == Z_OK) {
+ while (zonecfg_getdevent(snap_hndl, &ztab) == Z_OK) {
if (di_prof_add_dev(prof, ztab.zone_dev_match)) {
zerror(zlogp, B_TRUE, "failed to add "
"user-specified device");
goto cleanup;
}
}
- (void) zonecfg_enddevent(handle);
+ (void) zonecfg_enddevent(snap_hndl);
/* Send profile to kernel */
if (di_prof_commit(prof)) {
@@ -1176,8 +1202,6 @@ mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd)
cleanup:
if (bh != NULL)
brand_close(bh);
- if (handle != NULL)
- zonecfg_fini_handle(handle);
if (prof)
di_prof_fini(prof);
return (retval);
@@ -1672,7 +1696,6 @@ mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd)
char luroot[MAXPATHLEN];
int i, num_fs = 0;
struct zone_fstab *fs_ptr = NULL;
- zone_dochandle_t handle = NULL;
zone_state_t zstate;
brand_handle_t bh;
plat_gmount_cb_data_t cb;
@@ -1696,12 +1719,7 @@ mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd)
goto bad;
}
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- goto bad;
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK ||
- zonecfg_setfsent(handle) != Z_OK) {
+ if (zonecfg_setfsent(snap_hndl) != Z_OK) {
zerror(zlogp, B_FALSE, "invalid configuration");
goto bad;
}
@@ -1719,7 +1737,6 @@ mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd)
/* Get a handle to the brand info for this zone */
if ((bh = brand_open(brand)) == NULL) {
zerror(zlogp, B_FALSE, "unable to determine zone brand");
- zonecfg_fini_handle(handle);
return (-1);
}
@@ -1734,7 +1751,6 @@ mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd)
plat_gmount_cb, &cb) != 0) {
zerror(zlogp, B_FALSE, "unable to mount filesystems");
brand_close(bh);
- zonecfg_fini_handle(handle);
return (-1);
}
brand_close(bh);
@@ -1745,13 +1761,10 @@ mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd)
* higher level directories (e.g., /usr) get mounted before
* any beneath them (e.g., /usr/local).
*/
- if (mount_filesystems_fsent(handle, zlogp, &fs_ptr, &num_fs,
+ if (mount_filesystems_fsent(snap_hndl, zlogp, &fs_ptr, &num_fs,
mount_cmd) != 0)
goto bad;
- zonecfg_fini_handle(handle);
- handle = NULL;
-
/*
* Normally when we mount a zone all the zone filesystems
* get mounted relative to rootpath, which is usually
@@ -1830,8 +1843,6 @@ mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd)
return (0);
bad:
- if (handle != NULL)
- zonecfg_fini_handle(handle);
free_fs_data(fs_ptr, num_fs);
return (-1);
}
@@ -2187,13 +2198,7 @@ configure_one_interface(zlog_t *zlogp, zoneid_t zone_id,
if (ioctl(s, SIOCLIFADDIF, (caddr_t)&lifr) < 0) {
/*
* Here, we know that the interface can't be brought up.
- * A similar warning message was already printed out to
- * the console by zoneadm(1M) so instead we log the
- * message to syslog and continue.
*/
- zerror(&logsys, B_TRUE, "WARNING: skipping network interface "
- "'%s' which may not be present/plumbed in the "
- "global zone.", lifr.lifr_name);
(void) close(s);
return (Z_OK);
}
@@ -2406,7 +2411,6 @@ bad:
static int
configure_shared_network_interfaces(zlog_t *zlogp)
{
- zone_dochandle_t handle;
struct zone_nwiftab nwiftab, loopback_iftab;
zoneid_t zoneid;
@@ -2415,29 +2419,19 @@ configure_shared_network_interfaces(zlog_t *zlogp)
return (-1);
}
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
- if (zonecfg_setnwifent(handle) == Z_OK) {
+ if (zonecfg_setnwifent(snap_hndl) == Z_OK) {
for (;;) {
- if (zonecfg_getnwifent(handle, &nwiftab) != Z_OK)
+ if (zonecfg_getnwifent(snap_hndl, &nwiftab) != Z_OK)
break;
+ nwifent_free_attrs(&nwiftab);
if (configure_one_interface(zlogp, zoneid, &nwiftab) !=
Z_OK) {
- (void) zonecfg_endnwifent(handle);
- zonecfg_fini_handle(handle);
+ (void) zonecfg_endnwifent(snap_hndl);
return (-1);
}
}
- (void) zonecfg_endnwifent(handle);
+ (void) zonecfg_endnwifent(snap_hndl);
}
- zonecfg_fini_handle(handle);
if (is_system_labeled()) {
/*
* Labeled zones share the loopback interface
@@ -2891,7 +2885,6 @@ free_ip_interface(zone_addr_list_t *zalist)
static int
configure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid)
{
- zone_dochandle_t handle;
struct zone_nwiftab nwiftab;
char rootpath[MAXPATHLEN];
char path[MAXPATHLEN];
@@ -2900,30 +2893,18 @@ configure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid)
boolean_t added = B_FALSE;
zone_addr_list_t *zalist = NULL, *new;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
-
- if (zonecfg_setnwifent(handle) != Z_OK) {
- zonecfg_fini_handle(handle);
+ if (zonecfg_setnwifent(snap_hndl) != Z_OK)
return (0);
- }
for (;;) {
- if (zonecfg_getnwifent(handle, &nwiftab) != Z_OK)
+ if (zonecfg_getnwifent(snap_hndl, &nwiftab) != Z_OK)
break;
+ nwifent_free_attrs(&nwiftab);
if (prof == NULL) {
if (zone_get_devroot(zone_name, rootpath,
sizeof (rootpath)) != Z_OK) {
- (void) zonecfg_endnwifent(handle);
- zonecfg_fini_handle(handle);
+ (void) zonecfg_endnwifent(snap_hndl);
zerror(zlogp, B_TRUE,
"unable to determine dev root");
return (-1);
@@ -2931,8 +2912,7 @@ configure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid)
(void) snprintf(path, sizeof (path), "%s%s", rootpath,
"/dev");
if (di_prof_init(path, &prof) != 0) {
- (void) zonecfg_endnwifent(handle);
- zonecfg_fini_handle(handle);
+ (void) zonecfg_endnwifent(snap_hndl);
zerror(zlogp, B_TRUE,
"failed to initialize profile");
return (-1);
@@ -2956,17 +2936,17 @@ configure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid)
nwiftab.zone_nwif_physical) == 0) {
added = B_TRUE;
} else {
- (void) zonecfg_endnwifent(handle);
- zonecfg_fini_handle(handle);
- zerror(zlogp, B_TRUE, "failed to add network device");
- return (-1);
+ /*
+ * Failed to add network device, but the brand hook
+ * might be doing this for us, so keep silent.
+ */
+ continue;
}
/* set up the new IP interface, and add them all later */
new = malloc(sizeof (*new));
if (new == NULL) {
zerror(zlogp, B_TRUE, "no memory for %s",
nwiftab.zone_nwif_physical);
- zonecfg_fini_handle(handle);
free_ip_interface(zalist);
}
bzero(new, sizeof (*new));
@@ -2976,16 +2956,14 @@ configure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid)
}
if (zalist != NULL) {
if ((errno = add_net(zlogp, zoneid, zalist)) != 0) {
- (void) zonecfg_endnwifent(handle);
- zonecfg_fini_handle(handle);
+ (void) zonecfg_endnwifent(snap_hndl);
zerror(zlogp, B_TRUE, "failed to add address");
free_ip_interface(zalist);
return (-1);
}
free_ip_interface(zalist);
}
- (void) zonecfg_endnwifent(handle);
- zonecfg_fini_handle(handle);
+ (void) zonecfg_endnwifent(snap_hndl);
if (prof != NULL && added) {
if (di_prof_commit(prof) != 0) {
@@ -3121,48 +3099,23 @@ remove_datalink_protect(zlog_t *zlogp, zoneid_t zoneid)
/* datalink does not belong to the GZ */
continue;
}
- if (dlstatus != DLADM_STATUS_OK) {
+ if (dlstatus != DLADM_STATUS_OK)
zerror(zlogp, B_FALSE,
+ "clear 'protection' link property: %s",
dladm_status2str(dlstatus, dlerr));
- free(dllinks);
- return (-1);
- }
+
dlstatus = dladm_set_linkprop(dld_handle, *dllink,
"allowed-ips", NULL, 0, DLADM_OPT_ACTIVE);
- if (dlstatus != DLADM_STATUS_OK) {
+ if (dlstatus != DLADM_STATUS_OK)
zerror(zlogp, B_FALSE,
+ "clear 'allowed-ips' link property: %s",
dladm_status2str(dlstatus, dlerr));
- free(dllinks);
- return (-1);
- }
}
free(dllinks);
return (0);
}
static int
-unconfigure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid)
-{
- int dlnum = 0;
-
- /*
- * The kernel shutdown callback for the dls module should have removed
- * all datalinks from this zone. If any remain, then there's a
- * problem.
- */
- if (zone_list_datalink(zoneid, &dlnum, NULL) != 0) {
- zerror(zlogp, B_TRUE, "unable to list network interfaces");
- return (-1);
- }
- if (dlnum != 0) {
- zerror(zlogp, B_FALSE,
- "datalinks remain in zone after shutdown");
- return (-1);
- }
- return (0);
-}
-
-static int
tcp_abort_conn(zlog_t *zlogp, zoneid_t zoneid,
const struct sockaddr_storage *local, const struct sockaddr_storage *remote)
{
@@ -3244,26 +3197,14 @@ static int
get_privset(zlog_t *zlogp, priv_set_t *privs, zone_mnt_t mount_cmd)
{
int error = -1;
- zone_dochandle_t handle;
char *privname = NULL;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
-
if (ALT_MOUNT(mount_cmd)) {
zone_iptype_t iptype;
- const char *curr_iptype;
+ const char *curr_iptype = NULL;
- if (zonecfg_get_iptype(handle, &iptype) != Z_OK) {
+ if (zonecfg_get_iptype(snap_hndl, &iptype) != Z_OK) {
zerror(zlogp, B_TRUE, "unable to determine ip-type");
- zonecfg_fini_handle(handle);
return (-1);
}
@@ -3276,17 +3217,15 @@ get_privset(zlog_t *zlogp, priv_set_t *privs, zone_mnt_t mount_cmd)
break;
}
- if (zonecfg_default_privset(privs, curr_iptype) == Z_OK) {
- zonecfg_fini_handle(handle);
+ if (zonecfg_default_privset(privs, curr_iptype) == Z_OK)
return (0);
- }
+
zerror(zlogp, B_FALSE,
"failed to determine the zone's default privilege set");
- zonecfg_fini_handle(handle);
return (-1);
}
- switch (zonecfg_get_privset(handle, privs, &privname)) {
+ switch (zonecfg_get_privset(snap_hndl, privs, &privname)) {
case Z_OK:
error = 0;
break;
@@ -3309,7 +3248,6 @@ get_privset(zlog_t *zlogp, priv_set_t *privs, zone_mnt_t mount_cmd)
}
free(privname);
- zonecfg_fini_handle(handle);
return (error);
}
@@ -3322,7 +3260,6 @@ get_rctls(zlog_t *zlogp, char **bufp, size_t *bufsizep)
nvlist_t **nvlv = NULL;
int rctlcount = 0;
int error = -1;
- zone_dochandle_t handle;
struct zone_rctltab rctltab;
rctlblk_t *rctlblk = NULL;
uint64_t maxlwps;
@@ -3331,16 +3268,6 @@ get_rctls(zlog_t *zlogp, char **bufp, size_t *bufsizep)
*bufp = NULL;
*bufsizep = 0;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
-
rctltab.zone_rctl_valptr = NULL;
if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0) {
zerror(zlogp, B_TRUE, "%s failed", "nvlist_alloc");
@@ -3353,18 +3280,18 @@ get_rctls(zlog_t *zlogp, char **bufp, size_t *bufsizep)
* max-processes property. If only the max-processes property is set,
* we add a max-lwps property with a limit derived from max-processes.
*/
- if (zonecfg_get_aliased_rctl(handle, ALIAS_MAXPROCS, &maxprocs)
+ if (zonecfg_get_aliased_rctl(snap_hndl, ALIAS_MAXPROCS, &maxprocs)
== Z_OK &&
- zonecfg_get_aliased_rctl(handle, ALIAS_MAXLWPS, &maxlwps)
+ zonecfg_get_aliased_rctl(snap_hndl, ALIAS_MAXLWPS, &maxlwps)
== Z_NO_ENTRY) {
- if (zonecfg_set_aliased_rctl(handle, ALIAS_MAXLWPS,
+ if (zonecfg_set_aliased_rctl(snap_hndl, ALIAS_MAXLWPS,
maxprocs * LWPS_PER_PROCESS) != Z_OK) {
zerror(zlogp, B_FALSE, "unable to set max-lwps alias");
goto out;
}
}
- if (zonecfg_setrctlent(handle) != Z_OK) {
+ if (zonecfg_setrctlent(snap_hndl) != Z_OK) {
zerror(zlogp, B_FALSE, "%s failed", "zonecfg_setrctlent");
goto out;
}
@@ -3373,7 +3300,7 @@ get_rctls(zlog_t *zlogp, char **bufp, size_t *bufsizep)
zerror(zlogp, B_TRUE, "memory allocation failed");
goto out;
}
- while (zonecfg_getrctlent(handle, &rctltab) == Z_OK) {
+ while (zonecfg_getrctlent(snap_hndl, &rctltab) == Z_OK) {
struct zone_rctlvaltab *rctlval;
uint_t i, count;
const char *name = rctltab.zone_rctl_name;
@@ -3455,7 +3382,7 @@ get_rctls(zlog_t *zlogp, char **bufp, size_t *bufsizep)
nvlv = NULL;
rctlcount++;
}
- (void) zonecfg_endrctlent(handle);
+ (void) zonecfg_endrctlent(snap_hndl);
if (rctlcount == 0) {
error = 0;
@@ -3480,8 +3407,6 @@ out:
nvlist_free(nvl);
if (nvlv != NULL)
free(nvlv);
- if (handle != NULL)
- zonecfg_fini_handle(handle);
return (error);
}
@@ -3497,7 +3422,7 @@ get_implicit_datasets(zlog_t *zlogp, char **retstr)
> sizeof (cmdbuf))
return (-1);
- if (do_subproc(zlogp, cmdbuf, retstr) != 0)
+ if (do_subproc(zlogp, cmdbuf, retstr, B_FALSE) != 0)
return (-1);
return (0);
@@ -3506,7 +3431,6 @@ get_implicit_datasets(zlog_t *zlogp, char **retstr)
static int
get_datasets(zlog_t *zlogp, char **bufp, size_t *bufsizep)
{
- zone_dochandle_t handle;
struct zone_dstab dstab;
size_t total, offset, len;
int error = -1;
@@ -3517,30 +3441,20 @@ get_datasets(zlog_t *zlogp, char **bufp, size_t *bufsizep)
*bufp = NULL;
*bufsizep = 0;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
-
if (get_implicit_datasets(zlogp, &implicit_datasets) != 0) {
zerror(zlogp, B_FALSE, "getting implicit datasets failed");
goto out;
}
- if (zonecfg_setdsent(handle) != Z_OK) {
+ if (zonecfg_setdsent(snap_hndl) != Z_OK) {
zerror(zlogp, B_FALSE, "%s failed", "zonecfg_setdsent");
goto out;
}
total = 0;
- while (zonecfg_getdsent(handle, &dstab) == Z_OK)
+ while (zonecfg_getdsent(snap_hndl, &dstab) == Z_OK)
total += strlen(dstab.zone_dataset_name) + 1;
- (void) zonecfg_enddsent(handle);
+ (void) zonecfg_enddsent(snap_hndl);
if (implicit_datasets != NULL)
implicit_len = strlen(implicit_datasets);
@@ -3557,12 +3471,12 @@ get_datasets(zlog_t *zlogp, char **bufp, size_t *bufsizep)
goto out;
}
- if (zonecfg_setdsent(handle) != Z_OK) {
+ if (zonecfg_setdsent(snap_hndl) != Z_OK) {
zerror(zlogp, B_FALSE, "%s failed", "zonecfg_setdsent");
goto out;
}
offset = 0;
- while (zonecfg_getdsent(handle, &dstab) == Z_OK) {
+ while (zonecfg_getdsent(snap_hndl, &dstab) == Z_OK) {
len = strlen(dstab.zone_dataset_name);
(void) strlcpy(str + offset, dstab.zone_dataset_name,
total - offset);
@@ -3570,7 +3484,7 @@ get_datasets(zlog_t *zlogp, char **bufp, size_t *bufsizep)
if (offset < total - 1)
str[offset++] = ',';
}
- (void) zonecfg_enddsent(handle);
+ (void) zonecfg_enddsent(snap_hndl);
if (implicit_len > 0)
(void) strlcpy(str + offset, implicit_datasets, total - offset);
@@ -3582,8 +3496,6 @@ get_datasets(zlog_t *zlogp, char **bufp, size_t *bufsizep)
out:
if (error != 0 && str != NULL)
free(str);
- if (handle != NULL)
- zonecfg_fini_handle(handle);
if (implicit_datasets != NULL)
free(implicit_datasets);
@@ -3593,40 +3505,26 @@ out:
static int
validate_datasets(zlog_t *zlogp)
{
- zone_dochandle_t handle;
struct zone_dstab dstab;
zfs_handle_t *zhp;
libzfs_handle_t *hdl;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (-1);
- }
- if (zonecfg_get_snapshot_handle(zone_name, handle) != Z_OK) {
+ if (zonecfg_setdsent(snap_hndl) != Z_OK) {
zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (-1);
- }
-
- if (zonecfg_setdsent(handle) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
return (-1);
}
if ((hdl = libzfs_init()) == NULL) {
zerror(zlogp, B_FALSE, "opening ZFS library");
- zonecfg_fini_handle(handle);
return (-1);
}
- while (zonecfg_getdsent(handle, &dstab) == Z_OK) {
+ while (zonecfg_getdsent(snap_hndl, &dstab) == Z_OK) {
if ((zhp = zfs_open(hdl, dstab.zone_dataset_name,
ZFS_TYPE_FILESYSTEM)) == NULL) {
zerror(zlogp, B_FALSE, "cannot open ZFS dataset '%s'",
dstab.zone_dataset_name);
- zonecfg_fini_handle(handle);
libzfs_fini(hdl);
return (-1);
}
@@ -3641,7 +3539,6 @@ validate_datasets(zlog_t *zlogp)
zerror(zlogp, B_FALSE, "cannot set 'zoned' "
"property for ZFS dataset '%s'\n",
dstab.zone_dataset_name);
- zonecfg_fini_handle(handle);
zfs_close(zhp);
libzfs_fini(hdl);
return (-1);
@@ -3649,9 +3546,8 @@ validate_datasets(zlog_t *zlogp)
zfs_close(zhp);
}
- (void) zonecfg_enddsent(handle);
+ (void) zonecfg_enddsent(snap_hndl);
- zonecfg_fini_handle(handle);
libzfs_fini(hdl);
return (0);
@@ -4385,62 +4281,25 @@ duplicate_reachable_path(zlog_t *zlogp, const char *rootpath)
}
/*
- * Set memory cap and pool info for the zone's resource management
- * configuration.
+ * Set pool info for the zone's resource management configuration.
*/
static int
setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid)
{
int res;
uint64_t tmp;
- struct zone_mcaptab mcap;
char sched[MAXNAMELEN];
- zone_dochandle_t handle = NULL;
char pool_err[128];
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (Z_BAD_HANDLE);
- }
-
- if ((res = zonecfg_get_snapshot_handle(zone_name, handle)) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- zonecfg_fini_handle(handle);
- return (res);
- }
-
- /*
- * If a memory cap is configured, set the cap in the kernel using
- * zone_setattr() and make sure the rcapd SMF service is enabled.
- */
- if (zonecfg_getmcapent(handle, &mcap) == Z_OK) {
- uint64_t num;
- char smf_err[128];
-
- num = (uint64_t)strtoull(mcap.zone_physmem_cap, NULL, 10);
- if (zone_setattr(zoneid, ZONE_ATTR_PHYS_MCAP, &num, 0) == -1) {
- zerror(zlogp, B_TRUE, "could not set zone memory cap");
- zonecfg_fini_handle(handle);
- return (Z_INVAL);
- }
-
- if (zonecfg_enable_rcapd(smf_err, sizeof (smf_err)) != Z_OK) {
- zerror(zlogp, B_FALSE, "enabling system/rcap service "
- "failed: %s", smf_err);
- zonecfg_fini_handle(handle);
- return (Z_INVAL);
- }
- }
-
/* Get the scheduling class set in the zone configuration. */
- if (zonecfg_get_sched_class(handle, sched, sizeof (sched)) == Z_OK &&
+ if (zonecfg_get_sched_class(snap_hndl, sched, sizeof (sched)) == Z_OK &&
strlen(sched) > 0) {
if (zone_setattr(zoneid, ZONE_ATTR_SCHED_CLASS, sched,
strlen(sched)) == -1)
zerror(zlogp, B_TRUE, "WARNING: unable to set the "
"default scheduling class");
- } else if (zonecfg_get_aliased_rctl(handle, ALIAS_SHARES, &tmp)
+ } else if (zonecfg_get_aliased_rctl(snap_hndl, ALIAS_SHARES, &tmp)
== Z_OK) {
/*
* If the zone has the zone.cpu-shares rctl set then we want to
@@ -4451,7 +4310,7 @@ setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid)
*/
char class_name[PC_CLNMSZ];
- if (zonecfg_get_dflt_sched_class(handle, class_name,
+ if (zonecfg_get_dflt_sched_class(snap_hndl, class_name,
sizeof (class_name)) != Z_OK) {
zerror(zlogp, B_FALSE, "WARNING: unable to determine "
"the zone's scheduling class");
@@ -4484,7 +4343,7 @@ setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid)
* right thing in all cases (reuse or create) based on the current
* zonecfg.
*/
- if ((res = zonecfg_bind_tmp_pool(handle, zoneid, pool_err,
+ if ((res = zonecfg_bind_tmp_pool(snap_hndl, zoneid, pool_err,
sizeof (pool_err))) != Z_OK) {
if (res == Z_POOL || res == Z_POOL_CREATE || res == Z_POOL_BIND)
zerror(zlogp, B_FALSE, "%s: %s\ndedicated-cpu setting "
@@ -4493,14 +4352,13 @@ setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid)
else
zerror(zlogp, B_FALSE, "could not bind zone to "
"temporary pool: %s", zonecfg_strerror(res));
- zonecfg_fini_handle(handle);
return (Z_POOL_BIND);
}
/*
* Check if we need to warn about poold not being enabled.
*/
- if (zonecfg_warn_poold(handle)) {
+ if (zonecfg_warn_poold(snap_hndl)) {
zerror(zlogp, B_FALSE, "WARNING: A range of dedicated-cpus has "
"been specified\nbut the dynamic pool service is not "
"enabled.\nThe system will not dynamically adjust the\n"
@@ -4510,7 +4368,7 @@ setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid)
}
/* The following is a warning, not an error. */
- if ((res = zonecfg_bind_pool(handle, zoneid, pool_err,
+ if ((res = zonecfg_bind_pool(snap_hndl, zoneid, pool_err,
sizeof (pool_err))) != Z_OK) {
if (res == Z_POOL_BIND)
zerror(zlogp, B_FALSE, "WARNING: unable to bind to "
@@ -4524,10 +4382,9 @@ setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid)
}
/* Update saved pool name in case it has changed */
- (void) zonecfg_get_poolname(handle, zone_name, pool_name,
+ (void) zonecfg_get_poolname(snap_hndl, zone_name, pool_name,
sizeof (pool_name));
- zonecfg_fini_handle(handle);
return (Z_OK);
}
@@ -4589,56 +4446,67 @@ setup_zone_hostid(zone_dochandle_t handle, zlog_t *zlogp, zoneid_t zoneid)
static int
setup_zone_fs_allowed(zone_dochandle_t handle, zlog_t *zlogp, zoneid_t zoneid)
{
- char fsallowedp[ZONE_FS_ALLOWED_MAX];
+ char fsallowed[ZONE_FS_ALLOWED_MAX];
+ char *fsallowedp = fsallowed;
+ int len = sizeof (fsallowed);
int res;
- res = zonecfg_get_fs_allowed(handle, fsallowedp, sizeof (fsallowedp));
+ res = zonecfg_get_fs_allowed(handle, fsallowed, len);
if (res == Z_BAD_PROPERTY) {
- return (Z_OK);
+ /* No value, set the defaults */
+ (void) strlcpy(fsallowed, DFLT_FS_ALLOWED, len);
} else if (res != Z_OK) {
- report_prop_err(zlogp, "fs-allowed", fsallowedp, res);
+ report_prop_err(zlogp, "fs-allowed", fsallowed, res);
return (res);
+ } else if (fsallowed[0] == '-') {
+ /* dropping default privs - use remaining list */
+ if (fsallowed[1] != ',')
+ return (Z_OK);
+ fsallowedp += 2;
+ len -= 2;
+ } else {
+ /* Has a value, append the defaults */
+ if (strlcat(fsallowed, ",", len) >= len ||
+ strlcat(fsallowed, DFLT_FS_ALLOWED, len) >= len) {
+ report_prop_err(zlogp, "fs-allowed", fsallowed,
+ Z_TOO_BIG);
+ return (Z_TOO_BIG);
+ }
}
- if (zone_setattr(zoneid, ZONE_ATTR_FS_ALLOWED, &fsallowedp,
- sizeof (fsallowedp)) != 0) {
+ if (zone_setattr(zoneid, ZONE_ATTR_FS_ALLOWED, fsallowedp, len) != 0) {
zerror(zlogp, B_TRUE,
"fs-allowed couldn't be set: %s: %d", fsallowedp, res);
return (Z_SYSTEM);
}
- return (res);
+ return (Z_OK);
}
static int
-setup_zone_attrs(zlog_t *zlogp, char *zone_namep, zoneid_t zoneid)
+setup_zone_attrs(zlog_t *zlogp, zoneid_t zoneid)
{
- zone_dochandle_t handle;
int res = Z_OK;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE, "getting zone configuration handle");
- return (Z_BAD_HANDLE);
- }
- if ((res = zonecfg_get_snapshot_handle(zone_namep, handle)) != Z_OK) {
- zerror(zlogp, B_FALSE, "invalid configuration");
- goto out;
- }
-
- if ((res = setup_zone_hostid(handle, zlogp, zoneid)) != Z_OK)
+ if ((res = setup_zone_hostid(snap_hndl, zlogp, zoneid)) != Z_OK)
goto out;
- if ((res = setup_zone_fs_allowed(handle, zlogp, zoneid)) != Z_OK)
+ if ((res = setup_zone_fs_allowed(snap_hndl, zlogp, zoneid)) != Z_OK)
goto out;
out:
- zonecfg_fini_handle(handle);
return (res);
}
+/*
+ * The zone_did is a persistent debug ID. Each zone should have a unique ID
+ * in the kernel. This is used for things like DTrace which want to monitor
+ * zones across reboots. They can't use the zoneid since that changes on
+ * each boot.
+ */
zoneid_t
-vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
+vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd, zoneid_t zone_did)
{
zoneid_t rval = -1;
priv_set_t *privs;
@@ -4654,7 +4522,7 @@ vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
tsol_zcent_t *zcent = NULL;
int match = 0;
int doi = 0;
- int flags;
+ int flags = -1;
zone_iptype_t iptype;
if (zone_get_rootpath(zone_name, rootpath, sizeof (rootpath)) != Z_OK) {
@@ -4676,6 +4544,8 @@ vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
flags = ZCF_NET_EXCL;
break;
}
+ if (flags == -1)
+ abort();
if ((privs = priv_allocset()) == NULL) {
zerror(zlogp, B_TRUE, "%s failed", "priv_allocset");
@@ -4779,7 +4649,7 @@ vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
xerr = 0;
if ((zoneid = zone_create(kzone, rootpath, privs, rctlbuf,
rctlbufsz, zfsbuf, zfsbufsz, &xerr, match, doi, zlabel,
- flags)) == -1) {
+ flags, zone_did)) == -1) {
if (xerr == ZE_AREMOUNTS) {
if (zonecfg_find_mounts(rootpath, NULL, NULL) < 1) {
zerror(zlogp, B_FALSE,
@@ -4825,7 +4695,7 @@ vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
struct brand_attr attr;
char modname[MAXPATHLEN];
- if (setup_zone_attrs(zlogp, zone_name, zoneid) != Z_OK)
+ if (setup_zone_attrs(zlogp, zoneid) != Z_OK)
goto error;
if ((bh = brand_open(brand_name)) == NULL) {
@@ -4883,6 +4753,8 @@ error:
}
if (rctlbuf != NULL)
free(rctlbuf);
+ if (zfsbuf != NULL)
+ free(zfsbuf);
priv_freeset(privs);
if (fp != NULL)
zonecfg_close_scratch(fp);
@@ -5025,6 +4897,8 @@ vplat_bringup(zlog_t *zlogp, zone_mnt_t mount_cmd, zoneid_t zoneid)
return (-1);
}
break;
+ default:
+ abort();
}
}
@@ -5100,7 +4974,8 @@ unmounted:
}
int
-vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting)
+vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting,
+ boolean_t debug)
{
char *kzone;
zoneid_t zoneid;
@@ -5139,16 +5014,12 @@ vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting)
goto error;
}
- if (remove_datalink_pool(zlogp, zoneid) != 0) {
+ if (remove_datalink_pool(zlogp, zoneid) != 0)
zerror(zlogp, B_FALSE, "unable clear datalink pool property");
- goto error;
- }
- if (remove_datalink_protect(zlogp, zoneid) != 0) {
+ if (remove_datalink_protect(zlogp, zoneid) != 0)
zerror(zlogp, B_FALSE,
"unable clear datalink protect property");
- goto error;
- }
/*
* The datalinks assigned to the zone will be removed from the NGZ as
@@ -5188,7 +5059,7 @@ vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting)
brand_close(bh);
if ((strlen(cmdbuf) > EXEC_LEN) &&
- (do_subproc(zlogp, cmdbuf, NULL) != Z_OK)) {
+ (do_subproc(zlogp, cmdbuf, NULL, debug) != Z_OK)) {
zerror(zlogp, B_FALSE, "%s failed", cmdbuf);
goto error;
}
@@ -5220,12 +5091,6 @@ vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting)
}
break;
case ZS_EXCLUSIVE:
- if (unconfigure_exclusive_network_interfaces(zlogp,
- zoneid) != 0) {
- zerror(zlogp, B_FALSE, "unable to unconfigure "
- "network interfaces in zone");
- goto error;
- }
status = dladm_zone_halt(dld_handle, zoneid);
if (status != DLADM_STATUS_OK) {
zerror(zlogp, B_FALSE, "unable to notify "
@@ -5262,14 +5127,9 @@ vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting)
if (rebooting) {
struct zone_psettab pset_tab;
- zone_dochandle_t handle;
- if ((handle = zonecfg_init_handle()) != NULL &&
- zonecfg_get_handle(zone_name, handle) == Z_OK &&
- zonecfg_lookup_pset(handle, &pset_tab) == Z_OK)
+ if (zonecfg_lookup_pset(snap_hndl, &pset_tab) == Z_OK)
destroy_tmp_pool = B_FALSE;
-
- zonecfg_fini_handle(handle);
}
if (destroy_tmp_pool) {
diff --git a/usr/src/cmd/zoneadmd/zcons.c b/usr/src/cmd/zoneadmd/zcons.c
index 963bfd3100..153ccf9b62 100644
--- a/usr/src/cmd/zoneadmd/zcons.c
+++ b/usr/src/cmd/zoneadmd/zcons.c
@@ -22,7 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2012 Joyent, Inc. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -117,6 +117,8 @@
#define CONSOLE_SOCKPATH ZONES_TMPDIR "/%s.console_sock"
+#define ZCONS_RETRY 10
+
static int serverfd = -1; /* console server unix domain socket fd */
char boot_args[BOOTARGS_MAX];
char bad_boot_arg[BOOTARGS_MAX];
@@ -129,7 +131,10 @@ char bad_boot_arg[BOOTARGS_MAX];
*/
static int eventstream[2];
-
+/* flag used to cope with race creating master zcons devlink */
+static boolean_t master_zcons_failed = B_FALSE;
+/* flag to track if we've seen a state change when there is no master zcons */
+static boolean_t state_changed = B_FALSE;
int
eventstream_init()
@@ -321,7 +326,7 @@ destroy_console_devs(zlog_t *zlogp)
* interfaces to instantiate a new zone console node. We do a lot of
* sanity checking, and are careful to reuse a console if one exists.
*
- * Once the device is in the device tree, we kick devfsadm via di_init_devs()
+ * Once the device is in the device tree, we kick devfsadm via di_devlink_init()
* to ensure that the appropriate symlinks (to the master and slave console
* devices) are placed in /dev in the global zone.
*/
@@ -407,43 +412,63 @@ devlinks:
* Open the master side of the console and issue the ZC_HOLDSLAVE ioctl,
* which will cause the master to retain a reference to the slave.
* This prevents ttymon from blowing through the slave's STREAMS anchor.
+ *
+ * In very rare cases the open returns ENOENT if devfs doesn't have
+ * everything setup yet due to heavy zone startup load. Wait for
+ * 1 sec. and retry a few times. Even if we can't setup the zone's
+ * console, we still go ahead and boot the zone.
*/
(void) snprintf(conspath, sizeof (conspath), "/dev/zcons/%s/%s",
zone_name, ZCONS_MASTER_NAME);
- if ((masterfd = open(conspath, O_RDWR | O_NOCTTY)) == -1) {
+ for (i = 0; i < ZCONS_RETRY; i++) {
+ masterfd = open(conspath, O_RDWR | O_NOCTTY);
+ if (masterfd >= 0 || errno != ENOENT)
+ break;
+ (void) sleep(1);
+ }
+ if (masterfd == -1) {
zerror(zlogp, B_TRUE, "ERROR: could not open master side of "
"zone console for %s to acquire slave handle", zone_name);
- goto error;
+ master_zcons_failed = B_TRUE;
}
+
(void) snprintf(conspath, sizeof (conspath), "/dev/zcons/%s/%s",
zone_name, ZCONS_SLAVE_NAME);
- if ((slavefd = open(conspath, O_RDWR | O_NOCTTY)) == -1) {
+ for (i = 0; i < ZCONS_RETRY; i++) {
+ slavefd = open(conspath, O_RDWR | O_NOCTTY);
+ if (slavefd >= 0 || errno != ENOENT)
+ break;
+ (void) sleep(1);
+ }
+ if (slavefd == -1)
zerror(zlogp, B_TRUE, "ERROR: could not open slave side of zone"
" console for %s to acquire slave handle", zone_name);
- (void) close(masterfd);
- goto error;
- }
+
/*
* This ioctl can occasionally return ENXIO if devfs doesn't have
* everything plumbed up yet due to heavy zone startup load. Wait for
* 1 sec. and retry a few times before we fail to boot the zone.
*/
- for (i = 0; i < 5; i++) {
- if (ioctl(masterfd, ZC_HOLDSLAVE, (caddr_t)(intptr_t)slavefd)
- == 0) {
- rv = 0;
- break;
- } else if (errno != ENXIO) {
- break;
+ if (masterfd != -1 && slavefd != -1) {
+ for (i = 0; i < ZCONS_RETRY; i++) {
+ if (ioctl(masterfd, ZC_HOLDSLAVE,
+ (caddr_t)(intptr_t)slavefd) == 0) {
+ rv = 0;
+ break;
+ } else if (errno != ENXIO) {
+ break;
+ }
+ (void) sleep(1);
}
- (void) sleep(1);
+ if (rv != 0)
+ zerror(zlogp, B_TRUE, "ERROR: error while acquiring "
+ "slave handle of zone console for %s", zone_name);
}
- if (rv != 0)
- zerror(zlogp, B_TRUE, "ERROR: error while acquiring slave "
- "handle of zone console for %s", zone_name);
- (void) close(slavefd);
- (void) close(masterfd);
+ if (slavefd != -1)
+ (void) close(slavefd);
+ if (masterfd != -1)
+ (void) close(masterfd);
error:
if (ddef_hdl)
@@ -854,7 +879,6 @@ init_console(zlog_t *zlogp)
if (init_console_dev(zlogp) == -1) {
zerror(zlogp, B_FALSE,
"console setup: device initialization failed");
- return (-1);
}
if ((serverfd = init_console_sock(zlogp)) == -1) {
@@ -866,6 +890,17 @@ init_console(zlog_t *zlogp)
}
/*
+ * Maintain a simple flag that tracks if we have seen at least one state
+ * change. This is currently only used to handle the special case where we are
+ * running without a console device, which is what normally drives shutdown.
+ */
+void
+zcons_statechanged()
+{
+ state_changed = B_TRUE;
+}
+
+/*
* serve_console() is the master loop for driving console I/O. It is also the
* routine which is ultimately responsible for "pulling the plug" on zoneadmd
* when it realizes that the daemon should shut down.
@@ -883,6 +918,7 @@ serve_console(zlog_t *zlogp)
int masterfd;
zone_state_t zstate;
char conspath[MAXPATHLEN];
+ static boolean_t cons_warned = B_FALSE;
(void) snprintf(conspath, sizeof (conspath),
"/dev/zcons/%s/%s", zone_name, ZCONS_MASTER_NAME);
@@ -890,6 +926,46 @@ serve_console(zlog_t *zlogp)
for (;;) {
masterfd = open(conspath, O_RDWR|O_NONBLOCK|O_NOCTTY);
if (masterfd == -1) {
+ if (master_zcons_failed) {
+ /*
+ * If we don't have a console and the zone is
+ * not shutting down, there may have been a
+ * race/failure with devfs while creating the
+ * console. In this case we want to leave the
+ * zone up, even without a console, so
+ * periodically recheck.
+ */
+ int i;
+
+ /*
+ * In the normal flow of this loop, we use
+ * do_console_io to give things a chance to get
+ * going first. However, in this case we can't
+ * use that, so we have to wait for at least
+ * one state change before checking the state.
+ */
+ for (i = 0; i < 60; i++) {
+ if (state_changed)
+ break;
+ (void) sleep(1);
+ }
+
+ if (i < 60 && zone_get_state(zone_name,
+ &zstate) == Z_OK &&
+ (zstate == ZONE_STATE_READY ||
+ zstate == ZONE_STATE_RUNNING)) {
+ if (!cons_warned) {
+ zerror(zlogp, B_FALSE,
+ "WARNING: missing zone "
+ "console for %s",
+ zone_name);
+ cons_warned = B_TRUE;
+ }
+ (void) sleep(ZCONS_RETRY);
+ continue;
+ }
+ }
+
zerror(zlogp, B_TRUE, "failed to open console master");
(void) mutex_lock(&lock);
goto death;
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 94ab464193..c79f70fa06 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
*/
/*
@@ -106,6 +107,7 @@
static char *progname;
char *zone_name; /* zone which we are managing */
+zone_dochandle_t snap_hndl; /* handle for snapshot created when ready */
char pool_name[MAXNAMELEN];
char default_brand[MAXNAMELEN];
char brand_name[MAXNAMELEN];
@@ -113,10 +115,11 @@ boolean_t zone_isnative;
boolean_t zone_iscluster;
boolean_t zone_islabeled;
static zoneid_t zone_id;
+static zoneid_t zone_did = 0;
dladm_handle_t dld_handle = NULL;
-static char pre_statechg_hook[2 * MAXPATHLEN];
-static char post_statechg_hook[2 * MAXPATHLEN];
+char pre_statechg_hook[2 * MAXPATHLEN];
+char post_statechg_hook[2 * MAXPATHLEN];
char query_hook[2 * MAXPATHLEN];
zlog_t logsys;
@@ -138,6 +141,9 @@ boolean_t bringup_failure_recovery = B_FALSE; /* ignore certain failures */
#define DEFAULT_LOCALE "C"
+#define RSRC_NET "net"
+#define RSRC_DEV "device"
+
static const char *
z_cmd_name(zone_cmd_t zcmd)
{
@@ -273,7 +279,7 @@ filter_bootargs(zlog_t *zlogp, const char *inargs, char *outargs,
{
int argc = 0, argc_save;
int i;
- int err;
+ int err = Z_OK;
char *arg, *lasts, **argv = NULL, **argv_save;
char zonecfg_args[BOOTARGS_MAX];
char scratchargs[BOOTARGS_MAX], *sargs;
@@ -288,25 +294,10 @@ filter_bootargs(zlog_t *zlogp, const char *inargs, char *outargs,
* and use them if applicable.
*/
if (inargs == NULL || inargs[0] == '\0') {
- zone_dochandle_t handle;
- if ((handle = zonecfg_init_handle()) == NULL) {
- zerror(zlogp, B_TRUE,
- "getting zone configuration handle");
- return (Z_BAD_HANDLE);
- }
- err = zonecfg_get_snapshot_handle(zone_name, handle);
- if (err != Z_OK) {
- zerror(zlogp, B_FALSE,
- "invalid configuration snapshot");
- zonecfg_fini_handle(handle);
- return (Z_BAD_HANDLE);
- }
-
bzero(zonecfg_args, sizeof (zonecfg_args));
- (void) zonecfg_get_bootargs(handle, zonecfg_args,
+ (void) zonecfg_get_bootargs(snap_hndl, zonecfg_args,
sizeof (zonecfg_args));
inargs = zonecfg_args;
- zonecfg_fini_handle(handle);
}
if (strlen(inargs) >= BOOTARGS_MAX) {
@@ -454,7 +445,7 @@ mkzonedir(zlog_t *zlogp)
* Run the brand's pre-state change callback, if it exists.
*/
static int
-brand_prestatechg(zlog_t *zlogp, int state, int cmd)
+brand_prestatechg(zlog_t *zlogp, int state, int cmd, boolean_t debug)
{
char cmdbuf[2 * MAXPATHLEN];
const char *altroot;
@@ -467,7 +458,7 @@ brand_prestatechg(zlog_t *zlogp, int state, int cmd)
state, cmd, altroot) > sizeof (cmdbuf))
return (-1);
- if (do_subproc(zlogp, cmdbuf, NULL) != 0)
+ if (do_subproc(zlogp, cmdbuf, NULL, debug) != 0)
return (-1);
return (0);
@@ -477,7 +468,7 @@ brand_prestatechg(zlog_t *zlogp, int state, int cmd)
* Run the brand's post-state change callback, if it exists.
*/
static int
-brand_poststatechg(zlog_t *zlogp, int state, int cmd)
+brand_poststatechg(zlog_t *zlogp, int state, int cmd, boolean_t debug)
{
char cmdbuf[2 * MAXPATHLEN];
const char *altroot;
@@ -490,7 +481,7 @@ brand_poststatechg(zlog_t *zlogp, int state, int cmd)
state, cmd, altroot) > sizeof (cmdbuf))
return (-1);
- if (do_subproc(zlogp, cmdbuf, NULL) != 0)
+ if (do_subproc(zlogp, cmdbuf, NULL, debug) != 0)
return (-1);
return (0);
@@ -529,35 +520,44 @@ notify_zonestatd(zoneid_t zoneid)
* subcommand.
*/
static int
-zone_ready(zlog_t *zlogp, zone_mnt_t mount_cmd, int zstate)
+zone_ready(zlog_t *zlogp, zone_mnt_t mount_cmd, int zstate, boolean_t debug)
{
int err;
+ boolean_t snapped = B_FALSE;
- if (brand_prestatechg(zlogp, zstate, Z_READY) != 0)
- return (-1);
-
+ if ((snap_hndl = zonecfg_init_handle()) == NULL) {
+ zerror(zlogp, B_TRUE, "getting zone configuration handle");
+ goto bad;
+ }
if ((err = zonecfg_create_snapshot(zone_name)) != Z_OK) {
zerror(zlogp, B_FALSE, "unable to create snapshot: %s",
zonecfg_strerror(err));
goto bad;
}
+ snapped = B_TRUE;
- if ((zone_id = vplat_create(zlogp, mount_cmd)) == -1) {
- if ((err = zonecfg_destroy_snapshot(zone_name)) != Z_OK)
- zerror(zlogp, B_FALSE, "destroying snapshot: %s",
- zonecfg_strerror(err));
+ if (zonecfg_get_snapshot_handle(zone_name, snap_hndl) != Z_OK) {
+ zerror(zlogp, B_FALSE, "invalid configuration snapshot");
goto bad;
}
+
+ if (zone_did == 0)
+ zone_did = zone_get_did(zone_name);
+
+ if (brand_prestatechg(zlogp, zstate, Z_READY, debug) != 0)
+ goto bad;
+
+ if ((zone_id = vplat_create(zlogp, mount_cmd, zone_did)) == -1)
+ goto bad;
+
if (vplat_bringup(zlogp, mount_cmd, zone_id) != 0) {
bringup_failure_recovery = B_TRUE;
- (void) vplat_teardown(NULL, (mount_cmd != Z_MNT_BOOT), B_FALSE);
- if ((err = zonecfg_destroy_snapshot(zone_name)) != Z_OK)
- zerror(zlogp, B_FALSE, "destroying snapshot: %s",
- zonecfg_strerror(err));
+ (void) vplat_teardown(NULL, (mount_cmd != Z_MNT_BOOT), B_FALSE,
+ debug);
goto bad;
}
- if (brand_poststatechg(zlogp, zstate, Z_READY) != 0)
+ if (brand_poststatechg(zlogp, zstate, Z_READY, debug) != 0)
goto bad;
return (0);
@@ -567,7 +567,13 @@ bad:
* If something goes wrong, we up the zones's state to the target
* state, READY, and then invoke the hook as if we're halting.
*/
- (void) brand_poststatechg(zlogp, ZONE_STATE_READY, Z_HALT);
+ (void) brand_poststatechg(zlogp, ZONE_STATE_READY, Z_HALT, debug);
+ if (snapped)
+ if ((err = zonecfg_destroy_snapshot(zone_name)) != Z_OK)
+ zerror(zlogp, B_FALSE, "destroying snapshot: %s",
+ zonecfg_strerror(err));
+ zonecfg_fini_handle(snap_hndl);
+ snap_hndl = NULL;
return (-1);
}
@@ -682,6 +688,8 @@ mount_early_fs(void *data, const char *spec, const char *dir,
char opt_buf[MAX_MNTOPT_STR];
int optlen = 0;
int mflag = MS_DATA;
+ int i;
+ int ret;
(void) ct_tmpl_clear(tmpl_fd);
/*
@@ -709,9 +717,26 @@ mount_early_fs(void *data, const char *spec, const char *dir,
optlen = MAX_MNTOPT_STR;
mflag = MS_OPTIONSTR;
}
- if (mount(spec, dir, mflag, fstype, NULL, 0, opt, optlen) != 0)
- _exit(errno);
- _exit(0);
+
+ /*
+ * There is an obscure race condition which can cause mount
+ * to return EBUSY. This happens for example on the mount
+ * of the zone's /etc/svc/volatile file system if there is
+ * a GZ process running svcs -Z, which will touch the
+ * mountpoint, just as we're trying to do the mount. To cope
+ * with this, we retry up to 3 times to let this transient
+ * process get out of the way.
+ */
+ for (i = 0; i < 3; i++) {
+ ret = 0;
+ if (mount(spec, dir, mflag, fstype, NULL, 0, opt,
+ optlen) != 0)
+ ret = errno;
+ if (ret != EBUSY)
+ break;
+ (void) sleep(1);
+ }
+ _exit(ret);
}
/* parent */
@@ -735,12 +760,150 @@ mount_early_fs(void *data, const char *spec, const char *dir,
}
/*
+ * env variable name format
+ * _ZONECFG_{resource name}_{identifying attr. name}_{property name}
+ * Any dashes (-) in the property names are replaced with underscore (_).
+ */
+static void
+set_zonecfg_env(char *rsrc, char *attr, char *name, char *val)
+{
+ char *p;
+ char nm[MAXNAMELEN];
+
+ if (attr == NULL)
+ (void) snprintf(nm, sizeof (nm), "_ZONECFG_%s_%s", rsrc,
+ name);
+ else
+ (void) snprintf(nm, sizeof (nm), "_ZONECFG_%s_%s_%s", rsrc,
+ attr, name);
+
+ p = nm;
+ while ((p = strchr(p, '-')) != NULL)
+ *p++ = '_';
+
+ (void) setenv(nm, val, 1);
+}
+
+/*
+ * Export zonecfg network and device properties into environment for the boot
+ * and state change hooks.
+ * If debug is true, export the brand hook debug env. variable as well.
+ *
+ * We could export more of the config in the future, as necessary.
+ */
+static int
+setup_subproc_env(boolean_t debug)
+{
+ int res;
+ struct zone_nwiftab ntab;
+ struct zone_devtab dtab;
+ struct zone_attrtab atab;
+ char net_resources[MAXNAMELEN * 2];
+ char dev_resources[MAXNAMELEN * 2];
+
+ /* snap_hndl is null when called through the set_brand_env code path */
+ if (snap_hndl == NULL)
+ return (Z_OK);
+
+ net_resources[0] = '\0';
+ if ((res = zonecfg_setnwifent(snap_hndl)) != Z_OK)
+ goto done;
+
+ while (zonecfg_getnwifent(snap_hndl, &ntab) == Z_OK) {
+ struct zone_res_attrtab *rap;
+ char *phys;
+
+ phys = ntab.zone_nwif_physical;
+
+ (void) strlcat(net_resources, phys, sizeof (net_resources));
+ (void) strlcat(net_resources, " ", sizeof (net_resources));
+
+ set_zonecfg_env(RSRC_NET, phys, "physical", phys);
+
+ set_zonecfg_env(RSRC_NET, phys, "address",
+ ntab.zone_nwif_address);
+ set_zonecfg_env(RSRC_NET, phys, "allowed-address",
+ ntab.zone_nwif_allowed_address);
+ set_zonecfg_env(RSRC_NET, phys, "defrouter",
+ ntab.zone_nwif_defrouter);
+ set_zonecfg_env(RSRC_NET, phys, "global-nic",
+ ntab.zone_nwif_gnic);
+ set_zonecfg_env(RSRC_NET, phys, "mac-addr", ntab.zone_nwif_mac);
+ set_zonecfg_env(RSRC_NET, phys, "vlan-id",
+ ntab.zone_nwif_vlan_id);
+
+ for (rap = ntab.zone_nwif_attrp; rap != NULL;
+ rap = rap->zone_res_attr_next)
+ set_zonecfg_env(RSRC_NET, phys, rap->zone_res_attr_name,
+ rap->zone_res_attr_value);
+ nwifent_free_attrs(&ntab);
+ }
+
+ (void) setenv("_ZONECFG_net_resources", net_resources, 1);
+
+ (void) zonecfg_endnwifent(snap_hndl);
+
+ if ((res = zonecfg_setdevent(snap_hndl)) != Z_OK)
+ goto done;
+
+ while (zonecfg_getdevent(snap_hndl, &dtab) == Z_OK) {
+ struct zone_res_attrtab *rap;
+ char *match;
+
+ match = dtab.zone_dev_match;
+
+ (void) strlcat(dev_resources, match, sizeof (dev_resources));
+ (void) strlcat(dev_resources, " ", sizeof (dev_resources));
+
+ for (rap = dtab.zone_dev_attrp; rap != NULL;
+ rap = rap->zone_res_attr_next)
+ set_zonecfg_env(RSRC_DEV, match,
+ rap->zone_res_attr_name, rap->zone_res_attr_value);
+ }
+
+ (void) zonecfg_enddevent(snap_hndl);
+
+ if ((res = zonecfg_setattrent(snap_hndl)) != Z_OK)
+ goto done;
+
+ while (zonecfg_getattrent(snap_hndl, &atab) == Z_OK) {
+ set_zonecfg_env("attr", NULL, atab.zone_attr_name,
+ atab.zone_attr_value);
+ }
+
+ (void) zonecfg_endattrent(snap_hndl);
+
+ if (debug)
+ (void) setenv("_ZONEADMD_brand_debug", "1", 1);
+ else
+ (void) setenv("_ZONEADMD_brand_debug", "", 1);
+
+ res = Z_OK;
+
+done:
+ return (res);
+}
+
+void
+nwifent_free_attrs(struct zone_nwiftab *np)
+{
+ struct zone_res_attrtab *rap;
+
+ for (rap = np->zone_nwif_attrp; rap != NULL; ) {
+ struct zone_res_attrtab *tp = rap;
+
+ rap = rap->zone_res_attr_next;
+ free(tp);
+ }
+}
+
+/*
* If retstr is not NULL, the output of the subproc is returned in the str,
* otherwise it is output using zerror(). Any memory allocated for retstr
* should be freed by the caller.
*/
int
-do_subproc(zlog_t *zlogp, char *cmdbuf, char **retstr)
+do_subproc(zlog_t *zlogp, char *cmdbuf, char **retstr, boolean_t debug)
{
char buf[1024]; /* arbitrary large amount */
char *inbuf;
@@ -759,6 +922,11 @@ do_subproc(zlog_t *zlogp, char *cmdbuf, char **retstr)
inbuf = buf;
}
+ if (setup_subproc_env(debug) != Z_OK) {
+ zerror(zlogp, B_FALSE, "failed to setup environment");
+ return (-1);
+ }
+
file = popen(cmdbuf, "r");
if (file == NULL) {
zerror(zlogp, B_TRUE, "could not launch: %s", cmdbuf);
@@ -767,8 +935,13 @@ do_subproc(zlog_t *zlogp, char *cmdbuf, char **retstr)
while (fgets(inbuf, 1024, file) != NULL) {
if (retstr == NULL) {
- if (zlogp != &logsys)
+ if (zlogp != &logsys) {
+ int last = strlen(inbuf) - 1;
+
+ if (inbuf[last] == '\n')
+ inbuf[last] = '\0';
zerror(zlogp, B_FALSE, "%s", inbuf);
+ }
} else {
char *p;
@@ -798,8 +971,51 @@ do_subproc(zlog_t *zlogp, char *cmdbuf, char **retstr)
return (WEXITSTATUS(status));
}
+/*
+ * Get the path for this zone's init(1M) (or equivalent) process. First look
+ * for a zone-specific init-name attr, then get it from the brand.
+ */
static int
-zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate)
+get_initname(brand_handle_t bh, char *initname, int len)
+{
+ struct zone_attrtab a;
+
+ bzero(&a, sizeof (a));
+ (void) strlcpy(a.zone_attr_name, "init-name",
+ sizeof (a.zone_attr_name));
+
+ if (zonecfg_lookup_attr(snap_hndl, &a) == Z_OK) {
+ (void) strlcpy(initname, a.zone_attr_value, len);
+ return (0);
+ }
+
+ return (brand_get_initname(bh, initname, len));
+}
+
+/*
+ * Get the restart-init flag for this zone's init(1M) (or equivalent) process.
+ * First look for a zone-specific restart-init attr, then get it from the brand.
+ */
+static boolean_t
+restartinit(brand_handle_t bh)
+{
+ struct zone_attrtab a;
+
+ bzero(&a, sizeof (a));
+ (void) strlcpy(a.zone_attr_name, "restart-init",
+ sizeof (a.zone_attr_name));
+
+ if (zonecfg_lookup_attr(snap_hndl, &a) == Z_OK) {
+ if (strcmp(a.zone_attr_value, "false") == 0)
+ return (B_FALSE);
+ return (B_TRUE);
+ }
+
+ return (brand_restartinit(bh));
+}
+
+static int
+zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate, boolean_t debug)
{
zoneid_t zoneid;
struct stat st;
@@ -813,8 +1029,9 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate)
dladm_status_t status;
char errmsg[DLADM_STRSIZE];
int err;
+ boolean_t restart_init;
- if (brand_prestatechg(zlogp, zstate, Z_BOOT) != 0)
+ if (brand_prestatechg(zlogp, zstate, Z_BOOT, debug) != 0)
return (-1);
if ((zoneid = getzoneidbyname(zone_name)) == -1) {
@@ -862,13 +1079,16 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate)
}
/* Get the path for this zone's init(1M) (or equivalent) process. */
- if (brand_get_initname(bh, init_file, MAXPATHLEN) != 0) {
+ if (get_initname(bh, init_file, MAXPATHLEN) != 0) {
zerror(zlogp, B_FALSE,
"unable to determine zone's init(1M) location");
brand_close(bh);
goto bad;
}
+ /* See if we should restart init if it dies. */
+ restart_init = restartinit(bh);
+
brand_close(bh);
err = filter_bootargs(zlogp, bootargs, nbootargs, init_file,
@@ -920,7 +1140,7 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate)
* is booted.
*/
if ((strlen(cmdbuf) > EXEC_LEN) &&
- (do_subproc(zlogp, cmdbuf, NULL) != Z_OK)) {
+ (do_subproc(zlogp, cmdbuf, NULL, debug) != Z_OK)) {
zerror(zlogp, B_FALSE, "%s failed", cmdbuf);
goto bad;
}
@@ -935,6 +1155,12 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate)
goto bad;
}
+ if (!restart_init && zone_setattr(zoneid, ZONE_ATTR_INITNORESTART,
+ NULL, 0) == -1) {
+ zerror(zlogp, B_TRUE, "could not set zone init-no-restart");
+ goto bad;
+ }
+
/*
* Inform zonestatd of a new zone so that it can install a door for
* the zone to contact it.
@@ -946,9 +1172,12 @@ zone_bootup(zlog_t *zlogp, const char *bootargs, int zstate)
goto bad;
}
- if (brand_poststatechg(zlogp, zstate, Z_BOOT) != 0)
+ if (brand_poststatechg(zlogp, zstate, Z_BOOT, debug) != 0)
goto bad;
+ /* Startup a thread to perform memory capping for the zone. */
+ create_mcap_thread(zlogp, zone_id);
+
return (0);
bad:
@@ -956,32 +1185,39 @@ bad:
* If something goes wrong, we up the zones's state to the target
* state, RUNNING, and then invoke the hook as if we're halting.
*/
- (void) brand_poststatechg(zlogp, ZONE_STATE_RUNNING, Z_HALT);
+ (void) brand_poststatechg(zlogp, ZONE_STATE_RUNNING, Z_HALT, debug);
if (links_loaded)
(void) dladm_zone_halt(dld_handle, zoneid);
return (-1);
}
static int
-zone_halt(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting, int zstate)
+zone_halt(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting, int zstate,
+ boolean_t debug)
{
int err;
- if (brand_prestatechg(zlogp, zstate, Z_HALT) != 0)
+ if (brand_prestatechg(zlogp, zstate, Z_HALT, debug) != 0)
return (-1);
- if (vplat_teardown(zlogp, unmount_cmd, rebooting) != 0) {
+ /* Shutting down, stop the memcap thread */
+ destroy_mcap_thread();
+
+ if (vplat_teardown(zlogp, unmount_cmd, rebooting, debug) != 0) {
if (!bringup_failure_recovery)
zerror(zlogp, B_FALSE, "unable to destroy zone");
return (-1);
}
+ if (brand_poststatechg(zlogp, zstate, Z_HALT, debug) != 0)
+ return (-1);
+
if ((err = zonecfg_destroy_snapshot(zone_name)) != Z_OK)
zerror(zlogp, B_FALSE, "destroying snapshot: %s",
zonecfg_strerror(err));
- if (brand_poststatechg(zlogp, zstate, Z_HALT) != 0)
- return (-1);
+ zonecfg_fini_handle(snap_hndl);
+ snap_hndl = NULL;
return (0);
}
@@ -1048,9 +1284,10 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
zone_state_t zstate;
zone_cmd_t cmd;
+ boolean_t debug;
zone_cmd_arg_t *zargp;
- boolean_t kernelcall;
+ boolean_t kernelcall = B_TRUE;
int rval = -1;
uint64_t uniqid;
@@ -1099,6 +1336,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
goto out;
}
cmd = zargp->cmd;
+ debug = zargp->debug;
if (door_ucred(&uc) != 0) {
zerror(&logsys, B_TRUE, "door_ucred");
@@ -1204,23 +1442,25 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
case ZONE_STATE_INSTALLED:
switch (cmd) {
case Z_READY:
- rval = zone_ready(zlogp, Z_MNT_BOOT, zstate);
+ rval = zone_ready(zlogp, Z_MNT_BOOT, zstate, debug);
if (rval == 0)
eventstream_write(Z_EVT_ZONE_READIED);
+ zcons_statechanged();
break;
case Z_BOOT:
case Z_FORCEBOOT:
eventstream_write(Z_EVT_ZONE_BOOTING);
- if ((rval = zone_ready(zlogp, Z_MNT_BOOT, zstate))
- == 0) {
+ if ((rval = zone_ready(zlogp, Z_MNT_BOOT, zstate,
+ debug)) == 0) {
rval = zone_bootup(zlogp, zargp->bootbuf,
- zstate);
+ zstate, debug);
}
audit_put_record(zlogp, uc, rval, "boot");
+ zcons_statechanged();
if (rval != 0) {
bringup_failure_recovery = B_TRUE;
(void) zone_halt(zlogp, B_FALSE, B_FALSE,
- zstate);
+ zstate, debug);
eventstream_write(Z_EVT_ZONE_BOOTFAILED);
}
break;
@@ -1271,7 +1511,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
rval = zone_ready(zlogp,
strcmp(zargp->bootbuf, "-U") == 0 ?
- Z_MNT_UPDATE : Z_MNT_SCRATCH, zstate);
+ Z_MNT_UPDATE : Z_MNT_SCRATCH, zstate, debug);
if (rval != 0)
break;
@@ -1333,15 +1573,18 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
rval = 0;
break;
case Z_BOOT:
+ case Z_FORCEBOOT:
(void) strlcpy(boot_args, zargp->bootbuf,
sizeof (boot_args));
eventstream_write(Z_EVT_ZONE_BOOTING);
- rval = zone_bootup(zlogp, zargp->bootbuf, zstate);
+ rval = zone_bootup(zlogp, zargp->bootbuf, zstate,
+ debug);
audit_put_record(zlogp, uc, rval, "boot");
+ zcons_statechanged();
if (rval != 0) {
bringup_failure_recovery = B_TRUE;
(void) zone_halt(zlogp, B_FALSE, B_TRUE,
- zstate);
+ zstate, debug);
eventstream_write(Z_EVT_ZONE_BOOTFAILED);
}
boot_args[0] = '\0';
@@ -1349,14 +1592,16 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
case Z_HALT:
if (kernelcall) /* Invalid; can't happen */
abort();
- if ((rval = zone_halt(zlogp, B_FALSE, B_FALSE, zstate))
- != 0)
+ if ((rval = zone_halt(zlogp, B_FALSE, B_FALSE, zstate,
+ debug)) != 0)
break;
+ zcons_statechanged();
eventstream_write(Z_EVT_ZONE_HALTED);
break;
case Z_REBOOT:
case Z_NOTE_UNINSTALLING:
case Z_MOUNT:
+ case Z_FORCEMOUNT:
case Z_UNMOUNT:
if (kernelcall) /* Invalid; can't happen */
abort();
@@ -1373,7 +1618,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
case Z_UNMOUNT:
if (kernelcall) /* Invalid; can't happen */
abort();
- rval = zone_halt(zlogp, B_TRUE, B_FALSE, zstate);
+ rval = zone_halt(zlogp, B_TRUE, B_FALSE, zstate, debug);
if (rval == 0) {
eventstream_write(Z_EVT_ZONE_HALTED);
(void) sema_post(&scratch_sem);
@@ -1395,15 +1640,18 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
case ZONE_STATE_DOWN:
switch (cmd) {
case Z_READY:
- if ((rval = zone_halt(zlogp, B_FALSE, B_TRUE, zstate))
- != 0)
+ if ((rval = zone_halt(zlogp, B_FALSE, B_TRUE, zstate,
+ debug)) != 0)
break;
- if ((rval = zone_ready(zlogp, Z_MNT_BOOT, zstate)) == 0)
+ zcons_statechanged();
+ if ((rval = zone_ready(zlogp, Z_MNT_BOOT, zstate,
+ debug)) == 0)
eventstream_write(Z_EVT_ZONE_READIED);
else
eventstream_write(Z_EVT_ZONE_HALTED);
break;
case Z_BOOT:
+ case Z_FORCEBOOT:
/*
* We could have two clients racing to boot this
* zone; the second client loses, but his request
@@ -1414,38 +1662,42 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
rval = 0;
break;
case Z_HALT:
- if ((rval = zone_halt(zlogp, B_FALSE, B_FALSE, zstate))
- != 0)
+ if ((rval = zone_halt(zlogp, B_FALSE, B_FALSE, zstate,
+ debug)) != 0)
break;
eventstream_write(Z_EVT_ZONE_HALTED);
+ zcons_statechanged();
break;
case Z_REBOOT:
(void) strlcpy(boot_args, zargp->bootbuf,
sizeof (boot_args));
eventstream_write(Z_EVT_ZONE_REBOOTING);
- if ((rval = zone_halt(zlogp, B_FALSE, B_TRUE, zstate))
- != 0) {
+ if ((rval = zone_halt(zlogp, B_FALSE, B_TRUE, zstate,
+ debug)) != 0) {
eventstream_write(Z_EVT_ZONE_BOOTFAILED);
boot_args[0] = '\0';
break;
}
- if ((rval = zone_ready(zlogp, Z_MNT_BOOT, zstate))
- != 0) {
+ zcons_statechanged();
+ if ((rval = zone_ready(zlogp, Z_MNT_BOOT, zstate,
+ debug)) != 0) {
eventstream_write(Z_EVT_ZONE_BOOTFAILED);
boot_args[0] = '\0';
break;
}
- rval = zone_bootup(zlogp, zargp->bootbuf, zstate);
+ rval = zone_bootup(zlogp, zargp->bootbuf, zstate,
+ debug);
audit_put_record(zlogp, uc, rval, "reboot");
if (rval != 0) {
(void) zone_halt(zlogp, B_FALSE, B_TRUE,
- zstate);
+ zstate, debug);
eventstream_write(Z_EVT_ZONE_BOOTFAILED);
}
boot_args[0] = '\0';
break;
case Z_NOTE_UNINSTALLING:
case Z_MOUNT:
+ case Z_FORCEMOUNT:
case Z_UNMOUNT:
zerror(zlogp, B_FALSE, "%s operation is invalid "
"for zones in state '%s'", z_cmd_name(cmd),
@@ -1604,11 +1856,34 @@ top:
* state.
*/
if (zstate > ZONE_STATE_INSTALLED) {
+ static zoneid_t zid;
+
zerror(zlogp, B_FALSE,
"zone '%s': WARNING: zone is in state '%s', but "
"zoneadmd does not appear to be available; "
"restarted zoneadmd to recover.",
zone_name, zone_state_str(zstate));
+
+ /*
+ * Startup a thread to perform memory capping for the
+ * zone.
+ */
+ if ((zid = getzoneidbyname(zone_name)) != -1)
+ create_mcap_thread(zlogp, zid);
+
+ /* recover the global configuration snapshot */
+ if (snap_hndl == NULL) {
+ if ((snap_hndl = zonecfg_init_handle())
+ == NULL ||
+ zonecfg_create_snapshot(zone_name)
+ != Z_OK ||
+ zonecfg_get_snapshot_handle(zone_name,
+ snap_hndl) != Z_OK) {
+ zerror(zlogp, B_FALSE, "recovering "
+ "zone configuration handle");
+ goto out;
+ }
+ }
}
(void) fdetach(zone_door_path);
@@ -1622,6 +1897,52 @@ out:
}
/*
+ * Run the query hook with the 'env' parameter. It should return a
+ * string of tab-delimited key-value pairs, each of which should be set
+ * in the environment.
+ *
+ * Because the env_vars string values become part of the environment, the
+ * string is static and we don't free it.
+ *
+ * This function is always called before zoneadmd forks and makes itself
+ * exclusive, so it is possible there could more than one instance of zoneadmd
+ * running in parallel at this point. Thus, we have no zonecfg snapshot and
+ * shouldn't take one yet (i.e. snap_hndl is NULL). Thats ok, since we don't
+ * need any zonecfg info to query for a brand-specific env value.
+ */
+static int
+set_brand_env(zlog_t *zlogp)
+{
+ int ret = 0;
+ static char *env_vars = NULL;
+ char buf[2 * MAXPATHLEN];
+
+ if (query_hook[0] == '\0' || env_vars != NULL)
+ return (0);
+
+ if (snprintf(buf, sizeof (buf), "%s env", query_hook) > sizeof (buf))
+ return (-1);
+
+ if (do_subproc(zlogp, buf, &env_vars, B_FALSE) != 0)
+ return (-1);
+
+ if (env_vars != NULL) {
+ char *sp;
+
+ sp = strtok(env_vars, "\t");
+ while (sp != NULL) {
+ if (putenv(sp) != 0) {
+ ret = -1;
+ break;
+ }
+ sp = strtok(NULL, "\t");
+ }
+ }
+
+ return (ret);
+}
+
+/*
* Setup the brand's pre and post state change callbacks, as well as the
* query callback, if any of these exist.
*/
@@ -1857,6 +2178,11 @@ main(int argc, char *argv[])
}
priv_freeset(privset);
+ if (set_brand_env(zlogp) != 0) {
+ zerror(zlogp, B_FALSE, "Unable to setup brand's environment");
+ return (1);
+ }
+
if (mkzonedir(zlogp) != 0)
return (1);
@@ -1897,6 +2223,13 @@ main(int argc, char *argv[])
(void) sigaddset(&block_cld, SIGCHLD);
(void) sigprocmask(SIG_BLOCK, &block_cld, NULL);
+ /*
+ * The parent only needs stderr after the fork, so close other fd's
+ * that we inherited from zoneadm so that the parent doesn't have those
+ * open while waiting. The child will close the rest after the fork.
+ */
+ closefrom(3);
+
if ((ctfd = init_template()) == -1) {
zerror(zlogp, B_TRUE, "failed to create contract");
return (1);
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.h b/usr/src/cmd/zoneadmd/zoneadmd.h
index 63b23481d2..230d6603eb 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.h
+++ b/usr/src/cmd/zoneadmd/zoneadmd.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
*/
#ifndef _ZONEADMD_H
@@ -85,6 +86,7 @@ extern mutex_t msglock;
extern boolean_t in_death_throes;
extern boolean_t bringup_failure_recovery;
extern char *zone_name;
+extern zone_dochandle_t snap_hndl;
extern char pool_name[MAXNAMELEN];
extern char brand_name[MAXNAMELEN];
extern char default_brand[MAXNAMELEN];
@@ -96,6 +98,7 @@ extern dladm_handle_t dld_handle;
extern void zerror(zlog_t *, boolean_t, const char *, ...);
extern char *localize_msg(char *locale, const char *msg);
+extern void nwifent_free_attrs(struct zone_nwiftab *);
/*
* Eventstream interfaces.
@@ -130,9 +133,9 @@ typedef enum {
/*
* Virtual platform interfaces.
*/
-extern zoneid_t vplat_create(zlog_t *, zone_mnt_t);
+extern zoneid_t vplat_create(zlog_t *, zone_mnt_t, zoneid_t);
extern int vplat_bringup(zlog_t *, zone_mnt_t, zoneid_t);
-extern int vplat_teardown(zlog_t *, boolean_t, boolean_t);
+extern int vplat_teardown(zlog_t *, boolean_t, boolean_t, boolean_t);
extern int vplat_get_iptype(zlog_t *, zone_iptype_t *);
/*
@@ -149,6 +152,13 @@ extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen);
*/
extern int init_console(zlog_t *);
extern void serve_console(zlog_t *);
+extern void zcons_statechanged();
+
+/*
+ * Memory capping thread creation.
+ */
+extern void create_mcap_thread(zlog_t *, zoneid_t);
+extern void destroy_mcap_thread();
/*
* Contract handling.
@@ -158,7 +168,7 @@ extern int init_template(void);
/*
* Routine to manage child processes.
*/
-extern int do_subproc(zlog_t *, char *, char **);
+extern int do_subproc(zlog_t *, char *, char **, boolean_t);
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/zonecfg/Makefile b/usr/src/cmd/zonecfg/Makefile
index ae8f5c11d1..94d725776b 100644
--- a/usr/src/cmd/zonecfg/Makefile
+++ b/usr/src/cmd/zonecfg/Makefile
@@ -27,6 +27,7 @@ PROG= zonecfg
OBJS= zonecfg.o zonecfg_lex.o zonecfg_grammar.tab.o
include ../Makefile.cmd
+include ../Makefile.ctf
# zonecfg has a name clash with main() and libl.so.1. However, zonecfg must
# still export a number of "yy*" (libl) interfaces. Reduce all other symbols
@@ -36,7 +37,7 @@ MAPOPTS = $(MAPFILES:%=-M%)
LFLAGS = -t
YFLAGS = -d -b zonecfg_grammar
-LDLIBS += -lzonecfg -ll -lnsl -ltecla -lzfs -lbrand -ldladm -linetutil
+LDLIBS += -lzonecfg -ll -lnsl -ltecla -lzfs -lbrand -ldladm -linetutil -luuid
CPPFLAGS += -I.
LDFLAGS += $(MAPOPTS)
CLEANFILES += zonecfg_lex.c zonecfg_grammar.tab.c zonecfg_grammar.tab.h
diff --git a/usr/src/cmd/zonecfg/zonecfg.c b/usr/src/cmd/zonecfg/zonecfg.c
index 7a6e3cdcef..dcd1d42a42 100644
--- a/usr/src/cmd/zonecfg/zonecfg.c
+++ b/usr/src/cmd/zonecfg/zonecfg.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent Inc. All rights reserved.
*/
/*
@@ -77,6 +78,7 @@
#include <libinetutil.h>
#include <pwd.h>
#include <inet/ip.h>
+#include <uuid/uuid.h>
#include <libzonecfg.h>
#include "zonecfg.h"
@@ -124,7 +126,7 @@ extern int lex_lineno;
#define SHELP_REMOVE "remove [-F] <resource-type> " \
"[ <property-name>=<property-value> ]*\n" \
"\t(global scope)\n" \
- "remove <property-name> <property-value>\n" \
+ "remove [-F] <property-name> <property-value>\n" \
"\t(resource scope)"
#define SHELP_REVERT "revert [-F]"
#define SHELP_SELECT "select <resource-type> { <property-name>=" \
@@ -185,6 +187,8 @@ char *res_types[] = {
"admin",
"fs-allowed",
ALIAS_MAXPROCS,
+ ALIAS_ZFSPRI,
+ "uuid",
NULL
};
@@ -232,6 +236,12 @@ char *prop_types[] = {
"fs-allowed",
ALIAS_MAXPROCS,
"allowed-address",
+ ALIAS_ZFSPRI,
+ "mac-addr",
+ "vlan-id",
+ "global-nic",
+ "property",
+ "uuid",
NULL
};
@@ -297,6 +307,7 @@ static const char *clear_cmds[] = {
"clear " ALIAS_MAXSEMIDS,
"clear " ALIAS_SHARES,
"clear " ALIAS_MAXPROCS,
+ "clear " ALIAS_ZFSPRI,
NULL
};
@@ -347,6 +358,8 @@ static const char *set_cmds[] = {
"set hostid=",
"set fs-allowed=",
"set " ALIAS_MAXPROCS "=",
+ "set " ALIAS_ZFSPRI "=",
+ "set uuid=",
NULL
};
@@ -379,6 +392,7 @@ static const char *info_cmds[] = {
"info admin",
"info fs-allowed",
"info max-processes",
+ "info uuid",
NULL
};
@@ -404,9 +418,20 @@ static const char *net_res_scope_cmds[] = {
"exit",
"help",
"info",
+ "add property ",
+ "clear allowed-address",
+ "clear defrouter",
+ "clear global-nic",
+ "clear mac-addr",
+ "clear vlan-id",
+ "remove property ",
"set address=",
- "set physical=",
+ "set allowed-address=",
"set defrouter=",
+ "set global-nic=",
+ "set mac-addr=",
+ "set physical=",
+ "set vlan-id=",
NULL
};
@@ -416,6 +441,7 @@ static const char *device_res_scope_cmds[] = {
"exit",
"help",
"info",
+ "add property ",
"set match=",
NULL
};
@@ -523,6 +549,7 @@ static zone_dochandle_t handle;
/* used all over the place */
static char zone[ZONENAME_MAX];
static char revert_zone[ZONENAME_MAX];
+static char new_uuid[UUID_PRINTABLE_STRING_LENGTH];
/* global brand operations */
static brand_handle_t brand;
@@ -577,7 +604,6 @@ static struct zone_rctltab old_rctltab, in_progress_rctltab;
static struct zone_attrtab old_attrtab, in_progress_attrtab;
static struct zone_dstab old_dstab, in_progress_dstab;
static struct zone_psettab old_psettab, in_progress_psettab;
-static struct zone_mcaptab old_mcaptab, in_progress_mcaptab;
static struct zone_admintab old_admintab, in_progress_admintab;
static GetLine *gl; /* The gl_get_line() resource object */
@@ -992,11 +1018,20 @@ usage(boolean_t verbose, uint_t flags)
(void) fprintf(fp, gettext("Valid commands:\n"));
(void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
pt_to_str(PT_ADDRESS), gettext("<IP-address>"));
+ (void) fprintf(fp, "\t%s %s (%s=<value>,%s=<value>)\n",
+ cmd_to_str(CMD_ADD), pt_to_str(PT_NPROP),
+ pt_to_str(PT_NAME), pt_to_str(PT_VALUE));
(void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
pt_to_str(PT_ALLOWED_ADDRESS),
gettext("<IP-address>"));
(void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
pt_to_str(PT_PHYSICAL), gettext("<interface>"));
+ (void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
+ pt_to_str(PT_MAC), gettext("<mac-address>"));
+ (void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
+ pt_to_str(PT_GNIC), gettext("<global zone NIC>"));
+ (void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
+ pt_to_str(PT_VLANID), gettext("<vlan ID>"));
(void) fprintf(fp, gettext("See ifconfig(1M) for "
"details of the <interface> string.\n"));
(void) fprintf(fp, gettext("%s %s is valid "
@@ -1004,10 +1039,12 @@ usage(boolean_t verbose, uint_t flags)
"must not be set.\n"),
cmd_to_str(CMD_SET), pt_to_str(PT_ADDRESS),
pt_to_str(PT_IPTYPE), gettext("shared"));
- (void) fprintf(fp, gettext("%s %s is valid "
- "if the %s property is set to %s, otherwise it "
- "must not be set.\n"),
- cmd_to_str(CMD_SET), pt_to_str(PT_ALLOWED_ADDRESS),
+ (void) fprintf(fp, gettext("%s (%s, %s, %s, %s) are "
+ "valid if the %s property is set to %s, otherwise "
+ "they must not be set.\n"),
+ cmd_to_str(CMD_SET),
+ pt_to_str(PT_ALLOWED_ADDRESS), pt_to_str(PT_MAC),
+ pt_to_str(PT_VLANID), pt_to_str(PT_GNIC),
pt_to_str(PT_IPTYPE), gettext("exclusive"));
(void) fprintf(fp, gettext("\t%s %s=%s\n%s %s "
"is valid if the %s or %s property is set, "
@@ -1023,6 +1060,9 @@ usage(boolean_t verbose, uint_t flags)
"used to configure a device node.\n"),
rt_to_str(resource_scope));
(void) fprintf(fp, gettext("Valid commands:\n"));
+ (void) fprintf(fp, "\t%s %s (%s=<value>,%s=<value>)\n",
+ cmd_to_str(CMD_ADD), pt_to_str(PT_NPROP),
+ pt_to_str(PT_NAME), pt_to_str(PT_VALUE));
(void) fprintf(fp, "\t%s %s=%s\n", cmd_to_str(CMD_SET),
pt_to_str(PT_MATCH), gettext("<device-path>"));
break;
@@ -1154,10 +1194,12 @@ usage(boolean_t verbose, uint_t flags)
if (flags & HELP_USAGE) {
(void) fprintf(fp, "%s:\t%s %s\n", gettext("usage"),
execname, cmd_to_str(CMD_HELP));
- (void) fprintf(fp, "\t%s -z <zone>\t\t\t(%s)\n",
+ (void) fprintf(fp, "\t%s {-z <zone>|-u <uuid>}\t\t\t(%s)\n",
execname, gettext("interactive"));
- (void) fprintf(fp, "\t%s -z <zone> <command>\n", execname);
- (void) fprintf(fp, "\t%s -z <zone> -f <command-file>\n",
+ (void) fprintf(fp, "\t%s {-z <zone>|-u <uuid>} <command>\n",
+ execname);
+ (void) fprintf(fp,
+ "\t%s {-z <zone>|-u <uuid>} -f <command-file>\n",
execname);
}
if (flags & HELP_SUBCMDS) {
@@ -1246,15 +1288,22 @@ usage(boolean_t verbose, uint_t flags)
pt_to_str(PT_MAXSEMIDS));
(void) fprintf(fp, "\t%s\t%s\n", gettext("(global)"),
pt_to_str(PT_SHARES));
+ (void) fprintf(fp, "\t%s\t%s\n", gettext("(global)"),
+ pt_to_str(PT_UUID));
+ (void) fprintf(fp, "\t%s\t%s\n", gettext("(global)"),
+ pt_to_str(PT_ZFSPRI));
(void) fprintf(fp, "\t%s\t\t%s, %s, %s, %s, %s\n",
rt_to_str(RT_FS), pt_to_str(PT_DIR),
pt_to_str(PT_SPECIAL), pt_to_str(PT_RAW),
pt_to_str(PT_TYPE), pt_to_str(PT_OPTIONS));
- (void) fprintf(fp, "\t%s\t\t%s, %s, %s|%s\n", rt_to_str(RT_NET),
+ (void) fprintf(fp, "\t%s\t\t%s, %s, %s, %s, %s, %s, %s %s\n",
+ rt_to_str(RT_NET),
pt_to_str(PT_ADDRESS), pt_to_str(PT_ALLOWED_ADDRESS),
- pt_to_str(PT_PHYSICAL), pt_to_str(PT_DEFROUTER));
- (void) fprintf(fp, "\t%s\t\t%s\n", rt_to_str(RT_DEVICE),
- pt_to_str(PT_MATCH));
+ pt_to_str(PT_GNIC), pt_to_str(PT_MAC),
+ pt_to_str(PT_PHYSICAL), pt_to_str(PT_NPROP),
+ pt_to_str(PT_VLANID), pt_to_str(PT_DEFROUTER));
+ (void) fprintf(fp, "\t%s\t\t%s, %s\n", rt_to_str(RT_DEVICE),
+ pt_to_str(PT_MATCH), pt_to_str(PT_NPROP));
(void) fprintf(fp, "\t%s\t\t%s, %s\n", rt_to_str(RT_RCTL),
pt_to_str(PT_NAME), pt_to_str(PT_VALUE));
(void) fprintf(fp, "\t%s\t\t%s, %s, %s\n", rt_to_str(RT_ATTR),
@@ -1309,6 +1358,9 @@ initialize(boolean_t handle_expected)
if (zonecfg_check_handle(handle) != Z_OK) {
if ((err = zonecfg_get_handle(zone, handle)) == Z_OK) {
got_handle = B_TRUE;
+
+ (void) zonecfg_fix_obsolete(handle);
+
if (zonecfg_get_brand(handle, brandname,
sizeof (brandname)) != Z_OK) {
zerr("Zone %s is inconsistent: missing "
@@ -1576,6 +1628,7 @@ create_func(cmd_t *cmd)
boolean_t force = B_FALSE;
boolean_t attach = B_FALSE;
boolean_t arg_err = B_FALSE;
+ uuid_t uuid;
assert(cmd != NULL);
@@ -1583,7 +1636,7 @@ create_func(cmd_t *cmd)
(void) strlcpy(zone_template, "SUNWdefault", sizeof (zone_template));
optind = 0;
- while ((arg = getopt(cmd->cmd_argc, cmd->cmd_argv, "?a:bFt:"))
+ while ((arg = getopt(cmd->cmd_argc, cmd->cmd_argv, "?a:bFt:X"))
!= EOF) {
switch (arg) {
case '?':
@@ -1609,6 +1662,17 @@ create_func(cmd_t *cmd)
(void) strlcpy(zone_template, optarg,
sizeof (zone_template));
break;
+ case 'X':
+ (void) snprintf(zone_template, sizeof (zone_template),
+ "%s/%s.xml", ZONE_CONFIG_ROOT, zone);
+ err = zonecfg_get_xml_handle(zone_template, handle);
+ if (err != Z_OK) {
+ zone_perror(execname, err, B_TRUE);
+ exit(Z_ERR);
+ }
+ got_handle = B_TRUE;
+ need_to_commit = B_TRUE;
+ return;
default:
short_usage(CMD_CREATE);
arg_err = B_TRUE;
@@ -1665,6 +1729,10 @@ create_func(cmd_t *cmd)
zonecfg_fini_handle(handle);
handle = tmphandle;
got_handle = B_TRUE;
+
+ /* Allocate a new uuid for this new zone */
+ uuid_generate(uuid);
+ uuid_unparse(uuid, new_uuid);
}
/*
@@ -1711,8 +1779,8 @@ export_func(cmd_t *cmd)
struct zone_rctltab rctltab;
struct zone_dstab dstab;
struct zone_psettab psettab;
- struct zone_mcaptab mcaptab;
struct zone_rctlvaltab *valptr;
+ struct zone_res_attrtab *rap;
struct zone_admintab admintab;
int err, arg;
char zonepath[MAXPATHLEN], outfile[MAXPATHLEN], pool[MAXNAMELEN];
@@ -1725,6 +1793,7 @@ export_func(cmd_t *cmd)
FILE *of;
boolean_t autoboot;
zone_iptype_t iptype;
+ uuid_t uuid;
boolean_t need_to_close = B_FALSE;
boolean_t arg_err = B_FALSE;
@@ -1835,6 +1904,14 @@ export_func(cmd_t *cmd)
pt_to_str(PT_FS_ALLOWED), fsallowedp);
}
+ if (zonecfg_get_uuid(zone, uuid) == Z_OK && !uuid_is_null(uuid)) {
+ char suuid[UUID_PRINTABLE_STRING_LENGTH];
+
+ uuid_unparse(uuid, suuid);
+ (void) fprintf(of, "%s %s=%s\n", cmd_to_str(CMD_SET),
+ pt_to_str(PT_UUID), suuid);
+ }
+
if ((err = zonecfg_setfsent(handle)) != Z_OK) {
zone_perror(zone, err, B_FALSE);
goto done;
@@ -1882,7 +1959,17 @@ export_func(cmd_t *cmd)
export_prop(of, PT_ALLOWED_ADDRESS,
nwiftab.zone_nwif_allowed_address);
export_prop(of, PT_PHYSICAL, nwiftab.zone_nwif_physical);
+ export_prop(of, PT_MAC, nwiftab.zone_nwif_mac);
+ export_prop(of, PT_VLANID, nwiftab.zone_nwif_vlan_id);
+ export_prop(of, PT_GNIC, nwiftab.zone_nwif_gnic);
export_prop(of, PT_DEFROUTER, nwiftab.zone_nwif_defrouter);
+ for (rap = nwiftab.zone_nwif_attrp; rap != NULL;
+ rap = rap->zone_res_attr_next) {
+ fprintf(of, "%s %s (%s=%s,%s=\"%s\")\n",
+ cmd_to_str(CMD_ADD), pt_to_str(PT_NPROP),
+ pt_to_str(PT_NAME), rap->zone_res_attr_name,
+ pt_to_str(PT_VALUE), rap->zone_res_attr_value);
+ }
(void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
}
(void) zonecfg_endnwifent(handle);
@@ -1895,21 +1982,17 @@ export_func(cmd_t *cmd)
(void) fprintf(of, "%s %s\n", cmd_to_str(CMD_ADD),
rt_to_str(RT_DEVICE));
export_prop(of, PT_MATCH, devtab.zone_dev_match);
+ for (rap = devtab.zone_dev_attrp; rap != NULL;
+ rap = rap->zone_res_attr_next) {
+ fprintf(of, "%s %s (%s=%s,%s=\"%s\")\n",
+ cmd_to_str(CMD_ADD), pt_to_str(PT_NPROP),
+ pt_to_str(PT_NAME), rap->zone_res_attr_name,
+ pt_to_str(PT_VALUE), rap->zone_res_attr_value);
+ }
(void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
}
(void) zonecfg_enddevent(handle);
- if (zonecfg_getmcapent(handle, &mcaptab) == Z_OK) {
- char buf[128];
-
- (void) fprintf(of, "%s %s\n", cmd_to_str(CMD_ADD),
- rt_to_str(RT_MCAP));
- bytes_to_units(mcaptab.zone_physmem_cap, buf, sizeof (buf));
- (void) fprintf(of, "%s %s=%s\n", cmd_to_str(CMD_SET),
- pt_to_str(PT_PHYSICAL), buf);
- (void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
- }
-
if ((err = zonecfg_setrctlent(handle)) != Z_OK) {
zone_perror(zone, err, B_FALSE);
goto done;
@@ -2063,7 +2146,6 @@ add_resource(cmd_t *cmd)
{
int type;
struct zone_psettab tmp_psettab;
- struct zone_mcaptab tmp_mcaptab;
uint64_t tmp;
uint64_t tmp_mcap;
char pool[MAXNAMELEN];
@@ -2155,9 +2237,10 @@ add_resource(cmd_t *cmd)
* Make sure there isn't already a mem-cap entry or max-swap
* or max-locked rctl.
*/
- if (zonecfg_lookup_mcap(handle, &tmp_mcaptab) == Z_OK ||
- zonecfg_get_aliased_rctl(handle, ALIAS_MAXSWAP, &tmp_mcap)
- == Z_OK ||
+ if (zonecfg_get_aliased_rctl(handle, ALIAS_MAXSWAP,
+ &tmp_mcap) == Z_OK ||
+ zonecfg_get_aliased_rctl(handle, ALIAS_MAXPHYSMEM,
+ &tmp_mcap) == Z_OK ||
zonecfg_get_aliased_rctl(handle, ALIAS_MAXLOCKEDMEM,
&tmp_mcap) == Z_OK) {
zerr(gettext("The %s resource or a related resource "
@@ -2170,7 +2253,6 @@ add_resource(cmd_t *cmd)
"to even the root user; "
"this could render the system impossible\n"
"to administer. Please use caution."));
- bzero(&in_progress_mcaptab, sizeof (in_progress_mcaptab));
return;
case RT_ADMIN:
bzero(&in_progress_admintab, sizeof (in_progress_admintab));
@@ -2273,6 +2355,68 @@ bad:
zonecfg_free_rctl_value_list(rctlvaltab);
}
+/*
+ * Resource attribute ("property" resource embedded on net or dev resource)
+ */
+static void
+do_res_attr(struct zone_res_attrtab **headp, complex_property_ptr_t cpp)
+{
+ complex_property_ptr_t cp;
+ struct zone_res_attrtab *np;
+ int err;
+ boolean_t seen_name = B_FALSE, seen_value = B_FALSE;
+
+ if ((np = calloc(1, sizeof (struct zone_res_attrtab))) == NULL) {
+ zone_perror(zone, Z_NOMEM, B_TRUE);
+ exit(Z_ERR);
+ }
+
+ for (cp = cpp; cp != NULL; cp = cp->cp_next) {
+ switch (cp->cp_type) {
+ case PT_NAME:
+ if (seen_name) {
+ zerr(gettext("%s already specified"),
+ pt_to_str(PT_NAME));
+ goto bad;
+ }
+ (void) strlcpy(np->zone_res_attr_name, cp->cp_value,
+ sizeof (np->zone_res_attr_name));
+ seen_name = B_TRUE;
+ break;
+ case PT_VALUE:
+ if (seen_value) {
+ zerr(gettext("%s already specified"),
+ pt_to_str(PT_VALUE));
+ goto bad;
+ }
+ (void) strlcpy(np->zone_res_attr_value, cp->cp_value,
+ sizeof (np->zone_res_attr_value));
+ seen_value = B_TRUE;
+ break;
+ default:
+ zone_perror(pt_to_str(PT_NPROP), Z_NO_PROPERTY_TYPE,
+ B_TRUE);
+ long_usage(CMD_ADD, B_TRUE);
+ usage(B_FALSE, HELP_PROPS);
+ zonecfg_free_res_attr_list(np);
+ return;
+ }
+ }
+
+ if (!seen_name)
+ zerr(gettext("%s not specified"), pt_to_str(PT_NAME));
+ if (!seen_value)
+ zerr(gettext("%s not specified"), pt_to_str(PT_VALUE));
+
+ err = zonecfg_add_res_attr(headp, np);
+ if (err != Z_OK)
+ zone_perror(pt_to_str(PT_NPROP), err, B_TRUE);
+ return;
+
+bad:
+ zonecfg_free_res_attr_list(np);
+}
+
static void
add_property(cmd_t *cmd)
{
@@ -2340,6 +2484,44 @@ add_property(cmd_t *cmd)
}
}
return;
+ case RT_NET:
+ if (prop_type != PT_NPROP) {
+ zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
+ B_TRUE);
+ long_usage(CMD_ADD, B_TRUE);
+ usage(B_FALSE, HELP_PROPS);
+ return;
+ }
+ pp = cmd->cmd_property_ptr[0];
+ if (pp->pv_type != PROP_VAL_COMPLEX) {
+ zerr(gettext("A %s value was expected here."),
+ pvt_to_str(PROP_VAL_COMPLEX));
+ saw_error = B_TRUE;
+ return;
+ }
+
+ do_res_attr(&(in_progress_nwiftab.zone_nwif_attrp),
+ pp->pv_complex);
+ return;
+ case RT_DEVICE:
+ if (prop_type != PT_NPROP) {
+ zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
+ B_TRUE);
+ long_usage(CMD_ADD, B_TRUE);
+ usage(B_FALSE, HELP_PROPS);
+ return;
+ }
+ pp = cmd->cmd_property_ptr[0];
+ if (pp->pv_type != PROP_VAL_COMPLEX) {
+ zerr(gettext("A %s value was expected here."),
+ pvt_to_str(PROP_VAL_COMPLEX));
+ saw_error = B_TRUE;
+ return;
+ }
+
+ do_res_attr(&(in_progress_devtab.zone_dev_attrp),
+ pp->pv_complex);
+ return;
case RT_RCTL:
if (prop_type != PT_VALUE) {
zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
@@ -2384,7 +2566,7 @@ static boolean_t
gz_invalid_rt_property(int type)
{
return (global_zone && (type == RT_ZONENAME || type == RT_ZONEPATH ||
- type == RT_AUTOBOOT || type == RT_LIMITPRIV ||
+ type == RT_AUTOBOOT || type == RT_LIMITPRIV || type == RT_UUID ||
type == RT_BOOTARGS || type == RT_BRAND || type == RT_SCHED ||
type == RT_IPTYPE || type == RT_HOSTID || type == RT_FS_ALLOWED));
}
@@ -2393,7 +2575,7 @@ static boolean_t
gz_invalid_property(int type)
{
return (global_zone && (type == PT_ZONENAME || type == PT_ZONEPATH ||
- type == PT_AUTOBOOT || type == PT_LIMITPRIV ||
+ type == PT_AUTOBOOT || type == PT_LIMITPRIV || type == PT_UUID ||
type == PT_BOOTARGS || type == PT_BRAND || type == PT_SCHED ||
type == PT_IPTYPE || type == PT_HOSTID || type == PT_FS_ALLOWED));
}
@@ -2444,8 +2626,9 @@ add_func(cmd_t *cmd)
resource_scope = cmd->cmd_res_type;
end_op = CMD_ADD;
add_resource(cmd);
- } else
+ } else {
add_property(cmd);
+ }
}
/*
@@ -2610,6 +2793,32 @@ fill_in_fstab(cmd_t *cmd, struct zone_fstab *fstab, boolean_t fill_in_only)
return (zonecfg_lookup_filesystem(handle, fstab));
}
+/*
+ * Turn an addr that looks like f:2:0:44:5:6C into 0f:02:00:44:05:6c
+ * We're expecting a dst of at least MAXMACADDRLEN size here.
+ */
+static void
+normalize_mac_addr(char *dst, const char *src, int len)
+{
+ char *p, *e, *sep = "";
+ long n;
+ char buf[MAXMACADDRLEN], tmp[4];
+
+ *dst = '\0';
+ (void) strlcpy(buf, src, sizeof (buf));
+ p = strtok(buf, ":");
+ while (p != NULL) {
+ n = strtol(p, &e, 16);
+ if (*e != NULL || n > 0xff)
+ return;
+ (void) snprintf(tmp, sizeof (tmp), "%s%02x", sep, n);
+ (void) strlcat(dst, tmp, len);
+
+ sep = ":";
+ p = strtok(NULL, ":");
+ }
+}
+
static int
fill_in_nwiftab(cmd_t *cmd, struct zone_nwiftab *nwiftab,
boolean_t fill_in_only)
@@ -2643,6 +2852,21 @@ fill_in_nwiftab(cmd_t *cmd, struct zone_nwiftab *nwiftab,
pp->pv_simple,
sizeof (nwiftab->zone_nwif_physical));
break;
+ case PT_MAC:
+ normalize_mac_addr(nwiftab->zone_nwif_mac,
+ pp->pv_simple,
+ sizeof (nwiftab->zone_nwif_mac));
+ break;
+ case PT_VLANID:
+ (void) strlcpy(nwiftab->zone_nwif_vlan_id,
+ pp->pv_simple,
+ sizeof (nwiftab->zone_nwif_vlan_id));
+ break;
+ case PT_GNIC:
+ (void) strlcpy(nwiftab->zone_nwif_gnic,
+ pp->pv_simple,
+ sizeof (nwiftab->zone_nwif_gnic));
+ break;
case PT_DEFROUTER:
(void) strlcpy(nwiftab->zone_nwif_defrouter,
pp->pv_simple,
@@ -2893,6 +3117,8 @@ prompt_remove_resource(cmd_t *cmd, char *rsrc)
num = zonecfg_num_resources(handle, rsrc);
if (num == 0) {
+ if (force)
+ return (B_TRUE);
z_cmd_rt_perror(CMD_REMOVE, cmd->cmd_res_type, Z_NO_ENTRY,
B_TRUE);
return (B_FALSE);
@@ -2921,7 +3147,7 @@ prompt_remove_resource(cmd_t *cmd, char *rsrc)
}
static void
-remove_fs(cmd_t *cmd)
+remove_fs(cmd_t *cmd, boolean_t force)
{
int err;
@@ -2930,13 +3156,16 @@ remove_fs(cmd_t *cmd)
struct zone_fstab fstab;
if ((err = fill_in_fstab(cmd, &fstab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_FS, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_FS, err, B_TRUE);
return;
}
- if ((err = zonecfg_delete_filesystem(handle, &fstab)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_FS, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_filesystem(handle, &fstab)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_FS, err, B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
zonecfg_free_fs_option_list(fstab.zone_fs_options);
return;
}
@@ -2955,7 +3184,7 @@ remove_fs(cmd_t *cmd)
}
static void
-remove_net(cmd_t *cmd)
+remove_net(cmd_t *cmd, boolean_t force)
{
int err;
@@ -2964,13 +3193,18 @@ remove_net(cmd_t *cmd)
struct zone_nwiftab nwiftab;
if ((err = fill_in_nwiftab(cmd, &nwiftab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_NET, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_NET, err,
+ B_TRUE);
return;
}
- if ((err = zonecfg_delete_nwif(handle, &nwiftab)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_NET, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_nwif(handle, &nwiftab)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_NET, err,
+ B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
return;
}
@@ -2988,7 +3222,7 @@ remove_net(cmd_t *cmd)
}
static void
-remove_device(cmd_t *cmd)
+remove_device(cmd_t *cmd, boolean_t force)
{
int err;
@@ -2997,13 +3231,18 @@ remove_device(cmd_t *cmd)
struct zone_devtab devtab;
if ((err = fill_in_devtab(cmd, &devtab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_DEVICE, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_DEVICE, err,
+ B_TRUE);
return;
}
- if ((err = zonecfg_delete_dev(handle, &devtab)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_DEVICE, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_dev(handle, &devtab)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_DEVICE, err,
+ B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
return;
}
@@ -3021,7 +3260,7 @@ remove_device(cmd_t *cmd)
}
static void
-remove_attr(cmd_t *cmd)
+remove_attr(cmd_t *cmd, boolean_t force)
{
int err;
@@ -3030,13 +3269,18 @@ remove_attr(cmd_t *cmd)
struct zone_attrtab attrtab;
if ((err = fill_in_attrtab(cmd, &attrtab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_ATTR, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_ATTR, err,
+ B_TRUE);
return;
}
- if ((err = zonecfg_delete_attr(handle, &attrtab)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_ATTR, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_attr(handle, &attrtab)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_ATTR, err,
+ B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
return;
}
@@ -3054,7 +3298,7 @@ remove_attr(cmd_t *cmd)
}
static void
-remove_dataset(cmd_t *cmd)
+remove_dataset(cmd_t *cmd, boolean_t force)
{
int err;
@@ -3063,13 +3307,18 @@ remove_dataset(cmd_t *cmd)
struct zone_dstab dstab;
if ((err = fill_in_dstab(cmd, &dstab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_DATASET, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_DATASET, err,
+ B_TRUE);
return;
}
- if ((err = zonecfg_delete_ds(handle, &dstab)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_DATASET, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_ds(handle, &dstab)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_DATASET, err,
+ B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
return;
}
@@ -3087,7 +3336,7 @@ remove_dataset(cmd_t *cmd)
}
static void
-remove_rctl(cmd_t *cmd)
+remove_rctl(cmd_t *cmd, boolean_t force)
{
int err;
@@ -3096,13 +3345,18 @@ remove_rctl(cmd_t *cmd)
struct zone_rctltab rctltab;
if ((err = fill_in_rctltab(cmd, &rctltab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_RCTL, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_RCTL, err,
+ B_TRUE);
return;
}
- if ((err = zonecfg_delete_rctl(handle, &rctltab)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_RCTL, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_rctl(handle, &rctltab)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_RCTL, err,
+ B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
zonecfg_free_rctl_value_list(rctltab.zone_rctl_valptr);
return;
}
@@ -3121,72 +3375,90 @@ remove_rctl(cmd_t *cmd)
}
static void
-remove_pset()
+remove_pset(boolean_t force)
{
int err;
struct zone_psettab psettab;
if ((err = zonecfg_lookup_pset(handle, &psettab)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_DCPU, err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_DCPU, err, B_TRUE);
return;
}
- if ((err = zonecfg_delete_pset(handle)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_DCPU, err, B_TRUE);
- else
+ if ((err = zonecfg_delete_pset(handle)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_DCPU, err, B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
}
static void
-remove_pcap()
+remove_pcap(boolean_t force)
{
int err;
uint64_t tmp;
if (zonecfg_get_aliased_rctl(handle, ALIAS_CPUCAP, &tmp) != Z_OK) {
- zerr("%s %s: %s", cmd_to_str(CMD_REMOVE), rt_to_str(RT_PCAP),
- zonecfg_strerror(Z_NO_RESOURCE_TYPE));
- saw_error = B_TRUE;
+ if (!force) {
+ zerr("%s %s: %s", cmd_to_str(CMD_REMOVE),
+ rt_to_str(RT_PCAP),
+ zonecfg_strerror(Z_NO_RESOURCE_TYPE));
+ saw_error = B_TRUE;
+ }
return;
}
- if ((err = zonecfg_rm_aliased_rctl(handle, ALIAS_CPUCAP)) != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_PCAP, err, B_TRUE);
- else
+ if ((err = zonecfg_rm_aliased_rctl(handle, ALIAS_CPUCAP)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_PCAP, err, B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
}
static void
-remove_mcap()
+remove_mcap(boolean_t force)
{
int err, res1, res2, res3;
uint64_t tmp;
- struct zone_mcaptab mcaptab;
boolean_t revert = B_FALSE;
- res1 = zonecfg_lookup_mcap(handle, &mcaptab);
+ res1 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXPHYSMEM, &tmp);
res2 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXSWAP, &tmp);
res3 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXLOCKEDMEM, &tmp);
/* if none of these exist, there is no resource to remove */
if (res1 != Z_OK && res2 != Z_OK && res3 != Z_OK) {
- zerr("%s %s: %s", cmd_to_str(CMD_REMOVE), rt_to_str(RT_MCAP),
- zonecfg_strerror(Z_NO_RESOURCE_TYPE));
- saw_error = B_TRUE;
+ if (!force) {
+ zerr("%s %s: %s", cmd_to_str(CMD_REMOVE),
+ rt_to_str(RT_MCAP),
+ zonecfg_strerror(Z_NO_RESOURCE_TYPE));
+ saw_error = B_TRUE;
+ }
return;
}
if (res1 == Z_OK) {
- if ((err = zonecfg_delete_mcap(handle)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_MCAP, err, B_TRUE);
- revert = B_TRUE;
+ if ((err = zonecfg_rm_aliased_rctl(handle, ALIAS_MAXPHYSMEM))
+ != Z_OK) {
+ if (!force) {
+ z_cmd_rt_perror(CMD_REMOVE, RT_MCAP, err,
+ B_TRUE);
+ revert = B_TRUE;
+ }
} else {
need_to_commit = B_TRUE;
}
}
+
if (res2 == Z_OK) {
if ((err = zonecfg_rm_aliased_rctl(handle, ALIAS_MAXSWAP))
!= Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_MCAP, err, B_TRUE);
- revert = B_TRUE;
+ if (!force) {
+ z_cmd_rt_perror(CMD_REMOVE, RT_MCAP, err,
+ B_TRUE);
+ revert = B_TRUE;
+ }
} else {
need_to_commit = B_TRUE;
}
@@ -3194,8 +3466,11 @@ remove_mcap()
if (res3 == Z_OK) {
if ((err = zonecfg_rm_aliased_rctl(handle, ALIAS_MAXLOCKEDMEM))
!= Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_MCAP, err, B_TRUE);
- revert = B_TRUE;
+ if (!force) {
+ z_cmd_rt_perror(CMD_REMOVE, RT_MCAP, err,
+ B_TRUE);
+ revert = B_TRUE;
+ }
} else {
need_to_commit = B_TRUE;
}
@@ -3206,7 +3481,7 @@ remove_mcap()
}
static void
-remove_admin(cmd_t *cmd)
+remove_admin(cmd_t *cmd, boolean_t force)
{
int err;
@@ -3215,34 +3490,33 @@ remove_admin(cmd_t *cmd)
struct zone_admintab admintab;
if ((err = fill_in_admintab(cmd, &admintab, B_FALSE)) != Z_OK) {
- z_cmd_rt_perror(CMD_REMOVE, RT_ADMIN,
- err, B_TRUE);
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_ADMIN, err,
+ B_TRUE);
return;
}
if ((err = zonecfg_delete_admin(handle, &admintab,
- zone))
- != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_ADMIN,
- err, B_TRUE);
- else
+ zone)) != Z_OK) {
+ if (!force)
+ z_cmd_rt_perror(CMD_REMOVE, RT_ADMIN, err,
+ B_TRUE);
+ } else {
need_to_commit = B_TRUE;
+ }
return;
- } else {
- /*
- * unqualified admin removal.
- * remove all admins but prompt if more
- * than one.
- */
- if (!prompt_remove_resource(cmd, "admin"))
- return;
-
- if ((err = zonecfg_delete_admins(handle, zone))
- != Z_OK)
- z_cmd_rt_perror(CMD_REMOVE, RT_ADMIN,
- err, B_TRUE);
- else
- need_to_commit = B_TRUE;
}
+
+ /*
+ * unqualified admin removal.
+ * remove all admins but prompt if more than one.
+ */
+ if (!prompt_remove_resource(cmd, "admin"))
+ return;
+
+ if ((err = zonecfg_delete_admins(handle, zone)) != Z_OK)
+ z_cmd_rt_perror(CMD_REMOVE, RT_ADMIN, err, B_TRUE);
+ else
+ need_to_commit = B_TRUE;
}
static void
@@ -3251,6 +3525,7 @@ remove_resource(cmd_t *cmd)
int type;
int arg;
boolean_t arg_err = B_FALSE;
+ boolean_t force = B_FALSE;
if ((type = cmd->cmd_res_type) == RT_UNKNOWN) {
long_usage(CMD_REMOVE, B_TRUE);
@@ -3265,6 +3540,7 @@ remove_resource(cmd_t *cmd)
arg_err = B_TRUE;
break;
case 'F':
+ force = B_TRUE;
break;
default:
short_usage(CMD_REMOVE);
@@ -3280,34 +3556,34 @@ remove_resource(cmd_t *cmd)
switch (type) {
case RT_FS:
- remove_fs(cmd);
+ remove_fs(cmd, force);
return;
case RT_NET:
- remove_net(cmd);
+ remove_net(cmd, force);
return;
case RT_DEVICE:
- remove_device(cmd);
+ remove_device(cmd, force);
return;
case RT_RCTL:
- remove_rctl(cmd);
+ remove_rctl(cmd, force);
return;
case RT_ATTR:
- remove_attr(cmd);
+ remove_attr(cmd, force);
return;
case RT_DATASET:
- remove_dataset(cmd);
+ remove_dataset(cmd, force);
return;
case RT_DCPU:
- remove_pset();
+ remove_pset(force);
return;
case RT_PCAP:
- remove_pcap();
+ remove_pcap(force);
return;
case RT_MCAP:
- remove_mcap();
+ remove_mcap(force);
return;
case RT_ADMIN:
- remove_admin(cmd);
+ remove_admin(cmd, force);
return;
default:
zone_perror(rt_to_str(type), Z_NO_RESOURCE_TYPE, B_TRUE);
@@ -3324,7 +3600,27 @@ remove_property(cmd_t *cmd)
int err, res_type, prop_type;
property_value_ptr_t pp;
struct zone_rctlvaltab *rctlvaltab;
+ struct zone_res_attrtab *np;
complex_property_ptr_t cx;
+ int arg;
+ boolean_t force = B_FALSE;
+ boolean_t arg_err = B_FALSE;
+
+ optind = 0;
+ while ((arg = getopt(cmd->cmd_argc, cmd->cmd_argv, "F")) != EOF) {
+ switch (arg) {
+ case 'F':
+ force = B_TRUE;
+ break;
+ default:
+ arg_err = B_TRUE;
+ break;
+ }
+ }
+ if (arg_err) {
+ saw_error = B_TRUE;
+ return;
+ }
res_type = resource_scope;
prop_type = cmd->cmd_prop_name[0];
@@ -3366,7 +3662,7 @@ remove_property(cmd_t *cmd)
prop_id = pp->pv_simple;
err = zonecfg_remove_fs_option(&in_progress_fstab,
prop_id);
- if (err != Z_OK)
+ if (err != Z_OK && !force)
zone_perror(pt_to_str(prop_type), err, B_TRUE);
} else {
list_property_ptr_t list;
@@ -3378,12 +3674,62 @@ remove_property(cmd_t *cmd)
break;
err = zonecfg_remove_fs_option(
&in_progress_fstab, prop_id);
- if (err != Z_OK)
+ if (err != Z_OK && !force)
zone_perror(pt_to_str(prop_type), err,
B_TRUE);
}
}
return;
+ case RT_NET: /* FALLTHRU */
+ case RT_DEVICE:
+ if (prop_type != PT_NPROP) {
+ zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
+ B_TRUE);
+ long_usage(CMD_REMOVE, B_TRUE);
+ usage(B_FALSE, HELP_PROPS);
+ return;
+ }
+ pp = cmd->cmd_property_ptr[0];
+ if (pp->pv_type != PROP_VAL_COMPLEX) {
+ zerr(gettext("A %s value was expected here."),
+ pvt_to_str(PROP_VAL_COMPLEX));
+ saw_error = B_TRUE;
+ return;
+ }
+
+ np = alloca(sizeof (struct zone_res_attrtab));
+ for (cx = pp->pv_complex; cx != NULL; cx = cx->cp_next) {
+ switch (cx->cp_type) {
+ case PT_NAME:
+ (void) strlcpy(np->zone_res_attr_name,
+ cx->cp_value,
+ sizeof (np->zone_res_attr_name));
+ break;
+ case PT_VALUE:
+ (void) strlcpy(np->zone_res_attr_value,
+ cx->cp_value,
+ sizeof (np->zone_res_attr_value));
+ break;
+ default:
+ zone_perror(pt_to_str(prop_type),
+ Z_NO_PROPERTY_TYPE, B_TRUE);
+ long_usage(CMD_REMOVE, B_TRUE);
+ usage(B_FALSE, HELP_PROPS);
+ return;
+ }
+ }
+ np->zone_res_attr_next = NULL;
+
+ if (res_type == RT_NET) {
+ err = zonecfg_remove_res_attr(
+ &(in_progress_nwiftab.zone_nwif_attrp), np);
+ } else { /* RT_DEVICE */
+ err = zonecfg_remove_res_attr(
+ &(in_progress_devtab.zone_dev_attrp), np);
+ }
+ if (err != Z_OK && !force)
+ zone_perror(pt_to_str(prop_type), err, B_TRUE);
+ return;
case RT_RCTL:
if (prop_type != PT_VALUE) {
zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
@@ -3432,22 +3778,10 @@ remove_property(cmd_t *cmd)
rctlvaltab->zone_rctlval_next = NULL;
err = zonecfg_remove_rctl_value(&in_progress_rctltab,
rctlvaltab);
- if (err != Z_OK)
+ if (err != Z_OK && !force)
zone_perror(pt_to_str(prop_type), err, B_TRUE);
zonecfg_free_rctl_value_list(rctlvaltab);
return;
- case RT_NET:
- if (prop_type != PT_DEFROUTER) {
- zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
- B_TRUE);
- long_usage(CMD_REMOVE, B_TRUE);
- usage(B_FALSE, HELP_PROPS);
- return;
- } else {
- bzero(&in_progress_nwiftab.zone_nwif_defrouter,
- sizeof (in_progress_nwiftab.zone_nwif_defrouter));
- return;
- }
default:
zone_perror(rt_to_str(res_type), Z_NO_RESOURCE_TYPE, B_TRUE);
long_usage(CMD_REMOVE, B_TRUE);
@@ -3510,8 +3844,7 @@ clear_property(cmd_t *cmd)
case RT_MCAP:
switch (prop_type) {
case PT_PHYSICAL:
- in_progress_mcaptab.zone_physmem_cap[0] = '\0';
- need_to_commit = B_TRUE;
+ remove_aliased_rctl(PT_PHYSICAL, ALIAS_MAXPHYSMEM);
return;
case PT_SWAP:
remove_aliased_rctl(PT_SWAP, ALIAS_MAXSWAP);
@@ -3521,6 +3854,30 @@ clear_property(cmd_t *cmd)
return;
}
break;
+ case RT_NET:
+ switch (prop_type) {
+ case PT_ALLOWED_ADDRESS:
+ in_progress_nwiftab.zone_nwif_allowed_address[0] = '\0';
+ need_to_commit = B_TRUE;
+ return;
+ case PT_DEFROUTER:
+ in_progress_nwiftab.zone_nwif_defrouter[0] = '\0';
+ need_to_commit = B_TRUE;
+ return;
+ case PT_GNIC:
+ in_progress_nwiftab.zone_nwif_gnic[0] = '\0';
+ need_to_commit = B_TRUE;
+ return;
+ case PT_MAC:
+ in_progress_nwiftab.zone_nwif_mac[0] = '\0';
+ need_to_commit = B_TRUE;
+ return;
+ case PT_VLANID:
+ in_progress_nwiftab.zone_nwif_vlan_id[0] = '\0';
+ need_to_commit = B_TRUE;
+ return;
+ }
+ break;
default:
break;
}
@@ -3546,6 +3903,8 @@ clear_global(cmd_t *cmd)
/* FALLTHRU */
case PT_ZONEPATH:
/* FALLTHRU */
+ case PT_UUID:
+ /* FALLTHRU */
case PT_BRAND:
zone_perror(pt_to_str(type), Z_CLEAR_DISALLOW, B_TRUE);
return;
@@ -3608,6 +3967,9 @@ clear_global(cmd_t *cmd)
case PT_SHARES:
remove_aliased_rctl(PT_SHARES, ALIAS_SHARES);
return;
+ case PT_ZFSPRI:
+ remove_aliased_rctl(PT_ZFSPRI, ALIAS_ZFSPRI);
+ return;
case PT_HOSTID:
if ((err = zonecfg_set_hostid(handle, NULL)) != Z_OK)
z_cmd_rt_perror(CMD_CLEAR, RT_HOSTID, err, B_TRUE);
@@ -3653,7 +4015,7 @@ clear_func(cmd_t *cmd)
void
select_func(cmd_t *cmd)
{
- int type, err, res;
+ int type, err;
uint64_t limit;
uint64_t tmp;
@@ -3748,7 +4110,8 @@ select_func(cmd_t *cmd)
return;
case RT_MCAP:
/* if none of these exist, there is no resource to select */
- if ((res = zonecfg_lookup_mcap(handle, &old_mcaptab)) != Z_OK &&
+ if (zonecfg_get_aliased_rctl(handle, ALIAS_MAXPHYSMEM, &limit)
+ != Z_OK &&
zonecfg_get_aliased_rctl(handle, ALIAS_MAXSWAP, &limit)
!= Z_OK &&
zonecfg_get_aliased_rctl(handle, ALIAS_MAXLOCKEDMEM, &limit)
@@ -3757,12 +4120,6 @@ select_func(cmd_t *cmd)
B_TRUE);
global_scope = B_TRUE;
}
- if (res == Z_OK)
- bcopy(&old_mcaptab, &in_progress_mcaptab,
- sizeof (struct zone_mcaptab));
- else
- bzero(&in_progress_mcaptab,
- sizeof (in_progress_mcaptab));
return;
case RT_ADMIN:
if ((err = fill_in_admintab(cmd, &old_admintab, B_FALSE))
@@ -4029,7 +4386,6 @@ set_func(cmd_t *cmd)
boolean_t autoboot;
zone_iptype_t iptype;
boolean_t force_set = B_FALSE;
- size_t physmem_size = sizeof (in_progress_mcaptab.zone_physmem_cap);
uint64_t mem_cap, mem_limit;
float cap;
char *unitp;
@@ -4104,6 +4460,10 @@ set_func(cmd_t *cmd)
res_type = RT_HOSTID;
} else if (prop_type == PT_FS_ALLOWED) {
res_type = RT_FS_ALLOWED;
+ } else if (prop_type == PT_ZFSPRI) {
+ res_type = RT_ZFSPRI;
+ } else if (prop_type == PT_UUID) {
+ res_type = RT_UUID;
} else {
zerr(gettext("Cannot set a resource-specific property "
"from the global scope."));
@@ -4133,10 +4493,12 @@ set_func(cmd_t *cmd)
* A nasty expression but not that complicated:
* 1. fs options are simple or list (tested below)
* 2. rctl value's are complex or list (tested below)
+ * 3. net attr's are complex (tested below)
* Anything else should be simple.
*/
if (!(res_type == RT_FS && prop_type == PT_OPTIONS) &&
!(res_type == RT_RCTL && prop_type == PT_VALUE) &&
+ !(res_type == RT_NET && prop_type == PT_NPROP) &&
(pp->pv_type != PROP_VAL_SIMPLE ||
(prop_id = pp->pv_simple) == NULL)) {
zerr(gettext("A %s value was expected here."),
@@ -4309,6 +4671,9 @@ set_func(cmd_t *cmd)
case RT_SHARES:
set_aliased_rctl(ALIAS_SHARES, prop_type, prop_id);
return;
+ case RT_ZFSPRI:
+ set_aliased_rctl(ALIAS_ZFSPRI, prop_type, prop_id);
+ return;
case RT_HOSTID:
if ((err = zonecfg_set_hostid(handle, prop_id)) != Z_OK) {
if (err == Z_TOO_BIG) {
@@ -4322,6 +4687,15 @@ set_func(cmd_t *cmd)
}
need_to_commit = B_TRUE;
return;
+ case RT_UUID:
+ /*
+ * We can't set here. We have to wait until commit since the
+ * uuid will be updating the index file and we may not have
+ * created the zone yet.
+ */
+ (void) strlcpy(new_uuid, prop_id, sizeof (new_uuid));
+ need_to_commit = B_TRUE;
+ return;
case RT_FS_ALLOWED:
if ((err = zonecfg_set_fs_allowed(handle, prop_id)) != Z_OK)
zone_perror(zone, err, B_TRUE);
@@ -4396,6 +4770,21 @@ set_func(cmd_t *cmd)
prop_id,
sizeof (in_progress_nwiftab.zone_nwif_physical));
break;
+ case PT_MAC:
+ normalize_mac_addr(in_progress_nwiftab.zone_nwif_mac,
+ prop_id,
+ sizeof (in_progress_nwiftab.zone_nwif_mac));
+ break;
+ case PT_VLANID:
+ (void) strlcpy(in_progress_nwiftab.zone_nwif_vlan_id,
+ prop_id,
+ sizeof (in_progress_nwiftab.zone_nwif_vlan_id));
+ break;
+ case PT_GNIC:
+ (void) strlcpy(in_progress_nwiftab.zone_nwif_gnic,
+ prop_id,
+ sizeof (in_progress_nwiftab.zone_nwif_gnic));
+ break;
case PT_DEFROUTER:
if (validate_net_address_syntax(prop_id, B_TRUE)
!= Z_OK) {
@@ -4406,6 +4795,20 @@ set_func(cmd_t *cmd)
prop_id,
sizeof (in_progress_nwiftab.zone_nwif_defrouter));
break;
+ case PT_NPROP:
+ if (pp->pv_type != PROP_VAL_COMPLEX) {
+ zerr(gettext("A %s value was expected here."),
+ pvt_to_str(PROP_VAL_COMPLEX));
+ saw_error = B_TRUE;
+ return;
+ }
+ zonecfg_free_res_attr_list(
+ in_progress_nwiftab.zone_nwif_attrp);
+ in_progress_nwiftab.zone_nwif_attrp = NULL;
+ if (!(pp->pv_type == PROP_VAL_LIST &&
+ pp->pv_list == NULL))
+ add_property(cmd);
+ break;
default:
zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
B_TRUE);
@@ -4421,6 +4824,20 @@ set_func(cmd_t *cmd)
prop_id,
sizeof (in_progress_devtab.zone_dev_match));
break;
+ case PT_NPROP:
+ if (pp->pv_type != PROP_VAL_COMPLEX) {
+ zerr(gettext("A %s value was expected here."),
+ pvt_to_str(PROP_VAL_COMPLEX));
+ saw_error = B_TRUE;
+ return;
+ }
+ zonecfg_free_res_attr_list(
+ in_progress_devtab.zone_dev_attrp);
+ in_progress_devtab.zone_dev_attrp = NULL;
+ if (!(pp->pv_type == PROP_VAL_LIST &&
+ pp->pv_list == NULL))
+ add_property(cmd);
+ break;
default:
zone_perror(pt_to_str(prop_type), Z_NO_PROPERTY_TYPE,
B_TRUE);
@@ -4581,18 +4998,30 @@ set_func(cmd_t *cmd)
case RT_MCAP:
switch (prop_type) {
case PT_PHYSICAL:
+ /*
+ * We have to check if an rctl is allowed here since
+ * there might already be a rctl defined that blocks
+ * the alias.
+ */
+ if (!zonecfg_aliased_rctl_ok(handle,
+ ALIAS_MAXPHYSMEM)) {
+ zone_perror(pt_to_str(PT_LOCKED),
+ Z_ALIAS_DISALLOW, B_FALSE);
+ saw_error = B_TRUE;
+ return;
+ }
+
if (!zonecfg_valid_memlimit(prop_id, &mem_cap)) {
- zerr(gettext("A positive number with a "
+ zerr(gettext("A non-negative number with a "
"required scale suffix (K, M, G or T) was "
- "expected here."));
- saw_error = B_TRUE;
- } else if (mem_cap < ONE_MB) {
- zerr(gettext("%s value is too small. It must "
- "be at least 1M."), pt_to_str(PT_PHYSICAL));
+ "expected\nhere."));
saw_error = B_TRUE;
} else {
- snprintf(in_progress_mcaptab.zone_physmem_cap,
- physmem_size, "%llu", mem_cap);
+ if ((err = zonecfg_set_aliased_rctl(handle,
+ ALIAS_MAXPHYSMEM, mem_cap)) != Z_OK)
+ zone_perror(zone, err, B_TRUE);
+ else
+ need_to_commit = B_TRUE;
}
break;
case PT_SWAP:
@@ -4864,6 +5293,23 @@ info_hostid(zone_dochandle_t handle, FILE *fp)
}
static void
+info_uuid(FILE *fp)
+{
+ uuid_t uuid;
+ char suuid[UUID_PRINTABLE_STRING_LENGTH];
+
+ if (new_uuid[0] != '\0') {
+ (void) fprintf(fp, "%s: %s\n", pt_to_str(PT_UUID), new_uuid);
+ } else if (zonecfg_get_uuid(zone, uuid) == Z_OK &&
+ !uuid_is_null(uuid)) {
+ uuid_unparse(uuid, suuid);
+ (void) fprintf(fp, "%s: %s\n", pt_to_str(PT_UUID), suuid);
+ } else {
+ (void) fprintf(fp, "%s:\n", pt_to_str(PT_UUID));
+ }
+}
+
+static void
info_fs_allowed(zone_dochandle_t handle, FILE *fp)
{
char fsallowedp[ZONE_FS_ALLOWED_MAX];
@@ -4945,12 +5391,25 @@ loopend:
static void
output_net(FILE *fp, struct zone_nwiftab *nwiftab)
{
+ struct zone_res_attrtab *np;
+
(void) fprintf(fp, "%s:\n", rt_to_str(RT_NET));
output_prop(fp, PT_ADDRESS, nwiftab->zone_nwif_address, B_TRUE);
output_prop(fp, PT_ALLOWED_ADDRESS,
nwiftab->zone_nwif_allowed_address, B_TRUE);
- output_prop(fp, PT_PHYSICAL, nwiftab->zone_nwif_physical, B_TRUE);
output_prop(fp, PT_DEFROUTER, nwiftab->zone_nwif_defrouter, B_TRUE);
+ output_prop(fp, PT_GNIC, nwiftab->zone_nwif_gnic, B_TRUE);
+ output_prop(fp, PT_MAC, nwiftab->zone_nwif_mac, B_TRUE);
+ output_prop(fp, PT_PHYSICAL, nwiftab->zone_nwif_physical, B_TRUE);
+ output_prop(fp, PT_VLANID, nwiftab->zone_nwif_vlan_id, B_TRUE);
+
+ for (np = nwiftab->zone_nwif_attrp; np != NULL;
+ np = np->zone_res_attr_next) {
+ fprintf(fp, "\t%s: (%s=%s,%s=\"%s\")\n",
+ pt_to_str(PT_NPROP),
+ pt_to_str(PT_NAME), np->zone_res_attr_name,
+ pt_to_str(PT_VALUE), np->zone_res_attr_value);
+ }
}
static void
@@ -4993,8 +5452,18 @@ info_net(zone_dochandle_t handle, FILE *fp, cmd_t *cmd)
static void
output_dev(FILE *fp, struct zone_devtab *devtab)
{
+ struct zone_res_attrtab *np;
+
(void) fprintf(fp, "%s:\n", rt_to_str(RT_DEVICE));
output_prop(fp, PT_MATCH, devtab->zone_dev_match, B_TRUE);
+
+ for (np = devtab->zone_dev_attrp; np != NULL;
+ np = np->zone_res_attr_next) {
+ fprintf(fp, "\t%s: (%s=%s,%s=\"%s\")\n",
+ pt_to_str(PT_NPROP),
+ pt_to_str(PT_NAME), np->zone_res_attr_name,
+ pt_to_str(PT_VALUE), np->zone_res_attr_value);
+ }
}
static void
@@ -5253,15 +5722,18 @@ bytes_to_units(char *str, char *buf, int bufsize)
}
static void
-output_mcap(FILE *fp, struct zone_mcaptab *mcaptab, int showswap,
+output_mcap(FILE *fp, int showphys, uint64_t maxphys, int showswap,
uint64_t maxswap, int showlocked, uint64_t maxlocked)
{
char buf[128];
(void) fprintf(fp, "%s:\n", rt_to_str(RT_MCAP));
- if (mcaptab->zone_physmem_cap[0] != '\0') {
- bytes_to_units(mcaptab->zone_physmem_cap, buf, sizeof (buf));
- output_prop(fp, PT_PHYSICAL, buf, B_TRUE);
+
+ if (showphys == Z_OK) {
+ (void) snprintf(buf, sizeof (buf), "%llu", maxphys);
+ bytes_to_units(buf, buf, sizeof (buf));
+ /* Print directly since "physical" also is a net property. */
+ (void) fprintf(fp, "\t[%s: %s]\n", pt_to_str(PT_PHYSICAL), buf);
}
if (showswap == Z_OK) {
@@ -5283,16 +5755,16 @@ info_mcap(zone_dochandle_t handle, FILE *fp)
int res1, res2, res3;
uint64_t swap_limit;
uint64_t locked_limit;
- struct zone_mcaptab lookup;
+ uint64_t phys_limit;
- bzero(&lookup, sizeof (lookup));
- res1 = zonecfg_getmcapent(handle, &lookup);
+ res1 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXPHYSMEM, &phys_limit);
res2 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXSWAP, &swap_limit);
res3 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXLOCKEDMEM,
&locked_limit);
if (res1 == Z_OK || res2 == Z_OK || res3 == Z_OK)
- output_mcap(fp, &lookup, res2, swap_limit, res3, locked_limit);
+ output_mcap(fp, res1, phys_limit, res2, swap_limit,
+ res3, locked_limit);
}
static void
@@ -5344,9 +5816,10 @@ info_func(cmd_t *cmd)
boolean_t need_to_close = B_FALSE;
char *pager, *space;
int type;
- int res1, res2;
+ int res1, res2, res3;
uint64_t swap_limit;
uint64_t locked_limit;
+ uint64_t phys_limit;
struct stat statbuf;
assert(cmd != NULL);
@@ -5407,7 +5880,9 @@ info_func(cmd_t *cmd)
&swap_limit);
res2 = zonecfg_get_aliased_rctl(handle,
ALIAS_MAXLOCKEDMEM, &locked_limit);
- output_mcap(fp, &in_progress_mcaptab, res1, swap_limit,
+ res3 = zonecfg_get_aliased_rctl(handle,
+ ALIAS_MAXPHYSMEM, &phys_limit);
+ output_mcap(fp, res3, phys_limit, res1, swap_limit,
res2, locked_limit);
break;
case RT_ADMIN:
@@ -5447,6 +5922,7 @@ info_func(cmd_t *cmd)
info_iptype(handle, fp);
info_hostid(handle, fp);
info_fs_allowed(handle, fp);
+ info_uuid(fp);
}
info_aliased_rctl(handle, fp, ALIAS_MAXLWPS);
info_aliased_rctl(handle, fp, ALIAS_MAXPROCS);
@@ -5455,6 +5931,7 @@ info_func(cmd_t *cmd)
info_aliased_rctl(handle, fp, ALIAS_MAXMSGIDS);
info_aliased_rctl(handle, fp, ALIAS_MAXSEMIDS);
info_aliased_rctl(handle, fp, ALIAS_SHARES);
+ info_aliased_rctl(handle, fp, ALIAS_ZFSPRI);
if (!global_zone) {
info_fs(handle, fp, cmd);
info_net(handle, fp, cmd);
@@ -5518,6 +5995,9 @@ info_func(cmd_t *cmd)
case RT_SHARES:
info_aliased_rctl(handle, fp, ALIAS_SHARES);
break;
+ case RT_ZFSPRI:
+ info_aliased_rctl(handle, fp, ALIAS_ZFSPRI);
+ break;
case RT_FS:
info_fs(handle, fp, cmd);
break;
@@ -5548,6 +6028,9 @@ info_func(cmd_t *cmd)
case RT_HOSTID:
info_hostid(handle, fp);
break;
+ case RT_UUID:
+ info_uuid(fp);
+ break;
case RT_ADMIN:
info_auth(handle, fp, cmd);
break;
@@ -6015,11 +6498,29 @@ verify_func(cmd_t *cmd)
if (save) {
if (ret_val == Z_OK) {
+ /*
+ * If the zone doesn't yet have a debug ID, set one now.
+ */
+ if (zonecfg_get_did(handle) == -1)
+ zonecfg_set_did(handle);
+
if ((ret_val = zonecfg_save(handle)) == Z_OK) {
need_to_commit = B_FALSE;
(void) strlcpy(revert_zone, zone,
sizeof (revert_zone));
}
+
+ /*
+ * Commit a new uuid at this point since we now know the
+ * zone index entry will exist.
+ */
+ if (new_uuid[0] != '\0') {
+ if ((err = zonecfg_set_uuid(zone, zonepath,
+ new_uuid)) != Z_OK)
+ zone_perror(zone, err, B_FALSE);
+ else
+ new_uuid[0] = '\0';
+ }
} else {
zerr(gettext("Zone %s failed to verify"), zone);
}
@@ -6189,6 +6690,7 @@ end_func(cmd_t *cmd)
int err, arg, res1, res2, res3;
uint64_t swap_limit;
uint64_t locked_limit;
+ uint64_t phys_limit;
uint64_t proc_cap;
assert(cmd != NULL);
@@ -6492,8 +6994,8 @@ end_func(cmd_t *cmd)
break;
case RT_MCAP:
/* Make sure everything was filled in. */
- res1 = strlen(in_progress_mcaptab.zone_physmem_cap) == 0 ?
- Z_ERR : Z_OK;
+ res1 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXPHYSMEM,
+ &phys_limit);
res2 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXSWAP,
&swap_limit);
res3 = zonecfg_get_aliased_rctl(handle, ALIAS_MAXLOCKEDMEM,
@@ -6509,11 +7011,6 @@ end_func(cmd_t *cmd)
/* if phys & locked are both set, verify locked <= phys */
if (res1 == Z_OK && res3 == Z_OK) {
- uint64_t phys_limit;
- char *endp;
-
- phys_limit = strtoull(
- in_progress_mcaptab.zone_physmem_cap, &endp, 10);
if (phys_limit < locked_limit) {
zerr(gettext("The %s cap must be less than or "
"equal to the %s cap."),
@@ -6525,23 +7022,6 @@ end_func(cmd_t *cmd)
}
err = Z_OK;
- if (res1 == Z_OK) {
- /*
- * We could be ending from either an add operation
- * or a select operation. Since all of the properties
- * within this resource are optional, we always use
- * modify on the mcap entry. zonecfg_modify_mcap()
- * will handle both adding and modifying a memory cap.
- */
- err = zonecfg_modify_mcap(handle, &in_progress_mcaptab);
- } else if (end_op == CMD_SELECT) {
- /*
- * If we're ending from a select and the physical
- * memory cap is empty then the user could have cleared
- * the physical cap value, so try to delete the entry.
- */
- (void) zonecfg_delete_mcap(handle);
- }
break;
case RT_ADMIN:
/* First make sure everything was filled in. */
@@ -7090,8 +7570,10 @@ get_execbasename(char *execfullname)
int
main(int argc, char *argv[])
{
- int err, arg;
+ int err, arg, uflag = 0, zflag = 0;
struct stat st;
+ uuid_t uuidin;
+ char zonename[ZONENAME_MAX + 1];
/* This must be before anything goes to stdout. */
setbuf(stdout, NULL);
@@ -7118,7 +7600,7 @@ main(int argc, char *argv[])
exit(Z_OK);
}
- while ((arg = getopt(argc, argv, "?f:R:z:")) != EOF) {
+ while ((arg = getopt(argc, argv, "?f:R:z:u:")) != EOF) {
switch (arg) {
case '?':
if (optopt == '?')
@@ -7145,6 +7627,21 @@ main(int argc, char *argv[])
}
zonecfg_set_root(optarg);
break;
+ case 'u':
+ if (uuid_parse((char *)optarg, uuidin) == -1)
+ return (Z_INVALID_PROPERTY);
+
+ if (zonecfg_get_name_by_uuid(uuidin, zonename,
+ ZONENAME_MAX) != Z_OK) {
+ zone_perror(optarg, Z_BOGUS_ZONE_NAME, B_TRUE);
+ usage(B_FALSE, HELP_SYNTAX);
+ exit(Z_USAGE);
+ }
+
+ (void) strlcpy(zone, zonename, sizeof (zone));
+ (void) strlcpy(revert_zone, zonename, sizeof (zone));
+ uflag = 1;
+ break;
case 'z':
if (strcmp(optarg, GLOBAL_ZONENAME) == 0) {
global_zone = B_TRUE;
@@ -7155,6 +7652,7 @@ main(int argc, char *argv[])
}
(void) strlcpy(zone, optarg, sizeof (zone));
(void) strlcpy(revert_zone, optarg, sizeof (zone));
+ zflag = 1;
break;
default:
usage(B_FALSE, HELP_USAGE);
@@ -7162,7 +7660,7 @@ main(int argc, char *argv[])
}
}
- if (optind > argc || strcmp(zone, "") == 0) {
+ if (optind > argc || strcmp(zone, "") == 0 || (uflag && zflag)) {
usage(B_FALSE, HELP_USAGE);
exit(Z_USAGE);
}
diff --git a/usr/src/cmd/zonecfg/zonecfg.h b/usr/src/cmd/zonecfg/zonecfg.h
index d8f8b14ce8..f8c78437ad 100644
--- a/usr/src/cmd/zonecfg/zonecfg.h
+++ b/usr/src/cmd/zonecfg/zonecfg.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#ifndef _ZONECFG_H
@@ -90,9 +91,11 @@ extern "C" {
#define RT_ADMIN 26
#define RT_FS_ALLOWED 27
#define RT_MAXPROCS 28 /* really a rctl alias property, but for info */
+#define RT_ZFSPRI 29 /* really a rctl alias property, but for info */
+#define RT_UUID 30 /* really a property, but for info */
#define RT_MIN RT_UNKNOWN
-#define RT_MAX RT_MAXPROCS
+#define RT_MAX RT_UUID
/* property types: increment PT_MAX when expanding this list */
#define PT_UNKNOWN 0
@@ -137,9 +140,15 @@ extern "C" {
#define PT_FS_ALLOWED 39
#define PT_MAXPROCS 40
#define PT_ALLOWED_ADDRESS 41
+#define PT_ZFSPRI 42
+#define PT_MAC 43
+#define PT_VLANID 44
+#define PT_GNIC 45
+#define PT_NPROP 46
+#define PT_UUID 47
#define PT_MIN PT_UNKNOWN
-#define PT_MAX PT_ALLOWED_ADDRESS
+#define PT_MAX PT_UUID
#define MAX_EQ_PROP_PAIRS 3
diff --git a/usr/src/cmd/zonecfg/zonecfg_grammar.y b/usr/src/cmd/zonecfg/zonecfg_grammar.y
index d7f11b6a46..13a17876b7 100644
--- a/usr/src/cmd/zonecfg/zonecfg_grammar.y
+++ b/usr/src/cmd/zonecfg/zonecfg_grammar.y
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent Inc. All rights reserved.
*/
/*
@@ -136,6 +137,7 @@ complex_piece_func(int cp_type, const char *str, complex_property_ptr_t cp_next)
%token OPEN_PAREN CLOSE_PAREN COMMA DATASET LIMITPRIV BOOTARGS BRAND PSET PCAP
%token MCAP NCPUS IMPORTANCE SHARES MAXLWPS MAXSHMMEM MAXSHMIDS MAXMSGIDS
%token MAXSEMIDS LOCKED SWAP SCHED CLEAR DEFROUTER ADMIN USER AUTHS MAXPROCS
+%token ZFSPRI MAC VLANID GNIC NPROP UUID
%type <strval> TOKEN EQUAL OPEN_SQ_BRACKET CLOSE_SQ_BRACKET
property_value OPEN_PAREN CLOSE_PAREN COMMA simple_prop_val
@@ -145,7 +147,7 @@ complex_piece_func(int cp_type, const char *str, complex_property_ptr_t cp_next)
%type <ival> property_name SPECIAL RAW DIR OPTIONS TYPE ADDRESS PHYSICAL NAME
MATCH ZONENAME ZONEPATH AUTOBOOT POOL LIMITPRIV BOOTARGS VALUE PRIV LIMIT
ACTION BRAND SCHED IPTYPE DEFROUTER HOSTID USER AUTHS FS_ALLOWED
- ALLOWED_ADDRESS
+ ALLOWED_ADDRESS MAC VLANID GNIC NPROP UUID
%type <cmd> command
%type <cmd> add_command ADD
%type <cmd> cancel_command CANCEL
@@ -650,6 +652,24 @@ info_command: INFO
$$->cmd_res_type = RT_FS_ALLOWED;
$$->cmd_prop_nv_pairs = 0;
}
+ | INFO UUID
+ {
+ if (($$ = alloc_cmd()) == NULL)
+ YYERROR;
+ cmd = $$;
+ $$->cmd_handler = &info_func;
+ $$->cmd_res_type = RT_UUID;
+ $$->cmd_prop_nv_pairs = 0;
+ }
+ | INFO ZFSPRI
+ {
+ if (($$ = alloc_cmd()) == NULL)
+ YYERROR;
+ cmd = $$;
+ $$->cmd_handler = &info_func;
+ $$->cmd_res_type = RT_ZFSPRI;
+ $$->cmd_prop_nv_pairs = 0;
+ }
| INFO resource_type property_name EQUAL property_value
{
if (($$ = alloc_cmd()) == NULL)
@@ -734,6 +754,19 @@ remove_command: REMOVE
$$->cmd_prop_name[0] = $2;
$$->cmd_property_ptr[0] = &property[0];
}
+ | REMOVE TOKEN property_name property_value
+ {
+ if (($$ = alloc_cmd()) == NULL)
+ YYERROR;
+ cmd = $$;
+ $$->cmd_handler = &remove_func;
+ $$->cmd_argc = 1;
+ $$->cmd_argv[0] = claim_token($2);
+ $$->cmd_argv[1] = NULL;
+ $$->cmd_prop_nv_pairs = 1;
+ $$->cmd_prop_name[0] = $3;
+ $$->cmd_property_ptr[0] = &property[0];
+ }
| REMOVE resource_type property_name EQUAL property_value
{
if (($$ = alloc_cmd()) == NULL)
@@ -745,6 +778,20 @@ remove_command: REMOVE
$$->cmd_prop_name[0] = $3;
$$->cmd_property_ptr[0] = &property[0];
}
+ | REMOVE TOKEN resource_type property_name EQUAL property_value
+ {
+ if (($$ = alloc_cmd()) == NULL)
+ YYERROR;
+ cmd = $$;
+ $$->cmd_handler = &remove_func;
+ $$->cmd_res_type = $3;
+ $$->cmd_argc = 1;
+ $$->cmd_argv[0] = claim_token($2);
+ $$->cmd_argv[1] = NULL;
+ $$->cmd_prop_nv_pairs = 1;
+ $$->cmd_prop_name[0] = $4;
+ $$->cmd_property_ptr[0] = &property[0];
+ }
| REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value
{
if (($$ = alloc_cmd()) == NULL)
@@ -758,6 +805,22 @@ remove_command: REMOVE
$$->cmd_prop_name[1] = $6;
$$->cmd_property_ptr[1] = &property[1];
}
+ | REMOVE TOKEN resource_type property_name EQUAL property_value property_name EQUAL property_value
+ {
+ if (($$ = alloc_cmd()) == NULL)
+ YYERROR;
+ cmd = $$;
+ $$->cmd_handler = &remove_func;
+ $$->cmd_res_type = $3;
+ $$->cmd_argc = 1;
+ $$->cmd_argv[0] = claim_token($2);
+ $$->cmd_argv[1] = NULL;
+ $$->cmd_prop_nv_pairs = 2;
+ $$->cmd_prop_name[0] = $4;
+ $$->cmd_property_ptr[0] = &property[0];
+ $$->cmd_prop_name[1] = $7;
+ $$->cmd_property_ptr[1] = &property[1];
+ }
| REMOVE resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value
{
if (($$ = alloc_cmd()) == NULL)
@@ -773,6 +836,24 @@ remove_command: REMOVE
$$->cmd_prop_name[2] = $9;
$$->cmd_property_ptr[2] = &property[2];
}
+ | REMOVE TOKEN resource_type property_name EQUAL property_value property_name EQUAL property_value property_name EQUAL property_value
+ {
+ if (($$ = alloc_cmd()) == NULL)
+ YYERROR;
+ cmd = $$;
+ $$->cmd_handler = &remove_func;
+ $$->cmd_res_type = $3;
+ $$->cmd_argc = 1;
+ $$->cmd_argv[0] = claim_token($2);
+ $$->cmd_argv[1] = NULL;
+ $$->cmd_prop_nv_pairs = 3;
+ $$->cmd_prop_name[0] = $4;
+ $$->cmd_property_ptr[0] = &property[0];
+ $$->cmd_prop_name[1] = $7;
+ $$->cmd_property_ptr[1] = &property[1];
+ $$->cmd_prop_name[2] = $10;
+ $$->cmd_property_ptr[2] = &property[2];
+ }
revert_command: REVERT
{
@@ -976,6 +1057,10 @@ property_name: SPECIAL { $$ = PT_SPECIAL; }
| ALLOWED_ADDRESS { $$ = PT_ALLOWED_ADDRESS; }
| PHYSICAL { $$ = PT_PHYSICAL; }
| DEFROUTER { $$ = PT_DEFROUTER; }
+ | MAC { $$ = PT_MAC; }
+ | VLANID { $$ = PT_VLANID; }
+ | GNIC { $$ = PT_GNIC; }
+ | NPROP { $$ = PT_NPROP; }
| NAME { $$ = PT_NAME; }
| VALUE { $$ = PT_VALUE; }
| MATCH { $$ = PT_MATCH; }
@@ -999,6 +1084,8 @@ property_name: SPECIAL { $$ = PT_SPECIAL; }
| USER { $$ = PT_USER; }
| AUTHS { $$ = PT_AUTHS; }
| FS_ALLOWED { $$ = PT_FS_ALLOWED; }
+ | UUID { $$ = PT_UUID; }
+ | ZFSPRI { $$ = PT_ZFSPRI; }
/*
* The grammar builds data structures from the bottom up. Thus various
diff --git a/usr/src/cmd/zonecfg/zonecfg_lex.l b/usr/src/cmd/zonecfg/zonecfg_lex.l
index 6a0b577b75..328a75c922 100644
--- a/usr/src/cmd/zonecfg/zonecfg_lex.l
+++ b/usr/src/cmd/zonecfg/zonecfg_lex.l
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <assert.h>
@@ -57,10 +58,11 @@ extern void yyerror(char *s);
static char *create_token(char *s);
%}
-%a 7000
+%a 8000
%p 5000
%e 2000
%n 1000
+%o 13000
%{
/*
@@ -236,6 +238,18 @@ static char *create_token(char *s);
<TSTATE>defrouter { return DEFROUTER; }
<CSTATE>defrouter { return DEFROUTER; }
+<TSTATE>mac-addr { return MAC; }
+<CSTATE>mac-addr { return MAC; }
+
+<TSTATE>vlan-id { return VLANID; }
+<CSTATE>vlan-id { return VLANID; }
+
+<TSTATE>global-nic { return GNIC; }
+<CSTATE>global-nic { return GNIC; }
+
+<TSTATE>property { return NPROP; }
+<CSTATE>property { return NPROP; }
+
<TSTATE>dir { return DIR; }
<CSTATE>dir { return DIR; }
@@ -308,6 +322,12 @@ static char *create_token(char *s);
<TSTATE>fs-allowed { return FS_ALLOWED; }
<CSTATE>fs-allowed { return FS_ALLOWED; }
+<TSTATE>uuid { return UUID; }
+<CSTATE>uuid { return UUID; }
+
+<TSTATE>zfs-io-priority { return ZFSPRI; }
+<CSTATE>zfs-io-priority { return ZFSPRI; }
+
<TSTATE>= { return EQUAL; }
<LSTATE>= { return EQUAL; }
<CSTATE>= { return EQUAL; }
@@ -357,6 +377,13 @@ static char *create_token(char *s);
return TOKEN;
}
+<CSTATE>\"[^\"\n]*[\"\n] {
+ yylval.strval = create_token(yytext + 1);
+ if (yylval.strval[yyleng - 2] == '"')
+ yylval.strval[yyleng - 2] = 0;
+ return TOKEN;
+ }
+
<TSTATE>\"[^\"\n]*[\"\n] {
yylval.strval = create_token(yytext + 1);
if (yylval.strval[yyleng - 2] == '"')
diff --git a/usr/src/cmd/zonename/Makefile b/usr/src/cmd/zonename/Makefile
index 566e893a67..3a51952455 100644
--- a/usr/src/cmd/zonename/Makefile
+++ b/usr/src/cmd/zonename/Makefile
@@ -28,8 +28,10 @@
#
PROG= zonename
+OBJS= zonename.o
include ../Makefile.cmd
+include ../Makefile.ctf
LDLIBS += -lzonecfg
@@ -37,6 +39,10 @@ LDLIBS += -lzonecfg
all: $(PROG)
+$(PROG): $(OBJS)
+ $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
+ $(POST_PROCESS)
+
install: all $(ROOTSBINPROG)
$(RM) $(ROOTPROG)
$(SYMLINK) ../../sbin/$(PROG) $(ROOTPROG)
@@ -44,6 +50,10 @@ install: all $(ROOTSBINPROG)
check: $(PROG).c
$(CSTYLE) -pP $(PROG).c
+%.o: %.c
+ $(COMPILE.c) $<
+ $(POST_PROCESS_O)
+
clean:
lint: lint_PROG
diff --git a/usr/src/cmd/zonestat/zonestatd/zonestatd.c b/usr/src/cmd/zonestat/zonestatd/zonestatd.c
index b764551131..6c293bcc0e 100644
--- a/usr/src/cmd/zonestat/zonestatd/zonestatd.c
+++ b/usr/src/cmd/zonestat/zonestatd/zonestatd.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#include <alloca.h>
#include <assert.h>
@@ -2190,7 +2191,7 @@ zsd_get_zone_rctl_usage(char *name)
return (rctlblk_get_value(rblk));
}
-#define ZSD_NUM_RCTL_VALS 19
+#define ZSD_NUM_RCTL_VALS 20
/*
* Fetch the limit information for a zone. This uses zone_enter() as the
@@ -2237,12 +2238,6 @@ zsd_get_zone_caps(zsd_ctl_t *ctl, zsd_zone_t *zone, uint64_t *cpu_shares,
*msgids = 0;
*lofi = 0;
- /* Get the ram cap first since it is a zone attr */
- ret = zone_getattr(zone->zsz_id, ZONE_ATTR_PHYS_MCAP,
- ram_cap, sizeof (*ram_cap));
- if (ret < 0 || *ram_cap == 0)
- *ram_cap = ZS_LIMIT_NONE;
-
/* Get the zone's default scheduling class */
ret = zone_getattr(zone->zsz_id, ZONE_ATTR_SCHED_CLASS,
class, sizeof (class));
@@ -2298,6 +2293,7 @@ zsd_get_zone_caps(zsd_ctl_t *ctl, zsd_zone_t *zone, uint64_t *cpu_shares,
vals[i++] = zsd_get_zone_rctl_usage("zone.max-msg-ids");
vals[i++] = zsd_get_zone_rctl_limit("zone.max-lofi");
vals[i++] = zsd_get_zone_rctl_usage("zone.max-lofi");
+ vals[i++] = zsd_get_zone_rctl_usage("zone.max-physical-memory");
if (write(p[1], vals, ZSD_NUM_RCTL_VALS * sizeof (uint64_t)) !=
ZSD_NUM_RCTL_VALS * sizeof (uint64_t)) {
@@ -2342,6 +2338,7 @@ zsd_get_zone_caps(zsd_ctl_t *ctl, zsd_zone_t *zone, uint64_t *cpu_shares,
*msgids = vals[i++];
*lofi_cap = vals[i++];
*lofi = vals[i++];
+ *ram_cap = vals[i++];
/* Interpret maximum values as no cap */
if (*cpu_cap == UINT32_MAX || *cpu_cap == 0)
diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c
index d8839b6571..e77a86fa8a 100644
--- a/usr/src/cmd/zpool/zpool_main.c
+++ b/usr/src/cmd/zpool/zpool_main.c
@@ -25,6 +25,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#include <assert.h>
@@ -227,7 +228,7 @@ get_usage(zpool_help_t idx) {
return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval "
"[count]]\n"));
case HELP_LIST:
- return (gettext("\tlist [-H] [-o property[,...]] "
+ return (gettext("\tlist [-Hp] [-o property[,...]] "
"[-T d|u] [pool] ... [interval [count]]\n"));
case HELP_OFFLINE:
return (gettext("\toffline [-t] <pool> <device> ...\n"));
@@ -250,7 +251,7 @@ get_usage(zpool_help_t idx) {
"\tupgrade -v\n"
"\tupgrade [-V version] <-a | pool ...>\n"));
case HELP_GET:
- return (gettext("\tget <\"all\" | property[,...]> "
+ return (gettext("\tget [-p] <\"all\" | property[,...]> "
"<pool> ...\n"));
case HELP_SET:
return (gettext("\tset <property=value> <pool> \n"));
@@ -2616,8 +2617,9 @@ zpool_do_iostat(int argc, char **argv)
typedef struct list_cbdata {
boolean_t cb_verbose;
- int cb_namewidth;
+ boolean_t cb_namewidth;
boolean_t cb_scripted;
+ boolean_t cb_literal;
zprop_list_t *cb_proplist;
} list_cbdata_t;
@@ -2714,7 +2716,7 @@ print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
zpool_get_prop_int(zhp, pl->pl_prop, NULL) == 0)
propstr = "-";
else if (zpool_get_prop(zhp, pl->pl_prop, property,
- sizeof (property), NULL) != 0)
+ sizeof (property), NULL, cb->cb_literal) != 0)
propstr = "-";
else
propstr = property;
@@ -2865,12 +2867,13 @@ list_callback(zpool_handle_t *zhp, void *data)
}
/*
- * zpool list [-H] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]]
+ * zpool list [-Hp] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]]
*
* -H Scripted mode. Don't display headers, and separate properties
* by a single tab.
* -o List of properties to display. Defaults to
* "name,size,allocated,free,capacity,health,altroot"
+ * -p Display values in parsable (literal) format.
* -T Display a timestamp in date(1) or Unix format
*
* List all pools in the system, whether or not they're healthy. Output space
@@ -2891,7 +2894,7 @@ zpool_do_list(int argc, char **argv)
boolean_t first = B_TRUE;
/* check options */
- while ((c = getopt(argc, argv, ":Ho:T:v")) != -1) {
+ while ((c = getopt(argc, argv, ":Hpo:T:v")) != -1) {
switch (c) {
case 'H':
cb.cb_scripted = B_TRUE;
@@ -2899,6 +2902,9 @@ zpool_do_list(int argc, char **argv)
case 'o':
props = optarg;
break;
+ case 'p':
+ cb.cb_literal = B_TRUE;
+ break;
case 'T':
get_timestamp_arg(*optarg);
break;
@@ -4977,7 +4983,7 @@ get_callback(zpool_handle_t *zhp, void *data)
}
} else {
if (zpool_get_prop(zhp, pl->pl_prop, value,
- sizeof (value), &srctype) != 0)
+ sizeof (value), &srctype, cbp->cb_literal) != 0)
continue;
zprop_print_one_property(zpool_get_name(zhp), cbp,
@@ -4994,6 +5000,23 @@ zpool_do_get(int argc, char **argv)
zprop_get_cbdata_t cb = { 0 };
zprop_list_t fake_name = { 0 };
int ret;
+ char c;
+
+ /* check options */
+ while ((c = getopt(argc, argv, "p")) != -1) {
+ switch (c) {
+ case 'p':
+ cb.cb_literal = B_TRUE;
+ break;
+ case '?':
+ (void) fprintf(stderr, gettext("invalid option '%c'\n"),
+ optopt);
+ usage(B_FALSE);
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
if (argc < 2) {
(void) fprintf(stderr, gettext("missing property "
@@ -5009,7 +5032,7 @@ zpool_do_get(int argc, char **argv)
cb.cb_columns[3] = GET_COL_SOURCE;
cb.cb_type = ZFS_TYPE_POOL;
- if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist,
+ if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist,
ZFS_TYPE_POOL) != 0)
usage(B_FALSE);
@@ -5020,7 +5043,7 @@ zpool_do_get(int argc, char **argv)
cb.cb_proplist = &fake_name;
}
- ret = for_each_pool(argc - 2, argv + 2, B_TRUE, &cb.cb_proplist,
+ ret = for_each_pool(argc - 1, argv + 1, B_TRUE, &cb.cb_proplist,
get_callback, &cb);
if (cb.cb_proplist == &fake_name)
diff --git a/usr/src/common/ctf/ctf_open.c b/usr/src/common/ctf/ctf_open.c
index 2148389fff..001cf5c591 100644
--- a/usr/src/common/ctf/ctf_open.c
+++ b/usr/src/common/ctf/ctf_open.c
@@ -25,7 +25,7 @@
* Use is subject to license terms.
*/
/*
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <ctf_impl.h>
@@ -788,6 +788,92 @@ bad:
}
/*
+ * Dupliate a ctf_file_t and its underlying section information into a new
+ * container. This works by copying the three ctf_sect_t's of the original
+ * container if they exist and passing those into ctf_bufopen. To copy those, we
+ * mmap anonymous memory with ctf_data_alloc and bcopy the data across. It's not
+ * the cheapest thing, but it's what we've got.
+ */
+ctf_file_t *
+ctf_dup(ctf_file_t *ofp)
+{
+ ctf_file_t *fp;
+ ctf_sect_t ctfsect, symsect, strsect;
+ ctf_sect_t *ctp, *symp, *strp;
+ void *cbuf, *symbuf, *strbuf;
+ int err;
+
+ cbuf = symbuf = strbuf = NULL;
+ /*
+ * The ctfsect isn't allowed to not exist, but the symbol and string
+ * section might not. We only need to copy the data of the section, not
+ * the name, as ctf_bufopen will take care of that.
+ */
+ bcopy(&ofp->ctf_data, &ctfsect, sizeof (ctf_sect_t));
+ cbuf = ctf_data_alloc(ctfsect.cts_size);
+ if (cbuf == NULL) {
+ (void) ctf_set_errno(ofp, ECTF_MMAP);
+ return (NULL);
+ }
+
+ bcopy(ctfsect.cts_data, cbuf, ctfsect.cts_size);
+ ctf_data_protect(cbuf, ctfsect.cts_size);
+ ctfsect.cts_data = cbuf;
+ ctfsect.cts_offset = 0;
+ ctp = &ctfsect;
+
+ if (ofp->ctf_symtab.cts_data != NULL) {
+ bcopy(&ofp->ctf_symtab, &symsect, sizeof (ctf_sect_t));
+ symbuf = ctf_data_alloc(symsect.cts_size);
+ if (symbuf == NULL) {
+ (void) ctf_set_errno(ofp, ECTF_MMAP);
+ goto err;
+ }
+ bcopy(symsect.cts_data, symbuf, symsect.cts_size);
+ ctf_data_protect(symbuf, symsect.cts_size);
+ symsect.cts_data = symbuf;
+ symsect.cts_offset = 0;
+ symp = &symsect;
+ } else {
+ symp = NULL;
+ }
+
+ if (ofp->ctf_strtab.cts_data != NULL) {
+ bcopy(&ofp->ctf_strtab, &strsect, sizeof (ctf_sect_t));
+ strbuf = ctf_data_alloc(strsect.cts_size);
+ if (strbuf == NULL) {
+ (void) ctf_set_errno(ofp, ECTF_MMAP);
+ goto err;
+ }
+ bcopy(strsect.cts_data, strbuf, strsect.cts_size);
+ ctf_data_protect(strbuf, strsect.cts_size);
+ strsect.cts_data = strbuf;
+ strsect.cts_offset = 0;
+ strp = &strsect;
+ } else {
+ strp = NULL;
+ }
+
+ fp = ctf_bufopen(ctp, symp, strp, &err);
+ if (fp == NULL) {
+ (void) ctf_set_errno(ofp, err);
+ goto err;
+ }
+
+ fp->ctf_flags |= LCTF_MMAP;
+
+ return (fp);
+
+err:
+ ctf_data_free(cbuf, ctfsect.cts_size);
+ if (symbuf != NULL)
+ ctf_data_free(symbuf, symsect.cts_size);
+ if (strbuf != NULL)
+ ctf_data_free(strbuf, strsect.cts_size);
+ return (NULL);
+}
+
+/*
* Close the specified CTF container and free associated data structures. Note
* that ctf_close() is a reference counted operation: if the specified file is
* the parent of other active containers, its reference count will be greater
diff --git a/usr/src/common/ctf/ctf_types.c b/usr/src/common/ctf/ctf_types.c
index 290c518ae7..ab1b9ff14b 100644
--- a/usr/src/common/ctf/ctf_types.c
+++ b/usr/src/common/ctf/ctf_types.c
@@ -25,8 +25,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <ctf_impl.h>
ssize_t
@@ -199,8 +197,9 @@ ctf_type_resolve(ctf_file_t *fp, ctf_id_t type)
* Lookup the given type ID and print a string name for it into buf. Return
* the actual number of bytes (not including \0) needed to format the name.
*/
-ssize_t
-ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
+static ssize_t
+ctf_type_qlname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len,
+ const char *qname)
{
ctf_decl_t cd;
ctf_decl_node_t *cdp;
@@ -255,6 +254,8 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
case CTF_K_INTEGER:
case CTF_K_FLOAT:
case CTF_K_TYPEDEF:
+ if (qname != NULL)
+ ctf_decl_sprintf(&cd, "%s`", qname);
ctf_decl_sprintf(&cd, "%s", name);
break;
case CTF_K_POINTER:
@@ -268,13 +269,22 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
break;
case CTF_K_STRUCT:
case CTF_K_FORWARD:
- ctf_decl_sprintf(&cd, "struct %s", name);
+ ctf_decl_sprintf(&cd, "struct ");
+ if (qname != NULL)
+ ctf_decl_sprintf(&cd, "%s`", qname);
+ ctf_decl_sprintf(&cd, "%s", name);
break;
case CTF_K_UNION:
- ctf_decl_sprintf(&cd, "union %s", name);
+ ctf_decl_sprintf(&cd, "union ");
+ if (qname != NULL)
+ ctf_decl_sprintf(&cd, "%s`", qname);
+ ctf_decl_sprintf(&cd, "%s", name);
break;
case CTF_K_ENUM:
- ctf_decl_sprintf(&cd, "enum %s", name);
+ ctf_decl_sprintf(&cd, "enum ");
+ if (qname != NULL)
+ ctf_decl_sprintf(&cd, "%s`", qname);
+ ctf_decl_sprintf(&cd, "%s", name);
break;
case CTF_K_VOLATILE:
ctf_decl_sprintf(&cd, "volatile");
@@ -301,6 +311,12 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
return (cd.cd_len);
}
+ssize_t
+ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
+{
+ return (ctf_type_qlname(fp, type, buf, len, NULL));
+}
+
/*
* Lookup the given type ID and print a string name for it into buf. If buf
* is too small, return NULL: the ECTF_NAMELEN error is set on 'fp' for us.
@@ -308,10 +324,19 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
char *
ctf_type_name(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
{
- ssize_t rv = ctf_type_lname(fp, type, buf, len);
+ ssize_t rv = ctf_type_qlname(fp, type, buf, len, NULL);
+ return (rv >= 0 && rv < len ? buf : NULL);
+}
+
+char *
+ctf_type_qname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len,
+ const char *qname)
+{
+ ssize_t rv = ctf_type_qlname(fp, type, buf, len, qname);
return (rv >= 0 && rv < len ? buf : NULL);
}
+
/*
* Resolve the type down to a base type node, and then return the size
* of the type storage in bytes.
diff --git a/usr/src/common/fs/bootfsops.c b/usr/src/common/fs/bootfsops.c
new file mode 100644
index 0000000000..5a693b80e5
--- /dev/null
+++ b/usr/src/common/fs/bootfsops.c
@@ -0,0 +1,329 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2013 Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/bootconf.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/vnode.h>
+#include <sys/fs/ufs_fsdir.h>
+#include <sys/fs/ufs_fs.h>
+#include <sys/fs/ufs_inode.h>
+#include <sys/sysmacros.h>
+#include <sys/bootvfs.h>
+#include <sys/bootinfo.h>
+#include <sys/filep.h>
+
+#ifdef _BOOT
+#include "../common/util.h"
+#else
+#include <sys/sunddi.h>
+#endif
+
+#define MAX_FILES MAX_BOOT_MODULES
+#define MAX_FDS 256
+
+extern void *bkmem_alloc(size_t);
+extern void bkmem_free(void *, size_t);
+
+/*
+ * TODO: Replace these declarations with inclusion of the ordinary userland
+ * bootfs headers once they're available.
+ */
+typedef struct bfile {
+ char bf_name[MAXPATHLEN];
+ caddr_t bf_addr;
+ size_t bf_size;
+ struct bfile *bf_next;
+ uint64_t bf_ino;
+} bfile_t;
+
+typedef struct bf_fd {
+ bfile_t *fd_file;
+ off_t fd_pos;
+} bf_fd_t;
+
+static bfile_t *head;
+static uint_t init_done;
+static bf_fd_t fds[MAX_FDS];
+
+static char cpath[MAXPATHLEN]; /* For canonicalising filenames */
+
+static void bbootfs_closeall(int);
+
+static void
+canonicalise(const char *fn, char *out)
+{
+ const char *p;
+ char *q, *s;
+ char *last;
+ char *oc;
+ int is_slash = 0;
+ static char scratch[MAXPATHLEN];
+
+ if (fn == NULL) {
+ *out = '\0';
+ return;
+ }
+
+ /*
+ * Remove leading slashes and condense all multiple slashes into one.
+ */
+ p = fn;
+ while (*p == '/')
+ ++p;
+
+ for (q = scratch; *p != '\0'; p++) {
+ if (*p == '/' && !is_slash) {
+ *q++ = '/';
+ is_slash = 1;
+ } else if (*p != '/') {
+ *q++ = *p;
+ is_slash = 0;
+ }
+ }
+ *q = '\0';
+
+ if (strncmp(scratch, "system/boot/", 12) == 0 ||
+ strcmp(scratch, "system/boot") == 0) {
+ s = scratch + 12;
+ } else {
+ s = scratch;
+ }
+
+ for (last = strsep(&s, "/"), q = oc = out; last != NULL;
+ last = strsep(&s, "/")) {
+ if (strcmp(last, ".") == 0)
+ continue;
+ if (strcmp(last, "..") == 0) {
+ for (oc = q; oc > out && *oc != '/'; oc--)
+ ;
+ q = oc;
+ continue;
+ }
+ if (q > out)
+ *q++ = '/';
+ q += snprintf(q, MAXPATHLEN - (q - out), "%s", last);
+ }
+
+ *q = '\0';
+}
+
+/* ARGSUSED */
+static int
+bbootfs_mountroot(char *str)
+{
+ return (-1);
+}
+
+static int
+bbootfs_unmountroot(void)
+{
+ return (-1);
+}
+
+static int
+bbootfs_init(void)
+{
+ bfile_t *fp;
+ char propname[32];
+ uint64_t propval;
+ uint_t i;
+
+ for (i = 0; i < MAX_FILES; i++) {
+ (void) snprintf(propname, sizeof (propname),
+ "module-name-%u", i);
+ if (do_bsys_getproplen(NULL, propname) < 0)
+ break;
+
+ if ((fp = bkmem_alloc(sizeof (bfile_t))) == NULL) {
+ bbootfs_closeall(1);
+ return (-1);
+ }
+
+ (void) do_bsys_getprop(NULL, propname, cpath);
+ canonicalise(cpath, fp->bf_name);
+
+ (void) snprintf(propname, sizeof (propname),
+ "module-addr-%u", i);
+ if (do_bsys_getproplen(NULL, propname) != sizeof (uint64_t)) {
+ bkmem_free(fp, sizeof (bfile_t));
+ continue;
+ }
+ (void) do_bsys_getprop(NULL, propname, &propval);
+ fp->bf_addr = (void *)(uintptr_t)propval;
+
+ (void) snprintf(propname, sizeof (propname),
+ "module-size-%u", i);
+ if (do_bsys_getproplen(NULL, propname) != sizeof (uint64_t)) {
+ bkmem_free(fp, sizeof (bfile_t));
+ continue;
+ }
+ (void) do_bsys_getprop(NULL, propname, &propval);
+ fp->bf_size = (size_t)propval;
+ fp->bf_ino = i;
+
+ fp->bf_next = head;
+ head = fp;
+ }
+
+ return (0);
+}
+
+/*ARGSUSED*/
+static int
+bbootfs_open(char *fn, int flags)
+{
+ uint_t i;
+ bfile_t *fp;
+
+ if (!init_done) {
+ if (bbootfs_init() != 0)
+ return (-1);
+
+ init_done = 1;
+ }
+
+ canonicalise(fn, cpath);
+
+ for (fp = head; fp != NULL; fp = fp->bf_next) {
+ if (strcmp(fp->bf_name, cpath) == 0)
+ break;
+ }
+
+ if (fp == NULL)
+ return (-1);
+
+ for (i = 0; i < MAX_FDS; i++) {
+ if (fds[i].fd_file == NULL) {
+ fds[i].fd_file = fp;
+ fds[i].fd_pos = 0;
+ return (i);
+ }
+ }
+
+ return (-1);
+}
+
+static int
+bbootfs_close(int fd)
+{
+ if (fds[fd].fd_file == NULL)
+ return (-1);
+
+ fds[fd].fd_file = NULL;
+ fds[fd].fd_pos = 0;
+
+ return (0);
+}
+
+static ssize_t
+bbootfs_read(int fd, caddr_t buf, size_t size)
+{
+ ssize_t len;
+ bf_fd_t *fdp = &fds[fd];
+
+ if (fdp->fd_file == NULL)
+ return (-1);
+
+ if (fdp->fd_pos >= fdp->fd_file->bf_size)
+ return (-1);
+
+ if (fdp->fd_pos + size > fdp->fd_file->bf_size)
+ len = fdp->fd_file->bf_size - fdp->fd_pos;
+ else
+ len = size;
+
+ bcopy(fdp->fd_file->bf_addr + fdp->fd_pos, buf, len);
+
+ fdp->fd_pos += len;
+
+ return (len);
+}
+
+static off_t
+bbootfs_lseek(int fd, off_t addr, int whence)
+{
+ bf_fd_t *fdp = &fds[fd];
+
+ if (fdp->fd_file == NULL)
+ return (-1);
+
+ switch (whence) {
+ case SEEK_CUR:
+ fdp->fd_pos += addr;
+ break;
+ case SEEK_SET:
+ fdp->fd_pos = addr;
+ break;
+ case SEEK_END:
+ fdp->fd_pos = fdp->fd_file->bf_size;
+ break;
+ default:
+ return (-1);
+ }
+
+ return (0);
+}
+
+static int
+bbootfs_fstat(int fd, struct bootstat *bsp)
+{
+ bf_fd_t *fdp = &fds[fd];
+
+ if (fdp->fd_file == NULL)
+ return (-1);
+
+ bsp->st_dev = 1;
+ bsp->st_ino = fdp->fd_file->bf_ino;
+ bsp->st_mode = 0444;
+ bsp->st_nlink = 1;
+ bsp->st_uid = bsp->st_gid = 0;
+ bsp->st_rdev = 0;
+ bsp->st_size = fdp->fd_file->bf_size;
+ bsp->st_blksize = 1;
+ bsp->st_blocks = fdp->fd_file->bf_size;
+ (void) strcpy(bsp->st_fstype, "bootfs");
+
+ return (0);
+}
+
+/* ARGSUSED */
+static void
+bbootfs_closeall(int flag)
+{
+ bfile_t *fp;
+
+ while (head != NULL) {
+ fp = head;
+ head = head->bf_next;
+
+ bkmem_free(fp, sizeof (bfile_t));
+ }
+
+ init_done = 0;
+}
+
+struct boot_fs_ops bbootfs_ops = {
+ "bootfs",
+ bbootfs_mountroot,
+ bbootfs_unmountroot,
+ bbootfs_open,
+ bbootfs_close,
+ bbootfs_read,
+ bbootfs_lseek,
+ bbootfs_fstat,
+ bbootfs_closeall,
+ NULL
+};
diff --git a/usr/src/common/openssl/README.ENGINE b/usr/src/common/openssl/README.ENGINE
index 0ff8333709..34ec921734 100644
--- a/usr/src/common/openssl/README.ENGINE
+++ b/usr/src/common/openssl/README.ENGINE
@@ -266,7 +266,7 @@
this depends heavily on your system/compiler and is a nightmare
known well to anyone who has worked with shared-library portability
before. 'gcc' on Linux, for example, would use the following syntax;
- gcc -shared -o dyn_atalla.so tmp_atalla.o -L../.. -lcrypto
+ gcc -shared -o dyn_atalla.so tmp_atalla.o -L../.. -lsunw_crypto
5) Test your shared library using "openssl engine" as explained in the
previous section. Eg. from the top-level directory, you might try;
apps/openssl engine -vvvv dynamic \
diff --git a/usr/src/common/openssl/README.SUNW b/usr/src/common/openssl/README.SUNW
index 674734e1ac..957bc17848 100644
--- a/usr/src/common/openssl/README.SUNW
+++ b/usr/src/common/openssl/README.SUNW
@@ -123,8 +123,8 @@ The following files are different from the OpenSSL 0.9.8a release.
if OpenSSL code itself is not subject to lint checks (with the exception
of crypto/engine/hw_pk11*.[ch] files).
- crypto/llib-lcrypto
- ssl/llib-lssl
+ crypto/llib-lsunw_crypto
+ ssl/llib-lsunw_ssl
7. OpenSSL version string was modified. Due to the fact that we don't upgrade
OpenSSL frequently we are forced to patch the currently shipped version. The
diff --git a/usr/src/common/util/string.h b/usr/src/common/util/string.h
index 052eeab4a4..f7acd734bd 100644
--- a/usr/src/common/util/string.h
+++ b/usr/src/common/util/string.h
@@ -61,6 +61,7 @@ extern char *strncpy(char *, const char *, size_t);
extern char *strrchr(const char *, int c);
extern char *strstr(const char *, const char *);
extern char *strpbrk(const char *, const char *);
+extern char *strsep(char **, const char *);
extern char *strncat(char *, const char *, size_t);
extern size_t strlcat(char *, const char *, size_t);
extern size_t strlcpy(char *, const char *, size_t);
diff --git a/usr/src/common/util/strtolctype.h b/usr/src/common/util/strtolctype.h
index 7b7afc6e30..535c014d1f 100644
--- a/usr/src/common/util/strtolctype.h
+++ b/usr/src/common/util/strtolctype.h
@@ -38,9 +38,13 @@ extern "C" {
* This header file contains a collection of macros that the strtou?ll?
* functions in common/util use to test characters. What we need is a kernel
* version of ctype.h.
+ *
+ * NOTE: These macros are used within several DTrace probe context functions.
+ * They must not be altered to make function calls or perform actions not
+ * safe in probe context.
*/
-#if defined(_KERNEL) && !defined(_BOOT)
+#if defined(_KERNEL) || defined(_BOOT)
#define isalnum(ch) (isalpha(ch) || isdigit(ch))
#define isalpha(ch) (isupper(ch) || islower(ch))
@@ -52,7 +56,7 @@ extern "C" {
#define isxdigit(ch) (isdigit(ch) || ((ch) >= 'a' && (ch) <= 'f') || \
((ch) >= 'A' && (ch) <= 'F'))
-#endif /* _KERNEL && !_BOOT */
+#endif /* _KERNEL || _BOOT */
#define DIGIT(x) \
(isdigit(x) ? (x) - '0' : islower(x) ? (x) + 10 - 'a' : (x) + 10 - 'A')
diff --git a/usr/src/common/zfs/zfeature_common.c b/usr/src/common/zfs/zfeature_common.c
index 0c46244f5c..4e0030bb83 100644
--- a/usr/src/common/zfs/zfeature_common.c
+++ b/usr/src/common/zfs/zfeature_common.c
@@ -170,7 +170,9 @@ zpool_feature_init(void)
"org.illumos:lz4_compress", "lz4_compress",
"LZ4 compression algorithm support.", B_FALSE, B_FALSE,
B_FALSE, NULL);
-
+ zfeature_register(SPA_FEATURE_FS_SS_LIMIT_OBS,
+ "com.joyent:filesystem_limits", "obsolete_fs_limits",
+ "Obsolete fs and ss limits.", B_TRUE, B_FALSE, B_FALSE, NULL);
zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP,
"com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump",
"Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE,
diff --git a/usr/src/common/zfs/zfeature_common.h b/usr/src/common/zfs/zfeature_common.h
index af59036c61..88e1fe2af3 100644
--- a/usr/src/common/zfs/zfeature_common.h
+++ b/usr/src/common/zfs/zfeature_common.h
@@ -43,6 +43,7 @@ typedef enum spa_feature {
SPA_FEATURE_ASYNC_DESTROY,
SPA_FEATURE_EMPTY_BPOBJ,
SPA_FEATURE_LZ4_COMPRESS,
+ SPA_FEATURE_FS_SS_LIMIT_OBS,
SPA_FEATURE_MULTI_VDEV_CRASH_DUMP,
SPA_FEATURE_SPACEMAP_HISTOGRAM,
SPA_FEATURE_ENABLED_TXG,
diff --git a/usr/src/common/zfs/zfs_prop.c b/usr/src/common/zfs/zfs_prop.c
index d51d629784..75627c33bf 100644
--- a/usr/src/common/zfs/zfs_prop.c
+++ b/usr/src/common/zfs/zfs_prop.c
@@ -419,6 +419,23 @@ zfs_prop_delegatable(zfs_prop_t prop)
return (pd->pd_attr != PROP_READONLY);
}
+boolean_t
+zfs_prop_cacheable(zfs_prop_t prop)
+{
+ /*
+ * It'd be nice if each prop had a flags field which could have flag
+ * like PROP_CACHEABLE, but since zprop_attr_t is an enum and this
+ * setting is orthogonal to the concepts of PROP_READONLY, etc., we have
+ * this function.
+ */
+ return (prop == ZFS_PROP_VERSION ||
+ prop == ZFS_PROP_NORMALIZE ||
+ prop == ZFS_PROP_UTF8ONLY ||
+ prop == ZFS_PROP_CASE ||
+ prop == ZFS_PROP_VOLSIZE ||
+ prop == ZFS_PROP_VOLBLOCKSIZE);
+}
+
/*
* Given a zfs dataset property name, returns the corresponding property ID.
*/
diff --git a/usr/src/common/zfs/zfs_prop.h b/usr/src/common/zfs/zfs_prop.h
index a63262311b..1796642c68 100644
--- a/usr/src/common/zfs/zfs_prop.h
+++ b/usr/src/common/zfs/zfs_prop.h
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _ZFS_PROP_H
@@ -86,6 +87,7 @@ typedef struct {
void zfs_prop_init(void);
zprop_type_t zfs_prop_get_type(zfs_prop_t);
boolean_t zfs_prop_delegatable(zfs_prop_t prop);
+boolean_t zfs_prop_cacheable(zfs_prop_t prop);
zprop_desc_t *zfs_prop_get_table(void);
/*
diff --git a/usr/src/grub/Makefile b/usr/src/grub/Makefile
index 28c2eca2ff..c31e9a802c 100644
--- a/usr/src/grub/Makefile
+++ b/usr/src/grub/Makefile
@@ -29,6 +29,7 @@ INST_TARGETS += $(ROOT_BOOT_GRUB)/$(GRUB_MENU)
INST_TARGETS += $(ROOT_BOOT_GRUB)/$(INSTALL_MENU)
INST_TARGETS += $(ROOT_BOOT_GRUB)/$(GRUB_DEFAULT)
INST_TARGETS += $(ROOT_BOOT_GRUB)/$(CAPABILITY)
+INST_TARGETS += $(ROOT_USR_SBIN)/grub
$(ROOT_BOOT_GRUB)/$(GRUB_DEFAULT) := FILEMODE = 444
$(ROOT_BOOT_GRUB)/$(CAPABILITY) := FILEMODE = 444
@@ -45,9 +46,14 @@ $(GRUB): FRC
$(ROOT_BOOT_GRUB)/%: $(ROOT_BOOT_GRUB) %
$(INS.file)
+$(ROOT_USR_SBIN)/%: $(GRUB)/grub/grub $(ROOT_USR_SBIN)
+ $(INS.file)
+
$(ROOT_BOOT_GRUB):
$(INS.dir)
+$(ROOT_USR_SBIN):
+ $(INS.dir)
clean clobber: $(SUBDIRS)
diff --git a/usr/src/grub/Makefile.grub b/usr/src/grub/Makefile.grub
index 18354324ae..99942fa2ed 100644
--- a/usr/src/grub/Makefile.grub
+++ b/usr/src/grub/Makefile.grub
@@ -10,3 +10,4 @@ PLATFORM = i86pc
ROOT_BOOT_GRUB = $(ROOT)/boot/grub
ROOT_PLAT_GRUB = $(ROOT)/platform/$(PLATFORM)/boot/grub
ROOT_SRC = $(ROOT)/usr/share/src/grub
+ROOT_USR_SBIN = $(ROOT)/usr/sbin
diff --git a/usr/src/grub/grub-0.97/stage2/Makefile.solaris b/usr/src/grub/grub-0.97/stage2/Makefile.solaris
index 94b168f43d..bb737888cd 100644
--- a/usr/src/grub/grub-0.97/stage2/Makefile.solaris
+++ b/usr/src/grub/grub-0.97/stage2/Makefile.solaris
@@ -65,6 +65,7 @@ LIBGRUB_OBJS = libgrub_a-boot.o \
libgrub_a-cmdline.o \
libgrub_a-common.o \
libgrub_a-disk_io.o \
+ libgrub_a-expand.o \
libgrub_a-fsys_ext2fs.o \
libgrub_a-fsys_fat.o \
libgrub_a-fsys_ffs.o \
@@ -155,6 +156,7 @@ DISKLESS_OBJS = diskless_exec-bios.o \
diskless_exec-common.o \
diskless_exec-console.o \
diskless_exec-disk_io.o \
+ diskless_exec-expand.o \
diskless_exec-fsys_ext2fs.o \
diskless_exec-fsys_fat.o \
diskless_exec-fsys_ffs.o \
@@ -198,8 +200,8 @@ $(DISKLESS_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE2_CFLAGS) \
E2FS_STAGE1_5_DATA = e2fs_stage1_5
E2FS_STAGE1_5_EXEC = e2fs_stage1_5.exec
-E2FS_STAGE1_5_ASMOBJS = e2fs_stage1_5_exec-asm.o \
- e2fs_stage1_5_exec-start.o
+E2FS_STAGE1_5_ASMOBJS = e2fs_stage1_5_exec-start.o \
+ e2fs_stage1_5_exec-asm.o
E2FS_STAGE1_5_OBJS = e2fs_stage1_5_exec-bios.o \
e2fs_stage1_5_exec-char_io.o \
@@ -222,8 +224,8 @@ $(E2FS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
FAT_STAGE1_5_DATA = fat_stage1_5
FAT_STAGE1_5_EXEC = fat_stage1_5.exec
-FAT_STAGE1_5_ASMOBJS = fat_stage1_5_exec-asm.o \
- fat_stage1_5_exec-start.o
+FAT_STAGE1_5_ASMOBJS = fat_stage1_5_exec-start.o \
+ fat_stage1_5_exec-asm.o
FAT_STAGE1_5_OBJS = fat_stage1_5_exec-bios.o \
fat_stage1_5_exec-char_io.o \
@@ -246,8 +248,8 @@ $(FAT_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
FFS_STAGE1_5_DATA = ffs_stage1_5
FFS_STAGE1_5_EXEC = ffs_stage1_5.exec
-FFS_STAGE1_5_ASMOBJS = ffs_stage1_5_exec-asm.o \
- ffs_stage1_5_exec-start.o
+FFS_STAGE1_5_ASMOBJS = ffs_stage1_5_exec-start.o \
+ ffs_stage1_5_exec-asm.o
FFS_STAGE1_5_OBJS = ffs_stage1_5_exec-bios.o \
ffs_stage1_5_exec-char_io.o \
@@ -270,8 +272,8 @@ $(FFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
ISO9660_STAGE1_5_DATA = iso9660_stage1_5
ISO9660_STAGE1_5_EXEC = iso9660_stage1_5.exec
-ISO9660_STAGE1_5_ASMOBJS = iso9660_stage1_5_exec-asm.o \
- iso9660_stage1_5_exec-start_eltorito.o
+ISO9660_STAGE1_5_ASMOBJS = iso9660_stage1_5_exec-start_eltorito.o \
+ iso9660_stage1_5_exec-asm.o
ISO9660_STAGE1_5_OBJS = iso9660_stage1_5_exec-bios.o \
iso9660_stage1_5_exec-char_io.o \
@@ -295,8 +297,8 @@ $(ISO9660_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
JFS_STAGE1_5_DATA = jfs_stage1_5
JFS_STAGE1_5_EXEC = jfs_stage1_5.exec
-JFS_STAGE1_5_ASMOBJS = jfs_stage1_5_exec-asm.o \
- jfs_stage1_5_exec-start.o
+JFS_STAGE1_5_ASMOBJS = jfs_stage1_5_exec-start.o \
+ jfs_stage1_5_exec-asm.o
JFS_STAGE1_5_OBJS = jfs_stage1_5_exec-bios.o \
jfs_stage1_5_exec-char_io.o \
@@ -319,8 +321,8 @@ $(JFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
MINIX_STAGE1_5_DATA = minix_stage1_5
MINIX_STAGE1_5_EXEC = minix_stage1_5.exec
-MINIX_STAGE1_5_ASMOBJS = minix_stage1_5_exec-asm.o \
- minix_stage1_5_exec-start.o
+MINIX_STAGE1_5_ASMOBJS = minix_stage1_5_exec-start.o \
+ minix_stage1_5_exec-asm.o
MINIX_STAGE1_5_OBJS = minix_stage1_5_exec-bios.o \
minix_stage1_5_exec-char_io.o \
@@ -367,6 +369,7 @@ PRE_STAGE2_OBJS = pre_stage2_exec-bios.o \
pre_stage2_exec-common.o \
pre_stage2_exec-console.o \
pre_stage2_exec-disk_io.o \
+ pre_stage2_exec-expand.o \
pre_stage2_exec-fsys_ext2fs.o \
pre_stage2_exec-fsys_fat.o \
pre_stage2_exec-fsys_ffs.o \
@@ -423,8 +426,8 @@ $(PXELOADER_ASMOBJS) := CCASFLAGS = $(BASE_CCASFLAGS) $(STAGE2_CFLAGS)
REISERFS_STAGE1_5_DATA = reiserfs_stage1_5
REISERFS_STAGE1_5_EXEC = reiserfs_stage1_5.exec
-REISERFS_STAGE1_5_ASMOBJS = reiserfs_stage1_5_exec-asm.o \
- reiserfs_stage1_5_exec-start.o
+REISERFS_STAGE1_5_ASMOBJS = reiserfs_stage1_5_exec-start.o \
+ reiserfs_stage1_5_exec-asm.o
REISERFS_STAGE1_5_OBJS = reiserfs_stage1_5_exec-bios.o \
reiserfs_stage1_5_exec-char_io.o \
@@ -478,8 +481,8 @@ $(START_ELTORITO_ASMOBJS) := CCASFLAGS = $(BASE_CCASFLAGS) $(STAGE2_CFLAGS)
UFS2_STAGE1_5_DATA = ufs2_stage1_5
UFS2_STAGE1_5_EXEC = ufs2_stage1_5.exec
-UFS2_STAGE1_5_ASMOBJS = ufs2_stage1_5_exec-asm.o \
- ufs2_stage1_5_exec-start.o
+UFS2_STAGE1_5_ASMOBJS = ufs2_stage1_5_exec-start.o \
+ ufs2_stage1_5_exec-asm.o
UFS2_STAGE1_5_OBJS = ufs2_stage1_5_exec-bios.o \
ufs2_stage1_5_exec-char_io.o \
@@ -502,8 +505,8 @@ $(UFS2_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
UFS_STAGE1_5_DATA = ufs_stage1_5
UFS_STAGE1_5_EXEC = ufs_stage1_5.exec
-UFS_STAGE1_5_ASMOBJS = ufs_stage1_5_exec-asm.o \
- ufs_stage1_5_exec-start.o
+UFS_STAGE1_5_ASMOBJS = ufs_stage1_5_exec-start.o \
+ ufs_stage1_5_exec-asm.o
UFS_STAGE1_5_OBJS = ufs_stage1_5_exec-bios.o \
ufs_stage1_5_exec-char_io.o \
@@ -526,8 +529,8 @@ $(UFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
ZFS_STAGE1_5_DATA = zfs_stage1_5
ZFS_STAGE1_5_EXEC = zfs_stage1_5.exec
-ZFS_STAGE1_5_ASMOBJS = zfs_stage1_5_exec-asm.o \
- zfs_stage1_5_exec-start.o
+ZFS_STAGE1_5_ASMOBJS = zfs_stage1_5_exec-start.o \
+ zfs_stage1_5_exec-asm.o
ZFS_STAGE1_5_OBJS = zfs_stage1_5_exec-bios.o \
zfs_stage1_5_exec-char_io.o \
@@ -554,8 +557,8 @@ $(ZFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
VSTAFS_STAGE1_5_DATA = vstafs_stage1_5
VSTAFS_STAGE1_5_EXEC = vstafs_stage1_5.exec
-VSTAFS_STAGE1_5_ASMOBJS = vstafs_stage1_5_exec-asm.o \
- vstafs_stage1_5_exec-start.o
+VSTAFS_STAGE1_5_ASMOBJS = vstafs_stage1_5_exec-start.o \
+ vstafs_stage1_5_exec-asm.o
VSTAFS_STAGE1_5_OBJS = vstafs_stage1_5_exec-bios.o \
vstafs_stage1_5_exec-char_io.o \
@@ -578,8 +581,8 @@ $(VSTAFS_STAGE1_5_OBJS) := CFLAGS = $(BASE_CFLAGS) $(STAGE1_5_CFLAGS) \
XFS_STAGE1_5_DATA = xfs_stage1_5
XFS_STAGE1_5_EXEC = xfs_stage1_5.exec
-XFS_STAGE1_5_ASMOBJS = xfs_stage1_5_exec-asm.o \
- xfs_stage1_5_exec-start.o
+XFS_STAGE1_5_ASMOBJS = xfs_stage1_5_exec-start.o \
+ xfs_stage1_5_exec-asm.o
XFS_STAGE1_5_OBJS = xfs_stage1_5_exec-bios.o \
xfs_stage1_5_exec-char_io.o \
@@ -607,7 +610,8 @@ SRC_DIR = $(ROOT_SRC)/stage2
SRC_ZFSINC_DIR = $(SRC_DIR)/zfs-include
SRC_FILES = Makefile.am Makefile.in apic.h apm.S asm.S bios.c boot.c \
builtins.c char_io.c cmdline.c common.c console.c defs.h \
- dir.h disk_inode.h disk_inode_ffs.h disk_io.c fat.h \
+ dir.h disk_inode.h disk_inode_ffs.h disk_io.c expand.c \
+ expand.h fat.h \
filesys.h freebsd.h fs.h fsys_ext2fs.c fsys_fat.c \
fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
zfs_sha256.c zfs_lzjb.c zfs_lz4.c zfs_fletcher.c fsys_zfs.c \
diff --git a/usr/src/grub/grub-0.97/stage2/asm.S b/usr/src/grub/grub-0.97/stage2/asm.S
index 3e9986c0df..5d6faf7010 100644
--- a/usr/src/grub/grub-0.97/stage2/asm.S
+++ b/usr/src/grub/grub-0.97/stage2/asm.S
@@ -2664,8 +2664,8 @@ ENTRY(get_target_operating_mode)
movw $0xec00, %ax
movw $0x03, %bx
int $0x15
-/* XXX still need to pass back return */
+ setc %al
movw %ax, %cx
DATA32 call EXT_C(real_to_prot)
@@ -2673,6 +2673,7 @@ ENTRY(get_target_operating_mode)
xorl %eax, %eax
movw %cx, %ax
+ movl %eax, 0x1c(%esp)
popa
ret
diff --git a/usr/src/grub/grub-0.97/stage2/boot.c b/usr/src/grub/grub-0.97/stage2/boot.c
index cfc2336a4c..027de7709b 100644
--- a/usr/src/grub/grub-0.97/stage2/boot.c
+++ b/usr/src/grub/grub-0.97/stage2/boot.c
@@ -25,6 +25,8 @@
#include "imgact_aout.h"
#include "i386-elf.h"
+#define SAFE_LOAD_BASE 0xc800000
+
static int cur_addr;
entry_func entry_addr;
static struct mod_list mll[99];
@@ -773,6 +775,17 @@ load_module (char *module, char *arg)
{
int len;
+ /*
+ * XXX Workaround for RICHMOND-16: on some systems, the region
+ * [c700000, c800000) is corrupted by an unknown external (off-CPU) actor(s)
+ * during boot. To be on the safe side, we will simply ensure that every
+ * module is loaded above this region. Note that this means this particular
+ * boot loader supports only systems with at least 200 MB of DRAM plus the
+ * amount of space used by any modules.
+ */
+ if (cur_addr < SAFE_LOAD_BASE)
+ cur_addr = SAFE_LOAD_BASE;
+
/* if we are supposed to load on 4K boundaries */
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
diff --git a/usr/src/grub/grub-0.97/stage2/builtins.c b/usr/src/grub/grub-0.97/stage2/builtins.c
index af4a6f28bb..a6f5acd011 100644
--- a/usr/src/grub/grub-0.97/stage2/builtins.c
+++ b/usr/src/grub/grub-0.97/stage2/builtins.c
@@ -49,6 +49,7 @@
#endif
#include <cpu.h>
+#include <expand.h>
/* The type of kernel loaded. */
kernel_t kernel_type;
@@ -86,7 +87,7 @@ static int configfile_func (char *arg, int flags);
static void solaris_config_file (void);
#endif
-static unsigned int min_mem64 = 0;
+unsigned int min_mem64 = 0;
#if defined(__sun) && !defined(GRUB_UTIL)
extern void __enable_execute_stack (void *);
@@ -2791,117 +2792,6 @@ static struct builtin builtin_ioprobe =
};
-/*
- * To boot from a ZFS root filesystem, the kernel$ or module$ commands
- * must include "-B $ZFS-BOOTFS" to expand to the zfs-bootfs, bootpath,
- * and diskdevid boot property values for passing to the kernel:
- *
- * e.g.
- * kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=ttya
- *
- * $ZFS-BOOTFS is expanded to
- *
- * zfs-bootfs=<rootpool-name/zfs-rootfilesystem-object-num>,
- * bootpath=<device phys path>,
- * diskdevid=<device id>
- *
- * if both bootpath and diskdevid can be found.
- * e.g
- * zfs-bootfs=rpool/85,
- * bootpath="/pci@0,0/pci1022,7450@a/pci17c2,10@4/sd@0,0:a",
- * diskdevid="id1,sd@SSEAGATE_ST336607LC______3JA0LNHE0000741326W6/a"
- */
-static int
-expand_dollar_bootfs(char *in, char *out)
-{
- char *token, *tmpout = out;
- int outlen, blen;
- int postcomma = 0;
-
- /* no op if this is not zfs */
- if (is_zfs_mount == 0)
- return (0);
-
- if (current_bootpath[0] == '\0' && current_devid[0] == '\0') {
- errnum = ERR_NO_BOOTPATH;
- return (1);
- }
-
- outlen = strlen(in);
- blen = current_bootfs_obj == 0 ? strlen(current_rootpool) :
- strlen(current_rootpool) + 11;
-
- out[0] = '\0';
- while (token = strstr(in, "$ZFS-BOOTFS")) {
-
- if ((outlen += blen) >= MAX_CMDLINE) {
- errnum = ERR_WONT_FIT;
- return (1);
- }
-
- token[0] = '\0';
- grub_sprintf(tmpout, "%s", in);
- token[0] = '$';
- in = token + 11; /* skip over $ZFS-BOOTFS */
- tmpout = out + strlen(out);
-
- /* Note: %u only fits 32 bit integer; */
- if (current_bootfs_obj > 0)
- grub_sprintf(tmpout, "zfs-bootfs=%s/%u",
- current_rootpool, current_bootfs_obj);
- else
- grub_sprintf(tmpout, "zfs-bootfs=%s",
- current_rootpool);
- tmpout = out + strlen(out);
- }
-
- /*
- * Check to see if 'zfs-bootfs' was explicitly specified on the command
- * line so that we can insert the 'bootpath' property.
- */
- if ((tmpout == out) && (token = strstr(in, "zfs-bootfs")) != NULL) {
- token[0] = '\0';
- grub_strcpy(tmpout, in);
- token[0] = 'z';
- in = token;
-
- tmpout = out + strlen(out);
- postcomma = 1;
- }
-
- /*
- * Set the 'bootpath' property if a ZFS dataset was specified, either
- * through '$ZFS-BOOTFS' or an explicit 'zfs-bootfs' setting.
- */
- if (tmpout != out) {
- if (current_bootpath[0] != '\0') {
- if ((outlen += 12 + strlen(current_bootpath))
- >= MAX_CMDLINE) {
- errnum = ERR_WONT_FIT;
- return (1);
- }
- grub_sprintf(tmpout,
- postcomma ? "bootpath=\"%s\"," : ",bootpath=\"%s\"",
- current_bootpath);
- tmpout = out + strlen(out);
- }
-
- if (current_devid[0] != '\0') {
- if ((outlen += 13 + strlen(current_devid))
- >= MAX_CMDLINE) {
- errnum = ERR_WONT_FIT;
- return (1);
- }
- grub_sprintf(tmpout,
- postcomma ? "diskdevid=\"%s\"," : ",diskdevid=\"%s\"",
- current_devid);
- }
- }
-
- strncat(out, in, MAX_CMDLINE);
- return (0);
-}
-
/* kernel */
static int
kernel_func (char *arg, int flags)
@@ -3007,289 +2897,17 @@ static struct builtin builtin_min_mem64 =
"even on 64-bit capable hardware."
};
-int
-check_min_mem64()
-{
- if (min_mem64 == 0)
- return (1);
-
- if ((mbi.mem_upper / 10240) * 11 >= min_mem64)
- return (1);
-
- return (0);
-}
-
-static int detect_target_operating_mode();
-
-int
-amd64_config_cpu(void)
-{
- struct amd64_cpuid_regs __vcr, *vcr = &__vcr;
- uint32_t maxeax;
- uint32_t max_maxeax = 0x100;
- char vendor[13];
- int isamd64 = 0;
- uint32_t stdfeatures = 0, xtdfeatures = 0;
- uint64_t efer;
-
- /*
- * This check may seem silly, but if the C preprocesor symbol __amd64
- * is #defined during compilation, something that may outwardly seem
- * like a good idea, uts/common/sys/isa_defs.h will #define _LP64,
- * which will cause uts/common/sys/int_types.h to typedef uint64_t as
- * an unsigned long - which is only 4 bytes in size when using a 32-bit
- * compiler.
- *
- * If that happens, all the page table translation routines will fail
- * horribly, so check the size of uint64_t just to insure some degree
- * of sanity in future operations.
- */
- /*LINTED [sizeof result is invarient]*/
- if (sizeof (uint64_t) != 8)
- prom_panic("grub compiled improperly, unable to boot "
- "64-bit AMD64 executables");
-
- /*
- * If the CPU doesn't support the CPUID instruction, it's definitely
- * not an AMD64.
- */
- if (amd64_cpuid_supported() == 0)
- return (0);
-
- amd64_cpuid_insn(0, vcr);
-
- maxeax = vcr->r_eax;
- {
- /*LINTED [vendor string from cpuid data]*/
- uint32_t *iptr = (uint32_t *)vendor;
-
- *iptr++ = vcr->r_ebx;
- *iptr++ = vcr->r_edx;
- *iptr++ = vcr->r_ecx;
-
- vendor[12] = '\0';
- }
-
- if (maxeax > max_maxeax) {
- grub_printf("cpu: warning, maxeax was 0x%x -> 0x%x\n",
- maxeax, max_maxeax);
- maxeax = max_maxeax;
- }
-
- if (maxeax < 1)
- return (0); /* no additional functions, not an AMD64 */
- else {
- uint_t family, model, step;
-
- amd64_cpuid_insn(1, vcr);
-
- /*
- * All AMD64/IA32e processors technically SHOULD report
- * themselves as being in family 0xf, but for some reason
- * Simics doesn't, and this may change in the future, so
- * don't error out if it's not true.
- */
- if ((family = BITX(vcr->r_eax, 11, 8)) == 0xf)
- family += BITX(vcr->r_eax, 27, 20);
-
- if ((model = BITX(vcr->r_eax, 7, 4)) == 0xf)
- model += BITX(vcr->r_eax, 19, 16) << 4;
- step = BITX(vcr->r_eax, 3, 0);
-
- grub_printf("cpu: '%s' family %d model %d step %d\n",
- vendor, family, model, step);
- stdfeatures = vcr->r_edx;
- }
-
- amd64_cpuid_insn(0x80000000, vcr);
-
- if (vcr->r_eax & 0x80000000) {
- uint32_t xmaxeax = vcr->r_eax;
- const uint32_t max_xmaxeax = 0x80000100;
-
- if (xmaxeax > max_xmaxeax) {
- grub_printf("amd64: warning, xmaxeax was "
- "0x%x -> 0x%x\n", xmaxeax, max_xmaxeax);
- xmaxeax = max_xmaxeax;
- }
-
- if (xmaxeax >= 0x80000001) {
- amd64_cpuid_insn(0x80000001, vcr);
- xtdfeatures = vcr->r_edx;
- }
- }
-
- if (BITX(xtdfeatures, 29, 29)) /* long mode */
- isamd64++;
- else
- grub_printf("amd64: CPU does NOT support long mode\n");
-
- if (!BITX(stdfeatures, 0, 0)) {
- grub_printf("amd64: CPU does NOT support FPU\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 4, 4)) {
- grub_printf("amd64: CPU does NOT support TSC\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 5, 5)) {
- grub_printf("amd64: CPU does NOT support MSRs\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 6, 6)) {
- grub_printf("amd64: CPU does NOT support PAE\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 8, 8)) {
- grub_printf("amd64: CPU does NOT support CX8\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 13, 13)) {
- grub_printf("amd64: CPU does NOT support PGE\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 19, 19)) {
- grub_printf("amd64: CPU does NOT support CLFSH\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 23, 23)) {
- grub_printf("amd64: CPU does NOT support MMX\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 24, 24)) {
- grub_printf("amd64: CPU does NOT support FXSR\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 25, 25)) {
- grub_printf("amd64: CPU does NOT support SSE\n");
- isamd64--;
- }
-
- if (!BITX(stdfeatures, 26, 26)) {
- grub_printf("amd64: CPU does NOT support SSE2\n");
- isamd64--;
- }
-
- if (isamd64 < 1) {
- grub_printf("amd64: CPU does not support amd64 executables.\n");
- return (0);
- }
-
- amd64_rdmsr(MSR_AMD_EFER, &efer);
- if (efer & AMD_EFER_SCE)
- grub_printf("amd64: EFER_SCE (syscall/sysret) already "
- "enabled\n");
- if (efer & AMD_EFER_NXE)
- grub_printf("amd64: EFER_NXE (no-exec prot) already enabled\n");
- if (efer & AMD_EFER_LME)
- grub_printf("amd64: EFER_LME (long mode) already enabled\n");
-
- return (detect_target_operating_mode());
-}
-
-static int
-detect_target_operating_mode()
-{
- int ret, ah;
-
- ah = get_target_operating_mode();
-
- ah = ah >> 8;
-
- /* XXX still need to pass back the return from the call */
- ret = 0;
-
- if (ah == 0x86 && (ret & CB) != 0) {
- grub_printf("[BIOS 'Detect Target Operating Mode' "
- "callback unsupported on this platform]\n");
- return (1); /* unsupported, ignore */
- }
-
- if (ah == 0x0 && (ret & CB) == 0) {
- grub_printf("[BIOS accepted mixed-mode target setting!]\n");
- return (1); /* told the bios what we're up to */
- }
-
- if (ah == 0 && ret & CB) {
- grub_printf("fatal: BIOS reports this machine CANNOT run in "
- "mixed 32/64-bit mode!\n");
- return (0);
- }
-
- grub_printf("warning: BIOS Detect Target Operating Mode callback "
- "confused.\n %%ax >> 8 = 0x%x, carry = %d\n", ah,
- ret & CB ? 1 : 0);
-
- return (1);
-}
-
-
-int
-isamd64()
-{
- static int ret = -1;
-
- if (ret == -1)
- ret = amd64_config_cpu();
-
- return (ret);
-}
-
-static void
-expand_arch (char *arg, char *newarg)
-{
- char *index;
-
- newarg[0] = '\0';
-
- while ((index = strstr(arg, "$ISADIR")) != NULL) {
-
- index[0] = '\0';
- strncat(newarg, arg, MAX_CMDLINE);
- index[0] = '$';
-
- if (isamd64() && check_min_mem64())
- strncat(newarg, "amd64", MAX_CMDLINE);
-
- arg = index + 7;
- }
-
- strncat(newarg, arg, MAX_CMDLINE);
- return;
-}
-
-/* kernel$ */
static int
kernel_dollar_func (char *arg, int flags)
{
char newarg[MAX_CMDLINE]; /* everything boils down to MAX_CMDLINE */
grub_printf("loading '%s' ...\n", arg);
- expand_arch(arg, newarg);
-
- if (kernel_func(newarg, flags))
- return (1);
+ expand_string(arg, newarg, MAX_CMDLINE);
- mb_cmdline = (char *)MB_CMDLINE_BUF;
- if (expand_dollar_bootfs(newarg, mb_cmdline)) {
- grub_printf("cannot expand $ZFS-BOOTFS for dataset %s\n",
- current_bootfs);
- return (1);
- }
+ grub_printf("loading '%s' ...\n", newarg);
- grub_printf("'%s' is loaded\n", mb_cmdline);
- mb_cmdline += grub_strlen(mb_cmdline) + 1;
-
- return (0);
+ return (kernel_func(newarg, flags));
}
static struct builtin builtin_kernel_dollar =
@@ -3298,7 +2916,8 @@ static struct builtin builtin_kernel_dollar =
kernel_dollar_func,
BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
"kernel$ [--no-mem-option] [--type=TYPE] FILE [ARG ...]",
- " Just like kernel, but with $ISADIR expansion."
+ " Just like kernel, but with variable expansion, including the legacy"
+ " (and nonconforming) variables $ISADIR and $ZFS-BOOTFS."
};
@@ -3521,26 +3140,14 @@ static struct builtin builtin_module =
static int
module_dollar_func (char *arg, int flags)
{
- char newarg[MAX_CMDLINE]; /* everything boils down to MAX_CMDLINE */
- char *cmdline_sav;
+ char newarg[MAX_CMDLINE]; /* everything boils down to MAX_CMDLINE */
+ char *cmdline_sav;
- grub_printf("loading '%s' ...\n", arg);
- expand_arch(arg, newarg);
-
- cmdline_sav = (char *)mb_cmdline;
- if (module_func(newarg, flags))
- return (1);
+ grub_printf("loading '%s' ...\n", arg);
+ expand_string(arg, newarg, MAX_CMDLINE);
+ grub_printf("loading '%s' ...\n", newarg);
- if (expand_dollar_bootfs(newarg, cmdline_sav)) {
- grub_printf("cannot expand $ZFS-BOOTFS for dataset %s\n",
- current_bootfs);
- return (1);
- }
-
- grub_printf("'%s' is loaded\n", (char *)cmdline_sav);
- mb_cmdline += grub_strlen(cmdline_sav) + 1;
-
- return (0);
+ return (module_func(newarg, flags));
}
static struct builtin builtin_module_dollar =
@@ -4850,15 +4457,15 @@ setup_func (char *arg, int flags)
{
char tmp[16];
grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF);
- grub_strncat (device, tmp, 256);
+ grub_strncat (device, tmp, sizeof (device));
}
if ((partition & 0x00FF00) != 0x00FF00)
{
char tmp[16];
grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF));
- grub_strncat (device, tmp, 256);
+ grub_strncat (device, tmp, sizeof (device));
}
- grub_strncat (device, ")", 256);
+ grub_strncat (device, ")", sizeof (device));
}
int embed_stage1_5 (char *stage1_5, int drive, int partition)
@@ -5289,11 +4896,14 @@ static struct builtin builtin_terminal =
"terminal",
terminal_func,
BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
- "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]",
+ "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics] [composite]",
"Select a terminal. When multiple terminals are specified, wait until"
" you push any key to continue. If both console and serial are specified,"
" the terminal to which you input a key first will be selected. If no"
- " argument is specified, print current setting. The option --dumb"
+ " argument is specified, print current setting. To accomodate systems"
+ " where console redirection may or may not be present, the composite"
+ " console will direct output to the serial and BIOS consoles, and accept"
+ " input from either one, without requiring selection. The option --dumb"
" specifies that your terminal is dumb, otherwise, vt100-compatibility"
" is assumed. If you specify --no-echo, input characters won't be echoed."
" If you specify --no-edit, the BASH-like editing feature will be disabled."
@@ -5815,6 +5425,54 @@ static struct builtin builtin_vbeprobe =
"Probe VBE information. If the mode number MODE is specified, show only"
" the information about only the mode."
};
+
+static int
+variable_func(char *arg, int flags)
+{
+ char name[EV_NAMELEN];
+ char *val;
+ int err;
+
+ if (*arg == '\0') {
+ dump_variables();
+ return (0);
+ }
+
+ if ((val = grub_strchr(arg, ' ')) != NULL) {
+ if (val - arg >= sizeof (name)) {
+ errnum = ERR_WONT_FIT;
+ return (1);
+ }
+ (void) grub_memcpy(name, arg, (val - arg));
+ name[val - arg] = '\0';
+ val = skip_to(0, arg);
+ } else {
+ if (grub_strlen(arg) >= sizeof (name)) {
+ errnum = ERR_WONT_FIT;
+ return (1);
+ }
+ (void) grub_strcpy(name, arg);
+ }
+
+ if ((err = set_variable(name, val)) != 0) {
+ errnum = err;
+ return (1);
+ }
+
+ return (0);
+}
+
+static struct builtin builtin_variable =
+{
+ "variable",
+ variable_func,
+ BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_SCRIPT | BUILTIN_HELP_LIST,
+ "variable NAME [VALUE]",
+ "Set the variable NAME to VALUE, or to the empty string if no value is"
+ " given. NAME must contain no spaces. There is no quoting mechanism"
+ " and nested variable references are not allowed. Variable values may"
+ " be substituted into the kernel$ and module$ commands using ${NAME}."
+};
/* The table of builtin commands. Sorted in dictionary order. */
@@ -5922,6 +5580,7 @@ struct builtin *builtin_table[] =
&builtin_title,
&builtin_unhide,
&builtin_uppermem,
+ &builtin_variable,
&builtin_vbeprobe,
&builtin_verbose,
0
diff --git a/usr/src/grub/grub-0.97/stage2/char_io.c b/usr/src/grub/grub-0.97/stage2/char_io.c
index d73bc71001..3557552e01 100644
--- a/usr/src/grub/grub-0.97/stage2/char_io.c
+++ b/usr/src/grub/grub-0.97/stage2/char_io.c
@@ -71,6 +71,22 @@ struct term_entry term_table[] =
0,
0
},
+ {
+ "composite",
+ TERM_NEED_INIT,
+ 24,
+ composite_putchar,
+ composite_checkkey,
+ composite_getkey,
+ serial_getxy,
+ composite_gotoxy,
+ composite_cls,
+ composite_setcolorstate,
+ console_setcolor,
+ console_setcursor,
+ 0,
+ 0
+ },
#endif /* SUPPORT_SERIAL */
#ifdef SUPPORT_HERCULES
{
@@ -1047,10 +1063,10 @@ grub_strncat (char *s1, const char *s2, int n)
while (i < n && (s1[i++] = *(s2++)) != 0);
- s1[n - 1] = 0;
-
- if (i >= n)
+ if (i >= n) {
+ s1[n - 1] = 0;
return 0;
+ }
s1[i] = 0;
diff --git a/usr/src/grub/grub-0.97/stage2/cmdline.c b/usr/src/grub/grub-0.97/stage2/cmdline.c
index 46c5fda027..6d5591e1de 100644
--- a/usr/src/grub/grub-0.97/stage2/cmdline.c
+++ b/usr/src/grub/grub-0.97/stage2/cmdline.c
@@ -212,8 +212,27 @@ run_script (char *script, char *heap)
intervention. */
if (fallback_entryno < 0)
{
- grub_printf ("\nPress any key to continue...");
- (void) getkey ();
+ int time1, time2 = -1;
+
+ grub_printf (
+ "\nRebooting in 2 minutes (press any key to continue)...");
+ grub_timeout = 120;
+
+ /* using RT clock now, need to initialize value */
+ while ((time1 = getrtsecs()) == 0xFF);
+
+ while (grub_timeout >= 0) {
+ if ((time1 = getrtsecs()) != time2 && time1 != 0xFF) {
+ time2 = time1;
+ grub_timeout--;
+ }
+
+ if (checkkey() >= 0)
+ break;
+ }
+
+ grub_printf ("\nresetting...");
+ grub_reboot();
}
return 1;
diff --git a/usr/src/grub/grub-0.97/stage2/common.c b/usr/src/grub/grub-0.97/stage2/common.c
index b4bb696641..3ca5340206 100644
--- a/usr/src/grub/grub-0.97/stage2/common.c
+++ b/usr/src/grub/grub-0.97/stage2/common.c
@@ -99,7 +99,8 @@ char *err_list[] =
[ERR_NEWER_VERSION] = "Newer on-disk pool version",
[ERR_NOTXPM] = "Image not in XPM graphics format",
[ERR_TOOMANYCOLORS] = "Image cannot use more than 14 colors",
- [ERR_CORRUPTXPM] = "File contains corrupt XPM image data"
+ [ERR_CORRUPTXPM] = "File contains corrupt XPM image data",
+ [ERR_NOVAR] = "Unknown variable reference",
};
diff --git a/usr/src/grub/grub-0.97/stage2/cpu.h b/usr/src/grub/grub-0.97/stage2/cpu.h
index 34180727d9..ad2948978f 100644
--- a/usr/src/grub/grub-0.97/stage2/cpu.h
+++ b/usr/src/grub/grub-0.97/stage2/cpu.h
@@ -30,6 +30,8 @@
extern "C" {
#endif
+#include <shared.h>
+
typedef unsigned int uint_t;
typedef unsigned long ulong_t;
@@ -37,11 +39,6 @@ typedef unsigned long ulong_t;
#include <controlregs.h>
-#define CB 0x0001
-
-extern void amd64_flush_tlb(void);
-extern void amd64_flush_tlbentry(caddr_t);
-
extern ulong_t amd64_get_cr2(void);
extern ulong_t amd64_get_cr0(void);
extern ulong_t amd64_get_cr3(void);
diff --git a/usr/src/grub/grub-0.97/stage2/expand.c b/usr/src/grub/grub-0.97/stage2/expand.c
new file mode 100644
index 0000000000..43f8b1f0d7
--- /dev/null
+++ b/usr/src/grub/grub-0.97/stage2/expand.c
@@ -0,0 +1,465 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <expand.h>
+#include <shared.h>
+
+#ifdef SUPPORT_NETBOOT
+#include <grub.h>
+#endif
+
+#include <cpu.h>
+
+#define EVF_DEFINED 0x01
+#define EVF_VALUESET 0x02
+
+typedef struct variable {
+ char v_name[EV_NAMELEN];
+ unsigned int v_flags;
+ char v_value[220]; /* 256 - EV_NAMELEN - sizeof (fields) */
+} variable_t;
+
+static variable_t expvars[32];
+static const unsigned int nexpvars = 32;
+
+int
+set_variable(const char *name, const char *value)
+{
+ unsigned int i;
+ unsigned int avail = nexpvars;
+
+ if (strlen(name) >= sizeof (expvars[0].v_name))
+ return (ERR_WONT_FIT);
+
+ if (value != NULL && strlen(value) >= sizeof (expvars[0].v_value))
+ return (ERR_WONT_FIT);
+
+ for (i = 0; i < nexpvars; i++) {
+ if (expvars[i].v_flags & EVF_DEFINED) {
+ if (grub_strcmp(expvars[i].v_name, name) == 0)
+ break;
+ } else if (i < avail) {
+ avail = i;
+ }
+ }
+
+ if (i == nexpvars) {
+ if (avail == nexpvars)
+ return (ERR_WONT_FIT);
+
+ i = avail;
+ (void) grub_strcpy(expvars[i].v_name, name);
+ expvars[i].v_flags = EVF_DEFINED;
+ }
+
+ if (value != NULL) {
+ (void) grub_strcpy(expvars[i].v_value, value);
+ expvars[i].v_flags |= EVF_VALUESET;
+ } else {
+ expvars[i].v_flags &= ~EVF_VALUESET;
+ }
+
+ return (0);
+}
+
+const char *
+get_variable(const char *name)
+{
+ unsigned int i;
+
+ for (i = 0; i < nexpvars; i++) {
+ if (!(expvars[i].v_flags & EVF_DEFINED))
+ continue;
+ if (grub_strcmp(expvars[i].v_name, name) == 0) {
+ if (expvars[i].v_flags & EVF_VALUESET)
+ return (expvars[i].v_value);
+ return ("");
+ }
+ }
+
+ return (NULL);
+}
+
+static int
+detect_target_operating_mode(void)
+{
+ int ret, ah;
+
+ /*
+ * This function returns 16 bits. The upper 8 are the value of %ah
+ * after calling int 15/ec00. The lower 8 bits are zero if the BIOS
+ * call left CF clear, nonzero otherwise.
+ */
+ ret = get_target_operating_mode();
+ ah = ret & 0xff;
+ ret >>= 8;
+
+ if (ah == 0x86 && ret != 0) {
+ grub_printf("[BIOS 'Detect Target Operating Mode' "
+ "callback unsupported on this platform]\n");
+ return (1); /* unsupported, ignore */
+ }
+
+ if (ah == 0 && ret == 0) {
+ grub_printf("[BIOS accepted mixed-mode target setting!]\n");
+ return (1); /* told the bios what we're up to */
+ }
+
+ if (ah == 0 && ret != 0) {
+ grub_printf("fatal: BIOS reports this machine CANNOT run in "
+ "mixed 32/64-bit mode!\n");
+ return (0);
+ }
+
+ grub_printf("warning: BIOS Detect Target Operating Mode callback "
+ "confused.\n %%ax >> 8 = 0x%x, carry = %d\n", ah, ret);
+
+ return (1);
+}
+
+static int
+amd64_config_cpu(void)
+{
+ struct amd64_cpuid_regs __vcr, *vcr = &__vcr;
+ uint32_t maxeax;
+ uint32_t max_maxeax = 0x100;
+ char vendor[13];
+ int isamd64 = 0;
+ uint32_t stdfeatures = 0, xtdfeatures = 0;
+ uint64_t efer;
+
+ /*
+ * This check may seem silly, but if the C preprocesor symbol __amd64
+ * is #defined during compilation, something that may outwardly seem
+ * like a good idea, uts/common/sys/isa_defs.h will #define _LP64,
+ * which will cause uts/common/sys/int_types.h to typedef uint64_t as
+ * an unsigned long - which is only 4 bytes in size when using a 32-bit
+ * compiler.
+ *
+ * If that happens, all the page table translation routines will fail
+ * horribly, so check the size of uint64_t just to insure some degree
+ * of sanity in future operations.
+ */
+ /*LINTED [sizeof result is invarient]*/
+ if (sizeof (uint64_t) != 8)
+ prom_panic("grub compiled improperly, unable to boot "
+ "64-bit AMD64 executables");
+
+ /*
+ * If the CPU doesn't support the CPUID instruction, it's definitely
+ * not an AMD64.
+ */
+ if (amd64_cpuid_supported() == 0)
+ return (0);
+
+ amd64_cpuid_insn(0, vcr);
+
+ maxeax = vcr->r_eax;
+ {
+ /*LINTED [vendor string from cpuid data]*/
+ uint32_t *iptr = (uint32_t *)vendor;
+
+ *iptr++ = vcr->r_ebx;
+ *iptr++ = vcr->r_edx;
+ *iptr++ = vcr->r_ecx;
+
+ vendor[12] = '\0';
+ }
+
+ if (maxeax > max_maxeax) {
+ grub_printf("cpu: warning, maxeax was 0x%x -> 0x%x\n",
+ maxeax, max_maxeax);
+ maxeax = max_maxeax;
+ }
+
+ if (maxeax < 1)
+ return (0); /* no additional functions, not an AMD64 */
+ else {
+ uint_t family, model, step;
+
+ amd64_cpuid_insn(1, vcr);
+
+ /*
+ * All AMD64/IA32e processors technically SHOULD report
+ * themselves as being in family 0xf, but for some reason
+ * Simics doesn't, and this may change in the future, so
+ * don't error out if it's not true.
+ */
+ if ((family = BITX(vcr->r_eax, 11, 8)) == 0xf)
+ family += BITX(vcr->r_eax, 27, 20);
+
+ if ((model = BITX(vcr->r_eax, 7, 4)) == 0xf)
+ model += BITX(vcr->r_eax, 19, 16) << 4;
+ step = BITX(vcr->r_eax, 3, 0);
+
+ grub_printf("cpu: '%s' family %d model %d step %d\n",
+ vendor, family, model, step);
+ stdfeatures = vcr->r_edx;
+ }
+
+ amd64_cpuid_insn(0x80000000, vcr);
+
+ if (vcr->r_eax & 0x80000000) {
+ uint32_t xmaxeax = vcr->r_eax;
+ const uint32_t max_xmaxeax = 0x80000100;
+
+ if (xmaxeax > max_xmaxeax) {
+ grub_printf("amd64: warning, xmaxeax was "
+ "0x%x -> 0x%x\n", xmaxeax, max_xmaxeax);
+ xmaxeax = max_xmaxeax;
+ }
+
+ if (xmaxeax >= 0x80000001) {
+ amd64_cpuid_insn(0x80000001, vcr);
+ xtdfeatures = vcr->r_edx;
+ }
+ }
+
+ if (BITX(xtdfeatures, 29, 29)) /* long mode */
+ isamd64++;
+ else
+ grub_printf("amd64: CPU does NOT support long mode\n");
+
+ if (!BITX(stdfeatures, 0, 0)) {
+ grub_printf("amd64: CPU does NOT support FPU\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 4, 4)) {
+ grub_printf("amd64: CPU does NOT support TSC\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 5, 5)) {
+ grub_printf("amd64: CPU does NOT support MSRs\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 6, 6)) {
+ grub_printf("amd64: CPU does NOT support PAE\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 8, 8)) {
+ grub_printf("amd64: CPU does NOT support CX8\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 13, 13)) {
+ grub_printf("amd64: CPU does NOT support PGE\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 19, 19)) {
+ grub_printf("amd64: CPU does NOT support CLFSH\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 23, 23)) {
+ grub_printf("amd64: CPU does NOT support MMX\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 24, 24)) {
+ grub_printf("amd64: CPU does NOT support FXSR\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 25, 25)) {
+ grub_printf("amd64: CPU does NOT support SSE\n");
+ isamd64--;
+ }
+
+ if (!BITX(stdfeatures, 26, 26)) {
+ grub_printf("amd64: CPU does NOT support SSE2\n");
+ isamd64--;
+ }
+
+ if (isamd64 < 1) {
+ grub_printf("amd64: CPU does not support amd64 executables.\n");
+ return (0);
+ }
+
+ amd64_rdmsr(MSR_AMD_EFER, &efer);
+ if (efer & AMD_EFER_SCE)
+ grub_printf("amd64: EFER_SCE (syscall/sysret) already "
+ "enabled\n");
+ if (efer & AMD_EFER_NXE)
+ grub_printf("amd64: EFER_NXE (no-exec prot) already enabled\n");
+ if (efer & AMD_EFER_LME)
+ grub_printf("amd64: EFER_LME (long mode) already enabled\n");
+
+ return (detect_target_operating_mode());
+}
+
+static int
+isamd64()
+{
+ static int ret = -1;
+
+ if (ret == -1)
+ ret = amd64_config_cpu();
+
+ return (ret);
+}
+
+static int
+check_min_mem64(void)
+{
+ if (min_mem64 == 0)
+ return (1);
+
+ if ((mbi.mem_upper / 10240) * 11 >= min_mem64)
+ return (1);
+
+ return (0);
+}
+
+/*
+ * Given the nul-terminated input string s, expand all variable references
+ * within that string into the buffer pointed to by d, which must be of length
+ * not less than len bytes.
+ *
+ * We also expand the special case tokens "$ISADIR" and "$ZFS-BOOTFS" here.
+ *
+ * If the string will not fit, returns ERR_WONT_FIT.
+ * If a nonexistent variable is referenced, returns ERR_NOVAR.
+ * Otherwise, returns 0. The resulting string is nul-terminated. On error,
+ * the contents of the destination buffer are undefined.
+ */
+int
+expand_string(const char *s, char *d, unsigned int len)
+{
+ unsigned int i;
+ int vlen;
+ const char *p;
+ char *q;
+ const char *start;
+ char name[EV_NAMELEN];
+ const char *val;
+
+ for (p = s, q = d; *p != '\0' && q < d + len; ) {
+ /* Special case: $ISADIR */
+ if (grub_strncmp(p, "$ISADIR", 7) == 0) {
+ if (isamd64() && check_min_mem64()) {
+ if (q + 5 >= d + len)
+ return (ERR_WONT_FIT);
+ (void) grub_memcpy(q, "amd64", 5);
+ q += 5; /* amd64 */
+ }
+ p += 7; /* $ISADIR */
+ continue;
+ }
+ /* Special case: $ZFS-BOOTFS */
+ if (grub_strncmp(p, "$ZFS-BOOTFS", 11) == 0 &&
+ is_zfs_mount != 0) {
+ if (current_bootpath[0] == '\0' &&
+ current_devid[0] == '\0') {
+ return (ERR_NO_BOOTPATH);
+ }
+
+ /* zfs-bootfs=%s/%u */
+ vlen = (current_bootfs_obj > 0) ? 10 : 0;
+ vlen += 11;
+ vlen += strlen(current_rootpool);
+
+ /* ,bootpath=\"%s\" */
+ if (current_bootpath[0] != '\0')
+ vlen += 12 + strlen(current_bootpath);
+
+ /* ,diskdevid=\"%s\" */
+ if (current_devid[0] != '\0')
+ vlen += 13 + strlen(current_devid);
+
+ if (q + vlen >= d + len)
+ return (ERR_WONT_FIT);
+
+ if (current_bootfs_obj > 0) {
+ q += grub_sprintf(q, "zfs-bootfs=%s/%u",
+ current_rootpool, current_bootfs_obj);
+ } else {
+ q += grub_sprintf(q, "zfs-bootfs=%s",
+ current_rootpool);
+ }
+ if (current_bootpath[0] != '\0') {
+ q += grub_sprintf(q, ",bootpath=\"%s\"",
+ current_bootpath);
+ }
+ if (current_devid[0] != '\0') {
+ q += grub_sprintf(q, ",diskdevid=\"%s\"",
+ current_devid);
+ }
+
+ p += 11; /* $ZFS-BOOTFS */
+ continue;
+ }
+ if (*p == '$' && *(p + 1) == '{') {
+ start = p + 2;
+ for (p = start; *p != '\0' && *p != '}' &&
+ p - start < sizeof (name) - 1; p++) {
+ name[p - start] = *p;
+ }
+ /*
+ * Unterminated reference. Copy verbatim.
+ */
+ if (p - start >= sizeof (name) - 1 || *p != '}') {
+ p = start;
+ *q++ = '$';
+ *q++ = '{';
+ continue;
+ }
+
+ name[p - start] = '\0';
+ val = get_variable(name);
+ if (val == NULL)
+ return (ERR_NOVAR);
+
+ if ((vlen = grub_strlen(val)) >= q + len - d)
+ return (ERR_WONT_FIT);
+
+ (void) grub_memcpy(q, val, vlen);
+ q += vlen;
+ p++;
+ } else {
+ *q++ = *p++;
+ }
+ }
+
+ if (q >= d + len)
+ return (ERR_WONT_FIT);
+
+ *q = '\0';
+
+ return (0);
+}
+
+void
+dump_variables(void)
+{
+ unsigned int i;
+
+ for (i = 0; i < nexpvars; i++) {
+ if (!(expvars[i].v_flags & EVF_DEFINED))
+ continue;
+ (void) grub_printf("[%u] '%s' => '%s'\n", i, expvars[i].v_name,
+ (expvars[i].v_flags & EVF_VALUESET) ?
+ expvars[i].v_value : "");
+ }
+}
diff --git a/usr/src/grub/grub-0.97/stage2/expand.h b/usr/src/grub/grub-0.97/stage2/expand.h
new file mode 100644
index 0000000000..ed8344e8af
--- /dev/null
+++ b/usr/src/grub/grub-0.97/stage2/expand.h
@@ -0,0 +1,31 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _GRUB_EXPAND_H
+#define _GRUB_EXPAND_H
+
+#define EV_NAMELEN 32
+
+extern void init_variables(void);
+extern int set_variable(const char *, const char *);
+extern const char *get_variable(const char *);
+extern int expand_string(const char *, char *, unsigned int);
+extern void dump_variables(void);
+
+#endif
diff --git a/usr/src/grub/grub-0.97/stage2/serial.c b/usr/src/grub/grub-0.97/stage2/serial.c
index 16c376fa7d..4e120e000d 100644
--- a/usr/src/grub/grub-0.97/stage2/serial.c
+++ b/usr/src/grub/grub-0.97/stage2/serial.c
@@ -25,6 +25,9 @@
#include <term.h>
#include <terminfo.h>
+#define COMP_BS_SERIAL 0x01
+#define COMP_BS_BIOS 0x02
+
/* An input buffer. */
static char input_buf[8];
static int npending = 0;
@@ -33,6 +36,7 @@ static int serial_x;
static int serial_y;
static int keep_track = 1;
+static int composite_bitset = COMP_BS_SERIAL | COMP_BS_BIOS;
/* Hardware-dependent definitions. */
@@ -177,10 +181,10 @@ serial_hw_init (unsigned short port, unsigned int speed,
/* Get rid of TERM_NEED_INIT from the serial terminal. */
for (i = 0; term_table[i].name; i++)
- if (grub_strcmp (term_table[i].name, "serial") == 0)
+ if (grub_strcmp (term_table[i].name, "serial") == 0 ||
+ grub_strcmp (term_table[i].name, "composite") == 0)
{
term_table[i].flags &= ~TERM_NEED_INIT;
- break;
}
/* FIXME: should check if the serial terminal was found. */
@@ -402,8 +406,12 @@ serial_getxy (void)
void
serial_gotoxy (int x, int y)
{
+ int saved_cbs = composite_bitset;
+
keep_track = 0;
+ composite_bitset &= ~COMP_BS_BIOS;
ti_cursor_address (x, y);
+ composite_bitset = saved_cbs;
keep_track = 1;
serial_x = x;
@@ -413,8 +421,12 @@ serial_gotoxy (int x, int y)
void
serial_cls (void)
{
+ int saved_cbs = composite_bitset;
+
keep_track = 0;
+ composite_bitset &= ~COMP_BS_BIOS;
ti_clear_screen ();
+ composite_bitset = saved_cbs;
keep_track = 1;
serial_x = serial_y = 0;
@@ -423,12 +435,67 @@ serial_cls (void)
void
serial_setcolorstate (color_state state)
{
+ int saved_cbs = composite_bitset;
+
keep_track = 0;
+ composite_bitset &= ~COMP_BS_BIOS;
if (state == COLOR_STATE_HIGHLIGHT)
ti_enter_standout_mode ();
else
ti_exit_standout_mode ();
+ composite_bitset = saved_cbs;
keep_track = 1;
}
+void
+composite_putchar (int c)
+{
+ if (composite_bitset & COMP_BS_SERIAL)
+ serial_putchar (c);
+ if (composite_bitset & COMP_BS_BIOS)
+ console_putchar (c);
+}
+
+int
+composite_getkey (void)
+{
+ for (;;) {
+ if (serial_checkkey () != -1)
+ return (serial_getkey ());
+ if (console_checkkey () != -1)
+ return (console_getkey ());
+ }
+}
+
+int
+composite_checkkey (void)
+{
+ int ch;
+
+ if ((ch = serial_checkkey ()) != -1)
+ return (ch);
+ return (console_checkkey ());
+}
+
+void
+composite_gotoxy (int x, int y)
+{
+ serial_gotoxy (x, y);
+ console_gotoxy (x, y);
+}
+
+void
+composite_cls (void)
+{
+ serial_cls();
+ console_cls();
+}
+
+void
+composite_setcolorstate (color_state state)
+{
+ serial_setcolorstate (state);
+ console_setcolorstate (state);
+}
+
#endif /* SUPPORT_SERIAL */
diff --git a/usr/src/grub/grub-0.97/stage2/shared.h b/usr/src/grub/grub-0.97/stage2/shared.h
index 205715b021..cb41978ce3 100644
--- a/usr/src/grub/grub-0.97/stage2/shared.h
+++ b/usr/src/grub/grub-0.97/stage2/shared.h
@@ -579,7 +579,7 @@ typedef enum
ERR_NOTXPM,
ERR_TOOMANYCOLORS,
ERR_CORRUPTXPM,
-
+ ERR_NOVAR,
MAX_ERR_NUM
} grub_error_t;
@@ -639,6 +639,8 @@ extern int fallback_entryno;
extern int default_entry;
extern int current_entryno;
+extern unsigned int min_mem64;
+
/* The constants for password types. */
typedef enum
{
diff --git a/usr/src/grub/grub-0.97/stage2/stage2.c b/usr/src/grub/grub-0.97/stage2/stage2.c
index 896635b62d..c02e9ef2e4 100644
--- a/usr/src/grub/grub-0.97/stage2/stage2.c
+++ b/usr/src/grub/grub-0.97/stage2/stage2.c
@@ -19,6 +19,9 @@
#include <shared.h>
#include <term.h>
+#include <expand.h>
+
+#define MENU_ROWS 7
grub_jmp_buf restart_env;
@@ -237,6 +240,7 @@ run_menu (char *menu_entries, char *config_entries, int num_entries,
int c, time1, time2 = -1, first_entry = 0;
char *cur_entry = 0;
struct term_entry *prev_term = NULL;
+ const char *console = NULL;
/*
* Main loop for menu UI.
@@ -247,7 +251,7 @@ restart:
invariant for TERM_DUMB: first_entry == 0 */
if (! (current_term->flags & TERM_DUMB))
{
- while (entryno > 11)
+ while (entryno > MENU_ROWS - 1)
{
first_entry++;
entryno--;
@@ -306,7 +310,7 @@ restart:
if (current_term->flags & TERM_DUMB)
print_entries_raw (num_entries, first_entry, menu_entries);
else
- print_border (3, 12);
+ print_border (3, MENU_ROWS);
grub_printf ("\n\
Use the %c and %c keys to select which entry is highlighted.\n",
@@ -332,10 +336,20 @@ restart:
selected line, or escape to go back to the main menu.");
}
+ /* The selected OS console is special; if it's in use, tell the user. */
+ console = get_variable("os_console");
+ if (console != NULL) {
+ printf("\n\n Selected OS console device is '%s'."
+ "\n To change OS console device, enter command-line mode"
+ "\n and use 'variable os_console <dev>', then Esc to return."
+ "\n Valid <dev> values are: ttya, ttyb, ttyc, ttyd, vga",
+ console);
+ }
+
if (current_term->flags & TERM_DUMB)
grub_printf ("\n\nThe selected entry is %d ", entryno);
else
- print_entries (3, 12, first_entry, entryno, menu_entries);
+ print_entries (3, MENU_ROWS, first_entry, entryno, menu_entries);
}
/* XX using RT clock now, need to initialize value */
@@ -425,7 +439,7 @@ restart:
else if (first_entry > 0)
{
first_entry--;
- print_entries (3, 12, first_entry, entryno,
+ print_entries (3, MENU_ROWS, first_entry, entryno,
menu_entries);
}
}
@@ -437,7 +451,7 @@ restart:
entryno++;
else
{
- if (entryno < 11)
+ if (entryno < MENU_ROWS - 1)
{
print_entry (4 + entryno, 0,
get_entry (menu_entries,
@@ -449,17 +463,17 @@ restart:
first_entry + entryno,
0));
}
- else if (num_entries > 12 + first_entry)
+ else if (num_entries > MENU_ROWS + first_entry)
{
first_entry++;
- print_entries (3, 12, first_entry, entryno, menu_entries);
+ print_entries (3, MENU_ROWS, first_entry, entryno, menu_entries);
}
}
}
else if (c == 7)
{
/* Page Up */
- first_entry -= 12;
+ first_entry -= MENU_ROWS;
if (first_entry < 0)
{
entryno += first_entry;
@@ -467,20 +481,20 @@ restart:
if (entryno < 0)
entryno = 0;
}
- print_entries (3, 12, first_entry, entryno, menu_entries);
+ print_entries (3, MENU_ROWS, first_entry, entryno, menu_entries);
}
else if (c == 3)
{
/* Page Down */
- first_entry += 12;
+ first_entry += MENU_ROWS;
if (first_entry + entryno + 1 >= num_entries)
{
- first_entry = num_entries - 12;
+ first_entry = num_entries - MENU_ROWS;
if (first_entry < 0)
first_entry = 0;
entryno = num_entries - first_entry - 1;
}
- print_entries (3, 12, first_entry, entryno, menu_entries);
+ print_entries (3, MENU_ROWS, first_entry, entryno, menu_entries);
}
if (config_entries)
@@ -503,7 +517,8 @@ restart:
{
/* But `o' differs from `O', since it may causes
the menu screen to scroll up. */
- if (entryno < 11 || (current_term->flags & TERM_DUMB))
+ if (entryno < MENU_ROWS - 1 ||
+ (current_term->flags & TERM_DUMB))
entryno++;
else
first_entry++;
@@ -541,7 +556,7 @@ restart:
if (entryno >= num_entries)
entryno--;
- if (first_entry && num_entries < 12 + first_entry)
+ if (first_entry && num_entries < MENU_ROWS + first_entry)
first_entry--;
}
@@ -553,7 +568,7 @@ restart:
grub_printf ("\n");
}
else
- print_entries (3, 12, first_entry, entryno, menu_entries);
+ print_entries (3, MENU_ROWS, first_entry, entryno, menu_entries);
}
cur_entry = menu_entries;
diff --git a/usr/src/grub/grub-0.97/stage2/term.h b/usr/src/grub/grub-0.97/stage2/term.h
index 8ed8b9dc86..65d4220669 100644
--- a/usr/src/grub/grub-0.97/stage2/term.h
+++ b/usr/src/grub/grub-0.97/stage2/term.h
@@ -119,6 +119,14 @@ int serial_getxy (void);
void serial_gotoxy (int x, int y);
void serial_cls (void);
void serial_setcolorstate (color_state state);
+
+void composite_putchar (int c);
+int composite_checkkey (void);
+int composite_getkey (void);
+int composite_getxy (void);
+void composite_gotoxy (int x, int y);
+void composite_cls (void);
+void composite_setcolorstate (color_state state);
#endif
#ifdef SUPPORT_HERCULES
diff --git a/usr/src/head/Makefile b/usr/src/head/Makefile
index 21a5dfc1f9..da028880c5 100644
--- a/usr/src/head/Makefile
+++ b/usr/src/head/Makefile
@@ -146,6 +146,7 @@ HDRS= $($(MACH)_HDRS) $(ATTRDB_HDRS) \
regex.h \
regexp.h \
resolv.h \
+ resolv_joy.h \
rje.h \
rtld_db.h \
sac.h \
@@ -205,6 +206,7 @@ HDRS= $($(MACH)_HDRS) $(ATTRDB_HDRS) \
wordexp.h \
xti.h \
xti_inet.h \
+ zdoor.h \
zone.h
ISOHDRS = \
diff --git a/usr/src/head/libzonecfg.h b/usr/src/head/libzonecfg.h
index d41dbb0520..0212224de5 100644
--- a/usr/src/head/libzonecfg.h
+++ b/usr/src/head/libzonecfg.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBZONECFG_H
@@ -42,6 +43,7 @@ extern "C" {
#include <netinet/in.h>
#include <sys/socket.h>
#include <net/if.h>
+#include <sys/mac.h>
#include <stdio.h>
#include <rctl.h>
#include <zone.h>
@@ -127,6 +129,8 @@ extern "C" {
#define MAXAUTHS 4096
#define ZONE_MGMT_PROF "Zone Management"
+#define ZONE_INT32SZ 11 /* string to hold 32bit int. */
+
/* Owner, group, and mode (defined by packaging) for the config directory */
#define ZONE_CONFIG_UID 0 /* root */
#define ZONE_CONFIG_GID 3 /* sys */
@@ -150,9 +154,11 @@ extern "C" {
#define ALIAS_MAXSEMIDS "max-sem-ids"
#define ALIAS_MAXLOCKEDMEM "locked"
#define ALIAS_MAXSWAP "swap"
+#define ALIAS_MAXPHYSMEM "physical"
#define ALIAS_SHARES "cpu-shares"
#define ALIAS_CPUCAP "cpu-cap"
#define ALIAS_MAXPROCS "max-processes"
+#define ALIAS_ZFSPRI "zfs-io-priority"
/* Default name for zone detached manifest */
#define ZONE_DETACHED "SUNWdetached.xml"
@@ -191,15 +197,30 @@ struct zone_fstab {
char zone_fs_raw[MAXPATHLEN]; /* device to fsck */
};
+/*
+ * Generic resource attribute list.
+ * Key/value resource that can be attached to net or device.
+ */
+struct zone_res_attrtab {
+ char zone_res_attr_name[MAXNAMELEN];
+ char zone_res_attr_value[MAXNAMELEN];
+ struct zone_res_attrtab *zone_res_attr_next;
+};
+
struct zone_nwiftab {
char zone_nwif_address[INET6_ADDRSTRLEN]; /* shared-ip only */
char zone_nwif_allowed_address[INET6_ADDRSTRLEN]; /* excl-ip only */
char zone_nwif_physical[LIFNAMSIZ];
+ char zone_nwif_mac[MAXMACADDRLEN]; /* excl-ip only */
+ char zone_nwif_vlan_id[ZONE_INT32SZ]; /* excl-ip only */
+ char zone_nwif_gnic[LIFNAMSIZ]; /* excl-ip only */
char zone_nwif_defrouter[INET6_ADDRSTRLEN];
+ struct zone_res_attrtab *zone_nwif_attrp;
};
struct zone_devtab {
char zone_dev_match[MAXPATHLEN];
+ struct zone_res_attrtab *zone_dev_attrp;
};
struct zone_rctlvaltab {
@@ -230,10 +251,6 @@ struct zone_psettab {
char zone_importance[MAXNAMELEN];
};
-struct zone_mcaptab {
- char zone_physmem_cap[MAXNAMELEN];
-};
-
struct zone_pkgtab {
char zone_pkg_name[MAXNAMELEN];
char zone_pkg_version[ZONE_PKG_VERSMAX];
@@ -317,6 +334,8 @@ extern int zonecfg_set_bootargs(zone_dochandle_t, char *);
extern int zonecfg_get_sched_class(zone_dochandle_t, char *, size_t);
extern int zonecfg_set_sched(zone_dochandle_t, char *);
extern int zonecfg_get_dflt_sched_class(zone_dochandle_t, char *, int);
+extern zoneid_t zonecfg_get_did(zone_dochandle_t);
+extern void zonecfg_set_did(zone_dochandle_t);
/*
* Set/retrieve the brand for the zone
@@ -341,6 +360,15 @@ extern int zonecfg_find_mounts(char *, int(*)(const struct mnttab *,
void *), void *);
/*
+ * Resource key/value attributes (properties).
+ */
+extern int zonecfg_add_res_attr(struct zone_res_attrtab **,
+ struct zone_res_attrtab *);
+extern void zonecfg_free_res_attr_list(struct zone_res_attrtab *);
+extern int zonecfg_remove_res_attr(struct zone_res_attrtab **,
+ struct zone_res_attrtab *);
+
+/*
* Network interface configuration.
*/
extern int zonecfg_add_nwif(zone_dochandle_t, struct zone_nwiftab *);
@@ -422,13 +450,6 @@ extern int zonecfg_modify_pset(zone_dochandle_t, struct zone_psettab *);
extern int zonecfg_lookup_pset(zone_dochandle_t, struct zone_psettab *);
/*
- * mem-cap configuration.
- */
-extern int zonecfg_delete_mcap(zone_dochandle_t);
-extern int zonecfg_modify_mcap(zone_dochandle_t, struct zone_mcaptab *);
-extern int zonecfg_lookup_mcap(zone_dochandle_t, struct zone_mcaptab *);
-
-/*
* Temporary pool support functions.
*/
extern int zonecfg_destroy_tmp_pool(char *, char *, int);
@@ -485,7 +506,6 @@ extern int zonecfg_setdsent(zone_dochandle_t);
extern int zonecfg_getdsent(zone_dochandle_t, struct zone_dstab *);
extern int zonecfg_enddsent(zone_dochandle_t);
extern int zonecfg_getpsetent(zone_dochandle_t, struct zone_psettab *);
-extern int zonecfg_getmcapent(zone_dochandle_t, struct zone_mcaptab *);
extern int zonecfg_getpkgdata(zone_dochandle_t, uu_avl_pool_t *,
uu_avl_t *);
extern int zonecfg_setdevperment(zone_dochandle_t);
@@ -509,6 +529,7 @@ extern int zonecfg_set_limitpriv(zone_dochandle_t, char *);
* Higher-level routines.
*/
extern int zone_get_brand(char *, char *, size_t);
+extern zoneid_t zone_get_did(char *);
extern int zone_get_rootpath(char *, char *, size_t);
extern int zone_get_devroot(char *, char *, size_t);
extern int zone_get_zonepath(char *, char *, size_t);
@@ -517,7 +538,9 @@ extern int zone_set_state(char *, zone_state_t);
extern char *zone_state_str(zone_state_t);
extern int zonecfg_get_name_by_uuid(const uuid_t, char *, size_t);
extern int zonecfg_get_uuid(const char *, uuid_t);
+extern int zonecfg_set_uuid(const char *, const char *, const char *);
extern int zonecfg_default_brand(char *, size_t);
+extern int zonecfg_fix_obsolete(zone_dochandle_t);
/*
* Iterator for configured zones.
diff --git a/usr/src/head/resolv_joy.h b/usr/src/head/resolv_joy.h
new file mode 100644
index 0000000000..262cf6121d
--- /dev/null
+++ b/usr/src/head/resolv_joy.h
@@ -0,0 +1,472 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
+ * All Rights Reserved
+ *
+ * Portions of this source code were derived from Berkeley
+ * 4.3 BSD under license from the regents of the University of
+ * California.
+ */
+
+/*
+ * BIND 4.9.4:
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * --Copyright--
+ *
+ * End BIND 4.9.4
+ */
+
+/*
+ * Copyright (c) 1983, 1987, 1989
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * @(#)resolv.h 8.1 (Berkeley) 6/2/93
+ * $Id: resolv.h,v 8.52 2003/04/29 02:27:03 marka Exp $
+ */
+
+#ifndef _RESOLV_JOY_H
+#define _RESOLV_JOY_H
+
+#ifdef _RESOLV_H_
+#error "resolv.h and resolv_joy.h should not be used together"
+#endif
+
+#include <sys/param.h>
+
+#include <stdio.h>
+#include <arpa/nameser.h>
+#include <sys/socket.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Revision information. This is the release date in YYYYMMDD format.
+ * It can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__RES > 19931104)". Do not
+ * compare for equality; rather, use it to determine whether your resolver
+ * is new enough to contain a certain feature.
+ */
+
+#define __RES 20090302
+
+#pragma redefine_extname dn_expand joy_dn_expand
+#pragma redefine_extname res_nsearch joy_res_nsearch
+#pragma redefine_extname res_ninit joy_res_ninit
+#pragma redefine_extname res_ndestroy joy_res_ndestroy
+#pragma redefine_extname res_gethostbyaddr joy_res_gethostbyaddr
+#pragma redefine_extname res_gethostbyname joy_res_gethostbyname
+#pragma redefine_extname res_gethostbyname2 joy_res_gethostbyname2
+#pragma redefine_extname res_endhostent joy_res_endhostent
+#pragma redefine_extname res_sethostent joy_res_sethostent
+#pragma redefine_extname __res_override_retry __joy_res_override_retry
+#pragma redefine_extname __res_unset_no_hosts_fallback \
+ __joy_res_unset_no_hosts_fallback
+#pragma redefine_extname __res_set_no_hosts_fallback \
+ __joy_res_set_no_hosts_fallback
+#pragma redefine_extname __h_errno __joy_h_errno
+#pragma redefine_extname __ns_get16 __joy_ns_get16
+#pragma redefine_extname __ns_get32 __joy_ns_get32
+
+
+#define RES_SET_H_ERRNO(r, x) __h_errno_set(r, x)
+struct __res_state; /* forward */
+
+void __h_errno_set(struct __res_state *res, int err);
+
+/*
+ * Resolver configuration file.
+ * Normally not present, but may contain the address of the
+ * initial name server(s) to query and the domain search list.
+ */
+
+#ifndef _PATH_RESCONF
+#define _PATH_RESCONF "/etc/resolv.conf"
+#endif
+
+#ifdef __STDC__
+#ifndef __P
+#define __P(x) x
+#endif
+#else
+#ifndef __P
+#define __P(x) ()
+#endif
+#endif /* __STDC__ */
+
+typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
+ res_sendhookact;
+
+typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr * const *ns,
+ const uchar_t **query,
+ int *querylen,
+ uchar_t *ans,
+ int anssiz,
+ int *resplen));
+
+typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr *ns,
+ const uchar_t *query,
+ int querylen,
+ uchar_t *ans,
+ int anssiz,
+ int *resplen));
+
+struct res_sym {
+ int number; /* Identifying number, like T_MX */
+ const char *name; /* Its symbolic name, like "MX" */
+ const char *humanname; /* Its fun name, like "mail exchanger" */
+};
+
+/*
+ * Global defines and variables for resolver stub.
+ */
+/* ADDRSORT and MAXADDR retained for compatibility; not used */
+#define ADDRSORT 1 /* enable the address-sorting option */
+#define MAXADDR 10 /* max # addresses to sort by */
+
+#define MAXNS 32 /* max # name servers we'll track */
+#define MAXDFLSRCH 3 /* # default domain levels to try */
+#define MAXDNSRCH 6 /* max # domains in search path */
+#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
+
+#define RES_TIMEOUT 5 /* min. seconds between retries */
+#define MAXRESOLVSORT 10 /* number of net to sort on */
+#define RES_MAXNDOTS 15 /* should reflect bit field size */
+#define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */
+#define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */
+#define RES_DFLRETRY 2 /* Default #/tries. */
+#define RES_MAXTIME 65535 /* Infinity, in milliseconds. */
+
+struct __res_state_ext;
+
+struct __res_state {
+ int retrans; /* retransmission time interval */
+ int retry; /* number of times to retransmit */
+#ifdef __sun
+ uint_t options; /* option flags - see below. */
+#else
+ ulong_t options; /* option flags - see below. */
+#endif
+ int nscount; /* number of name servers */
+ struct sockaddr_in
+ nsaddr_list[MAXNS]; /* address of name server */
+#define nsaddr nsaddr_list[0] /* for backward compatibility */
+ ushort_t id; /* current packet id */
+ char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
+ char defdname[256]; /* default domain (deprecated) */
+#ifdef __sun
+ uint_t pfcode; /* RES_PRF_ flags - see below. */
+#else
+ ulong_t pfcode; /* RES_PRF_ flags - see below. */
+#endif
+ unsigned ndots:4; /* threshold for initial abs. query */
+ unsigned nsort:4; /* number of elements in sort_list[] */
+ char unused[3];
+ struct {
+ struct in_addr addr;
+ unsigned int mask;
+ } sort_list[MAXRESOLVSORT];
+ res_send_qhook qhook; /* query hook */
+ res_send_rhook rhook; /* response hook */
+ int res_h_errno; /* last one set for this context */
+ int _vcsock; /* PRIVATE: for res_send VC i/o */
+ uint_t _flags; /* PRIVATE: see below */
+ uint_t _pad; /* make _u 64 bit aligned */
+ union {
+ /* On an 32-bit arch this means 512b total. */
+ char pad[72 - 4*sizeof (int) - 2*sizeof (void *)];
+ struct {
+ uint16_t nscount;
+ uint16_t nstimes[MAXNS]; /* ms. */
+ int nssocks[MAXNS];
+ struct __res_state_ext *ext; /* extention for IPv6 */
+ uchar_t _rnd[16]; /* PRIVATE: random state */
+ } _ext;
+ } _u;
+};
+
+typedef struct __res_state *res_state;
+
+union res_sockaddr_union {
+ struct sockaddr_in sin;
+#ifdef IN6ADDR_ANY_INIT
+ struct sockaddr_in6 sin6;
+#endif
+#ifdef ISC_ALIGN64
+ int64_t __align64; /* 64bit alignment */
+#else
+ int32_t __align32; /* 32bit alignment */
+#endif
+ char __space[128]; /* max size */
+};
+
+/*
+ * Resolver flags (used to be discrete per-module statics ints).
+ */
+#define RES_F_VC 0x00000001 /* socket is TCP */
+#define RES_F_CONN 0x00000002 /* socket is connected */
+#define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors */
+#define RES_F__UNUSED 0x00000008 /* (unused) */
+#define RES_F_LASTMASK 0x000000F0 /* ordinal server of last res_nsend */
+#define RES_F_LASTSHIFT 4 /* bit position of LASTMASK "flag" */
+#define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)
+
+/* res_findzonecut2() options */
+#define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
+#define RES_IPV4ONLY 0x00000002 /* IPv4 only */
+#define RES_IPV6ONLY 0x00000004 /* IPv6 only */
+
+/*
+ * Resolver options (keep these in synch with res_debug.c, please)
+ */
+#define RES_INIT 0x00000001 /* address initialized */
+#define RES_DEBUG 0x00000002 /* print debug messages */
+#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL) */
+#define RES_USEVC 0x00000008 /* use virtual circuit */
+#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
+#define RES_IGNTC 0x00000020 /* ignore trucation errors */
+#define RES_RECURSE 0x00000040 /* recursion desired */
+#define RES_DEFNAMES 0x00000080 /* use default domain name */
+#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
+#define RES_DNSRCH 0x00000200 /* search up local domain tree */
+#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
+#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
+#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
+#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
+#define RES_ROTATE 0x00004000 /* rotate ns list after each query */
+#define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
+#define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
+#define RES_BLAST 0x00020000 /* blast all recursive servers */
+#define RES_NO_NIBBLE 0x00040000 /* disable IPv6 nibble mode reverse */
+#define RES_NO_BITSTRING 0x00080000 /* disable IPv6 bitstring mode revrse */
+#define RES_NOTLDQUERY 0x00100000 /* don't unqualified name as a tld */
+#define RES_USE_DNSSEC 0x00200000 /* use DNSSEC using OK bit in OPT */
+/* KAME extensions: use higher bit to avoid conflict with ISC use */
+#define RES_USE_DNAME 0x10000000 /* use DNAME */
+#define RES_USE_EDNS0 0x40000000 /* use EDNS0 if configured */
+#define RES_NO_NIBBLE2 0x80000000 /* disable alternate nibble lookup */
+
+#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
+
+/*
+ * Resolver "pfcode" values. Used by dig.
+ */
+#define RES_PRF_STATS 0x00000001
+#define RES_PRF_UPDATE 0x00000002
+#define RES_PRF_CLASS 0x00000004
+#define RES_PRF_CMD 0x00000008
+#define RES_PRF_QUES 0x00000010
+#define RES_PRF_ANS 0x00000020
+#define RES_PRF_AUTH 0x00000040
+#define RES_PRF_ADD 0x00000080
+#define RES_PRF_HEAD1 0x00000100
+#define RES_PRF_HEAD2 0x00000200
+#define RES_PRF_TTLID 0x00000400
+#define RES_PRF_HEADX 0x00000800
+#define RES_PRF_QUERY 0x00001000
+#define RES_PRF_REPLY 0x00002000
+#define RES_PRF_INIT 0x00004000
+#define RES_PRF_TRUNC 0x00008000
+/* 0x00010000 */
+
+/* Things involving an internal (static) resolver context. */
+#ifdef _REENTRANT
+extern struct __res_state *__res_state(void);
+#define _res (*__res_state())
+#else
+#ifndef __BIND_NOSTATIC
+extern struct __res_state _res;
+#endif
+#endif
+
+#ifndef __BIND_NOSTATIC
+void fp_nquery __P((const uchar_t *, int, FILE *));
+void fp_query __P((const uchar_t *, FILE *));
+const char *hostalias __P((const char *));
+void p_query __P((const uchar_t *));
+void res_close __P((void));
+int res_init __P((void));
+int res_isourserver __P((const struct sockaddr_in *));
+int res_mkquery __P((int, const char *, int, int, const uchar_t *,
+ int, const uchar_t *, uchar_t *, int));
+int res_query __P((const char *, int, int, uchar_t *, int));
+int res_querydomain __P((const char *, const char *, int, int,
+ uchar_t *, int));
+int res_search __P((const char *, int, int, uchar_t *, int));
+int res_send __P((const uchar_t *, int, uchar_t *, int));
+int res_sendsigned __P((const uchar_t *, int, ns_tsig_key *,
+ uchar_t *, int));
+#endif /* __BIND_NOSTATIC */
+
+extern const struct res_sym __p_key_syms[];
+extern const struct res_sym __p_cert_syms[];
+extern const struct res_sym __p_class_syms[];
+extern const struct res_sym __p_type_syms[];
+extern const struct res_sym __p_rcode_syms[];
+
+int res_hnok __P((const char *));
+int res_ownok __P((const char *));
+int res_mailok __P((const char *));
+int res_dnok __P((const char *));
+int sym_ston __P((const struct res_sym *, const char *, int *));
+const char *sym_ntos __P((const struct res_sym *, int, int *));
+const char *sym_ntop __P((const struct res_sym *, int, int *));
+int b64_ntop __P((uchar_t const *, size_t, char *, size_t));
+int b64_pton __P((char const *, uchar_t *, size_t));
+int loc_aton __P((const char *ascii, uchar_t *binary));
+const char *loc_ntoa __P((const uchar_t *binary, char *ascii));
+int dn_skipname __P((const uchar_t *, const uchar_t *));
+void putlong __P((unsigned int, uchar_t *));
+void putshort __P((unsigned short, uchar_t *));
+const char *p_class __P((int));
+const char *p_time __P((unsigned int));
+const char *p_type __P((int));
+const char *p_rcode __P((int));
+const char *p_sockun __P((union res_sockaddr_union, char *, size_t));
+const uchar_t *p_cdnname __P((const uchar_t *, const uchar_t *, int,
+ FILE *));
+const uchar_t *p_cdname __P((const uchar_t *, const uchar_t *, FILE *));
+const uchar_t *p_fqnname __P((const uchar_t *cp, const uchar_t *msg,
+ int, char *, int));
+const uchar_t *p_fqname __P((const uchar_t *, const uchar_t *, FILE *));
+const char *p_option __P((uint_t option));
+char *p_secstodate __P((uint_t));
+int dn_count_labels __P((const char *));
+int dn_comp __P((const char *, uchar_t *, int,
+ uchar_t **, uchar_t **));
+int dn_expand __P((const uchar_t *, const uchar_t *,
+ const uchar_t *, char *, int));
+void res_rndinit __P((res_state));
+uint_t res_randomid __P((void));
+uint_t res_nrandomid __P((res_state));
+int res_nameinquery __P((const char *, int, int,
+ const uchar_t *, const uchar_t *));
+int res_queriesmatch __P((const uchar_t *, const uchar_t *,
+ const uchar_t *, const uchar_t *));
+const char *p_section __P((int section, int opcode));
+
+
+/* Things involving a resolver context. */
+int res_ninit __P((res_state));
+int res_nisourserver __P((const res_state,
+ const struct sockaddr_in *));
+void fp_resstat __P((const res_state, FILE *));
+void res_pquery __P((const res_state, const uchar_t *, int, FILE *));
+const char *res_hostalias __P((const res_state, const char *,
+ char *, size_t));
+int res_nquery __P((res_state,
+ const char *, int, int, uchar_t *, int));
+int res_nsearch __P((res_state, const char *, int,
+ int, uchar_t *, int));
+int res_nquerydomain __P((res_state,
+ const char *, const char *, int, int,
+ uchar_t *, int));
+int res_nmkquery __P((res_state,
+ int, const char *, int, int, const uchar_t *,
+ int, const uchar_t *, uchar_t *, int));
+int res_nsend __P((res_state, const uchar_t *, int, uchar_t *,
+ int));
+int res_nsendsigned __P((res_state, const uchar_t *, int,
+ ns_tsig_key *, uchar_t *, int));
+int res_findzonecut __P((res_state, const char *, ns_class, int,
+ char *, size_t, struct in_addr *, int));
+int res_findzonecut2 __P((res_state, const char *, ns_class, int,
+ char *, size_t, union res_sockaddr_union *,
+ int));
+void res_nclose __P((res_state));
+int res_nopt __P((res_state, int, uchar_t *, int, int));
+int res_nopt_rdata __P((res_state, int, uchar_t *, int, uchar_t *,
+ ushort_t, ushort_t, uchar_t *));
+void res_send_setqhook __P((res_send_qhook hook));
+void res_send_setrhook __P((res_send_rhook hook));
+int __res_vinit __P((res_state, int));
+void res_destroyservicelist __P((void));
+const char *res_servicename __P((uint16_t port, const char *proto));
+const char *res_protocolname __P((int num));
+void res_destroyprotolist __P((void));
+void res_buildprotolist __P((void));
+const char *res_get_nibblesuffix __P((res_state));
+const char *res_get_nibblesuffix2 __P((res_state));
+void res_ndestroy __P((res_state));
+uint16_t res_nametoclass __P((const char *buf, int *success));
+uint16_t res_nametotype __P((const char *buf, int *success));
+void res_setservers __P((res_state,
+ const union res_sockaddr_union *, int));
+int res_getservers __P((res_state,
+ union res_sockaddr_union *, int));
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_RESOLV_JOY_H */
diff --git a/usr/src/head/zdoor.h b/usr/src/head/zdoor.h
new file mode 100644
index 0000000000..f2d204042d
--- /dev/null
+++ b/usr/src/head/zdoor.h
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _ZDOOR_H
+#define _ZDOOR_H
+
+#include <sys/types.h>
+#include <zone.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct zdoor_handle *zdoor_handle_t;
+
+typedef struct zdoor_cookie {
+ char *zdc_zonename;
+ char *zdc_service;
+ void *zdc_biscuit;
+} zdoor_cookie_t;
+
+typedef struct zdoor_result {
+ char *zdr_data;
+ size_t zdr_size;
+} zdoor_result_t;
+
+typedef zdoor_result_t *(*zdoor_callback) (zdoor_cookie_t *cookie,
+ char *argp, size_t arpg_sz);
+
+#define ZDOOR_OK 0
+#define ZDOOR_ERROR -1
+#define ZDOOR_NOT_GLOBAL_ZONE -2
+#define ZDOOR_ZONE_NOT_RUNNING -3
+#define ZDOOR_ZONE_FORBIDDEN -4
+#define ZDOOR_ARGS_ERROR -5
+#define ZDOOR_OUT_OF_MEMORY -6
+
+extern zdoor_handle_t zdoor_handle_init();
+
+extern int zdoor_open(zdoor_handle_t handle, const char *zonename,
+ const char *service, void *biscuit, zdoor_callback callback);
+
+extern void * zdoor_close(zdoor_handle_t handle, const char *zonename,
+ const char *service);
+
+extern void zdoor_handle_destroy(zdoor_handle_t handle);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZDOOR_H */
diff --git a/usr/src/head/zone.h b/usr/src/head/zone.h
index 34528a27f5..ae03d2453c 100644
--- a/usr/src/head/zone.h
+++ b/usr/src/head/zone.h
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent Inc. All rights reserved.
*/
#ifndef _ZONE_H
@@ -56,7 +57,7 @@ extern int zone_get_id(const char *, zoneid_t *);
/* System call API */
extern zoneid_t zone_create(const char *, const char *,
const struct priv_set *, const char *, size_t, const char *, size_t, int *,
- int, int, const bslabel_t *, int);
+ int, int, const bslabel_t *, int, zoneid_t);
extern int zone_boot(zoneid_t);
extern int zone_destroy(zoneid_t);
extern ssize_t zone_getattr(zoneid_t, int, void *, size_t);
diff --git a/usr/src/lib/Makefile b/usr/src/lib/Makefile
index fe579b4c9d..265d45030c 100644
--- a/usr/src/lib/Makefile
+++ b/usr/src/lib/Makefile
@@ -67,6 +67,7 @@ SUBDIRS += \
libcommputil \
libresolv \
libresolv2 .WAIT \
+ libresolv2_joy .WAIT \
libw .WAIT \
libintl .WAIT \
../cmd/sgs/librtld_db \
@@ -79,6 +80,8 @@ SUBDIRS += \
librt \
libadm \
libctf \
+ libbrand .WAIT \
+ libzonecfg .WAIT \
libdtrace \
libdtrace_jni \
libcurses \
@@ -179,7 +182,6 @@ SUBDIRS += \
libxnet \
libipsecutil \
nsswitch \
- print \
libuutil \
libscf \
libinetsvc \
@@ -198,10 +200,10 @@ SUBDIRS += \
libwrap \
libxcurses \
libxcurses2 \
- libbrand .WAIT \
- libzonecfg \
+ libzdoor \
libzoneinfo \
libzonestat \
+ libsmartsshd \
libtsnet \
libtsol \
gss_mechs/mech_spnego \
@@ -216,7 +218,6 @@ SUBDIRS += \
raidcfg_plugins \
cfgadm_plugins \
libmail \
- lvm \
libsmedia \
libipp \
libdiskmgt \
@@ -233,10 +234,7 @@ SUBDIRS += \
libzfs_core \
libzfs \
libbe \
- pylibbe \
libzfs_jni \
- pyzfs \
- pysolaris \
libmapid \
brand \
policykit \
@@ -297,9 +295,6 @@ fm: \
#
NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
-DCSUBDIRS = \
- lvm
-
MSGSUBDIRS= \
abi \
auditd_plugins \
@@ -355,12 +350,11 @@ MSGSUBDIRS= \
libwanbootutil \
libzfs \
libzonecfg \
- lvm \
+ libzdoor \
+ libsmartsshd \
madv \
mpss \
pam_modules \
- pyzfs \
- pysolaris \
rpcsec_gss \
libreparse
MSGSUBDIRS += \
@@ -480,7 +474,6 @@ HDRSUBDIRS= \
libzonestat \
hal \
policykit \
- lvm \
pkcs11 \
passwdutil \
../cmd/sendmail/libmilter \
@@ -565,7 +558,7 @@ gss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
libadt_jni: libbsm
libast: libsocket
libadutils: libldap5 libresolv libsocket libnsl
-nsswitch: libadutils libidmap
+nsswitch: libadutils libidmap libresolv2_joy
libbe: libzfs
libbsm: libtsol
libcmd: libsum libast libsocket libnsl
@@ -618,6 +611,8 @@ libpool: libnvpair libexacct
libpp: libast
libzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
libbrand libpool libscf
+libzdoor: libc libzonecfg libcontract
+libsmartsshd: libc libcontract
libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf libsaveargs
libproject: libpool libproc libsecdb
libtermcap: libcurses
@@ -633,8 +628,6 @@ librestart: libuutil libscf
libsaveargs: libdisasm
../cmd/sgs/libdl: ../cmd/sgs/libconv
../cmd/sgs/libelf: ../cmd/sgs/libconv
-pkcs11: libcryptoutil
-print: libldap5
udapl/udapl_tavor: udapl/libdat
libzfs: libdevid libgen libnvpair libuutil \
libadm libavl libefi libidmap libmd libzfs_core
@@ -659,9 +652,6 @@ sun_fc: libdevinfo libsysevent libnvpair
libsun_ima: libdevinfo libsysevent libnsl
sun_sas: libdevinfo libsysevent libnvpair libkstat libdevid
libgrubmgmt: libdevinfo libzfs libfstyp
-pylibbe: libbe libzfs
-pyzfs: libnvpair libzfs
-pysolaris: libsec libidmap
libreparse: libnvpair
libhotplug: libnvpair
cfgadm_plugins: libhotplug
diff --git a/usr/src/lib/Makefile.astmsg b/usr/src/lib/Makefile.astmsg
index 096805e825..ff8202d03a 100644
--- a/usr/src/lib/Makefile.astmsg
+++ b/usr/src/lib/Makefile.astmsg
@@ -47,8 +47,8 @@ MSGLIBNAME= $(LIBRARY:.a=)
ASTMSGCATALOG= $(ROOT)/usr/lib/locale/C/LC_MESSAGES/$(MSGLIBNAME)
$(DO_BUILD_AST_CATALOGS)ASTMSGCC= \
- PATH="/usr/ast/bin/:/bin:/usr/bin" \
- /usr/bin/ksh93 /usr/ast/bin/msgcc >>msgcc.out 2>&1
+ PATH="$(ASTBINDIR):/bin:/usr/bin" \
+ /usr/bin/ksh93 $(MSGCC) >>msgcc.out 2>&1
ASTMSGS= $(OBJECTS:%.o=msgs/%.mso)
diff --git a/usr/src/lib/brand/Makefile b/usr/src/lib/brand/Makefile
index 05bfc54764..db59df2efc 100644
--- a/usr/src/lib/brand/Makefile
+++ b/usr/src/lib/brand/Makefile
@@ -30,7 +30,7 @@ include ../../Makefile.master
# Build everything in parallel; use .WAIT for dependencies
.PARALLEL:
-SUBDIRS= shared .WAIT sn1 solaris10 ipkg labeled $($(MACH)_SUBDIRS)
+SUBDIRS= shared .WAIT sn1 sngl solaris10 ipkg labeled $($(MACH)_SUBDIRS)
MSGSUBDIRS= solaris10 shared $($(MACH)_MSGSUBDIRS)
all := TARGET= all
diff --git a/usr/src/lib/brand/shared/zone/common.ksh b/usr/src/lib/brand/shared/zone/common.ksh
index 52441d814a..463ba7a51a 100644
--- a/usr/src/lib/brand/shared/zone/common.ksh
+++ b/usr/src/lib/brand/shared/zone/common.ksh
@@ -333,10 +333,12 @@ post_unpack()
#
# Check if the image was created with a valid libc.so.1.
#
- hwcap=`moe -v -32 $ZONEROOT/lib/libc.so.1 2>&1`
- if (( $? != 0 )); then
- vlog "$f_hwcap_info" "$hwcap"
- fail_fatal "$f_sanity_hwcap"
+ if [[ -f $ZONEROOT/lib/libc.so.1 ]]; then
+ hwcap=`moe -v -32 $ZONEROOT/lib/libc.so.1 2>&1`
+ if (( $? != 0 )); then
+ vlog "$f_hwcap_info" "$hwcap"
+ fail_fatal "$f_sanity_hwcap"
+ fi
fi
( cd "$ZONEROOT" && \
@@ -1003,41 +1005,36 @@ install_image()
return 0
}
-# Setup i18n output
-TEXTDOMAIN="SUNW_OST_OSCMD"
-export TEXTDOMAIN
-
-e_cannot_wrap=$(gettext "%s: error: wrapper file already exists")
-e_baddir=$(gettext "Invalid '%s' directory within the zone")
-e_badfile=$(gettext "Invalid '%s' file within the zone")
-e_path_abs=$(gettext "Pathname specified to -a '%s' must be absolute.")
-e_not_found=$(gettext "%s: error: file or directory not found.")
-e_install_abort=$(gettext "Installation aborted.")
-e_not_readable=$(gettext "Cannot read directory '%s'")
-e_not_dir=$(gettext "Error: must be a directory")
-e_unknown_archive=$(gettext "Error: Unknown archive format. Must be a flash archive, a cpio archive (can also be gzipped or bzipped), a pax XUSTAR archive, or a level 0 ufsdump archive.")
-e_absolute_archive=$(gettext "Error: archive contains absolute paths instead of relative paths.")
-e_mismatch_archive=$(gettext "Error: the archive top-level directory (%s) does not match the zonepath (%s).")
-e_tmpfile=$(gettext "Unable to create temporary file")
-e_root_full=$(gettext "Zonepath root %s exists and contains data; remove or move aside prior to install.")
-f_mkdir=$(gettext "Unable to create directory %s.")
-f_chmod=$(gettext "Unable to chmod directory %s.")
-f_chown=$(gettext "Unable to chown directory %s.")
-f_hwcap_info=$(gettext "HWCAP: %s\n")
-f_sanity_hwcap=$(gettext \
-"The image was created with an incompatible libc.so.1 hwcap lofs mount.\n"\
+e_cannot_wrap="%s: error: wrapper file already exists"
+e_baddir="Invalid '%s' directory within the zone"
+e_badfile="Invalid '%s' file within the zone"
+e_path_abs="Pathname specified to -a '%s' must be absolute."
+e_not_found="%s: error: file or directory not found."
+e_install_abort="Installation aborted."
+e_not_readable="Cannot read directory '%s'"
+e_not_dir="Error: must be a directory"
+e_unknown_archive="Error: Unknown archive format. Must be a flash archive, a cpio archive (can also be gzipped or bzipped), a pax XUSTAR archive, or a level 0 ufsdump archive."
+e_absolute_archive="Error: archive contains absolute paths instead of relative paths."
+e_mismatch_archive="Error: the archive top-level directory (%s) does not match the zonepath (%s)."
+e_tmpfile="Unable to create temporary file"
+e_root_full="Zonepath root %s exists and contains data; remove or move aside prior to install."
+f_mkdir="Unable to create directory %s."
+f_chmod="Unable to chmod directory %s."
+f_chown="Unable to chown directory %s."
+f_hwcap_info="HWCAP: %s\n"
+f_sanity_hwcap="The image was created with an incompatible libc.so.1 hwcap lofs mount.\n"\
" The zone will not boot on this platform. See the zone's\n"\
-" documentation for the recommended way to create the archive.")
+" documentation for the recommended way to create the archive."
-m_analyse_archive=$(gettext "Analysing the archive")
+m_analyse_archive="Analysing the archive"
-not_readable=$(gettext "Cannot read file '%s'")
-not_flar=$(gettext "Input is not a flash archive")
-bad_flar=$(gettext "Flash archive is a corrupt")
-bad_zfs_flar=$(gettext "Flash archive contains a ZFS send stream.\n\tRecreate the flar using the -L option with cpio or pax.")
-f_unpack_failed=$(gettext "Unpacking the archive failed")
-unknown_archiver=$(gettext "Archiver %s is not supported")
-cmd_not_exec=$(gettext "Required command '%s' not executable!")
+not_readable="Cannot read file '%s'"
+not_flar="Input is not a flash archive"
+bad_flar="Flash archive is a corrupt"
+bad_zfs_flar="Flash archive contains a ZFS send stream.\n\tRecreate the flar using the -L option with cpio or pax."
+f_unpack_failed="Unpacking the archive failed"
+unknown_archiver="Archiver %s is not supported"
+cmd_not_exec="Required command '%s' not executable!"
#
# Exit values used by the script, as #defined in <sys/zone.h>
diff --git a/usr/src/lib/brand/shared/zone/uninstall.ksh b/usr/src/lib/brand/shared/zone/uninstall.ksh
index 468a7ed92f..923363c864 100644
--- a/usr/src/lib/brand/shared/zone/uninstall.ksh
+++ b/usr/src/lib/brand/shared/zone/uninstall.ksh
@@ -35,31 +35,31 @@ bname=`basename $0`
#
# error messages
#
-m_usage=$(gettext "Usage: %s: [-hFn]")
-
-m_1_zfs_promote=$(gettext "promoting '%s'.")
-m_1_zfs_destroy=$(gettext "destroying '%s'.")
-m_2_zfs_rename=$(gettext "renaming '%s' to '%s'.")
-m_3_zfs_set=$(gettext "setting property %s='%s' for '%s'.")
-m_rm_r=$(gettext "recursively deleting '%s'.")
-m_rm=$(gettext "deleting '%s'.")
-
-w_no_ds=$(gettext "Warning: no zonepath dataset found.")
-
-f_usage_err=$(gettext "Error: invalid usage")
-f_abort=$(gettext "Error: internal error detected, aborting.")
-f_1_zfs_promote=$(gettext "Error: promoting ZFS dataset '%s'.")
-f_2_zfs_rename=$(gettext "Error: renaming ZFS dataset '%s' to '%s'.")
-f_3_zfs_set=$(gettext "Error: setting ZFS propery %s='%s' for '%s'.")
-f_1_zfs_destroy=$(gettext "Error: destroying ZFS dataset.")
-f_2_zfs_get=$(gettext "Error: reading ZFS dataset property '%s' from '%s'.")
-f_user_snap=$(gettext "Error: user snapshot(s) detected.")
-f_stray_snap=$(gettext "Error: uncloned snapshot(s) detected.")
-f_stray_clone=$(gettext "Error: cloned zone datasets found outsize of zone.")
-f_rm_snap=$(gettext "Error: please delete snapshot(s) and retry uninstall.")
-f_rm_clone=$(gettext "Error: please delete clone(s) and retry uninstall.")
-f_iu_clone=$(gettext "Error: cloned zone dataset(s) in use.")
-f_dis_clone=$(gettext "Error: please stop using clone(s) and retry uninstall.")
+m_usage="Usage: %s: [-hFn]"
+
+m_1_zfs_promote="promoting '%s'."
+m_1_zfs_destroy="destroying '%s'."
+m_2_zfs_rename="renaming '%s' to '%s'."
+m_3_zfs_set="setting property %s='%s' for '%s'."
+m_rm_r="recursively deleting '%s'."
+m_rm="deleting '%s'."
+
+w_no_ds="Warning: no zonepath dataset found."
+
+f_usage_err="Error: invalid usage"
+f_abort="Error: internal error detected, aborting."
+f_1_zfs_promote="Error: promoting ZFS dataset '%s'."
+f_2_zfs_rename="Error: renaming ZFS dataset '%s' to '%s'."
+f_3_zfs_set="Error: setting ZFS propery %s='%s' for '%s'."
+f_1_zfs_destroy="Error: destroying ZFS dataset."
+f_2_zfs_get="Error: reading ZFS dataset property '%s' from '%s'."
+f_user_snap="Error: user snapshot(s) detected."
+f_stray_snap="Error: uncloned snapshot(s) detected."
+f_stray_clone="Error: cloned zone datasets found outsize of zone."
+f_rm_snap="Error: please delete snapshot(s) and retry uninstall."
+f_rm_clone="Error: please delete clone(s) and retry uninstall."
+f_iu_clone="Error: cloned zone dataset(s) in use."
+f_dis_clone="Error: please stop using clone(s) and retry uninstall."
#
# functions
diff --git a/usr/src/lib/brand/sngl/Makefile b/usr/src/lib/brand/sngl/Makefile
new file mode 100644
index 0000000000..780acc21e1
--- /dev/null
+++ b/usr/src/lib/brand/sngl/Makefile
@@ -0,0 +1,51 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2012, Joyent, Inc. All rights reserved.
+#
+
+default: all
+
+include Makefile.sngl
+
+# Build everything in parallel; use .WAIT for dependencies
+.PARALLEL:
+
+SUBDIRS = sngl_brand zone
+MSGSUBDIRS = zone
+
+all := TARGET= all
+install := TARGET= install
+clean := TARGET= clean
+clobber := TARGET= clobber
+lint := TARGET= lint
+_msg := TARGET= _msg
+
+.KEEP_STATE:
+
+all install clean clobber lint: $(SUBDIRS)
+
+_msg: $(MSGSUBDIRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
diff --git a/usr/src/lib/brand/sngl/Makefile.sngl b/usr/src/lib/brand/sngl/Makefile.sngl
new file mode 100644
index 0000000000..0c7a280696
--- /dev/null
+++ b/usr/src/lib/brand/sngl/Makefile.sngl
@@ -0,0 +1,28 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2012 Joyent, Inc. All rights reserved.
+#
+
+BRAND = sngl
+
+include $(SRC)/lib/brand/Makefile.brand
+
diff --git a/usr/src/lib/brand/sngl/sngl_brand/Makefile b/usr/src/lib/brand/sngl/sngl_brand/Makefile
new file mode 100644
index 0000000000..4b667e1fa8
--- /dev/null
+++ b/usr/src/lib/brand/sngl/sngl_brand/Makefile
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+include $(SRC)/lib/Makefile.lib
+
+default: all
+
+SUBDIRS = $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+lint := TARGET= lint
+_msg := TARGET= _msg
+
+.KEEP_STATE:
+
+all install clean clobber lint _msg: $(SUBDIRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
diff --git a/usr/src/lib/brand/sngl/sngl_brand/Makefile.com b/usr/src/lib/brand/sngl/sngl_brand/Makefile.com
new file mode 100644
index 0000000000..070a03dcb5
--- /dev/null
+++ b/usr/src/lib/brand/sngl/sngl_brand/Makefile.com
@@ -0,0 +1,76 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2012, Joyent, Inc. All rights reserved.
+#
+
+LIBRARY = sngl_brand.a
+VERS = .1
+COBJS = sngl_brand.o
+ASOBJS = crt.o handler.o runexe.o brand_util.o
+OBJECTS = $(COBJS)
+
+include ../../Makefile.sngl
+include $(SRC)/lib/Makefile.lib
+
+SRCDIR = ../common
+UTSBASE = $(SRC)/uts
+
+LIBS = $(DYNLIB)
+CSRCS = $(COBJS:%o=../common/%c)
+SHAREDOBJS = $(ASOBJS:%o=$(ISAOBJDIR)/%o)
+SRCS = $(CSRCS)
+
+#
+# Note that the architecture specific makefiles MUST update DYNFLAGS to
+# explicitly specify an interpreter for the brand emulation library so that we
+# use /lib/ld.so.1 or /lib/64/ld.so.1, which in a sngl zone is the system
+# linker.
+#
+# Note that since the linker is used to setup processes before libc is loaded,
+# it makes system calls directly (ie avoiding libc), and it makes these system
+# calls before our library has been initialized. Since our library hasn't been
+# initialized yet, there's no way for us to intercept and emulate any of those
+# system calls. Luckily we don't have to.
+#
+# Note that we make sure to link our brand emulation library to libmapmalloc.
+# This is required because in most cases there will be two copies of libc in
+# the same process and we don't want them to fight over the heap. So for our
+# brand library we link against libmapmalloc so that if we (our or copy of
+# libc) try to allocate any memory it will be done via mmap() instead of brk().
+#
+CPPFLAGS += -D_REENTRANT -U_ASM \
+ -I. -I$(BRAND_SHARED)/brand/sys -I$(UTSBASE)/common/brand/sngl
+CFLAGS += $(CCVERBOSE)
+DYNFLAGS += $(DYNFLAGS_$(CLASS))
+DYNFLAGS += $(BLOCAL) $(ZNOVERSION) -Wl,-e_start
+LDLIBS += -lc -lmapmalloc
+
+$(LIBS):= PICS += $(SHAREDOBJS)
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+lint: lintcheck
+
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/brand/sngl/sngl_brand/amd64/Makefile b/usr/src/lib/brand/sngl/sngl_brand/amd64/Makefile
new file mode 100644
index 0000000000..d019eaf841
--- /dev/null
+++ b/usr/src/lib/brand/sngl/sngl_brand/amd64/Makefile
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2012, Joyent, Inc. All rights reserved.
+#
+
+ISAOBJDIR = $(BRAND_SHARED)/brand/amd64/pics/
+
+include ../Makefile.com
+include $(SRC)/lib/Makefile.lib.64
+
+CPPFLAGS += -I$(BRAND_SHARED)/brand/amd64
+
+#
+# see ../Makefile.com for why we MUST explicity make ld.so.1 our interpreter
+#
+DYNFLAGS += -Wl,-I/lib/64/ld.so.1
+CPPFLAGS += -D_SYSCALL32
+
+# Note that we also set the runtime path for the emulation library to point
+# into /system. This is an attempt to ensure that our brand library get's the
+# native version of libmapmallc.
+#
+DYNFLAGS += -R/lib/64 -R/system/usr/lib/64
+
+CLEANFILES += $(DYNLIB)
+CLOBBERFILES += $(ROOTLIBS64)
+
+install: all $(ROOTLIBS64)
diff --git a/usr/src/lib/brand/sngl/sngl_brand/common/mapfile-vers b/usr/src/lib/brand/sngl/sngl_brand/common/mapfile-vers
new file mode 100644
index 0000000000..29800204f8
--- /dev/null
+++ b/usr/src/lib/brand/sngl/sngl_brand/common/mapfile-vers
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+$mapfile_version 2
+
+#
+# Scope everything local -- our .init section is our only public interface.
+#
+SYMBOL_SCOPE {
+ local:
+ *;
+};
diff --git a/usr/src/lib/brand/sngl/sngl_brand/common/sngl_brand.c b/usr/src/lib/brand/sngl/sngl_brand/common/sngl_brand.c
new file mode 100644
index 0000000000..d2b8d8702d
--- /dev/null
+++ b/usr/src/lib/brand/sngl/sngl_brand/common/sngl_brand.c
@@ -0,0 +1,429 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <strings.h>
+#include <unistd.h>
+#include <sys/brand.h>
+#include <sys/syscall.h>
+#include <sys/systm.h>
+#include <sys/stat.h>
+#include <libgen.h>
+#include <sys/auxv.h>
+
+#include <sngl_brand.h>
+#include <brand_misc.h>
+
+/*
+ * See usr/src/lib/brand/shared/brand/common/brand_util.c for general
+ * emulation notes.
+ */
+
+#define CONF32_PATH "/system/usr/lib/brand/sngl/ld.sys.config"
+#define CONF64_PATH "/system/usr/lib/brand/sngl/ld.sys64.config"
+
+brand_sysent_table_t brand_sysent_table[];
+
+static boolean_t is_sys = B_FALSE;
+static boolean_t is_crle = B_FALSE;
+
+typedef struct {
+ char *mnt_name;
+ dev_t mnt_id;
+} sys_mnt_dev_t;
+
+/*
+ * The brand platform mounts several GZ file systems into the zone. We know
+ * which ones can actually be on seperate file systems, so we only stat those
+ * when checking for system commands. This reduces the number of stats needed
+ * when we start up.
+ */
+static sys_mnt_dev_t sys_mounts[] = {
+ {"/system/usr", 0},
+ {"/lib", 0},
+ {NULL, 0}
+};
+
+/*
+ * If this is a /sytem binary and ld.so is opening the default config file,
+ * then redirect so it opens the /system config file instead. We need to do it
+ * this way, instead of setting one of the LD_CONFIG env vars, since those
+ * are ignored for secure binaries.
+ *
+ * We don't redirect if we're crle so that it can still be used on the default
+ * config files.
+ */
+int
+sngl_open(sysret_t *rval, char *path, int oflag, mode_t mode)
+{
+ char tstr[MAXPATHLEN];
+
+ if (is_sys && !is_crle) {
+ /* Get a copy of the path we're trying to open */
+ bzero(tstr, sizeof (tstr));
+ (void) brand_uucopystr(path, tstr, sizeof (tstr));
+
+ if (strcmp(tstr, "/var/ld/ld.config") == 0)
+ return (__systemcall(rval, SYS_open + 1024,
+ CONF32_PATH, oflag, mode));
+
+ if (strcmp(tstr, "/var/ld/64/ld.config") == 0)
+ return (__systemcall(rval, SYS_open + 1024,
+ CONF64_PATH, oflag, mode));
+ }
+
+ return (__systemcall(rval, SYS_open + 1024, path, oflag, mode));
+}
+
+/*ARGSUSED*/
+int
+brand_init(int argc, char *argv[], char *envp[])
+{
+ ulong_t ldentry;
+ int i;
+ uintptr_t *p;
+ auxv_t *ap;
+ struct stat64 buf;
+ char *bname;
+
+ brand_pre_init();
+
+ /*
+ * Check if we're trying to run a system binary.
+ *
+ * We haven't installed our emulation table yet, so its safe to make
+ * system calls directly.
+ *
+ * First, get the /system devices, then stat the executable to see if
+ * its on one of the /system devs.
+ */
+ for (i = 0; sys_mounts[i].mnt_name != NULL; i++) {
+ if (stat64(sys_mounts[i].mnt_name, &buf) != -1)
+ sys_mounts[i].mnt_id = buf.st_dev;
+ }
+
+ /* Find the aux vector on the stack. */
+ p = (uintptr_t *)envp;
+ while (*p != NULL)
+ p++;
+ p++;
+
+ /* Find AT_SUN_EXECNAME */
+ for (ap = (auxv_t *)p; ap->a_type != AT_NULL; ap++) {
+ if (ap->a_type != AT_SUN_EXECNAME)
+ continue;
+ if (stat64(ap->a_un.a_ptr, &buf) != -1) {
+ for (i = 0; sys_mounts[i].mnt_name != NULL; i++) {
+ if (sys_mounts[i].mnt_id == buf.st_dev) {
+ is_sys = B_TRUE;
+ bname = basename(ap->a_un.a_ptr);
+ if (strcmp("crle", bname) == 0)
+ is_crle = B_TRUE;
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ ldentry = brand_post_init(SNGL_VERSION, argc, argv, envp);
+
+ brand_runexe(argv, ldentry);
+ /*NOTREACHED*/
+ brand_abort(0, "brand_runexe() returned");
+ return (-1);
+}
+
+/*
+ * This table must have at least NSYSCALL entries in it.
+ *
+ * The second parameter of each entry in the brand_sysent_table
+ * contains the number of parameters and flags that describe the
+ * syscall return value encoding. See the block comments at the
+ * top of this file for more information about the syscall return
+ * value flags and when they should be used.
+ */
+brand_sysent_table_t brand_sysent_table[] = {
+ NOSYS, /* 0 */
+ NOSYS, /* 1 */
+ NOSYS, /* 2 */
+ NOSYS, /* 3 */
+ NOSYS, /* 4 */
+ EMULATE(sngl_open, 3 | RV_DEFAULT), /* 5 */
+ NOSYS, /* 6 */
+ NOSYS, /* 7 */
+ NOSYS, /* 8 */
+ NOSYS, /* 9 */
+ NOSYS, /* 10 */
+ NOSYS, /* 11 */
+ NOSYS, /* 12 */
+ NOSYS, /* 13 */
+ NOSYS, /* 14 */
+ NOSYS, /* 15 */
+ NOSYS, /* 16 */
+ NOSYS, /* 17 */
+ NOSYS, /* 18 */
+ NOSYS, /* 19 */
+ NOSYS, /* 20 */
+ NOSYS, /* 21 */
+ NOSYS, /* 22 */
+ NOSYS, /* 23 */
+ NOSYS, /* 24 */
+ NOSYS, /* 25 */
+ NOSYS, /* 26 */
+ NOSYS, /* 27 */
+ NOSYS, /* 28 */
+ NOSYS, /* 29 */
+ NOSYS, /* 30 */
+ NOSYS, /* 31 */
+ NOSYS, /* 32 */
+ NOSYS, /* 33 */
+ NOSYS, /* 34 */
+ NOSYS, /* 35 */
+ NOSYS, /* 36 */
+ NOSYS, /* 37 */
+ NOSYS, /* 38 */
+ NOSYS, /* 39 */
+ NOSYS, /* 40 */
+ NOSYS, /* 41 */
+ NOSYS, /* 42 */
+ NOSYS, /* 43 */
+ NOSYS, /* 44 */
+ NOSYS, /* 45 */
+ NOSYS, /* 46 */
+ NOSYS, /* 47 */
+ NOSYS, /* 48 */
+ NOSYS, /* 49 */
+ NOSYS, /* 50 */
+ NOSYS, /* 51 */
+ NOSYS, /* 52 */
+ NOSYS, /* 53 */
+ NOSYS, /* 54 */
+ NOSYS, /* 55 */
+ NOSYS, /* 56 */
+ NOSYS, /* 57 */
+ NOSYS, /* 58 */
+ NOSYS, /* 59 */
+ NOSYS, /* 60 */
+ NOSYS, /* 61 */
+ NOSYS, /* 62 */
+ NOSYS, /* 63 */
+ NOSYS, /* 64 */
+ NOSYS, /* 65 */
+ NOSYS, /* 66 */
+ NOSYS, /* 67 */
+ NOSYS, /* 68 */
+ NOSYS, /* 69 */
+ NOSYS, /* 70 */
+ NOSYS, /* 71 */
+ NOSYS, /* 72 */
+ NOSYS, /* 73 */
+ NOSYS, /* 74 */
+ NOSYS, /* 75 */
+ NOSYS, /* 76 */
+ NOSYS, /* 77 */
+ NOSYS, /* 78 */
+ NOSYS, /* 79 */
+ NOSYS, /* 80 */
+ NOSYS, /* 81 */
+ NOSYS, /* 82 */
+ NOSYS, /* 83 */
+ NOSYS, /* 84 */
+ NOSYS, /* 85 */
+ NOSYS, /* 86 */
+ NOSYS, /* 87 */
+ NOSYS, /* 88 */
+ NOSYS, /* 89 */
+ NOSYS, /* 90 */
+ NOSYS, /* 91 */
+ NOSYS, /* 92 */
+ NOSYS, /* 93 */
+ NOSYS, /* 94 */
+ NOSYS, /* 95 */
+ NOSYS, /* 96 */
+ NOSYS, /* 97 */
+ NOSYS, /* 98 */
+ NOSYS, /* 99 */
+ NOSYS, /* 100 */
+ NOSYS, /* 101 */
+ NOSYS, /* 102 */
+ NOSYS, /* 103 */
+ NOSYS, /* 104 */
+ NOSYS, /* 105 */
+ NOSYS, /* 106 */
+ NOSYS, /* 107 */
+ NOSYS, /* 108 */
+ NOSYS, /* 109 */
+ NOSYS, /* 110 */
+ NOSYS, /* 111 */
+ NOSYS, /* 112 */
+ NOSYS, /* 113 */
+ NOSYS, /* 114 */
+ NOSYS, /* 115 */
+ NOSYS, /* 116 */
+ NOSYS, /* 117 */
+ NOSYS, /* 118 */
+ NOSYS, /* 119 */
+ NOSYS, /* 120 */
+ NOSYS, /* 121 */
+ NOSYS, /* 122 */
+ NOSYS, /* 123 */
+ NOSYS, /* 124 */
+ NOSYS, /* 125 */
+ NOSYS, /* 126 */
+ NOSYS, /* 127 */
+ NOSYS, /* 128 */
+ NOSYS, /* 129 */
+ NOSYS, /* 130 */
+ NOSYS, /* 131 */
+ NOSYS, /* 132 */
+ NOSYS, /* 133 */
+ NOSYS, /* 134 */
+ NOSYS, /* 135 */
+ NOSYS, /* 136 */
+ NOSYS, /* 137 */
+ NOSYS, /* 138 */
+ NOSYS, /* 139 */
+ NOSYS, /* 140 */
+ NOSYS, /* 141 */
+ NOSYS, /* 142 */
+ NOSYS, /* 143 */
+ NOSYS, /* 144 */
+ NOSYS, /* 145 */
+ NOSYS, /* 146 */
+ NOSYS, /* 147 */
+ NOSYS, /* 148 */
+ NOSYS, /* 149 */
+ NOSYS, /* 150 */
+ NOSYS, /* 151 */
+ NOSYS, /* 152 */
+ NOSYS, /* 153 */
+ NOSYS, /* 154 */
+ NOSYS, /* 155 */
+ NOSYS, /* 156 */
+ NOSYS, /* 157 */
+ NOSYS, /* 158 */
+ NOSYS, /* 159 */
+ NOSYS, /* 160 */
+ NOSYS, /* 161 */
+ NOSYS, /* 162 */
+ NOSYS, /* 163 */
+ NOSYS, /* 164 */
+ NOSYS, /* 165 */
+ NOSYS, /* 166 */
+ NOSYS, /* 167 */
+ NOSYS, /* 168 */
+ NOSYS, /* 169 */
+ NOSYS, /* 170 */
+ NOSYS, /* 171 */
+ NOSYS, /* 172 */
+ NOSYS, /* 173 */
+ NOSYS, /* 174 */
+ NOSYS, /* 175 */
+ NOSYS, /* 176 */
+ NOSYS, /* 177 */
+ NOSYS, /* 178 */
+ NOSYS, /* 179 */
+ NOSYS, /* 180 */
+ NOSYS, /* 181 */
+ NOSYS, /* 182 */
+ NOSYS, /* 183 */
+ NOSYS, /* 184 */
+ NOSYS, /* 185 */
+ NOSYS, /* 186 */
+ NOSYS, /* 187 */
+ NOSYS, /* 188 */
+ NOSYS, /* 189 */
+ NOSYS, /* 190 */
+ NOSYS, /* 191 */
+ NOSYS, /* 192 */
+ NOSYS, /* 193 */
+ NOSYS, /* 194 */
+ NOSYS, /* 195 */
+ NOSYS, /* 196 */
+ NOSYS, /* 197 */
+ NOSYS, /* 198 */
+ NOSYS, /* 199 */
+ NOSYS, /* 200 */
+ NOSYS, /* 201 */
+ NOSYS, /* 202 */
+ NOSYS, /* 203 */
+ NOSYS, /* 204 */
+ NOSYS, /* 205 */
+ NOSYS, /* 206 */
+ NOSYS, /* 207 */
+ NOSYS, /* 208 */
+ NOSYS, /* 209 */
+ NOSYS, /* 210 */
+ NOSYS, /* 211 */
+ NOSYS, /* 212 */
+ NOSYS, /* 213 */
+ NOSYS, /* 214 */
+ NOSYS, /* 215 */
+ NOSYS, /* 216 */
+ NOSYS, /* 217 */
+ NOSYS, /* 218 */
+ NOSYS, /* 219 */
+ NOSYS, /* 220 */
+ NOSYS, /* 221 */
+ NOSYS, /* 222 */
+ NOSYS, /* 223 */
+ NOSYS, /* 224 */
+ NOSYS, /* 225 */
+ NOSYS, /* 226 */
+ NOSYS, /* 227 */
+ NOSYS, /* 228 */
+ NOSYS, /* 229 */
+ NOSYS, /* 230 */
+ NOSYS, /* 231 */
+ NOSYS, /* 232 */
+ NOSYS, /* 233 */
+ NOSYS, /* 234 */
+ NOSYS, /* 235 */
+ NOSYS, /* 236 */
+ NOSYS, /* 237 */
+ NOSYS, /* 238 */
+ NOSYS, /* 239 */
+ NOSYS, /* 240 */
+ NOSYS, /* 241 */
+ NOSYS, /* 242 */
+ NOSYS, /* 243 */
+ NOSYS, /* 244 */
+ NOSYS, /* 245 */
+ NOSYS, /* 246 */
+ NOSYS, /* 247 */
+ NOSYS, /* 248 */
+ NOSYS, /* 249 */
+ NOSYS, /* 250 */
+ NOSYS, /* 251 */
+ NOSYS, /* 252 */
+ NOSYS, /* 253 */
+ NOSYS, /* 254 */
+ NOSYS /* 255 */
+};
diff --git a/usr/src/lib/brand/sngl/sngl_brand/i386/Makefile b/usr/src/lib/brand/sngl/sngl_brand/i386/Makefile
new file mode 100644
index 0000000000..a0c4927252
--- /dev/null
+++ b/usr/src/lib/brand/sngl/sngl_brand/i386/Makefile
@@ -0,0 +1,46 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2012, Joyent, Inc. All rights reserved.
+#
+
+ISAOBJDIR = $(BRAND_SHARED)/brand/i386/pics
+
+include ../Makefile.com
+
+CPPFLAGS += -I$(BRAND_SHARED)/brand/i386
+
+#
+# see ../Makefile.com for why we explicity make ld.so.1 our interpreter
+#
+DYNFLAGS += -Wl,-I/lib/ld.so.1
+
+# Note that we also set the runtime path for the emulation library to point
+# into /system. This is an attempt to ensure that our brand library get's the
+# native version of libmapmallc.
+#
+DYNFLAGS += -R/lib -R/system/usr/lib
+
+CLEANFILES += $(DYNLIB)
+CLOBBERFILES += $(ROOTLIBS)
+
+install: all $(ROOTLIBS)
diff --git a/usr/src/lib/brand/sngl/zone/Makefile b/usr/src/lib/brand/sngl/zone/Makefile
new file mode 100644
index 0000000000..42785deab3
--- /dev/null
+++ b/usr/src/lib/brand/sngl/zone/Makefile
@@ -0,0 +1,53 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2012 Joyent, Inc. All rights reserved.
+#
+
+PROGS = sinstall
+XMLDOCS= config.xml platform.xml
+CLOBBERFILES= $(ROOTPROGS) $(ROOTXMLDOCS)
+
+include $(SRC)/cmd/Makefile.cmd
+include ../Makefile.sngl
+
+.KEEP_STATE:
+
+all: $(PROGS)
+
+POFILES =
+POFILE =
+
+install: $(PROGS) $(ROOTPROGS) $(ROOTXMLDOCS)
+ crle -c $(ROOTBRANDDIR)/ld.sys.config \
+ -l /lib:/system/usr/lib \
+ -s /lib/secure:/system/usr/lib/secure
+ crle -64 -c $(ROOTBRANDDIR)/ld.sys64.config \
+ -l /lib/64:/system/usr/lib/64 \
+ -s /lib/secure/64:/system/usr/lib/secure/64
+
+lint:
+
+clean:
+ -$(RM) $(PROGS)
+
+include $(SRC)/cmd/Makefile.targ
diff --git a/usr/src/lib/brand/sngl/zone/config.xml b/usr/src/lib/brand/sngl/zone/config.xml
new file mode 100644
index 0000000000..421400e82a
--- /dev/null
+++ b/usr/src/lib/brand/sngl/zone/config.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+
+<!--
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+
+ Copyright 2012 Joyent, Inc. All rights reserved.
+ Use is subject to license terms.
+
+ DO NOT EDIT THIS FILE.
+-->
+
+<!DOCTYPE brand PUBLIC "-//Joyent Inc//DTD Brands//EN"
+ "file:///usr/share/lib/xml/dtd/brand.dtd.1">
+
+<brand name="sngl">
+ <modname>sngl_brand</modname>
+
+ <initname>/system/sbin/init</initname>
+ <login_cmd>/system/usr/bin/login -z %Z %u</login_cmd>
+ <forcedlogin_cmd>/system/usr/bin/login -z %Z -f %u</forcedlogin_cmd>
+ <user_cmd>/system/usr/bin/getent passwd %u</user_cmd>
+
+ <install>/usr/lib/brand/sngl/sinstall -z %z -R %R</install>
+ <installopts>R:t:U:q:z:</installopts>
+ <boot></boot>
+ <halt></halt>
+ <verify_cfg></verify_cfg>
+ <verify_adm></verify_adm>
+ <postclone></postclone>
+ <postinstall></postinstall>
+ <attach>/bin/true</attach>
+ <detach>/bin/true</detach>
+ <clone></clone>
+ <uninstall>/usr/lib/brand/joyent/juninstall -z %z -R %R</uninstall>
+ <prestatechange>/usr/lib/brand/joyent/prestate %z %R</prestatechange>
+ <poststatechange>/usr/lib/brand/joyent/poststate %z %R</poststatechange>
+ <query>/usr/lib/brand/joyent/query %z %R</query>
+
+ <privilege set="default" name="contract_event" />
+ <privilege set="default" name="contract_identity" />
+ <privilege set="default" name="contract_observer" />
+ <privilege set="default" name="dtrace_proc" />
+ <privilege set="default" name="dtrace_user" />
+ <privilege set="default" name="file_chown" />
+ <privilege set="default" name="file_chown_self" />
+ <privilege set="default" name="file_dac_execute" />
+ <privilege set="default" name="file_dac_read" />
+ <privilege set="default" name="file_dac_search" />
+ <privilege set="default" name="file_dac_write" />
+ <privilege set="default" name="file_owner" />
+ <privilege set="default" name="file_setid" />
+ <privilege set="default" name="ipc_dac_read" />
+ <privilege set="default" name="ipc_dac_write" />
+ <privilege set="default" name="ipc_owner" />
+ <privilege set="default" name="net_bindmlp" />
+ <privilege set="default" name="net_icmpaccess" />
+ <privilege set="default" name="net_mac_aware" />
+ <privilege set="default" name="net_observability" />
+ <privilege set="default" name="net_privaddr" />
+ <privilege set="default" name="net_rawaccess" ip-type="exclusive" />
+ <privilege set="default" name="proc_chroot" />
+ <privilege set="default" name="sys_audit" />
+ <privilege set="default" name="proc_audit" />
+ <privilege set="default" name="proc_lock_memory" />
+ <privilege set="default" name="proc_owner" />
+ <privilege set="default" name="proc_prioup" />
+ <privilege set="default" name="proc_setid" />
+ <privilege set="default" name="proc_taskid" />
+ <privilege set="default" name="sys_acct" />
+ <privilege set="default" name="sys_admin" />
+ <privilege set="default" name="sys_ip_config" ip-type="exclusive" />
+ <privilege set="default" name="sys_iptun_config" ip-type="exclusive" />
+ <privilege set="default" name="sys_mount" />
+ <privilege set="default" name="sys_nfs" />
+ <privilege set="default" name="sys_resource" />
+ <privilege set="default" name="sys_ppp_config" ip-type="exclusive" />
+
+ <privilege set="prohibited" name="dtrace_kernel" />
+ <privilege set="prohibited" name="proc_zone" />
+ <privilege set="prohibited" name="sys_config" />
+ <privilege set="prohibited" name="sys_devices" />
+ <privilege set="prohibited" name="sys_ip_config" ip-type="shared" />
+ <privilege set="prohibited" name="sys_linkdir" />
+ <privilege set="prohibited" name="sys_net_config" />
+ <privilege set="prohibited" name="sys_res_config" />
+ <privilege set="prohibited" name="sys_suser_compat" />
+ <privilege set="prohibited" name="xvm_control" />
+ <privilege set="prohibited" name="virt_manage" />
+ <privilege set="prohibited" name="sys_ppp_config" ip-type="shared" />
+
+ <privilege set="required" name="proc_exec" />
+ <privilege set="required" name="proc_fork" />
+ <privilege set="required" name="sys_ip_config" ip-type="exclusive" />
+ <privilege set="required" name="sys_mount" />
+</brand>
diff --git a/usr/src/lib/brand/sngl/zone/platform.xml b/usr/src/lib/brand/sngl/zone/platform.xml
new file mode 100644
index 0000000000..d9313f8b5c
--- /dev/null
+++ b/usr/src/lib/brand/sngl/zone/platform.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+
+<!--
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License (the "License").
+ You may not use this file except in compliance with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+
+ Copyright (c) 2012 Joyent, Inc. All rights reserved.
+ Use is subject to license terms.
+
+ DO NOT EDIT THIS FILE.
+-->
+
+<!DOCTYPE platform PUBLIC "-//Joyent Inc//Zones Platform//EN"
+ "file:///usr/share/lib/xml/dtd/zone_platform.dtd.1">
+
+<platform name="sngl" allow-exclusive-ip="true">
+
+ <!-- Global filesystems to mount when booting the zone -->
+ <global_mount special="/dev" directory="/dev" type="dev"
+ opt="attrdir=%R/root/dev"/>
+
+ <global_mount special="/lib" directory="/lib"
+ opt="ro,nodevices" type="lofs" />
+ <global_mount special="%P/manifests/joyent"
+ directory="/lib/svc/manifest"
+ opt="ro,nodevices" type="lofs" />
+ <global_mount special="%R/site" directory="/lib/svc/manifest/site"
+ opt="nodevices" type="lofs" />
+ <global_mount special="/sbin" directory="/sbin"
+ opt="ro,nodevices" type="lofs" />
+ <global_mount special="/lib" directory="/system/lib"
+ opt="ro,nodevices" type="lofs" />
+ <global_mount special="/sbin" directory="/system/sbin"
+ opt="ro,nodevices" type="lofs" />
+ <global_mount special="/usr" directory="/system/usr"
+ opt="ro,nodevices" type="lofs" />
+
+ <!-- Local filesystems to mount when booting the zone -->
+ <mount special="/proc" directory="/proc" type="proc" />
+ <mount special="ctfs" directory="/system/contract" type="ctfs" />
+ <mount special="mnttab" directory="/etc/mnttab" type="mntfs" />
+ <mount special="objfs" directory="/system/object" type="objfs" />
+ <mount special="lxproc" directory="/system/lxproc" type="lxproc" />
+ <mount special="swap" directory="/etc/svc/volatile" type="tmpfs" />
+
+ <!-- Devices to create under /dev -->
+ <device match="arp" />
+ <device match="bpf" />
+ <device match="conslog" />
+ <device match="cpu/self/cpuid" />
+ <device match="crypto" />
+ <device match="cryptoadm" />
+ <device match="dsk" />
+ <device match="dtrace/*" />
+ <device match="dtrace/provider/*" />
+ <device match="fd" />
+ <device match="ipnet" />
+ <device match="kstat" />
+ <device match="lo0" />
+ <device match="lofictl" />
+ <device match="lofi" />
+ <device match="log" />
+ <device match="logindmux" />
+ <device match="nsmb" />
+ <device match="net/*" />
+ <device match="null" />
+ <device match="openprom" arch="sparc" />
+ <device match="poll" />
+ <device match="pool" />
+ <device match="ptmx" />
+ <device match="pts/*" />
+ <device match="random" />
+ <device match="rdsk" />
+ <device match="rlofi" />
+ <device match="rmt" />
+ <device match="sad/user" />
+ <device match="svvslo0" />
+ <device match="svvslo1" />
+ <device match="svvslo2" />
+ <device match="svvslo3" />
+ <device match="swap" />
+ <device match="sysevent" />
+ <device match="tap" />
+ <device match="tcp" />
+ <device match="tcp6" />
+ <device match="term" />
+ <device match="ticlts" />
+ <device match="ticots" />
+ <device match="ticotsord" />
+ <device match="tty" />
+ <device match="tun" />
+ <device match="udp" />
+ <device match="udp6" />
+ <device match="urandom" />
+ <device match="zero" />
+ <device match="zfs" />
+ <device match="zvol/dsk/%P/%z/*" />
+ <device match="zvol/rdsk/%P/%z/*" />
+
+ <!-- Devices to create in exclusive IP zone only -->
+ <device match="dld" ip-type="exclusive" />
+ <device match="icmp" ip-type="exclusive" />
+ <device match="icmp6" ip-type="exclusive" />
+ <device match="ip" ip-type="exclusive" />
+ <device match="ip6" ip-type="exclusive" />
+ <device match="ipauth" ip-type="exclusive" />
+ <device match="ipd" ip-type="exclusive" />
+ <device match="ipf" ip-type="exclusive" />
+ <device match="ipl" ip-type="exclusive" />
+ <device match="iplookup" ip-type="exclusive" />
+ <device match="ipmpstub" ip-type="exclusive" />
+ <device match="ipnat" ip-type="exclusive" />
+ <device match="ipscan" ip-type="exclusive" />
+ <device match="ipsecah" ip-type="exclusive" />
+ <device match="ipsecesp" ip-type="exclusive" />
+ <device match="ipstate" ip-type="exclusive" />
+ <device match="ipsync" ip-type="exclusive" />
+ <device match="keysock" ip-type="exclusive" />
+ <device match="rawip" ip-type="exclusive" />
+ <device match="rawip6" ip-type="exclusive" />
+ <device match="rts" ip-type="exclusive" />
+ <device match="sad/admin" ip-type="exclusive" />
+ <device match="sctp" ip-type="exclusive" />
+ <device match="sctp6" ip-type="exclusive" />
+ <device match="spdsock" ip-type="exclusive" />
+ <device match="sppp" ip-type="exclusive" />
+ <device match="sppptun" ip-type="exclusive" />
+ <device match="vni" ip-type="exclusive" />
+
+ <!-- Renamed devices to create under /dev -->
+ <device match="zcons/%z/zoneconsole" name="zconsole" />
+
+ <!-- Symlinks to create under /dev -->
+ <symlink source="console" target="zconsole" />
+ <symlink source="dtremote" target="/dev/null" />
+ <symlink source="msglog" target="zconsole" />
+ <symlink source="stderr" target="./fd/2" />
+ <symlink source="stdin" target="./fd/0" />
+ <symlink source="stdout" target="./fd/1" />
+ <symlink source="syscon" target="zconsole" />
+ <symlink source="sysmsg" target="zconsole" />
+ <symlink source="systty" target="zconsole" />
+
+</platform>
diff --git a/usr/src/lib/brand/sngl/zone/sinstall.sh b/usr/src/lib/brand/sngl/zone/sinstall.sh
new file mode 100644
index 0000000000..d0633a7525
--- /dev/null
+++ b/usr/src/lib/brand/sngl/zone/sinstall.sh
@@ -0,0 +1,118 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+unset LD_LIBRARY_PATH
+PATH=/usr/bin:/usr/sbin
+export PATH
+
+. /usr/lib/brand/shared/common.ksh
+. /usr/lib/brand/joyent/common.ksh
+
+ZONENAME=""
+ZONEPATH=""
+# Default to 10GB diskset quota
+ZQUOTA=10
+
+while getopts "R:t:U:q:z:" opt
+do
+ case "$opt" in
+ R) ZONEPATH="$OPTARG";;
+ t) TMPLZONE="$OPTARG";;
+ # UUID is only used in the postinstall script
+ U) UUID="$OPTARG";;
+ q) ZQUOTA="$OPTARG";;
+ z) ZONENAME="$OPTARG";;
+ *) printf "$m_usage\n"
+ exit $ZONE_SUBPROC_USAGE;;
+ esac
+done
+shift OPTIND-1
+
+if [[ -n $(zonecfg -z "${ZONENAME}" info attr name=transition \
+ | grep "value: receiving:") ]]; then
+
+ # Here we're doing an install for a received zone, the dataset should have
+ # already been created.
+ exit $ZONE_SUBPROC_OK
+fi
+
+if [[ -z $ZONEPATH || -z $ZONENAME ]]; then
+ print -u2 "Brand error: No zone path or name"
+ exit $ZONE_SUBPROC_USAGE
+fi
+
+# The install requires a template zone.
+if [[ -z $TMPLZONE ]]; then
+ print -u2 "Brand error: a zone template is required"
+ exit $ZONE_SUBPROC_USAGE
+fi
+
+# The dataset quota must be a number.
+case $ZQUOTA in *[!0-9]*)
+ print -u2 "Brand error: The quota $ZQUOTA is not a number"
+ exit $ZONE_SUBPROC_USAGE;;
+esac
+
+ZROOT=$ZONEPATH/root
+
+# Get the dataset of the parent directory of the zonepath.
+dname=${ZONEPATH%/*}
+bname=${ZONEPATH##*/}
+PDS_NAME=`mount | nawk -v p=$dname '{if ($1 == p) print $3}'`
+[ -z "$PDS_NAME" ] && \
+ print -u2 "Brand error: missing parent ZFS dataset for $dname"
+
+# We expect that zoneadm was invoked with '-x nodataset', so it won't have
+# created the dataset.
+
+QUOTA_ARG=
+if [[ ${ZQUOTA} != "0" ]]; then
+ QUOTA_ARG="-o quota=${ZQUOTA}g"
+fi
+
+# New imgadm renames the dataset's snapshot at import to @final for us
+# and when it exists, we use that. However, when it does not exist we
+# still use the old method of creating a zones/<uuid>@<uuid> snapshot
+# so we can support old datasets.
+exists=$(zfs list -Ho name ${PDS_NAME}/${TMPLZONE}@final 2>&1)
+if [[ $? == 0 && ${exists} == "${PDS_NAME}/${TMPLZONE}@final" ]]; then
+ zfs clone -F ${QUOTA_ARG} ${PDS_NAME}/${TMPLZONE}@final \
+ ${PDS_NAME}/${bname} || fatal "failed to clone zone dataset"
+elif [[ ${exists} =~ "dataset does not exist" ]]; then
+ zfs snapshot ${PDS_NAME}/${TMPLZONE}@${bname}
+ zfs clone -F ${QUOTA_ARG} ${PDS_NAME}/${TMPLZONE}@${bname} \
+ ${PDS_NAME}/${bname} || fatal "failed to clone zone dataset"
+else
+ fatal "Unable to determine snapshot for ${PDS_NAME}/${TMPLZONE}"
+fi
+
+if [ ! -d ${ZONEPATH}/config ]; then
+ mkdir -p ${ZONEPATH}/config
+ chmod 755 ${ZONEPATH}/config
+fi
+
+final_setup
+
+exit $ZONE_SUBPROC_OK
diff --git a/usr/src/lib/common/i386/crtn.s b/usr/src/lib/common/i386/crtn.s
index 6e37e25a8f..413c102006 100644
--- a/usr/src/lib/common/i386/crtn.s
+++ b/usr/src/lib/common/i386/crtn.s
@@ -33,7 +33,6 @@
*
* For further details - see bug#4433015
*/
- .ident "%Z%%M% %I% %E% SMI"
.file "crtn.s"
/*
diff --git a/usr/src/lib/fm/topo/libtopo/common/libtopo.h b/usr/src/lib/fm/topo/libtopo/common/libtopo.h
index 3ea35cdddd..e0adb6e0ab 100644
--- a/usr/src/lib/fm/topo/libtopo/common/libtopo.h
+++ b/usr/src/lib/fm/topo/libtopo/common/libtopo.h
@@ -22,6 +22,9 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#ifndef _LIBTOPO_H
#define _LIBTOPO_H
@@ -389,6 +392,8 @@ extern void topo_hdl_free(topo_hdl_t *, void *, size_t);
extern int topo_hdl_nvalloc(topo_hdl_t *, nvlist_t **, uint_t);
extern int topo_hdl_nvdup(topo_hdl_t *, nvlist_t *, nvlist_t **);
extern char *topo_hdl_strdup(topo_hdl_t *, const char *);
+extern char *topo_hdl_strsplit(topo_hdl_t *, const char *, const char *,
+ char **);
/*
* Interfaces for converting sensor/indicator types, units, states, etc to
diff --git a/usr/src/lib/fm/topo/libtopo/common/mapfile-vers b/usr/src/lib/fm/topo/libtopo/common/mapfile-vers
index b81f4fd7c6..c6ff800951 100644
--- a/usr/src/lib/fm/topo/libtopo/common/mapfile-vers
+++ b/usr/src/lib/fm/topo/libtopo/common/mapfile-vers
@@ -76,6 +76,7 @@ SYMBOL_VERSION SUNWprivate {
topo_hdl_prominfo;
topo_hdl_strdup;
topo_hdl_strfree;
+ topo_hdl_strsplit;
topo_hdl_zalloc;
topo_led_state_name;
topo_led_type_name;
@@ -118,6 +119,7 @@ SYMBOL_VERSION SUNWprivate {
topo_mod_str2nvl;
topo_mod_strdup;
topo_mod_strfree;
+ topo_mod_strsplit;
topo_mod_unload;
topo_mod_unregister;
topo_mod_walk_init;
diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_mod.h b/usr/src/lib/fm/topo/libtopo/common/topo_mod.h
index 2a137ad388..e6dda440a0 100644
--- a/usr/src/lib/fm/topo/libtopo/common/topo_mod.h
+++ b/usr/src/lib/fm/topo/libtopo/common/topo_mod.h
@@ -22,6 +22,9 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#ifndef _TOPO_MOD_H
#define _TOPO_MOD_H
@@ -215,6 +218,8 @@ extern void *topo_mod_zalloc(topo_mod_t *, size_t);
extern void topo_mod_free(topo_mod_t *, void *, size_t);
extern char *topo_mod_strdup(topo_mod_t *, const char *);
extern void topo_mod_strfree(topo_mod_t *, char *);
+extern char *topo_mod_strsplit(topo_mod_t *, const char *, const char *,
+ char **);
extern int topo_mod_nvalloc(topo_mod_t *, nvlist_t **, uint_t);
extern int topo_mod_nvdup(topo_mod_t *, nvlist_t *, nvlist_t **);
diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_string.c b/usr/src/lib/fm/topo/libtopo/common/topo_string.c
index 2c1f451770..2f59013e9e 100644
--- a/usr/src/lib/fm/topo/libtopo/common/topo_string.c
+++ b/usr/src/lib/fm/topo/libtopo/common/topo_string.c
@@ -23,8 +23,9 @@
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <strings.h>
#include <ctype.h>
@@ -56,6 +57,58 @@ topo_hdl_strfree(topo_hdl_t *thp, char *s)
}
char *
+topo_hdl_strsplit(topo_hdl_t *hdl, const char *input, const char *sep,
+ char **lastp)
+{
+ size_t seplen = strlen(sep);
+ const char *scanstart;
+ char *token;
+ char *ret;
+
+ if (input != NULL) {
+ /*
+ * Start scanning at beginning of input:
+ */
+ scanstart = input;
+ } else if (*lastp == NULL) {
+ /*
+ * If we have already finished scanning, return NULL.
+ */
+ return (NULL);
+ } else {
+ /*
+ * Otherwise, start scanning where we left off:
+ */
+ scanstart = *lastp;
+ }
+
+ token = strstr(scanstart, sep);
+ if (token != NULL) {
+ /*
+ * We still have a separator, so advance the next-start
+ * pointer past it:
+ */
+ *lastp = token + seplen;
+ /*
+ * Copy out this element. The buffer must fit the string
+ * exactly, so that topo_hdl_strfree() can determine its
+ * size with strlen().
+ */
+ ret = topo_hdl_alloc(hdl, token - scanstart + 1);
+ (void) strncpy(ret, scanstart, token - scanstart);
+ ret[token - scanstart] = '\0';
+ } else {
+ /*
+ * We have no separator, so this is the last element:
+ */
+ *lastp = NULL;
+ ret = topo_hdl_strdup(hdl, scanstart);
+ }
+
+ return (ret);
+}
+
+char *
topo_mod_strdup(topo_mod_t *mod, const char *s)
{
return (topo_hdl_strdup(mod->tm_hdl, s));
@@ -67,6 +120,13 @@ topo_mod_strfree(topo_mod_t *mod, char *s)
topo_hdl_strfree(mod->tm_hdl, s);
}
+char *
+topo_mod_strsplit(topo_mod_t *mod, const char *input, const char *sep,
+ char **lastp)
+{
+ return (topo_hdl_strsplit(mod->tm_hdl, input, sep, lastp));
+}
+
const char *
topo_strbasename(const char *s)
{
diff --git a/usr/src/lib/fm/topo/maps/Joyent,Joyent-Compute-Platform-1101/Joyent-Compute-Platform-1101-disk-hc-topology.xmlgenksh b/usr/src/lib/fm/topo/maps/Joyent,Joyent-Compute-Platform-1101/Joyent-Compute-Platform-1101-disk-hc-topology.xmlgenksh
index 000742db71..874bad142f 100644..100755
--- a/usr/src/lib/fm/topo/maps/Joyent,Joyent-Compute-Platform-1101/Joyent-Compute-Platform-1101-disk-hc-topology.xmlgenksh
+++ b/usr/src/lib/fm/topo/maps/Joyent,Joyent-Compute-Platform-1101/Joyent-Compute-Platform-1101-disk-hc-topology.xmlgenksh
@@ -69,17 +69,19 @@ EOF
enclosure=1
bay=0
slot=0
-devctl='/devices/pci@0,0/pci8086,3c02@1/pci15d9,691@0:devctl'
+devctl0='/devices/pci@0,0/pci8086,3c02@1/pci15d9,691@0:devctl'
+devctl1='/devices/pci@0,0/pci8086,e02@1/pci15d9,691@0:devctl'
while (( slot <= 7 )); do
- do_node $bay "Front Disk $bay" "$devctl" $enclosure $slot
+ do_node $bay "Front Disk $bay" "$devctl0|$devctl1" $enclosure $slot
(( bay = bay + 1 ))
(( slot = slot + 1 ))
done
slot=0
-devctl='/devices/pci@0,0/pci8086,3c06@2,2/pci15d9,691@0:devctl'
+devctl0='/devices/pci@0,0/pci8086,3c06@2,2/pci15d9,691@0:devctl'
+devctl1='/devices/pci@0,0/pci8086,e06@2,2/pci15d9,691@0:devctl'
while (( slot <= 7 )); do
- do_node $bay "Front Disk $bay" "$devctl" $enclosure $slot
+ do_node $bay "Front Disk $bay" "$devctl0|$devctl1" $enclosure $slot
(( bay = bay + 1 ))
(( slot = slot + 1 ))
done
diff --git a/usr/src/lib/fm/topo/modules/common/disk/disk_mptsas.c b/usr/src/lib/fm/topo/modules/common/disk/disk_mptsas.c
index db853c6695..beae89f9f1 100644
--- a/usr/src/lib/fm/topo/modules/common/disk/disk_mptsas.c
+++ b/usr/src/lib/fm/topo/modules/common/disk/disk_mptsas.c
@@ -32,11 +32,18 @@
#include "disk.h"
#include "disk_drivers.h"
+/*
+ * Request the SAS address of the disk (if any) attached to this mpt_sas
+ * instance at (Enclosure Number, Slot Number). The function returns
+ * -1 on error and sets errno to ENOENT _only_ if the /devices node
+ * (*devctl) does not exist.
+ */
static int
get_sas_address(topo_mod_t *mod, char *devctl, uint32_t enclosure,
uint32_t slot, char **sas_address)
{
- int fd, err, i;
+ int ret = -1, en = ENXIO;
+ int fd, i;
mptsas_get_disk_info_t gdi;
mptsas_disk_info_t *di;
size_t disz;
@@ -44,16 +51,19 @@ get_sas_address(topo_mod_t *mod, char *devctl, uint32_t enclosure,
bzero(&gdi, sizeof (gdi));
if ((fd = open(devctl, O_RDWR)) == -1) {
+ en = errno;
topo_mod_dprintf(mod, "could not open '%s' for ioctl: %s\n",
devctl, strerror(errno));
+ errno = en;
return (-1);
}
if (ioctl(fd, MPTIOCTL_GET_DISK_INFO, &gdi) == -1) {
+ if (errno != ENOENT)
+ en = errno;
topo_mod_dprintf(mod, "ioctl 1 on '%s' failed: %s\n", devctl,
strerror(errno));
- (void) close(fd);
- return (-1);
+ goto out;
}
gdi.DiskInfoArraySize = disz = sizeof (mptsas_disk_info_t) *
@@ -61,19 +71,19 @@ get_sas_address(topo_mod_t *mod, char *devctl, uint32_t enclosure,
gdi.PtrDiskInfoArray = di = topo_mod_alloc(mod, disz);
if (di == NULL) {
topo_mod_dprintf(mod, "memory allocation failed\n");
- (void) close(fd);
- return (-1);
+ en = ENOMEM;
+ goto out;
}
if (ioctl(fd, MPTIOCTL_GET_DISK_INFO, &gdi) == -1) {
+ if (errno != ENOENT)
+ en = errno;
topo_mod_dprintf(mod, "ioctl 2 on '%s' failed: %s\n", devctl,
strerror(errno));
topo_mod_free(mod, di, disz);
- (void) close(fd);
- return (-1);
+ goto out;
}
- err = -1;
for (i = 0; i < gdi.DiskCount; i++) {
if (di[i].Enclosure == enclosure && di[i].Slot == slot) {
char sas[17]; /* 16 hex digits and NUL */
@@ -81,14 +91,16 @@ get_sas_address(topo_mod_t *mod, char *devctl, uint32_t enclosure,
topo_mod_dprintf(mod, "found mpt_sas disk (%d/%d) "
"with adddress %s\n", enclosure, slot, sas);
*sas_address = topo_mod_strdup(mod, sas);
- err = 0;
+ en = ret = 0;
break;
}
}
topo_mod_free(mod, di, disz);
+out:
(void) close(fd);
- return (err);
+ errno = en;
+ return (ret);
}
int
@@ -97,6 +109,8 @@ disk_mptsas_find_disk(topo_mod_t *mod, tnode_t *baynode, char **sas_address)
char *devctl = NULL;
uint32_t enclosure, slot;
int err;
+ char *elem, *lastp;
+ int ret = -1;
/*
* Get the required properties from the node. These come from
@@ -115,6 +129,35 @@ disk_mptsas_find_disk(topo_mod_t *mod, tnode_t *baynode, char **sas_address)
return (-1);
}
- return (get_sas_address(mod, devctl, enclosure, slot, sas_address));
+ /*
+ * devctl is a (potentially) pipe-separated list of different device
+ * paths to try.
+ */
+ if ((elem = topo_mod_strsplit(mod, devctl, "|", &lastp)) != NULL) {
+ boolean_t done = B_FALSE;
+ do {
+ topo_mod_dprintf(mod, "trying mpt_sas instance at %s\n",
+ elem);
+
+ ret = get_sas_address(mod, elem, enclosure,
+ slot, sas_address);
+
+ /*
+ * Only try further devctl paths from the list if this
+ * one was not found:
+ */
+ if (ret == 0 || errno != ENOENT) {
+ done = B_TRUE;
+ } else {
+ topo_mod_dprintf(mod, "instance not found\n");
+ }
+
+ topo_mod_strfree(mod, elem);
+
+ } while (!done && (elem = topo_mod_strsplit(mod, NULL, "|",
+ &lastp)) != NULL);
+ }
+ topo_mod_strfree(mod, devctl);
+ return (ret);
}
diff --git a/usr/src/lib/fm/topo/modules/common/fac_prov_mptsas/fac_prov_mptsas.c b/usr/src/lib/fm/topo/modules/common/fac_prov_mptsas/fac_prov_mptsas.c
index a49a131811..115e3b801d 100644
--- a/usr/src/lib/fm/topo/modules/common/fac_prov_mptsas/fac_prov_mptsas.c
+++ b/usr/src/lib/fm/topo/modules/common/fac_prov_mptsas/fac_prov_mptsas.c
@@ -72,6 +72,12 @@ _topo_fini(topo_mod_t *mod)
topo_mod_unregister(mod);
}
+/*
+ * Get or set LED state for a particular target attached to an mpt_sas
+ * instance at (Enclosure Number, Slot Number). The function returns
+ * -1 on error and sets errno to ENOENT _only_ if the /devices node
+ * (*devctl) does not exist.
+ */
static int
do_led_control(topo_mod_t *mod, char *devctl, uint16_t enclosure,
uint16_t slot, uint8_t led, uint32_t *ledmode, boolean_t set)
@@ -88,8 +94,10 @@ do_led_control(topo_mod_t *mod, char *devctl, uint16_t enclosure,
lc.LedStatus = *ledmode;
if ((fd = open(devctl, (set ? O_RDWR : O_RDONLY))) == -1) {
+ int en = errno;
topo_mod_dprintf(mod, "devctl open failed: %s",
strerror(errno));
+ errno = en;
return (-1);
}
@@ -103,9 +111,11 @@ do_led_control(topo_mod_t *mod, char *devctl, uint16_t enclosure,
*/
lc.LedStatus = 0;
} else {
+ int en = errno;
topo_mod_dprintf(mod, "led control ioctl failed: %s",
strerror(errno));
(void) close(fd);
+ errno = en;
return (-1);
}
}
@@ -113,6 +123,7 @@ do_led_control(topo_mod_t *mod, char *devctl, uint16_t enclosure,
*ledmode = lc.LedStatus ? TOPO_LED_STATE_ON : TOPO_LED_STATE_OFF;
(void) close(fd);
+ errno = 0;
return (0);
}
@@ -127,7 +138,8 @@ mptsas_led_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers,
char *driver = NULL, *devctl = NULL;
uint32_t enclosure, slot;
uint8_t mptsas_led;
- boolean_t set;
+ boolean_t set, done;
+ char *elem, *lastp;
if (vers > TOPO_METH_MPTSAS_LED_MODE_VERSION)
return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW));
@@ -197,8 +209,41 @@ mptsas_led_mode(topo_mod_t *mod, tnode_t *node, topo_version_t vers,
topo_mod_dprintf(mod, "%s: Getting LED mode\n", __func__);
}
- if (do_led_control(mod, devctl, enclosure, slot, mptsas_led, &ledmode,
- set) != 0) {
+ /*
+ * devctl is a (potentially) pipe-separated list of different device
+ * paths to try.
+ */
+ if ((elem = topo_mod_strsplit(mod, devctl, "|", &lastp)) == NULL) {
+ topo_mod_dprintf(mod, "%s: could not parse devctl list",
+ __func__);
+ ret = topo_mod_seterrno(mod, EMOD_UNKNOWN);
+ goto out;
+ }
+ done = B_FALSE;
+ do {
+ topo_mod_dprintf(mod, "%s: trying mpt_sas instance at %s\n",
+ __func__, elem);
+
+ ret = do_led_control(mod, elem, enclosure, slot,
+ mptsas_led, &ledmode, set);
+
+ /*
+ * Only try further devctl paths from the list if this one
+ * was not found:
+ */
+ if (ret == 0 || errno != ENOENT) {
+ done = B_TRUE;
+ } else {
+ topo_mod_dprintf(mod, "%s: instance not found\n",
+ __func__);
+ }
+
+ topo_mod_strfree(mod, elem);
+
+ } while (!done && (elem = topo_mod_strsplit(mod, NULL, "|",
+ &lastp)) != NULL);
+
+ if (ret != 0) {
topo_mod_dprintf(mod, "%s: do_led_control failed", __func__);
ret = topo_mod_seterrno(mod, EMOD_UNKNOWN);
goto out;
diff --git a/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com b/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com
index 8449d22e24..07fcb2bbf7 100644
--- a/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com
+++ b/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com
@@ -70,7 +70,7 @@ CERRWARN += -_gcc=-Wno-unused-function
CFLAGS += $(CCVERBOSE) -I..
DYNFLAGS += $(KRUNPATH) $(KMECHLIB) -znodelete
-LDLIBS += -L $(ROOTLIBDIR) -lcrypto -lc
+LDLIBS += -L $(ROOTLIBDIR) -lsunw_crypto -lc
ROOTLIBDIR= $(ROOT)/usr/lib/krb5/plugins/preauth
diff --git a/usr/src/lib/libbe/common/be_list.c b/usr/src/lib/libbe/common/be_list.c
index 29ba142bc0..535e35a2ca 100644
--- a/usr/src/lib/libbe/common/be_list.c
+++ b/usr/src/lib/libbe/common/be_list.c
@@ -25,6 +25,7 @@
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
#include <assert.h>
@@ -876,7 +877,7 @@ be_get_node_data(
}
(void) zpool_get_prop(zphp, ZPOOL_PROP_BOOTFS, prop_buf,
- ZFS_MAXPROPLEN, NULL);
+ ZFS_MAXPROPLEN, NULL, B_FALSE);
if (be_has_grub() && (be_default_grub_bootfs(rpool,
&grub_default_bootfs) == BE_SUCCESS) &&
grub_default_bootfs != NULL)
diff --git a/usr/src/lib/libbrand/common/libbrand.c b/usr/src/lib/libbrand/common/libbrand.c
index 5034715a7e..baaaf33120 100644
--- a/usr/src/lib/libbrand/common/libbrand.c
+++ b/usr/src/lib/libbrand/common/libbrand.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#include <assert.h>
@@ -60,6 +61,7 @@
#define DTD_ELEM_FORCELOGIN_CMD ((const xmlChar *) "forcedlogin_cmd")
#define DTD_ELEM_MODNAME ((const xmlChar *) "modname")
#define DTD_ELEM_MOUNT ((const xmlChar *) "mount")
+#define DTD_ELEM_RESTARTINIT ((const xmlChar *) "restartinit")
#define DTD_ELEM_POSTATTACH ((const xmlChar *) "postattach")
#define DTD_ELEM_POSTCLONE ((const xmlChar *) "postclone")
#define DTD_ELEM_POSTINSTALL ((const xmlChar *) "postinstall")
@@ -319,6 +321,7 @@ i_substitute_tokens(const char *sbuf, char *dbuf, int dbuf_size,
const char *curr_zone)
{
int dst, src;
+ static char *env_pool = NULL;
/*
* Walk through the characters, substituting values as needed.
@@ -335,6 +338,13 @@ i_substitute_tokens(const char *sbuf, char *dbuf, int dbuf_size,
case '%':
dst += strlcpy(dbuf + dst, "%", dbuf_size - dst);
break;
+ case 'P':
+ if (env_pool == NULL)
+ env_pool = getenv("_ZONEADMD_ZPOOL");
+ if (env_pool == NULL)
+ break;
+ dst += strlcpy(dbuf + dst, env_pool, dbuf_size - dst);
+ break;
case 'R':
if (zonepath == NULL)
break;
@@ -509,6 +519,21 @@ brand_get_initname(brand_handle_t bh, char *buf, size_t len)
buf, len, DTD_ELEM_INITNAME, B_FALSE, B_FALSE));
}
+boolean_t
+brand_restartinit(brand_handle_t bh)
+{
+ struct brand_handle *bhp = (struct brand_handle *)bh;
+ char val[80];
+
+ if (brand_get_value(bhp, NULL, NULL, NULL, NULL,
+ val, 80, DTD_ELEM_RESTARTINIT, B_FALSE, B_FALSE) != 0)
+ return (B_TRUE);
+
+ if (strcmp(val, "false") == 0)
+ return (B_FALSE);
+ return (B_TRUE);
+}
+
int
brand_get_login_cmd(brand_handle_t bh, const char *username,
char *buf, size_t len)
diff --git a/usr/src/lib/libbrand/common/libbrand.h b/usr/src/lib/libbrand/common/libbrand.h
index 19231604a5..1ca9e9f36d 100644
--- a/usr/src/lib/libbrand/common/libbrand.h
+++ b/usr/src/lib/libbrand/common/libbrand.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBBRAND_H
@@ -57,6 +58,7 @@ extern int brand_get_detach(brand_handle_t, const char *, const char *,
extern int brand_get_halt(brand_handle_t, const char *, const char *,
char *, size_t);
extern int brand_get_initname(brand_handle_t, char *, size_t);
+extern boolean_t brand_restartinit(brand_handle_t);
extern int brand_get_install(brand_handle_t, const char *, const char *,
char *, size_t);
extern int brand_get_installopts(brand_handle_t, char *, size_t);
diff --git a/usr/src/lib/libbrand/common/mapfile-vers b/usr/src/lib/libbrand/common/mapfile-vers
index 7b961c3c18..9bf21d2d26 100644
--- a/usr/src/lib/libbrand/common/mapfile-vers
+++ b/usr/src/lib/libbrand/common/mapfile-vers
@@ -20,6 +20,7 @@
#
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Joyent, Inc. All rights reserved.
#
#
@@ -76,6 +77,7 @@ SYMBOL_VERSION SUNWprivate {
brand_platform_iter_gmounts;
brand_platform_iter_link;
brand_platform_iter_mounts;
+ brand_restartinit;
local:
*;
};
diff --git a/usr/src/lib/libbrand/dtd/brand.dtd.1 b/usr/src/lib/libbrand/dtd/brand.dtd.1
index 15542102db..89719a6ae6 100644
--- a/usr/src/lib/libbrand/dtd/brand.dtd.1
+++ b/usr/src/lib/libbrand/dtd/brand.dtd.1
@@ -21,6 +21,7 @@
CDDL HEADER END
Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, Joyent, Inc. All rights reserved.
DO NOT EDIT THIS FILE.
-->
@@ -188,6 +189,19 @@
<!ATTLIST initname>
<!--
+ restartinit
+
+ Boolean indicating that the program specified by the initname attr
+ should be restarted, or not, if it exits. By default, the init program
+ will be restarted if this attribute is not provided. Specifying false
+ for this attr will prevent that.
+
+ It has no attributes.
+-->
+<!ELEMENT restartinit (#PCDATA) >
+<!ATTLIST restartinit>
+
+<!--
login_cmd
Path to the initial login binary that should be executed when
@@ -605,8 +619,8 @@
directory in which the configuration file is stored.
-->
-<!ELEMENT brand (modname?, initname, login_cmd, forcedlogin_cmd,
- user_cmd, install,
+<!ELEMENT brand (modname?, initname, restartinit?, login_cmd,
+ forcedlogin_cmd, user_cmd, install,
installopts?, boot?, sysboot?, halt?, verify_cfg?,
verify_adm?, postattach?, postclone?, postinstall?,
predetach?, attach?, detach?, clone?,
diff --git a/usr/src/lib/libbsm/common/adt.c b/usr/src/lib/libbsm/common/adt.c
index 8c7b299e32..4cf0dd7566 100644
--- a/usr/src/lib/libbsm/common/adt.c
+++ b/usr/src/lib/libbsm/common/adt.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
#include <bsm/adt.h>
@@ -702,7 +703,37 @@ adt_get_hostIP(const char *hostname, au_tid_addr_t *p_term)
int tries = 3;
char msg[512];
int eai_err;
+ struct ifaddrlist al;
+ int family;
+ boolean_t found = B_FALSE;
+ /*
+ * getaddrinfo can take a long time to timeout if it can't map the
+ * hostname to an IP address so try to get an IP address from a local
+ * interface first.
+ */
+ family = AF_INET6;
+ if (adt_get_local_address(family, &al) == 0) {
+ found = B_TRUE;
+ } else {
+ family = AF_INET;
+ if (adt_get_local_address(family, &al) == 0)
+ found = B_TRUE;
+ }
+
+ if (found) {
+ if (family == AF_INET) {
+ p_term->at_type = AU_IPv4;
+ (void) memcpy(p_term->at_addr, &al.addr.addr, AU_IPv4);
+ } else {
+ p_term->at_type = AU_IPv6;
+ (void) memcpy(p_term->at_addr, &al.addr.addr6, AU_IPv6);
+ }
+
+ return (0);
+ }
+
+ /* Now try getaddrinfo */
while ((tries-- > 0) &&
((eai_err = getaddrinfo(hostname, NULL, NULL, &ai)) != 0)) {
/*
@@ -739,7 +770,9 @@ adt_get_hostIP(const char *hostname, au_tid_addr_t *p_term)
}
freeaddrinfo(ai);
return (0);
- } else if (auditstate & (AUC_AUDITING | AUC_NOSPACE)) {
+ }
+
+ if (auditstate & (AUC_AUDITING | AUC_NOSPACE)) {
auditinfo_addr_t audit_info;
/*
@@ -747,58 +780,23 @@ adt_get_hostIP(const char *hostname, au_tid_addr_t *p_term)
* kernel audit context
*/
if (auditon(A_GETKAUDIT, (caddr_t)&audit_info,
- sizeof (audit_info)) < 0) {
- adt_write_syslog("unable to get kernel audit context",
- errno);
- goto try_interface;
+ sizeof (audit_info)) >= 0) {
+ adt_write_syslog("setting Audit IP address to kernel",
+ 0);
+ *p_term = audit_info.ai_termid;
+ return (0);
}
- adt_write_syslog("setting Audit IP address to kernel", 0);
- *p_term = audit_info.ai_termid;
- return (0);
+ adt_write_syslog("unable to get kernel audit context", errno);
}
-try_interface:
- {
- struct ifaddrlist al;
- int family;
- char ntop[INET6_ADDRSTRLEN];
-
- /*
- * getaddrinfo has failed to map the hostname
- * to an IP address, try to get an IP address
- * from a local interface. If none up, default
- * to loopback.
- */
- family = AF_INET6;
- if (adt_get_local_address(family, &al) != 0) {
- family = AF_INET;
-
- if (adt_get_local_address(family, &al) != 0) {
- adt_write_syslog("adt_get_local_address "
- "failed, no Audit IP address available, "
- "faking loopback and error",
- errno);
- IN_SET_LOOPBACK_ADDR(
- (struct sockaddr_in *)&(al.addr.addr));
- (void) memcpy(p_term->at_addr, &al.addr.addr,
- AU_IPv4);
- p_term->at_type = AU_IPv4;
- return (-1);
- }
- }
- if (family == AF_INET) {
- p_term->at_type = AU_IPv4;
- (void) memcpy(p_term->at_addr, &al.addr.addr, AU_IPv4);
- } else {
- p_term->at_type = AU_IPv6;
- (void) memcpy(p_term->at_addr, &al.addr.addr6, AU_IPv6);
- }
- (void) snprintf(msg, sizeof (msg), "mapping %s to %s",
- hostname, inet_ntop(family, &(al.addr), ntop,
- sizeof (ntop)));
- adt_write_syslog(msg, 0);
- return (0);
- }
+ /* No mapping, default to loopback. */
+ errno = ENETDOWN;
+ adt_write_syslog("adt_get_local_address failed, no Audit IP address "
+ "available, faking loopback and error", errno);
+ IN_SET_LOOPBACK_ADDR((struct sockaddr_in *)&(al.addr.addr));
+ (void) memcpy(p_term->at_addr, &al.addr.addr, AU_IPv4);
+ p_term->at_type = AU_IPv4;
+ return (-1);
}
/*
@@ -2093,8 +2091,8 @@ adt_selected(struct adt_event_state *event, au_event_t actual_id, int status)
}
/*
- * Can't map the host name to an IP address in
- * adt_get_hostIP. Get something off an interface
+ * Before trying to map the host name to an IP address in
+ * adt_get_hostIP, get something off an interface
* to act as the hosts IP address for auditing.
*/
diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com
index b21f87a0d6..d91540d0ae 100644
--- a/usr/src/lib/libc/i386/Makefile.com
+++ b/usr/src/lib/libc/i386/Makefile.com
@@ -22,6 +22,7 @@
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, Joyent, Inc. All rights reserved.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Use is subject to license terms.
diff --git a/usr/src/lib/libc/inc/thr_inlines.h b/usr/src/lib/libc/inc/thr_inlines.h
index f7cdc6a6bd..66d811f25b 100644
--- a/usr/src/lib/libc/inc/thr_inlines.h
+++ b/usr/src/lib/libc/inc/thr_inlines.h
@@ -47,17 +47,19 @@
extern __GNU_INLINE ulwp_t *
_curthread(void)
{
-#if defined(__amd64)
ulwp_t *__value;
- __asm__ __volatile__("movq %%fs:0, %0" : "=r" (__value));
+ __asm__ __volatile__(
+#if defined(__amd64)
+ "movq %%fs:0, %0\n\t"
#elif defined(__i386)
- ulwp_t *__value;
- __asm__ __volatile__("movl %%gs:0, %0" : "=r" (__value));
+ "movl %%gs:0, %0\n\t"
#elif defined(__sparc)
- register ulwp_t *__value __asm__("g7");
+ ".register %%g7, #scratch\n\t"
+ "mov %%g7, %0\n\t"
#else
#error "port me"
#endif
+ : "=r" (__value));
return (__value);
}
diff --git a/usr/src/lib/libc/port/gen/getlogin.c b/usr/src/lib/libc/port/gen/getlogin.c
index a46d209189..08f29ec363 100644
--- a/usr/src/lib/libc/port/gen/getlogin.c
+++ b/usr/src/lib/libc/port/gen/getlogin.c
@@ -35,6 +35,7 @@
#include "lint.h"
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers
index 1882a337d5..86adb85d94 100644
--- a/usr/src/lib/libc/port/mapfile-vers
+++ b/usr/src/lib/libc/port/mapfile-vers
@@ -24,6 +24,7 @@
# Copyright 2010 Nexenta Systems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
diff --git a/usr/src/lib/libc/port/sys/zone.c b/usr/src/lib/libc/port/sys/zone.c
index 4a4c70043d..182a7f22f7 100644
--- a/usr/src/lib/libc/port/sys/zone.c
+++ b/usr/src/lib/libc/port/sys/zone.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent Inc. All rights reserved.
*/
#include "lint.h"
@@ -39,7 +40,8 @@
zoneid_t
zone_create(const char *name, const char *root, const struct priv_set *privs,
const char *rctls, size_t rctlsz, const char *zfs, size_t zfssz,
- int *extended_error, int match, int doi, const bslabel_t *label, int flags)
+ int *extended_error, int match, int doi, const bslabel_t *label, int flags,
+ zoneid_t req_zoneid)
{
zone_def zd;
priv_data_t *d;
@@ -59,6 +61,7 @@ zone_create(const char *name, const char *root, const struct priv_set *privs,
zd.doi = doi;
zd.label = label;
zd.flags = flags;
+ zd.zoneid = req_zoneid;
return ((zoneid_t)syscall(SYS_zone, ZONE_CREATE, &zd));
}
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index 25482d7324..c8779479d3 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -22,6 +22,7 @@
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Use is subject to license terms.
diff --git a/usr/src/lib/libc/sparc/crt/_rtld.c b/usr/src/lib/libc/sparc/crt/_rtld.c
index a9e9c6d98a..843cfe03a5 100644
--- a/usr/src/lib/libc/sparc/crt/_rtld.c
+++ b/usr/src/lib/libc/sparc/crt/_rtld.c
@@ -62,6 +62,15 @@
#define SYSCONFIG (*(funcs[SYSCONFIG_F]))
/*
+ * GCC will not emit unused static functions unless specifically told it must
+ */
+#ifdef __GNUC__
+#define __USED __attribute__((used))
+#else
+#define __USED
+#endif
+
+/*
* Alias ld.so entry point -- receives a bootstrap structure and a vector
* of strings. The vector is "well-known" to us, and consists of pointers
* to string constants. This aliasing bootstrap requires no relocation in
diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com
index fe6844273e..7f4a6e4e38 100644
--- a/usr/src/lib/libc/sparcv9/Makefile.com
+++ b/usr/src/lib/libc/sparcv9/Makefile.com
@@ -22,6 +22,7 @@
# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Use is subject to license terms.
diff --git a/usr/src/lib/libctf/common/mapfile-vers b/usr/src/lib/libctf/common/mapfile-vers
index 0873de319e..5573e8db25 100644
--- a/usr/src/lib/libctf/common/mapfile-vers
+++ b/usr/src/lib/libctf/common/mapfile-vers
@@ -23,6 +23,10 @@
#
#
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
+#
+
+#
# MAPFILE HEADER START
#
# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
@@ -62,6 +66,7 @@ SYMBOL_VERSION SUNWprivate_1.2 {
ctf_create;
ctf_delete_type;
ctf_discard;
+ ctf_dup;
ctf_enum_value;
ctf_label_info;
ctf_label_iter;
@@ -104,6 +109,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
ctf_type_kind;
ctf_type_lname;
ctf_type_name;
+ ctf_type_qname;
ctf_type_reference;
ctf_type_resolve;
ctf_type_size;
diff --git a/usr/src/lib/libdiskmgt/common/libdiskmgt.h b/usr/src/lib/libdiskmgt/common/libdiskmgt.h
index 7a2be0f0e5..2c42f6e8cc 100644
--- a/usr/src/lib/libdiskmgt/common/libdiskmgt.h
+++ b/usr/src/lib/libdiskmgt/common/libdiskmgt.h
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBDISKMGT_H
@@ -35,6 +36,144 @@ extern "C" {
/*
+ * Disk Management Library
+ *
+ * This library provides a common way to gather information about a system's
+ * disks, controllers, and related components.
+ *
+ *
+ * THREADS
+ * -------
+ *
+ * In general all of the functions are thread safe, however there are some
+ * specific considerations for getting events. The dm_get_event function may
+ * block the calling thread if no event is currently available. If another
+ * thread calls dm_get_event while a thread is already blocked in this function,
+ * the second thread will also block. When an event arrives and multiple
+ * threads are waiting for events, it is undefined which thread will be
+ * unblocked and receive the event. If a callback is used for handling events,
+ * this is equivalent to the dm_get_event function, so mixing callbacks and
+ * dm_get_event is also nondeterministic.
+ *
+ *
+ * ERRORS
+ * ------
+ *
+ * In general all of the functions take an errno pointer. This is an integer
+ * that will contain 0 if the function succeeded or contains an errno (see
+ * errno.h) if there was an error. If the function returns some data, that
+ * return data will generally be null if an error occured (see the API comment
+ * for the specific function for details). Many of the functions take a
+ * descriptor and provide more information for that descriptor. These functions
+ * may return an error if the object was removed between the call which obtained
+ * the descriptor and the call to get more information about the object (errno
+ * will be ENODEV). Only a few of the possible errno values will be returned;
+ * typically:
+ * EPERM not super-user
+ * ENOMEM not enough memory
+ * ENODEV no such device
+ * EINVAL invalid argument
+ * ENOENT no event queue has been created
+ *
+ * Many of the functions require the application to be running as root in order
+ * to get complete information. EPERM will be returned if the application is
+ * not running as root. However, not all of the functions have this requirement
+ * (i.e. event handling).
+ *
+ * It is possible for the system to run out of memory while receiving events.
+ * Since event receipt is asyncronous from the dm_get_event call there may not
+ * be a thread waiting when the event occurs and ENOMEM is detected. In this
+ * case the event will be lost. The first call to dm_get_event following this
+ * condition will immediately return ENOMEM, even if events are queued.
+ * Subsequent calls can return events. The dm_get_event call will clear the
+ * pending ENOMEM condition. There is no way to know how many events were lost
+ * when this situation occurs. If a thread is waiting when the event arrives
+ * and the ENOMEM condition occurs, the call will also return with ENOMEM.
+ * There is no way to determine if the system ran out of memory before the
+ * dm_get_event call or while the thread was blocked in the dm_get_event call
+ * since both conditions cause dm_get_event to return ENOMEM.
+ *
+ *
+ * MEMORY MANAGEMENT
+ * -----------------
+ *
+ * Most of the functions that return data are returning memory that has been
+ * allocated and must be freed by the application when no longer needed. The
+ * application should call the proper free function to free the memory. Most of
+ * the functions return either a nvlist or an array of descriptors. The normal
+ * nvlist function (nvlist_free; see libnvpair(3LIB)) can be used to free the
+ * simple nvlists. Other functions are provided to free the more complex data
+ * structures.
+ *
+ * The following list shows the functions that return allocated memory and the
+ * corresponding function to free the memory:
+ * dm_get_descriptors dm_free_descriptors
+ * dm_get_associated_descriptors dm_free_descriptors
+ * dm_get_descriptor_by_name dm_free_descriptor
+ * dm_get_name dm_free_name
+ * dm_get_attributes nvlist_free
+ * dm_get_stats nvlist_free
+ * dm_get_event nvlist_free
+ *
+ *
+ * EVENTS
+ * ------
+ *
+ * Event information is returned as a nvlist. It may be possible to return more
+ * information about events over time, especially information about what has
+ * changed. However, that may not always be the case, so by using an nvlist we
+ * have a very generic event indication. At a minimum the event will return the
+ * name of the device, the type of device (see dm_desc_type_t) and the type of
+ * event. The event type is a string which can currently be; add, remove,
+ * change.
+ *
+ * If a drive goes up or down this could be returned as event type "change".
+ * The application could get the drive information to see that the "status"
+ * attribute has changed value (ideally the event would include an attribute
+ * with the name of the changed attribute as the value). Although the API can
+ * return events for all drive related changes, events will not necessarily be
+ * delivered for all changes unless the system generates those events.
+ *
+ *
+ * Controller/HBAs
+ * ---------------
+ *
+ * In general the API means "the parent node of the drive in the device tree"
+ * where the word "controller" is used. This can actually be either the HBA or
+ * the drive controller depending on the type of the drive.
+ *
+ * Drives can be connected to their controller(s) in three different ways:
+ * single controller
+ * multiple controllers
+ * multiple controllers with mpxio
+ * These cases will lead to different information being available for the
+ * configuration. The two interesting cases are multi-path with and without
+ * mpxio. With mpxio the drive will have a unique name and a single controller
+ * (scsi_vhci). The physical controllers, the paths to the drive, can be
+ * obtained by calling dm_get_associated_descriptors with a drive descriptor and
+ * a type of DM_PATH. This will only return these physical paths when MPXIO, or
+ * possibly some future similar feature, is controlling the drive.
+ *
+ * Without mpxio the drive does not have a unique public name (in all cases the
+ * alias(es) of the drive can be determined by calling
+ * dm_get_associated_descriptors to get the DM_ALIAS descriptors. There will be
+ * more than one controller returned from dm_get_associated_descriptors when
+ * called with a type of DM_CONTROLLER. The controllers for each of the aliases
+ * will be returned in the same order as the aliases descriptors. For example,
+ * a drive with two paths has the aliases c5t3d2 and c7t1d0. There will be two
+ * controllers returned; the first corresponds to c5 and the second corresponds
+ * to c7.
+ *
+ * In the multi-path, non-mpxio case the drive has more than one alias.
+ * Although most of the drive attributes are represented on the drive (see
+ * dm_get_attributes) there can be some different attributes for the different
+ * aliases for the drive. Use dm_get_associated_descriptors to get the DM_ALIAS
+ * descriptors which can then be used to obtain these attributes. Use of this
+ * algorithm is not restricted to the multi-path, non-mpxio case. For example,
+ * it can be used to get the target/lun for a SCSI drive with a single path.
+ */
+
+/*
* Holds all the data regarding the device.
* Private to libdiskmgt. Must use dm_xxx functions to set/get data.
*/
@@ -50,6 +189,17 @@ typedef enum {
DM_WHO_ZPOOL_SPARE
} dm_who_type_t;
+/*
+ * The API uses a "descriptor" to identify the managed objects such as drives,
+ * controllers, media, slices, partitions, paths and buses. The descriptors are
+ * opaque and are only returned or used as parameters to the other functions in
+ * the API. The descriptor definition is a typedef to dm_descriptor_t.
+ *
+ * Applications call either the dm_get_descriptors or
+ * dm_get_associated_descriptors function to obtain a list of descriptors of a
+ * specific type. The application specifies the desired type from the following
+ * enumeration:
+ */
typedef enum {
DM_DRIVE = 0,
DM_CONTROLLER,
@@ -61,6 +211,31 @@ typedef enum {
DM_BUS
} dm_desc_type_t;
+/*
+ * These descriptors are associated with each other in the following way:
+ *
+ * alias partition
+ * _ \ / |
+ * / \ \ / |
+ * \ / \ / |
+ * bus --- controller --- drive --- media |
+ * | / \ |
+ * | / \ |
+ * | / \ |
+ * path slice
+ *
+ * The dm_get_associated_descriptors function can be used get the descriptors
+ * associated with a given descriptor. The dm_get_associated_types function can
+ * be used to find the types that can be associated with a given type.
+ *
+ * The attributes and values for these objects are described using a list of
+ * name/value pairs (see libnvpair(3LIB) and the specific comments for each
+ * function in the API section of this document).
+ *
+ * Drives and media have a type which are defined as the following enumerations.
+ * There could be additional types added to these enumerations as new drive and
+ * media types are supported by the system.
+ */
typedef enum {
DM_DT_UNKNOWN = 0,
@@ -102,6 +277,11 @@ typedef enum {
#define DM_FILTER_END -1
+/*
+ * The dm_get_stats function takes a stat_type argument for the specific sample
+ * to get for the descriptor. The following enums specify the drive and slice
+ * stat types.
+ */
/* drive stat name */
typedef enum {
DM_DRV_STAT_PERFORMANCE = 0,
diff --git a/usr/src/lib/libdladm/common/libdladm.h b/usr/src/lib/libdladm/common/libdladm.h
index f0811ae5df..1cfb927a41 100644
--- a/usr/src/lib/libdladm/common/libdladm.h
+++ b/usr/src/lib/libdladm/common/libdladm.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBDLADM_H
@@ -71,6 +72,10 @@ extern "C" {
* - DLADM_OPT_BOOT:
* Bypass check functions during boot (used by pool property since pools
* can come up after link properties are set)
+ *
+ * - DLADM_OPT_TRANSIENT:
+ * Indicates that the link assigned to a zone is transient and will be
+ * removed when the zone shuts down.
*/
#define DLADM_OPT_ACTIVE 0x00000001
#define DLADM_OPT_PERSIST 0x00000002
@@ -81,6 +86,7 @@ extern "C" {
#define DLADM_OPT_VLAN 0x00000040
#define DLADM_OPT_NOREFRESH 0x00000080
#define DLADM_OPT_BOOT 0x00000100
+#define DLADM_OPT_TRANSIENT 0x00000200
#define DLADM_WALK_TERMINATE 0
#define DLADM_WALK_CONTINUE -1
diff --git a/usr/src/lib/libdladm/common/libdllink.c b/usr/src/lib/libdladm/common/libdllink.c
index 8a3c5759ee..303885e929 100644
--- a/usr/src/lib/libdladm/common/libdllink.c
+++ b/usr/src/lib/libdladm/common/libdllink.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -386,10 +387,14 @@ dladm_linkduplex2str(link_duplex_t duplex, char *buf)
/*
* Case 1: rename an existing link1 to a link2 that does not exist.
* Result: <linkid1, link2>
+ * The zonename parameter is used to allow us to create a VNIC in the global
+ * zone which is assigned to a non-global zone. Since there is a race condition
+ * in the create process if two VNICs have the same name, we need to rename it
+ * after it has been assigned to the zone.
*/
static dladm_status_t
i_dladm_rename_link_c1(dladm_handle_t handle, datalink_id_t linkid1,
- const char *link1, const char *link2, uint32_t flags)
+ const char *link1, const char *link2, uint32_t flags, const char *zonename)
{
dld_ioc_rename_t dir;
dladm_status_t status = DLADM_STATUS_OK;
@@ -402,6 +407,10 @@ i_dladm_rename_link_c1(dladm_handle_t handle, datalink_id_t linkid1,
dir.dir_linkid1 = linkid1;
dir.dir_linkid2 = DATALINK_INVALID_LINKID;
(void) strlcpy(dir.dir_link, link2, MAXLINKNAMELEN);
+ if (zonename != NULL)
+ dir.dir_zoneinit = B_TRUE;
+ else
+ dir.dir_zoneinit = B_FALSE;
if (ioctl(dladm_dld_fd(handle), DLDIOC_RENAME, &dir) < 0) {
status = dladm_errno2status(errno);
@@ -412,6 +421,7 @@ i_dladm_rename_link_c1(dladm_handle_t handle, datalink_id_t linkid1,
status = dladm_remap_datalink_id(handle, linkid1, link2);
if (status != DLADM_STATUS_OK && (flags & DLADM_OPT_ACTIVE)) {
(void) strlcpy(dir.dir_link, link1, MAXLINKNAMELEN);
+ dir.dir_zoneinit = B_FALSE;
(void) ioctl(dladm_dld_fd(handle), DLDIOC_RENAME, &dir);
}
return (status);
@@ -508,6 +518,7 @@ i_dladm_rename_link_c2(dladm_handle_t handle, datalink_id_t linkid1,
*/
dir.dir_linkid1 = linkid1;
dir.dir_linkid2 = linkid2;
+ dir.dir_zoneinit = B_FALSE;
if (ioctl(dladm_dld_fd(handle), DLDIOC_RENAME, &dir) < 0)
status = dladm_errno2status(errno);
@@ -617,7 +628,8 @@ done:
}
dladm_status_t
-dladm_rename_link(dladm_handle_t handle, const char *link1, const char *link2)
+dladm_rename_link(dladm_handle_t handle, const char *zonename,
+ const char *link1, const char *link2)
{
datalink_id_t linkid1 = DATALINK_INVALID_LINKID;
datalink_id_t linkid2 = DATALINK_INVALID_LINKID;
@@ -627,11 +639,11 @@ dladm_rename_link(dladm_handle_t handle, const char *link1, const char *link2)
boolean_t remphy2 = B_FALSE;
dladm_status_t status;
- (void) dladm_name2info(handle, link1, &linkid1, &flags1, &class1,
- &media1);
- if ((dladm_name2info(handle, link2, &linkid2, &flags2, &class2,
- &media2) == DLADM_STATUS_OK) && (class2 == DATALINK_CLASS_PHYS) &&
- (flags2 == DLADM_OPT_PERSIST)) {
+ (void) dladm_zname2info(handle, zonename, link1, &linkid1, &flags1,
+ &class1, &media1);
+ if ((dladm_zname2info(handle, zonename, link2, &linkid2, &flags2,
+ &class2, &media2) == DLADM_STATUS_OK) &&
+ (class2 == DATALINK_CLASS_PHYS) && (flags2 == DLADM_OPT_PERSIST)) {
/*
* see whether link2 is a removed physical link.
*/
@@ -645,7 +657,7 @@ dladm_rename_link(dladm_handle_t handle, const char *link1, const char *link2)
* does not exist.
*/
status = i_dladm_rename_link_c1(handle, linkid1, link1,
- link2, flags1);
+ link2, flags1, zonename);
} else if (remphy2) {
/*
* case 2: rename an available link to a REMOVED
diff --git a/usr/src/lib/libdladm/common/libdllink.h b/usr/src/lib/libdladm/common/libdllink.h
index a2830b5e37..a858e78aa3 100644
--- a/usr/src/lib/libdladm/common/libdllink.h
+++ b/usr/src/lib/libdladm/common/libdllink.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#ifndef _LIBDLLINK_H
@@ -121,7 +122,7 @@ extern dladm_status_t dladm_info(dladm_handle_t, datalink_id_t,
dladm_attr_t *);
extern dladm_status_t dladm_rename_link(dladm_handle_t, const char *,
- const char *);
+ const char *, const char *);
extern dladm_status_t dladm_set_linkprop(dladm_handle_t, datalink_id_t,
const char *, char **, uint_t, uint_t);
@@ -170,6 +171,9 @@ extern dladm_status_t dladm_up_datalink_id(dladm_handle_t, datalink_id_t);
extern dladm_status_t dladm_name2info(dladm_handle_t, const char *,
datalink_id_t *, uint32_t *, datalink_class_t *,
uint32_t *);
+extern dladm_status_t dladm_zname2info(dladm_handle_t, const char *,
+ const char *, datalink_id_t *, uint32_t *,
+ datalink_class_t *, uint32_t *);
extern dladm_status_t dladm_datalink_id2info(dladm_handle_t, datalink_id_t,
uint32_t *, datalink_class_t *, uint32_t *, char *,
size_t);
diff --git a/usr/src/lib/libdladm/common/libdlmgmt.c b/usr/src/lib/libdladm/common/libdlmgmt.c
index 4b0753417c..c9c7906934 100644
--- a/usr/src/lib/libdladm/common/libdlmgmt.c
+++ b/usr/src/lib/libdladm/common/libdlmgmt.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <door.h>
@@ -528,12 +529,24 @@ dladm_getnext_conf_linkprop(dladm_handle_t handle, dladm_conf_t conf,
}
/*
- * Get the link ID that is associated with the given name.
+ * Get the link ID that is associated with the given name in the current zone.
*/
dladm_status_t
dladm_name2info(dladm_handle_t handle, const char *link, datalink_id_t *linkidp,
uint32_t *flagp, datalink_class_t *classp, uint32_t *mediap)
{
+ return (dladm_zname2info(handle, NULL, link, linkidp, flagp, classp,
+ mediap));
+}
+
+/*
+ * Get the link ID that is associated with the given zone/name pair.
+ */
+dladm_status_t
+dladm_zname2info(dladm_handle_t handle, const char *zonename, const char *link,
+ datalink_id_t *linkidp, uint32_t *flagp, datalink_class_t *classp,
+ uint32_t *mediap)
+{
dlmgmt_door_getlinkid_t getlinkid;
dlmgmt_getlinkid_retval_t retval;
datalink_id_t linkid;
@@ -542,6 +555,10 @@ dladm_name2info(dladm_handle_t handle, const char *link, datalink_id_t *linkidp,
getlinkid.ld_cmd = DLMGMT_CMD_GETLINKID;
(void) strlcpy(getlinkid.ld_link, link, MAXLINKNAMELEN);
+ if (zonename != NULL)
+ getlinkid.ld_zoneid = getzoneidbyname(zonename);
+ else
+ getlinkid.ld_zoneid = -1;
if ((status = dladm_door_call(handle, &getlinkid, sizeof (getlinkid),
&retval, &sz)) != DLADM_STATUS_OK) {
diff --git a/usr/src/lib/libdladm/common/libdlvnic.c b/usr/src/lib/libdladm/common/libdlvnic.c
index 6dba8d6fad..1a866dcb06 100644
--- a/usr/src/lib/libdladm/common/libdlvnic.c
+++ b/usr/src/lib/libdladm/common/libdlvnic.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <stdio.h>
@@ -537,27 +538,35 @@ dladm_vnic_create(dladm_handle_t handle, const char *vnic, datalink_id_t linkid,
vnic_created = B_TRUE;
/* Save vnic configuration and its properties */
- if (!(flags & DLADM_OPT_PERSIST))
- goto done;
+ if (flags & DLADM_OPT_PERSIST) {
+ status = dladm_vnic_persist_conf(handle, name, &attr, class);
+ if (status == DLADM_STATUS_OK)
+ conf_set = B_TRUE;
+ }
- status = dladm_vnic_persist_conf(handle, name, &attr, class);
- if (status != DLADM_STATUS_OK)
- goto done;
- conf_set = B_TRUE;
+done:
+ if (status == DLADM_STATUS_OK && proplist != NULL) {
+ uint32_t flg;
+
+ flg = (flags & DLADM_OPT_PERSIST) ?
+ DLADM_OPT_PERSIST : DLADM_OPT_ACTIVE;
- if (proplist != NULL) {
for (i = 0; i < proplist->al_count; i++) {
dladm_arg_info_t *aip = &proplist->al_info[i];
+ if (strcmp(aip->ai_name, "zone") == 0 &&
+ flags & DLADM_OPT_TRANSIENT)
+ flg |= DLADM_OPT_TRANSIENT;
+ else
+ flg &= ~DLADM_OPT_TRANSIENT;
+
status = dladm_set_linkprop(handle, vnic_id,
- aip->ai_name, aip->ai_val, aip->ai_count,
- DLADM_OPT_PERSIST);
+ aip->ai_name, aip->ai_val, aip->ai_count, flg);
if (status != DLADM_STATUS_OK)
break;
}
}
-done:
if (status != DLADM_STATUS_OK) {
if (conf_set)
(void) dladm_remove_conf(handle, vnic_id);
diff --git a/usr/src/lib/libdladm/common/linkprop.c b/usr/src/lib/libdladm/common/linkprop.c
index 229a5fd83f..b89860e1c1 100644
--- a/usr/src/lib/libdladm/common/linkprop.c
+++ b/usr/src/lib/libdladm/common/linkprop.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <stdlib.h>
@@ -65,6 +66,7 @@
#include <net/if_types.h>
#include <libinetutil.h>
#include <pool.h>
+#include <libdlaggr.h>
/*
* The linkprop get() callback.
@@ -149,18 +151,20 @@ static pd_getf_t get_zone, get_autopush, get_rate_mod, get_rate,
get_flowctl, get_maxbw, get_cpus, get_priority,
get_tagmode, get_range, get_stp, get_bridge_forward,
get_bridge_pvid, get_protection, get_rxrings,
- get_txrings, get_cntavail,
+ get_txrings, get_cntavail, get_secondary_macs,
get_allowedips, get_allowedcids, get_pool,
- get_rings_range, get_linkmode_prop;
+ get_rings_range, get_linkmode_prop,
+ get_promisc_filtered;
static pd_setf_t set_zone, set_rate, set_powermode, set_radio,
set_public_prop, set_resource, set_stp_prop,
- set_bridge_forward, set_bridge_pvid;
+ set_bridge_forward, set_bridge_pvid, set_secondary_macs,
+ set_promisc_filtered;
static pd_checkf_t check_zone, check_autopush, check_rate, check_hoplimit,
check_encaplim, check_uint32, check_maxbw, check_cpus,
check_stp_prop, check_bridge_pvid, check_allowedips,
- check_allowedcids, check_rings,
+ check_allowedcids, check_secondary_macs, check_rings,
check_pool, check_prop;
struct prop_desc {
@@ -363,6 +367,11 @@ static link_attr_t link_attr[] = {
{ MAC_PROP_IB_LINKMODE, sizeof (uint32_t), "linkmode"},
+ { MAC_PROP_VN_PROMISC_FILTERED, sizeof (boolean_t), "promisc-filtered"},
+
+ { MAC_PROP_SECONDARY_ADDRS, sizeof (mac_secondary_addr_t),
+ "secondary-macs"},
+
{ MAC_PROP_PRIVATE, 0, "driver-private"}
};
@@ -417,6 +426,11 @@ static val_desc_t link_protect_vals[] = {
{ "dhcp-nospoof", MPT_DHCPNOSPOOF },
};
+static val_desc_t link_promisc_filtered_vals[] = {
+ { "off", B_FALSE },
+ { "on", B_TRUE },
+};
+
static val_desc_t dladm_wlan_radio_vals[] = {
{ "on", DLADM_WLAN_RADIO_ON },
{ "off", DLADM_WLAN_RADIO_OFF }
@@ -443,6 +457,12 @@ static val_desc_t dladm_part_linkmode_vals[] = {
#define RESET_VAL ((uintptr_t)-1)
#define UNSPEC_VAL ((uintptr_t)-2)
+/*
+ * For the default, if defaults are not defined for the property,
+ * pd_defval.vd_name should be null. If the driver has to be contacted for the
+ * value, vd_name should be the empty string (""). Otherwise, dladm will
+ * just print whatever is in the table.
+ */
static prop_desc_t prop_table[] = {
{ "channel", { NULL, 0 },
NULL, 0, NULL, NULL,
@@ -506,6 +526,11 @@ static prop_desc_t prop_table[] = {
set_public_prop, NULL, get_flowctl, NULL,
0, DATALINK_CLASS_PHYS, DL_ETHER },
+ { "secondary-macs", { "--", 0 }, NULL, 0,
+ set_secondary_macs, NULL,
+ get_secondary_macs, check_secondary_macs, PD_CHECK_ALLOC,
+ DATALINK_CLASS_VNIC, DL_ETHER },
+
{ "adv_10gfdx_cap", { "", 0 },
link_01_vals, VALCNT(link_01_vals),
NULL, NULL, get_binary, NULL,
@@ -682,6 +707,12 @@ static prop_desc_t prop_table[] = {
set_resource, NULL, get_protection, check_prop, 0,
DATALINK_CLASS_ALL, DATALINK_ANY_MEDIATYPE },
+ { "promisc-filtered", { "on", 1 },
+ link_promisc_filtered_vals, VALCNT(link_promisc_filtered_vals),
+ set_promisc_filtered, NULL, get_promisc_filtered, check_prop, 0,
+ DATALINK_CLASS_VNIC, DATALINK_ANY_MEDIATYPE },
+
+
{ "allowed-ips", { "--", 0 },
NULL, 0, set_resource, NULL,
get_allowedips, check_allowedips, PD_CHECK_ALLOC,
@@ -1513,6 +1544,9 @@ set_zone(dladm_handle_t handle, prop_desc_t *pdp, datalink_id_t linkid,
if (zid_new == zid_old)
return (DLADM_STATUS_OK);
+ if (flags & DLADM_OPT_TRANSIENT)
+ dzp->diz_transient = B_TRUE;
+
if ((status = set_public_prop(handle, pdp, linkid, vdp, val_cnt,
flags, media)) != DLADM_STATUS_OK)
return (status);
@@ -2314,6 +2348,33 @@ get_protection(dladm_handle_t handle, prop_desc_t *pdp,
return (DLADM_STATUS_OK);
}
+static uint32_t
+nbits_to_mask(int nbits)
+{
+ int i;
+ uint_t mask = 0;
+
+ for (i = 0; i < nbits; i++) {
+ mask >>= 1;
+ mask |= 0x80000000;
+ }
+
+ return (mask);
+}
+
+static uint32_t
+mask_to_nbits(uint32_t mask)
+{
+ uint_t nbits = 0;
+
+ while (mask != 0) {
+ nbits++;
+ mask <<= 1;
+ }
+
+ return (nbits);
+}
+
/* ARGSUSED */
static dladm_status_t
get_allowedips(dladm_handle_t handle, prop_desc_t *pdp,
@@ -2341,9 +2402,16 @@ get_allowedips(dladm_handle_t handle, prop_desc_t *pdp,
for (i = 0; i < p->mp_ipaddrcnt; i++) {
if (p->mp_ipaddrs[i].ip_version == IPV4_VERSION) {
ipaddr_t v4addr;
+ uint32_t mask;
v4addr = V4_PART_OF_V6(p->mp_ipaddrs[i].ip_addr);
+ mask = p->mp_ipaddrs[i].ip_v4netmask;
(void) dladm_ipv4addr2str(&v4addr, prop_val[i]);
+ if (mask != 0) {
+ int len = strlen(prop_val[i]);
+ (void) sprintf(prop_val[i] + len, "/%d",
+ mask_to_nbits(mask));
+ }
} else {
(void) dladm_ipv6addr2str(&p->mp_ipaddrs[i].ip_addr,
prop_val[i]);
@@ -2395,6 +2463,28 @@ check_single_ip(char *buf, mac_ipaddr_t *addr)
ipaddr_t v4addr;
in6_addr_t v6addr;
boolean_t isv4 = B_TRUE;
+ char *p;
+ uint32_t mask;
+
+ /*
+ * If the IP address is in CIDR format, parse the bits component
+ * seperately. An address in this style will be used to indicate an
+ * entire subnet, so it must be a network number with no host address.
+ */
+ if ((p = strchr(buf, '/')) != NULL) {
+ char *end = NULL;
+ long msk;
+
+ *p++ = '\0';
+ if (!isdigit(*p))
+ return (DLADM_STATUS_INVALID_IP);
+ msk = strtol(p, &end, 10);
+ if (end != NULL && *end != '\0')
+ return (DLADM_STATUS_INVALID_IP);
+ if (msk > 32 || msk < 1)
+ return (DLADM_STATUS_INVALID_IP);
+ mask = nbits_to_mask((int)msk);
+ }
status = dladm_str2ipv4addr(buf, &v4addr);
if (status == DLADM_STATUS_INVALID_IP) {
@@ -2411,10 +2501,22 @@ check_single_ip(char *buf, mac_ipaddr_t *addr)
IN6_IPADDR_TO_V4MAPPED(v4addr, &addr->ip_addr);
addr->ip_version = IPV4_VERSION;
+ if (p != NULL) {
+ /*
+ * We have a CIDR style address, confirm that only the
+ * network number is set.
+ */
+ if (htonl(v4addr) & ~mask)
+ return (DLADM_STATUS_INVALID_IP);
+ addr->ip_v4netmask = mask;
+ }
} else {
if (IN6_IS_ADDR_UNSPECIFIED(&v6addr))
return (DLADM_STATUS_INVALID_IP);
+ if (p != NULL)
+ return (DLADM_STATUS_INVALID_IP);
+
addr->ip_addr = v6addr;
addr->ip_version = IPV6_VERSION;
}
@@ -2797,6 +2899,106 @@ fail:
/* ARGSUSED */
static dladm_status_t
+get_secondary_macs(dladm_handle_t handle, prop_desc_t *pdp,
+ datalink_id_t linkid, char **prop_val, uint_t *val_cnt,
+ datalink_media_t media, uint_t flags, uint_t *perm_flags)
+{
+ mac_secondary_addr_t sa;
+ dladm_status_t status;
+ int i;
+
+ status = i_dladm_get_public_prop(handle, linkid, pdp->pd_name, flags,
+ perm_flags, &sa, sizeof (sa));
+ if (status != DLADM_STATUS_OK)
+ return (status);
+
+ if (sa.ms_addrcnt == 0) {
+ *val_cnt = 0;
+ return (DLADM_STATUS_OK);
+ }
+ if (sa.ms_addrcnt > *val_cnt)
+ return (DLADM_STATUS_BADVALCNT);
+
+ for (i = 0; i < sa.ms_addrcnt; i++) {
+ (void) dladm_aggr_macaddr2str(
+ (const unsigned char *)&sa.ms_addrs[i], prop_val[i]);
+ }
+ *val_cnt = sa.ms_addrcnt;
+ return (DLADM_STATUS_OK);
+}
+
+/* ARGSUSED */
+static dladm_status_t
+check_secondary_macs(dladm_handle_t handle, prop_desc_t *pdp,
+ datalink_id_t linkid, char **prop_val, uint_t *val_cntp, uint_t flags,
+ val_desc_t **vdpp, datalink_media_t media)
+{
+ dladm_status_t status;
+ uchar_t *addr;
+ uint_t len = 0;
+ int i;
+ uint_t val_cnt = *val_cntp;
+ val_desc_t *vdp = *vdpp;
+
+ if (val_cnt >= MPT_MAXMACADDR)
+ return (DLADM_STATUS_BADVALCNT);
+
+ for (i = 0; i < val_cnt; i++) {
+ addr = _link_aton(prop_val[i], (int *)&len);
+ if (addr == NULL) {
+ if (len == (uint_t)-1)
+ status = DLADM_STATUS_MACADDRINVAL;
+ else
+ status = DLADM_STATUS_NOMEM;
+ goto fail;
+ }
+
+ vdp[i].vd_val = (uintptr_t)addr;
+ }
+ return (DLADM_STATUS_OK);
+
+fail:
+ for (i = 0; i < val_cnt; i++) {
+ free((void *)vdp[i].vd_val);
+ vdp[i].vd_val = NULL;
+ }
+ return (status);
+}
+
+/* ARGSUSED */
+static dladm_status_t
+set_secondary_macs(dladm_handle_t handle, prop_desc_t *pd, datalink_id_t linkid,
+ val_desc_t *vdp, uint_t val_cnt, uint_t flags, datalink_media_t media)
+{
+ dladm_status_t status;
+ dld_ioc_macprop_t *dip;
+ int i;
+ mac_secondary_addr_t msa;
+
+ dip = i_dladm_buf_alloc_by_name(0, linkid, "secondary-macs", 0,
+ &status);
+ if (dip == NULL)
+ return (status);
+
+ if (vdp->vd_val == 0) {
+ val_cnt = (uint_t)-1;
+ } else {
+ for (i = 0; i < val_cnt; i++) {
+ bcopy((void *)vdp[i].vd_val, msa.ms_addrs[i],
+ MAXMACADDRLEN);
+ }
+ }
+ msa.ms_addrcnt = val_cnt;
+ (void) memcpy(dip->pr_val, &msa, dip->pr_valsize);
+
+ status = i_dladm_macprop(handle, dip, B_TRUE);
+
+ free(dip);
+ return (status);
+}
+
+/* ARGSUSED */
+static dladm_status_t
get_autopush(dladm_handle_t handle, prop_desc_t *pdp, datalink_id_t linkid,
char **prop_val, uint_t *val_cnt, datalink_media_t media,
uint_t flags, uint_t *perm_flags)
@@ -4531,11 +4733,13 @@ dladm_linkprop_is_set(dladm_handle_t handle, datalink_id_t linkid,
/*
* valcnt is always set to 1 by get_pool(), hence we need to check
- * for a non-null string to see if it is set. For protection and
- * allowed-ips, we can check either the *propval or the valcnt.
+ * for a non-null string to see if it is set. For protection,
+ * secondary-macs and allowed-ips, we can check either the *propval
+ * or the valcnt.
*/
if ((strcmp(prop_name, "pool") == 0 ||
strcmp(prop_name, "protection") == 0 ||
+ strcmp(prop_name, "secondary-macs") == 0 ||
strcmp(prop_name, "allowed-ips") == 0) &&
(strlen(*propvals) != 0)) {
*is_set = B_TRUE;
@@ -4583,3 +4787,50 @@ get_linkmode_prop(dladm_handle_t handle, prop_desc_t *pdp,
*val_cnt = 1;
return (DLADM_STATUS_OK);
}
+
+/*ARGSUSED*/
+static dladm_status_t
+get_promisc_filtered(dladm_handle_t handle, prop_desc_t *pdp,
+ datalink_id_t linkid, char **prop_val, uint_t *val_cnt,
+ datalink_media_t media, uint_t flags, uint_t *perm_flags)
+{
+ char *s;
+ dladm_status_t status;
+ boolean_t filt;
+
+ status = i_dladm_get_public_prop(handle, linkid, pdp->pd_name, flags,
+ perm_flags, &filt, sizeof (filt));
+ if (status != DLADM_STATUS_OK)
+ return (status);
+
+ if (filt != 0)
+ s = link_promisc_filtered_vals[1].vd_name;
+ else
+ s = link_promisc_filtered_vals[0].vd_name;
+ (void) snprintf(prop_val[0], DLADM_STRSIZE, "%s", s);
+
+ *val_cnt = 1;
+ return (DLADM_STATUS_OK);
+}
+
+/* ARGSUSED */
+static dladm_status_t
+set_promisc_filtered(dladm_handle_t handle, prop_desc_t *pdp,
+ datalink_id_t linkid, val_desc_t *vdp, uint_t val_cnt, uint_t flags,
+ datalink_media_t media)
+{
+ dld_ioc_macprop_t *dip;
+ dladm_status_t status = DLADM_STATUS_OK;
+
+ dip = i_dladm_buf_alloc_by_name(0, linkid, pdp->pd_name,
+ 0, &status);
+
+ if (dip == NULL)
+ return (status);
+
+ (void) memcpy(dip->pr_val, &vdp->vd_val, dip->pr_valsize);
+ status = i_dladm_macprop(handle, dip, B_TRUE);
+
+ free(dip);
+ return (status);
+}
diff --git a/usr/src/lib/libdladm/common/mapfile-vers b/usr/src/lib/libdladm/common/mapfile-vers
index b781c93aff..3eaeea656e 100644
--- a/usr/src/lib/libdladm/common/mapfile-vers
+++ b/usr/src/lib/libdladm/common/mapfile-vers
@@ -20,6 +20,7 @@
#
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Joyent Inc. All rights reserved.
#
#
@@ -134,6 +135,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
dladm_remap_datalink_id;
dladm_up_datalink_id;
dladm_name2info;
+ dladm_zname2info;
dladm_datalink_id2info;
dladm_walk_datalink_id;
dladm_create_conf;
diff --git a/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java b/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java
index 366d83476b..6983e279fa 100644
--- a/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java
+++ b/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java
@@ -5,9 +5,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,9 +25,6 @@ Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
Revision 1.1 2006/06/20 23:00:12 rpantos
<rdar://problem/3839132> Java needs to implement DNSServiceRegisterRecord equivalent
-
-ident "%Z%%M% %I% %E% SMI"
-
*/
@@ -38,7 +35,7 @@ package com.apple.dnssd;
public interface DNSSDRecordRegistrar extends DNSSDService
{
- /** Register an independent {@link DNSRecord}.<P>
+ /** Register an independent {@link DNSRecord}.<P>
@param flags
Possible values are SHARED or UNIQUE (see flag type definitions for details).
<P>
@@ -55,25 +52,22 @@ public interface DNSSDRecordRegistrar extends DNSSDService
as defined in nameser.h.
<P>
@param rrclass
- The class of the resource record, as defined in nameser.h
+ The class of the resource record, as defined in nameser.h
(usually 1 for the Internet class).
<P>
- @param rData
+ @param rdata
The new rdata as it is to appear in the DNS record.
<P>
@param ttl
The time to live of the resource record, in seconds. Pass 0 to use a default value.
<P>
- @param listener
- This object will get called when the service is registered.
- <P>
@return A {@link DNSSDService} that can be used to abort the record registration.
@throws SecurityException If a security manager is present and denies <tt>RuntimePermission("getDNSSDInstance")</tt>.
@see RuntimePermission
*/
- public DNSRecord registerRecord( int flags, int ifIndex, String fullname, int rrtype,
+ public DNSRecord registerRecord( int flags, int ifIndex, String fullname, int rrtype,
int rrclass, byte[] rdata, int ttl)
throws DNSSDException;
-}
+}
diff --git a/usr/src/lib/libdtrace/Makefile.com b/usr/src/lib/libdtrace/Makefile.com
index 071e9f22b8..f10edcf878 100644
--- a/usr/src/lib/libdtrace/Makefile.com
+++ b/usr/src/lib/libdtrace/Makefile.com
@@ -132,7 +132,7 @@ CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-switch
YYCFLAGS =
-LDLIBS += -lgen -lproc -lrtld_db -lnsl -lsocket -lctf -lelf -lc
+LDLIBS += -lgen -lproc -lrtld_db -lnsl -lsocket -lctf -lelf -lc -lzonecfg
DRTILDLIBS = $(LDLIBS.lib) -lc
yydebug := YYCFLAGS += -DYYDEBUG
diff --git a/usr/src/lib/libdtrace/common/dt_aggregate.c b/usr/src/lib/libdtrace/common/dt_aggregate.c
index 1d78f086db..64ea79fbcc 100644
--- a/usr/src/lib/libdtrace/common/dt_aggregate.c
+++ b/usr/src/lib/libdtrace/common/dt_aggregate.c
@@ -25,7 +25,7 @@
*/
/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -1291,6 +1291,231 @@ dtrace_aggregate_walk(dtrace_hdl_t *dtp, dtrace_aggregate_f *func, void *arg)
}
static int
+dt_aggregate_total(dtrace_hdl_t *dtp, boolean_t clear)
+{
+ dt_ahashent_t *h;
+ dtrace_aggdata_t **total;
+ dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id;
+ dt_aggregate_t *agp = &dtp->dt_aggregate;
+ dt_ahash_t *hash = &agp->dtat_hash;
+ uint32_t tflags;
+
+ tflags = DTRACE_A_TOTAL | DTRACE_A_HASNEGATIVES | DTRACE_A_HASPOSITIVES;
+
+ /*
+ * If we need to deliver per-aggregation totals, we're going to take
+ * three passes over the aggregate: one to clear everything out and
+ * determine our maximum aggregation ID, one to actually total
+ * everything up, and a final pass to assign the totals to the
+ * individual elements.
+ */
+ for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+ dtrace_aggdata_t *aggdata = &h->dtahe_data;
+
+ if ((id = dt_aggregate_aggvarid(h)) > max)
+ max = id;
+
+ aggdata->dtada_total = 0;
+ aggdata->dtada_flags &= ~tflags;
+ }
+
+ if (clear || max == DTRACE_AGGVARIDNONE)
+ return (0);
+
+ total = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *));
+
+ if (total == NULL)
+ return (-1);
+
+ for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+ dtrace_aggdata_t *aggdata = &h->dtahe_data;
+ dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+ dtrace_recdesc_t *rec;
+ caddr_t data;
+ int64_t val, *addr;
+
+ rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1];
+ data = aggdata->dtada_data;
+ addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset);
+
+ switch (rec->dtrd_action) {
+ case DTRACEAGG_STDDEV:
+ val = dt_stddev((uint64_t *)addr, 1);
+ break;
+
+ case DTRACEAGG_SUM:
+ case DTRACEAGG_COUNT:
+ val = *addr;
+ break;
+
+ case DTRACEAGG_AVG:
+ val = addr[0] ? (addr[1] / addr[0]) : 0;
+ break;
+
+ default:
+ continue;
+ }
+
+ if (total[agg->dtagd_varid] == NULL) {
+ total[agg->dtagd_varid] = aggdata;
+ aggdata->dtada_flags |= DTRACE_A_TOTAL;
+ } else {
+ aggdata = total[agg->dtagd_varid];
+ }
+
+ if (val > 0)
+ aggdata->dtada_flags |= DTRACE_A_HASPOSITIVES;
+
+ if (val < 0) {
+ aggdata->dtada_flags |= DTRACE_A_HASNEGATIVES;
+ val = -val;
+ }
+
+ if (dtp->dt_options[DTRACEOPT_AGGZOOM] != DTRACEOPT_UNSET) {
+ val = (int64_t)((long double)val *
+ (1 / DTRACE_AGGZOOM_MAX));
+
+ if (val > aggdata->dtada_total)
+ aggdata->dtada_total = val;
+ } else {
+ aggdata->dtada_total += val;
+ }
+ }
+
+ /*
+ * And now one final pass to set everyone's total.
+ */
+ for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+ dtrace_aggdata_t *aggdata = &h->dtahe_data, *t;
+ dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+
+ if ((t = total[agg->dtagd_varid]) == NULL || aggdata == t)
+ continue;
+
+ aggdata->dtada_total = t->dtada_total;
+ aggdata->dtada_flags |= (t->dtada_flags & tflags);
+ }
+
+ dt_free(dtp, total);
+
+ return (0);
+}
+
+static int
+dt_aggregate_minmaxbin(dtrace_hdl_t *dtp, boolean_t clear)
+{
+ dt_ahashent_t *h;
+ dtrace_aggdata_t **minmax;
+ dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id;
+ dt_aggregate_t *agp = &dtp->dt_aggregate;
+ dt_ahash_t *hash = &agp->dtat_hash;
+
+ for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+ dtrace_aggdata_t *aggdata = &h->dtahe_data;
+
+ if ((id = dt_aggregate_aggvarid(h)) > max)
+ max = id;
+
+ aggdata->dtada_minbin = 0;
+ aggdata->dtada_maxbin = 0;
+ aggdata->dtada_flags &= ~DTRACE_A_MINMAXBIN;
+ }
+
+ if (clear || max == DTRACE_AGGVARIDNONE)
+ return (0);
+
+ minmax = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *));
+
+ if (minmax == NULL)
+ return (-1);
+
+ for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+ dtrace_aggdata_t *aggdata = &h->dtahe_data;
+ dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+ dtrace_recdesc_t *rec;
+ caddr_t data;
+ int64_t *addr;
+ int minbin = -1, maxbin = -1, i;
+ int start = 0, size;
+
+ rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1];
+ size = rec->dtrd_size / sizeof (int64_t);
+ data = aggdata->dtada_data;
+ addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset);
+
+ switch (rec->dtrd_action) {
+ case DTRACEAGG_LQUANTIZE:
+ /*
+ * For lquantize(), we always display the entire range
+ * of the aggregation when aggpack is set.
+ */
+ start = 1;
+ minbin = start;
+ maxbin = size - 1 - start;
+ break;
+
+ case DTRACEAGG_QUANTIZE:
+ for (i = start; i < size; i++) {
+ if (!addr[i])
+ continue;
+
+ if (minbin == -1)
+ minbin = i - start;
+
+ maxbin = i - start;
+ }
+
+ if (minbin == -1) {
+ /*
+ * If we have no data (e.g., due to a clear()
+ * or negative increments), we'll use the
+ * zero bucket as both our min and max.
+ */
+ minbin = maxbin = DTRACE_QUANTIZE_ZEROBUCKET;
+ }
+
+ break;
+
+ default:
+ continue;
+ }
+
+ if (minmax[agg->dtagd_varid] == NULL) {
+ minmax[agg->dtagd_varid] = aggdata;
+ aggdata->dtada_flags |= DTRACE_A_MINMAXBIN;
+ aggdata->dtada_minbin = minbin;
+ aggdata->dtada_maxbin = maxbin;
+ continue;
+ }
+
+ if (minbin < minmax[agg->dtagd_varid]->dtada_minbin)
+ minmax[agg->dtagd_varid]->dtada_minbin = minbin;
+
+ if (maxbin > minmax[agg->dtagd_varid]->dtada_maxbin)
+ minmax[agg->dtagd_varid]->dtada_maxbin = maxbin;
+ }
+
+ /*
+ * And now one final pass to set everyone's minbin and maxbin.
+ */
+ for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+ dtrace_aggdata_t *aggdata = &h->dtahe_data, *mm;
+ dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+
+ if ((mm = minmax[agg->dtagd_varid]) == NULL || aggdata == mm)
+ continue;
+
+ aggdata->dtada_minbin = mm->dtada_minbin;
+ aggdata->dtada_maxbin = mm->dtada_maxbin;
+ aggdata->dtada_flags |= DTRACE_A_MINMAXBIN;
+ }
+
+ dt_free(dtp, minmax);
+
+ return (0);
+}
+
+static int
dt_aggregate_walk_sorted(dtrace_hdl_t *dtp,
dtrace_aggregate_f *func, void *arg,
int (*sfunc)(const void *, const void *))
@@ -1299,6 +1524,23 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp,
dt_ahashent_t *h, **sorted;
dt_ahash_t *hash = &agp->dtat_hash;
size_t i, nentries = 0;
+ int rval = -1;
+
+ agp->dtat_flags &= ~(DTRACE_A_TOTAL | DTRACE_A_MINMAXBIN);
+
+ if (dtp->dt_options[DTRACEOPT_AGGHIST] != DTRACEOPT_UNSET) {
+ agp->dtat_flags |= DTRACE_A_TOTAL;
+
+ if (dt_aggregate_total(dtp, B_FALSE) != 0)
+ return (-1);
+ }
+
+ if (dtp->dt_options[DTRACEOPT_AGGPACK] != DTRACEOPT_UNSET) {
+ agp->dtat_flags |= DTRACE_A_MINMAXBIN;
+
+ if (dt_aggregate_minmaxbin(dtp, B_FALSE) != 0)
+ return (-1);
+ }
for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall)
nentries++;
@@ -1306,7 +1548,7 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp,
sorted = dt_alloc(dtp, nentries * sizeof (dt_ahashent_t *));
if (sorted == NULL)
- return (-1);
+ goto out;
for (h = hash->dtah_all, i = 0; h != NULL; h = h->dtahe_nextall)
sorted[i++] = h;
@@ -1330,14 +1572,20 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *dtp,
for (i = 0; i < nentries; i++) {
h = sorted[i];
- if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1) {
- dt_free(dtp, sorted);
- return (-1);
- }
+ if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1)
+ goto out;
}
+ rval = 0;
+out:
+ if (agp->dtat_flags & DTRACE_A_TOTAL)
+ (void) dt_aggregate_total(dtp, B_TRUE);
+
+ if (agp->dtat_flags & DTRACE_A_MINMAXBIN)
+ (void) dt_aggregate_minmaxbin(dtp, B_TRUE);
+
dt_free(dtp, sorted);
- return (0);
+ return (rval);
}
int
@@ -1860,6 +2108,8 @@ dtrace_aggregate_print(dtrace_hdl_t *dtp, FILE *fp,
{
dt_print_aggdata_t pd;
+ bzero(&pd, sizeof (pd));
+
pd.dtpa_dtp = dtp;
pd.dtpa_fp = fp;
pd.dtpa_allunprint = 1;
diff --git a/usr/src/lib/libdtrace/common/dt_as.c b/usr/src/lib/libdtrace/common/dt_as.c
index 457b8fd721..f937261c35 100644
--- a/usr/src/lib/libdtrace/common/dt_as.c
+++ b/usr/src/lib/libdtrace/common/dt_as.c
@@ -23,8 +23,10 @@
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
#include <sys/types.h>
#include <strings.h>
@@ -125,7 +127,7 @@ dt_copyvar(dt_idhash_t *dhp, dt_ident_t *idp, void *data)
dvp->dtdv_flags |= DIFV_F_MOD;
bzero(&dn, sizeof (dn));
- dt_node_type_assign(&dn, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(&dn, idp->di_ctfp, idp->di_type, B_FALSE);
dt_node_diftype(pcb->pcb_hdl, &dn, &dvp->dtdv_type);
idp->di_flags &= ~(DT_IDFLG_DIFR | DT_IDFLG_DIFW);
diff --git a/usr/src/lib/libdtrace/common/dt_cc.c b/usr/src/lib/libdtrace/common/dt_cc.c
index f4b0509b4a..5d38704ffe 100644
--- a/usr/src/lib/libdtrace/common/dt_cc.c
+++ b/usr/src/lib/libdtrace/common/dt_cc.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -662,6 +662,8 @@ dt_action_printflike(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp,
static void
dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
{
+ int ctflib;
+
dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
boolean_t istrace = (dnp->dn_ident->di_id == DT_ACT_TRACE);
const char *act = istrace ? "trace" : "print";
@@ -693,7 +695,10 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
* like arrays and function pointers that can't be resolved by
* ctf_type_lookup(). This is later processed by dtrace_dof_create()
* and turned into a reference into the string table so that we can
- * get the type information when we process the data after the fact.
+ * get the type information when we process the data after the fact. In
+ * the case where we are referring to userland CTF data, we also need to
+ * to identify which ctf container in question we care about and encode
+ * that within the name.
*/
if (dnp->dn_ident->di_id == DT_ACT_PRINT) {
dt_node_t *dret;
@@ -703,12 +708,25 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
dret = yypcb->pcb_dret;
dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
- n = snprintf(NULL, 0, "%s`%d", dmp->dm_name, dret->dn_type) + 1;
+ if (dmp->dm_pid != 0) {
+ ctflib = dt_module_getlibid(dtp, dmp, dret->dn_ctfp);
+ assert(ctflib >= 0);
+ n = snprintf(NULL, 0, "%s`%d`%d", dmp->dm_name,
+ ctflib, dret->dn_type) + 1;
+ } else {
+ n = snprintf(NULL, 0, "%s`%d", dmp->dm_name,
+ dret->dn_type) + 1;
+ }
sdp->dtsd_strdata = dt_alloc(dtp, n);
if (sdp->dtsd_strdata == NULL)
longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
- (void) snprintf(sdp->dtsd_strdata, n, "%s`%d", dmp->dm_name,
- dret->dn_type);
+ if (dmp->dm_pid != 0) {
+ (void) snprintf(sdp->dtsd_strdata, n, "%s`%d`%d",
+ dmp->dm_name, ctflib, dret->dn_type);
+ } else {
+ (void) snprintf(sdp->dtsd_strdata, n, "%s`%d",
+ dmp->dm_name, dret->dn_type);
+ }
}
ap->dtad_difo = dt_as(yypcb);
diff --git a/usr/src/lib/libdtrace/common/dt_cg.c b/usr/src/lib/libdtrace/common/dt_cg.c
index 3103106d27..28db9b2262 100644
--- a/usr/src/lib/libdtrace/common/dt_cg.c
+++ b/usr/src/lib/libdtrace/common/dt_cg.c
@@ -476,7 +476,7 @@ dt_cg_typecast(const dt_node_t *src, const dt_node_t *dst,
if (!dt_node_is_scalar(dst))
return; /* not a scalar */
if (dstsize == srcsize &&
- ((src->dn_flags ^ dst->dn_flags) & DT_NF_SIGNED) != 0)
+ ((src->dn_flags ^ dst->dn_flags) & DT_NF_SIGNED) == 0)
return; /* not narrowing or changing signed-ness */
if (dstsize > srcsize && (src->dn_flags & DT_NF_SIGNED) == 0)
return; /* nothing to do in this case */
diff --git a/usr/src/lib/libdtrace/common/dt_consume.c b/usr/src/lib/libdtrace/common/dt_consume.c
index b1e8d2daa4..14cd7162cd 100644
--- a/usr/src/lib/libdtrace/common/dt_consume.c
+++ b/usr/src/lib/libdtrace/common/dt_consume.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -54,6 +54,25 @@ dt_fabsl(long double x)
return (x);
}
+static int
+dt_ndigits(long long val)
+{
+ int rval = 1;
+ long long cmp = 10;
+
+ if (val < 0) {
+ val = val == INT64_MIN ? INT64_MAX : -val;
+ rval++;
+ }
+
+ while (val > cmp && cmp > 0) {
+ rval++;
+ cmp *= 10;
+ }
+
+ return (rval < 4 ? 4 : rval);
+}
+
/*
* 128-bit arithmetic functions needed to support the stddev() aggregating
* action.
@@ -482,7 +501,125 @@ dt_nullrec()
return (DTRACE_CONSUME_NEXT);
}
-int
+static void
+dt_quantize_total(dtrace_hdl_t *dtp, int64_t datum, long double *total)
+{
+ long double val = dt_fabsl((long double)datum);
+
+ if (dtp->dt_options[DTRACEOPT_AGGZOOM] == DTRACEOPT_UNSET) {
+ *total += val;
+ return;
+ }
+
+ /*
+ * If we're zooming in on an aggregation, we want the height of the
+ * highest value to be approximately 95% of total bar height -- so we
+ * adjust up by the reciprocal of DTRACE_AGGZOOM_MAX when comparing to
+ * our highest value.
+ */
+ val *= 1 / DTRACE_AGGZOOM_MAX;
+
+ if (*total < val)
+ *total = val;
+}
+
+static int
+dt_print_quanthdr(dtrace_hdl_t *dtp, FILE *fp, int width)
+{
+ return (dt_printf(dtp, fp, "\n%*s %41s %-9s\n",
+ width ? width : 16, width ? "key" : "value",
+ "------------- Distribution -------------", "count"));
+}
+
+static int
+dt_print_quanthdr_packed(dtrace_hdl_t *dtp, FILE *fp, int width,
+ const dtrace_aggdata_t *aggdata, dtrace_actkind_t action)
+{
+ int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin;
+ int minwidth, maxwidth, i;
+
+ assert(action == DTRACEAGG_QUANTIZE || action == DTRACEAGG_LQUANTIZE);
+
+ if (action == DTRACEAGG_QUANTIZE) {
+ if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET)
+ min--;
+
+ if (max < DTRACE_QUANTIZE_NBUCKETS - 1)
+ max++;
+
+ minwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(min));
+ maxwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(max));
+ } else {
+ maxwidth = 8;
+ minwidth = maxwidth - 1;
+ max++;
+ }
+
+ if (dt_printf(dtp, fp, "\n%*s %*s .",
+ width, width > 0 ? "key" : "", minwidth, "min") < 0)
+ return (-1);
+
+ for (i = min; i <= max; i++) {
+ if (dt_printf(dtp, fp, "-") < 0)
+ return (-1);
+ }
+
+ return (dt_printf(dtp, fp, ". %*s | count\n", -maxwidth, "max"));
+}
+
+/*
+ * We use a subset of the Unicode Block Elements (U+2588 through U+258F,
+ * inclusive) to represent aggregations via UTF-8 -- which are expressed via
+ * 3-byte UTF-8 sequences.
+ */
+#define DTRACE_AGGUTF8_FULL 0x2588
+#define DTRACE_AGGUTF8_BASE 0x258f
+#define DTRACE_AGGUTF8_LEVELS 8
+
+#define DTRACE_AGGUTF8_BYTE0(val) (0xe0 | ((val) >> 12))
+#define DTRACE_AGGUTF8_BYTE1(val) (0x80 | (((val) >> 6) & 0x3f))
+#define DTRACE_AGGUTF8_BYTE2(val) (0x80 | ((val) & 0x3f))
+
+static int
+dt_print_quantline_utf8(dtrace_hdl_t *dtp, FILE *fp, int64_t val,
+ uint64_t normal, long double total)
+{
+ uint_t len = 40, i, whole, partial;
+ long double f = (dt_fabsl((long double)val) * len) / total;
+ const char *spaces = " ";
+
+ whole = (uint_t)f;
+ partial = (uint_t)((f - (long double)(uint_t)f) *
+ (long double)DTRACE_AGGUTF8_LEVELS);
+
+ if (dt_printf(dtp, fp, "|") < 0)
+ return (-1);
+
+ for (i = 0; i < whole; i++) {
+ if (dt_printf(dtp, fp, "%c%c%c",
+ DTRACE_AGGUTF8_BYTE0(DTRACE_AGGUTF8_FULL),
+ DTRACE_AGGUTF8_BYTE1(DTRACE_AGGUTF8_FULL),
+ DTRACE_AGGUTF8_BYTE2(DTRACE_AGGUTF8_FULL)) < 0)
+ return (-1);
+ }
+
+ if (partial != 0) {
+ partial = DTRACE_AGGUTF8_BASE - (partial - 1);
+
+ if (dt_printf(dtp, fp, "%c%c%c",
+ DTRACE_AGGUTF8_BYTE0(partial),
+ DTRACE_AGGUTF8_BYTE1(partial),
+ DTRACE_AGGUTF8_BYTE2(partial)) < 0)
+ return (-1);
+
+ i++;
+ }
+
+ return (dt_printf(dtp, fp, "%s %-9lld\n", spaces + i,
+ (long long)val / normal));
+}
+
+static int
dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val,
uint64_t normal, long double total, char positives, char negatives)
{
@@ -500,6 +637,11 @@ dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val,
if (!negatives) {
if (positives) {
+ if (dtp->dt_encoding == DT_ENCODING_UTF8) {
+ return (dt_print_quantline_utf8(dtp, fp, val,
+ normal, total));
+ }
+
f = (dt_fabsl((long double)val) * len) / total;
depth = (uint_t)(f + 0.5);
} else {
@@ -542,6 +684,77 @@ dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val,
}
}
+/*
+ * As with UTF-8 printing of aggregations, we use a subset of the Unicode
+ * Block Elements (U+2581 through U+2588, inclusive) to represent our packed
+ * aggregation.
+ */
+#define DTRACE_AGGPACK_BASE 0x2581
+#define DTRACE_AGGPACK_LEVELS 8
+
+static int
+dt_print_packed(dtrace_hdl_t *dtp, FILE *fp,
+ long double datum, long double total)
+{
+ static boolean_t utf8_checked = 0;
+ static boolean_t utf8;
+ char *ascii = "__xxxxXX";
+ char *neg = "vvvvVV";
+ unsigned int len;
+ long double val;
+
+ while (!utf8_checked) {
+ char *term;
+
+ /*
+ * We want to determine if we can reasonably emit UTF-8 for our
+ * packed aggregation. To do this, we will check for terminals
+ * that are known to be primitive to emit UTF-8 on these.
+ */
+ utf8_checked = B_TRUE;
+
+ if (dtp->dt_encoding == DT_ENCODING_ASCII)
+ break;
+
+ if (dtp->dt_encoding == DT_ENCODING_UTF8) {
+ utf8 = B_TRUE;
+ break;
+ }
+
+ if ((term = getenv("TERM")) != NULL &&
+ (strcmp(term, "sun") == 0 ||
+ strcmp(term, "sun-color") == 0) ||
+ strcmp(term, "dumb") == 0) {
+ break;
+ }
+
+ utf8 = B_TRUE;
+ }
+
+ if (datum == 0)
+ return (dt_printf(dtp, fp, " "));
+
+ if (datum < 0) {
+ len = strlen(neg);
+ val = dt_fabsl(datum * (len - 1)) / total;
+ return (dt_printf(dtp, fp, "%c", neg[(uint_t)(val + 0.5)]));
+ }
+
+ if (utf8) {
+ int block = DTRACE_AGGPACK_BASE + (unsigned int)(((datum *
+ (DTRACE_AGGPACK_LEVELS - 1)) / total) + 0.5);
+
+ return (dt_printf(dtp, fp, "%c%c%c",
+ DTRACE_AGGUTF8_BYTE0(block),
+ DTRACE_AGGUTF8_BYTE1(block),
+ DTRACE_AGGUTF8_BYTE2(block)));
+ }
+
+ len = strlen(ascii);
+ val = (datum * (len - 1)) / total;
+ return (dt_printf(dtp, fp, "%c", ascii[(uint_t)(val + 0.5)]));
+}
+
int
dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
size_t size, uint64_t normal)
@@ -559,9 +772,9 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
if (first_bin == DTRACE_QUANTIZE_NBUCKETS - 1) {
/*
- * There isn't any data. This is possible if (and only if)
- * negative increment values have been used. In this case,
- * we'll print the buckets around 0.
+ * There isn't any data. This is possible if the aggregation
+ * has been clear()'d or if negative increment values have been
+ * used. Regardless, we'll print the buckets around 0.
*/
first_bin = DTRACE_QUANTIZE_ZEROBUCKET - 1;
last_bin = DTRACE_QUANTIZE_ZEROBUCKET + 1;
@@ -579,11 +792,10 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
for (i = first_bin; i <= last_bin; i++) {
positives |= (data[i] > 0);
negatives |= (data[i] < 0);
- total += dt_fabsl((long double)data[i]);
+ dt_quantize_total(dtp, data[i], &total);
}
- if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
- "------------- Distribution -------------", "count") < 0)
+ if (dt_print_quanthdr(dtp, fp, 0) < 0)
return (-1);
for (i = first_bin; i <= last_bin; i++) {
@@ -600,6 +812,48 @@ dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
}
int
+dt_print_quantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
+ size_t size, const dtrace_aggdata_t *aggdata)
+{
+ const int64_t *data = addr;
+ long double total = 0, count = 0;
+ int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin, i;
+ int64_t minval, maxval;
+
+ if (size != DTRACE_QUANTIZE_NBUCKETS * sizeof (uint64_t))
+ return (dt_set_errno(dtp, EDT_DMISMATCH));
+
+ if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET)
+ min--;
+
+ if (max < DTRACE_QUANTIZE_NBUCKETS - 1)
+ max++;
+
+ minval = DTRACE_QUANTIZE_BUCKETVAL(min);
+ maxval = DTRACE_QUANTIZE_BUCKETVAL(max);
+
+ if (dt_printf(dtp, fp, " %*lld :", dt_ndigits(minval),
+ (long long)minval) < 0)
+ return (-1);
+
+ for (i = min; i <= max; i++) {
+ dt_quantize_total(dtp, data[i], &total);
+ count += data[i];
+ }
+
+ for (i = min; i <= max; i++) {
+ if (dt_print_packed(dtp, fp, data[i], total) < 0)
+ return (-1);
+ }
+
+ if (dt_printf(dtp, fp, ": %*lld | %lld\n",
+ -dt_ndigits(maxval), (long long)maxval, (long long)count) < 0)
+ return (-1);
+
+ return (0);
+}
+
+int
dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
size_t size, uint64_t normal)
{
@@ -646,7 +900,7 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
for (i = first_bin; i <= last_bin; i++) {
positives |= (data[i] > 0);
negatives |= (data[i] < 0);
- total += dt_fabsl((long double)data[i]);
+ dt_quantize_total(dtp, data[i], &total);
}
if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
@@ -658,8 +912,7 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
int err;
if (i == 0) {
- (void) snprintf(c, sizeof (c), "< %d",
- base / (uint32_t)normal);
+ (void) snprintf(c, sizeof (c), "< %d", base);
err = dt_printf(dtp, fp, "%16s ", c);
} else if (i == levels + 1) {
(void) snprintf(c, sizeof (c), ">= %d",
@@ -678,6 +931,59 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
return (0);
}
+/*ARGSUSED*/
+int
+dt_print_lquantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
+ size_t size, const dtrace_aggdata_t *aggdata)
+{
+ const int64_t *data = addr;
+ long double total = 0, count = 0;
+ int min, max, base, err;
+ uint64_t arg;
+ uint16_t step, levels;
+ char c[32];
+ unsigned int i;
+
+ if (size < sizeof (uint64_t))
+ return (dt_set_errno(dtp, EDT_DMISMATCH));
+
+ arg = *data++;
+ size -= sizeof (uint64_t);
+
+ base = DTRACE_LQUANTIZE_BASE(arg);
+ step = DTRACE_LQUANTIZE_STEP(arg);
+ levels = DTRACE_LQUANTIZE_LEVELS(arg);
+
+ if (size != sizeof (uint64_t) * (levels + 2))
+ return (dt_set_errno(dtp, EDT_DMISMATCH));
+
+ min = 0;
+ max = levels + 1;
+
+ if (min == 0) {
+ (void) snprintf(c, sizeof (c), "< %d", base);
+ err = dt_printf(dtp, fp, "%8s :", c);
+ } else {
+ err = dt_printf(dtp, fp, "%8d :", base + (min - 1) * step);
+ }
+
+ if (err < 0)
+ return (-1);
+
+ for (i = min; i <= max; i++) {
+ dt_quantize_total(dtp, data[i], &total);
+ count += data[i];
+ }
+
+ for (i = min; i <= max; i++) {
+ if (dt_print_packed(dtp, fp, data[i], total) < 0)
+ return (-1);
+ }
+
+ (void) snprintf(c, sizeof (c), ">= %d", base + (levels * step));
+ return (dt_printf(dtp, fp, ": %-8s | %lld\n", c, (long long)count));
+}
+
int
dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
size_t size, uint64_t normal)
@@ -735,7 +1041,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
for (i = first_bin; i <= last_bin; i++) {
positives |= (data[i] > 0);
negatives |= (data[i] < 0);
- total += dt_fabsl((long double)data[i]);
+ dt_quantize_total(dtp, data[i], &total);
}
if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
@@ -818,7 +1124,7 @@ dt_print_stddev(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
}
/*ARGSUSED*/
-int
+static int
dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
size_t nbytes, int width, int quiet, int forceraw)
{
@@ -871,10 +1177,12 @@ dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
if (j != nbytes)
break;
- if (quiet)
+ if (quiet) {
return (dt_printf(dtp, fp, "%s", c));
- else
- return (dt_printf(dtp, fp, " %-*s", width, c));
+ } else {
+ return (dt_printf(dtp, fp, " %s%*s",
+ width < 0 ? " " : "", width, c));
+ }
}
break;
@@ -1078,8 +1386,8 @@ dt_print_ustack(dtrace_hdl_t *dtp, FILE *fp, const char *format,
"%s`%s", dt_basename(objname), name);
}
} else if (str != NULL && str[0] != '\0' && str[0] != '@' &&
- (P != NULL && ((map = Paddr_to_map(P, pc[i])) == NULL ||
- (map->pr_mflags & MA_WRITE)))) {
+ (P == NULL || (map = Paddr_to_map(P, pc[i])) == NULL ||
+ map->pr_mflags & MA_WRITE)) {
/*
* If the current string pointer in the string table
* does not point to an empty string _and_ the program
@@ -1091,7 +1399,10 @@ dt_print_ustack(dtrace_hdl_t *dtp, FILE *fp, const char *format,
* identify. If we have a string for a program
* counter that falls in a segment that isn't
* writable, we assume that we have fallen into this
- * case and we refuse to use the string.
+ * case and we refuse to use the string. Finally,
+ * note that if we could not grab the process (e.g.,
+ * because it exited), the information from the helper
+ * is better than nothing.
*/
(void) snprintf(c, sizeof (c), "%s", str);
} else {
@@ -1479,10 +1790,83 @@ dt_trunc(dtrace_hdl_t *dtp, caddr_t base, dtrace_recdesc_t *rec)
static int
dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec,
- caddr_t addr, size_t size, uint64_t normal)
+ caddr_t addr, size_t size, const dtrace_aggdata_t *aggdata,
+ uint64_t normal, dt_print_aggdata_t *pd)
{
- int err;
+ int err, width;
dtrace_actkind_t act = rec->dtrd_action;
+ boolean_t packed = pd->dtpa_agghist || pd->dtpa_aggpack;
+ dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+
+ static struct {
+ size_t size;
+ int width;
+ int packedwidth;
+ } *fmt, fmttab[] = {
+ { sizeof (uint8_t), 3, 3 },
+ { sizeof (uint16_t), 5, 5 },
+ { sizeof (uint32_t), 8, 8 },
+ { sizeof (uint64_t), 16, 16 },
+ { 0, -50, 16 }
+ };
+
+ if (packed && pd->dtpa_agghisthdr != agg->dtagd_varid) {
+ dtrace_recdesc_t *r;
+
+ width = 0;
+
+ /*
+ * To print our quantization header for either an agghist or
+ * aggpack aggregation, we need to iterate through all of our
+ * of our records to determine their width.
+ */
+ for (r = rec; !DTRACEACT_ISAGG(r->dtrd_action); r++) {
+ for (fmt = fmttab; fmt->size &&
+ fmt->size != r->dtrd_size; fmt++)
+ continue;
+
+ width += fmt->packedwidth + 1;
+ }
+
+ if (pd->dtpa_agghist) {
+ if (dt_print_quanthdr(dtp, fp, width) < 0)
+ return (-1);
+ } else {
+ if (dt_print_quanthdr_packed(dtp, fp,
+ width, aggdata, r->dtrd_action) < 0)
+ return (-1);
+ }
+
+ pd->dtpa_agghisthdr = agg->dtagd_varid;
+ }
+
+ if (pd->dtpa_agghist && DTRACEACT_ISAGG(act)) {
+ char positives = aggdata->dtada_flags & DTRACE_A_HASPOSITIVES;
+ char negatives = aggdata->dtada_flags & DTRACE_A_HASNEGATIVES;
+ int64_t val;
+
+ assert(act == DTRACEAGG_SUM || act == DTRACEAGG_COUNT);
+ val = (long long)*((uint64_t *)addr);
+
+ if (dt_printf(dtp, fp, " ") < 0)
+ return (-1);
+
+ return (dt_print_quantline(dtp, fp, val, normal,
+ aggdata->dtada_total, positives, negatives));
+ }
+
+ if (pd->dtpa_aggpack && DTRACEACT_ISAGG(act)) {
+ switch (act) {
+ case DTRACEAGG_QUANTIZE:
+ return (dt_print_quantize_packed(dtp,
+ fp, addr, size, aggdata));
+ case DTRACEAGG_LQUANTIZE:
+ return (dt_print_lquantize_packed(dtp,
+ fp, addr, size, aggdata));
+ default:
+ break;
+ }
+ }
switch (act) {
case DTRACEACT_STACK:
@@ -1525,28 +1909,33 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec,
break;
}
+ for (fmt = fmttab; fmt->size && fmt->size != size; fmt++)
+ continue;
+
+ width = packed ? fmt->packedwidth : fmt->width;
+
switch (size) {
case sizeof (uint64_t):
- err = dt_printf(dtp, fp, " %16lld",
+ err = dt_printf(dtp, fp, " %*lld", width,
/* LINTED - alignment */
(long long)*((uint64_t *)addr) / normal);
break;
case sizeof (uint32_t):
/* LINTED - alignment */
- err = dt_printf(dtp, fp, " %8d", *((uint32_t *)addr) /
+ err = dt_printf(dtp, fp, " %*d", width, *((uint32_t *)addr) /
(uint32_t)normal);
break;
case sizeof (uint16_t):
/* LINTED - alignment */
- err = dt_printf(dtp, fp, " %5d", *((uint16_t *)addr) /
+ err = dt_printf(dtp, fp, " %*d", width, *((uint16_t *)addr) /
(uint32_t)normal);
break;
case sizeof (uint8_t):
- err = dt_printf(dtp, fp, " %3d", *((uint8_t *)addr) /
+ err = dt_printf(dtp, fp, " %*d", width, *((uint8_t *)addr) /
(uint32_t)normal);
break;
default:
- err = dt_print_bytes(dtp, fp, addr, size, 50, 0, 0);
+ err = dt_print_bytes(dtp, fp, addr, size, width, 0, 0);
break;
}
@@ -1567,6 +1956,9 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg)
caddr_t addr;
size_t size;
+ pd->dtpa_agghist = (aggdata->dtada_flags & DTRACE_A_TOTAL);
+ pd->dtpa_aggpack = (aggdata->dtada_flags & DTRACE_A_MINMAXBIN);
+
/*
* Iterate over each record description in the key, printing the traced
* data, skipping the first datum (the tuple member created by the
@@ -1583,7 +1975,8 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg)
break;
}
- if (dt_print_datum(dtp, fp, rec, addr, size, 1) < 0)
+ if (dt_print_datum(dtp, fp, rec, addr,
+ size, aggdata, 1, pd) < 0)
return (-1);
if (dt_buffered_flush(dtp, NULL, rec, aggdata,
@@ -1606,7 +1999,8 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg)
assert(DTRACEACT_ISAGG(act));
normal = aggdata->dtada_normal;
- if (dt_print_datum(dtp, fp, rec, addr, size, normal) < 0)
+ if (dt_print_datum(dtp, fp, rec, addr,
+ size, aggdata, normal, pd) < 0)
return (-1);
if (dt_buffered_flush(dtp, NULL, rec, aggdata,
@@ -1617,8 +2011,10 @@ dt_print_aggs(const dtrace_aggdata_t **aggsdata, int naggvars, void *arg)
agg->dtagd_flags |= DTRACE_AGD_PRINTED;
}
- if (dt_printf(dtp, fp, "\n") < 0)
- return (-1);
+ if (!pd->dtpa_agghist && !pd->dtpa_aggpack) {
+ if (dt_printf(dtp, fp, "\n") < 0)
+ return (-1);
+ }
if (dt_buffered_flush(dtp, NULL, NULL, aggdata,
DTRACE_BUFDATA_AGGFORMAT | DTRACE_BUFDATA_AGGLAST) < 0)
@@ -2075,7 +2471,7 @@ nofmt:
}
n = dt_print_bytes(dtp, fp, addr,
- tracememsize, 33, quiet, 1);
+ tracememsize, -33, quiet, 1);
tracememsize = 0;
@@ -2108,7 +2504,7 @@ nofmt:
break;
default:
n = dt_print_bytes(dtp, fp, addr,
- rec->dtrd_size, 33, quiet, 0);
+ rec->dtrd_size, -33, quiet, 0);
break;
}
diff --git a/usr/src/lib/libdtrace/common/dt_decl.c b/usr/src/lib/libdtrace/common/dt_decl.c
index 563c0057da..4e99ff4c9f 100644
--- a/usr/src/lib/libdtrace/common/dt_decl.c
+++ b/usr/src/lib/libdtrace/common/dt_decl.c
@@ -21,7 +21,8 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#include <strings.h>
@@ -775,7 +776,7 @@ dt_decl_enumerator(char *s, dt_node_t *dnp)
yyintdecimal = 0;
dnp = dt_node_int(value);
- dt_node_type_assign(dnp, dsp->ds_ctfp, dsp->ds_type);
+ dt_node_type_assign(dnp, dsp->ds_ctfp, dsp->ds_type, B_FALSE);
if ((inp = malloc(sizeof (dt_idnode_t))) == NULL)
longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
@@ -817,6 +818,8 @@ dt_decl_type(dt_decl_t *ddp, dtrace_typeinfo_t *tip)
char *name;
int rv;
+ tip->dtt_flags = 0;
+
/*
* Based on our current #include depth and decl stack depth, determine
* which dynamic CTF module and scope to use when adding any new types.
@@ -824,6 +827,9 @@ dt_decl_type(dt_decl_t *ddp, dtrace_typeinfo_t *tip)
dmp = yypcb->pcb_idepth ? dtp->dt_cdefs : dtp->dt_ddefs;
flag = yypcb->pcb_dstack.ds_next ? CTF_ADD_NONROOT : CTF_ADD_ROOT;
+ if (ddp->dd_attr & DT_DA_USER)
+ tip->dtt_flags = DTT_FL_USER;
+
/*
* If we have already cached a CTF type for this decl, then we just
* return the type information for the cached type.
diff --git a/usr/src/lib/libdtrace/common/dt_decl.h b/usr/src/lib/libdtrace/common/dt_decl.h
index 2933155c78..d322875782 100644
--- a/usr/src/lib/libdtrace/common/dt_decl.h
+++ b/usr/src/lib/libdtrace/common/dt_decl.h
@@ -23,12 +23,14 @@
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
#ifndef _DT_DECL_H
#define _DT_DECL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <libctf.h>
#include <dtrace.h>
@@ -59,6 +61,7 @@ typedef struct dt_decl {
#define DT_DA_RESTRICT 0x0040 /* qualify type as restrict */
#define DT_DA_VOLATILE 0x0080 /* qualify type as volatile */
#define DT_DA_PAREN 0x0100 /* parenthesis tag */
+#define DT_DA_USER 0x0200 /* user-land type specifier */
typedef enum dt_dclass {
DT_DC_DEFAULT, /* no storage class specified */
diff --git a/usr/src/lib/libdtrace/common/dt_dis.c b/usr/src/lib/libdtrace/common/dt_dis.c
index fff4235a6b..c0af36420e 100644
--- a/usr/src/lib/libdtrace/common/dt_dis.c
+++ b/usr/src/lib/libdtrace/common/dt_dis.c
@@ -26,7 +26,8 @@
*/
/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#include <strings.h>
@@ -312,9 +313,10 @@ dt_dis_typestr(const dtrace_diftype_t *t, char *buf, size_t len)
(void) snprintf(ckind, sizeof (ckind), "0x%x", t->dtdt_ckind);
}
- if (t->dtdt_flags & DIF_TF_BYREF) {
- (void) snprintf(buf, len, "%s (%s) by ref (size %lu)",
- kind, ckind, (ulong_t)t->dtdt_size);
+ if (t->dtdt_flags & (DIF_TF_BYREF | DIF_TF_BYUREF)) {
+ (void) snprintf(buf, len, "%s (%s) by %sref (size %lu)",
+ kind, ckind, (t->dtdt_flags & DIF_TF_BYUREF) ? "user " : "",
+ (ulong_t)t->dtdt_size);
} else {
(void) snprintf(buf, len, "%s (%s) (size %lu)",
kind, ckind, (ulong_t)t->dtdt_size);
diff --git a/usr/src/lib/libdtrace/common/dt_error.c b/usr/src/lib/libdtrace/common/dt_error.c
index f7ad28ebae..abac5b11d1 100644
--- a/usr/src/lib/libdtrace/common/dt_error.c
+++ b/usr/src/lib/libdtrace/common/dt_error.c
@@ -110,7 +110,8 @@ static const struct {
{ EDT_BADAGGVAR, "Invalid aggregation variable identifier" },
{ EDT_OVERSION, "Client requested deprecated version of library" },
{ EDT_ENABLING_ERR, "Failed to enable probe" },
- { EDT_NOPROBES, "No probe sites found for declared provider" }
+ { EDT_NOPROBES, "No probe sites found for declared provider" },
+ { EDT_CANTLOAD, "Failed to load module" }
};
static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]);
diff --git a/usr/src/lib/libdtrace/common/dt_grammar.y b/usr/src/lib/libdtrace/common/dt_grammar.y
index 0c12623bc4..07790f4ebc 100644
--- a/usr/src/lib/libdtrace/common/dt_grammar.y
+++ b/usr/src/lib/libdtrace/common/dt_grammar.y
@@ -23,8 +23,10 @@
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <dt_impl.h>
@@ -102,6 +104,7 @@
%token DT_KEY_TYPEDEF
%token DT_KEY_UNION
%token DT_KEY_UNSIGNED
+%token DT_KEY_USERLAND
%token DT_KEY_VOID
%token DT_KEY_VOLATILE
%token DT_KEY_WHILE
@@ -633,6 +636,7 @@ type_specifier: DT_KEY_VOID { $$ = dt_decl_spec(CTF_K_INTEGER, DUP("void")); }
| DT_KEY_DOUBLE { $$ = dt_decl_spec(CTF_K_FLOAT, DUP("double")); }
| DT_KEY_SIGNED { $$ = dt_decl_attr(DT_DA_SIGNED); }
| DT_KEY_UNSIGNED { $$ = dt_decl_attr(DT_DA_UNSIGNED); }
+ | DT_KEY_USERLAND { $$ = dt_decl_attr(DT_DA_USER); }
| DT_KEY_STRING {
$$ = dt_decl_spec(CTF_K_TYPEDEF, DUP("string"));
}
diff --git a/usr/src/lib/libdtrace/common/dt_ident.c b/usr/src/lib/libdtrace/common/dt_ident.c
index 3dfa058b16..33f94eb9fd 100644
--- a/usr/src/lib/libdtrace/common/dt_ident.c
+++ b/usr/src/lib/libdtrace/common/dt_ident.c
@@ -21,6 +21,8 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#include <sys/sysmacros.h>
@@ -95,7 +97,7 @@ dt_idcook_sign(dt_node_t *dnp, dt_ident_t *idp,
}
}
- dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
}
/*
@@ -154,7 +156,7 @@ dt_idcook_assc(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
if (argc != 0)
isp->dis_args[argc - 1].dn_list = NULL;
- dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
} else {
dt_idcook_sign(dnp, idp, argc, args,
@@ -294,7 +296,7 @@ dt_idcook_func(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
}
dt_node_type_assign(&isp->dis_args[i],
- dtt.dtt_ctfp, dtt.dtt_type);
+ dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
}
}
@@ -381,7 +383,9 @@ dt_idcook_args(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *ap)
dt_node_type_assign(dnp,
prp->pr_argv[ap->dn_value].dtt_ctfp,
- prp->pr_argv[ap->dn_value].dtt_type);
+ prp->pr_argv[ap->dn_value].dtt_type,
+ prp->pr_argv[ap->dn_value].dtt_flags & DTT_FL_USER ?
+ B_TRUE : B_FALSE);
} else if ((dxp = dt_xlator_lookup(dtp,
nnp, xnp, DT_XLATE_FUZZY)) != NULL || (
@@ -409,7 +413,8 @@ dt_idcook_args(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *ap)
dnp->dn_ident->di_ctfp = xidp->di_ctfp;
dnp->dn_ident->di_type = xidp->di_type;
- dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
+ B_FALSE);
} else {
xyerror(D_ARGS_XLATOR, "translator for %s[%lld] from %s to %s "
@@ -455,7 +460,7 @@ dt_idcook_regs(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *ap)
idp->di_ctfp = dtt.dtt_ctfp;
idp->di_type = dtt.dtt_type;
- dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
}
/*ARGSUSED*/
@@ -477,7 +482,7 @@ dt_idcook_type(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
idp->di_type = dtt.dtt_type;
}
- dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
}
/*ARGSUSED*/
@@ -485,7 +490,7 @@ static void
dt_idcook_thaw(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
{
if (idp->di_ctfp != NULL && idp->di_type != CTF_ERR)
- dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
}
static void
diff --git a/usr/src/lib/libdtrace/common/dt_impl.h b/usr/src/lib/libdtrace/common/dt_impl.h
index fc275e6805..2d824ba640 100644
--- a/usr/src/lib/libdtrace/common/dt_impl.h
+++ b/usr/src/lib/libdtrace/common/dt_impl.h
@@ -133,6 +133,10 @@ typedef struct dt_module {
GElf_Addr dm_bss_va; /* virtual address of BSS */
GElf_Xword dm_bss_size; /* size in bytes of BSS */
dt_idhash_t *dm_extern; /* external symbol definitions */
+ pid_t dm_pid; /* pid for this module */
+ uint_t dm_nctflibs; /* number of ctf children libraries */
+ ctf_file_t **dm_libctfp; /* process library ctf pointers */
+ char **dm_libctfn; /* names of process ctf containers */
} dt_module_t;
#define DT_DM_LOADED 0x1 /* module symbol and type data is loaded */
@@ -176,6 +180,9 @@ typedef struct dt_print_aggdata {
dtrace_aggvarid_t dtpa_id; /* aggregation variable of interest */
FILE *dtpa_fp; /* file pointer */
int dtpa_allunprint; /* print only unprinted aggregations */
+ int dtpa_agghist; /* print aggregation as histogram */
+ int dtpa_agghisthdr; /* aggregation histogram hdr printed */
+ int dtpa_aggpack; /* pack quantized aggregations */
} dt_print_aggdata_t;
typedef struct dt_dirpath {
@@ -260,6 +267,7 @@ struct dtrace_hdl {
uint_t dt_droptags; /* boolean: set via -xdroptags */
uint_t dt_active; /* boolean: set once tracing is active */
uint_t dt_stopped; /* boolean: set once tracing is stopped */
+ uint_t dt_optset; /* boolean: set once options have been set */
processorid_t dt_beganon; /* CPU that executed BEGIN probe (if any) */
processorid_t dt_endedon; /* CPU that executed END probe (if any) */
uint_t dt_oflags; /* dtrace open-time options (see dtrace.h) */
@@ -270,6 +278,7 @@ struct dtrace_hdl {
uint_t dt_linktype; /* dtrace link output file type (see below) */
uint_t dt_xlatemode; /* dtrace translator linking mode (see below) */
uint_t dt_stdcmode; /* dtrace stdc compatibility mode (see below) */
+ uint_t dt_encoding; /* dtrace output encoding (see below) */
uint_t dt_treedump; /* dtrace tree debug bitmap (see below) */
uint64_t dt_options[DTRACEOPT_MAX]; /* dtrace run-time options */
int dt_version; /* library version requested by client */
@@ -353,6 +362,14 @@ struct dtrace_hdl {
#define DT_STDC_XT 3 /* ISO C + K&R C compat with ISO: __STDC__=0 */
/*
+ * Values for the dt_encoding property, which is used to force a particular
+ * character encoding (overriding default behavior and/or automatic detection).
+ */
+#define DT_ENCODING_UNSET 0
+#define DT_ENCODING_ASCII 1
+#define DT_ENCODING_UTF8 2
+
+/*
* Macro to test whether a given pass bit is set in the dt_treedump bit-vector.
* If the bit for pass 'p' is set, the D compiler displays the parse tree for
* the program by printing it to stderr at the end of compiler pass 'p'.
@@ -513,7 +530,8 @@ enum {
EDT_BADAGGVAR, /* invalid aggregation variable identifier */
EDT_OVERSION, /* client is requesting deprecated version */
EDT_ENABLING_ERR, /* failed to enable probe */
- EDT_NOPROBES /* no probes sites for declared provider */
+ EDT_NOPROBES, /* no probes sites for declared provider */
+ EDT_CANTLOAD /* failed to load a module */
};
/*
diff --git a/usr/src/lib/libdtrace/common/dt_lex.l b/usr/src/lib/libdtrace/common/dt_lex.l
index 5b2ad34d2e..5e990e2049 100644
--- a/usr/src/lib/libdtrace/common/dt_lex.l
+++ b/usr/src/lib/libdtrace/common/dt_lex.l
@@ -23,6 +23,10 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <string.h>
#include <stdlib.h>
@@ -60,13 +64,17 @@ static void unput(int);
%}
%e 1500 /* maximum nodes */
-%p 3700 /* maximum positions */
+%p 4900 /* maximum positions */
%n 600 /* maximum states */
+%a 3000 /* maximum transitions */
%s S0 S1 S2 S3 S4
RGX_AGG "@"[a-zA-Z_][0-9a-zA-Z_]*
RGX_PSPEC [-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`?*\\\[\]!]*
+RGX_ALTIDENT [a-zA-Z_][0-9a-zA-Z_]*
+RGX_LMID LM[0-9a-fA-F]+`
+RGX_MOD_IDENT [a-zA-Z_`][0-9a-z.A-Z_`]*`
RGX_IDENT [a-zA-Z_`][0-9a-zA-Z_`]*
RGX_INT ([0-9]+|0[xX][0-9A-Fa-f]+)[uU]?[lL]?[lL]?
RGX_FP ([0-9]+("."?)[0-9]*|"."[0-9]+)((e|E)("+"|-)?[0-9]+)?[fFlL]?
@@ -136,6 +144,7 @@ if (yypcb->pcb_token != 0) {
<S0>typedef return (DT_KEY_TYPEDEF);
<S0>union return (DT_KEY_UNION);
<S0>unsigned return (DT_KEY_UNSIGNED);
+<S0>userland return (DT_KEY_USERLAND);
<S0>void return (DT_KEY_VOID);
<S0>volatile return (DT_KEY_VOLATILE);
<S0>while return (DT_KEY_WHILE);
@@ -314,7 +323,9 @@ if (yypcb->pcb_token != 0) {
return (DT_TOK_INT);
}
-<S0>{RGX_IDENT} {
+<S0>{RGX_IDENT} |
+<S0>{RGX_MOD_IDENT}{RGX_IDENT} |
+<S0>{RGX_MOD_IDENT} {
return (id_or_type(yytext));
}
diff --git a/usr/src/lib/libdtrace/common/dt_module.c b/usr/src/lib/libdtrace/common/dt_module.c
index 1490f775c3..0288f329da 100644
--- a/usr/src/lib/libdtrace/common/dt_module.c
+++ b/usr/src/lib/libdtrace/common/dt_module.c
@@ -22,6 +22,9 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <sys/types.h>
#include <sys/modctl.h>
@@ -418,6 +421,9 @@ static const dt_modops_t dt_modops_64 = {
dt_module_t *
dt_module_create(dtrace_hdl_t *dtp, const char *name)
{
+ long pid;
+ char *eptr;
+ dt_ident_t *idp;
uint_t h = dt_strtab_hash(name, NULL) % dtp->dt_modbuckets;
dt_module_t *dmp;
@@ -441,6 +447,32 @@ dt_module_create(dtrace_hdl_t *dtp, const char *name)
else
dmp->dm_ops = &dt_modops_32;
+ /*
+ * Modules for userland processes are special. They always refer to a
+ * specific process and have a copy of their CTF data from a specific
+ * instant in time. Any dt_module_t that begins with 'pid' is a module
+ * for a specific process, much like how any probe description that
+ * begins with 'pid' is special. pid123 refers to process 123. A module
+ * that is just 'pid' refers specifically to pid$target. This is
+ * generally done as D does not currently allow for macros to be
+ * evaluated when working with types.
+ */
+ if (strncmp(dmp->dm_name, "pid", 3) == 0) {
+ errno = 0;
+ if (dmp->dm_name[3] == '\0') {
+ idp = dt_idhash_lookup(dtp->dt_macros, "target");
+ if (idp != NULL && idp->di_id != 0)
+ dmp->dm_pid = idp->di_id;
+ } else {
+ pid = strtol(dmp->dm_name + 3, &eptr, 10);
+ if (errno == 0 && *eptr == '\0')
+ dmp->dm_pid = (pid_t)pid;
+ else
+ dt_dprintf("encountered malformed pid "
+ "module: %s\n", dmp->dm_name);
+ }
+ }
+
return (dmp);
}
@@ -504,12 +536,169 @@ dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp)
return (0);
}
+typedef struct dt_module_cb_arg {
+ struct ps_prochandle *dpa_proc;
+ dtrace_hdl_t *dpa_dtp;
+ dt_module_t *dpa_dmp;
+ uint_t dpa_count;
+} dt_module_cb_arg_t;
+
+/* ARGSUSED */
+static int
+dt_module_load_proc_count(void *arg, const prmap_t *prmap, const char *obj)
+{
+ ctf_file_t *fp;
+ dt_module_cb_arg_t *dcp = arg;
+
+ /* Try to grab a ctf container if it exists */
+ fp = Pname_to_ctf(dcp->dpa_proc, obj);
+ if (fp != NULL)
+ dcp->dpa_count++;
+ return (0);
+}
+
+/* ARGSUSED */
+static int
+dt_module_load_proc_build(void *arg, const prmap_t *prmap, const char *obj)
+{
+ ctf_file_t *fp;
+ char buf[MAXPATHLEN], *p;
+ dt_module_cb_arg_t *dcp = arg;
+ int count = dcp->dpa_count;
+ Lmid_t lmid;
+
+ fp = Pname_to_ctf(dcp->dpa_proc, obj);
+ if (fp == NULL)
+ return (0);
+ fp = ctf_dup(fp);
+ if (fp == NULL)
+ return (0);
+ dcp->dpa_dmp->dm_libctfp[count] = fp;
+ /*
+ * While it'd be nice to simply use objname here, because of our prior
+ * actions we'll always get a resolved object name to its on disk file.
+ * Like the pid provider, we need to tell a bit of a lie here. The type
+ * that the user thinks of is in terms of the libraries they requested,
+ * eg. libc.so.1, they don't care about the fact that it's
+ * libc_hwcap.so.1.
+ */
+ (void) Pobjname(dcp->dpa_proc, prmap->pr_vaddr, buf, sizeof (buf));
+ if ((p = strrchr(buf, '/')) == NULL)
+ p = buf;
+ else
+ p++;
+
+ /*
+ * If for some reason we can't find a link map id for this module, which
+ * would be really quite weird. We instead just say the link map id is
+ * zero.
+ */
+ if (Plmid(dcp->dpa_proc, prmap->pr_vaddr, &lmid) != 0)
+ lmid = 0;
+
+ if (lmid == 0)
+ dcp->dpa_dmp->dm_libctfn[count] = strdup(p);
+ else
+ (void) asprintf(&dcp->dpa_dmp->dm_libctfn[count],
+ "LM%lx`%s", lmid, p);
+ if (dcp->dpa_dmp->dm_libctfn[count] == NULL)
+ return (1);
+ ctf_setspecific(fp, dcp->dpa_dmp);
+ dcp->dpa_count++;
+ return (0);
+}
+
+/*
+ * We've been asked to load data that belongs to another process. As such we're
+ * going to pgrab it at this instant, load everything that we might ever care
+ * about, and then drive on. The reason for this is that the process that we're
+ * interested in might be changing. As long as we have grabbed it, then this
+ * can't be a problem for us.
+ *
+ * For now, we're actually going to punt on most things and just try to get CTF
+ * data, nothing else. Basically this is only useful as a source of type
+ * information, we can't go and do the stacktrace lookups, etc.
+ */
+static int
+dt_module_load_proc(dtrace_hdl_t *dtp, dt_module_t *dmp)
+{
+ struct ps_prochandle *p;
+ dt_module_cb_arg_t arg;
+
+ /*
+ * Note that on success we do not release this hold. We must hold this
+ * for our life time.
+ */
+ p = dt_proc_grab(dtp, dmp->dm_pid, 0, PGRAB_RDONLY | PGRAB_FORCE);
+ if (p == NULL) {
+ dt_dprintf("failed to grab pid: %d\n", (int)dmp->dm_pid);
+ return (dt_set_errno(dtp, EDT_CANTLOAD));
+ }
+ dt_proc_lock(dtp, p);
+
+ arg.dpa_proc = p;
+ arg.dpa_dtp = dtp;
+ arg.dpa_dmp = dmp;
+ arg.dpa_count = 0;
+ if (Pobject_iter_resolved(p, dt_module_load_proc_count, &arg) != 0) {
+ dt_dprintf("failed to iterate objects\n");
+ dt_proc_release(dtp, p);
+ return (dt_set_errno(dtp, EDT_CANTLOAD));
+ }
+
+ if (arg.dpa_count == 0) {
+ dt_dprintf("no ctf data present\n");
+ dt_proc_unlock(dtp, p);
+ dt_proc_release(dtp, p);
+ return (dt_set_errno(dtp, EDT_CANTLOAD));
+ }
+
+ dmp->dm_libctfp = malloc(sizeof (ctf_file_t *) * arg.dpa_count);
+ if (dmp->dm_libctfp == NULL) {
+ dt_proc_unlock(dtp, p);
+ dt_proc_release(dtp, p);
+ return (dt_set_errno(dtp, EDT_NOMEM));
+ }
+ bzero(dmp->dm_libctfp, sizeof (ctf_file_t *) * arg.dpa_count);
+
+ dmp->dm_libctfn = malloc(sizeof (char *) * arg.dpa_count);
+ if (dmp->dm_libctfn == NULL) {
+ free(dmp->dm_libctfp);
+ dt_proc_unlock(dtp, p);
+ dt_proc_release(dtp, p);
+ return (dt_set_errno(dtp, EDT_NOMEM));
+ }
+ bzero(dmp->dm_libctfn, sizeof (char *) * arg.dpa_count);
+
+ dmp->dm_nctflibs = arg.dpa_count;
+
+ arg.dpa_count = 0;
+ if (Pobject_iter_resolved(p, dt_module_load_proc_build, &arg) != 0) {
+ dt_proc_unlock(dtp, p);
+ dt_module_unload(dtp, dmp);
+ dt_proc_release(dtp, p);
+ return (dt_set_errno(dtp, EDT_CANTLOAD));
+ }
+ assert(arg.dpa_count == dmp->dm_nctflibs);
+ dt_dprintf("loaded %d ctf modules for pid %d\n", arg.dpa_count,
+ (int)dmp->dm_pid);
+
+ dt_proc_unlock(dtp, p);
+ dt_proc_release(dtp, p);
+ dmp->dm_flags |= DT_DM_LOADED;
+
+ return (0);
+}
+
int
dt_module_load(dtrace_hdl_t *dtp, dt_module_t *dmp)
{
if (dmp->dm_flags & DT_DM_LOADED)
return (0); /* module is already loaded */
+ if (dmp->dm_pid != 0)
+ return (dt_module_load_proc(dtp, dmp));
+
dmp->dm_ctdata.cts_name = ".SUNW_ctf";
dmp->dm_ctdata.cts_type = SHT_PROGBITS;
dmp->dm_ctdata.cts_flags = 0;
@@ -595,6 +784,14 @@ dt_module_load(dtrace_hdl_t *dtp, dt_module_t *dmp)
return (0);
}
+int
+dt_module_hasctf(dtrace_hdl_t *dtp, dt_module_t *dmp)
+{
+ if (dmp->dm_pid != 0 && dmp->dm_nctflibs > 0)
+ return (1);
+ return (dt_module_getctf(dtp, dmp) != NULL);
+}
+
ctf_file_t *
dt_module_getctf(dtrace_hdl_t *dtp, dt_module_t *dmp)
{
@@ -668,9 +865,22 @@ err:
void
dt_module_unload(dtrace_hdl_t *dtp, dt_module_t *dmp)
{
+ int i;
+
ctf_close(dmp->dm_ctfp);
dmp->dm_ctfp = NULL;
+ if (dmp->dm_libctfp != NULL) {
+ for (i = 0; i < dmp->dm_nctflibs; i++) {
+ ctf_close(dmp->dm_libctfp[i]);
+ free(dmp->dm_libctfn[i]);
+ }
+ free(dmp->dm_libctfp);
+ free(dmp->dm_libctfn);
+ dmp->dm_libctfp = NULL;
+ dmp->dm_nctflibs = 0;
+ }
+
bzero(&dmp->dm_ctdata, sizeof (ctf_sect_t));
bzero(&dmp->dm_symtab, sizeof (ctf_sect_t));
bzero(&dmp->dm_strtab, sizeof (ctf_sect_t));
@@ -711,6 +921,8 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_module_t *dmp)
(void) elf_end(dmp->dm_elf);
dmp->dm_elf = NULL;
+ dmp->dm_pid = 0;
+
dmp->dm_flags &= ~DT_DM_LOADED;
}
@@ -799,6 +1011,34 @@ dt_module_modelname(dt_module_t *dmp)
return ("32-bit");
}
+/* ARGSUSED */
+int
+dt_module_getlibid(dtrace_hdl_t *dtp, dt_module_t *dmp, const ctf_file_t *fp)
+{
+ int i;
+
+ for (i = 0; i < dmp->dm_nctflibs; i++) {
+ if (dmp->dm_libctfp[i] == fp)
+ return (i);
+ }
+
+ return (-1);
+}
+
+/* ARGSUSED */
+ctf_file_t *
+dt_module_getctflib(dtrace_hdl_t *dtp, dt_module_t *dmp, const char *name)
+{
+ int i;
+
+ for (i = 0; i < dmp->dm_nctflibs; i++) {
+ if (strcmp(dmp->dm_libctfn[i], name) == 0)
+ return (dmp->dm_libctfp[i]);
+ }
+
+ return (NULL);
+}
+
/*
* Update our module cache by adding an entry for the specified module 'name'.
* We create the dt_module_t and populate it using /system/object/<name>/.
@@ -1140,8 +1380,10 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp, const char *object, const char *name,
dt_module_t *dmp;
int found = 0;
ctf_id_t id;
- uint_t n;
+ uint_t n, i;
int justone;
+ ctf_file_t *fp;
+ char *buf, *p, *q;
uint_t mask = 0; /* mask of dt_module flags to match */
uint_t bits = 0; /* flag bits that must be present */
@@ -1156,7 +1398,6 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp, const char *object, const char *name,
return (-1); /* dt_errno is set for us */
n = 1;
justone = 1;
-
} else {
if (object == DTRACE_OBJ_KMODS)
mask = bits = DT_DM_KERNEL;
@@ -1180,7 +1421,7 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp, const char *object, const char *name,
* module. If our search was scoped to only one module then
* return immediately leaving dt_errno unmodified.
*/
- if (dt_module_getctf(dtp, dmp) == NULL) {
+ if (dt_module_hasctf(dtp, dmp) == 0) {
if (justone)
return (-1);
continue;
@@ -1192,13 +1433,38 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp, const char *object, const char *name,
* 'tip' and keep going in the hope that we will locate the
* underlying structure definition. Otherwise just return.
*/
- if ((id = ctf_lookup_by_name(dmp->dm_ctfp, name)) != CTF_ERR) {
+ if (dmp->dm_pid == 0) {
+ id = ctf_lookup_by_name(dmp->dm_ctfp, name);
+ fp = dmp->dm_ctfp;
+ } else {
+ if ((p = strchr(name, '`')) != NULL) {
+ buf = strdup(name);
+ if (buf == NULL)
+ return (dt_set_errno(dtp, EDT_NOMEM));
+ p = strchr(buf, '`');
+ if ((q = strchr(p + 1, '`')) != NULL)
+ p = q;
+ *p = '\0';
+ fp = dt_module_getctflib(dtp, dmp, buf);
+ if (fp == NULL || (id = ctf_lookup_by_name(fp,
+ p + 1)) == CTF_ERR)
+ id = CTF_ERR;
+ free(buf);
+ } else {
+ for (i = 0; i < dmp->dm_nctflibs; i++) {
+ fp = dmp->dm_libctfp[i];
+ id = ctf_lookup_by_name(fp, name);
+ if (id != CTF_ERR)
+ break;
+ }
+ }
+ }
+ if (id != CTF_ERR) {
tip->dtt_object = dmp->dm_name;
- tip->dtt_ctfp = dmp->dm_ctfp;
+ tip->dtt_ctfp = fp;
tip->dtt_type = id;
-
- if (ctf_type_kind(dmp->dm_ctfp, ctf_type_resolve(
- dmp->dm_ctfp, id)) != CTF_K_FORWARD)
+ if (ctf_type_kind(fp, ctf_type_resolve(fp, id)) !=
+ CTF_K_FORWARD)
return (0);
found++;
@@ -1220,6 +1486,7 @@ dtrace_symbol_type(dtrace_hdl_t *dtp, const GElf_Sym *symp,
tip->dtt_object = NULL;
tip->dtt_ctfp = NULL;
tip->dtt_type = CTF_ERR;
+ tip->dtt_flags = 0;
if ((dmp = dt_module_lookup_by_name(dtp, sip->dts_object)) == NULL)
return (dt_set_errno(dtp, EDT_NOMOD));
diff --git a/usr/src/lib/libdtrace/common/dt_module.h b/usr/src/lib/libdtrace/common/dt_module.h
index 8334a2bb81..d103e028e4 100644
--- a/usr/src/lib/libdtrace/common/dt_module.h
+++ b/usr/src/lib/libdtrace/common/dt_module.h
@@ -23,12 +23,13 @@
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#ifndef _DT_MODULE_H
#define _DT_MODULE_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <dt_impl.h>
#ifdef __cplusplus
@@ -43,11 +44,16 @@ extern void dt_module_destroy(dtrace_hdl_t *, dt_module_t *);
extern dt_module_t *dt_module_lookup_by_name(dtrace_hdl_t *, const char *);
extern dt_module_t *dt_module_lookup_by_ctf(dtrace_hdl_t *, ctf_file_t *);
+extern int dt_module_hasctf(dtrace_hdl_t *, dt_module_t *);
extern ctf_file_t *dt_module_getctf(dtrace_hdl_t *, dt_module_t *);
extern dt_ident_t *dt_module_extern(dtrace_hdl_t *, dt_module_t *,
const char *, const dtrace_typeinfo_t *);
extern const char *dt_module_modelname(dt_module_t *);
+extern int dt_module_getlibid(dtrace_hdl_t *, dt_module_t *,
+ const ctf_file_t *);
+extern ctf_file_t *dt_module_getctflib(dtrace_hdl_t *, dt_module_t *,
+ const char *);
#ifdef __cplusplus
}
diff --git a/usr/src/lib/libdtrace/common/dt_open.c b/usr/src/lib/libdtrace/common/dt_open.c
index dd83370ee8..72597310a8 100644
--- a/usr/src/lib/libdtrace/common/dt_open.c
+++ b/usr/src/lib/libdtrace/common/dt_open.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -110,9 +110,12 @@
#define DT_VERS_1_8 DT_VERSION_NUMBER(1, 8, 0)
#define DT_VERS_1_8_1 DT_VERSION_NUMBER(1, 8, 1)
#define DT_VERS_1_9 DT_VERSION_NUMBER(1, 9, 0)
-#define DT_VERS_1_9_1 DT_VERSION_NUMBER(1, 9, 1)
-#define DT_VERS_LATEST DT_VERS_1_9_1
-#define DT_VERS_STRING "Sun D 1.9.1"
+#define DT_VERS_1_10 DT_VERSION_NUMBER(1, 10, 0)
+#define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0)
+#define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0)
+#define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1)
+#define DT_VERS_LATEST DT_VERS_1_12_1
+#define DT_VERS_STRING "Sun D 1.12.1"
const dt_version_t _dtrace_versions[] = {
DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
@@ -133,7 +136,10 @@ const dt_version_t _dtrace_versions[] = {
DT_VERS_1_8, /* D API 1.8 */
DT_VERS_1_8_1, /* D API 1.8.1 */
DT_VERS_1_9, /* D API 1.9 */
- DT_VERS_1_9_1, /* D API 1.9.1 */
+ DT_VERS_1_10, /* D API 1.10 */
+ DT_VERS_1_11, /* D API 1.11 */
+ DT_VERS_1_12, /* D API 1.12 */
+ DT_VERS_1_12_1, /* D API 1.12.1 */
0
};
@@ -247,6 +253,8 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_func, "uint64_t(uint64_t)" },
{ "htons", DT_IDENT_FUNC, 0, DIF_SUBR_HTONS, DT_ATTR_EVOLCMN, DT_VERS_1_3,
&dt_idops_func, "uint16_t(uint16_t)" },
+{ "getf", DT_IDENT_FUNC, 0, DIF_SUBR_GETF, DT_ATTR_STABCMN, DT_VERS_1_10,
+ &dt_idops_func, "file_t *(int)" },
{ "gid", DT_IDENT_SCALAR, 0, DIF_VAR_GID, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "gid_t" },
{ "id", DT_IDENT_SCALAR, 0, DIF_VAR_ID, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -261,6 +269,8 @@ static const dt_ident_t _dtrace_globals[] = {
DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
{ "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "uint_t" },
+{ "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11,
+ &dt_idops_func, "string(const char *, const char *)" },
{ "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_func, "stack(...)" },
{ "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -375,6 +385,8 @@ static const dt_ident_t _dtrace_globals[] = {
&dt_idops_func, "string(const char *, const char *)" },
{ "strtok", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOK, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, const char *)" },
+{ "strtoll", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOLL, DT_ATTR_STABCMN, DT_VERS_1_11,
+ &dt_idops_func, "int64_t(const char *, [int])" },
{ "substr", DT_IDENT_FUNC, 0, DIF_SUBR_SUBSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
&dt_idops_func, "string(const char *, int, [int])" },
{ "sum", DT_IDENT_AGGFUNC, 0, DTRACEAGG_SUM, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -928,6 +940,7 @@ alloc:
dtp->dt_linktype = DT_LTYP_ELF;
dtp->dt_xlatemode = DT_XL_STATIC;
dtp->dt_stdcmode = DT_STDC_XA;
+ dtp->dt_encoding = DT_ENCODING_UNSET;
dtp->dt_version = version;
dtp->dt_fd = dtfd;
dtp->dt_ftfd = ftfd;
diff --git a/usr/src/lib/libdtrace/common/dt_options.c b/usr/src/lib/libdtrace/common/dt_options.c
index cc3ae7b9d3..be985d6dab 100644
--- a/usr/src/lib/libdtrace/common/dt_options.c
+++ b/usr/src/lib/libdtrace/common/dt_options.c
@@ -25,6 +25,7 @@
*/
/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -40,6 +41,8 @@
#include <alloca.h>
#include <errno.h>
#include <fcntl.h>
+#include <zone.h>
+#include <libzonecfg.h>
#include <dt_impl.h>
#include <dt_string.h>
@@ -336,6 +339,23 @@ dt_opt_linktype(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
/*ARGSUSED*/
static int
+dt_opt_encoding(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
+{
+ if (arg == NULL)
+ return (dt_set_errno(dtp, EDT_BADOPTVAL));
+
+ if (strcmp(arg, "ascii") == 0)
+ dtp->dt_encoding = DT_ENCODING_ASCII;
+ else if (strcmp(arg, "utf8") == 0)
+ dtp->dt_encoding = DT_ENCODING_UTF8;
+ else
+ return (dt_set_errno(dtp, EDT_BADOPTVAL));
+
+ return (0);
+}
+
+/*ARGSUSED*/
+static int
dt_opt_evaltime(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
{
if (arg == NULL)
@@ -836,6 +856,44 @@ dt_opt_bufresize(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
return (0);
}
+/*ARGSUSED*/
+static int
+dt_opt_zone(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
+{
+ zoneid_t z, did;
+
+ if (arg == NULL)
+ return (dt_set_errno(dtp, EDT_BADOPTVAL));
+
+ /*
+ * If the specified zone is currently running, we'll query the kernel
+ * for its debugger ID. If it doesn't appear to be running, we'll look
+ * for it for among all installed zones (thereby allowing a zdefs
+ * enabling against a halted zone).
+ */
+ if ((z = getzoneidbyname(arg)) != -1) {
+ if (zone_getattr(z, ZONE_ATTR_DID, &did, sizeof (did)) < 0)
+ return (dt_set_errno(dtp, EDT_BADOPTVAL));
+ } else {
+ zone_dochandle_t handle;
+
+ if ((handle = zonecfg_init_handle()) == NULL)
+ return (dt_set_errno(dtp, errno));
+
+ if (zonecfg_get_handle(arg, handle) != Z_OK) {
+ zonecfg_fini_handle(handle);
+ return (dt_set_errno(dtp, EDT_BADOPTVAL));
+ }
+
+ did = zonecfg_get_did(handle);
+ zonecfg_fini_handle(handle);
+ }
+
+ dtp->dt_options[DTRACEOPT_ZONE] = did;
+
+ return (0);
+}
+
int
dt_options_load(dtrace_hdl_t *dtp)
{
@@ -917,6 +975,7 @@ static const dt_option_t _dtrace_ctoptions[] = {
{ "define", dt_opt_cpp_opts, (uintptr_t)"-D" },
{ "droptags", dt_opt_droptags },
{ "empty", dt_opt_cflags, DTRACE_C_EMPTY },
+ { "encoding", dt_opt_encoding },
{ "errtags", dt_opt_cflags, DTRACE_C_ETAGS },
{ "evaltime", dt_opt_evaltime },
{ "incdir", dt_opt_cpp_opts, (uintptr_t)"-I" },
@@ -969,6 +1028,7 @@ static const dt_option_t _dtrace_rtoptions[] = {
{ "statusrate", dt_opt_rate, DTRACEOPT_STATUSRATE },
{ "strsize", dt_opt_strsize, DTRACEOPT_STRSIZE },
{ "ustackframes", dt_opt_runtime, DTRACEOPT_USTACKFRAMES },
+ { "zone", dt_opt_zone, DTRACEOPT_ZONE },
{ "temporal", dt_opt_runtime, DTRACEOPT_TEMPORAL },
{ NULL }
};
@@ -977,11 +1037,14 @@ static const dt_option_t _dtrace_rtoptions[] = {
* Dynamic run-time options.
*/
static const dt_option_t _dtrace_drtoptions[] = {
+ { "agghist", dt_opt_runtime, DTRACEOPT_AGGHIST },
+ { "aggpack", dt_opt_runtime, DTRACEOPT_AGGPACK },
{ "aggrate", dt_opt_rate, DTRACEOPT_AGGRATE },
{ "aggsortkey", dt_opt_runtime, DTRACEOPT_AGGSORTKEY },
{ "aggsortkeypos", dt_opt_runtime, DTRACEOPT_AGGSORTKEYPOS },
{ "aggsortpos", dt_opt_runtime, DTRACEOPT_AGGSORTPOS },
{ "aggsortrev", dt_opt_runtime, DTRACEOPT_AGGSORTREV },
+ { "aggzoom", dt_opt_runtime, DTRACEOPT_AGGZOOM },
{ "flowindent", dt_opt_runtime, DTRACEOPT_FLOWINDENT },
{ "quiet", dt_opt_runtime, DTRACEOPT_QUIET },
{ "rawbytes", dt_opt_runtime, DTRACEOPT_RAWBYTES },
@@ -1046,9 +1109,41 @@ dtrace_setopt(dtrace_hdl_t *dtp, const char *opt, const char *val)
if (dtp->dt_active)
return (dt_set_errno(dtp, EDT_ACTIVE));
+ /*
+ * If our options had been previously ioctl'd down,
+ * clear dt_optset to indicate that a run-time option
+ * has since been set.
+ */
+ dtp->dt_optset = B_FALSE;
+
return (op->o_func(dtp, val, op->o_option));
}
}
return (dt_set_errno(dtp, EDT_BADOPTNAME));
}
+
+int
+dtrace_setopts(dtrace_hdl_t *dtp)
+{
+ void *dof;
+ int err;
+
+ if (dtp->dt_optset)
+ return (0);
+
+ if ((dof = dtrace_getopt_dof(dtp)) == NULL)
+ return (-1); /* dt_errno has been set for us */
+
+ if ((err = dt_ioctl(dtp, DTRACEIOC_ENABLE, dof)) == -1)
+ (void) dt_set_errno(dtp, errno);
+
+ dtrace_dof_destroy(dtp, dof);
+
+ if (err == -1)
+ return (-1);
+
+ dtp->dt_optset = B_TRUE;
+
+ return (0);
+}
diff --git a/usr/src/lib/libdtrace/common/dt_parser.c b/usr/src/lib/libdtrace/common/dt_parser.c
index 6f837c4bed..753009f857 100644
--- a/usr/src/lib/libdtrace/common/dt_parser.c
+++ b/usr/src/lib/libdtrace/common/dt_parser.c
@@ -21,8 +21,8 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
/*
@@ -192,7 +192,7 @@ dt_type_lookup(const char *s, dtrace_typeinfo_t *tip)
{
static const char delimiters[] = " \t\n\r\v\f*`";
dtrace_hdl_t *dtp = yypcb->pcb_hdl;
- const char *p, *q, *end, *obj;
+ const char *p, *q, *r, *end, *obj;
for (p = s, end = s + strlen(s); *p != '\0'; p = q) {
while (isspace(*p))
@@ -220,8 +220,23 @@ dt_type_lookup(const char *s, dtrace_typeinfo_t *tip)
bcopy(s, type, (size_t)(p - s));
bcopy(q + 1, type + (size_t)(p - s), strlen(q + 1) + 1);
- if (strchr(q + 1, '`') != NULL)
- return (dt_set_errno(dtp, EDT_BADSCOPE));
+ /*
+ * There may be at most three delimeters. The second
+ * delimeter is usually used to distinguish the type
+ * within a given module, however, there could be a link
+ * map id on the scene in which case that delimeter
+ * would be the third. We determine presence of the lmid
+ * if it rouglhly meets the from LM[0-9]
+ */
+ if ((r = strchr(q + 1, '`')) != NULL &&
+ ((r = strchr(r + 1, '`')) != NULL)) {
+ if (strchr(r + 1, '`') != NULL)
+ return (dt_set_errno(dtp,
+ EDT_BADSCOPE));
+ if (q[1] != 'L' || q[2] != 'M')
+ return (dt_set_errno(dtp,
+ EDT_BADSCOPE));
+ }
return (dtrace_lookup_by_type(dtp, object, type, tip));
}
@@ -251,6 +266,7 @@ dt_type_pointer(dtrace_typeinfo_t *tip)
ctf_file_t *ctfp = tip->dtt_ctfp;
ctf_id_t type = tip->dtt_type;
ctf_id_t base = ctf_type_resolve(ctfp, type);
+ uint_t bflags = tip->dtt_flags;
dt_module_t *dmp;
ctf_id_t ptr;
@@ -282,6 +298,7 @@ dt_type_pointer(dtrace_typeinfo_t *tip)
tip->dtt_object = dmp->dm_name;
tip->dtt_ctfp = dmp->dm_ctfp;
tip->dtt_type = ptr;
+ tip->dtt_flags = bflags;
return (0);
}
@@ -385,7 +402,7 @@ void
dt_node_promote(dt_node_t *lp, dt_node_t *rp, dt_node_t *dnp)
{
dt_type_promote(lp, rp, &dnp->dn_ctfp, &dnp->dn_type);
- dt_node_type_assign(dnp, dnp->dn_ctfp, dnp->dn_type);
+ dt_node_type_assign(dnp, dnp->dn_ctfp, dnp->dn_type, B_FALSE);
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
}
@@ -654,7 +671,8 @@ dt_node_attr_assign(dt_node_t *dnp, dtrace_attribute_t attr)
}
void
-dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type)
+dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type,
+ boolean_t user)
{
ctf_id_t base = ctf_type_resolve(fp, type);
uint_t kind = ctf_type_kind(fp, base);
@@ -686,6 +704,9 @@ dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type)
type == DT_DYN_TYPE(yypcb->pcb_hdl))
dnp->dn_flags |= DT_NF_REF;
+ if (user)
+ dnp->dn_flags |= DT_NF_USERLAND;
+
dnp->dn_flags |= DT_NF_COOKED;
dnp->dn_ctfp = fp;
dnp->dn_type = type;
@@ -723,6 +744,7 @@ size_t
dt_node_type_size(const dt_node_t *dnp)
{
ctf_id_t base;
+ dtrace_hdl_t *dtp = yypcb->pcb_hdl;
if (dnp->dn_kind == DT_NODE_STRING)
return (strlen(dnp->dn_string) + 1);
@@ -735,6 +757,20 @@ dt_node_type_size(const dt_node_t *dnp)
if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD)
return (0);
+ /*
+ * Here we have a 32-bit user pointer that is being used with a 64-bit
+ * kernel. When we're using it and its tagged as a userland reference --
+ * then we need to keep it as a 32-bit pointer. However, if we are
+ * referring to it as a kernel address, eg. being used after a copyin()
+ * then we need to make sure that we actually return the kernel's size
+ * of a pointer, 8 bytes.
+ */
+ if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_POINTER &&
+ ctf_getmodel(dnp->dn_ctfp) == CTF_MODEL_ILP32 &&
+ !(dnp->dn_flags & DT_NF_USERLAND) &&
+ dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64)
+ return (8);
+
return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type));
}
@@ -1221,7 +1257,7 @@ dt_node_int(uintmax_t value)
if (value <= dtp->dt_ints[i].did_limit) {
dt_node_type_assign(dnp,
dtp->dt_ints[i].did_ctfp,
- dtp->dt_ints[i].did_type);
+ dtp->dt_ints[i].did_type, B_FALSE);
/*
* If a prefix character is present in macro text, add
@@ -1256,7 +1292,7 @@ dt_node_string(char *string)
dnp = dt_node_alloc(DT_NODE_STRING);
dnp->dn_op = DT_TOK_STRING;
dnp->dn_string = string;
- dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp), B_FALSE);
return (dnp);
}
@@ -1332,7 +1368,8 @@ dt_node_type(dt_decl_t *ddp)
dnp = dt_node_alloc(DT_NODE_TYPE);
dnp->dn_op = DT_TOK_IDENT;
dnp->dn_string = name;
- dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
+
+ dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, dtt.dtt_flags);
if (dtt.dtt_ctfp == dtp->dt_cdefs->dm_ctfp ||
dtt.dtt_ctfp == dtp->dt_ddefs->dm_ctfp)
@@ -1576,7 +1613,8 @@ dt_node_decl(void)
bzero(&idn, sizeof (dt_node_t));
if (idp != NULL && idp->di_type != CTF_ERR)
- dt_node_type_assign(&idn, idp->di_ctfp, idp->di_type);
+ dt_node_type_assign(&idn, idp->di_ctfp, idp->di_type,
+ B_FALSE);
else if (idp != NULL)
(void) dt_ident_cook(&idn, idp, NULL);
@@ -1785,7 +1823,7 @@ dt_node_offsetof(dt_decl_t *ddp, char *s)
}
bzero(&dn, sizeof (dn));
- dt_node_type_assign(&dn, dtt.dtt_ctfp, ctm.ctm_type);
+ dt_node_type_assign(&dn, dtt.dtt_ctfp, ctm.ctm_type, B_FALSE);
if (dn.dn_flags & DT_NF_BITFIELD) {
xyerror(D_OFFSETOF_BITFIELD,
@@ -1841,7 +1879,8 @@ dt_node_op1(int op, dt_node_t *cp)
}
dt_node_type_assign(cp, dtp->dt_ddefs->dm_ctfp,
- ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"));
+ ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"),
+ B_FALSE);
cp->dn_kind = DT_NODE_INT;
cp->dn_op = DT_TOK_INT;
@@ -1919,17 +1958,17 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
case DT_TOK_LOR:
dnp->dn_value = l || r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_LXOR:
dnp->dn_value = (l != 0) ^ (r != 0);
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_LAND:
dnp->dn_value = l && r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_BOR:
dnp->dn_value = l | r;
@@ -1946,12 +1985,12 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
case DT_TOK_EQU:
dnp->dn_value = l == r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_NEQ:
dnp->dn_value = l != r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_LT:
dt_node_promote(lp, rp, dnp);
@@ -1960,7 +1999,7 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
else
dnp->dn_value = l < r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_LE:
dt_node_promote(lp, rp, dnp);
@@ -1969,7 +2008,7 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
else
dnp->dn_value = l <= r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_GT:
dt_node_promote(lp, rp, dnp);
@@ -1978,7 +2017,7 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
else
dnp->dn_value = l > r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_GE:
dt_node_promote(lp, rp, dnp);
@@ -1987,7 +2026,7 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
else
dnp->dn_value = l >= r;
dt_node_type_assign(dnp,
- DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
break;
case DT_TOK_LSH:
dnp->dn_value = l << r;
@@ -2228,7 +2267,7 @@ dt_node_inline(dt_node_t *expr)
* until we have successfully cooked the right-hand expression, below.
*/
dnp = dt_node_alloc(DT_NODE_INLINE);
- dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
+ dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
dt_node_attr_assign(dnp, _dtrace_defattr);
if (dt_node_is_void(dnp)) {
@@ -2383,7 +2422,8 @@ dt_node_member(dt_decl_t *ddp, char *name, dt_node_t *expr)
dnp->dn_membexpr = expr;
if (ddp != NULL)
- dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
+ dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
+ dtt.dtt_flags);
return (dnp);
}
@@ -2414,10 +2454,10 @@ dt_node_xlator(dt_decl_t *ddp, dt_decl_t *sdp, char *name, dt_node_t *members)
}
bzero(&sn, sizeof (sn));
- dt_node_type_assign(&sn, src.dtt_ctfp, src.dtt_type);
+ dt_node_type_assign(&sn, src.dtt_ctfp, src.dtt_type, B_FALSE);
bzero(&dn, sizeof (dn));
- dt_node_type_assign(&dn, dst.dtt_ctfp, dst.dtt_type);
+ dt_node_type_assign(&dn, dst.dtt_ctfp, dst.dtt_type, B_FALSE);
if (dt_xlator_lookup(dtp, &sn, &dn, DT_XLATE_EXACT) != NULL) {
xyerror(D_XLATE_REDECL,
@@ -2663,7 +2703,7 @@ dt_xcook_ident(dt_node_t *dnp, dt_idhash_t *dhp, uint_t idkind, int create)
attr = dt_ident_cook(dnp, idp, NULL);
else {
dt_node_type_assign(dnp,
- DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+ DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
attr = idp->di_attr;
}
@@ -2739,7 +2779,8 @@ dt_xcook_ident(dt_node_t *dnp, dt_idhash_t *dhp, uint_t idkind, int create)
dnp->dn_ident = idp;
dnp->dn_flags |= DT_NF_LVALUE;
- dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
+ dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
+ dtt.dtt_flags);
dt_node_attr_assign(dnp, _dtrace_symattr);
if (uref) {
@@ -2787,7 +2828,7 @@ dt_xcook_ident(dt_node_t *dnp, dt_idhash_t *dhp, uint_t idkind, int create)
attr = dt_ident_cook(dnp, idp, NULL);
else {
dt_node_type_assign(dnp,
- DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+ DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
attr = idp->di_attr;
}
@@ -2890,7 +2931,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
xyerror(D_TYPE_ERR, "failed to lookup int64_t\n");
dt_ident_type_assign(cp->dn_ident, dtt.dtt_ctfp, dtt.dtt_type);
- dt_node_type_assign(cp, dtt.dtt_ctfp, dtt.dtt_type);
+ dt_node_type_assign(cp, dtt.dtt_ctfp, dtt.dtt_type,
+ dtt.dtt_flags);
}
if (cp->dn_kind == DT_NODE_VAR)
@@ -2907,7 +2949,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
dnp->dn_ident = &dxp->dx_souid;
dt_node_type_assign(dnp,
- dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type);
+ dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type,
+ cp->dn_flags & DT_NF_USERLAND);
break;
}
@@ -2927,7 +2970,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
"cannot dereference non-pointer type\n");
}
- dt_node_type_assign(dnp, cp->dn_ctfp, type);
+ dt_node_type_assign(dnp, cp->dn_ctfp, type,
+ cp->dn_flags & DT_NF_USERLAND);
base = ctf_type_resolve(cp->dn_ctfp, type);
kind = ctf_type_kind(cp->dn_ctfp, base);
@@ -2984,7 +3028,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
xyerror(D_OP_SCALAR, "operator %s requires an operand "
"of scalar type\n", opstr(dnp->dn_op));
}
- dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
+ B_FALSE);
break;
case DT_TOK_ADDROF:
@@ -3017,10 +3062,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
dt_node_type_name(cp, n, sizeof (n)));
}
- dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
-
- if (cp->dn_flags & DT_NF_USERLAND)
- dnp->dn_flags |= DT_NF_USERLAND;
+ dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
+ cp->dn_flags & DT_NF_USERLAND);
break;
case DT_TOK_SIZEOF:
@@ -3035,7 +3078,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
}
dt_node_type_assign(dnp, dtp->dt_ddefs->dm_ctfp,
- ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"));
+ ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"),
+ B_FALSE);
break;
case DT_TOK_STRINGOF:
@@ -3045,7 +3089,8 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
"cannot apply stringof to a value of type %s\n",
dt_node_type_name(cp, n, sizeof (n)));
}
- dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp),
+ cp->dn_flags & DT_NF_USERLAND);
break;
case DT_TOK_PREINC:
@@ -3238,7 +3283,8 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
"of scalar type\n", opstr(op));
}
- dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
+ B_FALSE);
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
break;
@@ -3282,7 +3328,8 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
rp->dn_op = DT_TOK_INT;
rp->dn_value = (intmax_t)val;
- dt_node_type_assign(rp, lp->dn_ctfp, lp->dn_type);
+ dt_node_type_assign(rp, lp->dn_ctfp, lp->dn_type,
+ B_FALSE);
dt_node_attr_assign(rp, _dtrace_symattr);
}
@@ -3314,7 +3361,8 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
dt_node_type_name(rp, n2, sizeof (n2)));
}
- dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
+ B_FALSE);
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
break;
@@ -3362,7 +3410,7 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
dt_node_type_name(rp, n2, sizeof (n2)));
}
- dt_node_type_assign(dnp, ctfp, type);
+ dt_node_type_assign(dnp, ctfp, type, B_FALSE);
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
if (uref)
@@ -3503,7 +3551,7 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
*/
if (lp->dn_kind == DT_NODE_VAR &&
dt_ident_unref(lp->dn_ident)) {
- dt_node_type_assign(lp, ctfp, type);
+ dt_node_type_assign(lp, ctfp, type, B_FALSE);
dt_ident_type_assign(lp->dn_ident, ctfp, type);
if (uref) {
@@ -3717,7 +3765,7 @@ asgn_common:
type = ctf_type_resolve(ctfp, m.ctm_type);
kind = ctf_type_kind(ctfp, type);
- dt_node_type_assign(dnp, ctfp, m.ctm_type);
+ dt_node_type_assign(dnp, ctfp, m.ctm_type, B_FALSE);
dt_node_attr_assign(dnp, lp->dn_attr);
if (op == DT_TOK_PTR && (kind != CTF_K_ARRAY ||
@@ -3843,7 +3891,8 @@ asgn_common:
}
dnp->dn_ident = dt_xlator_ident(dxp, lp->dn_ctfp, lp->dn_type);
- dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
+ B_FALSE);
dt_node_attr_assign(dnp,
dt_attr_min(rp->dn_attr, dnp->dn_ident->di_attr));
break;
@@ -4008,7 +4057,7 @@ dt_cook_op3(dt_node_t *dnp, uint_t idflags)
"used in a conditional context\n");
}
- dt_node_type_assign(dnp, ctfp, type);
+ dt_node_type_assign(dnp, ctfp, type, B_FALSE);
dt_node_attr_assign(dnp, dt_attr_min(dnp->dn_expr->dn_attr,
dt_attr_min(lp->dn_attr, rp->dn_attr)));
@@ -4041,7 +4090,8 @@ dt_cook_aggregation(dt_node_t *dnp, uint_t idflags)
dt_node_attr_assign(dnp, dt_ident_cook(dnp,
dnp->dn_ident, &dnp->dn_aggtup));
} else {
- dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
+ B_FALSE);
dt_node_attr_assign(dnp, dnp->dn_ident->di_attr);
}
@@ -4243,7 +4293,8 @@ dt_cook_xlator(dt_node_t *dnp, uint_t idflags)
}
(void) dt_node_cook(mnp, DT_IDFLG_REF);
- dt_node_type_assign(mnp, dxp->dx_dst_ctfp, ctm.ctm_type);
+ dt_node_type_assign(mnp, dxp->dx_dst_ctfp, ctm.ctm_type,
+ B_FALSE);
attr = dt_attr_min(attr, mnp->dn_attr);
if (dt_node_is_argcompat(mnp, mnp->dn_membexpr) == 0) {
@@ -4262,7 +4313,7 @@ dt_cook_xlator(dt_node_t *dnp, uint_t idflags)
dxp->dx_souid.di_attr = attr;
dxp->dx_ptrid.di_attr = attr;
- dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+ dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
dt_node_attr_assign(dnp, _dtrace_defattr);
return (dnp);
@@ -4555,7 +4606,9 @@ dt_node_diftype(dtrace_hdl_t *dtp, const dt_node_t *dnp, dtrace_diftype_t *tp)
ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type));
}
- tp->dtdt_flags = (dnp->dn_flags & DT_NF_REF) ? DIF_TF_BYREF : 0;
+ tp->dtdt_flags = (dnp->dn_flags & DT_NF_REF) ?
+ (dnp->dn_flags & DT_NF_USERLAND) ? DIF_TF_BYUREF :
+ DIF_TF_BYREF : 0;
tp->dtdt_pad = 0;
tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type);
}
diff --git a/usr/src/lib/libdtrace/common/dt_parser.h b/usr/src/lib/libdtrace/common/dt_parser.h
index 6064efb2e6..38f21c9f2e 100644
--- a/usr/src/lib/libdtrace/common/dt_parser.h
+++ b/usr/src/lib/libdtrace/common/dt_parser.h
@@ -22,12 +22,14 @@
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
#ifndef _DT_PARSER_H
#define _DT_PARSER_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/dtrace.h>
@@ -223,7 +225,7 @@ extern void dt_node_list_free(dt_node_t **);
extern void dt_node_link_free(dt_node_t **);
extern void dt_node_attr_assign(dt_node_t *, dtrace_attribute_t);
-extern void dt_node_type_assign(dt_node_t *, ctf_file_t *, ctf_id_t);
+extern void dt_node_type_assign(dt_node_t *, ctf_file_t *, ctf_id_t, boolean_t);
extern void dt_node_type_propagate(const dt_node_t *, dt_node_t *);
extern const char *dt_node_type_name(const dt_node_t *, char *, size_t);
extern size_t dt_node_type_size(const dt_node_t *);
diff --git a/usr/src/lib/libdtrace/common/dt_pid.c b/usr/src/lib/libdtrace/common/dt_pid.c
index 241805154a..881db806f4 100644
--- a/usr/src/lib/libdtrace/common/dt_pid.c
+++ b/usr/src/lib/libdtrace/common/dt_pid.c
@@ -23,6 +23,9 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <assert.h>
#include <strings.h>
@@ -33,11 +36,13 @@
#include <alloca.h>
#include <libgen.h>
#include <stddef.h>
+#include <sys/sysmacros.h>
#include <dt_impl.h>
#include <dt_program.h>
#include <dt_pid.h>
#include <dt_string.h>
+#include <dt_module.h>
typedef struct dt_pid_probe {
dtrace_hdl_t *dpp_dtp;
@@ -755,3 +760,162 @@ dt_pid_create_probes_module(dtrace_hdl_t *dtp, dt_proc_t *dpr)
return (ret);
}
+
+/*
+ * libdtrace has a backroom deal with us to ask us for type information on
+ * behalf of pid provider probes when fasttrap doesn't return any type
+ * information. Instead we'll look up the module and see if there is type
+ * information available. However, if there is no type information available due
+ * to a lack of CTF data, then we want to make sure that DTrace still carries on
+ * in face of that. As such we don't have a meaningful exit code about failure.
+ * We emit information about why we failed to the dtrace debug log so someone
+ * can figure it out by asking nicely for DTRACE_DEBUG.
+ */
+void
+dt_pid_get_types(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp,
+ dtrace_argdesc_t *adp, int *nargs)
+{
+ dt_module_t *dmp;
+ ctf_file_t *fp;
+ ctf_funcinfo_t f;
+ ctf_id_t argv[32];
+ GElf_Sym sym;
+ prsyminfo_t si;
+ struct ps_prochandle *p;
+ int i, args;
+ char buf[DTRACE_ARGTYPELEN];
+ const char *mptr;
+ char *eptr;
+ int ret = 0;
+ int argc = sizeof (argv) / sizeof (ctf_id_t);
+ Lmid_t lmid;
+
+ /* Set up a potential outcome */
+ args = *nargs;
+ *nargs = 0;
+
+ /*
+ * If we don't have an entry or return probe then we can just stop right
+ * now as we don't have arguments for offset probes.
+ */
+ if (strcmp(pdp->dtpd_name, "entry") != 0 &&
+ strcmp(pdp->dtpd_name, "return") != 0)
+ return;
+
+ dmp = dt_module_create(dtp, pdp->dtpd_provider);
+ if (dmp == NULL) {
+ dt_dprintf("failed to find module for %s\n",
+ pdp->dtpd_provider);
+ return;
+ }
+ if (dt_module_load(dtp, dmp) != 0) {
+ dt_dprintf("failed to load module for %s\n",
+ pdp->dtpd_provider);
+ return;
+ }
+
+ /*
+ * We may be working with a module that doesn't have ctf. If that's the
+ * case then we just return now and move on with life.
+ */
+ fp = dt_module_getctflib(dtp, dmp, pdp->dtpd_mod);
+ if (fp == NULL) {
+ dt_dprintf("no ctf container for %s\n",
+ pdp->dtpd_mod);
+ return;
+ }
+ p = dt_proc_grab(dtp, dmp->dm_pid, 0, PGRAB_RDONLY | PGRAB_FORCE);
+ if (p == NULL) {
+ dt_dprintf("failed to grab pid\n");
+ return;
+ }
+ dt_proc_lock(dtp, p);
+
+ /*
+ * Check to see if the D module has a link map ID and separate that out
+ * for properly interrogating libproc.
+ */
+ if ((mptr = strchr(pdp->dtpd_mod, '`')) != NULL) {
+ if (strlen(pdp->dtpd_mod) < 3) {
+ dt_dprintf("found weird modname with linkmap, "
+ "aborting: %s\n", pdp->dtpd_mod);
+ goto out;
+ }
+ if (pdp->dtpd_mod[0] != 'L' || pdp->dtpd_mod[1] != 'M') {
+ dt_dprintf("missing leading 'LM', "
+ "aborting: %s\n", pdp->dtpd_mod);
+ goto out;
+ }
+ errno = 0;
+ lmid = strtol(pdp->dtpd_mod + 2, &eptr, 16);
+ if (errno == ERANGE || eptr != mptr) {
+ dt_dprintf("failed to parse out lmid, aborting: %s\n",
+ pdp->dtpd_mod);
+ goto out;
+ }
+ mptr++;
+ } else {
+ mptr = pdp->dtpd_mod;
+ lmid = 0;
+ }
+
+ if (Pxlookup_by_name(p, lmid, mptr, pdp->dtpd_func,
+ &sym, &si) != 0) {
+ dt_dprintf("failed to find function %s in %s`%s\n",
+ pdp->dtpd_func, pdp->dtpd_provider, pdp->dtpd_mod);
+ goto out;
+ }
+ if (ctf_func_info(fp, si.prs_id, &f) == CTF_ERR) {
+ dt_dprintf("failed to get ctf information for %s in %s`%s\n",
+ pdp->dtpd_func, pdp->dtpd_provider, pdp->dtpd_mod);
+ goto out;
+ }
+
+ (void) snprintf(buf, sizeof (buf), "%s`%s", pdp->dtpd_provider,
+ pdp->dtpd_mod);
+
+ if (strcmp(pdp->dtpd_name, "return") == 0) {
+ if (args < 2)
+ goto out;
+
+ bzero(adp, sizeof (dtrace_argdesc_t));
+ adp->dtargd_ndx = 0;
+ adp->dtargd_id = pdp->dtpd_id;
+ adp->dtargd_mapping = adp->dtargd_ndx;
+ /*
+ * We explicitly leave out the library here, we only care that
+ * it is some int. We are assuming that there is no ctf
+ * container in here that is lying about what an int is.
+ */
+ (void) snprintf(adp->dtargd_native, DTRACE_ARGTYPELEN,
+ "user %s`%s", pdp->dtpd_provider, "int");
+ adp++;
+ bzero(adp, sizeof (dtrace_argdesc_t));
+ adp->dtargd_ndx = 1;
+ adp->dtargd_id = pdp->dtpd_id;
+ adp->dtargd_mapping = adp->dtargd_ndx;
+ ret = snprintf(adp->dtargd_native, DTRACE_ARGTYPELEN,
+ "userland ");
+ (void) ctf_type_qname(fp, f.ctc_return, adp->dtargd_native +
+ ret, DTRACE_ARGTYPELEN - ret, buf);
+ *nargs = 2;
+ } else {
+ if (ctf_func_args(fp, si.prs_id, argc, argv) == CTF_ERR)
+ goto out;
+
+ *nargs = MIN(args, f.ctc_argc);
+ for (i = 0; i < *nargs; i++, adp++) {
+ bzero(adp, sizeof (dtrace_argdesc_t));
+ adp->dtargd_ndx = i;
+ adp->dtargd_id = pdp->dtpd_id;
+ adp->dtargd_mapping = adp->dtargd_ndx;
+ ret = snprintf(adp->dtargd_native, DTRACE_ARGTYPELEN,
+ "userland ");
+ (void) ctf_type_qname(fp, argv[i], adp->dtargd_native +
+ ret, DTRACE_ARGTYPELEN - ret, buf);
+ }
+ }
+out:
+ dt_proc_unlock(dtp, p);
+ dt_proc_release(dtp, p);
+}
diff --git a/usr/src/lib/libdtrace/common/dt_pid.h b/usr/src/lib/libdtrace/common/dt_pid.h
index 886e33d833..4bf39c8645 100644
--- a/usr/src/lib/libdtrace/common/dt_pid.h
+++ b/usr/src/lib/libdtrace/common/dt_pid.h
@@ -24,12 +24,13 @@
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#ifndef _DT_PID_H
#define _DT_PID_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libproc.h>
#include <sys/fasttrap.h>
#include <dt_impl.h>
@@ -57,6 +58,9 @@ extern int dt_pid_create_offset_probe(struct ps_prochandle *, dtrace_hdl_t *,
extern int dt_pid_create_glob_offset_probes(struct ps_prochandle *,
dtrace_hdl_t *, fasttrap_probe_spec_t *, const GElf_Sym *, const char *);
+extern void dt_pid_get_types(dtrace_hdl_t *, const dtrace_probedesc_t *,
+ dtrace_argdesc_t *, int *);
+
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/lib/libdtrace/common/dt_print.c b/usr/src/lib/libdtrace/common/dt_print.c
index e258f9ac54..b71eddbf9d 100644
--- a/usr/src/lib/libdtrace/common/dt_print.c
+++ b/usr/src/lib/libdtrace/common/dt_print.c
@@ -649,12 +649,16 @@ dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename,
dt_printarg_t pa;
ctf_id_t id;
dt_module_t *dmp;
+ ctf_file_t *ctfp;
+ int libid;
/*
* Split the fully-qualified type ID (module`id). This should
* always be the format, but if for some reason we don't find the
* expected value, return 0 to fall back to the generic trace()
- * behavior.
+ * behavior. In the case of userland CTF modules this will actually be
+ * of the format (module`lib`id). This is due to the fact that those
+ * modules have multiple CTF containers which `lib` identifies.
*/
for (s = typename; *s != '\0' && *s != '`'; s++)
;
@@ -665,6 +669,20 @@ dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename,
object = alloca(s - typename + 1);
bcopy(typename, object, s - typename);
object[s - typename] = '\0';
+ dmp = dt_module_lookup_by_name(dtp, object);
+ if (dmp == NULL)
+ return (0);
+
+ if (dmp->dm_pid != 0) {
+ libid = atoi(s + 1);
+ s = strchr(s + 1, '`');
+ if (s == NULL || libid > dmp->dm_nctflibs)
+ return (0);
+ ctfp = dmp->dm_libctfp[libid];
+ } else {
+ ctfp = dt_module_getctf(dtp, dmp);
+ }
+
id = atoi(s + 1);
/*
@@ -672,16 +690,13 @@ dtrace_print(dtrace_hdl_t *dtp, FILE *fp, const char *typename,
* wrong and we can't resolve the ID, bail out and let trace() do the
* work.
*/
- dmp = dt_module_lookup_by_name(dtp, object);
- if (dmp == NULL || ctf_type_kind(dt_module_getctf(dtp, dmp),
- id) == CTF_ERR) {
+ if (ctfp == NULL || ctf_type_kind(ctfp, id) == CTF_ERR)
return (0);
- }
/* setup the print structure and kick off the main print routine */
pa.pa_dtp = dtp;
pa.pa_addr = addr;
- pa.pa_ctfp = dt_module_getctf(dtp, dmp);
+ pa.pa_ctfp = ctfp;
pa.pa_nest = 0;
pa.pa_depth = 0;
pa.pa_file = fp;
diff --git a/usr/src/lib/libdtrace/common/dt_printf.c b/usr/src/lib/libdtrace/common/dt_printf.c
index 8d96bd4c71..7bd91b9f48 100644
--- a/usr/src/lib/libdtrace/common/dt_printf.c
+++ b/usr/src/lib/libdtrace/common/dt_printf.c
@@ -21,8 +21,8 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#include <sys/sysmacros.h>
@@ -1048,7 +1048,7 @@ dt_printf_validate(dt_pfargv_t *pfv, uint_t flags,
xyerror(D_TYPE_ERR, "failed to lookup agg type %s\n", aggtype);
bzero(&aggnode, sizeof (aggnode));
- dt_node_type_assign(&aggnode, dtt.dtt_ctfp, dtt.dtt_type);
+ dt_node_type_assign(&aggnode, dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
for (i = 0, j = 0; i < pfv->pfv_argc; i++, pfd = pfd->pfd_next) {
const dt_pfconv_t *pfc = pfd->pfd_conv;
diff --git a/usr/src/lib/libdtrace/common/dt_program.c b/usr/src/lib/libdtrace/common/dt_program.c
index 7d725bd0af..e4f9d8dd1c 100644
--- a/usr/src/lib/libdtrace/common/dt_program.c
+++ b/usr/src/lib/libdtrace/common/dt_program.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
* Copyright (c) 2011 by Delphix. All rights reserved.
*/
@@ -154,6 +155,14 @@ dtrace_program_exec(dtrace_hdl_t *dtp, dtrace_prog_t *pgp,
void *dof;
int n, err;
+ /*
+ * If we have not yet ioctl'd down our options DOF, we'll do that
+ * before enabling any probes (some options will affect which probes
+ * we match).
+ */
+ if (dtrace_setopts(dtp) != 0)
+ return (-1);
+
dtrace_program_info(dtp, pgp, pip);
if ((dof = dtrace_dof_create(dtp, pgp, DTRACE_D_STRIP)) == NULL)
diff --git a/usr/src/lib/libdtrace/common/dt_provider.c b/usr/src/lib/libdtrace/common/dt_provider.c
index 86e1204e63..ef4b4470d5 100644
--- a/usr/src/lib/libdtrace/common/dt_provider.c
+++ b/usr/src/lib/libdtrace/common/dt_provider.c
@@ -23,8 +23,9 @@
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <sys/types.h>
#include <sys/sysmacros.h>
@@ -41,6 +42,8 @@
#include <dt_module.h>
#include <dt_string.h>
#include <dt_list.h>
+#include <dt_pid.h>
+#include <dtrace.h>
static dt_provider_t *
dt_provider_insert(dtrace_hdl_t *dtp, dt_provider_t *pvp, uint_t h)
@@ -269,6 +272,21 @@ dt_probe_discover(dt_provider_t *pvp, const dtrace_probedesc_t *pdp)
nc++;
/*
+ * The pid provider believes in giving the kernel a break. No reason to
+ * give the kernel all the ctf containers that we're keeping ourselves
+ * just to get it back from it. So if we're coming from a pid provider
+ * probe and the kernel gave us no argument information we'll get some
+ * here. If for some crazy reason the kernel knows about our userland
+ * types then we just ignore this.
+ */
+ if (xc == 0 && nc == 0 &&
+ strncmp(pvp->pv_desc.dtvd_name, "pid", 3) == 0) {
+ nc = adc;
+ dt_pid_get_types(dtp, pdp, adv, &nc);
+ xc = nc;
+ }
+
+ /*
* Now that we have discovered the number of native and translated
* arguments from the argument descriptions, allocate a new probe ident
* and corresponding dt_probe_t and hash it into the provider.
@@ -314,7 +332,8 @@ dt_probe_discover(dt_provider_t *pvp, const dtrace_probedesc_t *pdp)
dtt.dtt_type = CTF_ERR;
} else {
dt_node_type_assign(prp->pr_nargv[adp->dtargd_mapping],
- dtt.dtt_ctfp, dtt.dtt_type);
+ dtt.dtt_ctfp, dtt.dtt_type,
+ dtt.dtt_flags & DTT_FL_USER ? B_TRUE : B_FALSE);
}
if (dtt.dtt_type != CTF_ERR && (adp->dtargd_xlate[0] == '\0' ||
@@ -333,7 +352,7 @@ dt_probe_discover(dt_provider_t *pvp, const dtrace_probedesc_t *pdp)
dtt.dtt_type = CTF_ERR;
} else {
dt_node_type_assign(prp->pr_xargv[i],
- dtt.dtt_ctfp, dtt.dtt_type);
+ dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
}
prp->pr_mapping[i] = adp->dtargd_mapping;
@@ -634,7 +653,7 @@ dt_probe_tag(dt_probe_t *prp, uint_t argn, dt_node_t *dnp)
bzero(dnp, sizeof (dt_node_t));
dnp->dn_kind = DT_NODE_TYPE;
- dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
+ dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
dt_node_attr_assign(dnp, _dtrace_defattr);
return (dnp);
diff --git a/usr/src/lib/libdtrace/common/dt_work.c b/usr/src/lib/libdtrace/common/dt_work.c
index 97a7f62d69..c330394027 100644
--- a/usr/src/lib/libdtrace/common/dt_work.c
+++ b/usr/src/lib/libdtrace/common/dt_work.c
@@ -25,7 +25,9 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
#include <dt_impl.h>
#include <stddef.h>
@@ -164,13 +166,22 @@ dtrace_status(dtrace_hdl_t *dtp)
int
dtrace_go(dtrace_hdl_t *dtp)
{
- void *dof;
- int err;
-
if (dtp->dt_active)
return (dt_set_errno(dtp, EINVAL));
/*
+ * In most cases, we will have already ioctl'd down our options DOF
+ * by this point -- but if a libdtrace does a dtrace_setopt() after
+ * calling dtrace_program_exec() but before calling dtrace_go(),
+ * dt_optset will be cleared and we need to ioctl down the options
+ * DOF now.
+ */
+ if (dtrace_setopts(dtp) != 0 &&
+ (dtp->dt_errno != ENOTTY || dtp->dt_vector == NULL)) {
+ return (-1);
+ }
+
+ /*
* If a dtrace:::ERROR program and callback are registered, enable the
* program before we start tracing. If this fails for a vector open
* with ENOTTY, we permit dtrace_go() to succeed so that vector clients
@@ -178,19 +189,10 @@ dtrace_go(dtrace_hdl_t *dtp)
* though they do not provide support for the DTRACEIOC_ENABLE ioctl.
*/
if (dtp->dt_errprog != NULL &&
- dtrace_program_exec(dtp, dtp->dt_errprog, NULL) == -1 && (
- dtp->dt_errno != ENOTTY || dtp->dt_vector == NULL))
- return (-1); /* dt_errno has been set for us */
-
- if ((dof = dtrace_getopt_dof(dtp)) == NULL)
+ dtrace_program_exec(dtp, dtp->dt_errprog, NULL) == -1 &&
+ (dtp->dt_errno != ENOTTY || dtp->dt_vector == NULL))
return (-1); /* dt_errno has been set for us */
- err = dt_ioctl(dtp, DTRACEIOC_ENABLE, dof);
- dtrace_dof_destroy(dtp, dof);
-
- if (err == -1 && (errno != ENOTTY || dtp->dt_vector == NULL))
- return (dt_set_errno(dtp, errno));
-
if (dt_ioctl(dtp, DTRACEIOC_GO, &dtp->dt_beganon) == -1) {
if (errno == EACCES)
return (dt_set_errno(dtp, EDT_DESTRUCTIVE));
diff --git a/usr/src/lib/libdtrace/common/dt_xlator.c b/usr/src/lib/libdtrace/common/dt_xlator.c
index 7ac0cc42f5..74bd487861 100644
--- a/usr/src/lib/libdtrace/common/dt_xlator.c
+++ b/usr/src/lib/libdtrace/common/dt_xlator.c
@@ -23,8 +23,10 @@
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
#include <strings.h>
#include <assert.h>
@@ -69,7 +71,7 @@ dt_xlator_create_member(const char *name, ctf_id_t type, ulong_t off, void *arg)
enp->dn_op = DT_TOK_XLATE;
enp->dn_xlator = dxp;
enp->dn_xmember = mnp;
- dt_node_type_assign(enp, dxp->dx_dst_ctfp, type);
+ dt_node_type_assign(enp, dxp->dx_dst_ctfp, type, B_FALSE);
/*
* For the member itself, we use a DT_NODE_MEMBER as usual with the
@@ -83,7 +85,7 @@ dt_xlator_create_member(const char *name, ctf_id_t type, ulong_t off, void *arg)
mnp->dn_membname = strdup(name);
mnp->dn_membexpr = enp;
- dt_node_type_assign(mnp, dxp->dx_dst_ctfp, type);
+ dt_node_type_assign(mnp, dxp->dx_dst_ctfp, type, B_FALSE);
if (mnp->dn_membname == NULL)
return (dt_set_errno(dtp, EDT_NOMEM));
@@ -318,7 +320,8 @@ dt_xlator_lookup(dtrace_hdl_t *dtp, dt_node_t *src, dt_node_t *dst, int flags)
for (dxp = dt_list_next(&dtp->dt_xlators); dxp != NULL;
dxp = dt_list_next(dxp)) {
- dt_node_type_assign(&xn, dxp->dx_src_ctfp, dxp->dx_src_type);
+ dt_node_type_assign(&xn, dxp->dx_src_ctfp, dxp->dx_src_type,
+ B_FALSE);
if (ctf_type_compat(dxp->dx_dst_ctfp, dxp->dx_dst_base,
dst_ctfp, dst_base) && dt_node_is_argcompat(src, &xn))
goto out;
diff --git a/usr/src/lib/libdtrace/common/dtrace.h b/usr/src/lib/libdtrace/common/dtrace.h
index 87df1ca440..8c65ff8bec 100644
--- a/usr/src/lib/libdtrace/common/dtrace.h
+++ b/usr/src/lib/libdtrace/common/dtrace.h
@@ -25,7 +25,8 @@
*/
/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _DTRACE_H
@@ -81,6 +82,7 @@ extern const char *dtrace_subrstr(dtrace_hdl_t *, int);
extern int dtrace_setopt(dtrace_hdl_t *, const char *, const char *);
extern int dtrace_getopt(dtrace_hdl_t *, const char *, dtrace_optval_t *);
+extern int dtrace_setopts(dtrace_hdl_t *);
extern void dtrace_update(dtrace_hdl_t *);
extern int dtrace_ctlfd(dtrace_hdl_t *);
@@ -352,6 +354,12 @@ extern int dtrace_handle_setopt(dtrace_hdl_t *,
#define DTRACE_A_PERCPU 0x0001
#define DTRACE_A_KEEPDELTA 0x0002
#define DTRACE_A_ANONYMOUS 0x0004
+#define DTRACE_A_TOTAL 0x0008
+#define DTRACE_A_MINMAXBIN 0x0010
+#define DTRACE_A_HASNEGATIVES 0x0020
+#define DTRACE_A_HASPOSITIVES 0x0040
+
+#define DTRACE_AGGZOOM_MAX 0.95 /* height of max bar */
#define DTRACE_AGGWALK_ERROR -1 /* error while processing */
#define DTRACE_AGGWALK_NEXT 0 /* proceed to next element */
@@ -372,6 +380,10 @@ struct dtrace_aggdata {
caddr_t dtada_delta; /* delta data, if available */
caddr_t *dtada_percpu; /* per CPU data, if avail */
caddr_t *dtada_percpu_delta; /* per CPU delta, if avail */
+ int64_t dtada_total; /* per agg total, if avail */
+ uint16_t dtada_minbin; /* minimum bin, if avail */
+ uint16_t dtada_maxbin; /* maximum bin, if avail */
+ uint32_t dtada_flags; /* flags */
};
typedef int dtrace_aggregate_f(const dtrace_aggdata_t *, void *);
@@ -491,8 +503,11 @@ typedef struct dtrace_typeinfo {
const char *dtt_object; /* object containing type */
ctf_file_t *dtt_ctfp; /* CTF container handle */
ctf_id_t dtt_type; /* CTF type identifier */
+ uint_t dtt_flags; /* Misc. flags */
} dtrace_typeinfo_t;
+#define DTT_FL_USER 0x1 /* user type */
+
extern int dtrace_lookup_by_type(dtrace_hdl_t *, const char *, const char *,
dtrace_typeinfo_t *);
diff --git a/usr/src/lib/libdtrace/common/io.d.in b/usr/src/lib/libdtrace/common/io.d.in
index cb1e32cffe..5f676b9546 100644
--- a/usr/src/lib/libdtrace/common/io.d.in
+++ b/usr/src/lib/libdtrace/common/io.d.in
@@ -23,7 +23,9 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
#pragma D depends_on module unix
#pragma D depends_on provider io
@@ -197,9 +199,7 @@ translator fileinfo_t < struct file *F > {
fi_oflags = F == NULL ? 0 : F->f_flag + (int)@FOPEN@;
};
-inline fileinfo_t fds[int fd] = xlate <fileinfo_t> (
- fd >= 0 && fd < curthread->t_procp->p_user.u_finfo.fi_nfiles ?
- curthread->t_procp->p_user.u_finfo.fi_list[fd].uf_file : NULL);
+inline fileinfo_t fds[int fd] = xlate <fileinfo_t> (getf(fd));
#pragma D attributes Stable/Stable/Common fds
#pragma D binding "1.1" fds
diff --git a/usr/src/lib/libgrubmgmt/common/libgrub_fs.c b/usr/src/lib/libgrubmgmt/common/libgrub_fs.c
index 28a47deabb..ff2884b6b3 100644
--- a/usr/src/lib/libgrubmgmt/common/libgrub_fs.c
+++ b/usr/src/lib/libgrubmgmt/common/libgrub_fs.c
@@ -21,6 +21,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
@@ -161,7 +163,8 @@ get_zfs_root(zfs_handle_t *zfh, grub_fs_t *fs, grub_root_t *root)
sizeof (root->gr_physpath))) == 0 &&
(ret = zpool_get_prop(zph, ZPOOL_PROP_BOOTFS,
root->gr_fs[GRBM_ZFS_BOOTFS].gfs_dev,
- sizeof (root->gr_fs[GRBM_ZFS_BOOTFS].gfs_dev), NULL)) == 0) {
+ sizeof (root->gr_fs[GRBM_ZFS_BOOTFS].gfs_dev), NULL,
+ B_FALSE)) == 0) {
(void) strlcpy(root->gr_fs[GRBM_ZFS_TOPFS].gfs_dev, name,
sizeof (root->gr_fs[GRBM_ZFS_TOPFS].gfs_dev));
diff --git a/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com b/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com
index 76ecd38479..50e298bc09 100644
--- a/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com
+++ b/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com
@@ -37,11 +37,11 @@ KMFINC= -I../../../include -I../../../ber_der/inc
BERLIB= -lkmf -lkmfberder
BERLIB64= $(BERLIB)
-OPENSSLLIBS= $(BERLIB) -lcrypto -lcryptoutil -lc
-OPENSSLLIBS64= $(BERLIB64) -lcrypto -lcryptoutil -lc
+OPENSSLLIBS= $(BERLIB) -lsunw_crypto -lcryptoutil -lc
+OPENSSLLIBS64= $(BERLIB64) -lsunw_crypto -lcryptoutil -lc
-LINTSSLLIBS = $(BERLIB) -lcrypto -lcryptoutil -lc
-LINTSSLLIBS64 = $(BERLIB64) -lcrypto -lcryptoutil -lc
+LINTSSLLIBS = $(BERLIB) -lsunw_crypto -lcryptoutil -lc
+LINTSSLLIBS64 = $(BERLIB64) -lsunw_crypto -lcryptoutil -lc
SRCDIR= ../common
INCDIR= ../../include
diff --git a/usr/src/lib/libnisdb/db_mindex3.cc b/usr/src/lib/libnisdb/db_mindex3.cc
index 886487f8c5..28182544a4 100644
--- a/usr/src/lib/libnisdb/db_mindex3.cc
+++ b/usr/src/lib/libnisdb/db_mindex3.cc
@@ -282,7 +282,7 @@ entriesFromLDAPthread(void *voidarg) {
/* Lock to prevent removal */
(void) __nis_lock_db_table(arg->tableName, 1, 0,
- "entriesFromLDAPthread");
+ (char *)"entriesFromLDAPthread");
/*
* It's possible that the db_mindex for the table has changed,
@@ -314,7 +314,7 @@ entriesFromLDAPthread(void *voidarg) {
stat = entriesFromLDAPreal(arg);
(void) __nis_ulock_db_table(arg->tableName, 1, 0,
- "entriesFromLDAPthread");
+ (char *)"entriesFromLDAPthread");
freeQuery(arg->q);
if (arg->dirObj != 0)
diff --git a/usr/src/lib/libnisdb/db_table.cc b/usr/src/lib/libnisdb/db_table.cc
index 2995f1a9c9..8044148355 100644
--- a/usr/src/lib/libnisdb/db_table.cc
+++ b/usr/src/lib/libnisdb/db_table.cc
@@ -599,7 +599,7 @@ db_table::setEntryExp(entryp where, entry_obj *obj, int initialLoad) {
if (o != 0) {
__nis_buffer_t b = {0, 0};
- bp2buf(myself, &b, "%s.%s",
+ bp2buf(myself, &b, (char *)"%s.%s",
o->zo_name, o->zo_domain);
t = getObjMapping(b.buf, 0, 1, 0, 0);
sfree(b.buf);
@@ -967,7 +967,7 @@ db_table::setEnumMode(long enumNum) {
if (stat != DB_SUCCESS) {
enumMode.flag = 0;
enumCount.flag = 0;
- logmsg(MSG_NOTIMECHECK, LOG_ERR,
+ logmsg(MSG_NOTIMECHECK, LOG_ERR, (char *)
"%s: No memory for enum check array; entry removal disabled",
myself);
}
diff --git a/usr/src/lib/libnisdb/nis_db.cc b/usr/src/lib/libnisdb/nis_db.cc
index 2908cc99b0..b27889b147 100644
--- a/usr/src/lib/libnisdb/nis_db.cc
+++ b/usr/src/lib/libnisdb/nis_db.cc
@@ -527,7 +527,7 @@ dbFindObject(char *objName, db_status *statP) {
/* If not the root dir, find the directory where the entry lives */
sfree(table);
- name = entryName(myself, objName, &table);
+ name = entryName((char *)myself, objName, &table);
if (name == 0 || table == 0) {
sfree(name);
RETSTAT(0, DB_MEMORY_LIMIT);
@@ -737,7 +737,7 @@ dbDeleteObj(char *objName) {
nod->objType = o->zo_data.zo_type;
nis_destroy_object(o);
- nod->objName = sdup(myself, T, objName);
+ nod->objName = sdup((char *)myself, T, objName);
if (nod->objName == 0) {
sfree(nod);
return (DB_MEMORY_LIMIT);
@@ -789,7 +789,7 @@ dbTouchObj(char *objName) {
sfree(table);
table = 0;
- ent = entryName(myself, objName, &table);
+ ent = entryName((char *)myself, objName, &table);
if (ent == 0 || table == 0) {
sfree(ent);
return (DB_MEMORY_LIMIT);
@@ -989,7 +989,7 @@ dbRefreshObj(char *name, nis_object *o) {
int lstat;
/* Find parent */
- ent = entryName(myself, objName, &table);
+ ent = entryName((char *)myself, objName, &table);
if (ent == 0 || table == 0) {
sfree(b.buf);
sfree(objTable);
diff --git a/usr/src/lib/libpkg/Makefile.com b/usr/src/lib/libpkg/Makefile.com
index 8f56a61423..0106d8288f 100644
--- a/usr/src/lib/libpkg/Makefile.com
+++ b/usr/src/lib/libpkg/Makefile.com
@@ -64,7 +64,7 @@ $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC)
LIBS = $(DYNLIB) $(LINTLIB)
-LDLIBS += -lc -lssl -lwanboot -lcrypto -lscf -ladm
+LDLIBS += -lc -lsunw_ssl -lwanboot -lsunw_crypto -lscf -ladm
CFLAGS += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-unused-label
diff --git a/usr/src/lib/libproc/common/Pzone.c b/usr/src/lib/libproc/common/Pzone.c
index 67a8c0b3c9..c8e2bfcd02 100644
--- a/usr/src/lib/libproc/common/Pzone.c
+++ b/usr/src/lib/libproc/common/Pzone.c
@@ -28,6 +28,9 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
@@ -387,16 +390,23 @@ Plofspath(const char *path, char *s, size_t n)
* lofs resolution loop. Use resolvepath() to make
* sure there are no consecutive or trailing '/'s
* in the path.
+ *
+ * However, we need to be careful to handle the case of
+ * a lofs mounted file under a lofs mounted file system.
+ * In this case, we just keep going.
*/
+
(void) strlcpy(tmp2, special, sizeof (tmp2) - 1);
(void) strlcat(tmp2, "/", sizeof (tmp2) - 1);
(void) strlcat(tmp2, &p[1], sizeof (tmp2) - 1);
- (void) strlcpy(tmp, tmp2, sizeof (tmp) - 1);
- if ((rv = resolvepath(tmp, tmp, sizeof (tmp) - 1)) >= 0)
- tmp[rv] = '\0';
- p = &tmp[strlen(tmp)];
- p[1] = '\0';
- continue;
+ if ((rv = resolvepath(tmp2, tmp2, sizeof (tmp2) - 1)) >=
+ 0) {
+ tmp2[rv] = '\0';
+ (void) strlcpy(tmp, tmp2, sizeof (tmp) - 1);
+ p = &tmp[strlen(tmp)];
+ p[1] = '\0';
+ continue;
+ }
}
/* No lofs mount found */
diff --git a/usr/src/lib/libresolv2_joy/Makefile b/usr/src/lib/libresolv2_joy/Makefile
new file mode 100644
index 0000000000..052dfdd092
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/Makefile
@@ -0,0 +1,76 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+
+include ../../Makefile.master
+include ../Makefile.lib
+
+$(ROOTSVCMETHOD) := FILEMODE = 0555
+
+SUBDIRS= include $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+lint := TARGET= lint
+_msg := TARGET= _msg
+
+LIBRARY= libresolv_joy.a
+TEXT_DOMAIN= SUNW_OST_OSLIB
+XGETFLAGS= -a
+POFILE= $(LIBRARY:.a=.po)
+POFILES= generic.po
+
+SED= sed
+GREP= grep
+
+.KEEP_STATE:
+
+all clean clobber lint: $(SUBDIRS)
+
+install: $(SUBDIRS)
+
+check: $(CHECKHDRS) $(CHKMANIFEST)
+
+_msg: $(MSGDOMAIN) $(POFILE)
+ $(RM) $(MSGDOMAIN)/$(POFILE)
+ $(CP) $(POFILE) $(MSGDOMAIN)
+
+$(POFILE): $(POFILES)
+ $(RM) $@
+ $(CAT) $(POFILES) > $@
+
+$(POFILES):
+ $(RM) messages.po
+ $(XGETTEXT) $(XGETFLAGS) *.[ch]* */*.[ch]*
+ $(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
+ $(RM) messages.po
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET); echo
+
+FRC:
+
diff --git a/usr/src/lib/libresolv2_joy/Makefile.com b/usr/src/lib/libresolv2_joy/Makefile.com
new file mode 100644
index 0000000000..bbabcbcede
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/Makefile.com
@@ -0,0 +1,162 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#
+
+LIBRARY= libresolv_joy.a
+VERS= .2
+
+BSDOBJS= daemon.o putenv.o strcasecmp.o strsep.o \
+ ftruncate.o readv.o strdup.o strtoul.o \
+ gettimeofday.o setenv.o strerror.o utimes.o \
+ mktemp.o setitimer.o strpbrk.o writev.o
+
+DSTOBJS= dst_api.o support.o hmac_link.o
+
+# inet_addr, inet_pton, inet_ntop, and inet_ntoa removed due to overlap with
+# libnsl
+INETOBJS= inet_net_pton.o inet_neta.o inet_lnaof.o \
+ inet_netof.o nsap_addr.o inet_makeaddr.o \
+ inet_network.o inet_net_ntop.o inet_cidr_ntop.o \
+ inet_cidr_pton.o inet_data.o
+
+# build only the IRS objects that the ISC libbind's make would
+IRSTHROBJS= gethostent_r.o getnetent_r.o getnetgrent_r.o \
+ getprotoent_r.o getservent_r.o
+IRSOBJS= ${IRSTHROBJS} \
+ dns.o dns_ho.o dns_nw.o dns_pr.o \
+ dns_sv.o gai_strerror.o gen.o gen_ho.o \
+ gen_ng.o gen_nw.o gen_pr.o gen_sv.o \
+ getaddrinfo.o gethostent.o getnameinfo.o getnetent.o \
+ getnetgrent.o getprotoent.o getservent.o hesiod.o \
+ irp.o irp_ho.o irp_ng.o irp_nw.o \
+ irp_pr.o irp_sv.o irpmarshall.o irs_data.o \
+ lcl.o lcl_ho.o lcl_ng.o lcl_nw.o \
+ lcl_pr.o lcl_sv.o nis.o nul_ng.o \
+ util.o
+
+ISCOBJS= assertions.o base64.o bitncmp.o ctl_clnt.o \
+ ctl_p.o ctl_srvr.o ev_connects.o ev_files.o \
+ ev_streams.o ev_timers.o ev_waits.o eventlib.o \
+ heap.o hex.o logging.o memcluster.o \
+ movefile.o tree.o
+
+NAMESEROBJS= ns_date.o ns_name.o ns_netint.o ns_parse.o \
+ ns_print.o ns_samedomain.o ns_sign.o ns_ttl.o \
+ ns_verify.o ns_rdata.o ns_newmsg.o
+
+RESOLVOBJS= herror.o mtctxres.o res_comp.o res_data.o \
+ res_debug.o res_findzonecut.o res_init.o \
+ res_mkquery.o res_mkupdate.o res_query.o res_send.o \
+ res_sendsigned.o res_update.o
+
+SUNWOBJS= sunw_mtctxres.o sunw_updrec.o sunw_wrappers.o
+
+OBJECTS= $(BSDOBJS) $(DSTOBJS) $(INETOBJS) $(IRSOBJS) $(ISCOBJS) \
+ $(NAMESEROBJS) $(RESOLVOBJS) $(SUNWOBJS)
+
+# include library definitions
+include ../../Makefile.lib
+
+# install this library in the root filesystem
+include ../../Makefile.rootfs
+
+# CC -v complains about things we aren't going to change in the ISC code
+CCVERBOSE=
+
+SRCDIR = ../common
+SRCS= $(BSDOBJS:%.o=../common/bsd/%.c) \
+ $(DSTOBJS:%.o=../common/dst/%.c) \
+ $(INETOBJS:%.o=../common/inet/%.c) \
+ $(IRSOBJS:%.o=../common/irs/%.c) \
+ $(ISCOBJS:%.o=../common/isc/%.c) \
+ $(NAMESEROBJS:%.o=../common/nameser/%.c) \
+ $(RESOLVOBJS:%.o=../common/resolv/%.c) \
+ $(SUNWOBJS:%.o=../common/sunw/%.c)
+
+LIBS = $(DYNLIB) $(LINTLIB)
+
+$(LINTLIB):= SRCS = ../common/llib-lresolv_joy
+
+# Local Libresolv definitions
+
+SOLCOMPAT = -Dsocket=_socket
+CRYPTFLAGS= -DHMAC_MD5 -DUSE_MD5
+
+LOCFLAGS += $(CRYPTFLAGS)
+LOCFLAGS += -D_SYS_STREAM_H -D_REENTRANT -DSVR4 -DSUNW_OPTIONS \
+ $(SOLCOMPAT) -I../include -I../../common/inc
+
+CPPFLAGS += $(LOCFLAGS)
+
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
+DYNFLAGS += $(ZNODELETE)
+
+LDLIBS += -lsocket -lnsl -lc -lmd
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+lint: lintcheck
+
+# include library targets
+include ../../Makefile.targ
+
+pics/%.o: ../common/bsd/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/dst/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/inet/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/irs/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/isc/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/nameser/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/resolv/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: ../common/sunw/%.c
+ $(COMPILE.c) -o $@ $<
+ $(POST_PROCESS_O)
+
+# install rule for lint library target
+$(ROOTLINTDIR)/%: ../common/%
+ $(INS.file)
diff --git a/usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE b/usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE
new file mode 100644
index 0000000000..719d77fea2
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE
@@ -0,0 +1,185 @@
+ * Copyright (c) 1995-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+
+ * Copyright (c) 1983, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+
+/* Copyright (C) RSA Data Security, Inc. created 1986-1987, 1990,
+ 1992-1994, 1996. This is an
+ unpublished work protected as such under copyright law. This work
+ contains proprietary, confidential, and trade secret information of
+ RSA Data Security, Inc. Use, disclosure or reproduction without the
+ express written authorization of RSA Data Security, Inc. is
+ prohibited.
+ */
+
+ DNSSAFE LICENSE TERMS
+
+ This BIND software includes the DNSsafe software from RSA Data
+ Security, Inc., which is copyrighted software that can only be
+ distributed under the terms of this license agreement.
+
+ The DNSsafe software cannot be used or distributed separately from the
+ BIND software. You only have the right to use it or distribute it as
+ a bundled, integrated product.
+
+ The DNSsafe software can ONLY be used to provide authentication for
+ resource records in the Domain Name System, as specified in RFC 2065
+ and successors. You cannot modify the BIND software to use the
+ DNSsafe software for other purposes, or to make its cryptographic
+ functions available to end-users for other uses.
+
+ If you modify the DNSsafe software itself, you cannot modify its
+ documented API, and you must grant RSA Data Security the right to use,
+ modify, and distribute your modifications, including the right to use
+ any patents or other intellectual property that your modifications
+ depend upon.
+
+ You must not remove, alter, or destroy any of RSA's copyright notices
+ or license information. When distributing the software to the Federal
+ Government, it must be licensed to them as "commercial computer
+ software" protected under 48 CFR 12.212 of the FAR, or 48 CFR
+ 227.7202.1 of the DFARS.
+
+ You must not violate United States export control laws by distributing
+ the DNSsafe software or information about it, when such distribution
+ is prohibited by law.
+
+ THE DNSSAFE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY
+ WHATSOEVER. RSA HAS NO OBLIGATION TO SUPPORT, CORRECT, UPDATE OR
+ MAINTAIN THE RSA SOFTWARE. RSA DISCLAIMS ALL WARRANTIES, EXPRESS,
+ IMPLIED OR STATUTORY, AS TO ANY MATTER WHATSOEVER, INCLUDING ALL
+ IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS.
+
+ If you desire to use DNSsafe in ways that these terms do not permit,
+ please contact RSA Data Security, Inc., 100 Marine Parkway, Redwood
+ City, California 94065, USA, to discuss alternate licensing
+ arrangements.
+
+ * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+ *
+ * Permission to use, copy modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
+
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by WIDE Project and
+ * its contributors.
+ * 4. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
diff --git a/usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE.descrip b/usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE.descrip
new file mode 100644
index 0000000000..67315d8f33
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/THIRDPARTYLICENSE.descrip
@@ -0,0 +1 @@
+BIND SOFTWARE
diff --git a/usr/src/lib/libresolv2_joy/amd64/Makefile b/usr/src/lib/libresolv2_joy/amd64/Makefile
new file mode 100644
index 0000000000..2e8cdecf75
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/amd64/Makefile
@@ -0,0 +1,31 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/daemon.c b/usr/src/lib/libresolv2_joy/common/bsd/daemon.c
new file mode 100644
index 0000000000..54ff83b753
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/daemon.c
@@ -0,0 +1,81 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: daemon.c,v 1.2 2005/04/27 04:56:10 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+
+#include <fcntl.h>
+#include <paths.h>
+#include <unistd.h>
+
+#include "port_after.h"
+
+#ifndef NEED_DAEMON
+int __bind_daemon__;
+#else
+
+int
+daemon(int nochdir, int noclose) {
+ int fd;
+
+ switch (fork()) {
+ case -1:
+ return (-1);
+ case 0:
+ break;
+ default:
+ _exit(0);
+ }
+
+ if (setsid() == -1)
+ return (-1);
+
+ if (!nochdir)
+ (void)chdir("/");
+
+ if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
+ (void)dup2(fd, STDIN_FILENO);
+ (void)dup2(fd, STDOUT_FILENO);
+ (void)dup2(fd, STDERR_FILENO);
+ if (fd > 2)
+ (void)close (fd);
+ }
+ return (0);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/ftruncate.c b/usr/src/lib/libresolv2_joy/common/bsd/ftruncate.c
new file mode 100644
index 0000000000..5ac4ebac9b
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/ftruncate.c
@@ -0,0 +1,64 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: ftruncate.c,v 1.3 2005/04/27 18:16:45 sra Exp $";
+#endif
+
+/*! \file
+ * \brief
+ * ftruncate - set file size, BSD Style
+ *
+ * shortens or enlarges the file as neeeded
+ * uses some undocumented locking call. It is known to work on SCO unix,
+ * other vendors should try.
+ * The #error directive prevents unsupported OSes
+ */
+
+#include "port_before.h"
+
+#if defined(M_UNIX)
+#define OWN_FTRUNCATE
+#include <stdio.h>
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+#ifdef _POSIX_SOURCE
+#undef _POSIX_SOURCE
+#endif
+
+#include <fcntl.h>
+
+#include "port_after.h"
+
+int
+__ftruncate(int fd, long wantsize) {
+ long cursize;
+
+ /* determine current file size */
+ if ((cursize = lseek(fd, 0L, 2)) == -1)
+ return (-1);
+
+ /* maybe lengthen... */
+ if (cursize < wantsize) {
+ if (lseek(fd, wantsize - 1, 0) == -1 ||
+ write(fd, "", 1) == -1) {
+ return (-1);
+ }
+ return (0);
+ }
+
+ /* maybe shorten... */
+ if (wantsize < cursize) {
+ struct flock fl;
+
+ fl.l_whence = 0;
+ fl.l_len = 0;
+ fl.l_start = wantsize;
+ fl.l_type = F_WRLCK;
+ return (fcntl(fd, F_FREESP, &fl));
+ }
+ return (0);
+}
+#endif
+
+#ifndef OWN_FTRUNCATE
+int __bindcompat_ftruncate;
+#endif
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/gettimeofday.c b/usr/src/lib/libresolv2_joy/common/bsd/gettimeofday.c
new file mode 100644
index 0000000000..2926a3575e
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/gettimeofday.c
@@ -0,0 +1,62 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: gettimeofday.c,v 1.4 2005/04/27 04:56:11 sra Exp $";
+#endif
+
+#include "port_before.h"
+#include <stdio.h>
+#include <syslog.h>
+#include <sys/time.h>
+#include "port_after.h"
+
+#if !defined(NEED_GETTIMEOFDAY)
+/*%
+ * gettimeofday() occasionally returns invalid tv_usec on some platforms.
+ */
+#define MILLION 1000000
+#undef gettimeofday
+
+int
+isc__gettimeofday(struct timeval *tp, struct timezone *tzp) {
+ int res;
+
+ res = gettimeofday(tp, tzp);
+ if (res < 0)
+ return (res);
+ if (tp == NULL)
+ return (res);
+ if (tp->tv_usec < 0) {
+ do {
+ tp->tv_usec += MILLION;
+ tp->tv_sec--;
+ } while (tp->tv_usec < 0);
+ goto log;
+ } else if (tp->tv_usec > MILLION) {
+ do {
+ tp->tv_usec -= MILLION;
+ tp->tv_sec++;
+ } while (tp->tv_usec > MILLION);
+ goto log;
+ }
+ return (res);
+ log:
+ syslog(LOG_ERR, "gettimeofday: tv_usec out of range\n");
+ return (res);
+}
+#else
+int
+gettimeofday(struct timeval *tvp, struct _TIMEZONE *tzp) {
+ time_t clock, time(time_t *);
+
+ if (time(&clock) == (time_t) -1)
+ return (-1);
+ if (tvp) {
+ tvp->tv_sec = clock;
+ tvp->tv_usec = 0;
+ }
+ if (tzp) {
+ tzp->tz_minuteswest = 0;
+ tzp->tz_dsttime = 0;
+ }
+ return (0);
+}
+#endif /*NEED_GETTIMEOFDAY*/
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/mktemp.c b/usr/src/lib/libresolv2_joy/common/bsd/mktemp.c
new file mode 100644
index 0000000000..001b24b58f
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/mktemp.c
@@ -0,0 +1,156 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: mktemp.c,v 1.2 2005/04/27 04:56:11 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+#include "port_after.h"
+
+#if (!defined(NEED_MKTEMP)) && (!defined(NEED_MKSTEMP))
+int __mktemp_unneeded__;
+#else
+
+static int gettemp(char *path, int *doopen);
+
+#ifdef NEED_MKSTEMP
+mkstemp(char *path) {
+ int fd;
+
+ return (gettemp(path, &fd) ? fd : -1);
+}
+#endif
+
+#ifdef NEED_MKTEMP
+char *
+mktemp(char *path) {
+ return(gettemp(path, (int *)NULL) ? path : (char *)NULL);
+}
+#endif
+
+static int
+gettemp(char *path, int *doopen) {
+ char *start, *trv;
+ struct stat sbuf;
+ u_int pid;
+
+ pid = getpid();
+ for (trv = path; *trv; ++trv); /*%< extra X's get set to 0's */
+ while (*--trv == 'X') {
+ *trv = (pid % 10) + '0';
+ pid /= 10;
+ }
+
+ /*
+ * check the target directory; if you have six X's and it
+ * doesn't exist this runs for a *very* long time.
+ */
+ for (start = trv + 1;; --trv) {
+ if (trv <= path)
+ break;
+ if (*trv == '/') {
+ *trv = '\0';
+ if (stat(path, &sbuf))
+ return(0);
+ if (!S_ISDIR(sbuf.st_mode)) {
+ errno = ENOTDIR;
+ return(0);
+ }
+ *trv = '/';
+ break;
+ }
+ }
+
+ for (;;) {
+ if (doopen) {
+ if ((*doopen =
+ open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
+ return(1);
+ if (errno != EEXIST)
+ return(0);
+ }
+ else if (stat(path, &sbuf))
+ return(errno == ENOENT ? 1 : 0);
+
+ /* tricky little algorithm for backward compatibility */
+ for (trv = start;;) {
+ if (!*trv)
+ return(0);
+ if (*trv == 'z')
+ *trv++ = 'a';
+ else {
+ if (isdigit(*trv))
+ *trv = 'a';
+ else
+ ++*trv;
+ break;
+ }
+ }
+ }
+ /*NOTREACHED*/
+}
+
+#endif /*NEED_MKTEMP*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/putenv.c b/usr/src/lib/libresolv2_joy/common/bsd/putenv.c
new file mode 100644
index 0000000000..2dcbc57e6c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/putenv.c
@@ -0,0 +1,27 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: putenv.c,v 1.2 2005/04/27 04:56:11 sra Exp $";
+#endif
+
+#include "port_before.h"
+#include "port_after.h"
+
+/*%
+ * To give a little credit to Sun, SGI,
+ * and many vendors in the SysV world.
+ */
+
+#if !defined(NEED_PUTENV)
+int __bindcompat_putenv;
+#else
+int
+putenv(char *str) {
+ char *tmp;
+
+ for (tmp = str; *tmp && (*tmp != '='); tmp++)
+ ;
+
+ return (setenv(str, tmp, 1));
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/readv.c b/usr/src/lib/libresolv2_joy/common/bsd/readv.c
new file mode 100644
index 0000000000..5fa691a92f
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/readv.c
@@ -0,0 +1,39 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: readv.c,v 1.2 2005/04/27 04:56:11 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+
+#include "port_after.h"
+
+#ifndef NEED_READV
+int __bindcompat_readv;
+#else
+
+int
+__readv(fd, vp, vpcount)
+ int fd;
+ const struct iovec *vp;
+ int vpcount;
+{
+ int count = 0;
+
+ while (vpcount-- > 0) {
+ int bytes = read(fd, vp->iov_base, vp->iov_len);
+
+ if (bytes < 0)
+ return (-1);
+ count += bytes;
+ if (bytes != vp->iov_len)
+ break;
+ vp++;
+ }
+ return (count);
+}
+#endif /* NEED_READV */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/setenv.c b/usr/src/lib/libresolv2_joy/common/bsd/setenv.c
new file mode 100644
index 0000000000..baf00f6ff2
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/setenv.c
@@ -0,0 +1,151 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)setenv.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: setenv.c,v 1.2 2005/04/27 04:56:11 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "port_after.h"
+
+#if !defined(NEED_SETENV)
+int __bindcompat_setenv;
+#else
+
+extern char **environ;
+
+static char *findenv(const char *name, int *offset);
+
+/*%
+ * setenv --
+ * Set the value of the environmental variable "name" to be
+ * "value". If rewrite is set, replace any current value.
+ */
+setenv(const char *name, const char *value, int rewrite) {
+ extern char **environ;
+ static int alloced; /*%< if allocated space before */
+ char *c;
+ int l_value, offset;
+
+ if (*value == '=') /*%< no `=' in value */
+ ++value;
+ l_value = strlen(value);
+ if ((c = findenv(name, &offset))) { /*%< find if already exists */
+ if (!rewrite)
+ return (0);
+ if (strlen(c) >= l_value) { /*%< old larger; copy over */
+ while (*c++ = *value++);
+ return (0);
+ }
+ } else { /*%< create new slot */
+ int cnt;
+ char **p;
+
+ for (p = environ, cnt = 0; *p; ++p, ++cnt);
+ if (alloced) { /*%< just increase size */
+ environ = (char **)realloc((char *)environ,
+ (size_t)(sizeof(char *) * (cnt + 2)));
+ if (!environ)
+ return (-1);
+ }
+ else { /*%< get new space */
+ alloced = 1; /*%< copy old entries into it */
+ p = malloc((size_t)(sizeof(char *) * (cnt + 2)));
+ if (!p)
+ return (-1);
+ memcpy(p, environ, cnt * sizeof(char *));
+ environ = p;
+ }
+ environ[cnt + 1] = NULL;
+ offset = cnt;
+ }
+ for (c = (char *)name; *c && *c != '='; ++c); /*%< no `=' in name */
+ if (!(environ[offset] = /*%< name + `=' + value */
+ malloc((size_t)((int)(c - name) + l_value + 2))))
+ return (-1);
+ for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
+ for (*c++ = '='; *c++ = *value++;);
+ return (0);
+}
+
+/*%
+ * unsetenv(name) --
+ * Delete environmental variable "name".
+ */
+void
+unsetenv(const char *name) {
+ char **p;
+ int offset;
+
+ while (findenv(name, &offset)) /*%< if set multiple times */
+ for (p = &environ[offset];; ++p)
+ if (!(*p = *(p + 1)))
+ break;
+}
+
+/*%
+ * findenv --
+ * Returns pointer to value associated with name, if any, else NULL.
+ * Sets offset to be the offset of the name/value combination in the
+ * environmental array, for use by setenv(3) and unsetenv(3).
+ * Explicitly removes '=' in argument name.
+ *
+ * This routine *should* be a static; don't use it.
+ */
+static char *
+findenv(const char *name, int *offset) {
+ const char *np;
+ char **p, *c;
+ int len;
+
+ if (name == NULL || environ == NULL)
+ return (NULL);
+ for (np = name; *np && *np != '='; ++np)
+ continue;
+ len = np - name;
+ for (p = environ; (c = *p) != NULL; ++p)
+ if (strncmp(c, name, len) == 0 && c[len] == '=') {
+ *offset = p - environ;
+ return (c + len + 1);
+ }
+ return (NULL);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/setitimer.c b/usr/src/lib/libresolv2_joy/common/bsd/setitimer.c
new file mode 100644
index 0000000000..67881d7ca8
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/setitimer.c
@@ -0,0 +1,29 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: setitimer.c,v 1.2 2005/04/27 04:56:12 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/time.h>
+
+#include "port_after.h"
+
+/*%
+ * Setitimer emulation routine.
+ */
+#ifndef NEED_SETITIMER
+int __bindcompat_setitimer;
+#else
+
+int
+__setitimer(int which, const struct itimerval *value,
+ struct itimerval *ovalue)
+{
+ if (alarm(value->it_value.tv_sec) >= 0)
+ return (0);
+ else
+ return (-1);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/strcasecmp.c b/usr/src/lib/libresolv2_joy/common/bsd/strcasecmp.c
new file mode 100644
index 0000000000..0c9f0dccf0
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/strcasecmp.c
@@ -0,0 +1,124 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: strcasecmp.c,v 1.2 2005/04/27 04:56:12 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+#include <string.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRCASECMP
+int __strcasecmp_unneeded__;
+#else
+
+/*%
+ * This array is designed for mapping upper and lower case letter
+ * together for a case independent comparison. The mappings are
+ * based upon ascii character sequences.
+ */
+static const u_char charmap[] = {
+ 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
+ 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
+ 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
+ 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
+ 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
+ 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
+ 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
+ 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
+ 0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
+ 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
+ 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
+ 0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137,
+ 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
+ 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
+ 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
+ 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
+ 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
+ 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
+ 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
+ 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
+ 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
+ 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
+ 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
+ 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
+ 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
+ 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
+ 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
+ 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
+ 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
+ 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
+ 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
+ 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
+};
+
+int
+strcasecmp(const char *s1, const char *s2) {
+ const u_char *cm = charmap,
+ *us1 = (const u_char *)s1,
+ *us2 = (const u_char *)s2;
+
+ while (cm[*us1] == cm[*us2++])
+ if (*us1++ == '\0')
+ return (0);
+ return (cm[*us1] - cm[*--us2]);
+}
+
+int
+strncasecmp(const char *s1, const char *s2, size_t n) {
+ if (n != 0) {
+ const u_char *cm = charmap,
+ *us1 = (const u_char *)s1,
+ *us2 = (const u_char *)s2;
+
+ do {
+ if (cm[*us1] != cm[*us2++])
+ return (cm[*us1] - cm[*--us2]);
+ if (*us1++ == '\0')
+ break;
+ } while (--n != 0);
+ }
+ return (0);
+}
+
+#endif /*NEED_STRCASECMP*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/strdup.c b/usr/src/lib/libresolv2_joy/common/bsd/strdup.c
new file mode 100644
index 0000000000..a8d31e9587
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/strdup.c
@@ -0,0 +1,20 @@
+#include "port_before.h"
+
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRDUP
+int __bind_strdup_unneeded;
+#else
+char *
+strdup(const char *src) {
+ char *dst = malloc(strlen(src) + 1);
+
+ if (dst)
+ strcpy(dst, src);
+ return (dst);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/strerror.c b/usr/src/lib/libresolv2_joy/common/bsd/strerror.c
new file mode 100644
index 0000000000..5973e63d5b
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/strerror.c
@@ -0,0 +1,94 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: strerror.c,v 1.6 2008/02/18 03:49:08 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/types.h>
+
+#include <string.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRERROR
+int __strerror_unneeded__;
+#else
+
+#ifdef USE_SYSERROR_LIST
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif
+
+const char *
+isc_strerror(int num) {
+#define UPREFIX "Unknown error: "
+ static char ebuf[40] = UPREFIX; /*%< 64-bit number + slop */
+ u_int errnum;
+ char *p, *t;
+#ifndef USE_SYSERROR_LIST
+ const char *ret;
+#endif
+ char tmp[40];
+
+ errnum = num; /*%< convert to unsigned */
+#ifdef USE_SYSERROR_LIST
+ if (errnum < (u_int)sys_nerr)
+ return (sys_errlist[errnum]);
+#else
+#undef strerror
+ ret = strerror(num); /*%< call strerror() in libc */
+ if (ret != NULL)
+ return(ret);
+#endif
+
+ /* Do this by hand, so we don't include stdio(3). */
+ t = tmp;
+ do {
+ *t++ = "0123456789"[errnum % 10];
+ } while (errnum /= 10);
+ for (p = ebuf + sizeof(UPREFIX) - 1;;) {
+ *p++ = *--t;
+ if (t <= tmp)
+ break;
+ }
+ return (ebuf);
+}
+
+#endif /*NEED_STRERROR*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/strpbrk.c b/usr/src/lib/libresolv2_joy/common/bsd/strpbrk.c
new file mode 100644
index 0000000000..4c12d88e1c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/strpbrk.c
@@ -0,0 +1,70 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)strpbrk.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: strpbrk.c,v 1.2 2005/04/27 04:56:12 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1985, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/cdefs.h>
+
+#include <string.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRPBRK
+int __strpbrk_unneeded__;
+#else
+
+/*%
+ * Find the first occurrence in s1 of a character in s2 (excluding NUL).
+ */
+char *
+strpbrk(const char *s1, const char *s2) {
+ const char *scanp;
+ int c, sc;
+
+ while ((c = *s1++) != 0) {
+ for (scanp = s2; (sc = *scanp++) != 0;)
+ if (sc == c)
+ return ((char *)(s1 - 1));
+ }
+ return (NULL);
+}
+
+#endif /*NEED_STRPBRK*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/strsep.c b/usr/src/lib/libresolv2_joy/common/bsd/strsep.c
new file mode 100644
index 0000000000..c7969f0028
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/strsep.c
@@ -0,0 +1,88 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "strsep.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: strsep.c,v 1.2 2005/04/27 04:56:12 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+#include <sys/cdefs.h>
+#include <string.h>
+#include <stdio.h>
+#include "port_after.h"
+
+#ifndef NEED_STRSEP
+int __strsep_unneeded__;
+#else
+
+/*%
+ * Get next token from string *stringp, where tokens are possibly-empty
+ * strings separated by characters from delim.
+ *
+ * Writes NULs into the string at *stringp to end tokens.
+ * delim need not remain constant from call to call.
+ * On return, *stringp points past the last NUL written (if there might
+ * be further tokens), or is NULL (if there are definitely no more tokens).
+ *
+ * If *stringp is NULL, strsep returns NULL.
+ */
+char *
+strsep(char **stringp, const char *delim) {
+ char *s;
+ const char *spanp;
+ int c, sc;
+ char *tok;
+
+ if ((s = *stringp) == NULL)
+ return (NULL);
+ for (tok = s;;) {
+ c = *s++;
+ spanp = delim;
+ do {
+ if ((sc = *spanp++) == c) {
+ if (c == 0)
+ s = NULL;
+ else
+ s[-1] = 0;
+ *stringp = s;
+ return (tok);
+ }
+ } while (sc != 0);
+ }
+ /* NOTREACHED */
+}
+
+#endif /*NEED_STRSEP*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/strtoul.c b/usr/src/lib/libresolv2_joy/common/bsd/strtoul.c
new file mode 100644
index 0000000000..b37ff72729
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/strtoul.c
@@ -0,0 +1,119 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: strtoul.c,v 1.4 2008/02/18 03:49:08 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRTOUL
+int __strtoul_unneeded__;
+#else
+
+/*%
+ * Convert a string to an unsigned long integer.
+ *
+ * Ignores `locale' stuff. Assumes that the upper and lower case
+ * alphabets and digits are each contiguous.
+ */
+u_long
+strtoul(const char *nptr, char **endptr, int base) {
+ const char *s = nptr;
+ u_long acc, cutoff;
+ int neg, c, any, cutlim;
+
+ neg = 0;
+
+ /*
+ * See strtol for comments as to the logic used.
+ */
+ do {
+ c = *(const unsigned char *)s++;
+ } while (isspace(c));
+ if (c == '-') {
+ neg = 1;
+ c = *s++;
+ } else if (c == '+')
+ c = *s++;
+ if ((base == 0 || base == 16) &&
+ c == '0' && (*s == 'x' || *s == 'X')) {
+ c = s[1];
+ s += 2;
+ base = 16;
+ }
+ if (base == 0)
+ base = c == '0' ? 8 : 10;
+ cutoff = (u_long)ULONG_MAX / (u_long)base;
+ cutlim = (u_long)ULONG_MAX % (u_long)base;
+ for (acc = 0, any = 0;; c = *(const unsigned char*)s++) {
+ if (isdigit(c))
+ c -= '0';
+ else if (isalpha(c))
+ c -= isupper(c) ? 'A' - 10 : 'a' - 10;
+ else
+ break;
+ if (c >= base)
+ break;
+ if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
+ any = -1;
+ else {
+ any = 1;
+ acc *= base;
+ acc += c;
+ }
+ }
+ if (any < 0) {
+ acc = ULONG_MAX;
+ errno = ERANGE;
+ } else if (neg)
+ acc = -acc;
+ if (endptr != 0)
+ DE_CONST((any ? s - 1 : nptr), *endptr);
+ return (acc);
+}
+
+#endif /*NEED_STRTOUL*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/utimes.c b/usr/src/lib/libresolv2_joy/common/bsd/utimes.c
new file mode 100644
index 0000000000..2f65cffe25
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/utimes.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1997,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <utime.h>
+
+#include "port_after.h"
+
+#ifndef NEED_UTIMES
+int __bind_utimes_unneeded;
+#else
+
+int
+__utimes(char *filename, struct timeval *tvp) {
+ struct utimbuf utb;
+
+ utb.actime = (time_t)tvp[0].tv_sec;
+ utb.modtime = (time_t)tvp[1].tv_sec;
+ return (utime(filename, &utb));
+}
+
+#endif /* NEED_UTIMES */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/bsd/writev.c b/usr/src/lib/libresolv2_joy/common/bsd/writev.c
new file mode 100644
index 0000000000..65baa71cfc
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/bsd/writev.c
@@ -0,0 +1,89 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: writev.c,v 1.3 2005/04/27 04:56:13 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+
+#include "port_after.h"
+
+#ifndef NEED_WRITEV
+int __bindcompat_writev;
+#else
+
+#ifdef _CRAY
+#define OWN_WRITEV
+int
+__writev(int fd, struct iovec *iov, int iovlen)
+{
+ struct stat statbuf;
+
+ if (fstat(fd, &statbuf) < 0)
+ return (-1);
+
+ /*
+ * Allow for atomic writes to network.
+ */
+ if (statbuf.st_mode & S_IFSOCK) {
+ struct msghdr mesg;
+
+ memset(&mesg, 0, sizeof(mesg));
+ mesg.msg_name = 0;
+ mesg.msg_namelen = 0;
+ mesg.msg_iov = iov;
+ mesg.msg_iovlen = iovlen;
+ mesg.msg_accrights = 0;
+ mesg.msg_accrightslen = 0;
+ return (sendmsg(fd, &mesg, 0));
+ } else {
+ struct iovec *tv;
+ int i, rcode = 0, count = 0;
+
+ for (i = 0, tv = iov; i <= iovlen; tv++) {
+ rcode = write(fd, tv->iov_base, tv->iov_len);
+
+ if (rcode < 0)
+ break;
+
+ count += rcode;
+ }
+
+ if (count == 0)
+ return (rcode);
+ else
+ return (count);
+ }
+}
+
+#else /*_CRAY*/
+
+int
+__writev(fd, vp, vpcount)
+ int fd;
+ const struct iovec *vp;
+ int vpcount;
+{
+ int count = 0;
+
+ while (vpcount-- > 0) {
+ int written = write(fd, vp->iov_base, vp->iov_len);
+
+ if (written < 0)
+ return (-1);
+ count += written;
+ if (written != vp->iov_len)
+ break;
+ vp++;
+ }
+ return (count);
+}
+
+#endif /*_CRAY*/
+
+#endif /*NEED_WRITEV*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/dst/dst_api.c b/usr/src/lib/libresolv2_joy/common/dst/dst_api.c
new file mode 100644
index 0000000000..a3e48077ad
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/dst/dst_api.c
@@ -0,0 +1,1048 @@
+#ifndef LINT
+static const char rcsid[] = "$Header: /proj/cvs/prod/libbind/dst/dst_api.c,v 1.17 2007/09/24 17:18:25 each Exp $";
+#endif
+
+/*
+ * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+ *
+ * Permission to use, copy modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
+ */
+/*
+ * This file contains the interface between the DST API and the crypto API.
+ * This is the only file that needs to be changed if the crypto system is
+ * changed. Exported functions are:
+ * void dst_init() Initialize the toolkit
+ * int dst_check_algorithm() Function to determines if alg is suppored.
+ * int dst_compare_keys() Function to compare two keys for equality.
+ * int dst_sign_data() Incremental signing routine.
+ * int dst_verify_data() Incremental verify routine.
+ * int dst_generate_key() Function to generate new KEY
+ * DST_KEY *dst_read_key() Function to retrieve private/public KEY.
+ * void dst_write_key() Function to write out a key.
+ * DST_KEY *dst_dnskey_to_key() Function to convert DNS KEY RR to a DST
+ * KEY structure.
+ * int dst_key_to_dnskey() Function to return a public key in DNS
+ * format binary
+ * DST_KEY *dst_buffer_to_key() Converst a data in buffer to KEY
+ * int *dst_key_to_buffer() Writes out DST_KEY key matterial in buffer
+ * void dst_free_key() Releases all memory referenced by key structure
+ */
+
+#include "port_before.h"
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <memory.h>
+#include <ctype.h>
+#include <time.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include "dst_internal.h"
+#include "port_after.h"
+
+/* static variables */
+static int done_init = 0;
+dst_func *dst_t_func[DST_MAX_ALGS];
+const char *key_file_fmt_str = "Private-key-format: v%s\nAlgorithm: %d (%s)\n";
+const char *dst_path = "";
+
+/* internal I/O functions */
+static DST_KEY *dst_s_read_public_key(const char *in_name,
+ const u_int16_t in_id, int in_alg);
+static int dst_s_read_private_key_file(char *name, DST_KEY *pk_key,
+ u_int16_t in_id, int in_alg);
+static int dst_s_write_public_key(const DST_KEY *key);
+static int dst_s_write_private_key(const DST_KEY *key);
+
+/* internal function to set up data structure */
+static DST_KEY *dst_s_get_key_struct(const char *name, const int alg,
+ const int flags, const int protocol,
+ const int bits);
+
+/*%
+ * dst_init
+ * This function initializes the Digital Signature Toolkit.
+ * Right now, it just checks the DSTKEYPATH environment variable.
+ * Parameters
+ * none
+ * Returns
+ * none
+ */
+void
+dst_init()
+{
+ char *s;
+ int len;
+
+ if (done_init != 0)
+ return;
+ done_init = 1;
+
+ s = getenv("DSTKEYPATH");
+ len = 0;
+ if (s) {
+ struct stat statbuf;
+
+ len = strlen(s);
+ if (len > PATH_MAX) {
+ EREPORT(("%s is longer than %d characters, ignoring\n",
+ s, PATH_MAX));
+ } else if (stat(s, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) {
+ EREPORT(("%s is not a valid directory\n", s));
+ } else {
+ char *tmp;
+ tmp = (char *) malloc(len + 2);
+ memcpy(tmp, s, len + 1);
+ if (tmp[strlen(tmp) - 1] != '/') {
+ tmp[strlen(tmp) + 1] = 0;
+ tmp[strlen(tmp)] = '/';
+ }
+ dst_path = tmp;
+ }
+ }
+ memset(dst_t_func, 0, sizeof(dst_t_func));
+ /* first one is selected */
+ dst_hmac_md5_init();
+}
+
+/*%
+ * dst_check_algorithm
+ * This function determines if the crypto system for the specified
+ * algorithm is present.
+ * Parameters
+ * alg 1 KEY_RSA
+ * 3 KEY_DSA
+ * 157 KEY_HMAC_MD5
+ * future algorithms TBD and registered with IANA.
+ * Returns
+ * 1 - The algorithm is available.
+ * 0 - The algorithm is not available.
+ */
+int
+dst_check_algorithm(const int alg)
+{
+ return (dst_t_func[alg] != NULL);
+}
+
+/*%
+ * dst_s_get_key_struct
+ * This function allocates key structure and fills in some of the
+ * fields of the structure.
+ * Parameters:
+ * name: the name of the key
+ * alg: the algorithm number
+ * flags: the dns flags of the key
+ * protocol: the dns protocol of the key
+ * bits: the size of the key
+ * Returns:
+ * NULL if error
+ * valid pointer otherwise
+ */
+static DST_KEY *
+dst_s_get_key_struct(const char *name, const int alg, const int flags,
+ const int protocol, const int bits)
+{
+ DST_KEY *new_key = NULL;
+
+ if (dst_check_algorithm(alg)) /*%< make sure alg is available */
+ new_key = (DST_KEY *) malloc(sizeof(*new_key));
+ if (new_key == NULL)
+ return (NULL);
+
+ memset(new_key, 0, sizeof(*new_key));
+ new_key->dk_key_name = strdup(name);
+ if (new_key->dk_key_name == NULL) {
+ free(new_key);
+ return (NULL);
+ }
+ new_key->dk_alg = alg;
+ new_key->dk_flags = flags;
+ new_key->dk_proto = protocol;
+ new_key->dk_KEY_struct = NULL;
+ new_key->dk_key_size = bits;
+ new_key->dk_func = dst_t_func[alg];
+ return (new_key);
+}
+
+/*%
+ * dst_compare_keys
+ * Compares two keys for equality.
+ * Parameters
+ * key1, key2 Two keys to be compared.
+ * Returns
+ * 0 The keys are equal.
+ * non-zero The keys are not equal.
+ */
+
+int
+dst_compare_keys(const DST_KEY *key1, const DST_KEY *key2)
+{
+ if (key1 == key2)
+ return (0);
+ if (key1 == NULL || key2 == NULL)
+ return (4);
+ if (key1->dk_alg != key2->dk_alg)
+ return (1);
+ if (key1->dk_key_size != key2->dk_key_size)
+ return (2);
+ if (key1->dk_id != key2->dk_id)
+ return (3);
+ return (key1->dk_func->compare(key1, key2));
+}
+
+/*%
+ * dst_sign_data
+ * An incremental signing function. Data is signed in steps.
+ * First the context must be initialized (SIG_MODE_INIT).
+ * Then data is hashed (SIG_MODE_UPDATE). Finally the signature
+ * itself is created (SIG_MODE_FINAL). This function can be called
+ * once with INIT, UPDATE and FINAL modes all set, or it can be
+ * called separately with a different mode set for each step. The
+ * UPDATE step can be repeated.
+ * Parameters
+ * mode A bit mask used to specify operation(s) to be performed.
+ * SIG_MODE_INIT 1 Initialize digest
+ * SIG_MODE_UPDATE 2 Add data to digest
+ * SIG_MODE_FINAL 4 Generate signature
+ * from signature
+ * SIG_MODE_ALL (SIG_MODE_INIT,SIG_MODE_UPDATE,SIG_MODE_FINAL
+ * data Data to be signed.
+ * len The length in bytes of data to be signed.
+ * in_key Contains a private key to sign with.
+ * KEY structures should be handled (created, converted,
+ * compared, stored, freed) by the DST.
+ * signature
+ * The location to which the signature will be written.
+ * sig_len Length of the signature field in bytes.
+ * Return
+ * 0 Successfull INIT or Update operation
+ * &gt;0 success FINAL (sign) operation
+ * &lt;0 failure
+ */
+
+int
+dst_sign_data(const int mode, DST_KEY *in_key, void **context,
+ const u_char *data, const int len,
+ u_char *signature, const int sig_len)
+{
+ DUMP(data, mode, len, "dst_sign_data()");
+
+ if (mode & SIG_MODE_FINAL &&
+ (in_key->dk_KEY_struct == NULL || signature == NULL))
+ return (MISSING_KEY_OR_SIGNATURE);
+
+ if (in_key->dk_func && in_key->dk_func->sign)
+ return (in_key->dk_func->sign(mode, in_key, context, data, len,
+ signature, sig_len));
+ return (UNKNOWN_KEYALG);
+}
+
+/*%
+ * dst_verify_data
+ * An incremental verify function. Data is verified in steps.
+ * First the context must be initialized (SIG_MODE_INIT).
+ * Then data is hashed (SIG_MODE_UPDATE). Finally the signature
+ * is verified (SIG_MODE_FINAL). This function can be called
+ * once with INIT, UPDATE and FINAL modes all set, or it can be
+ * called separately with a different mode set for each step. The
+ * UPDATE step can be repeated.
+ * Parameters
+ * mode Operations to perform this time.
+ * SIG_MODE_INIT 1 Initialize digest
+ * SIG_MODE_UPDATE 2 add data to digest
+ * SIG_MODE_FINAL 4 verify signature
+ * SIG_MODE_ALL
+ * (SIG_MODE_INIT,SIG_MODE_UPDATE,SIG_MODE_FINAL)
+ * data Data to pass through the hash function.
+ * len Length of the data in bytes.
+ * in_key Key for verification.
+ * signature Location of signature.
+ * sig_len Length of the signature in bytes.
+ * Returns
+ * 0 Verify success
+ * Non-Zero Verify Failure
+ */
+
+int
+dst_verify_data(const int mode, DST_KEY *in_key, void **context,
+ const u_char *data, const int len,
+ const u_char *signature, const int sig_len)
+{
+ DUMP(data, mode, len, "dst_verify_data()");
+ if (mode & SIG_MODE_FINAL &&
+ (in_key->dk_KEY_struct == NULL || signature == NULL))
+ return (MISSING_KEY_OR_SIGNATURE);
+
+ if (in_key->dk_func == NULL || in_key->dk_func->verify == NULL)
+ return (UNSUPPORTED_KEYALG);
+ return (in_key->dk_func->verify(mode, in_key, context, data, len,
+ signature, sig_len));
+}
+
+/*%
+ * dst_read_private_key
+ * Access a private key. First the list of private keys that have
+ * already been read in is searched, then the key accessed on disk.
+ * If the private key can be found, it is returned. If the key cannot
+ * be found, a null pointer is returned. The options specify required
+ * key characteristics. If the private key requested does not have
+ * these characteristics, it will not be read.
+ * Parameters
+ * in_keyname The private key name.
+ * in_id The id of the private key.
+ * options DST_FORCE_READ Read from disk - don't use a previously
+ * read key.
+ * DST_CAN_SIGN The key must be useable for signing.
+ * DST_NO_AUTHEN The key must be useable for authentication.
+ * DST_STANDARD Return any key
+ * Returns
+ * NULL If there is no key found in the current directory or
+ * this key has not been loaded before.
+ * !NULL Success - KEY structure returned.
+ */
+
+DST_KEY *
+dst_read_key(const char *in_keyname, const u_int16_t in_id,
+ const int in_alg, const int type)
+{
+ char keyname[PATH_MAX];
+ DST_KEY *dg_key = NULL, *pubkey = NULL;
+
+ if (!dst_check_algorithm(in_alg)) { /*%< make sure alg is available */
+ EREPORT(("dst_read_private_key(): Algorithm %d not suppored\n",
+ in_alg));
+ return (NULL);
+ }
+ if ((type & (DST_PUBLIC | DST_PRIVATE)) == 0)
+ return (NULL);
+ if (in_keyname == NULL) {
+ EREPORT(("dst_read_private_key(): Null key name passed in\n"));
+ return (NULL);
+ } else if (strlen(in_keyname) >= sizeof(keyname)) {
+ EREPORT(("dst_read_private_key(): keyname too big\n"));
+ return (NULL);
+ } else
+ strcpy(keyname, in_keyname);
+
+ /* before I read in the public key, check if it is allowed to sign */
+ if ((pubkey = dst_s_read_public_key(keyname, in_id, in_alg)) == NULL)
+ return (NULL);
+
+ if (type == DST_PUBLIC)
+ return pubkey;
+
+ if (!(dg_key = dst_s_get_key_struct(keyname, pubkey->dk_alg,
+ pubkey->dk_flags, pubkey->dk_proto,
+ 0)))
+ return (dg_key);
+ /* Fill in private key and some fields in the general key structure */
+ if (dst_s_read_private_key_file(keyname, dg_key, pubkey->dk_id,
+ pubkey->dk_alg) == 0)
+ dg_key = dst_free_key(dg_key);
+
+ (void)dst_free_key(pubkey);
+ return (dg_key);
+}
+
+int
+dst_write_key(const DST_KEY *key, const int type)
+{
+ int pub = 0, priv = 0;
+
+ if (key == NULL)
+ return (0);
+ if (!dst_check_algorithm(key->dk_alg)) { /*%< make sure alg is available */
+ EREPORT(("dst_write_key(): Algorithm %d not suppored\n",
+ key->dk_alg));
+ return (UNSUPPORTED_KEYALG);
+ }
+ if ((type & (DST_PRIVATE|DST_PUBLIC)) == 0)
+ return (0);
+
+ if (type & DST_PUBLIC)
+ if ((pub = dst_s_write_public_key(key)) < 0)
+ return (pub);
+ if (type & DST_PRIVATE)
+ if ((priv = dst_s_write_private_key(key)) < 0)
+ return (priv);
+ return (priv+pub);
+}
+
+/*%
+ * dst_write_private_key
+ * Write a private key to disk. The filename will be of the form:
+ * K&lt;key-&gt;dk_name&gt;+&lt;key-&gt;dk_alg+&gt;&lt;key-d&gt;k_id.&gt;&lt;private key suffix&gt;.
+ * If there is already a file with this name, an error is returned.
+ *
+ * Parameters
+ * key A DST managed key structure that contains
+ * all information needed about a key.
+ * Return
+ * &gt;= 0 Correct behavior. Returns length of encoded key value
+ * written to disk.
+ * &lt; 0 error.
+ */
+
+static int
+dst_s_write_private_key(const DST_KEY *key)
+{
+ u_char encoded_block[RAW_KEY_SIZE];
+ char file[PATH_MAX];
+ int len;
+ FILE *fp;
+
+ /* First encode the key into the portable key format */
+ if (key == NULL)
+ return (-1);
+ if (key->dk_KEY_struct == NULL)
+ return (0); /*%< null key has no private key */
+ if (key->dk_func == NULL || key->dk_func->to_file_fmt == NULL) {
+ EREPORT(("dst_write_private_key(): Unsupported operation %d\n",
+ key->dk_alg));
+ return (-5);
+ } else if ((len = key->dk_func->to_file_fmt(key, (char *)encoded_block,
+ sizeof(encoded_block))) <= 0) {
+ EREPORT(("dst_write_private_key(): Failed encoding private RSA bsafe key %d\n", len));
+ return (-8);
+ }
+ /* Now I can create the file I want to use */
+ dst_s_build_filename(file, key->dk_key_name, key->dk_id, key->dk_alg,
+ PRIVATE_KEY, PATH_MAX);
+
+ /* Do not overwrite an existing file */
+ if ((fp = dst_s_fopen(file, "w", 0600)) != NULL) {
+ int nn;
+ if ((nn = fwrite(encoded_block, 1, len, fp)) != len) {
+ EREPORT(("dst_write_private_key(): Write failure on %s %d != %d errno=%d\n",
+ file, len, nn, errno));
+ fclose(fp);
+ return (-5);
+ }
+ fclose(fp);
+ } else {
+ EREPORT(("dst_write_private_key(): Can not create file %s\n"
+ ,file));
+ return (-6);
+ }
+ memset(encoded_block, 0, len);
+ return (len);
+}
+
+/*%
+*
+ * dst_read_public_key
+ * Read a public key from disk and store in a DST key structure.
+ * Parameters
+ * in_name K&lt;in_name&gt;&lt;in_id&gt;.&lt;public key suffix&gt; is the
+ * filename of the key file to be read.
+ * Returns
+ * NULL If the key does not exist or no name is supplied.
+ * NON-NULL Initialized key structure if the key exists.
+ */
+
+static DST_KEY *
+dst_s_read_public_key(const char *in_name, const u_int16_t in_id, int in_alg)
+{
+ int flags, proto, alg, len, dlen;
+ int c;
+ char name[PATH_MAX], enckey[RAW_KEY_SIZE], *notspace;
+ u_char deckey[RAW_KEY_SIZE];
+ FILE *fp;
+
+ if (in_name == NULL) {
+ EREPORT(("dst_read_public_key(): No key name given\n"));
+ return (NULL);
+ }
+ if (dst_s_build_filename(name, in_name, in_id, in_alg, PUBLIC_KEY,
+ PATH_MAX) == -1) {
+ EREPORT(("dst_read_public_key(): Cannot make filename from %s, %d, and %s\n",
+ in_name, in_id, PUBLIC_KEY));
+ return (NULL);
+ }
+ /*
+ * Open the file and read it's formatted contents up to key
+ * File format:
+ * domain.name [ttl] [IN] KEY &lt;flags&gt; &lt;protocol&gt; &lt;algorithm&gt; &lt;key&gt;
+ * flags, proto, alg stored as decimal (or hex numbers FIXME).
+ * (FIXME: handle parentheses for line continuation.)
+ */
+ if ((fp = dst_s_fopen(name, "r", 0)) == NULL) {
+ EREPORT(("dst_read_public_key(): Public Key not found %s\n",
+ name));
+ return (NULL);
+ }
+ /* Skip domain name, which ends at first blank */
+ while ((c = getc(fp)) != EOF)
+ if (isspace(c))
+ break;
+ /* Skip blank to get to next field */
+ while ((c = getc(fp)) != EOF)
+ if (!isspace(c))
+ break;
+
+ /* Skip optional TTL -- if initial digit, skip whole word. */
+ if (isdigit(c)) {
+ while ((c = getc(fp)) != EOF)
+ if (isspace(c))
+ break;
+ while ((c = getc(fp)) != EOF)
+ if (!isspace(c))
+ break;
+ }
+ /* Skip optional "IN" */
+ if (c == 'I' || c == 'i') {
+ while ((c = getc(fp)) != EOF)
+ if (isspace(c))
+ break;
+ while ((c = getc(fp)) != EOF)
+ if (!isspace(c))
+ break;
+ }
+ /* Locate and skip "KEY" */
+ if (c != 'K' && c != 'k') {
+ EREPORT(("\"KEY\" doesn't appear in file: %s", name));
+ return NULL;
+ }
+ while ((c = getc(fp)) != EOF)
+ if (isspace(c))
+ break;
+ while ((c = getc(fp)) != EOF)
+ if (!isspace(c))
+ break;
+ ungetc(c, fp); /*%< return the charcter to the input field */
+ /* Handle hex!! FIXME. */
+
+ if (fscanf(fp, "%d %d %d", &flags, &proto, &alg) != 3) {
+ EREPORT(("dst_read_public_key(): Can not read flag/proto/alg field from %s\n"
+ ,name));
+ return (NULL);
+ }
+ /* read in the key string */
+ fgets(enckey, sizeof(enckey), fp);
+
+ /* If we aren't at end-of-file, something is wrong. */
+ while ((c = getc(fp)) != EOF)
+ if (!isspace(c))
+ break;
+ if (!feof(fp)) {
+ EREPORT(("Key too long in file: %s", name));
+ return NULL;
+ }
+ fclose(fp);
+
+ if ((len = strlen(enckey)) <= 0)
+ return (NULL);
+
+ /* discard \n */
+ enckey[--len] = '\0';
+
+ /* remove leading spaces */
+ for (notspace = (char *) enckey; isspace((*notspace)&0xff); len--)
+ notspace++;
+
+ dlen = b64_pton(notspace, deckey, sizeof(deckey));
+ if (dlen < 0) {
+ EREPORT(("dst_read_public_key: bad return from b64_pton = %d",
+ dlen));
+ return (NULL);
+ }
+ /* store key and info in a key structure that is returned */
+/* return dst_store_public_key(in_name, alg, proto, 666, flags, deckey,
+ dlen);*/
+ return dst_buffer_to_key(in_name, alg, flags, proto, deckey, dlen);
+}
+
+/*%
+ * dst_write_public_key
+ * Write a key to disk in DNS format.
+ * Parameters
+ * key Pointer to a DST key structure.
+ * Returns
+ * 0 Failure
+ * 1 Success
+ */
+
+static int
+dst_s_write_public_key(const DST_KEY *key)
+{
+ FILE *fp;
+ char filename[PATH_MAX];
+ u_char out_key[RAW_KEY_SIZE];
+ char enc_key[RAW_KEY_SIZE];
+ int len = 0;
+ int mode;
+
+ memset(out_key, 0, sizeof(out_key));
+ if (key == NULL) {
+ EREPORT(("dst_write_public_key(): No key specified \n"));
+ return (0);
+ } else if ((len = dst_key_to_dnskey(key, out_key, sizeof(out_key)))< 0)
+ return (0);
+
+ /* Make the filename */
+ if (dst_s_build_filename(filename, key->dk_key_name, key->dk_id,
+ key->dk_alg, PUBLIC_KEY, PATH_MAX) == -1) {
+ EREPORT(("dst_write_public_key(): Cannot make filename from %s, %d, and %s\n",
+ key->dk_key_name, key->dk_id, PUBLIC_KEY));
+ return (0);
+ }
+ /* XXX in general this should be a check for symmetric keys */
+ mode = (key->dk_alg == KEY_HMAC_MD5) ? 0600 : 0644;
+ /* create public key file */
+ if ((fp = dst_s_fopen(filename, "w+", mode)) == NULL) {
+ EREPORT(("DST_write_public_key: open of file:%s failed (errno=%d)\n",
+ filename, errno));
+ return (0);
+ }
+ /*write out key first base64 the key data */
+ if (key->dk_flags & DST_EXTEND_FLAG)
+ b64_ntop(&out_key[6], len - 6, enc_key, sizeof(enc_key));
+ else
+ b64_ntop(&out_key[4], len - 4, enc_key, sizeof(enc_key));
+ fprintf(fp, "%s IN KEY %d %d %d %s\n",
+ key->dk_key_name,
+ key->dk_flags, key->dk_proto, key->dk_alg, enc_key);
+ fclose(fp);
+ return (1);
+}
+
+/*%
+ * dst_dnskey_to_public_key
+ * This function converts the contents of a DNS KEY RR into a DST
+ * key structure.
+ * Paramters
+ * len Length of the RDATA of the KEY RR RDATA
+ * rdata A pointer to the the KEY RR RDATA.
+ * in_name Key name to be stored in key structure.
+ * Returns
+ * NULL Failure
+ * NON-NULL Success. Pointer to key structure.
+ * Caller's responsibility to free() it.
+ */
+
+DST_KEY *
+dst_dnskey_to_key(const char *in_name, const u_char *rdata, const int len)
+{
+ DST_KEY *key_st;
+ int alg ;
+ int start = DST_KEY_START;
+
+ if (rdata == NULL || len <= DST_KEY_ALG) /*%< no data */
+ return (NULL);
+ alg = (u_int8_t) rdata[DST_KEY_ALG];
+ if (!dst_check_algorithm(alg)) { /*%< make sure alg is available */
+ EREPORT(("dst_dnskey_to_key(): Algorithm %d not suppored\n",
+ alg));
+ return (NULL);
+ }
+
+ if (in_name == NULL)
+ return (NULL);
+
+ if ((key_st = dst_s_get_key_struct(in_name, alg, 0, 0, 0)) == NULL)
+ return (NULL);
+
+ key_st->dk_id = dst_s_dns_key_id(rdata, len);
+ key_st->dk_flags = dst_s_get_int16(rdata);
+ key_st->dk_proto = (u_int16_t) rdata[DST_KEY_PROT];
+ if (key_st->dk_flags & DST_EXTEND_FLAG) {
+ u_int32_t ext_flags;
+ ext_flags = (u_int32_t) dst_s_get_int16(&rdata[DST_EXT_FLAG]);
+ key_st->dk_flags = key_st->dk_flags | (ext_flags << 16);
+ start += 2;
+ }
+ /*
+ * now point to the begining of the data representing the encoding
+ * of the key
+ */
+ if (key_st->dk_func && key_st->dk_func->from_dns_key) {
+ if (key_st->dk_func->from_dns_key(key_st, &rdata[start],
+ len - start) > 0)
+ return (key_st);
+ } else
+ EREPORT(("dst_dnskey_to_public_key(): unsuppored alg %d\n",
+ alg));
+
+ SAFE_FREE(key_st);
+ return (key_st);
+}
+
+/*%
+ * dst_public_key_to_dnskey
+ * Function to encode a public key into DNS KEY wire format
+ * Parameters
+ * key Key structure to encode.
+ * out_storage Location to write the encoded key to.
+ * out_len Size of the output array.
+ * Returns
+ * <0 Failure
+ * >=0 Number of bytes written to out_storage
+ */
+
+int
+dst_key_to_dnskey(const DST_KEY *key, u_char *out_storage,
+ const int out_len)
+{
+ u_int16_t val;
+ int loc = 0;
+ int enc_len = 0;
+ if (key == NULL)
+ return (-1);
+
+ if (!dst_check_algorithm(key->dk_alg)) { /*%< make sure alg is available */
+ EREPORT(("dst_key_to_dnskey(): Algorithm %d not suppored\n",
+ key->dk_alg));
+ return (UNSUPPORTED_KEYALG);
+ }
+ memset(out_storage, 0, out_len);
+ val = (u_int16_t)(key->dk_flags & 0xffff);
+ dst_s_put_int16(out_storage, val);
+ loc += 2;
+
+ out_storage[loc++] = (u_char) key->dk_proto;
+ out_storage[loc++] = (u_char) key->dk_alg;
+
+ if (key->dk_flags > 0xffff) { /*%< Extended flags */
+ val = (u_int16_t)((key->dk_flags >> 16) & 0xffff);
+ dst_s_put_int16(&out_storage[loc], val);
+ loc += 2;
+ }
+ if (key->dk_KEY_struct == NULL)
+ return (loc);
+ if (key->dk_func && key->dk_func->to_dns_key) {
+ enc_len = key->dk_func->to_dns_key(key,
+ (u_char *) &out_storage[loc],
+ out_len - loc);
+ if (enc_len > 0)
+ return (enc_len + loc);
+ else
+ return (-1);
+ } else
+ EREPORT(("dst_key_to_dnskey(): Unsupported ALG %d\n",
+ key->dk_alg));
+ return (-1);
+}
+
+/*%
+ * dst_buffer_to_key
+ * Function to encode a string of raw data into a DST key
+ * Parameters
+ * alg The algorithm (HMAC only)
+ * key A pointer to the data
+ * keylen The length of the data
+ * Returns
+ * NULL an error occurred
+ * NON-NULL the DST key
+ */
+DST_KEY *
+dst_buffer_to_key(const char *key_name, /*!< name of the key */
+ const int alg, /*!< algorithm */
+ const int flags, /*!< dns flags */
+ const int protocol, /*!< dns protocol */
+ const u_char *key_buf, /*!< key in dns wire fmt */
+ const int key_len) /*!< size of key */
+{
+
+ DST_KEY *dkey = NULL;
+ int dnslen;
+ u_char dns[2048];
+
+ if (!dst_check_algorithm(alg)) { /*%< make sure alg is available */
+ EREPORT(("dst_buffer_to_key(): Algorithm %d not suppored\n", alg));
+ return (NULL);
+ }
+
+ dkey = dst_s_get_key_struct(key_name, alg, flags, protocol, -1);
+
+ if (dkey == NULL || dkey->dk_func == NULL ||
+ dkey->dk_func->from_dns_key == NULL)
+ return (dst_free_key(dkey));
+
+ if (dkey->dk_func->from_dns_key(dkey, key_buf, key_len) < 0) {
+ EREPORT(("dst_buffer_to_key(): dst_buffer_to_hmac failed\n"));
+ return (dst_free_key(dkey));
+ }
+
+ dnslen = dst_key_to_dnskey(dkey, dns, sizeof(dns));
+ dkey->dk_id = dst_s_dns_key_id(dns, dnslen);
+ return (dkey);
+}
+
+int
+dst_key_to_buffer(DST_KEY *key, u_char *out_buff, int buf_len)
+{
+ int len;
+ /* this function will extrac the secret of HMAC into a buffer */
+ if (key == NULL)
+ return (0);
+ if (key->dk_func != NULL && key->dk_func->to_dns_key != NULL) {
+ len = key->dk_func->to_dns_key(key, out_buff, buf_len);
+ if (len < 0)
+ return (0);
+ return (len);
+ }
+ return (0);
+}
+
+/*%
+ * dst_s_read_private_key_file
+ * Function reads in private key from a file.
+ * Fills out the KEY structure.
+ * Parameters
+ * name Name of the key to be read.
+ * pk_key Structure that the key is returned in.
+ * in_id Key identifier (tag)
+ * Return
+ * 1 if everthing works
+ * 0 if there is any problem
+ */
+
+static int
+dst_s_read_private_key_file(char *name, DST_KEY *pk_key, u_int16_t in_id,
+ int in_alg)
+{
+ int cnt, alg, len, major, minor, file_major, file_minor;
+ int ret, id;
+ char filename[PATH_MAX];
+ u_char in_buff[RAW_KEY_SIZE], *p;
+ FILE *fp;
+ int dnslen;
+ u_char dns[2048];
+
+ if (name == NULL || pk_key == NULL) {
+ EREPORT(("dst_read_private_key_file(): No key name given\n"));
+ return (0);
+ }
+ /* Make the filename */
+ if (dst_s_build_filename(filename, name, in_id, in_alg, PRIVATE_KEY,
+ PATH_MAX) == -1) {
+ EREPORT(("dst_read_private_key(): Cannot make filename from %s, %d, and %s\n",
+ name, in_id, PRIVATE_KEY));
+ return (0);
+ }
+ /* first check if we can find the key file */
+ if ((fp = dst_s_fopen(filename, "r", 0)) == NULL) {
+ EREPORT(("dst_s_read_private_key_file: Could not open file %s in directory %s\n",
+ filename, dst_path[0] ? dst_path :
+ (char *) getcwd(NULL, PATH_MAX - 1)));
+ return (0);
+ }
+ /* now read the header info from the file */
+ if ((cnt = fread(in_buff, 1, sizeof(in_buff), fp)) < 5) {
+ fclose(fp);
+ EREPORT(("dst_s_read_private_key_file: error reading file %s (empty file)\n",
+ filename));
+ return (0);
+ }
+ /* decrypt key */
+ fclose(fp);
+ if (memcmp(in_buff, "Private-key-format: v", 20) != 0)
+ goto fail;
+ len = cnt;
+ p = in_buff;
+
+ if (!dst_s_verify_str((const char **) (void *)&p,
+ "Private-key-format: v")) {
+ EREPORT(("dst_s_read_private_key_file(): Not a Key file/Decrypt failed %s\n", name));
+ goto fail;
+ }
+ /* read in file format */
+ sscanf((char *)p, "%d.%d", &file_major, &file_minor);
+ sscanf(KEY_FILE_FORMAT, "%d.%d", &major, &minor);
+ if (file_major < 1) {
+ EREPORT(("dst_s_read_private_key_file(): Unknown keyfile %d.%d version for %s\n",
+ file_major, file_minor, name));
+ goto fail;
+ } else if (file_major > major || file_minor > minor)
+ EREPORT((
+ "dst_s_read_private_key_file(): Keyfile %s version higher than mine %d.%d MAY FAIL\n",
+ name, file_major, file_minor));
+
+ while (*p++ != '\n') ; /*%< skip to end of line */
+
+ if (!dst_s_verify_str((const char **) (void *)&p, "Algorithm: "))
+ goto fail;
+
+ if (sscanf((char *)p, "%d", &alg) != 1)
+ goto fail;
+ while (*p++ != '\n') ; /*%< skip to end of line */
+
+ if (pk_key->dk_key_name && !strcmp(pk_key->dk_key_name, name))
+ SAFE_FREE2(pk_key->dk_key_name, strlen(pk_key->dk_key_name));
+ pk_key->dk_key_name = (char *) strdup(name);
+
+ /* allocate and fill in key structure */
+ if (pk_key->dk_func == NULL || pk_key->dk_func->from_file_fmt == NULL)
+ goto fail;
+
+ ret = pk_key->dk_func->from_file_fmt(pk_key, (char *)p, &in_buff[len] - p);
+ if (ret < 0)
+ goto fail;
+
+ dnslen = dst_key_to_dnskey(pk_key, dns, sizeof(dns));
+ id = dst_s_dns_key_id(dns, dnslen);
+
+ /* Make sure the actual key tag matches the input tag used in the filename
+ */
+ if (id != in_id) {
+ EREPORT(("dst_s_read_private_key_file(): actual tag of key read %d != input tag used to build filename %d.\n", id, in_id));
+ goto fail;
+ }
+ pk_key->dk_id = (u_int16_t) id;
+ pk_key->dk_alg = alg;
+ memset(in_buff, 0, cnt);
+ return (1);
+
+ fail:
+ memset(in_buff, 0, cnt);
+ return (0);
+}
+
+/*%
+ * Generate and store a public/private keypair.
+ * Keys will be stored in formatted files.
+ *
+ * Parameters
+ &
+ *\par name Name of the new key. Used to create key files
+ *\li K&lt;name&gt;+&lt;alg&gt;+&lt;id&gt;.public and K&lt;name&gt;+&lt;alg&gt;+&lt;id&gt;.private.
+ *\par bits Size of the new key in bits.
+ *\par exp What exponent to use:
+ *\li 0 use exponent 3
+ *\li non-zero use Fermant4
+ *\par flags The default value of the DNS Key flags.
+ *\li The DNS Key RR Flag field is defined in RFC2065,
+ * section 3.3. The field has 16 bits.
+ *\par protocol
+ *\li Default value of the DNS Key protocol field.
+ *\li The DNS Key protocol field is defined in RFC2065,
+ * section 3.4. The field has 8 bits.
+ *\par alg What algorithm to use. Currently defined:
+ *\li KEY_RSA 1
+ *\li KEY_DSA 3
+ *\li KEY_HMAC 157
+ *\par out_id The key tag is returned.
+ *
+ * Return
+ *\li NULL Failure
+ *\li non-NULL the generated key pair
+ * Caller frees the result, and its dk_name pointer.
+ */
+DST_KEY *
+dst_generate_key(const char *name, const int bits, const int exp,
+ const int flags, const int protocol, const int alg)
+{
+ DST_KEY *new_key = NULL;
+ int dnslen;
+ u_char dns[2048];
+
+ if (name == NULL)
+ return (NULL);
+
+ if (!dst_check_algorithm(alg)) { /*%< make sure alg is available */
+ EREPORT(("dst_generate_key(): Algorithm %d not suppored\n", alg));
+ return (NULL);
+ }
+
+ new_key = dst_s_get_key_struct(name, alg, flags, protocol, bits);
+ if (new_key == NULL)
+ return (NULL);
+ if (bits == 0) /*%< null key we are done */
+ return (new_key);
+ if (new_key->dk_func == NULL || new_key->dk_func->generate == NULL) {
+ EREPORT(("dst_generate_key_pair():Unsupported algorithm %d\n",
+ alg));
+ return (dst_free_key(new_key));
+ }
+ if (new_key->dk_func->generate(new_key, exp) <= 0) {
+ EREPORT(("dst_generate_key_pair(): Key generation failure %s %d %d %d\n",
+ new_key->dk_key_name, new_key->dk_alg,
+ new_key->dk_key_size, exp));
+ return (dst_free_key(new_key));
+ }
+
+ dnslen = dst_key_to_dnskey(new_key, dns, sizeof(dns));
+ if (dnslen != UNSUPPORTED_KEYALG)
+ new_key->dk_id = dst_s_dns_key_id(dns, dnslen);
+ else
+ new_key->dk_id = 0;
+
+ return (new_key);
+}
+
+/*%
+ * Release all data structures pointed to by a key structure.
+ *
+ * Parameters
+ *\li f_key Key structure to be freed.
+ */
+
+DST_KEY *
+dst_free_key(DST_KEY *f_key)
+{
+
+ if (f_key == NULL)
+ return (f_key);
+ if (f_key->dk_func && f_key->dk_func->destroy)
+ f_key->dk_KEY_struct =
+ f_key->dk_func->destroy(f_key->dk_KEY_struct);
+ else {
+ EREPORT(("dst_free_key(): Unknown key alg %d\n",
+ f_key->dk_alg));
+ }
+ if (f_key->dk_KEY_struct) {
+ free(f_key->dk_KEY_struct);
+ f_key->dk_KEY_struct = NULL;
+ }
+ if (f_key->dk_key_name)
+ SAFE_FREE(f_key->dk_key_name);
+ SAFE_FREE(f_key);
+ return (NULL);
+}
+
+/*%
+ * Return the maximim size of signature from the key specified in bytes
+ *
+ * Parameters
+ *\li key
+ *
+ * Returns
+ * \li bytes
+ */
+int
+dst_sig_size(DST_KEY *key) {
+ switch (key->dk_alg) {
+ case KEY_HMAC_MD5:
+ return (16);
+ case KEY_HMAC_SHA1:
+ return (20);
+ case KEY_RSA:
+ return (key->dk_key_size + 7) / 8;
+ case KEY_DSA:
+ return (40);
+ default:
+ EREPORT(("dst_sig_size(): Unknown key alg %d\n", key->dk_alg));
+ return -1;
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/dst/dst_internal.h b/usr/src/lib/libresolv2_joy/common/dst/dst_internal.h
new file mode 100644
index 0000000000..e9bc6fc08d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/dst/dst_internal.h
@@ -0,0 +1,155 @@
+#ifndef DST_INTERNAL_H
+#define DST_INTERNAL_H
+
+/*
+ * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+ *
+ * Permission to use, copy modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
+ */
+#include <limits.h>
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+# include <sys/bitypes.h>
+#else
+# include <sys/types.h>
+#endif
+
+#ifndef PATH_MAX
+# ifdef POSIX_PATH_MAX
+# define PATH_MAX POSIX_PATH_MAX
+# else
+# define PATH_MAX 255 /*%< this is the value of POSIX_PATH_MAX */
+# endif
+#endif
+
+typedef struct dst_key {
+ char *dk_key_name; /*%< name of the key */
+ int dk_key_size; /*%< this is the size of the key in bits */
+ int dk_proto; /*%< what protocols this key can be used for */
+ int dk_alg; /*%< algorithm number from key record */
+ u_int32_t dk_flags; /*%< and the flags of the public key */
+ u_int16_t dk_id; /*%< identifier of the key */
+ void *dk_KEY_struct; /*%< pointer to key in crypto pkg fmt */
+ struct dst_func *dk_func; /*%< point to cryptto pgk specific function table */
+} DST_KEY;
+#define HAS_DST_KEY
+
+#include <isc/dst.h>
+/*
+ * define what crypto systems are supported for RSA,
+ * BSAFE is prefered over RSAREF; only one can be set at any time
+ */
+#if defined(BSAFE) && defined(RSAREF)
+# error "Cannot have both BSAFE and RSAREF defined"
+#endif
+
+/* Declare dst_lib specific constants */
+#define KEY_FILE_FORMAT "1.2"
+
+/* suffixes for key file names */
+#define PRIVATE_KEY "private"
+#define PUBLIC_KEY "key"
+
+/* error handling */
+#ifdef REPORT_ERRORS
+#define EREPORT(str) printf str
+#else
+#define EREPORT(str) (void)0
+#endif
+
+/* use our own special macro to FRRE memory */
+
+#ifndef SAFE_FREE
+#define SAFE_FREE(a) \
+do{if(a != NULL){memset(a,0, sizeof(*a)); free(a); a=NULL;}} while (0)
+#define SAFE_FREE2(a,s) if (a != NULL && (long)s > 0){memset(a,0, s);free(a); a=NULL;}
+#endif
+
+typedef struct dst_func {
+ int (*sign)(const int mode, DST_KEY *key, void **context,
+ const u_int8_t *data, const int len,
+ u_int8_t *signature, const int sig_len);
+ int (*verify)(const int mode, DST_KEY *key, void **context,
+ const u_int8_t *data, const int len,
+ const u_int8_t *signature, const int sig_len);
+ int (*compare)(const DST_KEY *key1, const DST_KEY *key2);
+ int (*generate)(DST_KEY *key, int parms);
+ void *(*destroy)(void *key);
+ /* conversion functions */
+ int (*to_dns_key)(const DST_KEY *key, u_int8_t *out,
+ const int out_len);
+ int (*from_dns_key)(DST_KEY *key, const u_int8_t *str,
+ const int str_len);
+ int (*to_file_fmt)(const DST_KEY *key, char *out,
+ const int out_len);
+ int (*from_file_fmt)(DST_KEY *key, const char *out,
+ const int out_len);
+
+} dst_func;
+
+extern dst_func *dst_t_func[DST_MAX_ALGS];
+extern const char *key_file_fmt_str;
+extern const char *dst_path;
+
+#ifndef DST_HASH_SIZE
+#define DST_HASH_SIZE 20 /*%< RIPEMD160 and SHA-1 are 20 bytes MD5 is 16 */
+#endif
+
+int dst_bsafe_init(void);
+
+int dst_rsaref_init(void);
+
+int dst_hmac_md5_init(void);
+
+int dst_cylink_init(void);
+
+int dst_eay_dss_init(void);
+
+/* from higher level support routines */
+int dst_s_calculate_bits( const u_int8_t *str, const int max_bits);
+int dst_s_verify_str( const char **buf, const char *str);
+
+
+/* conversion between dns names and key file names */
+size_t dst_s_filename_length( const char *name, const char *suffix);
+int dst_s_build_filename( char *filename, const char *name,
+ u_int16_t id, int alg, const char *suffix,
+ size_t filename_length);
+
+FILE *dst_s_fopen (const char *filename, const char *mode, int perm);
+
+/*%
+ * read and write network byte order into u_int?_t
+ * all of these should be retired
+ */
+u_int16_t dst_s_get_int16( const u_int8_t *buf);
+void dst_s_put_int16( u_int8_t *buf, const u_int16_t val);
+
+u_int32_t dst_s_get_int32( const u_int8_t *buf);
+void dst_s_put_int32( u_int8_t *buf, const u_int32_t val);
+
+#ifdef DUMP
+# undef DUMP
+# define DUMP(a,b,c,d) dst_s_dump(a,b,c,d)
+#else
+# define DUMP(a,b,c,d)
+#endif
+void
+dst_s_dump(const int mode, const u_char *data, const int size,
+ const char *msg);
+
+
+
+#endif /* DST_INTERNAL_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/dst/hmac_link.c b/usr/src/lib/libresolv2_joy/common/dst/hmac_link.c
new file mode 100644
index 0000000000..23925e4269
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/dst/hmac_link.c
@@ -0,0 +1,491 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#ifdef HMAC_MD5
+#ifndef LINT
+static const char rcsid[] = "$Header: /proj/cvs/prod/libbind/dst/hmac_link.c,v 1.8 2007/09/24 17:18:25 each Exp $";
+#endif
+/*
+ * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+ *
+ * Permission to use, copy modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
+ */
+
+/*%
+ * This file contains an implementation of the HMAC-MD5 algorithm.
+ */
+#include "port_before.h"
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include "dst_internal.h"
+
+#ifdef USE_MD5
+# ifndef HAVE_MD5
+# include "md5.h"
+# else
+# ifdef SOLARIS2
+# include <sys/md5.h>
+# endif
+# endif
+# ifndef _MD5_H_
+# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */
+# endif
+#endif
+
+#include "port_after.h"
+
+
+#define HMAC_LEN 64
+#define HMAC_IPAD 0x36
+#define HMAC_OPAD 0x5c
+#define MD5_LEN 16
+
+
+typedef struct hmackey {
+ u_char hk_ipad[64], hk_opad[64];
+} HMAC_Key;
+
+
+/**************************************************************************
+ * dst_hmac_md5_sign
+ * Call HMAC signing functions to sign a block of data.
+ * There are three steps to signing, INIT (initialize structures),
+ * UPDATE (hash (more) data), FINAL (generate a signature). This
+ * routine performs one or more of these steps.
+ * Parameters
+ * mode SIG_MODE_INIT, SIG_MODE_UPDATE and/or SIG_MODE_FINAL.
+ * priv_key key to use for signing.
+ * context the context to be used in this digest
+ * data data to be signed.
+ * len length in bytes of data.
+ * signature location to store signature.
+ * sig_len size of the signature location
+ * returns
+ * N Success on SIG_MODE_FINAL = returns signature length in bytes
+ * 0 Success on SIG_MODE_INIT and UPDATE
+ * <0 Failure
+ */
+
+static int
+dst_hmac_md5_sign(const int mode, DST_KEY *d_key, void **context,
+ const u_char *data, const int len,
+ u_char *signature, const int sig_len)
+{
+ HMAC_Key *key;
+ int sign_len = 0;
+ MD5_CTX *ctx = NULL;
+
+ if (d_key == NULL || d_key->dk_KEY_struct == NULL)
+ return (-1);
+
+ if (mode & SIG_MODE_INIT)
+ ctx = (MD5_CTX *) malloc(sizeof(*ctx));
+ else if (context)
+ ctx = (MD5_CTX *) *context;
+ if (ctx == NULL)
+ return (-1);
+
+ key = (HMAC_Key *) d_key->dk_KEY_struct;
+
+ if (mode & SIG_MODE_INIT) {
+ MD5Init(ctx);
+ MD5Update(ctx, key->hk_ipad, HMAC_LEN);
+ }
+
+ if ((mode & SIG_MODE_UPDATE) && (data && len > 0))
+ MD5Update(ctx, data, len);
+
+ if (mode & SIG_MODE_FINAL) {
+ if (signature == NULL || sig_len < MD5_LEN)
+ return (SIGN_FINAL_FAILURE);
+ MD5Final(signature, ctx);
+
+ /* perform outer MD5 */
+ MD5Init(ctx);
+ MD5Update(ctx, key->hk_opad, HMAC_LEN);
+ MD5Update(ctx, signature, MD5_LEN);
+ MD5Final(signature, ctx);
+ sign_len = MD5_LEN;
+ SAFE_FREE(ctx);
+ }
+ else {
+ if (context == NULL)
+ return (-1);
+ *context = (void *) ctx;
+ }
+ return (sign_len);
+}
+
+
+/**************************************************************************
+ * dst_hmac_md5_verify()
+ * Calls HMAC verification routines. There are three steps to
+ * verification, INIT (initialize structures), UPDATE (hash (more) data),
+ * FINAL (generate a signature). This routine performs one or more of
+ * these steps.
+ * Parameters
+ * mode SIG_MODE_INIT, SIG_MODE_UPDATE and/or SIG_MODE_FINAL.
+ * dkey key to use for verify.
+ * data data signed.
+ * len length in bytes of data.
+ * signature signature.
+ * sig_len length in bytes of signature.
+ * returns
+ * 0 Success
+ * <0 Failure
+ */
+
+static int
+dst_hmac_md5_verify(const int mode, DST_KEY *d_key, void **context,
+ const u_char *data, const int len,
+ const u_char *signature, const int sig_len)
+{
+ HMAC_Key *key;
+ MD5_CTX *ctx = NULL;
+
+ if (d_key == NULL || d_key->dk_KEY_struct == NULL)
+ return (-1);
+
+ if (mode & SIG_MODE_INIT)
+ ctx = (MD5_CTX *) malloc(sizeof(*ctx));
+ else if (context)
+ ctx = (MD5_CTX *) *context;
+ if (ctx == NULL)
+ return (-1);
+
+ key = (HMAC_Key *) d_key->dk_KEY_struct;
+ if (mode & SIG_MODE_INIT) {
+ MD5Init(ctx);
+ MD5Update(ctx, key->hk_ipad, HMAC_LEN);
+ }
+ if ((mode & SIG_MODE_UPDATE) && (data && len > 0))
+ MD5Update(ctx, data, len);
+
+ if (mode & SIG_MODE_FINAL) {
+ u_char digest[MD5_LEN];
+ if (signature == NULL || key == NULL || sig_len != MD5_LEN)
+ return (VERIFY_FINAL_FAILURE);
+ MD5Final(digest, ctx);
+
+ /* perform outer MD5 */
+ MD5Init(ctx);
+ MD5Update(ctx, key->hk_opad, HMAC_LEN);
+ MD5Update(ctx, digest, MD5_LEN);
+ MD5Final(digest, ctx);
+
+ SAFE_FREE(ctx);
+ if (memcmp(digest, signature, MD5_LEN) != 0)
+ return (VERIFY_FINAL_FAILURE);
+ }
+ else {
+ if (context == NULL)
+ return (-1);
+ *context = (void *) ctx;
+ }
+ return (0);
+}
+
+
+/**************************************************************************
+ * dst_buffer_to_hmac_md5
+ * Converts key from raw data to an HMAC Key
+ * This function gets in a pointer to the data
+ * Parameters
+ * hkey the HMAC key to be filled in
+ * key the key in raw format
+ * keylen the length of the key
+ * Return
+ * 0 Success
+ * <0 Failure
+ */
+static int
+dst_buffer_to_hmac_md5(DST_KEY *dkey, const u_char *key, const int keylen)
+{
+ int i;
+ HMAC_Key *hkey = NULL;
+ MD5_CTX ctx;
+ int local_keylen = keylen;
+ u_char tk[MD5_LEN];
+
+ if (dkey == NULL || key == NULL || keylen < 0)
+ return (-1);
+
+ if ((hkey = (HMAC_Key *) malloc(sizeof(HMAC_Key))) == NULL)
+ return (-2);
+
+ memset(hkey->hk_ipad, 0, sizeof(hkey->hk_ipad));
+ memset(hkey->hk_opad, 0, sizeof(hkey->hk_opad));
+
+ /* if key is longer than HMAC_LEN bytes reset it to key=MD5(key) */
+ if (keylen > HMAC_LEN) {
+ MD5Init(&ctx);
+ MD5Update(&ctx, key, keylen);
+ MD5Final(tk, &ctx);
+ memset((void *) &ctx, 0, sizeof(ctx));
+ key = tk;
+ local_keylen = MD5_LEN;
+ }
+ /* start out by storing key in pads */
+ memcpy(hkey->hk_ipad, key, local_keylen);
+ memcpy(hkey->hk_opad, key, local_keylen);
+
+ /* XOR key with hk_ipad and opad values */
+ for (i = 0; i < HMAC_LEN; i++) {
+ hkey->hk_ipad[i] ^= HMAC_IPAD;
+ hkey->hk_opad[i] ^= HMAC_OPAD;
+ }
+ dkey->dk_key_size = local_keylen;
+ dkey->dk_KEY_struct = (void *) hkey;
+ return (1);
+}
+
+
+/**************************************************************************
+ * dst_hmac_md5_key_to_file_format
+ * Encodes an HMAC Key into the portable file format.
+ * Parameters
+ * hkey HMAC KEY structure
+ * buff output buffer
+ * buff_len size of output buffer
+ * Return
+ * 0 Failure - null input hkey
+ * -1 Failure - not enough space in output area
+ * N Success - Length of data returned in buff
+ */
+
+static int
+dst_hmac_md5_key_to_file_format(const DST_KEY *dkey, char *buff,
+ const int buff_len)
+{
+ char *bp;
+ int len, i, key_len;
+ u_char key[HMAC_LEN];
+ HMAC_Key *hkey;
+
+ if (dkey == NULL || dkey->dk_KEY_struct == NULL)
+ return (0);
+ /*
+ * Using snprintf() would be so much simpler here.
+ */
+ if (buff == NULL ||
+ buff_len <= (int)(strlen(key_file_fmt_str) +
+ strlen(KEY_FILE_FORMAT) + 4))
+ return (-1); /*%< no OR not enough space in output area */
+ hkey = (HMAC_Key *) dkey->dk_KEY_struct;
+ memset(buff, 0, buff_len); /*%< just in case */
+ /* write file header */
+ sprintf(buff, key_file_fmt_str, KEY_FILE_FORMAT, KEY_HMAC_MD5, "HMAC");
+
+ bp = buff + strlen(buff);
+
+ memset(key, 0, HMAC_LEN);
+ for (i = 0; i < HMAC_LEN; i++)
+ key[i] = hkey->hk_ipad[i] ^ HMAC_IPAD;
+ for (i = HMAC_LEN - 1; i >= 0; i--)
+ if (key[i] != 0)
+ break;
+ key_len = i + 1;
+
+ if (buff_len - (bp - buff) < 6)
+ return (-1);
+ strcat(bp, "Key: ");
+ bp += strlen("Key: ");
+
+ len = b64_ntop(key, key_len, bp, buff_len - (bp - buff));
+ if (len < 0)
+ return (-1);
+ bp += len;
+ if (buff_len - (bp - buff) < 2)
+ return (-1);
+ *(bp++) = '\n';
+ *bp = '\0';
+
+ return (bp - buff);
+}
+
+
+/**************************************************************************
+ * dst_hmac_md5_key_from_file_format
+ * Converts contents of a key file into an HMAC key.
+ * Parameters
+ * hkey structure to put key into
+ * buff buffer containing the encoded key
+ * buff_len the length of the buffer
+ * Return
+ * n >= 0 Foot print of the key converted
+ * n < 0 Error in conversion
+ */
+
+static int
+dst_hmac_md5_key_from_file_format(DST_KEY *dkey, const char *buff,
+ const int buff_len)
+{
+ const char *p = buff, *eol;
+ u_char key[HMAC_LEN+1]; /* b64_pton needs more than 64 bytes do decode
+ * it should probably be fixed rather than doing
+ * this
+ */
+ u_char *tmp;
+ int key_len, len;
+
+ if (dkey == NULL)
+ return (-2);
+ if (buff == NULL || buff_len < 0)
+ return (-1);
+
+ memset(key, 0, sizeof(key));
+
+ if (!dst_s_verify_str(&p, "Key: "))
+ return (-3);
+
+ eol = strchr(p, '\n');
+ if (eol == NULL)
+ return (-4);
+ len = eol - p;
+ tmp = malloc(len + 2);
+ if (tmp == NULL)
+ return (-5);
+ memcpy(tmp, p, len);
+ *(tmp + len) = 0x0;
+ key_len = b64_pton((char *)tmp, key, HMAC_LEN+1); /*%< see above */
+ SAFE_FREE2(tmp, len + 2);
+
+ if (dst_buffer_to_hmac_md5(dkey, key, key_len) < 0) {
+ return (-6);
+ }
+ return (0);
+}
+
+/*%
+ * dst_hmac_md5_to_dns_key()
+ * function to extract hmac key from DST_KEY structure
+ * intput:
+ * in_key: HMAC-MD5 key
+ * output:
+ * out_str: buffer to write ot
+ * out_len: size of output buffer
+ * returns:
+ * number of bytes written to output buffer
+ */
+static int
+dst_hmac_md5_to_dns_key(const DST_KEY *in_key, u_char *out_str,
+ const int out_len)
+{
+
+ HMAC_Key *hkey;
+ int i;
+
+ if (in_key == NULL || in_key->dk_KEY_struct == NULL ||
+ out_len <= in_key->dk_key_size || out_str == NULL)
+ return (-1);
+
+ hkey = (HMAC_Key *) in_key->dk_KEY_struct;
+ for (i = 0; i < in_key->dk_key_size; i++)
+ out_str[i] = hkey->hk_ipad[i] ^ HMAC_IPAD;
+ return (i);
+}
+
+/**************************************************************************
+ * dst_hmac_md5_compare_keys
+ * Compare two keys for equality.
+ * Return
+ * 0 The keys are equal
+ * NON-ZERO The keys are not equal
+ */
+
+static int
+dst_hmac_md5_compare_keys(const DST_KEY *key1, const DST_KEY *key2)
+{
+ HMAC_Key *hkey1 = (HMAC_Key *) key1->dk_KEY_struct;
+ HMAC_Key *hkey2 = (HMAC_Key *) key2->dk_KEY_struct;
+ return memcmp(hkey1->hk_ipad, hkey2->hk_ipad, HMAC_LEN);
+}
+
+/**************************************************************************
+ * dst_hmac_md5_free_key_structure
+ * Frees all (none) dynamically allocated structures in hkey
+ */
+
+static void *
+dst_hmac_md5_free_key_structure(void *key)
+{
+ HMAC_Key *hkey = key;
+ SAFE_FREE(hkey);
+ return (NULL);
+}
+
+
+/***************************************************************************
+ * dst_hmac_md5_generate_key
+ * Creates a HMAC key of size size with a maximum size of 63 bytes
+ * generating a HMAC key larger than 63 bytes makes no sense as that key
+ * is digested before use.
+ */
+
+static int
+dst_hmac_md5_generate_key(DST_KEY *key, const int nothing)
+{
+ (void)key;
+ (void)nothing;
+ return (-1);
+}
+
+/*%
+ * dst_hmac_md5_init() Function to answer set up function pointers for HMAC
+ * related functions
+ */
+int
+dst_hmac_md5_init()
+{
+ if (dst_t_func[KEY_HMAC_MD5] != NULL)
+ return (1);
+ dst_t_func[KEY_HMAC_MD5] = malloc(sizeof(struct dst_func));
+ if (dst_t_func[KEY_HMAC_MD5] == NULL)
+ return (0);
+ memset(dst_t_func[KEY_HMAC_MD5], 0, sizeof(struct dst_func));
+ dst_t_func[KEY_HMAC_MD5]->sign = dst_hmac_md5_sign;
+ dst_t_func[KEY_HMAC_MD5]->verify = dst_hmac_md5_verify;
+ dst_t_func[KEY_HMAC_MD5]->compare = dst_hmac_md5_compare_keys;
+ dst_t_func[KEY_HMAC_MD5]->generate = dst_hmac_md5_generate_key;
+ dst_t_func[KEY_HMAC_MD5]->destroy = dst_hmac_md5_free_key_structure;
+ dst_t_func[KEY_HMAC_MD5]->to_dns_key = dst_hmac_md5_to_dns_key;
+ dst_t_func[KEY_HMAC_MD5]->from_dns_key = dst_buffer_to_hmac_md5;
+ dst_t_func[KEY_HMAC_MD5]->to_file_fmt = dst_hmac_md5_key_to_file_format;
+ dst_t_func[KEY_HMAC_MD5]->from_file_fmt = dst_hmac_md5_key_from_file_format;
+ return (1);
+}
+
+#else
+#define dst_hmac_md5_init __dst_hmac_md5_init
+
+int
+dst_hmac_md5_init(){
+ return (0);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/dst/support.c b/usr/src/lib/libresolv2_joy/common/dst/support.c
new file mode 100644
index 0000000000..8f827667d6
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/dst/support.c
@@ -0,0 +1,342 @@
+static const char rcsid[] = "$Header: /proj/cvs/prod/libbind/dst/support.c,v 1.6 2005/10/11 00:10:13 marka Exp $";
+
+
+/*
+ * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
+ *
+ * Permission to use, copy modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
+ */
+
+#include "port_before.h"
+
+#include <stdio.h>
+#include <unistd.h>
+#include <memory.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include "dst_internal.h"
+
+#include "port_after.h"
+
+/*%
+ * dst_s_verify_str()
+ * Validate that the input string(*str) is at the head of the input
+ * buffer(**buf). If so, move the buffer head pointer (*buf) to
+ * the first byte of data following the string(*str).
+ * Parameters
+ * buf Input buffer.
+ * str Input string.
+ * Return
+ * 0 *str is not the head of **buff
+ * 1 *str is the head of **buff, *buf is is advanced to
+ * the tail of **buf.
+ */
+
+int
+dst_s_verify_str(const char **buf, const char *str)
+{
+ int b, s;
+ if (*buf == NULL) /*%< error checks */
+ return (0);
+ if (str == NULL || *str == '\0')
+ return (1);
+
+ b = strlen(*buf); /*%< get length of strings */
+ s = strlen(str);
+ if (s > b || strncmp(*buf, str, s)) /*%< check if same */
+ return (0); /*%< not a match */
+ (*buf) += s; /*%< advance pointer */
+ return (1);
+}
+
+/*%
+ * dst_s_calculate_bits
+ * Given a binary number represented in a u_char[], determine
+ * the number of significant bits used.
+ * Parameters
+ * str An input character string containing a binary number.
+ * max_bits The maximum possible significant bits.
+ * Return
+ * N The number of significant bits in str.
+ */
+
+int
+dst_s_calculate_bits(const u_char *str, const int max_bits)
+{
+ const u_char *p = str;
+ u_char i, j = 0x80;
+ int bits;
+ for (bits = max_bits; *p == 0x00 && bits > 0; p++)
+ bits -= 8;
+ for (i = *p; (i & j) != j; j >>= 1)
+ bits--;
+ return (bits);
+}
+
+/*%
+ * calculates a checksum used in dst for an id.
+ * takes an array of bytes and a length.
+ * returns a 16 bit checksum.
+ */
+u_int16_t
+dst_s_id_calc(const u_char *key, const int keysize)
+{
+ u_int32_t ac;
+ const u_char *kp = key;
+ int size = keysize;
+
+ if (!key || (keysize <= 0))
+ return (0xffffU);
+
+ for (ac = 0; size > 1; size -= 2, kp += 2)
+ ac += ((*kp) << 8) + *(kp + 1);
+
+ if (size > 0)
+ ac += ((*kp) << 8);
+ ac += (ac >> 16) & 0xffff;
+
+ return (ac & 0xffff);
+}
+
+/*%
+ * dst_s_dns_key_id() Function to calculate DNSSEC footprint from KEY record
+ * rdata
+ * Input:
+ * dns_key_rdata: the raw data in wire format
+ * rdata_len: the size of the input data
+ * Output:
+ * the key footprint/id calculated from the key data
+ */
+u_int16_t
+dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len)
+{
+ if (!dns_key_rdata)
+ return 0;
+
+ /* compute id */
+ if (dns_key_rdata[3] == KEY_RSA) /*%< Algorithm RSA */
+ return dst_s_get_int16((const u_char *)
+ &dns_key_rdata[rdata_len - 3]);
+ else if (dns_key_rdata[3] == KEY_HMAC_MD5)
+ /* compatibility */
+ return 0;
+ else
+ /* compute a checksum on the key part of the key rr */
+ return dst_s_id_calc(dns_key_rdata, rdata_len);
+}
+
+/*%
+ * dst_s_get_int16
+ * This routine extracts a 16 bit integer from a two byte character
+ * string. The character string is assumed to be in network byte
+ * order and may be unaligned. The number returned is in host order.
+ * Parameter
+ * buf A two byte character string.
+ * Return
+ * The converted integer value.
+ */
+
+u_int16_t
+dst_s_get_int16(const u_char *buf)
+{
+ register u_int16_t a = 0;
+ a = ((u_int16_t)(buf[0] << 8)) | ((u_int16_t)(buf[1]));
+ return (a);
+}
+
+/*%
+ * dst_s_get_int32
+ * This routine extracts a 32 bit integer from a four byte character
+ * string. The character string is assumed to be in network byte
+ * order and may be unaligned. The number returned is in host order.
+ * Parameter
+ * buf A four byte character string.
+ * Return
+ * The converted integer value.
+ */
+
+u_int32_t
+dst_s_get_int32(const u_char *buf)
+{
+ register u_int32_t a = 0;
+ a = ((u_int32_t)(buf[0] << 24)) | ((u_int32_t)(buf[1] << 16)) |
+ ((u_int32_t)(buf[2] << 8)) | ((u_int32_t)(buf[3]));
+ return (a);
+}
+
+/*%
+ * dst_s_put_int16
+ * Take a 16 bit integer and store the value in a two byte
+ * character string. The integer is assumed to be in network
+ * order and the string is returned in host order.
+ *
+ * Parameters
+ * buf Storage for a two byte character string.
+ * val 16 bit integer.
+ */
+
+void
+dst_s_put_int16(u_int8_t *buf, const u_int16_t val)
+{
+ buf[0] = (u_int8_t)(val >> 8);
+ buf[1] = (u_int8_t)(val);
+}
+
+/*%
+ * dst_s_put_int32
+ * Take a 32 bit integer and store the value in a four byte
+ * character string. The integer is assumed to be in network
+ * order and the string is returned in host order.
+ *
+ * Parameters
+ * buf Storage for a four byte character string.
+ * val 32 bit integer.
+ */
+
+void
+dst_s_put_int32(u_int8_t *buf, const u_int32_t val)
+{
+ buf[0] = (u_int8_t)(val >> 24);
+ buf[1] = (u_int8_t)(val >> 16);
+ buf[2] = (u_int8_t)(val >> 8);
+ buf[3] = (u_int8_t)(val);
+}
+
+/*%
+ * dst_s_filename_length
+ *
+ * This function returns the number of bytes needed to hold the
+ * filename for a key file. '/', '\' and ':' are not allowed.
+ * form: K&lt;keyname&gt;+&lt;alg&gt;+&lt;id&gt;.&lt;suffix&gt;
+ *
+ * Returns 0 if the filename would contain either '\', '/' or ':'
+ */
+size_t
+dst_s_filename_length(const char *name, const char *suffix)
+{
+ if (name == NULL)
+ return (0);
+ if (strrchr(name, '\\'))
+ return (0);
+ if (strrchr(name, '/'))
+ return (0);
+ if (strrchr(name, ':'))
+ return (0);
+ if (suffix == NULL)
+ return (0);
+ if (strrchr(suffix, '\\'))
+ return (0);
+ if (strrchr(suffix, '/'))
+ return (0);
+ if (strrchr(suffix, ':'))
+ return (0);
+ return (1 + strlen(name) + 6 + strlen(suffix));
+}
+
+/*%
+ * dst_s_build_filename ()
+ * Builds a key filename from the key name, it's id, and a
+ * suffix. '\', '/' and ':' are not allowed. fA filename is of the
+ * form: K&lt;keyname&gt;&lt;id&gt;.&lt;suffix&gt;
+ * form: K&lt;keyname&gt;+&lt;alg&gt;+&lt;id&gt;.&lt;suffix&gt;
+ *
+ * Returns -1 if the conversion fails:
+ * if the filename would be too long for space allotted
+ * if the filename would contain a '\', '/' or ':'
+ * Returns 0 on success
+ */
+
+int
+dst_s_build_filename(char *filename, const char *name, u_int16_t id,
+ int alg, const char *suffix, size_t filename_length)
+{
+ u_int32_t my_id;
+ if (filename == NULL)
+ return (-1);
+ memset(filename, 0, filename_length);
+ if (name == NULL)
+ return (-1);
+ if (suffix == NULL)
+ return (-1);
+ if (filename_length < 1 + strlen(name) + 4 + 6 + 1 + strlen(suffix))
+ return (-1);
+ my_id = id;
+ sprintf(filename, "K%s+%03d+%05d.%s", name, alg, my_id,
+ (const char *) suffix);
+ if (strrchr(filename, '/'))
+ return (-1);
+ if (strrchr(filename, '\\'))
+ return (-1);
+ if (strrchr(filename, ':'))
+ return (-1);
+ return (0);
+}
+
+/*%
+ * dst_s_fopen ()
+ * Open a file in the dst_path directory. If perm is specified, the
+ * file is checked for existence first, and not opened if it exists.
+ * Parameters
+ * filename File to open
+ * mode Mode to open the file (passed directly to fopen)
+ * perm File permission, if creating a new file.
+ * Returns
+ * NULL Failure
+ * NON-NULL (FILE *) of opened file.
+ */
+FILE *
+dst_s_fopen(const char *filename, const char *mode, int perm)
+{
+ FILE *fp;
+ char pathname[PATH_MAX];
+
+ if (strlen(filename) + strlen(dst_path) >= sizeof(pathname))
+ return (NULL);
+
+ if (*dst_path != '\0') {
+ strcpy(pathname, dst_path);
+ strcat(pathname, filename);
+ } else
+ strcpy(pathname, filename);
+
+ fp = fopen(pathname, mode);
+ if (perm)
+ chmod(pathname, perm);
+ return (fp);
+}
+
+void
+dst_s_dump(const int mode, const u_char *data, const int size,
+ const char *msg)
+{
+ UNUSED(data);
+
+ if (size > 0) {
+#ifdef LONG_TEST
+ static u_char scratch[1000];
+ int n ;
+ n = b64_ntop(data, scratch, size, sizeof(scratch));
+ printf("%s: %x %d %s\n", msg, mode, n, scratch);
+#else
+ printf("%s,%x %d\n", msg, mode, size);
+#endif
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_cidr_ntop.c b/usr/src/lib/libresolv2_joy/common/inet/inet_cidr_ntop.c
new file mode 100644
index 0000000000..bf960a8acc
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_cidr_ntop.c
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.7 2006/10/11 02:18:18 marka Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+static char *
+inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size);
+static char *
+inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size);
+
+/*%
+ * char *
+ * inet_cidr_ntop(af, src, bits, dst, size)
+ * convert network address from network to presentation format.
+ * "src"'s size is determined from its "af".
+ * return:
+ * pointer to dst, or NULL if an error occurred (check errno).
+ * note:
+ * 192.5.5.1/28 has a nonzero host part, which means it isn't a network
+ * as called for by inet_net_ntop() but it can be a host address with
+ * an included netmask.
+ * author:
+ * Paul Vixie (ISC), October 1998
+ */
+char *
+inet_cidr_ntop(int af, const void *src, int bits, char *dst, size_t size) {
+ switch (af) {
+ case AF_INET:
+ return (inet_cidr_ntop_ipv4(src, bits, dst, size));
+ case AF_INET6:
+ return (inet_cidr_ntop_ipv6(src, bits, dst, size));
+ default:
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+}
+
+static int
+decoct(const u_char *src, int bytes, char *dst, size_t size) {
+ char *odst = dst;
+ char *t;
+ int b;
+
+ for (b = 1; b <= bytes; b++) {
+ if (size < sizeof "255.")
+ return (0);
+ t = dst;
+ dst += SPRINTF((dst, "%u", *src++));
+ if (b != bytes) {
+ *dst++ = '.';
+ *dst = '\0';
+ }
+ size -= (size_t)(dst - t);
+ }
+ return (dst - odst);
+}
+
+/*%
+ * static char *
+ * inet_cidr_ntop_ipv4(src, bits, dst, size)
+ * convert IPv4 network address from network to presentation format.
+ * "src"'s size is determined from its "af".
+ * return:
+ * pointer to dst, or NULL if an error occurred (check errno).
+ * note:
+ * network byte order assumed. this means 192.5.5.240/28 has
+ * 0b11110000 in its fourth octet.
+ * author:
+ * Paul Vixie (ISC), October 1998
+ */
+static char *
+inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) {
+ char *odst = dst;
+ size_t len = 4;
+ size_t b;
+ size_t bytes;
+
+ if ((bits < -1) || (bits > 32)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /* Find number of significant bytes in address. */
+ if (bits == -1)
+ len = 4;
+ else
+ for (len = 1, b = 1 ; b < 4U; b++)
+ if (*(src + b))
+ len = b + 1;
+
+ /* Format whole octets plus nonzero trailing octets. */
+ bytes = (((bits <= 0) ? 1 : bits) + 7) / 8;
+ if (len > bytes)
+ bytes = len;
+ b = decoct(src, bytes, dst, size);
+ if (b == 0U)
+ goto emsgsize;
+ dst += b;
+ size -= b;
+
+ if (bits != -1) {
+ /* Format CIDR /width. */
+ if (size < sizeof "/32")
+ goto emsgsize;
+ dst += SPRINTF((dst, "/%u", bits));
+ }
+
+ return (odst);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (NULL);
+}
+
+static char *
+inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
+ /*
+ * Note that int32_t and int16_t need only be "at least" large enough
+ * to contain a value of the specified size. On some systems, like
+ * Crays, there is no such thing as an integer variable with 16 bits.
+ * Keep this in mind if you think this function should have been coded
+ * to use pointer overlays. All the world's not a VAX.
+ */
+ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255/128"];
+ char *tp;
+ struct { int base, len; } best, cur;
+ u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
+ int i;
+
+ if ((bits < -1) || (bits > 128)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /*
+ * Preprocess:
+ * Copy the input (bytewise) array into a wordwise array.
+ * Find the longest run of 0x00's in src[] for :: shorthanding.
+ */
+ memset(words, '\0', sizeof words);
+ for (i = 0; i < NS_IN6ADDRSZ; i++)
+ words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
+ best.base = -1;
+ best.len = 0;
+ cur.base = -1;
+ cur.len = 0;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+ if (words[i] == 0) {
+ if (cur.base == -1)
+ cur.base = i, cur.len = 1;
+ else
+ cur.len++;
+ } else {
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ cur.base = -1;
+ }
+ }
+ }
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ }
+ if (best.base != -1 && best.len < 2)
+ best.base = -1;
+
+ /*
+ * Format the result.
+ */
+ tp = tmp;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+ /* Are we inside the best run of 0x00's? */
+ if (best.base != -1 && i >= best.base &&
+ i < (best.base + best.len)) {
+ if (i == best.base)
+ *tp++ = ':';
+ continue;
+ }
+ /* Are we following an initial run of 0x00s or any real hex? */
+ if (i != 0)
+ *tp++ = ':';
+ /* Is this address an encapsulated IPv4? */
+ if (i == 6 && best.base == 0 && (best.len == 6 ||
+ (best.len == 7 && words[7] != 0x0001) ||
+ (best.len == 5 && words[5] == 0xffff))) {
+ int n;
+
+ if (src[15] || bits == -1 || bits > 120)
+ n = 4;
+ else if (src[14] || bits > 112)
+ n = 3;
+ else
+ n = 2;
+ n = decoct(src+12, n, tp, sizeof tmp - (tp - tmp));
+ if (n == 0) {
+ errno = EMSGSIZE;
+ return (NULL);
+ }
+ tp += strlen(tp);
+ break;
+ }
+ tp += SPRINTF((tp, "%x", words[i]));
+ }
+
+ /* Was it a trailing run of 0x00's? */
+ if (best.base != -1 && (best.base + best.len) ==
+ (NS_IN6ADDRSZ / NS_INT16SZ))
+ *tp++ = ':';
+ *tp = '\0';
+
+ if (bits != -1)
+ tp += SPRINTF((tp, "/%u", bits));
+
+ /*
+ * Check for overflow, copy, and we're done.
+ */
+ if ((size_t)(tp - tmp) > size) {
+ errno = EMSGSIZE;
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_cidr_pton.c b/usr/src/lib/libresolv2_joy/common/inet/inet_cidr_pton.c
new file mode 100644
index 0000000000..07652af463
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_cidr_pton.c
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.6 2005/04/27 04:56:19 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <isc/assertions.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+static int inet_cidr_pton_ipv4 __P((const char *src, u_char *dst,
+ int *bits, int ipv6));
+static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
+ int *bits));
+
+static int getbits(const char *, int ipv6);
+
+/*%
+ * int
+ * inet_cidr_pton(af, src, dst, *bits)
+ * convert network address from presentation to network format.
+ * accepts inet_pton()'s input for this "af" plus trailing "/CIDR".
+ * "dst" is assumed large enough for its "af". "bits" is set to the
+ * /CIDR prefix length, which can have defaults (like /32 for IPv4).
+ * return:
+ * -1 if an error occurred (inspect errno; ENOENT means bad format).
+ * 0 if successful conversion occurred.
+ * note:
+ * 192.5.5.1/28 has a nonzero host part, which means it isn't a network
+ * as called for by inet_net_pton() but it can be a host address with
+ * an included netmask.
+ * author:
+ * Paul Vixie (ISC), October 1998
+ */
+int
+inet_cidr_pton(int af, const char *src, void *dst, int *bits) {
+ switch (af) {
+ case AF_INET:
+ return (inet_cidr_pton_ipv4(src, dst, bits, 0));
+ case AF_INET6:
+ return (inet_cidr_pton_ipv6(src, dst, bits));
+ default:
+ errno = EAFNOSUPPORT;
+ return (-1);
+ }
+}
+
+static const char digits[] = "0123456789";
+
+static int
+inet_cidr_pton_ipv4(const char *src, u_char *dst, int *pbits, int ipv6) {
+ const u_char *odst = dst;
+ int n, ch, tmp, bits;
+ size_t size = 4;
+
+ /* Get the mantissa. */
+ while (ch = *src++, (isascii(ch) && isdigit(ch))) {
+ tmp = 0;
+ do {
+ n = strchr(digits, ch) - digits;
+ INSIST(n >= 0 && n <= 9);
+ tmp *= 10;
+ tmp += n;
+ if (tmp > 255)
+ goto enoent;
+ } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
+ if (size-- == 0U)
+ goto emsgsize;
+ *dst++ = (u_char) tmp;
+ if (ch == '\0' || ch == '/')
+ break;
+ if (ch != '.')
+ goto enoent;
+ }
+
+ /* Get the prefix length if any. */
+ bits = -1;
+ if (ch == '/' && dst > odst) {
+ bits = getbits(src, ipv6);
+ if (bits == -2)
+ goto enoent;
+ } else if (ch != '\0')
+ goto enoent;
+
+ /* Prefix length can default to /32 only if all four octets spec'd. */
+ if (bits == -1) {
+ if (dst - odst == 4)
+ bits = ipv6 ? 128 : 32;
+ else
+ goto enoent;
+ }
+
+ /* If nothing was written to the destination, we found no address. */
+ if (dst == odst)
+ goto enoent;
+
+ /* If prefix length overspecifies mantissa, life is bad. */
+ if (((bits - (ipv6 ? 96 : 0)) / 8) > (dst - odst))
+ goto enoent;
+
+ /* Extend address to four octets. */
+ while (size-- > 0U)
+ *dst++ = 0;
+
+ *pbits = bits;
+ return (0);
+
+ enoent:
+ errno = ENOENT;
+ return (-1);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (-1);
+}
+
+static int
+inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
+ static const char xdigits_l[] = "0123456789abcdef",
+ xdigits_u[] = "0123456789ABCDEF";
+ u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *xdigits, *curtok;
+ int ch, saw_xdigit;
+ u_int val;
+ int bits;
+
+ memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
+ colonp = NULL;
+ /* Leading :: requires some special handling. */
+ if (*src == ':')
+ if (*++src != ':')
+ return (0);
+ curtok = src;
+ saw_xdigit = 0;
+ val = 0;
+ bits = -1;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_u), ch);
+ if (pch != NULL) {
+ val <<= 4;
+ val |= (pch - xdigits);
+ if (val > 0xffff)
+ return (0);
+ saw_xdigit = 1;
+ continue;
+ }
+ if (ch == ':') {
+ curtok = src;
+ if (!saw_xdigit) {
+ if (colonp)
+ return (0);
+ colonp = tp;
+ continue;
+ } else if (*src == '\0') {
+ return (0);
+ }
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ saw_xdigit = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+ inet_cidr_pton_ipv4(curtok, tp, &bits, 1) == 0) {
+ tp += NS_INADDRSZ;
+ saw_xdigit = 0;
+ break; /*%< '\\0' was seen by inet_pton4(). */
+ }
+ if (ch == '/') {
+ bits = getbits(src, 1);
+ if (bits == -2)
+ goto enoent;
+ break;
+ }
+ goto enoent;
+ }
+ if (saw_xdigit) {
+ if (tp + NS_INT16SZ > endp)
+ goto emsgsize;
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ }
+ if (colonp != NULL) {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+ const int n = tp - colonp;
+ int i;
+
+ if (tp == endp)
+ goto enoent;
+ for (i = 1; i <= n; i++) {
+ endp[- i] = colonp[n - i];
+ colonp[n - i] = 0;
+ }
+ tp = endp;
+ }
+
+ memcpy(dst, tmp, NS_IN6ADDRSZ);
+
+ *pbits = bits;
+ return (0);
+
+ enoent:
+ errno = ENOENT;
+ return (-1);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (-1);
+}
+
+static int
+getbits(const char *src, int ipv6) {
+ int bits = 0;
+ char *cp, ch;
+
+ if (*src == '\0') /*%< syntax */
+ return (-2);
+ do {
+ ch = *src++;
+ cp = strchr(digits, ch);
+ if (cp == NULL) /*%< syntax */
+ return (-2);
+ bits *= 10;
+ bits += cp - digits;
+ if (bits == 0 && *src != '\0') /*%< no leading zeros */
+ return (-2);
+ if (bits > (ipv6 ? 128 : 32)) /*%< range error */
+ return (-2);
+ } while (*src != '\0');
+
+ return (bits);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_data.c b/usr/src/lib/libresolv2_joy/common/inet/inet_data.c
new file mode 100644
index 0000000000..58b8c4342d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_data.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$Id: inet_data.c,v 1.4 2005/04/27 04:56:19 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "port_after.h"
+
+const struct in6_addr isc_in6addr_any = IN6ADDR_ANY_INIT;
+const struct in6_addr isc_in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_lnaof.c b/usr/src/lib/libresolv2_joy/common/inet/inet_lnaof.c
new file mode 100644
index 0000000000..70ac409512
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_lnaof.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "port_after.h"
+
+/*%
+ * Return the local network address portion of an
+ * internet address; handles class a/b/c network
+ * number formats.
+ */
+u_long
+inet_lnaof(in)
+ struct in_addr in;
+{
+ register u_long i = ntohl(in.s_addr);
+
+ if (IN_CLASSA(i))
+ return ((i)&IN_CLASSA_HOST);
+ else if (IN_CLASSB(i))
+ return ((i)&IN_CLASSB_HOST);
+ else
+ return ((i)&IN_CLASSC_HOST);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_makeaddr.c b/usr/src/lib/libresolv2_joy/common/inet/inet_makeaddr.c
new file mode 100644
index 0000000000..c56cb3eaeb
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_makeaddr.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "port_after.h"
+
+/*%
+ * Formulate an Internet address from network + host. Used in
+ * building addresses stored in the ifnet structure.
+ */
+struct in_addr
+inet_makeaddr(net, host)
+ u_long net, host;
+{
+ struct in_addr a;
+
+ if (net < 128U)
+ a.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
+ else if (net < 65536U)
+ a.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
+ else if (net < 16777216L)
+ a.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
+ else
+ a.s_addr = net | host;
+ a.s_addr = htonl(a.s_addr);
+ return (a);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_net_ntop.c b/usr/src/lib/libresolv2_joy/common/inet/inet_net_ntop.c
new file mode 100644
index 0000000000..fb28e3cbe5
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_net_ntop.c
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.5 2006/06/20 02:50:14 marka Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
+ char *dst, size_t size));
+static char * inet_net_ntop_ipv6 __P((const u_char *src, int bits,
+ char *dst, size_t size));
+
+/*%
+ * char *
+ * inet_net_ntop(af, src, bits, dst, size)
+ * convert network number from network to presentation format.
+ * generates CIDR style result always.
+ * return:
+ * pointer to dst, or NULL if an error occurred (check errno).
+ * author:
+ * Paul Vixie (ISC), July 1996
+ */
+char *
+inet_net_ntop(af, src, bits, dst, size)
+ int af;
+ const void *src;
+ int bits;
+ char *dst;
+ size_t size;
+{
+ switch (af) {
+ case AF_INET:
+ return (inet_net_ntop_ipv4(src, bits, dst, size));
+ case AF_INET6:
+ return (inet_net_ntop_ipv6(src, bits, dst, size));
+ default:
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+}
+
+/*%
+ * static char *
+ * inet_net_ntop_ipv4(src, bits, dst, size)
+ * convert IPv4 network number from network to presentation format.
+ * generates CIDR style result always.
+ * return:
+ * pointer to dst, or NULL if an error occurred (check errno).
+ * note:
+ * network byte order assumed. this means 192.5.5.240/28 has
+ * 0b11110000 in its fourth octet.
+ * author:
+ * Paul Vixie (ISC), July 1996
+ */
+static char *
+inet_net_ntop_ipv4(src, bits, dst, size)
+ const u_char *src;
+ int bits;
+ char *dst;
+ size_t size;
+{
+ char *odst = dst;
+ char *t;
+ u_int m;
+ int b;
+
+ if (bits < 0 || bits > 32) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ if (bits == 0) {
+ if (size < sizeof "0")
+ goto emsgsize;
+ *dst++ = '0';
+ size--;
+ *dst = '\0';
+ }
+
+ /* Format whole octets. */
+ for (b = bits / 8; b > 0; b--) {
+ if (size <= sizeof "255.")
+ goto emsgsize;
+ t = dst;
+ dst += SPRINTF((dst, "%u", *src++));
+ if (b > 1) {
+ *dst++ = '.';
+ *dst = '\0';
+ }
+ size -= (size_t)(dst - t);
+ }
+
+ /* Format partial octet. */
+ b = bits % 8;
+ if (b > 0) {
+ if (size <= sizeof ".255")
+ goto emsgsize;
+ t = dst;
+ if (dst != odst)
+ *dst++ = '.';
+ m = ((1 << b) - 1) << (8 - b);
+ dst += SPRINTF((dst, "%u", *src & m));
+ size -= (size_t)(dst - t);
+ }
+
+ /* Format CIDR /width. */
+ if (size <= sizeof "/32")
+ goto emsgsize;
+ dst += SPRINTF((dst, "/%u", bits));
+ return (odst);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (NULL);
+}
+
+/*%
+ * static char *
+ * inet_net_ntop_ipv6(src, bits, fakebits, dst, size)
+ * convert IPv6 network number from network to presentation format.
+ * generates CIDR style result always. Picks the shortest representation
+ * unless the IP is really IPv4.
+ * always prints specified number of bits (bits).
+ * return:
+ * pointer to dst, or NULL if an error occurred (check errno).
+ * note:
+ * network byte order assumed. this means 192.5.5.240/28 has
+ * 0x11110000 in its fourth octet.
+ * author:
+ * Vadim Kogan (UCB), June 2001
+ * Original version (IPv4) by Paul Vixie (ISC), July 1996
+ */
+
+static char *
+inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
+ u_int m;
+ int b;
+ int p;
+ int zero_s, zero_l, tmp_zero_s, tmp_zero_l;
+ int i;
+ int is_ipv4 = 0;
+ unsigned char inbuf[16];
+ char outbuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255.255.255.255/128")];
+ char *cp;
+ int words;
+ u_char *s;
+
+ if (bits < 0 || bits > 128) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ cp = outbuf;
+
+ if (bits == 0) {
+ *cp++ = ':';
+ *cp++ = ':';
+ *cp = '\0';
+ } else {
+ /* Copy src to private buffer. Zero host part. */
+ p = (bits + 7) / 8;
+ memcpy(inbuf, src, p);
+ memset(inbuf + p, 0, 16 - p);
+ b = bits % 8;
+ if (b != 0) {
+ m = ~0 << (8 - b);
+ inbuf[p-1] &= m;
+ }
+
+ s = inbuf;
+
+ /* how many words need to be displayed in output */
+ words = (bits + 15) / 16;
+ if (words == 1)
+ words = 2;
+
+ /* Find the longest substring of zero's */
+ zero_s = zero_l = tmp_zero_s = tmp_zero_l = 0;
+ for (i = 0; i < (words * 2); i += 2) {
+ if ((s[i] | s[i+1]) == 0) {
+ if (tmp_zero_l == 0)
+ tmp_zero_s = i / 2;
+ tmp_zero_l++;
+ } else {
+ if (tmp_zero_l && zero_l < tmp_zero_l) {
+ zero_s = tmp_zero_s;
+ zero_l = tmp_zero_l;
+ tmp_zero_l = 0;
+ }
+ }
+ }
+
+ if (tmp_zero_l && zero_l < tmp_zero_l) {
+ zero_s = tmp_zero_s;
+ zero_l = tmp_zero_l;
+ }
+
+ if (zero_l != words && zero_s == 0 && ((zero_l == 6) ||
+ ((zero_l == 5 && s[10] == 0xff && s[11] == 0xff) ||
+ ((zero_l == 7 && s[14] != 0 && s[15] != 1)))))
+ is_ipv4 = 1;
+
+ /* Format whole words. */
+ for (p = 0; p < words; p++) {
+ if (zero_l != 0 && p >= zero_s && p < zero_s + zero_l) {
+ /* Time to skip some zeros */
+ if (p == zero_s)
+ *cp++ = ':';
+ if (p == words - 1)
+ *cp++ = ':';
+ s++;
+ s++;
+ continue;
+ }
+
+ if (is_ipv4 && p > 5 ) {
+ *cp++ = (p == 6) ? ':' : '.';
+ cp += SPRINTF((cp, "%u", *s++));
+ /* we can potentially drop the last octet */
+ if (p != 7 || bits > 120) {
+ *cp++ = '.';
+ cp += SPRINTF((cp, "%u", *s++));
+ }
+ } else {
+ if (cp != outbuf)
+ *cp++ = ':';
+ cp += SPRINTF((cp, "%x", *s * 256 + s[1]));
+ s += 2;
+ }
+ }
+ }
+ /* Format CIDR /width. */
+ sprintf(cp, "/%u", bits);
+ if (strlen(outbuf) + 1 > size)
+ goto emsgsize;
+ strcpy(dst, outbuf);
+
+ return (dst);
+
+emsgsize:
+ errno = EMSGSIZE;
+ return (NULL);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_net_pton.c b/usr/src/lib/libresolv2_joy/common/inet/inet_net_pton.c
new file mode 100644
index 0000000000..8d8bfb1f64
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_net_pton.c
@@ -0,0 +1,407 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996, 1998, 1999, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: inet_net_pton.c,v 1.10 2008/11/14 02:36:51 marka Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <isc/assertions.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/*%
+ * static int
+ * inet_net_pton_ipv4(src, dst, size)
+ * convert IPv4 network number from presentation to network format.
+ * accepts hex octets, hex strings, decimal octets, and /CIDR.
+ * "size" is in bytes and describes "dst".
+ * return:
+ * number of bits, either imputed classfully or specified with /CIDR,
+ * or -1 if some failure occurred (check errno). ENOENT means it was
+ * not an IPv4 network specification.
+ * note:
+ * network byte order assumed. this means 192.5.5.240/28 has
+ * 0b11110000 in its fourth octet.
+ * author:
+ * Paul Vixie (ISC), June 1996
+ */
+static int
+inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
+ static const char xdigits[] = "0123456789abcdef";
+ static const char digits[] = "0123456789";
+ int n, ch, tmp = 0, dirty, bits;
+ const u_char *odst = dst;
+
+ ch = *src++;
+ if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
+ && isascii((unsigned char)(src[1]))
+ && isxdigit((unsigned char)(src[1]))) {
+ /* Hexadecimal: Eat nybble string. */
+ if (size <= 0U)
+ goto emsgsize;
+ dirty = 0;
+ src++; /*%< skip x or X. */
+ while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) {
+ if (isupper(ch))
+ ch = tolower(ch);
+ n = strchr(xdigits, ch) - xdigits;
+ INSIST(n >= 0 && n <= 15);
+ if (dirty == 0)
+ tmp = n;
+ else
+ tmp = (tmp << 4) | n;
+ if (++dirty == 2) {
+ if (size-- <= 0U)
+ goto emsgsize;
+ *dst++ = (u_char) tmp;
+ dirty = 0;
+ }
+ }
+ if (dirty) { /*%< Odd trailing nybble? */
+ if (size-- <= 0U)
+ goto emsgsize;
+ *dst++ = (u_char) (tmp << 4);
+ }
+ } else if (isascii(ch) && isdigit(ch)) {
+ /* Decimal: eat dotted digit string. */
+ for (;;) {
+ tmp = 0;
+ do {
+ n = strchr(digits, ch) - digits;
+ INSIST(n >= 0 && n <= 9);
+ tmp *= 10;
+ tmp += n;
+ if (tmp > 255)
+ goto enoent;
+ } while ((ch = *src++) != '\0' &&
+ isascii(ch) && isdigit(ch));
+ if (size-- <= 0U)
+ goto emsgsize;
+ *dst++ = (u_char) tmp;
+ if (ch == '\0' || ch == '/')
+ break;
+ if (ch != '.')
+ goto enoent;
+ ch = *src++;
+ if (!isascii(ch) || !isdigit(ch))
+ goto enoent;
+ }
+ } else
+ goto enoent;
+
+ bits = -1;
+ if (ch == '/' && isascii((unsigned char)(src[0])) &&
+ isdigit((unsigned char)(src[0])) && dst > odst) {
+ /* CIDR width specifier. Nothing can follow it. */
+ ch = *src++; /*%< Skip over the /. */
+ bits = 0;
+ do {
+ n = strchr(digits, ch) - digits;
+ INSIST(n >= 0 && n <= 9);
+ bits *= 10;
+ bits += n;
+ if (bits > 32)
+ goto enoent;
+ } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
+ if (ch != '\0')
+ goto enoent;
+ }
+
+ /* Firey death and destruction unless we prefetched EOS. */
+ if (ch != '\0')
+ goto enoent;
+
+ /* If nothing was written to the destination, we found no address. */
+ if (dst == odst)
+ goto enoent;
+ /* If no CIDR spec was given, infer width from net class. */
+ if (bits == -1) {
+ if (*odst >= 240) /*%< Class E */
+ bits = 32;
+ else if (*odst >= 224) /*%< Class D */
+ bits = 8;
+ else if (*odst >= 192) /*%< Class C */
+ bits = 24;
+ else if (*odst >= 128) /*%< Class B */
+ bits = 16;
+ else /*%< Class A */
+ bits = 8;
+ /* If imputed mask is narrower than specified octets, widen. */
+ if (bits < ((dst - odst) * 8))
+ bits = (dst - odst) * 8;
+ /*
+ * If there are no additional bits specified for a class D
+ * address adjust bits to 4.
+ */
+ if (bits == 8 && *odst == 224)
+ bits = 4;
+ }
+ /* Extend network to cover the actual mask. */
+ while (bits > ((dst - odst) * 8)) {
+ if (size-- <= 0U)
+ goto emsgsize;
+ *dst++ = '\0';
+ }
+ return (bits);
+
+ enoent:
+ errno = ENOENT;
+ return (-1);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (-1);
+}
+
+static int
+getbits(const char *src, int *bitsp) {
+ static const char digits[] = "0123456789";
+ int n;
+ int val;
+ char ch;
+
+ val = 0;
+ n = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ pch = strchr(digits, ch);
+ if (pch != NULL) {
+ if (n++ != 0 && val == 0) /*%< no leading zeros */
+ return (0);
+ val *= 10;
+ val += (pch - digits);
+ if (val > 128) /*%< range */
+ return (0);
+ continue;
+ }
+ return (0);
+ }
+ if (n == 0)
+ return (0);
+ *bitsp = val;
+ return (1);
+}
+
+static int
+getv4(const char *src, u_char *dst, int *bitsp) {
+ static const char digits[] = "0123456789";
+ u_char *odst = dst;
+ int n;
+ u_int val;
+ char ch;
+
+ val = 0;
+ n = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ pch = strchr(digits, ch);
+ if (pch != NULL) {
+ if (n++ != 0 && val == 0) /*%< no leading zeros */
+ return (0);
+ val *= 10;
+ val += (pch - digits);
+ if (val > 255) /*%< range */
+ return (0);
+ continue;
+ }
+ if (ch == '.' || ch == '/') {
+ if (dst - odst > 3) /*%< too many octets? */
+ return (0);
+ *dst++ = val;
+ if (ch == '/')
+ return (getbits(src, bitsp));
+ val = 0;
+ n = 0;
+ continue;
+ }
+ return (0);
+ }
+ if (n == 0)
+ return (0);
+ if (dst - odst > 3) /*%< too many octets? */
+ return (0);
+ *dst++ = val;
+ return (1);
+}
+
+static int
+inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
+ static const char xdigits_l[] = "0123456789abcdef",
+ xdigits_u[] = "0123456789ABCDEF";
+ u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *xdigits, *curtok;
+ int ch, saw_xdigit;
+ u_int val;
+ int digits;
+ int bits;
+ size_t bytes;
+ int words;
+ int ipv4;
+
+ memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
+ colonp = NULL;
+ /* Leading :: requires some special handling. */
+ if (*src == ':')
+ if (*++src != ':')
+ goto enoent;
+ curtok = src;
+ saw_xdigit = 0;
+ val = 0;
+ digits = 0;
+ bits = -1;
+ ipv4 = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_u), ch);
+ if (pch != NULL) {
+ val <<= 4;
+ val |= (pch - xdigits);
+ if (++digits > 4)
+ goto enoent;
+ saw_xdigit = 1;
+ continue;
+ }
+ if (ch == ':') {
+ curtok = src;
+ if (!saw_xdigit) {
+ if (colonp)
+ goto enoent;
+ colonp = tp;
+ continue;
+ } else if (*src == '\0')
+ goto enoent;
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ saw_xdigit = 0;
+ digits = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+ getv4(curtok, tp, &bits) > 0) {
+ tp += NS_INADDRSZ;
+ saw_xdigit = 0;
+ ipv4 = 1;
+ break; /*%< '\\0' was seen by inet_pton4(). */
+ }
+ if (ch == '/' && getbits(src, &bits) > 0)
+ break;
+ goto enoent;
+ }
+ if (saw_xdigit) {
+ if (tp + NS_INT16SZ > endp)
+ goto enoent;
+ *tp++ = (u_char) (val >> 8) & 0xff;
+ *tp++ = (u_char) val & 0xff;
+ }
+ if (bits == -1)
+ bits = 128;
+
+ words = (bits + 15) / 16;
+ if (words < 2)
+ words = 2;
+ if (ipv4)
+ words = 8;
+ endp = tmp + 2 * words;
+
+ if (colonp != NULL) {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+ const int n = tp - colonp;
+ int i;
+
+ if (tp == endp)
+ goto enoent;
+ for (i = 1; i <= n; i++) {
+ endp[- i] = colonp[n - i];
+ colonp[n - i] = 0;
+ }
+ tp = endp;
+ }
+ if (tp != endp)
+ goto enoent;
+
+ bytes = (bits + 7) / 8;
+ if (bytes > size)
+ goto emsgsize;
+ memcpy(dst, tmp, bytes);
+ return (bits);
+
+ enoent:
+ errno = ENOENT;
+ return (-1);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (-1);
+}
+
+/*%
+ * int
+ * inet_net_pton(af, src, dst, size)
+ * convert network number from presentation to network format.
+ * accepts hex octets, hex strings, decimal octets, and /CIDR.
+ * "size" is in bytes and describes "dst".
+ * return:
+ * number of bits, either imputed classfully or specified with /CIDR,
+ * or -1 if some failure occurred (check errno). ENOENT means it was
+ * not a valid network specification.
+ * author:
+ * Paul Vixie (ISC), June 1996
+ */
+int
+inet_net_pton(int af, const char *src, void *dst, size_t size) {
+ switch (af) {
+ case AF_INET:
+ return (inet_net_pton_ipv4(src, dst, size));
+ case AF_INET6:
+ return (inet_net_pton_ipv6(src, dst, size));
+ default:
+ errno = EAFNOSUPPORT;
+ return (-1);
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_neta.c b/usr/src/lib/libresolv2_joy/common/inet/inet_neta.c
new file mode 100644
index 0000000000..63a6c201a4
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_neta.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: inet_neta.c,v 1.3 2005/04/27 04:56:20 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/*%
+ * char *
+ * inet_neta(src, dst, size)
+ * format a u_long network number into presentation format.
+ * return:
+ * pointer to dst, or NULL if an error occurred (check errno).
+ * note:
+ * format of ``src'' is as for inet_network().
+ * author:
+ * Paul Vixie (ISC), July 1996
+ */
+char *
+inet_neta(src, dst, size)
+ u_long src;
+ char *dst;
+ size_t size;
+{
+ char *odst = dst;
+ char *tp;
+
+ while (src & 0xffffffff) {
+ u_char b = (src & 0xff000000) >> 24;
+
+ src <<= 8;
+ if (b) {
+ if (size < sizeof "255.")
+ goto emsgsize;
+ tp = dst;
+ dst += SPRINTF((dst, "%u", b));
+ if (src != 0L) {
+ *dst++ = '.';
+ *dst = '\0';
+ }
+ size -= (size_t)(dst - tp);
+ }
+ }
+ if (dst == odst) {
+ if (size < sizeof "0.0.0.0")
+ goto emsgsize;
+ strcpy(dst, "0.0.0.0");
+ }
+ return (odst);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (NULL);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_netof.c b/usr/src/lib/libresolv2_joy/common/inet/inet_netof.c
new file mode 100644
index 0000000000..c228e3d818
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_netof.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "port_after.h"
+
+/*%
+ * Return the network number from an internet
+ * address; handles class a/b/c network #'s.
+ */
+u_long
+inet_netof(in)
+ struct in_addr in;
+{
+ register u_long i = ntohl(in.s_addr);
+
+ if (IN_CLASSA(i))
+ return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
+ else if (IN_CLASSB(i))
+ return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
+ else
+ return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/inet_network.c b/usr/src/lib/libresolv2_joy/common/inet/inet_network.c
new file mode 100644
index 0000000000..47976cff68
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/inet_network.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <ctype.h>
+
+#include "port_after.h"
+
+/*%
+ * Internet network address interpretation routine.
+ * The library routines call this routine to interpret
+ * network numbers.
+ */
+u_long
+inet_network(cp)
+ register const char *cp;
+{
+ register u_long val, base, n, i;
+ register char c;
+ u_long parts[4], *pp = parts;
+ int digit;
+
+again:
+ val = 0; base = 10; digit = 0;
+ if (*cp == '0')
+ digit = 1, base = 8, cp++;
+ if (*cp == 'x' || *cp == 'X')
+ base = 16, cp++;
+ while ((c = *cp) != 0) {
+ if (isdigit((unsigned char)c)) {
+ if (base == 8U && (c == '8' || c == '9'))
+ return (INADDR_NONE);
+ val = (val * base) + (c - '0');
+ cp++;
+ digit = 1;
+ continue;
+ }
+ if (base == 16U && isxdigit((unsigned char)c)) {
+ val = (val << 4) +
+ (c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
+ cp++;
+ digit = 1;
+ continue;
+ }
+ break;
+ }
+ if (!digit)
+ return (INADDR_NONE);
+ if (pp >= parts + 4 || val > 0xffU)
+ return (INADDR_NONE);
+ if (*cp == '.') {
+ *pp++ = val, cp++;
+ goto again;
+ }
+ if (*cp && !isspace(*cp&0xff))
+ return (INADDR_NONE);
+ *pp++ = val;
+ n = pp - parts;
+ if (n > 4U)
+ return (INADDR_NONE);
+ for (val = 0, i = 0; i < n; i++) {
+ val <<= 8;
+ val |= parts[i] & 0xff;
+ }
+ return (val);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/inet/nsap_addr.c b/usr/src/lib/libresolv2_joy/common/inet/nsap_addr.c
new file mode 100644
index 0000000000..a9972e6e32
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/inet/nsap_addr.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: nsap_addr.c,v 1.5 2005/07/28 06:51:48 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <resolv_joy.h>
+#include <resolv_mt.h>
+
+#include "port_after.h"
+
+static char
+xtob(int c) {
+ return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
+}
+
+u_int
+inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) {
+ u_char c, nib;
+ u_int len = 0;
+
+ if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))
+ return (0);
+ ascii += 2;
+
+ while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
+ if (c == '.' || c == '+' || c == '/')
+ continue;
+ if (!isascii(c))
+ return (0);
+ if (islower(c))
+ c = toupper(c);
+ if (isxdigit(c)) {
+ nib = xtob(c);
+ c = *ascii++;
+ if (c != '\0') {
+ c = toupper(c);
+ if (isxdigit(c)) {
+ *binary++ = (nib << 4) | xtob(c);
+ len++;
+ } else
+ return (0);
+ }
+ else
+ return (0);
+ }
+ else
+ return (0);
+ }
+ return (len);
+}
+
+char *
+inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
+ int nib;
+ int i;
+ char *tmpbuf = inet_nsap_ntoa_tmpbuf;
+ char *start;
+
+ if (ascii)
+ start = ascii;
+ else {
+ ascii = tmpbuf;
+ start = tmpbuf;
+ }
+
+ *ascii++ = '0';
+ *ascii++ = 'x';
+
+ if (binlen > 255)
+ binlen = 255;
+
+ for (i = 0; i < binlen; i++) {
+ nib = *binary >> 4;
+ *ascii++ = nib + (nib < 10 ? '0' : '7');
+ nib = *binary++ & 0x0f;
+ *ascii++ = nib + (nib < 10 ? '0' : '7');
+ if (((i % 2) == 0 && (i + 1) < binlen))
+ *ascii++ = '.';
+ }
+ *ascii = '\0';
+ return (start);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/dns.c b/usr/src/lib/libresolv2_joy/common/irs/dns.c
new file mode 100644
index 0000000000..7c50320ae7
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/dns.c
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: dns.c,v 1.5 2006/03/09 23:57:56 marka Exp $";
+#endif
+
+/*! \file
+ * \brief
+ * dns.c --- this is the top-level accessor function for the dns
+ */
+
+#include "port_before.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <resolv_joy.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "hesiod.h"
+#include "dns_p.h"
+
+/* forward */
+
+static void dns_close(struct irs_acc *);
+static struct __res_state * dns_res_get(struct irs_acc *);
+static void dns_res_set(struct irs_acc *, struct __res_state *,
+ void (*)(void *));
+
+/* public */
+
+struct irs_acc *
+irs_dns_acc(const char *options) {
+ struct irs_acc *acc;
+ struct dns_p *dns;
+
+ UNUSED(options);
+
+ if (!(acc = memget(sizeof *acc))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(acc, 0x5e, sizeof *acc);
+ if (!(dns = memget(sizeof *dns))) {
+ errno = ENOMEM;
+ memput(acc, sizeof *acc);
+ return (NULL);
+ }
+ memset(dns, 0x5e, sizeof *dns);
+ dns->res = NULL;
+ dns->free_res = NULL;
+ if (hesiod_init(&dns->hes_ctx) < 0) {
+ /*
+ * We allow the dns accessor class to initialize
+ * despite hesiod failing to initialize correctly,
+ * since dns host queries don't depend on hesiod.
+ */
+ dns->hes_ctx = NULL;
+ }
+ acc->private = dns;
+#ifdef WANT_IRS_GR
+ acc->gr_map = irs_dns_gr;
+#else
+ acc->gr_map = NULL;
+#endif
+#ifdef WANT_IRS_PW
+ acc->pw_map = irs_dns_pw;
+#else
+ acc->pw_map = NULL;
+#endif
+ acc->sv_map = irs_dns_sv;
+ acc->pr_map = irs_dns_pr;
+ acc->ho_map = irs_dns_ho;
+ acc->nw_map = irs_dns_nw;
+ acc->ng_map = irs_nul_ng;
+ acc->res_get = dns_res_get;
+ acc->res_set = dns_res_set;
+ acc->close = dns_close;
+ return (acc);
+}
+
+/* methods */
+static struct __res_state *
+dns_res_get(struct irs_acc *this) {
+ struct dns_p *dns = (struct dns_p *)this->private;
+
+ if (dns->res == NULL) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (res == NULL)
+ return (NULL);
+ memset(res, 0, sizeof *res);
+ dns_res_set(this, res, free);
+ }
+
+ if ((dns->res->options & RES_INIT) == 0U &&
+ res_ninit(dns->res) < 0)
+ return (NULL);
+
+ return (dns->res);
+}
+
+static void
+dns_res_set(struct irs_acc *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct dns_p *dns = (struct dns_p *)this->private;
+
+ if (dns->res && dns->free_res) {
+ res_nclose(dns->res);
+ (*dns->free_res)(dns->res);
+ }
+ dns->res = res;
+ dns->free_res = free_res;
+}
+
+static void
+dns_close(struct irs_acc *this) {
+ struct dns_p *dns;
+
+ dns = (struct dns_p *)this->private;
+ if (dns->res && dns->free_res)
+ (*dns->free_res)(dns->res);
+ if (dns->hes_ctx)
+ hesiod_end(dns->hes_ctx);
+ memput(dns, sizeof *dns);
+ memput(this, sizeof *this);
+}
+
diff --git a/usr/src/lib/libresolv2_joy/common/irs/dns_ho.c b/usr/src/lib/libresolv2_joy/common/irs/dns_ho.c
new file mode 100644
index 0000000000..67812717fb
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/dns_ho.c
@@ -0,0 +1,1143 @@
+/*
+ * Portions Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1985, 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* from gethostnamadr.c 8.1 (Berkeley) 6/4/93 */
+/* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: dns_ho.c,v 1.23 2008/11/14 02:36:51 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports. */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+#include <syslog.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "dns_p.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) sprintf x
+#endif
+
+/* Definitions. */
+
+#define MAXALIASES 35
+#define MAXADDRS 35
+
+#define MAXPACKET (65535) /*%< Maximum TCP message size */
+#define BOUNDS_CHECK(ptr, count) \
+ if ((ptr) + (count) > eom) { \
+ had_error++; \
+ continue; \
+ } else (void)0
+
+typedef union {
+ HEADER hdr;
+ u_char buf[MAXPACKET];
+} querybuf;
+
+struct dns_res_target {
+ struct dns_res_target *next;
+ querybuf qbuf; /*%< query buffer */
+ u_char *answer; /*%< buffer to put answer */
+ int anslen; /*%< size of answer buffer */
+ int qclass, qtype; /*%< class and type of query */
+ int action; /*%< condition whether query is really issued */
+ char qname[MAXDNAME +1]; /*%< domain name */
+#if 0
+ int n; /*%< result length */
+#endif
+};
+enum {RESTGT_DOALWAYS, RESTGT_AFTERFAILURE, RESTGT_IGNORE};
+enum {RESQRY_SUCCESS, RESQRY_FAIL};
+
+struct pvt {
+ struct hostent host;
+ char * h_addr_ptrs[MAXADDRS + 1];
+ char * host_aliases[MAXALIASES];
+ char hostbuf[8*1024];
+ u_char host_addr[16]; /*%< IPv4 or IPv6 */
+ struct __res_state *res;
+ void (*free_res)(void *);
+};
+
+typedef union {
+ int32_t al;
+ char ac;
+} align;
+
+static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
+static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+/* Note: the IPv6 loopback address is in the "tunnel" space */
+static const u_char v6local[] = { 0,0, 0,1 }; /*%< last 4 bytes of IPv6 addr */
+/* Forwards. */
+
+static void ho_close(struct irs_ho *this);
+static struct hostent * ho_byname(struct irs_ho *this, const char *name);
+static struct hostent * ho_byname2(struct irs_ho *this, const char *name,
+ int af);
+static struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
+ int len, int af);
+static struct hostent * ho_next(struct irs_ho *this);
+static void ho_rewind(struct irs_ho *this);
+static void ho_minimize(struct irs_ho *this);
+static struct __res_state * ho_res_get(struct irs_ho *this);
+static void ho_res_set(struct irs_ho *this,
+ struct __res_state *res,
+ void (*free_res)(void *));
+static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,
+ const struct addrinfo *pai);
+
+static void map_v4v6_hostent(struct hostent *hp, char **bp,
+ char *ep);
+static void addrsort(res_state, char **, int);
+static struct hostent * gethostans(struct irs_ho *this,
+ const u_char *ansbuf, int anslen,
+ const char *qname, int qtype,
+ int af, int size,
+ struct addrinfo **ret_aip,
+ const struct addrinfo *pai);
+static int add_hostent(struct pvt *pvt, char *bp, char **hap,
+ struct addrinfo *ai);
+static int init(struct irs_ho *this);
+
+/* Exports. */
+
+struct irs_ho *
+irs_dns_ho(struct irs_acc *this) {
+ struct irs_ho *ho;
+ struct pvt *pvt;
+
+ UNUSED(this);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+
+ if (!(ho = memget(sizeof *ho))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ho, 0x5e, sizeof *ho);
+ ho->private = pvt;
+ ho->close = ho_close;
+ ho->byname = ho_byname;
+ ho->byname2 = ho_byname2;
+ ho->byaddr = ho_byaddr;
+ ho->next = ho_next;
+ ho->rewind = ho_rewind;
+ ho->minimize = ho_minimize;
+ ho->res_get = ho_res_get;
+ ho->res_set = ho_res_set;
+ ho->addrinfo = ho_addrinfo;
+ return (ho);
+}
+
+/* Methods. */
+
+static void
+ho_close(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ ho_minimize(this);
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct hostent *
+ho_byname(struct irs_ho *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *hp;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ if (pvt->res->options & RES_USE_INET6) {
+ hp = ho_byname2(this, name, AF_INET6);
+ if (hp)
+ return (hp);
+ }
+ return (ho_byname2(this, name, AF_INET));
+}
+
+static struct hostent *
+ho_byname2(struct irs_ho *this, const char *name, int af)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *hp = NULL;
+ int n, size;
+ char tmp[NS_MAXDNAME];
+ const char *cp;
+ struct addrinfo ai;
+ struct dns_res_target *q, *p;
+ int querystate = RESQRY_FAIL;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ q = memget(sizeof(*q));
+ if (q == NULL) {
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ memset(q, 0, sizeof(*q));
+
+ switch (af) {
+ case AF_INET:
+ size = INADDRSZ;
+ q->qclass = C_IN;
+ q->qtype = T_A;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->action = RESTGT_DOALWAYS;
+ break;
+ case AF_INET6:
+ size = IN6ADDRSZ;
+ q->qclass = C_IN;
+ q->qtype = T_AAAA;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->action = RESTGT_DOALWAYS;
+ break;
+ default:
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = EAFNOSUPPORT;
+ hp = NULL;
+ goto cleanup;
+ }
+
+ /*
+ * if there aren't any dots, it could be a user-level alias.
+ * this is also done in res_nquery() since we are not the only
+ * function that looks up host names.
+ */
+ if (!strchr(name, '.') && (cp = res_hostalias(pvt->res, name,
+ tmp, sizeof tmp)))
+ name = cp;
+
+ for (p = q; p; p = p->next) {
+ switch(p->action) {
+ case RESTGT_DOALWAYS:
+ break;
+ case RESTGT_AFTERFAILURE:
+ if (querystate == RESQRY_SUCCESS)
+ continue;
+ break;
+ case RESTGT_IGNORE:
+ continue;
+ }
+
+ if ((n = res_nsearch(pvt->res, name, p->qclass, p->qtype,
+ p->answer, p->anslen)) < 0) {
+ querystate = RESQRY_FAIL;
+ continue;
+ }
+
+ memset(&ai, 0, sizeof(ai));
+ ai.ai_family = af;
+ if ((hp = gethostans(this, p->answer, n, name, p->qtype,
+ af, size, NULL,
+ (const struct addrinfo *)&ai)) != NULL)
+ goto cleanup; /*%< no more loop is necessary */
+ querystate = RESQRY_FAIL;
+ continue;
+ }
+
+ cleanup:
+ if (q != NULL)
+ memput(q, sizeof(*q));
+ return(hp);
+}
+
+static struct hostent *
+ho_byaddr(struct irs_ho *this, const void *addr, int len, int af)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ const u_char *uaddr = addr;
+ char *qp;
+ struct hostent *hp = NULL;
+ struct addrinfo ai;
+ struct dns_res_target *q, *q2, *p;
+ int n, size, i;
+ int querystate = RESQRY_FAIL;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ q = memget(sizeof(*q));
+ q2 = memget(sizeof(*q2));
+ if (q == NULL || q2 == NULL) {
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ memset(q, 0, sizeof(*q));
+ memset(q2, 0, sizeof(*q2));
+
+ if (af == AF_INET6 && len == IN6ADDRSZ &&
+ (!memcmp(uaddr, mapped, sizeof mapped) ||
+ (!memcmp(uaddr, tunnelled, sizeof tunnelled) &&
+ memcmp(&uaddr[sizeof tunnelled], v6local, sizeof(v6local))))) {
+ /* Unmap. */
+ addr = (const char *)addr + sizeof mapped;
+ uaddr += sizeof mapped;
+ af = AF_INET;
+ len = INADDRSZ;
+ }
+ switch (af) {
+ case AF_INET:
+ size = INADDRSZ;
+ q->qclass = C_IN;
+ q->qtype = T_PTR;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->action = RESTGT_DOALWAYS;
+ break;
+ case AF_INET6:
+ size = IN6ADDRSZ;
+ q->qclass = C_IN;
+ q->qtype = T_PTR;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->next = q2;
+ q->action = RESTGT_DOALWAYS;
+ q2->qclass = C_IN;
+ q2->qtype = T_PTR;
+ q2->answer = q2->qbuf.buf;
+ q2->anslen = sizeof(q2->qbuf);
+ if ((pvt->res->options & RES_NO_NIBBLE2) != 0U)
+ q2->action = RESTGT_IGNORE;
+ else
+ q2->action = RESTGT_AFTERFAILURE;
+ break;
+ default:
+ errno = EAFNOSUPPORT;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ hp = NULL;
+ goto cleanup;
+ }
+ if (size > len) {
+ errno = EINVAL;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ hp = NULL;
+ goto cleanup;
+ }
+ switch (af) {
+ case AF_INET:
+ qp = q->qname;
+ (void) sprintf(qp, "%u.%u.%u.%u.in-addr.arpa",
+ (uaddr[3] & 0xff),
+ (uaddr[2] & 0xff),
+ (uaddr[1] & 0xff),
+ (uaddr[0] & 0xff));
+ break;
+ case AF_INET6:
+ if (q->action != RESTGT_IGNORE) {
+ const char *nibsuff = res_get_nibblesuffix(pvt->res);
+ qp = q->qname;
+ for (n = IN6ADDRSZ - 1; n >= 0; n--) {
+ i = SPRINTF((qp, "%x.%x.",
+ uaddr[n] & 0xf,
+ (uaddr[n] >> 4) & 0xf));
+ if (i != 4)
+ abort();
+ qp += i;
+ }
+ if (strlen(q->qname) + strlen(nibsuff) + 1 >
+ sizeof q->qname) {
+ errno = ENAMETOOLONG;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ hp = NULL;
+ goto cleanup;
+ }
+ strcpy(qp, nibsuff); /* (checked) */
+ }
+ if (q2->action != RESTGT_IGNORE) {
+ const char *nibsuff2 = res_get_nibblesuffix2(pvt->res);
+ qp = q2->qname;
+ for (n = IN6ADDRSZ - 1; n >= 0; n--) {
+ i = SPRINTF((qp, "%x.%x.",
+ uaddr[n] & 0xf,
+ (uaddr[n] >> 4) & 0xf));
+ if (i != 4)
+ abort();
+ qp += i;
+ }
+ if (strlen(q2->qname) + strlen(nibsuff2) + 1 >
+ sizeof q2->qname) {
+ errno = ENAMETOOLONG;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ hp = NULL;
+ goto cleanup;
+ }
+ strcpy(qp, nibsuff2); /* (checked) */
+ }
+ break;
+ default:
+ abort();
+ }
+
+ for (p = q; p; p = p->next) {
+ switch(p->action) {
+ case RESTGT_DOALWAYS:
+ break;
+ case RESTGT_AFTERFAILURE:
+ if (querystate == RESQRY_SUCCESS)
+ continue;
+ break;
+ case RESTGT_IGNORE:
+ continue;
+ }
+
+ if ((n = res_nquery(pvt->res, p->qname, p->qclass, p->qtype,
+ p->answer, p->anslen)) < 0) {
+ querystate = RESQRY_FAIL;
+ continue;
+ }
+
+ memset(&ai, 0, sizeof(ai));
+ ai.ai_family = af;
+ hp = gethostans(this, p->answer, n, p->qname, T_PTR, af, size,
+ NULL, (const struct addrinfo *)&ai);
+ if (!hp) {
+ querystate = RESQRY_FAIL;
+ continue;
+ }
+
+ memcpy(pvt->host_addr, addr, len);
+ pvt->h_addr_ptrs[0] = (char *)pvt->host_addr;
+ pvt->h_addr_ptrs[1] = NULL;
+ if (af == AF_INET && (pvt->res->options & RES_USE_INET6)) {
+ map_v4v6_address((char*)pvt->host_addr,
+ (char*)pvt->host_addr);
+ pvt->host.h_addrtype = AF_INET6;
+ pvt->host.h_length = IN6ADDRSZ;
+ }
+
+ RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
+ goto cleanup; /*%< no more loop is necessary. */
+ }
+ hp = NULL; /*%< H_ERRNO was set by subroutines */
+ cleanup:
+ if (q != NULL)
+ memput(q, sizeof(*q));
+ if (q2 != NULL)
+ memput(q2, sizeof(*q2));
+ return(hp);
+}
+
+static struct hostent *
+ho_next(struct irs_ho *this) {
+
+ UNUSED(this);
+
+ return (NULL);
+}
+
+static void
+ho_rewind(struct irs_ho *this) {
+
+ UNUSED(this);
+
+ /* NOOP */
+}
+
+static void
+ho_minimize(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res)
+ res_nclose(pvt->res);
+}
+
+static struct __res_state *
+ho_res_get(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ ho_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+/* XXX */
+extern struct addrinfo *addr2addrinfo __P((const struct addrinfo *,
+ const char *));
+
+static struct addrinfo *
+ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ int n;
+ char tmp[NS_MAXDNAME];
+ const char *cp;
+ struct dns_res_target *q, *q2, *p;
+ struct addrinfo sentinel, *cur;
+ int querystate = RESQRY_FAIL;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ memset(&sentinel, 0, sizeof(sentinel));
+ cur = &sentinel;
+
+ q = memget(sizeof(*q));
+ q2 = memget(sizeof(*q2));
+ if (q == NULL || q2 == NULL) {
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ memset(q, 0, sizeof(*q2));
+ memset(q2, 0, sizeof(*q2));
+
+ switch (pai->ai_family) {
+ case AF_UNSPEC:
+ /* prefer IPv6 */
+ q->qclass = C_IN;
+ q->qtype = T_AAAA;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->next = q2;
+ q->action = RESTGT_DOALWAYS;
+ q2->qclass = C_IN;
+ q2->qtype = T_A;
+ q2->answer = q2->qbuf.buf;
+ q2->anslen = sizeof(q2->qbuf);
+ q2->action = RESTGT_DOALWAYS;
+ break;
+ case AF_INET:
+ q->qclass = C_IN;
+ q->qtype = T_A;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->action = RESTGT_DOALWAYS;
+ break;
+ case AF_INET6:
+ q->qclass = C_IN;
+ q->qtype = T_AAAA;
+ q->answer = q->qbuf.buf;
+ q->anslen = sizeof(q->qbuf);
+ q->action = RESTGT_DOALWAYS;
+ break;
+ default:
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /*%< better error? */
+ goto cleanup;
+ }
+
+ /*
+ * if there aren't any dots, it could be a user-level alias.
+ * this is also done in res_nquery() since we are not the only
+ * function that looks up host names.
+ */
+ if (!strchr(name, '.') && (cp = res_hostalias(pvt->res, name,
+ tmp, sizeof tmp)))
+ name = cp;
+
+ for (p = q; p; p = p->next) {
+ struct addrinfo *ai;
+
+ switch(p->action) {
+ case RESTGT_DOALWAYS:
+ break;
+ case RESTGT_AFTERFAILURE:
+ if (querystate == RESQRY_SUCCESS)
+ continue;
+ break;
+ case RESTGT_IGNORE:
+ continue;
+ }
+
+ if ((n = res_nsearch(pvt->res, name, p->qclass, p->qtype,
+ p->answer, p->anslen)) < 0) {
+ querystate = RESQRY_FAIL;
+ continue;
+ }
+ (void)gethostans(this, p->answer, n, name, p->qtype,
+ pai->ai_family, /*%< XXX: meaningless */
+ 0, &ai, pai);
+ if (ai) {
+ querystate = RESQRY_SUCCESS;
+ cur->ai_next = ai;
+ while (cur->ai_next)
+ cur = cur->ai_next;
+ } else
+ querystate = RESQRY_FAIL;
+ }
+
+ cleanup:
+ if (q != NULL)
+ memput(q, sizeof(*q));
+ if (q2 != NULL)
+ memput(q2, sizeof(*q2));
+ return(sentinel.ai_next);
+}
+
+static void
+ho_res_set(struct irs_ho *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+}
+
+/* Private. */
+
+static struct hostent *
+gethostans(struct irs_ho *this,
+ const u_char *ansbuf, int anslen, const char *qname, int qtype,
+ int af, int size, /*!< meaningless for addrinfo cases */
+ struct addrinfo **ret_aip, const struct addrinfo *pai)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ int type, class, ancount, qdcount, n, haveanswer, had_error;
+ int error = NETDB_SUCCESS;
+ int (*name_ok)(const char *);
+ const HEADER *hp;
+ const u_char *eom;
+ const u_char *eor;
+ const u_char *cp;
+ const char *tname;
+ const char *hname;
+ char *bp, *ep, **ap, **hap;
+ char tbuf[MAXDNAME+1];
+ struct addrinfo sentinel, *cur, ai;
+
+ if (pai == NULL) abort();
+ if (ret_aip != NULL)
+ *ret_aip = NULL;
+ memset(&sentinel, 0, sizeof(sentinel));
+ cur = &sentinel;
+
+ tname = qname;
+ eom = ansbuf + anslen;
+ switch (qtype) {
+ case T_A:
+ case T_AAAA:
+ case T_ANY: /*%< use T_ANY only for T_A/T_AAAA lookup */
+ name_ok = res_hnok;
+ break;
+ case T_PTR:
+ name_ok = res_dnok;
+ break;
+ default:
+ abort();
+ }
+
+ pvt->host.h_addrtype = af;
+ pvt->host.h_length = size;
+ hname = pvt->host.h_name = NULL;
+
+ /*
+ * Find first satisfactory answer.
+ */
+ if (ansbuf + HFIXEDSZ > eom) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ hp = (const HEADER *)ansbuf;
+ ancount = ntohs(hp->ancount);
+ qdcount = ntohs(hp->qdcount);
+ bp = pvt->hostbuf;
+ ep = pvt->hostbuf + sizeof(pvt->hostbuf);
+ cp = ansbuf + HFIXEDSZ;
+ if (qdcount != 1) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ n = dn_expand(ansbuf, eom, cp, bp, ep - bp);
+ if (n < 0 || !maybe_ok(pvt->res, bp, name_ok)) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ cp += n + QFIXEDSZ;
+ if (cp > eom) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ if (qtype == T_A || qtype == T_AAAA || qtype == T_ANY) {
+ /* res_nsend() has already verified that the query name is the
+ * same as the one we sent; this just gets the expanded name
+ * (i.e., with the succeeding search-domain tacked on).
+ */
+ n = strlen(bp) + 1; /*%< for the \\0 */
+ if (n > MAXHOSTNAMELEN) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ pvt->host.h_name = bp;
+ hname = bp;
+ bp += n;
+ /* The qname can be abbreviated, but hname is now absolute. */
+ qname = pvt->host.h_name;
+ }
+ ap = pvt->host_aliases;
+ *ap = NULL;
+ pvt->host.h_aliases = pvt->host_aliases;
+ hap = pvt->h_addr_ptrs;
+ *hap = NULL;
+ pvt->host.h_addr_list = pvt->h_addr_ptrs;
+ haveanswer = 0;
+ had_error = 0;
+ while (ancount-- > 0 && cp < eom && !had_error) {
+ n = dn_expand(ansbuf, eom, cp, bp, ep - bp);
+ if (n < 0 || !maybe_ok(pvt->res, bp, name_ok)) {
+ had_error++;
+ continue;
+ }
+ cp += n; /*%< name */
+ BOUNDS_CHECK(cp, 3 * INT16SZ + INT32SZ);
+ type = ns_get16(cp);
+ cp += INT16SZ; /*%< type */
+ class = ns_get16(cp);
+ cp += INT16SZ + INT32SZ; /*%< class, TTL */
+ n = ns_get16(cp);
+ cp += INT16SZ; /*%< len */
+ BOUNDS_CHECK(cp, n);
+ if (class != C_IN) {
+ cp += n;
+ continue;
+ }
+ eor = cp + n;
+ if ((qtype == T_A || qtype == T_AAAA || qtype == T_ANY) &&
+ type == T_CNAME) {
+ if (haveanswer) {
+ int level = LOG_CRIT;
+#ifdef LOG_SECURITY
+ level |= LOG_SECURITY;
+#endif
+ syslog(level,
+ "gethostans: possible attempt to exploit buffer overflow while looking up %s",
+ *qname ? qname : ".");
+ }
+ n = dn_expand(ansbuf, eor, cp, tbuf, sizeof tbuf);
+ if (n < 0 || !maybe_ok(pvt->res, tbuf, name_ok)) {
+ had_error++;
+ continue;
+ }
+ cp += n;
+ /* Store alias. */
+ if (ap >= &pvt->host_aliases[MAXALIASES-1])
+ continue;
+ *ap++ = bp;
+ n = strlen(bp) + 1; /*%< for the \\0 */
+ bp += n;
+ /* Get canonical name. */
+ n = strlen(tbuf) + 1; /*%< for the \\0 */
+ if (n > (ep - bp) || n > MAXHOSTNAMELEN) {
+ had_error++;
+ continue;
+ }
+ strcpy(bp, tbuf); /* (checked) */
+ pvt->host.h_name = bp;
+ hname = bp;
+ bp += n;
+ continue;
+ }
+ if (qtype == T_PTR && type == T_CNAME) {
+ n = dn_expand(ansbuf, eor, cp, tbuf, sizeof tbuf);
+ if (n < 0 || !maybe_dnok(pvt->res, tbuf)) {
+ had_error++;
+ continue;
+ }
+ cp += n;
+#ifdef RES_USE_DNAME
+ if ((pvt->res->options & RES_USE_DNAME) != 0U)
+#endif
+ {
+ /*
+ * We may be able to check this regardless
+ * of the USE_DNAME bit, but we add the check
+ * for now since the DNAME support is
+ * experimental.
+ */
+ if (ns_samename(tname, bp) != 1)
+ continue;
+ }
+ /* Get canonical name. */
+ n = strlen(tbuf) + 1; /*%< for the \\0 */
+ if (n > (ep - bp)) {
+ had_error++;
+ continue;
+ }
+ strcpy(bp, tbuf); /* (checked) */
+ tname = bp;
+ bp += n;
+ continue;
+ }
+ if (qtype == T_ANY) {
+ if (!(type == T_A || type == T_AAAA)) {
+ cp += n;
+ continue;
+ }
+ } else if (type != qtype) {
+ cp += n;
+ continue;
+ }
+ switch (type) {
+ case T_PTR:
+ if (ret_aip != NULL) {
+ /* addrinfo never needs T_PTR */
+ cp += n;
+ continue;
+ }
+ if (ns_samename(tname, bp) != 1) {
+ cp += n;
+ continue;
+ }
+ n = dn_expand(ansbuf, eor, cp, bp, ep - bp);
+ if (n < 0 || !maybe_hnok(pvt->res, bp) ||
+ n >= MAXHOSTNAMELEN) {
+ had_error++;
+ break;
+ }
+ cp += n;
+ if (!haveanswer) {
+ pvt->host.h_name = bp;
+ hname = bp;
+ }
+ else if (ap < &pvt->host_aliases[MAXALIASES-1])
+ *ap++ = bp;
+ else
+ n = -1;
+ if (n != -1) {
+ n = strlen(bp) + 1; /*%< for the \\0 */
+ bp += n;
+ }
+ break;
+ case T_A:
+ case T_AAAA:
+ if (ns_samename(hname, bp) != 1) {
+ cp += n;
+ continue;
+ }
+ if (type == T_A && n != INADDRSZ) {
+ cp += n;
+ continue;
+ }
+ if (type == T_AAAA && n != IN6ADDRSZ) {
+ cp += n;
+ continue;
+ }
+
+ /* make addrinfo. don't overwrite constant PAI */
+ ai = *pai;
+ ai.ai_family = (type == T_AAAA) ? AF_INET6 : AF_INET;
+ cur->ai_next = addr2addrinfo(
+ (const struct addrinfo *)&ai,
+ (const char *)cp);
+ if (cur->ai_next == NULL)
+ had_error++;
+
+ if (!haveanswer) {
+ int nn;
+
+ nn = strlen(bp) + 1; /*%< for the \\0 */
+ if (nn >= MAXHOSTNAMELEN) {
+ cp += n;
+ had_error++;
+ continue;
+ }
+ pvt->host.h_name = bp;
+ hname = bp;
+ bp += nn;
+ }
+ /* Ensure alignment. */
+ bp = (char *)(((u_long)bp + (sizeof(align) - 1)) &
+ ~(sizeof(align) - 1));
+ /* Avoid overflows. */
+ if (bp + n > &pvt->hostbuf[sizeof(pvt->hostbuf) - 1]) {
+ had_error++;
+ continue;
+ }
+ if (ret_aip) { /*%< need addrinfo. keep it. */
+ while (cur->ai_next)
+ cur = cur->ai_next;
+ } else if (cur->ai_next) { /*%< need hostent */
+ struct addrinfo *aip = cur->ai_next;
+
+ for (aip = cur->ai_next; aip;
+ aip = aip->ai_next) {
+ int m;
+
+ m = add_hostent(pvt, bp, hap, aip);
+ if (m < 0) {
+ had_error++;
+ break;
+ }
+ if (m == 0)
+ continue;
+ if (hap < &pvt->h_addr_ptrs[MAXADDRS])
+ hap++;
+ *hap = NULL;
+ bp += m;
+ }
+
+ freeaddrinfo(cur->ai_next);
+ cur->ai_next = NULL;
+ }
+ cp += n;
+ break;
+ default:
+ abort();
+ }
+ if (!had_error)
+ haveanswer++;
+ }
+ if (haveanswer) {
+ if (ret_aip == NULL) {
+ *ap = NULL;
+ *hap = NULL;
+
+ if (pvt->res->nsort && hap != pvt->h_addr_ptrs &&
+ qtype == T_A)
+ addrsort(pvt->res, pvt->h_addr_ptrs,
+ hap - pvt->h_addr_ptrs);
+ if (pvt->host.h_name == NULL) {
+ n = strlen(qname) + 1; /*%< for the \\0 */
+ if (n > (ep - bp) || n >= MAXHOSTNAMELEN)
+ goto no_recovery;
+ strcpy(bp, qname); /* (checked) */
+ pvt->host.h_name = bp;
+ bp += n;
+ }
+ if (pvt->res->options & RES_USE_INET6)
+ map_v4v6_hostent(&pvt->host, &bp, ep);
+ RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
+ return (&pvt->host);
+ } else {
+ if ((pai->ai_flags & AI_CANONNAME) != 0) {
+ if (pvt->host.h_name == NULL) {
+ sentinel.ai_next->ai_canonname =
+ strdup(qname);
+ }
+ else {
+ sentinel.ai_next->ai_canonname =
+ strdup(pvt->host.h_name);
+ }
+ }
+ *ret_aip = sentinel.ai_next;
+ return(NULL);
+ }
+ }
+ no_recovery:
+ if (sentinel.ai_next) {
+ /* this should be impossible, but check it for safety */
+ freeaddrinfo(sentinel.ai_next);
+ }
+ if (error == NETDB_SUCCESS)
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ else
+ RES_SET_H_ERRNO(pvt->res, error);
+ return(NULL);
+}
+
+static int
+add_hostent(struct pvt *pvt, char *bp, char **hap, struct addrinfo *ai)
+{
+ int addrlen;
+ char *addrp;
+ const char **tap;
+ char *obp = bp;
+
+ switch(ai->ai_addr->sa_family) {
+ case AF_INET6:
+ addrlen = IN6ADDRSZ;
+ addrp = (char *)&((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr;
+ break;
+ case AF_INET:
+ addrlen = INADDRSZ;
+ addrp = (char *)&((struct sockaddr_in *)ai->ai_addr)->sin_addr;
+ break;
+ default:
+ return(-1); /*%< abort? */
+ }
+
+ /* Ensure alignment. */
+ bp = (char *)(((u_long)bp + (sizeof(align) - 1)) &
+ ~(sizeof(align) - 1));
+ /* Avoid overflows. */
+ if (bp + addrlen > &pvt->hostbuf[sizeof(pvt->hostbuf) - 1])
+ return(-1);
+ if (hap >= &pvt->h_addr_ptrs[MAXADDRS])
+ return(0); /*%< fail, but not treat it as an error. */
+ /* Suppress duplicates. */
+ for (tap = (const char **)pvt->h_addr_ptrs;
+ *tap != NULL;
+ tap++)
+ if (memcmp(*tap, addrp, addrlen) == 0)
+ break;
+ if (*tap != NULL)
+ return (0);
+
+ memcpy(*hap = bp, addrp, addrlen);
+ return((bp + addrlen) - obp);
+}
+
+static void
+map_v4v6_hostent(struct hostent *hp, char **bpp, char *ep) {
+ char **ap;
+
+ if (hp->h_addrtype != AF_INET || hp->h_length != INADDRSZ)
+ return;
+ hp->h_addrtype = AF_INET6;
+ hp->h_length = IN6ADDRSZ;
+ for (ap = hp->h_addr_list; *ap; ap++) {
+ int i = (u_long)*bpp % sizeof(align);
+
+ if (i != 0)
+ i = sizeof(align) - i;
+
+ if ((ep - *bpp) < (i + IN6ADDRSZ)) {
+ /* Out of memory. Truncate address list here. */
+ *ap = NULL;
+ return;
+ }
+ *bpp += i;
+ map_v4v6_address(*ap, *bpp);
+ *ap = *bpp;
+ *bpp += IN6ADDRSZ;
+ }
+}
+
+static void
+addrsort(res_state statp, char **ap, int num) {
+ int i, j, needsort = 0, aval[MAXADDRS];
+ char **p;
+
+ p = ap;
+ for (i = 0; i < num; i++, p++) {
+ for (j = 0 ; (unsigned)j < statp->nsort; j++)
+ if (statp->sort_list[j].addr.s_addr ==
+ (((struct in_addr *)(*p))->s_addr &
+ statp->sort_list[j].mask))
+ break;
+ aval[i] = j;
+ if (needsort == 0 && i > 0 && j < aval[i-1])
+ needsort = i;
+ }
+ if (!needsort)
+ return;
+
+ while (needsort < num) {
+ for (j = needsort - 1; j >= 0; j--) {
+ if (aval[j] > aval[j+1]) {
+ char *hp;
+
+ i = aval[j];
+ aval[j] = aval[j+1];
+ aval[j+1] = i;
+
+ hp = ap[j];
+ ap[j] = ap[j+1];
+ ap[j+1] = hp;
+
+ } else
+ break;
+ }
+ needsort++;
+ }
+}
+
+static int
+init(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res && !ho_res_get(this))
+ return (-1);
+ if (((pvt->res->options & RES_INIT) == 0U) &&
+ res_ninit(pvt->res) == -1)
+ return (-1);
+ return (0);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/irs/dns_nw.c b/usr/src/lib/libresolv2_joy/common/irs/dns_nw.c
new file mode 100644
index 0000000000..e9acfd39c7
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/dns_nw.c
@@ -0,0 +1,591 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: dns_nw.c,v 1.12 2005/04/27 04:56:22 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports. */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "dns_p.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) sprintf x
+#endif
+
+/* Definitions. */
+
+#define MAXALIASES 35
+
+#define MAXPACKET (64*1024)
+
+struct pvt {
+ struct nwent net;
+ char * ali[MAXALIASES];
+ char buf[BUFSIZ+1];
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+typedef union {
+ long al;
+ char ac;
+} align;
+
+enum by_what { by_addr, by_name };
+
+/* Forwards. */
+
+static void nw_close(struct irs_nw *);
+static struct nwent * nw_byname(struct irs_nw *, const char *, int);
+static struct nwent * nw_byaddr(struct irs_nw *, void *, int, int);
+static struct nwent * nw_next(struct irs_nw *);
+static void nw_rewind(struct irs_nw *);
+static void nw_minimize(struct irs_nw *);
+static struct __res_state * nw_res_get(struct irs_nw *this);
+static void nw_res_set(struct irs_nw *this,
+ struct __res_state *res,
+ void (*free_res)(void *));
+
+static struct nwent * get1101byaddr(struct irs_nw *, u_char *, int);
+static struct nwent * get1101byname(struct irs_nw *, const char *);
+static struct nwent * get1101answer(struct irs_nw *,
+ u_char *ansbuf, int anslen,
+ enum by_what by_what,
+ int af, const char *name,
+ const u_char *addr, int addrlen);
+static struct nwent * get1101mask(struct irs_nw *this, struct nwent *);
+static int make1101inaddr(const u_char *, int, char *, int);
+static void normalize_name(char *name);
+static int init(struct irs_nw *this);
+
+/* Exports. */
+
+struct irs_nw *
+irs_dns_nw(struct irs_acc *this) {
+ struct irs_nw *nw;
+ struct pvt *pvt;
+
+ UNUSED(this);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ if (!(nw = memget(sizeof *nw))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(nw, 0x5e, sizeof *nw);
+ nw->private = pvt;
+ nw->close = nw_close;
+ nw->byname = nw_byname;
+ nw->byaddr = nw_byaddr;
+ nw->next = nw_next;
+ nw->rewind = nw_rewind;
+ nw->minimize = nw_minimize;
+ nw->res_get = nw_res_get;
+ nw->res_set = nw_res_set;
+ return (nw);
+}
+
+/* Methods. */
+
+static void
+nw_close(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ nw_minimize(this);
+
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct nwent *
+nw_byname(struct irs_nw *this, const char *name, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ switch (af) {
+ case AF_INET:
+ return (get1101byname(this, name));
+ default:
+ (void)NULL;
+ }
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = EAFNOSUPPORT;
+ return (NULL);
+}
+
+static struct nwent *
+nw_byaddr(struct irs_nw *this, void *net, int len, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ switch (af) {
+ case AF_INET:
+ return (get1101byaddr(this, net, len));
+ default:
+ (void)NULL;
+ }
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = EAFNOSUPPORT;
+ return (NULL);
+}
+
+static struct nwent *
+nw_next(struct irs_nw *this) {
+
+ UNUSED(this);
+
+ return (NULL);
+}
+
+static void
+nw_rewind(struct irs_nw *this) {
+ UNUSED(this);
+ /* NOOP */
+}
+
+static void
+nw_minimize(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res)
+ res_nclose(pvt->res);
+}
+
+static struct __res_state *
+nw_res_get(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ nw_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+nw_res_set(struct irs_nw *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+}
+
+/* Private. */
+
+static struct nwent *
+get1101byname(struct irs_nw *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ u_char *ansbuf;
+ int anslen;
+ struct nwent *result;
+
+ ansbuf = memget(MAXPACKET);
+ if (ansbuf == NULL) {
+ errno = ENOMEM;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ anslen = res_nsearch(pvt->res, name, C_IN, T_PTR, ansbuf, MAXPACKET);
+ if (anslen < 0) {
+ memput(ansbuf, MAXPACKET);
+ return (NULL);
+ }
+ result = get1101mask(this, get1101answer(this, ansbuf, anslen, by_name,
+ AF_INET, name, NULL, 0));
+ memput(ansbuf, MAXPACKET);
+ return (result);
+}
+
+static struct nwent *
+get1101byaddr(struct irs_nw *this, u_char *net, int len) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char qbuf[sizeof "255.255.255.255.in-addr.arpa"];
+ struct nwent *result;
+ u_char *ansbuf;
+ int anslen;
+
+ if (len < 1 || len > 32) {
+ errno = EINVAL;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ if (make1101inaddr(net, len, qbuf, sizeof qbuf) < 0)
+ return (NULL);
+ ansbuf = memget(MAXPACKET);
+ if (ansbuf == NULL) {
+ errno = ENOMEM;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ anslen = res_nquery(pvt->res, qbuf, C_IN, T_PTR, ansbuf, MAXPACKET);
+ if (anslen < 0) {
+ memput(ansbuf, MAXPACKET);
+ return (NULL);
+ }
+ result = get1101mask(this, get1101answer(this, ansbuf, anslen, by_addr,
+ AF_INET, NULL, net, len));
+ memput(ansbuf, MAXPACKET);
+ return (result);
+}
+
+static struct nwent *
+get1101answer(struct irs_nw *this,
+ u_char *ansbuf, int anslen, enum by_what by_what,
+ int af, const char *name, const u_char *addr, int addrlen)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ int type, class, ancount, qdcount, haveanswer;
+ char *bp, *ep, **ap;
+ u_char *cp, *eom;
+ HEADER *hp;
+
+ /* Initialize, and parse header. */
+ eom = ansbuf + anslen;
+ if (ansbuf + HFIXEDSZ > eom) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ hp = (HEADER *)ansbuf;
+ cp = ansbuf + HFIXEDSZ;
+ qdcount = ntohs(hp->qdcount);
+ while (qdcount-- > 0) {
+ int n = dn_skipname(cp, eom);
+ cp += n + QFIXEDSZ;
+ if (n < 0 || cp > eom) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ }
+ ancount = ntohs(hp->ancount);
+ if (!ancount) {
+ if (hp->aa)
+ RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND);
+ else
+ RES_SET_H_ERRNO(pvt->res, TRY_AGAIN);
+ return (NULL);
+ }
+
+ /* Prepare a return structure. */
+ bp = pvt->buf;
+ ep = pvt->buf + sizeof(pvt->buf);
+ pvt->net.n_name = NULL;
+ pvt->net.n_aliases = pvt->ali;
+ pvt->net.n_addrtype = af;
+ pvt->net.n_addr = NULL;
+ pvt->net.n_length = addrlen;
+
+ /* Save input key if given. */
+ switch (by_what) {
+ case by_name:
+ if (name != NULL) {
+ int n = strlen(name) + 1;
+
+ if (n > (ep - bp)) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ pvt->net.n_name = strcpy(bp, name); /* (checked) */
+ bp += n;
+ }
+ break;
+ case by_addr:
+ if (addr != NULL && addrlen != 0) {
+ int n = addrlen / 8 + ((addrlen % 8) != 0);
+
+ if (INADDRSZ > (ep - bp)) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ memset(bp, 0, INADDRSZ);
+ memcpy(bp, addr, n);
+ pvt->net.n_addr = bp;
+ bp += INADDRSZ;
+ }
+ break;
+ default:
+ abort();
+ }
+
+ /* Parse the answer, collect aliases. */
+ ap = pvt->ali;
+ haveanswer = 0;
+ while (--ancount >= 0 && cp < eom) {
+ int n = dn_expand(ansbuf, eom, cp, bp, ep - bp);
+
+ cp += n; /*%< Owner */
+ if (n < 0 || !maybe_dnok(pvt->res, bp) ||
+ cp + 3 * INT16SZ + INT32SZ > eom) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ GETSHORT(type, cp); /*%< Type */
+ GETSHORT(class, cp); /*%< Class */
+ cp += INT32SZ; /*%< TTL */
+ GETSHORT(n, cp); /*%< RDLENGTH */
+ if (class == C_IN && type == T_PTR) {
+ int nn;
+
+ nn = dn_expand(ansbuf, eom, cp, bp, ep - bp);
+ if (nn < 0 || !maybe_hnok(pvt->res, bp) || nn != n) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ normalize_name(bp);
+ switch (by_what) {
+ case by_addr: {
+ if (pvt->net.n_name == NULL)
+ pvt->net.n_name = bp;
+ else if (ns_samename(pvt->net.n_name, bp) == 1)
+ break;
+ else
+ *ap++ = bp;
+ nn = strlen(bp) + 1;
+ bp += nn;
+ haveanswer++;
+ break;
+ }
+ case by_name: {
+ u_int b1, b2, b3, b4;
+
+ if (pvt->net.n_addr != NULL ||
+ sscanf(bp, "%u.%u.%u.%u.in-addr.arpa",
+ &b1, &b2, &b3, &b4) != 4)
+ break;
+ if ((ep - bp) < INADDRSZ) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ return (NULL);
+ }
+ pvt->net.n_addr = bp;
+ *bp++ = b4;
+ *bp++ = b3;
+ *bp++ = b2;
+ *bp++ = b1;
+ pvt->net.n_length = INADDRSZ * 8;
+ haveanswer++;
+ }
+ }
+ }
+ cp += n; /*%< RDATA */
+ }
+ if (!haveanswer) {
+ RES_SET_H_ERRNO(pvt->res, TRY_AGAIN);
+ return (NULL);
+ }
+ *ap = NULL;
+
+ return (&pvt->net);
+}
+
+static struct nwent *
+get1101mask(struct irs_nw *this, struct nwent *nwent) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char qbuf[sizeof "255.255.255.255.in-addr.arpa"], owner[MAXDNAME];
+ int anslen, type, class, ancount, qdcount;
+ u_char *ansbuf, *cp, *eom;
+ HEADER *hp;
+
+ if (!nwent)
+ return (NULL);
+ if (make1101inaddr(nwent->n_addr, nwent->n_length, qbuf, sizeof qbuf)
+ < 0) {
+ /* "First, do no harm." */
+ return (nwent);
+ }
+
+ ansbuf = memget(MAXPACKET);
+ if (ansbuf == NULL) {
+ errno = ENOMEM;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ /* Query for the A RR that would hold this network's mask. */
+ anslen = res_nquery(pvt->res, qbuf, C_IN, T_A, ansbuf, MAXPACKET);
+ if (anslen < HFIXEDSZ) {
+ memput(ansbuf, MAXPACKET);
+ return (nwent);
+ }
+
+ /* Initialize, and parse header. */
+ hp = (HEADER *)ansbuf;
+ cp = ansbuf + HFIXEDSZ;
+ eom = ansbuf + anslen;
+ qdcount = ntohs(hp->qdcount);
+ while (qdcount-- > 0) {
+ int n = dn_skipname(cp, eom);
+ cp += n + QFIXEDSZ;
+ if (n < 0 || cp > eom) {
+ memput(ansbuf, MAXPACKET);
+ return (nwent);
+ }
+ }
+ ancount = ntohs(hp->ancount);
+
+ /* Parse the answer, collect aliases. */
+ while (--ancount >= 0 && cp < eom) {
+ int n = dn_expand(ansbuf, eom, cp, owner, sizeof owner);
+
+ if (n < 0 || !maybe_dnok(pvt->res, owner))
+ break;
+ cp += n; /*%< Owner */
+ if (cp + 3 * INT16SZ + INT32SZ > eom)
+ break;
+ GETSHORT(type, cp); /*%< Type */
+ GETSHORT(class, cp); /*%< Class */
+ cp += INT32SZ; /*%< TTL */
+ GETSHORT(n, cp); /*%< RDLENGTH */
+ if (cp + n > eom)
+ break;
+ if (n == INADDRSZ && class == C_IN && type == T_A &&
+ ns_samename(qbuf, owner) == 1) {
+ /* This A RR indicates the actual netmask. */
+ int nn, mm;
+
+ nwent->n_length = 0;
+ for (nn = 0; nn < INADDRSZ; nn++)
+ for (mm = 7; mm >= 0; mm--)
+ if (cp[nn] & (1 << mm))
+ nwent->n_length++;
+ else
+ break;
+ }
+ cp += n; /*%< RDATA */
+ }
+ memput(ansbuf, MAXPACKET);
+ return (nwent);
+}
+
+static int
+make1101inaddr(const u_char *net, int bits, char *name, int size) {
+ int n, m;
+ char *ep;
+
+ ep = name + size;
+
+ /* Zero fill any whole bytes left out of the prefix. */
+ for (n = (32 - bits) / 8; n > 0; n--) {
+ if (ep - name < (int)(sizeof "0."))
+ goto emsgsize;
+ m = SPRINTF((name, "0."));
+ name += m;
+ }
+
+ /* Format the partial byte, if any, within the prefix. */
+ if ((n = bits % 8) != 0) {
+ if (ep - name < (int)(sizeof "255."))
+ goto emsgsize;
+ m = SPRINTF((name, "%u.",
+ net[bits / 8] & ~((1 << (8 - n)) - 1)));
+ name += m;
+ }
+
+ /* Format the whole bytes within the prefix. */
+ for (n = bits / 8; n > 0; n--) {
+ if (ep - name < (int)(sizeof "255."))
+ goto emsgsize;
+ m = SPRINTF((name, "%u.", net[n - 1]));
+ name += m;
+ }
+
+ /* Add the static text. */
+ if (ep - name < (int)(sizeof "in-addr.arpa"))
+ goto emsgsize;
+ (void) SPRINTF((name, "in-addr.arpa"));
+ return (0);
+
+ emsgsize:
+ errno = EMSGSIZE;
+ return (-1);
+}
+
+static void
+normalize_name(char *name) {
+ char *t;
+
+ /* Make lower case. */
+ for (t = name; *t; t++)
+ if (isascii((unsigned char)*t) && isupper((unsigned char)*t))
+ *t = tolower((*t)&0xff);
+
+ /* Remove trailing dots. */
+ while (t > name && t[-1] == '.')
+ *--t = '\0';
+}
+
+static int
+init(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res && !nw_res_get(this))
+ return (-1);
+ if (((pvt->res->options & RES_INIT) == 0U) &&
+ res_ninit(pvt->res) == -1)
+ return (-1);
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/dns_p.h b/usr/src/lib/libresolv2_joy/common/irs/dns_p.h
new file mode 100644
index 0000000000..d85ae2a238
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/dns_p.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: dns_p.h,v 1.4 2005/04/27 04:56:22 sra Exp $
+ */
+
+#ifndef _DNS_P_H_INCLUDED
+#define _DNS_P_H_INCLUDED
+
+#define maybe_ok(res, nm, ok) (((res)->options & RES_NOCHECKNAME) != 0U || \
+ (ok)(nm) != 0)
+#define maybe_hnok(res, hn) maybe_ok((res), (hn), res_hnok)
+#define maybe_dnok(res, dn) maybe_ok((res), (dn), res_dnok)
+
+/*%
+ * Object state.
+ */
+struct dns_p {
+ void *hes_ctx;
+ struct __res_state *res;
+ void (*free_res) __P((void *));
+};
+
+/*
+ * Methods.
+ */
+
+extern struct irs_gr * irs_dns_gr __P((struct irs_acc *));
+extern struct irs_pw * irs_dns_pw __P((struct irs_acc *));
+extern struct irs_sv * irs_dns_sv __P((struct irs_acc *));
+extern struct irs_pr * irs_dns_pr __P((struct irs_acc *));
+extern struct irs_ho * irs_dns_ho __P((struct irs_acc *));
+extern struct irs_nw * irs_dns_nw __P((struct irs_acc *));
+
+#endif /*_DNS_P_H_INCLUDED*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/dns_pr.c b/usr/src/lib/libresolv2_joy/common/irs/dns_pr.c
new file mode 100644
index 0000000000..c281be432c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/dns_pr.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: dns_pr.c,v 1.5 2005/04/27 04:56:22 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "hesiod.h"
+#include "dns_p.h"
+
+/* Types. */
+
+struct pvt {
+ struct dns_p * dns;
+ struct protoent proto;
+ char * prbuf;
+};
+
+/* Forward. */
+
+static void pr_close(struct irs_pr *);
+static struct protoent * pr_byname(struct irs_pr *, const char *);
+static struct protoent * pr_bynumber(struct irs_pr *, int);
+static struct protoent * pr_next(struct irs_pr *);
+static void pr_rewind(struct irs_pr *);
+static void pr_minimize(struct irs_pr *);
+static struct __res_state * pr_res_get(struct irs_pr *);
+static void pr_res_set(struct irs_pr *,
+ struct __res_state *,
+ void (*)(void *));
+
+static struct protoent * parse_hes_list(struct irs_pr *, char **);
+
+/* Public. */
+
+struct irs_pr *
+irs_dns_pr(struct irs_acc *this) {
+ struct dns_p *dns = (struct dns_p *)this->private;
+ struct pvt *pvt;
+ struct irs_pr *pr;
+
+ if (!dns->hes_ctx) {
+ errno = ENODEV;
+ return (NULL);
+ }
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ if (!(pr = memget(sizeof *pr))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pr, 0x5e, sizeof *pr);
+ pvt->dns = dns;
+ pr->private = pvt;
+ pr->byname = pr_byname;
+ pr->bynumber = pr_bynumber;
+ pr->next = pr_next;
+ pr->rewind = pr_rewind;
+ pr->close = pr_close;
+ pr->minimize = pr_minimize;
+ pr->res_get = pr_res_get;
+ pr->res_set = pr_res_set;
+ return (pr);
+}
+
+/* Methods. */
+
+static void
+pr_close(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->proto.p_aliases)
+ free(pvt->proto.p_aliases);
+ if (pvt->prbuf)
+ free(pvt->prbuf);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct protoent *
+pr_byname(struct irs_pr *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+ struct protoent *proto;
+ char **hes_list;
+
+ if (!(hes_list = hesiod_resolve(dns->hes_ctx, name, "protocol")))
+ return (NULL);
+
+ proto = parse_hes_list(this, hes_list);
+ hesiod_free_list(dns->hes_ctx, hes_list);
+ return (proto);
+}
+
+static struct protoent *
+pr_bynumber(struct irs_pr *this, int num) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+ struct protoent *proto;
+ char numstr[16];
+ char **hes_list;
+
+ sprintf(numstr, "%d", num);
+ if (!(hes_list = hesiod_resolve(dns->hes_ctx, numstr, "protonum")))
+ return (NULL);
+
+ proto = parse_hes_list(this, hes_list);
+ hesiod_free_list(dns->hes_ctx, hes_list);
+ return (proto);
+}
+
+static struct protoent *
+pr_next(struct irs_pr *this) {
+ UNUSED(this);
+ errno = ENODEV;
+ return (NULL);
+}
+
+static void
+pr_rewind(struct irs_pr *this) {
+ UNUSED(this);
+ /* NOOP */
+}
+
+static void
+pr_minimize(struct irs_pr *this) {
+ UNUSED(this);
+ /* NOOP */
+}
+
+static struct __res_state *
+pr_res_get(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+
+ return (__hesiod_res_get(dns->hes_ctx));
+}
+
+static void
+pr_res_set(struct irs_pr *this, struct __res_state * res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+
+ __hesiod_res_set(dns->hes_ctx, res, free_res);
+}
+
+/* Private. */
+
+static struct protoent *
+parse_hes_list(struct irs_pr *this, char **hes_list) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *p, *cp, **cpp, **new;
+ int num = 0;
+ int max = 0;
+
+ for (cpp = hes_list; *cpp; cpp++) {
+ cp = *cpp;
+
+ /* Strip away comments, if any. */
+ if ((p = strchr(cp, '#')))
+ *p = 0;
+
+ /* Skip blank lines. */
+ p = cp;
+ while (*p && !isspace((unsigned char)*p))
+ p++;
+ if (!*p)
+ continue;
+
+ /* OK, we've got a live one. Let's parse it for real. */
+ if (pvt->prbuf)
+ free(pvt->prbuf);
+ pvt->prbuf = strdup(cp);
+
+ p = pvt->prbuf;
+ pvt->proto.p_name = p;
+ while (*p && !isspace((unsigned char)*p))
+ p++;
+ if (!*p)
+ continue;
+ *p++ = '\0';
+
+ pvt->proto.p_proto = atoi(p);
+ while (*p && !isspace((unsigned char)*p))
+ p++;
+ if (*p)
+ *p++ = '\0';
+
+ while (*p) {
+ if ((num + 1) >= max || !pvt->proto.p_aliases) {
+ max += 10;
+ new = realloc(pvt->proto.p_aliases,
+ max * sizeof(char *));
+ if (!new) {
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ pvt->proto.p_aliases = new;
+ }
+ pvt->proto.p_aliases[num++] = p;
+ while (*p && !isspace((unsigned char)*p))
+ p++;
+ if (*p)
+ *p++ = '\0';
+ }
+ if (!pvt->proto.p_aliases)
+ pvt->proto.p_aliases = malloc(sizeof(char *));
+ if (!pvt->proto.p_aliases)
+ goto cleanup;
+ pvt->proto.p_aliases[num] = NULL;
+ return (&pvt->proto);
+ }
+
+ cleanup:
+ if (pvt->proto.p_aliases) {
+ free(pvt->proto.p_aliases);
+ pvt->proto.p_aliases = NULL;
+ }
+ if (pvt->prbuf) {
+ free(pvt->prbuf);
+ pvt->prbuf = NULL;
+ }
+ return (NULL);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/dns_sv.c b/usr/src/lib/libresolv2_joy/common/irs/dns_sv.c
new file mode 100644
index 0000000000..1001dc1051
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/dns_sv.c
@@ -0,0 +1,300 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: dns_sv.c,v 1.5 2005/04/27 04:56:23 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "hesiod.h"
+#include "dns_p.h"
+
+/* Definitions */
+
+struct pvt {
+ struct dns_p * dns;
+ struct servent serv;
+ char * svbuf;
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+/* Forward. */
+
+static void sv_close(struct irs_sv *);
+static struct servent * sv_byname(struct irs_sv *,
+ const char *, const char *);
+static struct servent * sv_byport(struct irs_sv *, int, const char *);
+static struct servent * sv_next(struct irs_sv *);
+static void sv_rewind(struct irs_sv *);
+static void sv_minimize(struct irs_sv *);
+#ifdef SV_RES_SETGET
+static struct __res_state * sv_res_get(struct irs_sv *);
+static void sv_res_set(struct irs_sv *,
+ struct __res_state *,
+ void (*)(void *));
+#endif
+
+static struct servent * parse_hes_list(struct irs_sv *,
+ char **, const char *);
+
+/* Public */
+
+struct irs_sv *
+irs_dns_sv(struct irs_acc *this) {
+ struct dns_p *dns = (struct dns_p *)this->private;
+ struct irs_sv *sv;
+ struct pvt *pvt;
+
+ if (!dns || !dns->hes_ctx) {
+ errno = ENODEV;
+ return (NULL);
+ }
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->dns = dns;
+ if (!(sv = memget(sizeof *sv))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(sv, 0x5e, sizeof *sv);
+ sv->private = pvt;
+ sv->byname = sv_byname;
+ sv->byport = sv_byport;
+ sv->next = sv_next;
+ sv->rewind = sv_rewind;
+ sv->close = sv_close;
+ sv->minimize = sv_minimize;
+#ifdef SV_RES_SETGET
+ sv->res_get = sv_res_get;
+ sv->res_set = sv_res_set;
+#else
+ sv->res_get = NULL; /*%< sv_res_get; */
+ sv->res_set = NULL; /*%< sv_res_set; */
+#endif
+ return (sv);
+}
+
+/* Methods */
+
+static void
+sv_close(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->serv.s_aliases)
+ free(pvt->serv.s_aliases);
+ if (pvt->svbuf)
+ free(pvt->svbuf);
+
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct servent *
+sv_byname(struct irs_sv *this, const char *name, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+ struct servent *s;
+ char **hes_list;
+
+ if (!(hes_list = hesiod_resolve(dns->hes_ctx, name, "service")))
+ return (NULL);
+
+ s = parse_hes_list(this, hes_list, proto);
+ hesiod_free_list(dns->hes_ctx, hes_list);
+ return (s);
+}
+
+static struct servent *
+sv_byport(struct irs_sv *this, int port, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+ struct servent *s;
+ char portstr[16];
+ char **hes_list;
+
+ sprintf(portstr, "%d", ntohs(port));
+ if (!(hes_list = hesiod_resolve(dns->hes_ctx, portstr, "port")))
+ return (NULL);
+
+ s = parse_hes_list(this, hes_list, proto);
+ hesiod_free_list(dns->hes_ctx, hes_list);
+ return (s);
+}
+
+static struct servent *
+sv_next(struct irs_sv *this) {
+ UNUSED(this);
+ errno = ENODEV;
+ return (NULL);
+}
+
+static void
+sv_rewind(struct irs_sv *this) {
+ UNUSED(this);
+ /* NOOP */
+}
+
+/* Private */
+
+static struct servent *
+parse_hes_list(struct irs_sv *this, char **hes_list, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *p, *cp, **cpp, **new;
+ int proto_len;
+ int num = 0;
+ int max = 0;
+
+ for (cpp = hes_list; *cpp; cpp++) {
+ cp = *cpp;
+
+ /* Strip away comments, if any. */
+ if ((p = strchr(cp, '#')))
+ *p = 0;
+
+ /* Check to make sure the protocol matches. */
+ p = cp;
+ while (*p && !isspace((unsigned char)*p))
+ p++;
+ if (!*p)
+ continue;
+ if (proto) {
+ proto_len = strlen(proto);
+ if (strncasecmp(++p, proto, proto_len) != 0)
+ continue;
+ if (p[proto_len] && !isspace(p[proto_len]&0xff))
+ continue;
+ }
+ /* OK, we've got a live one. Let's parse it for real. */
+ if (pvt->svbuf)
+ free(pvt->svbuf);
+ pvt->svbuf = strdup(cp);
+
+ p = pvt->svbuf;
+ pvt->serv.s_name = p;
+ while (*p && !isspace(*p&0xff))
+ p++;
+ if (!*p)
+ continue;
+ *p++ = '\0';
+
+ pvt->serv.s_proto = p;
+ while (*p && !isspace(*p&0xff))
+ p++;
+ if (!*p)
+ continue;
+ *p++ = '\0';
+
+ pvt->serv.s_port = htons((u_short) atoi(p));
+ while (*p && !isspace(*p&0xff))
+ p++;
+ if (*p)
+ *p++ = '\0';
+
+ while (*p) {
+ if ((num + 1) >= max || !pvt->serv.s_aliases) {
+ max += 10;
+ new = realloc(pvt->serv.s_aliases,
+ max * sizeof(char *));
+ if (!new) {
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ pvt->serv.s_aliases = new;
+ }
+ pvt->serv.s_aliases[num++] = p;
+ while (*p && !isspace(*p&0xff))
+ p++;
+ if (*p)
+ *p++ = '\0';
+ }
+ if (!pvt->serv.s_aliases)
+ pvt->serv.s_aliases = malloc(sizeof(char *));
+ if (!pvt->serv.s_aliases)
+ goto cleanup;
+ pvt->serv.s_aliases[num] = NULL;
+ return (&pvt->serv);
+ }
+
+ cleanup:
+ if (pvt->serv.s_aliases) {
+ free(pvt->serv.s_aliases);
+ pvt->serv.s_aliases = NULL;
+ }
+ if (pvt->svbuf) {
+ free(pvt->svbuf);
+ pvt->svbuf = NULL;
+ }
+ return (NULL);
+}
+
+static void
+sv_minimize(struct irs_sv *this) {
+ UNUSED(this);
+ /* NOOP */
+}
+
+#ifdef SV_RES_SETGET
+static struct __res_state *
+sv_res_get(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+
+ return (__hesiod_res_get(dns->hes_ctx));
+}
+
+static void
+sv_res_set(struct irs_sv *this, struct __res_state * res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct dns_p *dns = pvt->dns;
+
+ __hesiod_res_set(dns->hes_ctx, res, free_res);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gai_strerror.c b/usr/src/lib/libresolv2_joy/common/irs/gai_strerror.c
new file mode 100644
index 0000000000..9ca1c4bfe1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gai_strerror.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2001 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <port_before.h>
+#include <netdb.h>
+#include <port_after.h>
+
+#ifdef DO_PTHREADS
+#include <pthread.h>
+#include <stdlib.h>
+#endif
+
+static const char *gai_errlist[] = {
+ "no error",
+ "address family not supported for name",/*%< EAI_ADDRFAMILY */
+ "temporary failure", /*%< EAI_AGAIN */
+ "invalid flags", /*%< EAI_BADFLAGS */
+ "permanent failure", /*%< EAI_FAIL */
+ "address family not supported", /*%< EAI_FAMILY */
+ "memory failure", /*%< EAI_MEMORY */
+ "no address", /*%< EAI_NODATA */
+ "unknown name or service", /*%< EAI_NONAME */
+ "service not supported for socktype", /*%< EAI_SERVICE */
+ "socktype not supported", /*%< EAI_SOCKTYPE */
+ "system failure", /*%< EAI_SYSTEM */
+ "bad hints", /*%< EAI_BADHINTS */
+ "bad protocol", /*%< EAI_PROTOCOL */
+ "unknown error" /*%< Must be last. */
+};
+
+static const int gai_nerr = (sizeof(gai_errlist)/sizeof(*gai_errlist));
+
+#define EAI_BUFSIZE 128
+
+const char *
+gai_strerror(int ecode) {
+#ifndef DO_PTHREADS
+ static char buf[EAI_BUFSIZE];
+#else /* DO_PTHREADS */
+#ifndef LIBBIND_MUTEX_INITIALIZER
+#define LIBBIND_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#endif
+ static pthread_mutex_t lock = LIBBIND_MUTEX_INITIALIZER;
+ static pthread_key_t key;
+ static int once = 0;
+ char *buf;
+#endif
+
+ if (ecode >= 0 && ecode < (gai_nerr - 1))
+ return (gai_errlist[ecode]);
+
+#ifdef DO_PTHREADS
+ if (!once) {
+ if (pthread_mutex_lock(&lock) != 0)
+ goto unknown;
+ if (!once) {
+ if (pthread_key_create(&key, free) != 0) {
+ (void)pthread_mutex_unlock(&lock);
+ goto unknown;
+ }
+ once = 1;
+ }
+ if (pthread_mutex_unlock(&lock) != 0)
+ goto unknown;
+ }
+
+ buf = pthread_getspecific(key);
+ if (buf == NULL) {
+ buf = malloc(EAI_BUFSIZE);
+ if (buf == NULL)
+ goto unknown;
+ if (pthread_setspecific(key, buf) != 0) {
+ free(buf);
+ goto unknown;
+ }
+ }
+#endif
+ /*
+ * XXX This really should be snprintf(buf, EAI_BUFSIZE, ...).
+ * It is safe until message catalogs are used.
+ */
+ sprintf(buf, "%s: %d", gai_errlist[gai_nerr - 1], ecode);
+ return (buf);
+
+#ifdef DO_PTHREADS
+ unknown:
+ return ("unknown error");
+#endif
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen.c b/usr/src/lib/libresolv2_joy/common/irs/gen.c
new file mode 100644
index 0000000000..7da01f5b09
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen.c
@@ -0,0 +1,459 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: gen.c,v 1.7 2005/04/27 04:56:23 sra Exp $";
+#endif
+
+/*! \file
+ * \brief
+ * this is the top level dispatcher
+ *
+ * The dispatcher is implemented as an accessor class; it is an
+ * accessor class that calls other accessor classes, as controlled by a
+ * configuration file.
+ *
+ * A big difference between this accessor class and others is that the
+ * map class initializers are NULL, and the map classes are already
+ * filled in with method functions that will do the right thing.
+ */
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <isc/assertions.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "gen_p.h"
+
+#ifdef SUNW_HOSTS_FALLBACK
+extern int __res_no_hosts_fallback(void);
+#endif /* SUNW_HOSTS_FALLBACK */
+
+/* Definitions */
+
+struct nameval {
+ const char * name;
+ int val;
+};
+
+static const struct nameval acc_names[irs_nacc+1] = {
+ { "local", irs_lcl },
+ { "dns", irs_dns },
+ { "nis", irs_nis },
+ { "irp", irs_irp },
+ { NULL, irs_nacc }
+};
+
+typedef struct irs_acc *(*accinit) __P((const char *options));
+
+static const accinit accs[irs_nacc+1] = {
+ irs_lcl_acc,
+ irs_dns_acc,
+#ifdef WANT_IRS_NIS
+ irs_nis_acc,
+#else
+ NULL,
+#endif
+ irs_irp_acc,
+ NULL
+};
+
+static const struct nameval map_names[irs_nmap+1] = {
+ { "group", irs_gr },
+ { "passwd", irs_pw },
+ { "services", irs_sv },
+ { "protocols", irs_pr },
+ { "hosts", irs_ho },
+ { "networks", irs_nw },
+ { "netgroup", irs_ng },
+ { NULL, irs_nmap }
+};
+
+static const struct nameval option_names[] = {
+ { "merge", IRS_MERGE },
+ { "continue", IRS_CONTINUE },
+ { NULL, 0 }
+};
+
+/* Forward */
+
+static void gen_close(struct irs_acc *);
+static struct __res_state * gen_res_get(struct irs_acc *);
+static void gen_res_set(struct irs_acc *, struct __res_state *,
+ void (*)(void *));
+static int find_name(const char *, const struct nameval nv[]);
+static void init_map_rules(struct gen_p *, const char *conf_file);
+static struct irs_rule *release_rule(struct irs_rule *);
+static int add_rule(struct gen_p *,
+ enum irs_map_id, enum irs_acc_id,
+ const char *);
+
+/* Public */
+
+struct irs_acc *
+irs_gen_acc(const char *options, const char *conf_file) {
+ struct irs_acc *acc;
+ struct gen_p *irs;
+
+ if (!(acc = memget(sizeof *acc))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(acc, 0x5e, sizeof *acc);
+ if (!(irs = memget(sizeof *irs))) {
+ errno = ENOMEM;
+ memput(acc, sizeof *acc);
+ return (NULL);
+ }
+ memset(irs, 0x5e, sizeof *irs);
+ irs->options = strdup(options);
+ irs->res = NULL;
+ irs->free_res = NULL;
+ memset(irs->accessors, 0, sizeof irs->accessors);
+ memset(irs->map_rules, 0, sizeof irs->map_rules);
+ init_map_rules(irs, conf_file);
+ acc->private = irs;
+#ifdef WANT_IRS_GR
+ acc->gr_map = irs_gen_gr;
+#else
+ acc->gr_map = NULL;
+#endif
+#ifdef WANT_IRS_PW
+ acc->pw_map = irs_gen_pw;
+#else
+ acc->pw_map = NULL;
+#endif
+ acc->sv_map = irs_gen_sv;
+ acc->pr_map = irs_gen_pr;
+ acc->ho_map = irs_gen_ho;
+ acc->nw_map = irs_gen_nw;
+ acc->ng_map = irs_gen_ng;
+ acc->res_get = gen_res_get;
+ acc->res_set = gen_res_set;
+ acc->close = gen_close;
+ return (acc);
+}
+
+/* Methods */
+
+static struct __res_state *
+gen_res_get(struct irs_acc *this) {
+ struct gen_p *irs = (struct gen_p *)this->private;
+
+ if (irs->res == NULL) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (res == NULL)
+ return (NULL);
+ memset(res, 0, sizeof *res);
+ gen_res_set(this, res, free);
+ }
+
+ if (((irs->res->options & RES_INIT) == 0U) && res_ninit(irs->res) < 0)
+ return (NULL);
+
+ return (irs->res);
+}
+
+static void
+gen_res_set(struct irs_acc *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct gen_p *irs = (struct gen_p *)this->private;
+#if 0
+ struct irs_rule *rule;
+ struct irs_ho *ho;
+ struct irs_nw *nw;
+#endif
+
+ if (irs->res && irs->free_res) {
+ res_nclose(irs->res);
+ (*irs->free_res)(irs->res);
+ }
+
+ irs->res = res;
+ irs->free_res = free_res;
+
+#if 0
+ for (rule = irs->map_rules[irs_ho]; rule; rule = rule->next) {
+ ho = rule->inst->ho;
+
+ (*ho->res_set)(ho, res, NULL);
+ }
+ for (rule = irs->map_rules[irs_nw]; rule; rule = rule->next) {
+ nw = rule->inst->nw;
+
+ (*nw->res_set)(nw, res, NULL);
+ }
+#endif
+}
+
+static void
+gen_close(struct irs_acc *this) {
+ struct gen_p *irs = (struct gen_p *)this->private;
+ int n;
+
+ /* Search rules. */
+ for (n = 0; n < irs_nmap; n++)
+ while (irs->map_rules[n] != NULL)
+ irs->map_rules[n] = release_rule(irs->map_rules[n]);
+
+ /* Access methods. */
+ for (n = 0; n < irs_nacc; n++) {
+ /* Map objects. */
+ if (irs->accessors[n].gr != NULL)
+ (*irs->accessors[n].gr->close)(irs->accessors[n].gr);
+ if (irs->accessors[n].pw != NULL)
+ (*irs->accessors[n].pw->close)(irs->accessors[n].pw);
+ if (irs->accessors[n].sv != NULL)
+ (*irs->accessors[n].sv->close)(irs->accessors[n].sv);
+ if (irs->accessors[n].pr != NULL)
+ (*irs->accessors[n].pr->close)(irs->accessors[n].pr);
+ if (irs->accessors[n].ho != NULL)
+ (*irs->accessors[n].ho->close)(irs->accessors[n].ho);
+ if (irs->accessors[n].nw != NULL)
+ (*irs->accessors[n].nw->close)(irs->accessors[n].nw);
+ if (irs->accessors[n].ng != NULL)
+ (*irs->accessors[n].ng->close)(irs->accessors[n].ng);
+ /* Enclosing accessor. */
+ if (irs->accessors[n].acc != NULL)
+ (*irs->accessors[n].acc->close)(irs->accessors[n].acc);
+ }
+
+ /* The options string was strdup'd. */
+ free((void*)irs->options);
+
+ if (irs->res && irs->free_res)
+ (*irs->free_res)(irs->res);
+
+ /* The private data container. */
+ memput(irs, sizeof *irs);
+
+ /* The object. */
+ memput(this, sizeof *this);
+}
+
+/* Private */
+
+static int
+find_name(const char *name, const struct nameval names[]) {
+ int n;
+
+ for (n = 0; names[n].name != NULL; n++)
+ if (strcmp(name, names[n].name) == 0)
+ return (names[n].val);
+ return (-1);
+}
+
+static struct irs_rule *
+release_rule(struct irs_rule *rule) {
+ struct irs_rule *next = rule->next;
+
+ memput(rule, sizeof *rule);
+ return (next);
+}
+
+static int
+add_rule(struct gen_p *irs,
+ enum irs_map_id map, enum irs_acc_id acc,
+ const char *options)
+{
+ struct irs_rule **rules, *last, *tmp, *new;
+ struct irs_inst *inst;
+ const char *cp;
+ int n;
+
+#ifndef WANT_IRS_GR
+ if (map == irs_gr)
+ return (-1);
+#endif
+#ifndef WANT_IRS_PW
+ if (map == irs_pw)
+ return (-1);
+#endif
+#ifndef WANT_IRS_NIS
+ if (acc == irs_nis)
+ return (-1);
+#endif
+ new = memget(sizeof *new);
+ if (new == NULL)
+ return (-1);
+ memset(new, 0x5e, sizeof *new);
+ new->next = NULL;
+
+ new->inst = &irs->accessors[acc];
+
+ new->flags = 0;
+ cp = options;
+ while (cp && *cp) {
+ char option[50], *next;
+
+ next = strchr(cp, ',');
+ if (next)
+ n = next++ - cp;
+ else
+ n = strlen(cp);
+ if ((size_t)n > sizeof option - 1)
+ n = sizeof option - 1;
+ strncpy(option, cp, n);
+ option[n] = '\0';
+
+ n = find_name(option, option_names);
+ if (n >= 0)
+ new->flags |= n;
+
+ cp = next;
+ }
+
+ rules = &irs->map_rules[map];
+ for (last = NULL, tmp = *rules;
+ tmp != NULL;
+ last = tmp, tmp = tmp->next)
+ (void)NULL;
+ if (last == NULL)
+ *rules = new;
+ else
+ last->next = new;
+
+ /* Try to instantiate map accessors for this if necessary & approp. */
+ inst = &irs->accessors[acc];
+ if (inst->acc == NULL && accs[acc] != NULL)
+ inst->acc = (*accs[acc])(irs->options);
+ if (inst->acc != NULL) {
+ if (inst->gr == NULL && inst->acc->gr_map != NULL)
+ inst->gr = (*inst->acc->gr_map)(inst->acc);
+ if (inst->pw == NULL && inst->acc->pw_map != NULL)
+ inst->pw = (*inst->acc->pw_map)(inst->acc);
+ if (inst->sv == NULL && inst->acc->sv_map != NULL)
+ inst->sv = (*inst->acc->sv_map)(inst->acc);
+ if (inst->pr == NULL && inst->acc->pr_map != NULL)
+ inst->pr = (*inst->acc->pr_map)(inst->acc);
+ if (inst->ho == NULL && inst->acc->ho_map != NULL)
+ inst->ho = (*inst->acc->ho_map)(inst->acc);
+ if (inst->nw == NULL && inst->acc->nw_map != NULL)
+ inst->nw = (*inst->acc->nw_map)(inst->acc);
+ if (inst->ng == NULL && inst->acc->ng_map != NULL)
+ inst->ng = (*inst->acc->ng_map)(inst->acc);
+ }
+
+ return (0);
+}
+
+static void
+default_map_rules(struct gen_p *irs) {
+ /* Install time honoured and proved BSD style rules as default. */
+ add_rule(irs, irs_gr, irs_lcl, "");
+ add_rule(irs, irs_pw, irs_lcl, "");
+ add_rule(irs, irs_sv, irs_lcl, "");
+ add_rule(irs, irs_pr, irs_lcl, "");
+#ifdef SUNW_HOSTS_FALLBACK
+ if (__res_no_hosts_fallback())
+ add_rule(irs, irs_ho, irs_dns, "");
+ else {
+ add_rule(irs, irs_ho, irs_dns, "continue");
+ add_rule(irs, irs_ho, irs_lcl, "");
+ }
+#else /* SUNW_HOSTS_FALLBACK */
+ add_rule(irs, irs_ho, irs_dns, "continue");
+ add_rule(irs, irs_ho, irs_lcl, "");
+#endif /* SUNW_HOSTS_FALLBACK */
+ add_rule(irs, irs_nw, irs_dns, "continue");
+ add_rule(irs, irs_nw, irs_lcl, "");
+ add_rule(irs, irs_ng, irs_lcl, "");
+}
+
+static void
+init_map_rules(struct gen_p *irs, const char *conf_file) {
+ char line[1024], pattern[40], mapname[20], accname[20], options[100];
+ FILE *conf;
+
+#ifdef SUNW_HOSTS_FALLBACK
+ if (__res_no_hosts_fallback()) {
+ default_map_rules(irs);
+ return;
+ }
+#endif /* SUNW_HOSTS_FALLBACK */
+
+ if (conf_file == NULL)
+ conf_file = _PATH_IRS_CONF ;
+
+ /* A conf file of "" means compiled in defaults. Irpd wants this */
+ if (conf_file[0] == '\0' || (conf = fopen(conf_file, "r")) == NULL) {
+ default_map_rules(irs);
+ return;
+ }
+ (void) sprintf(pattern, "%%%lus %%%lus %%%lus\n",
+ (unsigned long)sizeof mapname,
+ (unsigned long)sizeof accname,
+ (unsigned long)sizeof options);
+ while (fgets(line, sizeof line, conf)) {
+ enum irs_map_id map;
+ enum irs_acc_id acc;
+ char *tmp;
+ int n;
+
+ for (tmp = line;
+ isascii((unsigned char)*tmp) &&
+ isspace((unsigned char)*tmp);
+ tmp++)
+ (void)NULL;
+ if (*tmp == '#' || *tmp == '\n' || *tmp == '\0')
+ continue;
+ n = sscanf(tmp, pattern, mapname, accname, options);
+ if (n < 2)
+ continue;
+ if (n < 3)
+ options[0] = '\0';
+
+ n = find_name(mapname, map_names);
+ INSIST(n < irs_nmap);
+ if (n < 0)
+ continue;
+ map = (enum irs_map_id) n;
+
+ n = find_name(accname, acc_names);
+ INSIST(n < irs_nacc);
+ if (n < 0)
+ continue;
+ acc = (enum irs_acc_id) n;
+
+ add_rule(irs, map, acc, options);
+ }
+ fclose(conf);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen_ho.c b/usr/src/lib/libresolv2_joy/common/irs/gen_ho.c
new file mode 100644
index 0000000000..8e41d7d610
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen_ho.c
@@ -0,0 +1,391 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: gen_ho.c,v 1.5 2006/03/09 23:57:56 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "gen_p.h"
+
+/* Definitions */
+
+struct pvt {
+ struct irs_rule * rules;
+ struct irs_rule * rule;
+ struct irs_ho * ho;
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+/* Forwards */
+
+static void ho_close(struct irs_ho *this);
+static struct hostent * ho_byname(struct irs_ho *this, const char *name);
+static struct hostent * ho_byname2(struct irs_ho *this, const char *name,
+ int af);
+static struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
+ int len, int af);
+static struct hostent * ho_next(struct irs_ho *this);
+static void ho_rewind(struct irs_ho *this);
+static void ho_minimize(struct irs_ho *this);
+static struct __res_state * ho_res_get(struct irs_ho *this);
+static void ho_res_set(struct irs_ho *this,
+ struct __res_state *res,
+ void (*free_res)(void *));
+static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,
+ const struct addrinfo *pai);
+
+static int init(struct irs_ho *this);
+
+/* Exports */
+
+struct irs_ho *
+irs_gen_ho(struct irs_acc *this) {
+ struct gen_p *accpvt = (struct gen_p *)this->private;
+ struct irs_ho *ho;
+ struct pvt *pvt;
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ if (!(ho = memget(sizeof *ho))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ho, 0x5e, sizeof *ho);
+ pvt->rules = accpvt->map_rules[irs_ho];
+ pvt->rule = pvt->rules;
+ ho->private = pvt;
+ ho->close = ho_close;
+ ho->byname = ho_byname;
+ ho->byname2 = ho_byname2;
+ ho->byaddr = ho_byaddr;
+ ho->next = ho_next;
+ ho->rewind = ho_rewind;
+ ho->minimize = ho_minimize;
+ ho->res_get = ho_res_get;
+ ho->res_set = ho_res_set;
+ ho->addrinfo = ho_addrinfo;
+ return (ho);
+}
+
+/* Methods. */
+
+static void
+ho_close(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ ho_minimize(this);
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct hostent *
+ho_byname(struct irs_ho *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct hostent *rval;
+ struct irs_ho *ho;
+ int therrno = NETDB_INTERNAL;
+ int softerror = 0;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ ho = rule->inst->ho;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = 0;
+ rval = (*ho->byname)(ho, name);
+ if (rval != NULL)
+ return (rval);
+ if (softerror == 0 &&
+ pvt->res->res_h_errno != HOST_NOT_FOUND &&
+ pvt->res->res_h_errno != NETDB_INTERNAL) {
+ softerror = 1;
+ therrno = pvt->res->res_h_errno;
+ }
+ if (rule->flags & IRS_CONTINUE)
+ continue;
+ /*
+ * The value TRY_AGAIN can mean that the service
+ * is not available, or just that this particular name
+ * cannot be resolved now. We use the errno ECONNREFUSED
+ * to distinguish. If a lookup sets that errno when
+ * H_ERRNO is TRY_AGAIN, we continue to try other lookup
+ * functions, otherwise we return the TRY_AGAIN error.
+ */
+ if (pvt->res->res_h_errno != TRY_AGAIN || errno != ECONNREFUSED)
+ break;
+ }
+ if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)
+ RES_SET_H_ERRNO(pvt->res, therrno);
+ return (NULL);
+}
+
+static struct hostent *
+ho_byname2(struct irs_ho *this, const char *name, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct hostent *rval;
+ struct irs_ho *ho;
+ int therrno = NETDB_INTERNAL;
+ int softerror = 0;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ ho = rule->inst->ho;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = 0;
+ rval = (*ho->byname2)(ho, name, af);
+ if (rval != NULL)
+ return (rval);
+ if (softerror == 0 &&
+ pvt->res->res_h_errno != HOST_NOT_FOUND &&
+ pvt->res->res_h_errno != NETDB_INTERNAL) {
+ softerror = 1;
+ therrno = pvt->res->res_h_errno;
+ }
+ if (rule->flags & IRS_CONTINUE)
+ continue;
+ /*
+ * See the comments in ho_byname() explaining
+ * the interpretation of TRY_AGAIN and ECONNREFUSED.
+ */
+ if (pvt->res->res_h_errno != TRY_AGAIN || errno != ECONNREFUSED)
+ break;
+ }
+ if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)
+ RES_SET_H_ERRNO(pvt->res, therrno);
+ return (NULL);
+}
+
+static struct hostent *
+ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct hostent *rval;
+ struct irs_ho *ho;
+ int therrno = NETDB_INTERNAL;
+ int softerror = 0;
+
+
+ if (init(this) == -1)
+ return (NULL);
+
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ ho = rule->inst->ho;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = 0;
+ rval = (*ho->byaddr)(ho, addr, len, af);
+ if (rval != NULL)
+ return (rval);
+ if (softerror == 0 &&
+ pvt->res->res_h_errno != HOST_NOT_FOUND &&
+ pvt->res->res_h_errno != NETDB_INTERNAL) {
+ softerror = 1;
+ therrno = pvt->res->res_h_errno;
+ }
+
+ if (rule->flags & IRS_CONTINUE)
+ continue;
+ /*
+ * See the comments in ho_byname() explaining
+ * the interpretation of TRY_AGAIN and ECONNREFUSED.
+ */
+ if (pvt->res->res_h_errno != TRY_AGAIN || errno != ECONNREFUSED)
+ break;
+ }
+ if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)
+ RES_SET_H_ERRNO(pvt->res, therrno);
+ return (NULL);
+}
+
+static struct hostent *
+ho_next(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *rval;
+ struct irs_ho *ho;
+
+ while (pvt->rule) {
+ ho = pvt->rule->inst->ho;
+ rval = (*ho->next)(ho);
+ if (rval)
+ return (rval);
+ if (!(pvt->rule->flags & IRS_CONTINUE))
+ break;
+ pvt->rule = pvt->rule->next;
+ if (pvt->rule) {
+ ho = pvt->rule->inst->ho;
+ (*ho->rewind)(ho);
+ }
+ }
+ return (NULL);
+}
+
+static void
+ho_rewind(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_ho *ho;
+
+ pvt->rule = pvt->rules;
+ if (pvt->rule) {
+ ho = pvt->rule->inst->ho;
+ (*ho->rewind)(ho);
+ }
+}
+
+static void
+ho_minimize(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ if (pvt->res)
+ res_nclose(pvt->res);
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_ho *ho = rule->inst->ho;
+
+ (*ho->minimize)(ho);
+ }
+}
+
+static struct __res_state *
+ho_res_get(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ ho_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+ho_res_set(struct irs_ho *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_ho *ho = rule->inst->ho;
+
+ (*ho->res_set)(ho, pvt->res, NULL);
+ }
+}
+
+static struct addrinfo *
+ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct addrinfo *rval = NULL;
+ struct irs_ho *ho;
+ int therrno = NETDB_INTERNAL;
+ int softerror = 0;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ ho = rule->inst->ho;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ errno = 0;
+ if (ho->addrinfo == NULL) /*%< for safety */
+ continue;
+ rval = (*ho->addrinfo)(ho, name, pai);
+ if (rval != NULL)
+ return (rval);
+ if (softerror == 0 &&
+ pvt->res->res_h_errno != HOST_NOT_FOUND &&
+ pvt->res->res_h_errno != NETDB_INTERNAL) {
+ softerror = 1;
+ therrno = pvt->res->res_h_errno;
+ }
+ if (rule->flags & IRS_CONTINUE)
+ continue;
+ /*
+ * See the comments in ho_byname() explaining
+ * the interpretation of TRY_AGAIN and ECONNREFUSED.
+ */
+ if (pvt->res->res_h_errno != TRY_AGAIN ||
+ errno != ECONNREFUSED)
+ break;
+ }
+ if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)
+ RES_SET_H_ERRNO(pvt->res, therrno);
+ return (NULL);
+}
+
+static int
+init(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res && !ho_res_get(this))
+ return (-1);
+
+ if (((pvt->res->options & RES_INIT) == 0U) &&
+ (res_ninit(pvt->res) == -1))
+ return (-1);
+
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen_ng.c b/usr/src/lib/libresolv2_joy/common/irs/gen_ng.c
new file mode 100644
index 0000000000..e3c874ee68
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen_ng.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: gen_ng.c,v 1.3 2005/04/27 04:56:23 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "gen_p.h"
+
+/* Types */
+
+struct pvt {
+ struct irs_rule * rules;
+ struct irs_rule * rule;
+ char * curgroup;
+};
+
+/* Forward */
+
+static void ng_close(struct irs_ng *);
+static int ng_next(struct irs_ng *, const char **,
+ const char **, const char **);
+static int ng_test(struct irs_ng *, const char *,
+ const char *, const char *,
+ const char *);
+static void ng_rewind(struct irs_ng *, const char *);
+static void ng_minimize(struct irs_ng *);
+
+/* Public */
+
+struct irs_ng *
+irs_gen_ng(struct irs_acc *this) {
+ struct gen_p *accpvt = (struct gen_p *)this->private;
+ struct irs_ng *ng;
+ struct pvt *pvt;
+
+ if (!(ng = memget(sizeof *ng))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ng, 0x5e, sizeof *ng);
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(ng, sizeof *ng);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->rules = accpvt->map_rules[irs_ng];
+ pvt->rule = pvt->rules;
+ ng->private = pvt;
+ ng->close = ng_close;
+ ng->next = ng_next;
+ ng->test = ng_test;
+ ng->rewind = ng_rewind;
+ ng->minimize = ng_minimize;
+ return (ng);
+}
+
+/* Methods */
+
+static void
+ng_close(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ ng_minimize(this);
+ if (pvt->curgroup)
+ free(pvt->curgroup);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static int
+ng_next(struct irs_ng *this, const char **host, const char **user,
+ const char **domain)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_ng *ng;
+
+ while (pvt->rule) {
+ ng = pvt->rule->inst->ng;
+ if ((*ng->next)(ng, host, user, domain) == 1)
+ return (1);
+ if (!(pvt->rule->flags & IRS_CONTINUE))
+ break;
+ pvt->rule = pvt->rule->next;
+ if (pvt->rule) {
+ ng = pvt->rule->inst->ng;
+ (*ng->rewind)(ng, pvt->curgroup);
+ }
+ }
+ return (0);
+}
+
+static int
+ng_test(struct irs_ng *this, const char *name,
+ const char *user, const char *host, const char *domain)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct irs_ng *ng;
+ int rval;
+
+ rval = 0;
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ ng = rule->inst->ng;
+ rval = (*ng->test)(ng, name, user, host, domain);
+ if (rval || !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (rval);
+}
+
+static void
+ng_rewind(struct irs_ng *this, const char *group) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_ng *ng;
+
+ pvt->rule = pvt->rules;
+ if (pvt->rule) {
+ if (pvt->curgroup)
+ free(pvt->curgroup);
+ pvt->curgroup = strdup(group);
+ ng = pvt->rule->inst->ng;
+ (*ng->rewind)(ng, pvt->curgroup);
+ }
+}
+
+static void
+ng_minimize(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_ng *ng = rule->inst->ng;
+
+ (*ng->minimize)(ng);
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen_nw.c b/usr/src/lib/libresolv2_joy/common/irs/gen_nw.c
new file mode 100644
index 0000000000..12bd0e0f6d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen_nw.c
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: gen_nw.c,v 1.4 2005/04/27 04:56:23 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "gen_p.h"
+
+/* Types */
+
+struct pvt {
+ struct irs_rule * rules;
+ struct irs_rule * rule;
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+/* Forward */
+
+static void nw_close(struct irs_nw*);
+static struct nwent * nw_next(struct irs_nw *);
+static struct nwent * nw_byname(struct irs_nw *, const char *, int);
+static struct nwent * nw_byaddr(struct irs_nw *, void *, int, int);
+static void nw_rewind(struct irs_nw *);
+static void nw_minimize(struct irs_nw *);
+static struct __res_state * nw_res_get(struct irs_nw *this);
+static void nw_res_set(struct irs_nw *this,
+ struct __res_state *res,
+ void (*free_res)(void *));
+
+static int init(struct irs_nw *this);
+
+/* Public */
+
+struct irs_nw *
+irs_gen_nw(struct irs_acc *this) {
+ struct gen_p *accpvt = (struct gen_p *)this->private;
+ struct irs_nw *nw;
+ struct pvt *pvt;
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ if (!(nw = memget(sizeof *nw))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(nw, 0x5e, sizeof *nw);
+ pvt->rules = accpvt->map_rules[irs_nw];
+ pvt->rule = pvt->rules;
+ nw->private = pvt;
+ nw->close = nw_close;
+ nw->next = nw_next;
+ nw->byname = nw_byname;
+ nw->byaddr = nw_byaddr;
+ nw->rewind = nw_rewind;
+ nw->minimize = nw_minimize;
+ nw->res_get = nw_res_get;
+ nw->res_set = nw_res_set;
+ return (nw);
+}
+
+/* Methods */
+
+static void
+nw_close(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ nw_minimize(this);
+
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct nwent *
+nw_next(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct nwent *rval;
+ struct irs_nw *nw;
+
+ if (init(this) == -1)
+ return(NULL);
+
+ while (pvt->rule) {
+ nw = pvt->rule->inst->nw;
+ rval = (*nw->next)(nw);
+ if (rval)
+ return (rval);
+ if (!(pvt->rules->flags & IRS_CONTINUE))
+ break;
+ pvt->rule = pvt->rule->next;
+ if (pvt->rule) {
+ nw = pvt->rule->inst->nw;
+ (*nw->rewind)(nw);
+ }
+ }
+ return (NULL);
+}
+
+static struct nwent *
+nw_byname(struct irs_nw *this, const char *name, int type) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct nwent *rval;
+ struct irs_nw *nw;
+
+ if (init(this) == -1)
+ return(NULL);
+
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ nw = rule->inst->nw;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ rval = (*nw->byname)(nw, name, type);
+ if (rval != NULL)
+ return (rval);
+ if (pvt->res->res_h_errno != TRY_AGAIN &&
+ !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (NULL);
+}
+
+static struct nwent *
+nw_byaddr(struct irs_nw *this, void *net, int length, int type) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct nwent *rval;
+ struct irs_nw *nw;
+
+ if (init(this) == -1)
+ return(NULL);
+
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ nw = rule->inst->nw;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ rval = (*nw->byaddr)(nw, net, length, type);
+ if (rval != NULL)
+ return (rval);
+ if (pvt->res->res_h_errno != TRY_AGAIN &&
+ !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (NULL);
+}
+
+static void
+nw_rewind(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_nw *nw;
+
+ pvt->rule = pvt->rules;
+ if (pvt->rule) {
+ nw = pvt->rule->inst->nw;
+ (*nw->rewind)(nw);
+ }
+}
+
+static void
+nw_minimize(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ if (pvt->res)
+ res_nclose(pvt->res);
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_nw *nw = rule->inst->nw;
+
+ (*nw->minimize)(nw);
+ }
+}
+
+static struct __res_state *
+nw_res_get(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ nw_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+nw_res_set(struct irs_nw *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_nw *nw = rule->inst->nw;
+
+ (*nw->res_set)(nw, pvt->res, NULL);
+ }
+}
+
+static int
+init(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res && !nw_res_get(this))
+ return (-1);
+ if (((pvt->res->options & RES_INIT) == 0U) &&
+ res_ninit(pvt->res) == -1)
+ return (-1);
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen_p.h b/usr/src/lib/libresolv2_joy/common/irs/gen_p.h
new file mode 100644
index 0000000000..1adc5909bb
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen_p.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: gen_p.h,v 1.3 2005/04/27 04:56:23 sra Exp $
+ */
+
+/*! \file
+ * Notes:
+ * We hope to create a complete set of thread-safe entry points someday,
+ * which will mean a set of getXbyY() functions that take as an argument
+ * a pointer to the map class, which will have a pointer to the private
+ * data, which will be used preferentially to the static variables that
+ * are necessary to support the "classic" interface. This "classic"
+ * interface will then be reimplemented as stubs on top of the thread
+ * safe modules, and will keep the map class pointers as their only
+ * static data. HOWEVER, we are not there yet. So while we will call
+ * the just-barely-converted map class methods with map class pointers,
+ * right now they probably all still use statics. We're not fooling
+ * anybody, and we're not trying to (yet).
+ */
+
+#ifndef _GEN_P_H_INCLUDED
+#define _GEN_P_H_INCLUDED
+
+/*%
+ * These are the access methods.
+ */
+enum irs_acc_id {
+ irs_lcl, /*%< Local. */
+ irs_dns, /*%< DNS or Hesiod. */
+ irs_nis, /*%< Sun NIS ("YP"). */
+ irs_irp, /*%< IR protocol. */
+ irs_nacc
+};
+
+/*%
+ * These are the map types.
+ */
+enum irs_map_id {
+ irs_gr, /*%< "group" */
+ irs_pw, /*%< "passwd" */
+ irs_sv, /*%< "services" */
+ irs_pr, /*%< "protocols" */
+ irs_ho, /*%< "hosts" */
+ irs_nw, /*%< "networks" */
+ irs_ng, /*%< "netgroup" */
+ irs_nmap
+};
+
+/*%
+ * This is an accessor instance.
+ */
+struct irs_inst {
+ struct irs_acc *acc;
+ struct irs_gr * gr;
+ struct irs_pw * pw;
+ struct irs_sv * sv;
+ struct irs_pr * pr;
+ struct irs_ho * ho;
+ struct irs_nw * nw;
+ struct irs_ng * ng;
+};
+
+/*%
+ * This is a search rule for some map type.
+ */
+struct irs_rule {
+ struct irs_rule * next;
+ struct irs_inst * inst;
+ int flags;
+};
+#define IRS_MERGE 0x0001 /*%< Don't stop if acc. has data? */
+#define IRS_CONTINUE 0x0002 /*%< Don't stop if acc. has no data? */
+/*
+ * This is the private data for a search access class.
+ */
+struct gen_p {
+ char * options;
+ struct irs_rule * map_rules[(int)irs_nmap];
+ struct irs_inst accessors[(int)irs_nacc];
+ struct __res_state * res;
+ void (*free_res) __P((void *));
+};
+
+/*
+ * Externs.
+ */
+
+extern struct irs_acc * irs_gen_acc __P((const char *, const char *conf_file));
+extern struct irs_gr * irs_gen_gr __P((struct irs_acc *));
+extern struct irs_pw * irs_gen_pw __P((struct irs_acc *));
+extern struct irs_sv * irs_gen_sv __P((struct irs_acc *));
+extern struct irs_pr * irs_gen_pr __P((struct irs_acc *));
+extern struct irs_ho * irs_gen_ho __P((struct irs_acc *));
+extern struct irs_nw * irs_gen_nw __P((struct irs_acc *));
+extern struct irs_ng * irs_gen_ng __P((struct irs_acc *));
+
+#endif /*_IRS_P_H_INCLUDED*/
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen_pr.c b/usr/src/lib/libresolv2_joy/common/irs/gen_pr.c
new file mode 100644
index 0000000000..9fd32c4dd9
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen_pr.c
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: gen_pr.c,v 1.3 2005/04/27 04:56:24 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "gen_p.h"
+
+/* Types */
+
+struct pvt {
+ struct irs_rule * rules;
+ struct irs_rule * rule;
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+/* Forward */
+
+static void pr_close(struct irs_pr*);
+static struct protoent * pr_next(struct irs_pr *);
+static struct protoent * pr_byname(struct irs_pr *, const char *);
+static struct protoent * pr_bynumber(struct irs_pr *, int);
+static void pr_rewind(struct irs_pr *);
+static void pr_minimize(struct irs_pr *);
+static struct __res_state * pr_res_get(struct irs_pr *);
+static void pr_res_set(struct irs_pr *,
+ struct __res_state *,
+ void (*)(void *));
+
+/* Public */
+
+struct irs_pr *
+irs_gen_pr(struct irs_acc *this) {
+ struct gen_p *accpvt = (struct gen_p *)this->private;
+ struct irs_pr *pr;
+ struct pvt *pvt;
+
+ if (!(pr = memget(sizeof *pr))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pr, 0x5e, sizeof *pr);
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(pr, sizeof *pr);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->rules = accpvt->map_rules[irs_pr];
+ pvt->rule = pvt->rules;
+ pr->private = pvt;
+ pr->close = pr_close;
+ pr->next = pr_next;
+ pr->byname = pr_byname;
+ pr->bynumber = pr_bynumber;
+ pr->rewind = pr_rewind;
+ pr->minimize = pr_minimize;
+ pr->res_get = pr_res_get;
+ pr->res_set = pr_res_set;
+ return (pr);
+}
+
+/* Methods */
+
+static void
+pr_close(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct protoent *
+pr_next(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct protoent *rval;
+ struct irs_pr *pr;
+
+ while (pvt->rule) {
+ pr = pvt->rule->inst->pr;
+ rval = (*pr->next)(pr);
+ if (rval)
+ return (rval);
+ if (!(pvt->rules->flags & IRS_CONTINUE))
+ break;
+ pvt->rule = pvt->rule->next;
+ if (pvt->rule) {
+ pr = pvt->rule->inst->pr;
+ (*pr->rewind)(pr);
+ }
+ }
+ return (NULL);
+}
+
+static struct protoent *
+pr_byname(struct irs_pr *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct protoent *rval;
+ struct irs_pr *pr;
+
+ rval = NULL;
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ pr = rule->inst->pr;
+ rval = (*pr->byname)(pr, name);
+ if (rval || !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (rval);
+}
+
+static struct protoent *
+pr_bynumber(struct irs_pr *this, int proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct protoent *rval;
+ struct irs_pr *pr;
+
+ rval = NULL;
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ pr = rule->inst->pr;
+ rval = (*pr->bynumber)(pr, proto);
+ if (rval || !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (rval);
+}
+
+static void
+pr_rewind(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_pr *pr;
+
+ pvt->rule = pvt->rules;
+ if (pvt->rule) {
+ pr = pvt->rule->inst->pr;
+ (*pr->rewind)(pr);
+ }
+}
+
+static void
+pr_minimize(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_pr *pr = rule->inst->pr;
+
+ (*pr->minimize)(pr);
+ }
+}
+
+static struct __res_state *
+pr_res_get(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ pr_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+pr_res_set(struct irs_pr *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_pr *pr = rule->inst->pr;
+
+ if (pr->res_set)
+ (*pr->res_set)(pr, pvt->res, NULL);
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gen_sv.c b/usr/src/lib/libresolv2_joy/common/irs/gen_sv.c
new file mode 100644
index 0000000000..93b70e57ec
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gen_sv.c
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: gen_sv.c,v 1.3 2005/04/27 04:56:24 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "gen_p.h"
+
+/* Types */
+
+struct pvt {
+ struct irs_rule * rules;
+ struct irs_rule * rule;
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+/* Forward */
+
+static void sv_close(struct irs_sv*);
+static struct servent * sv_next(struct irs_sv *);
+static struct servent * sv_byname(struct irs_sv *, const char *,
+ const char *);
+static struct servent * sv_byport(struct irs_sv *, int, const char *);
+static void sv_rewind(struct irs_sv *);
+static void sv_minimize(struct irs_sv *);
+static struct __res_state * sv_res_get(struct irs_sv *);
+static void sv_res_set(struct irs_sv *,
+ struct __res_state *,
+ void (*)(void *));
+
+/* Public */
+
+struct irs_sv *
+irs_gen_sv(struct irs_acc *this) {
+ struct gen_p *accpvt = (struct gen_p *)this->private;
+ struct irs_sv *sv;
+ struct pvt *pvt;
+
+ if (!(sv = memget(sizeof *sv))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(sv, 0x5e, sizeof *sv);
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(sv, sizeof *sv);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->rules = accpvt->map_rules[irs_sv];
+ pvt->rule = pvt->rules;
+ sv->private = pvt;
+ sv->close = sv_close;
+ sv->next = sv_next;
+ sv->byname = sv_byname;
+ sv->byport = sv_byport;
+ sv->rewind = sv_rewind;
+ sv->minimize = sv_minimize;
+ sv->res_get = sv_res_get;
+ sv->res_set = sv_res_set;
+ return (sv);
+}
+
+/* Methods */
+
+static void
+sv_close(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct servent *
+sv_next(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct servent *rval;
+ struct irs_sv *sv;
+
+ while (pvt->rule) {
+ sv = pvt->rule->inst->sv;
+ rval = (*sv->next)(sv);
+ if (rval)
+ return (rval);
+ if (!(pvt->rule->flags & IRS_CONTINUE))
+ break;
+ pvt->rule = pvt->rule->next;
+ if (pvt->rule) {
+ sv = pvt->rule->inst->sv;
+ (*sv->rewind)(sv);
+ }
+ }
+ return (NULL);
+}
+
+static struct servent *
+sv_byname(struct irs_sv *this, const char *name, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct servent *rval;
+ struct irs_sv *sv;
+
+ rval = NULL;
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ sv = rule->inst->sv;
+ rval = (*sv->byname)(sv, name, proto);
+ if (rval || !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (rval);
+}
+
+static struct servent *
+sv_byport(struct irs_sv *this, int port, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+ struct servent *rval;
+ struct irs_sv *sv;
+
+ rval = NULL;
+ for (rule = pvt->rules; rule; rule = rule->next) {
+ sv = rule->inst->sv;
+ rval = (*sv->byport)(sv, port, proto);
+ if (rval || !(rule->flags & IRS_CONTINUE))
+ break;
+ }
+ return (rval);
+}
+
+static void
+sv_rewind(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_sv *sv;
+
+ pvt->rule = pvt->rules;
+ if (pvt->rule) {
+ sv = pvt->rule->inst->sv;
+ (*sv->rewind)(sv);
+ }
+}
+
+static void
+sv_minimize(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_sv *sv = rule->inst->sv;
+
+ (*sv->minimize)(sv);
+ }
+}
+
+static struct __res_state *
+sv_res_get(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ sv_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+sv_res_set(struct irs_sv *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct irs_rule *rule;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+
+ for (rule = pvt->rules; rule != NULL; rule = rule->next) {
+ struct irs_sv *sv = rule->inst->sv;
+
+ if (sv->res_set)
+ (*sv->res_set)(sv, pvt->res, NULL);
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getaddrinfo.c b/usr/src/lib/libresolv2_joy/common/irs/getaddrinfo.c
new file mode 100644
index 0000000000..19bbbea854
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getaddrinfo.c
@@ -0,0 +1,1253 @@
+/* $KAME: getaddrinfo.c,v 1.14 2001/01/06 09:41:15 jinmei Exp $ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*! \file
+ * Issues to be discussed:
+ *\li Thread safe-ness must be checked.
+ *\li Return values. There are nonstandard return values defined and used
+ * in the source code. This is because RFC2553 is silent about which error
+ * code must be returned for which situation.
+ *\li IPv4 classful (shortened) form. RFC2553 is silent about it. XNET 5.2
+ * says to use inet_aton() to convert IPv4 numeric to binary (allows
+ * classful form as a result).
+ * current code - disallow classful form for IPv4 (due to use of inet_pton).
+ *\li freeaddrinfo(NULL). RFC2553 is silent about it. XNET 5.2 says it is
+ * invalid.
+ * current code - SEGV on freeaddrinfo(NULL)
+ * Note:
+ *\li We use getipnodebyname() just for thread-safeness. There's no intent
+ * to let it do PF_UNSPEC (actually we never pass PF_UNSPEC to
+ * getipnodebyname().
+ *\li The code filters out AFs that are not supported by the kernel,
+ * when globbing NULL hostname (to loopback, or wildcard). Is it the right
+ * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG
+ * in ai_flags?
+ *\li (post-2553) semantics of AI_ADDRCONFIG itself is too vague.
+ * (1) what should we do against numeric hostname (2) what should we do
+ * against NULL hostname (3) what is AI_ADDRCONFIG itself. AF not ready?
+ * non-loopback address configured? global address configured?
+ * \par Additional Issue:
+ * To avoid search order issue, we have a big amount of code duplicate
+ * from gethnamaddr.c and some other places. The issues that there's no
+ * lower layer function to lookup "IPv4 or IPv6" record. Calling
+ * gethostbyname2 from getaddrinfo will end up in wrong search order, as
+ * follows:
+ * \li The code makes use of following calls when asked to resolver with
+ * ai_family = PF_UNSPEC:
+ *\code getipnodebyname(host, AF_INET6);
+ * getipnodebyname(host, AF_INET);
+ *\endcode
+ * \li This will result in the following queries if the node is configure to
+ * prefer /etc/hosts than DNS:
+ *\code
+ * lookup /etc/hosts for IPv6 address
+ * lookup DNS for IPv6 address
+ * lookup /etc/hosts for IPv4 address
+ * lookup DNS for IPv4 address
+ *\endcode
+ * which may not meet people's requirement.
+ * \li The right thing to happen is to have underlying layer which does
+ * PF_UNSPEC lookup (lookup both) and return chain of addrinfos.
+ * This would result in a bit of code duplicate with _dns_ghbyname() and
+ * friends.
+ */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <netinet/in.h>
+
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <stdarg.h>
+
+#include <irs.h>
+#include <isc/assertions.h>
+
+#include "port_after.h"
+
+#include "irs_data.h"
+
+#define SUCCESS 0
+#define ANY 0
+#define YES 1
+#define NO 0
+
+static const char in_addrany[] = { 0, 0, 0, 0 };
+static const char in6_addrany[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+static const char in_loopback[] = { 127, 0, 0, 1 };
+static const char in6_loopback[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
+};
+
+static const struct afd {
+ int a_af;
+ int a_addrlen;
+ int a_socklen;
+ int a_off;
+ const char *a_addrany;
+ const char *a_loopback;
+ int a_scoped;
+} afdl [] = {
+ {PF_INET6, sizeof(struct in6_addr),
+ sizeof(struct sockaddr_in6),
+ offsetof(struct sockaddr_in6, sin6_addr),
+ in6_addrany, in6_loopback, 1},
+ {PF_INET, sizeof(struct in_addr),
+ sizeof(struct sockaddr_in),
+ offsetof(struct sockaddr_in, sin_addr),
+ in_addrany, in_loopback, 0},
+ {0, 0, 0, 0, NULL, NULL, 0},
+};
+
+struct explore {
+ int e_af;
+ int e_socktype;
+ int e_protocol;
+ const char *e_protostr;
+ int e_wild;
+#define WILD_AF(ex) ((ex)->e_wild & 0x01)
+#define WILD_SOCKTYPE(ex) ((ex)->e_wild & 0x02)
+#define WILD_PROTOCOL(ex) ((ex)->e_wild & 0x04)
+};
+
+static const struct explore explore[] = {
+#if 0
+ { PF_LOCAL, 0, ANY, ANY, NULL, 0x01 },
+#endif
+ { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
+ { PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+ { PF_INET6, SOCK_RAW, ANY, NULL, 0x05 },
+ { PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
+ { PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+ { PF_INET, SOCK_RAW, ANY, NULL, 0x05 },
+ { -1, 0, 0, NULL, 0 },
+};
+
+#define PTON_MAX 16
+
+static int str_isnumber __P((const char *));
+static int explore_fqdn __P((const struct addrinfo *, const char *,
+ const char *, struct addrinfo **));
+static int explore_copy __P((const struct addrinfo *, const struct addrinfo *,
+ struct addrinfo **));
+static int explore_null __P((const struct addrinfo *,
+ const char *, struct addrinfo **));
+static int explore_numeric __P((const struct addrinfo *, const char *,
+ const char *, struct addrinfo **));
+static int explore_numeric_scope __P((const struct addrinfo *, const char *,
+ const char *, struct addrinfo **));
+static int get_canonname __P((const struct addrinfo *,
+ struct addrinfo *, const char *));
+static struct addrinfo *get_ai __P((const struct addrinfo *,
+ const struct afd *, const char *));
+static struct addrinfo *copy_ai __P((const struct addrinfo *));
+static int get_portmatch __P((const struct addrinfo *, const char *));
+static int get_port __P((const struct addrinfo *, const char *, int));
+static const struct afd *find_afd __P((int));
+static int addrconfig __P((int));
+static int ip6_str2scopeid __P((char *, struct sockaddr_in6 *,
+ u_int32_t *scopeidp));
+static struct net_data *init __P((void));
+
+struct addrinfo *hostent2addrinfo __P((struct hostent *,
+ const struct addrinfo *));
+struct addrinfo *addr2addrinfo __P((const struct addrinfo *,
+ const char *));
+
+#if 0
+static const char *ai_errlist[] = {
+ "Success",
+ "Address family for hostname not supported", /*%< EAI_ADDRFAMILY */
+ "Temporary failure in name resolution", /*%< EAI_AGAIN */
+ "Invalid value for ai_flags", /*%< EAI_BADFLAGS */
+ "Non-recoverable failure in name resolution", /*%< EAI_FAIL */
+ "ai_family not supported", /*%< EAI_FAMILY */
+ "Memory allocation failure", /*%< EAI_MEMORY */
+ "No address associated with hostname", /*%< EAI_NODATA */
+ "hostname nor servname provided, or not known", /*%< EAI_NONAME */
+ "servname not supported for ai_socktype", /*%< EAI_SERVICE */
+ "ai_socktype not supported", /*%< EAI_SOCKTYPE */
+ "System error returned in errno", /*%< EAI_SYSTEM */
+ "Invalid value for hints", /*%< EAI_BADHINTS */
+ "Resolved protocol is unknown", /*%< EAI_PROTOCOL */
+ "Unknown error", /*%< EAI_MAX */
+};
+#endif
+
+/* XXX macros that make external reference is BAD. */
+
+#define GET_AI(ai, afd, addr) \
+do { \
+ /* external reference: pai, error, and label free */ \
+ (ai) = get_ai(pai, (afd), (addr)); \
+ if ((ai) == NULL) { \
+ error = EAI_MEMORY; \
+ goto free; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define GET_PORT(ai, serv) \
+do { \
+ /* external reference: error and label free */ \
+ error = get_port((ai), (serv), 0); \
+ if (error != 0) \
+ goto free; \
+} while (/*CONSTCOND*/0)
+
+#define GET_CANONNAME(ai, str) \
+do { \
+ /* external reference: pai, error and label free */ \
+ error = get_canonname(pai, (ai), (str)); \
+ if (error != 0) \
+ goto free; \
+} while (/*CONSTCOND*/0)
+
+#ifndef SOLARIS2
+#define SETERROR(err) \
+do { \
+ /* external reference: error, and label bad */ \
+ error = (err); \
+ goto bad; \
+ /*NOTREACHED*/ \
+} while (/*CONSTCOND*/0)
+#else
+#define SETERROR(err) \
+do { \
+ /* external reference: error, and label bad */ \
+ error = (err); \
+ if (error == error) \
+ goto bad; \
+} while (/*CONSTCOND*/0)
+#endif
+
+
+#define MATCH_FAMILY(x, y, w) \
+ ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == PF_UNSPEC || (y) == PF_UNSPEC)))
+#define MATCH(x, y, w) \
+ ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY)))
+
+#if 0 /*%< bind8 has its own version */
+char *
+gai_strerror(ecode)
+ int ecode;
+{
+ if (ecode < 0 || ecode > EAI_MAX)
+ ecode = EAI_MAX;
+ return ai_errlist[ecode];
+}
+#endif
+
+void
+freeaddrinfo(ai)
+ struct addrinfo *ai;
+{
+ struct addrinfo *next;
+
+ do {
+ next = ai->ai_next;
+ if (ai->ai_canonname)
+ free(ai->ai_canonname);
+ /* no need to free(ai->ai_addr) */
+ free(ai);
+ ai = next;
+ } while (ai);
+}
+
+static int
+str_isnumber(p)
+ const char *p;
+{
+ char *ep;
+
+ if (*p == '\0')
+ return NO;
+ ep = NULL;
+ errno = 0;
+ (void)strtoul(p, &ep, 10);
+ if (errno == 0 && ep && *ep == '\0')
+ return YES;
+ else
+ return NO;
+}
+
+int
+getaddrinfo(hostname, servname, hints, res)
+ const char *hostname, *servname;
+ const struct addrinfo *hints;
+ struct addrinfo **res;
+{
+ struct addrinfo sentinel;
+ struct addrinfo *cur;
+ int error = 0;
+ struct addrinfo ai, ai0, *afai = NULL;
+ struct addrinfo *pai;
+ const struct explore *ex;
+
+ memset(&sentinel, 0, sizeof(sentinel));
+ cur = &sentinel;
+ pai = &ai;
+ pai->ai_flags = 0;
+ pai->ai_family = PF_UNSPEC;
+ pai->ai_socktype = ANY;
+ pai->ai_protocol = ANY;
+#if defined(sun) && defined(_SOCKLEN_T) && defined(__sparcv9)
+ /*
+ * clear _ai_pad to preserve binary
+ * compatibility with previously compiled 64-bit
+ * applications in a pre-SUSv3 environment by
+ * guaranteeing the upper 32-bits are empty.
+ */
+ pai->_ai_pad = 0;
+#endif
+ pai->ai_addrlen = 0;
+ pai->ai_canonname = NULL;
+ pai->ai_addr = NULL;
+ pai->ai_next = NULL;
+
+ if (hostname == NULL && servname == NULL)
+ return EAI_NONAME;
+ if (hints) {
+ /* error check for hints */
+ if (hints->ai_addrlen || hints->ai_canonname ||
+ hints->ai_addr || hints->ai_next)
+ SETERROR(EAI_BADHINTS); /*%< xxx */
+ if (hints->ai_flags & ~AI_MASK)
+ SETERROR(EAI_BADFLAGS);
+ switch (hints->ai_family) {
+ case PF_UNSPEC:
+ case PF_INET:
+ case PF_INET6:
+ break;
+ default:
+ SETERROR(EAI_FAMILY);
+ }
+ memcpy(pai, hints, sizeof(*pai));
+
+#if defined(sun) && defined(_SOCKLEN_T) && defined(__sparcv9)
+ /*
+ * We need to clear _ai_pad to preserve binary
+ * compatibility. See prior comment.
+ */
+ pai->_ai_pad = 0;
+#endif
+ /*
+ * if both socktype/protocol are specified, check if they
+ * are meaningful combination.
+ */
+ if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) {
+ for (ex = explore; ex->e_af >= 0; ex++) {
+ if (pai->ai_family != ex->e_af)
+ continue;
+ if (ex->e_socktype == ANY)
+ continue;
+ if (ex->e_protocol == ANY)
+ continue;
+ if (pai->ai_socktype == ex->e_socktype &&
+ pai->ai_protocol != ex->e_protocol) {
+ SETERROR(EAI_BADHINTS);
+ }
+ }
+ }
+ }
+
+ /*
+ * post-2553: AI_ALL and AI_V4MAPPED are effective only against
+ * AF_INET6 query. They needs to be ignored if specified in other
+ * occassions.
+ */
+ switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) {
+ case AI_V4MAPPED:
+ case AI_ALL | AI_V4MAPPED:
+ if (pai->ai_family != AF_INET6)
+ pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED);
+ break;
+ case AI_ALL:
+#if 1
+ /* illegal */
+ SETERROR(EAI_BADFLAGS);
+#else
+ pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED);
+ break;
+#endif
+ }
+
+ /*
+ * check for special cases. (1) numeric servname is disallowed if
+ * socktype/protocol are left unspecified. (2) servname is disallowed
+ * for raw and other inet{,6} sockets.
+ */
+ if (MATCH_FAMILY(pai->ai_family, PF_INET, 1)
+#ifdef PF_INET6
+ || MATCH_FAMILY(pai->ai_family, PF_INET6, 1)
+#endif
+ ) {
+ ai0 = *pai; /* backup *pai */
+
+ if (pai->ai_family == PF_UNSPEC) {
+#ifdef PF_INET6
+ pai->ai_family = PF_INET6;
+#else
+ pai->ai_family = PF_INET;
+#endif
+ }
+ error = get_portmatch(pai, servname);
+ if (error)
+ SETERROR(error);
+
+ *pai = ai0;
+ }
+
+ ai0 = *pai;
+
+ /* NULL hostname, or numeric hostname */
+ for (ex = explore; ex->e_af >= 0; ex++) {
+ *pai = ai0;
+
+ if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
+ continue;
+ if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
+ continue;
+ if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex)))
+ continue;
+
+ if (pai->ai_family == PF_UNSPEC)
+ pai->ai_family = ex->e_af;
+ if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
+ pai->ai_socktype = ex->e_socktype;
+ if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
+ pai->ai_protocol = ex->e_protocol;
+
+ /*
+ * if the servname does not match socktype/protocol, ignore it.
+ */
+ if (get_portmatch(pai, servname) != 0)
+ continue;
+
+ if (hostname == NULL) {
+ /*
+ * filter out AFs that are not supported by the kernel
+ * XXX errno?
+ */
+ if (!addrconfig(pai->ai_family))
+ continue;
+ error = explore_null(pai, servname, &cur->ai_next);
+ } else
+ error = explore_numeric_scope(pai, hostname, servname,
+ &cur->ai_next);
+
+ if (error)
+ goto free;
+
+ while (cur && cur->ai_next)
+ cur = cur->ai_next;
+ }
+
+ /*
+ * XXX
+ * If numreic representation of AF1 can be interpreted as FQDN
+ * representation of AF2, we need to think again about the code below.
+ */
+ if (sentinel.ai_next)
+ goto good;
+
+ if (pai->ai_flags & AI_NUMERICHOST)
+ SETERROR(EAI_NONAME);
+ if (hostname == NULL)
+ SETERROR(EAI_NONAME);
+
+ /*
+ * hostname as alphabetical name.
+ * We'll make sure that
+ * - if returning addrinfo list is empty, return non-zero error
+ * value (already known one or EAI_NONAME).
+ * - otherwise,
+ * + if we haven't had any errors, return 0 (i.e. success).
+ * + if we've had an error, free the list and return the error.
+ * without any assumption on the behavior of explore_fqdn().
+ */
+
+ /* first, try to query DNS for all possible address families. */
+ *pai = ai0;
+ error = explore_fqdn(pai, hostname, servname, &afai);
+ if (error) {
+ if (afai != NULL)
+ freeaddrinfo(afai);
+ goto free;
+ }
+ if (afai == NULL) {
+ error = EAI_NONAME; /*%< we've had no errors. */
+ goto free;
+ }
+
+ /*
+ * we would like to prefer AF_INET6 than AF_INET, so we'll make an
+ * outer loop by AFs.
+ */
+ for (ex = explore; ex->e_af >= 0; ex++) {
+ *pai = ai0;
+
+ if (pai->ai_family == PF_UNSPEC)
+ pai->ai_family = ex->e_af;
+
+ if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
+ continue;
+ if (!MATCH(pai->ai_socktype, ex->e_socktype,
+ WILD_SOCKTYPE(ex))) {
+ continue;
+ }
+ if (!MATCH(pai->ai_protocol, ex->e_protocol,
+ WILD_PROTOCOL(ex))) {
+ continue;
+ }
+
+#ifdef AI_ADDRCONFIG
+ /*
+ * If AI_ADDRCONFIG is specified, check if we are
+ * expected to return the address family or not.
+ */
+ if ((pai->ai_flags & AI_ADDRCONFIG) != 0 &&
+ !addrconfig(pai->ai_family))
+ continue;
+#endif
+
+ if (pai->ai_family == PF_UNSPEC)
+ pai->ai_family = ex->e_af;
+ if (pai->ai_socktype == ANY && ex->e_socktype != ANY)
+ pai->ai_socktype = ex->e_socktype;
+ if (pai->ai_protocol == ANY && ex->e_protocol != ANY)
+ pai->ai_protocol = ex->e_protocol;
+
+ /*
+ * if the servname does not match socktype/protocol, ignore it.
+ */
+ if (get_portmatch(pai, servname) != 0)
+ continue;
+
+ if ((error = explore_copy(pai, afai, &cur->ai_next)) != 0) {
+ freeaddrinfo(afai);
+ goto free;
+ }
+
+ while (cur && cur->ai_next)
+ cur = cur->ai_next;
+ }
+
+ freeaddrinfo(afai); /*%< afai must not be NULL at this point. */
+
+ if (sentinel.ai_next) {
+good:
+ *res = sentinel.ai_next;
+ return(SUCCESS);
+ } else {
+ /*
+ * All the process succeeded, but we've had an empty list.
+ * This can happen if the given hints do not match our
+ * candidates.
+ */
+ error = EAI_NONAME;
+ }
+
+free:
+bad:
+ if (sentinel.ai_next)
+ freeaddrinfo(sentinel.ai_next);
+ *res = NULL;
+ return(error);
+}
+
+/*%
+ * FQDN hostname, DNS lookup
+ */
+static int
+explore_fqdn(pai, hostname, servname, res)
+ const struct addrinfo *pai;
+ const char *hostname;
+ const char *servname;
+ struct addrinfo **res;
+{
+ struct addrinfo *result;
+ struct addrinfo *cur;
+ struct net_data *net_data = init();
+ struct irs_ho *ho;
+ int error = 0;
+ char tmp[NS_MAXDNAME];
+ const char *cp;
+
+ INSIST(res != NULL && *res == NULL);
+
+ /*
+ * if the servname does not match socktype/protocol, ignore it.
+ */
+ if (get_portmatch(pai, servname) != 0)
+ return(0);
+
+ if (!net_data || !(ho = net_data->ho))
+ return(0);
+#if 0 /*%< XXX (notyet) */
+ if (net_data->ho_stayopen && net_data->ho_last &&
+ net_data->ho_last->h_addrtype == af) {
+ if (ns_samename(name, net_data->ho_last->h_name) == 1)
+ return (net_data->ho_last);
+ for (hap = net_data->ho_last->h_aliases; hap && *hap; hap++)
+ if (ns_samename(name, *hap) == 1)
+ return (net_data->ho_last);
+ }
+#endif
+ if (!strchr(hostname, '.') &&
+ (cp = res_hostalias(net_data->res, hostname,
+ tmp, sizeof(tmp))))
+ hostname = cp;
+ result = (*ho->addrinfo)(ho, hostname, pai);
+ if (!net_data->ho_stayopen) {
+ (*ho->minimize)(ho);
+ }
+ if (result == NULL) {
+ int e = h_errno;
+
+ switch(e) {
+ case NETDB_INTERNAL:
+ error = EAI_SYSTEM;
+ break;
+ case TRY_AGAIN:
+ error = EAI_AGAIN;
+ break;
+ case NO_RECOVERY:
+ error = EAI_FAIL;
+ break;
+ case HOST_NOT_FOUND:
+ case NO_DATA:
+ error = EAI_NONAME;
+ break;
+ default:
+ case NETDB_SUCCESS: /*%< should be impossible... */
+ error = EAI_NONAME;
+ break;
+ }
+ goto free;
+ }
+
+ for (cur = result; cur; cur = cur->ai_next) {
+ GET_PORT(cur, servname); /*%< XXX: redundant lookups... */
+ /* canonname should already be filled. */
+ }
+
+ *res = result;
+
+ return(0);
+
+free:
+ if (result)
+ freeaddrinfo(result);
+ return error;
+}
+
+static int
+explore_copy(pai, src0, res)
+ const struct addrinfo *pai; /*%< seed */
+ const struct addrinfo *src0; /*%< source */
+ struct addrinfo **res;
+{
+ int error;
+ struct addrinfo sentinel, *cur;
+ const struct addrinfo *src;
+
+ error = 0;
+ sentinel.ai_next = NULL;
+ cur = &sentinel;
+
+ for (src = src0; src != NULL; src = src->ai_next) {
+ if (src->ai_family != pai->ai_family)
+ continue;
+
+ cur->ai_next = copy_ai(src);
+ if (!cur->ai_next) {
+ error = EAI_MEMORY;
+ goto fail;
+ }
+
+ cur->ai_next->ai_socktype = pai->ai_socktype;
+ cur->ai_next->ai_protocol = pai->ai_protocol;
+ cur = cur->ai_next;
+ }
+
+ *res = sentinel.ai_next;
+ return 0;
+
+fail:
+ freeaddrinfo(sentinel.ai_next);
+ return error;
+}
+
+/*%
+ * hostname == NULL.
+ * passive socket -> anyaddr (0.0.0.0 or ::)
+ * non-passive socket -> localhost (127.0.0.1 or ::1)
+ */
+static int
+explore_null(pai, servname, res)
+ const struct addrinfo *pai;
+ const char *servname;
+ struct addrinfo **res;
+{
+ const struct afd *afd;
+ struct addrinfo *cur;
+ struct addrinfo sentinel;
+ int error;
+
+ *res = NULL;
+ sentinel.ai_next = NULL;
+ cur = &sentinel;
+
+ afd = find_afd(pai->ai_family);
+ if (afd == NULL)
+ return 0;
+
+ if (pai->ai_flags & AI_PASSIVE) {
+ GET_AI(cur->ai_next, afd, afd->a_addrany);
+ /* xxx meaningless?
+ * GET_CANONNAME(cur->ai_next, "anyaddr");
+ */
+ GET_PORT(cur->ai_next, servname);
+ } else {
+ GET_AI(cur->ai_next, afd, afd->a_loopback);
+ /* xxx meaningless?
+ * GET_CANONNAME(cur->ai_next, "localhost");
+ */
+ GET_PORT(cur->ai_next, servname);
+ }
+ cur = cur->ai_next;
+
+ *res = sentinel.ai_next;
+ return 0;
+
+free:
+ if (sentinel.ai_next)
+ freeaddrinfo(sentinel.ai_next);
+ return error;
+}
+
+/*%
+ * numeric hostname
+ */
+static int
+explore_numeric(pai, hostname, servname, res)
+ const struct addrinfo *pai;
+ const char *hostname;
+ const char *servname;
+ struct addrinfo **res;
+{
+ const struct afd *afd;
+ struct addrinfo *cur;
+ struct addrinfo sentinel;
+ int error;
+ char pton[PTON_MAX];
+
+ *res = NULL;
+ sentinel.ai_next = NULL;
+ cur = &sentinel;
+
+ afd = find_afd(pai->ai_family);
+ if (afd == NULL)
+ return 0;
+
+ switch (afd->a_af) {
+#if 0 /*X/Open spec*/
+ case AF_INET:
+ if (inet_aton(hostname, (struct in_addr *)pton) == 1) {
+ if (pai->ai_family == afd->a_af ||
+ pai->ai_family == PF_UNSPEC /*?*/) {
+ GET_AI(cur->ai_next, afd, pton);
+ GET_PORT(cur->ai_next, servname);
+ while (cur->ai_next)
+ cur = cur->ai_next;
+ } else
+ SETERROR(EAI_FAMILY); /*xxx*/
+ }
+ break;
+#endif
+ default:
+ if (inet_pton(afd->a_af, hostname, pton) == 1) {
+ if (pai->ai_family == afd->a_af ||
+ pai->ai_family == PF_UNSPEC /*?*/) {
+ GET_AI(cur->ai_next, afd, pton);
+ GET_PORT(cur->ai_next, servname);
+ while (cur->ai_next)
+ cur = cur->ai_next;
+ } else
+ SETERROR(EAI_FAMILY); /*xxx*/
+ }
+ break;
+ }
+
+ *res = sentinel.ai_next;
+ return 0;
+
+free:
+bad:
+ if (sentinel.ai_next)
+ freeaddrinfo(sentinel.ai_next);
+ return error;
+}
+
+/*%
+ * numeric hostname with scope
+ */
+static int
+explore_numeric_scope(pai, hostname, servname, res)
+ const struct addrinfo *pai;
+ const char *hostname;
+ const char *servname;
+ struct addrinfo **res;
+{
+#ifndef SCOPE_DELIMITER
+ return explore_numeric(pai, hostname, servname, res);
+#else
+ const struct afd *afd;
+ struct addrinfo *cur;
+ int error;
+ char *cp, *hostname2 = NULL, *scope, *addr;
+ struct sockaddr_in6 *sin6;
+
+ afd = find_afd(pai->ai_family);
+ if (afd == NULL)
+ return 0;
+
+ if (!afd->a_scoped)
+ return explore_numeric(pai, hostname, servname, res);
+
+ cp = strchr(hostname, SCOPE_DELIMITER);
+ if (cp == NULL)
+ return explore_numeric(pai, hostname, servname, res);
+
+ /*
+ * Handle special case of <scoped_address><delimiter><scope id>
+ */
+ hostname2 = strdup(hostname);
+ if (hostname2 == NULL)
+ return EAI_MEMORY;
+ /* terminate at the delimiter */
+ hostname2[cp - hostname] = '\0';
+ addr = hostname2;
+ scope = cp + 1;
+
+ error = explore_numeric(pai, addr, servname, res);
+ if (error == 0) {
+ u_int32_t scopeid = 0;
+
+ for (cur = *res; cur; cur = cur->ai_next) {
+ if (cur->ai_family != AF_INET6)
+ continue;
+ sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr;
+ if (!ip6_str2scopeid(scope, sin6, &scopeid)) {
+ free(hostname2);
+ return(EAI_NONAME); /*%< XXX: is return OK? */
+ }
+#ifdef HAVE_SIN6_SCOPE_ID
+ sin6->sin6_scope_id = scopeid;
+#endif
+ }
+ }
+
+ free(hostname2);
+
+ return error;
+#endif
+}
+
+static int
+get_canonname(pai, ai, str)
+ const struct addrinfo *pai;
+ struct addrinfo *ai;
+ const char *str;
+{
+ if ((pai->ai_flags & AI_CANONNAME) != 0) {
+ ai->ai_canonname = (char *)malloc(strlen(str) + 1);
+ if (ai->ai_canonname == NULL)
+ return EAI_MEMORY;
+ strcpy(ai->ai_canonname, str);
+ }
+ return 0;
+}
+
+static struct addrinfo *
+get_ai(pai, afd, addr)
+ const struct addrinfo *pai;
+ const struct afd *afd;
+ const char *addr;
+{
+ char *p;
+ struct addrinfo *ai;
+
+ ai = (struct addrinfo *)malloc(sizeof(struct addrinfo)
+ + (afd->a_socklen));
+ if (ai == NULL)
+ return NULL;
+
+ memcpy(ai, pai, sizeof(struct addrinfo));
+ ai->ai_addr = (struct sockaddr *)(void *)(ai + 1);
+ memset(ai->ai_addr, 0, (size_t)afd->a_socklen);
+#ifdef HAVE_SA_LEN
+ ai->ai_addr->sa_len = afd->a_socklen;
+#endif
+ ai->ai_addrlen = afd->a_socklen;
+ ai->ai_addr->sa_family = ai->ai_family = afd->a_af;
+ p = (char *)(void *)(ai->ai_addr);
+ memcpy(p + afd->a_off, addr, (size_t)afd->a_addrlen);
+ return ai;
+}
+
+/* XXX need to malloc() the same way we do from other functions! */
+static struct addrinfo *
+copy_ai(pai)
+ const struct addrinfo *pai;
+{
+ struct addrinfo *ai;
+ size_t l;
+
+ l = sizeof(*ai) + pai->ai_addrlen;
+ if ((ai = (struct addrinfo *)malloc(l)) == NULL)
+ return NULL;
+ memset(ai, 0, l);
+ memcpy(ai, pai, sizeof(*ai));
+ ai->ai_addr = (struct sockaddr *)(void *)(ai + 1);
+ memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen);
+
+ if (pai->ai_canonname) {
+ l = strlen(pai->ai_canonname) + 1;
+ if ((ai->ai_canonname = malloc(l)) == NULL) {
+ free(ai);
+ return NULL;
+ }
+ strcpy(ai->ai_canonname, pai->ai_canonname); /* (checked) */
+ } else {
+ /* just to make sure */
+ ai->ai_canonname = NULL;
+ }
+
+ ai->ai_next = NULL;
+
+ return ai;
+}
+
+static int
+get_portmatch(const struct addrinfo *ai, const char *servname) {
+
+ /* get_port does not touch first argument. when matchonly == 1. */
+ /* LINTED const cast */
+ return get_port((const struct addrinfo *)ai, servname, 1);
+}
+
+static int
+get_port(const struct addrinfo *ai, const char *servname, int matchonly) {
+ const char *proto;
+ struct servent *sp;
+ int port;
+ int allownumeric;
+
+ if (servname == NULL)
+ return 0;
+ switch (ai->ai_family) {
+ case AF_INET:
+#ifdef AF_INET6
+ case AF_INET6:
+#endif
+ break;
+ default:
+ return 0;
+ }
+
+ switch (ai->ai_socktype) {
+ case SOCK_RAW:
+ return EAI_SERVICE;
+ case SOCK_DGRAM:
+ case SOCK_STREAM:
+ allownumeric = 1;
+ break;
+ case ANY:
+ switch (ai->ai_family) {
+ case AF_INET:
+#ifdef AF_INET6
+ case AF_INET6:
+#endif
+ allownumeric = 1;
+ break;
+ default:
+ allownumeric = 0;
+ break;
+ }
+ break;
+ default:
+ return EAI_SOCKTYPE;
+ }
+
+ if (str_isnumber(servname)) {
+ if (!allownumeric)
+ return EAI_SERVICE;
+ port = atoi(servname);
+ if (port < 0 || port > 65535)
+ return EAI_SERVICE;
+ port = htons(port);
+ } else {
+ switch (ai->ai_socktype) {
+ case SOCK_DGRAM:
+ proto = "udp";
+ break;
+ case SOCK_STREAM:
+ proto = "tcp";
+ break;
+ default:
+ proto = NULL;
+ break;
+ }
+
+ if ((sp = getservbyname(servname, proto)) == NULL)
+ return EAI_SERVICE;
+ port = sp->s_port;
+ }
+
+ if (!matchonly) {
+ switch (ai->ai_family) {
+ case AF_INET:
+ ((struct sockaddr_in *)(void *)
+ ai->ai_addr)->sin_port = port;
+ break;
+ case AF_INET6:
+ ((struct sockaddr_in6 *)(void *)
+ ai->ai_addr)->sin6_port = port;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+static const struct afd *
+find_afd(af)
+ int af;
+{
+ const struct afd *afd;
+
+ if (af == PF_UNSPEC)
+ return NULL;
+ for (afd = afdl; afd->a_af; afd++) {
+ if (afd->a_af == af)
+ return afd;
+ }
+ return NULL;
+}
+
+/*%
+ * post-2553: AI_ADDRCONFIG check. if we use getipnodeby* as backend, backend
+ * will take care of it.
+ * the semantics of AI_ADDRCONFIG is not defined well. we are not sure
+ * if the code is right or not.
+ */
+static int
+addrconfig(af)
+ int af;
+{
+ int s;
+
+ /* XXX errno */
+ s = socket(af, SOCK_DGRAM, 0);
+ if (s < 0) {
+ if (errno != EMFILE)
+ return 0;
+ } else
+ close(s);
+ return 1;
+}
+
+/* convert a string to a scope identifier. XXX: IPv6 specific */
+static int
+ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6,
+ u_int32_t *scopeidp)
+{
+ u_int32_t scopeid;
+ u_long lscopeid;
+ struct in6_addr *a6 = &sin6->sin6_addr;
+ char *ep;
+
+ /* empty scopeid portion is invalid */
+ if (*scope == '\0')
+ return (0);
+
+#ifdef USE_IFNAMELINKID
+ if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
+ IN6_IS_ADDR_MC_NODELOCAL(a6)) {
+ /*
+ * Using interface names as link indices can be allowed
+ * only when we can assume a one-to-one mappings between
+ * links and interfaces. See comments in getnameinfo.c.
+ */
+ scopeid = if_nametoindex(scope);
+ if (scopeid == 0)
+ goto trynumeric;
+ *scopeidp = scopeid;
+ return (1);
+ }
+#endif
+
+ /* still unclear about literal, allow numeric only - placeholder */
+ if (IN6_IS_ADDR_SITELOCAL(a6) || IN6_IS_ADDR_MC_SITELOCAL(a6))
+ goto trynumeric;
+ if (IN6_IS_ADDR_MC_ORGLOCAL(a6))
+ goto trynumeric;
+ else
+ goto trynumeric; /*%< global */
+ /* try to convert to a numeric id as a last resort */
+trynumeric:
+ errno = 0;
+ lscopeid = strtoul(scope, &ep, 10);
+ scopeid = lscopeid & 0xffffffff;
+ if (errno == 0 && ep && *ep == '\0' && scopeid == lscopeid) {
+ *scopeidp = scopeid;
+ return (1);
+ } else
+ return (0);
+}
+
+struct addrinfo *
+hostent2addrinfo(hp, pai)
+ struct hostent *hp;
+ const struct addrinfo *pai;
+{
+ int i, af, error = 0;
+ char **aplist = NULL, *ap;
+ struct addrinfo sentinel, *cur;
+ const struct afd *afd;
+
+ af = hp->h_addrtype;
+ if (pai->ai_family != AF_UNSPEC && af != pai->ai_family)
+ return(NULL);
+
+ afd = find_afd(af);
+ if (afd == NULL)
+ return(NULL);
+
+ aplist = hp->h_addr_list;
+
+ memset(&sentinel, 0, sizeof(sentinel));
+ cur = &sentinel;
+
+ for (i = 0; (ap = aplist[i]) != NULL; i++) {
+#if 0 /*%< the trick seems too much */
+ af = hp->h_addr_list;
+ if (af == AF_INET6 &&
+ IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ap)) {
+ af = AF_INET;
+ ap = ap + sizeof(struct in6_addr)
+ - sizeof(struct in_addr);
+ }
+ afd = find_afd(af);
+ if (afd == NULL)
+ continue;
+#endif /* 0 */
+
+ GET_AI(cur->ai_next, afd, ap);
+
+ /* GET_PORT(cur->ai_next, servname); */
+ if ((pai->ai_flags & AI_CANONNAME) != 0) {
+ /*
+ * RFC2553 says that ai_canonname will be set only for
+ * the first element. we do it for all the elements,
+ * just for convenience.
+ */
+ GET_CANONNAME(cur->ai_next, hp->h_name);
+ }
+ while (cur->ai_next) /*%< no need to loop, actually. */
+ cur = cur->ai_next;
+ continue;
+
+ free:
+ if (cur->ai_next)
+ freeaddrinfo(cur->ai_next);
+ cur->ai_next = NULL;
+ /* continue, without tht pointer CUR advanced. */
+ }
+
+ return(sentinel.ai_next);
+}
+
+struct addrinfo *
+addr2addrinfo(pai, cp)
+ const struct addrinfo *pai;
+ const char *cp;
+{
+ const struct afd *afd;
+
+ afd = find_afd(pai->ai_family);
+ if (afd == NULL)
+ return(NULL);
+
+ return(get_ai(pai, afd, cp));
+}
+
+static struct net_data *
+init()
+{
+ struct net_data *net_data;
+
+ if (!(net_data = net_data_init(NULL)))
+ goto error;
+ if (!net_data->ho) {
+ net_data->ho = (*net_data->irs->ho_map)(net_data->irs);
+ if (!net_data->ho || !net_data->res) {
+error:
+ errno = EIO;
+ if (net_data && net_data->res)
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+
+ (*net_data->ho->res_set)(net_data->ho, net_data->res, NULL);
+ }
+
+ return (net_data);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gethostent.c b/usr/src/lib/libresolv2_joy/common/irs/gethostent.c
new file mode 100644
index 0000000000..c4751c2c80
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gethostent.c
@@ -0,0 +1,1096 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: gethostent.c,v 1.8 2006/01/10 05:06:00 marka Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#if !defined(__BIND_NOSTATIC)
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "irs_data.h"
+
+/* Definitions */
+
+struct pvt {
+ char * aliases[1];
+ char * addrs[2];
+ char addr[NS_IN6ADDRSZ];
+ char name[NS_MAXDNAME + 1];
+ struct hostent host;
+};
+
+/* Forward */
+
+static struct net_data *init(void);
+static void freepvt(struct net_data *);
+static struct hostent *fakeaddr(const char *, int, struct net_data *);
+
+#ifdef SUNW_OVERRIDE_RETRY
+extern int __res_retry(int);
+extern int __res_retry_reset(void);
+#endif /* SUNW_OVERRIDE_RETRY */
+
+
+/* Public */
+
+struct hostent *
+gethostbyname(const char *name) {
+ struct net_data *net_data = init();
+
+ return (gethostbyname_p(name, net_data));
+}
+
+struct hostent *
+gethostbyname2(const char *name, int af) {
+ struct net_data *net_data = init();
+
+ return (gethostbyname2_p(name, af, net_data));
+}
+
+struct hostent *
+gethostbyaddr(const char *addr, int len, int af) {
+ struct net_data *net_data = init();
+
+ return (gethostbyaddr_p(addr, len, af, net_data));
+}
+
+struct hostent *
+gethostent() {
+ struct net_data *net_data = init();
+
+ return (gethostent_p(net_data));
+}
+
+void
+sethostent(int stayopen) {
+ struct net_data *net_data = init();
+ sethostent_p(stayopen, net_data);
+}
+
+
+void
+endhostent() {
+ struct net_data *net_data = init();
+ endhostent_p(net_data);
+}
+
+/* Shared private. */
+
+struct hostent *
+gethostbyname_p(const char *name, struct net_data *net_data) {
+ struct hostent *hp;
+
+ if (!net_data)
+ return (NULL);
+
+ if (net_data->res->options & RES_USE_INET6) {
+ hp = gethostbyname2_p(name, AF_INET6, net_data);
+ if (hp)
+ return (hp);
+ }
+ return (gethostbyname2_p(name, AF_INET, net_data));
+}
+
+struct hostent *
+gethostbyname2_p(const char *name, int af, struct net_data *net_data) {
+ struct irs_ho *ho;
+ char tmp[NS_MAXDNAME];
+ struct hostent *hp;
+ const char *cp;
+ char **hap;
+
+ if (!net_data || !(ho = net_data->ho))
+ return (NULL);
+ if (net_data->ho_stayopen && net_data->ho_last &&
+ net_data->ho_last->h_addrtype == af) {
+ if (ns_samename(name, net_data->ho_last->h_name) == 1)
+ return (net_data->ho_last);
+ for (hap = net_data->ho_last->h_aliases; hap && *hap; hap++)
+ if (ns_samename(name, *hap) == 1)
+ return (net_data->ho_last);
+ }
+ if (!strchr(name, '.') && (cp = res_hostalias(net_data->res, name,
+ tmp, sizeof tmp)))
+ name = cp;
+ if ((hp = fakeaddr(name, af, net_data)) != NULL)
+ return (hp);
+#ifdef SUNW_OVERRIDE_RETRY
+ net_data->res->retry = __res_retry(net_data->res->retry);
+#endif /* SUNW_OVERRIDE_RETRY */
+ net_data->ho_last = (*ho->byname2)(ho, name, af);
+#ifdef SUNW_OVERRIDE_RETRY
+ net_data->res->retry = __res_retry_reset();
+#endif /* SUNW_OVERRIDE_RETRY */
+ if (!net_data->ho_stayopen)
+ endhostent();
+ return (net_data->ho_last);
+}
+
+struct hostent *
+gethostbyaddr_p(const char *addr, int len, int af, struct net_data *net_data) {
+ struct irs_ho *ho;
+ char **hap;
+
+ if (!net_data || !(ho = net_data->ho))
+ return (NULL);
+ if (net_data->ho_stayopen && net_data->ho_last &&
+ net_data->ho_last->h_length == len)
+ for (hap = net_data->ho_last->h_addr_list;
+ hap && *hap;
+ hap++)
+ if (!memcmp(addr, *hap, len))
+ return (net_data->ho_last);
+ net_data->ho_last = (*ho->byaddr)(ho, addr, len, af);
+ if (!net_data->ho_stayopen)
+ endhostent();
+ return (net_data->ho_last);
+}
+
+
+struct hostent *
+gethostent_p(struct net_data *net_data) {
+ struct irs_ho *ho;
+ struct hostent *hp;
+
+ if (!net_data || !(ho = net_data->ho))
+ return (NULL);
+ while ((hp = (*ho->next)(ho)) != NULL &&
+ hp->h_addrtype == AF_INET6 &&
+ (net_data->res->options & RES_USE_INET6) == 0U)
+ continue;
+ net_data->ho_last = hp;
+ return (net_data->ho_last);
+}
+
+
+void
+sethostent_p(int stayopen, struct net_data *net_data) {
+ struct irs_ho *ho;
+
+ if (!net_data || !(ho = net_data->ho))
+ return;
+ freepvt(net_data);
+ (*ho->rewind)(ho);
+ net_data->ho_stayopen = (stayopen != 0);
+ if (stayopen == 0)
+ net_data_minimize(net_data);
+}
+
+void
+endhostent_p(struct net_data *net_data) {
+ struct irs_ho *ho;
+
+ if ((net_data != NULL) && ((ho = net_data->ho) != NULL))
+ (*ho->minimize)(ho);
+}
+
+#ifndef IN6_IS_ADDR_V4COMPAT
+static const unsigned char in6addr_compat[12] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+#define IN6_IS_ADDR_V4COMPAT(x) (!memcmp((x)->s6_addr, in6addr_compat, 12) && \
+ ((x)->s6_addr[12] != 0 || \
+ (x)->s6_addr[13] != 0 || \
+ (x)->s6_addr[14] != 0 || \
+ ((x)->s6_addr[15] != 0 && \
+ (x)->s6_addr[15] != 1)))
+#endif
+#ifndef IN6_IS_ADDR_V4MAPPED
+#define IN6_IS_ADDR_V4MAPPED(x) (!memcmp((x)->s6_addr, in6addr_mapped, 12))
+#endif
+
+static const unsigned char in6addr_mapped[12] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };
+
+static int scan_interfaces(int *, int *);
+static struct hostent *copyandmerge(struct hostent *, struct hostent *, int, int *);
+
+/*%
+ * Public functions
+ */
+
+/*%
+ * AI_V4MAPPED + AF_INET6
+ * If no IPv6 address then a query for IPv4 and map returned values.
+ *
+ * AI_ALL + AI_V4MAPPED + AF_INET6
+ * Return IPv6 and IPv4 mapped.
+ *
+ * AI_ADDRCONFIG
+ * Only return IPv6 / IPv4 address if there is an interface of that
+ * type active.
+ */
+
+struct hostent *
+getipnodebyname(const char *name, int af, int flags, int *error_num) {
+ int have_v4 = 1, have_v6 = 1;
+ struct in_addr in4;
+ struct in6_addr in6;
+ struct hostent he, *he1 = NULL, *he2 = NULL, *he3;
+ int v4 = 0, v6 = 0;
+ struct net_data *net_data = init();
+ u_long options;
+ int tmp_err;
+
+ if (net_data == NULL) {
+ *error_num = NO_RECOVERY;
+ return (NULL);
+ }
+
+ /* If we care about active interfaces then check. */
+ if ((flags & AI_ADDRCONFIG) != 0)
+ if (scan_interfaces(&have_v4, &have_v6) == -1) {
+ *error_num = NO_RECOVERY;
+ return (NULL);
+ }
+
+ /* Check for literal address. */
+ if ((v4 = inet_pton(AF_INET, name, &in4)) != 1)
+ v6 = inet_pton(AF_INET6, name, &in6);
+
+ /* Impossible combination? */
+
+ if ((af == AF_INET6 && (flags & AI_V4MAPPED) == 0 && v4 == 1) ||
+ (af == AF_INET && v6 == 1) ||
+ (have_v4 == 0 && v4 == 1) ||
+ (have_v6 == 0 && v6 == 1) ||
+ (have_v4 == 0 && af == AF_INET) ||
+ (have_v6 == 0 && af == AF_INET6)) {
+ *error_num = HOST_NOT_FOUND;
+ return (NULL);
+ }
+
+ /* Literal address? */
+ if (v4 == 1 || v6 == 1) {
+ char *addr_list[2];
+ char *aliases[1];
+
+ DE_CONST(name, he.h_name);
+ he.h_addr_list = addr_list;
+ he.h_addr_list[0] = (v4 == 1) ? (char *)&in4 : (char *)&in6;
+ he.h_addr_list[1] = NULL;
+ he.h_aliases = aliases;
+ he.h_aliases[0] = NULL;
+ he.h_length = (v4 == 1) ? INADDRSZ : IN6ADDRSZ;
+ he.h_addrtype = (v4 == 1) ? AF_INET : AF_INET6;
+ return (copyandmerge(&he, NULL, af, error_num));
+ }
+
+ options = net_data->res->options;
+ net_data->res->options &= ~RES_USE_INET6;
+
+ tmp_err = NO_RECOVERY;
+ if (have_v6 && af == AF_INET6) {
+ he2 = gethostbyname2_p(name, AF_INET6, net_data);
+ if (he2 != NULL) {
+ he1 = copyandmerge(he2, NULL, af, error_num);
+ if (he1 == NULL)
+ return (NULL);
+ he2 = NULL;
+ } else {
+ tmp_err = net_data->res->res_h_errno;
+ }
+ }
+
+ if (have_v4 &&
+ ((af == AF_INET) ||
+ (af == AF_INET6 && (flags & AI_V4MAPPED) != 0 &&
+ (he1 == NULL || (flags & AI_ALL) != 0)))) {
+ he2 = gethostbyname2_p(name, AF_INET, net_data);
+ if (he1 == NULL && he2 == NULL) {
+ *error_num = net_data->res->res_h_errno;
+ return (NULL);
+ }
+ } else
+ *error_num = tmp_err;
+
+ net_data->res->options = options;
+
+ he3 = copyandmerge(he1, he2, af, error_num);
+
+ if (he1 != NULL)
+ freehostent(he1);
+ return (he3);
+}
+
+struct hostent *
+getipnodebyaddr(const void *src, size_t len, int af, int *error_num) {
+ struct hostent *he1, *he2;
+ struct net_data *net_data = init();
+
+ /* Sanity Checks. */
+#ifdef ORIGINAL_ISC_CODE
+ if (src == NULL) {
+#else
+ /* this change was added circa May 2009, but not in ISC libbind 6.0 */
+ if (src == NULL|| net_data == NULL) {
+#endif /* ORIGINAL_ISC_CODE */
+ *error_num = NO_RECOVERY;
+ return (NULL);
+ }
+
+ switch (af) {
+ case AF_INET:
+ if (len != (size_t)INADDRSZ) {
+ *error_num = NO_RECOVERY;
+ return (NULL);
+ }
+ break;
+ case AF_INET6:
+ if (len != (size_t)IN6ADDRSZ) {
+ *error_num = NO_RECOVERY;
+ return (NULL);
+ }
+ break;
+ default:
+ *error_num = NO_RECOVERY;
+ return (NULL);
+ }
+
+ /*
+ * Lookup IPv4 and IPv4 mapped/compatible addresses
+ */
+ if ((af == AF_INET6 &&
+ IN6_IS_ADDR_V4COMPAT((const struct in6_addr *)src)) ||
+ (af == AF_INET6 &&
+ IN6_IS_ADDR_V4MAPPED((const struct in6_addr *)src)) ||
+ (af == AF_INET)) {
+ const char *cp = src;
+
+ if (af == AF_INET6)
+ cp += 12;
+ he1 = gethostbyaddr_p(cp, 4, AF_INET, net_data);
+ if (he1 == NULL) {
+ *error_num = net_data->res->res_h_errno;
+ return (NULL);
+ }
+ he2 = copyandmerge(he1, NULL, af, error_num);
+ if (he2 == NULL)
+ return (NULL);
+ /*
+ * Restore original address if mapped/compatible.
+ */
+ if (af == AF_INET6)
+ memcpy(he1->h_addr, src, len);
+ return (he2);
+ }
+
+ /*
+ * Lookup IPv6 address.
+ */
+ if (memcmp((const struct in6_addr *)src, &in6addr_any, 16) == 0) {
+ *error_num = HOST_NOT_FOUND;
+ return (NULL);
+ }
+
+ he1 = gethostbyaddr_p(src, 16, AF_INET6, net_data);
+ if (he1 == NULL) {
+ *error_num = net_data->res->res_h_errno;
+ return (NULL);
+ }
+ return (copyandmerge(he1, NULL, af, error_num));
+}
+
+void
+freehostent(struct hostent *he) {
+ char **cpp;
+ int names = 1;
+ int addresses = 1;
+
+ memput(he->h_name, strlen(he->h_name) + 1);
+
+ cpp = he->h_addr_list;
+ while (*cpp != NULL) {
+ memput(*cpp, (he->h_addrtype == AF_INET) ?
+ INADDRSZ : IN6ADDRSZ);
+ *cpp = NULL;
+ cpp++;
+ addresses++;
+ }
+
+ cpp = he->h_aliases;
+ while (*cpp != NULL) {
+ memput(*cpp, strlen(*cpp) + 1);
+ cpp++;
+ names++;
+ }
+
+ memput(he->h_aliases, sizeof(char *) * (names));
+ memput(he->h_addr_list, sizeof(char *) * (addresses));
+ memput(he, sizeof *he);
+}
+
+/*%
+ * Private
+ */
+
+/*%
+ * Scan the interface table and set have_v4 and have_v6 depending
+ * upon whether there are IPv4 and IPv6 interface addresses.
+ *
+ * Returns:
+ * 0 on success
+ * -1 on failure.
+ */
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) && \
+ !defined(IRIX_EMUL_IOCTL_SIOCGIFCONF)
+
+#ifdef __hpux
+#define lifc_len iflc_len
+#define lifc_buf iflc_buf
+#define lifc_req iflc_req
+#define LIFCONF if_laddrconf
+#else
+#define SETFAMILYFLAGS
+#define LIFCONF lifconf
+#endif
+
+#ifdef __hpux
+#define lifr_addr iflr_addr
+#define lifr_name iflr_name
+#define lifr_dstaddr iflr_dstaddr
+#define lifr_flags iflr_flags
+#define ss_family sa_family
+#define LIFREQ if_laddrreq
+#else
+#define LIFREQ lifreq
+#endif
+
+static void
+scan_interfaces6(int *have_v4, int *have_v6) {
+ struct LIFCONF lifc;
+ struct LIFREQ lifreq;
+ struct in_addr in4;
+ struct in6_addr in6;
+ char *buf = NULL, *cp, *cplim;
+ static unsigned int bufsiz = 4095;
+ int s, cpsize, n;
+
+ /* Get interface list from system. */
+ if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) == -1)
+ goto cleanup;
+
+ /*
+ * Grow buffer until large enough to contain all interface
+ * descriptions.
+ */
+ for (;;) {
+ buf = memget(bufsiz);
+ if (buf == NULL)
+ goto cleanup;
+#ifdef SETFAMILYFLAGS
+ lifc.lifc_family = AF_UNSPEC; /*%< request all families */
+ lifc.lifc_flags = 0;
+#endif
+ lifc.lifc_len = bufsiz;
+ lifc.lifc_buf = buf;
+ if ((n = ioctl(s, SIOCGLIFCONF, (char *)&lifc)) != -1) {
+ /*
+ * Some OS's just return what will fit rather
+ * than set EINVAL if the buffer is too small
+ * to fit all the interfaces in. If
+ * lifc.lifc_len is too near to the end of the
+ * buffer we will grow it just in case and
+ * retry.
+ */
+ if (lifc.lifc_len + 2 * sizeof(lifreq) < bufsiz)
+ break;
+ }
+ if ((n == -1) && errno != EINVAL)
+ goto cleanup;
+
+ if (bufsiz > 1000000)
+ goto cleanup;
+
+ memput(buf, bufsiz);
+ bufsiz += 4096;
+ }
+
+ /* Parse system's interface list. */
+ cplim = buf + lifc.lifc_len; /*%< skip over if's with big ifr_addr's */
+ for (cp = buf;
+ (*have_v4 == 0 || *have_v6 == 0) && cp < cplim;
+ cp += cpsize) {
+ memcpy(&lifreq, cp, sizeof lifreq);
+#ifdef HAVE_SA_LEN
+#ifdef FIX_ZERO_SA_LEN
+ if (lifreq.lifr_addr.sa_len == 0)
+ lifreq.lifr_addr.sa_len = 16;
+#endif
+#ifdef HAVE_MINIMUM_IFREQ
+ cpsize = sizeof lifreq;
+ if (lifreq.lifr_addr.sa_len > sizeof (struct sockaddr))
+ cpsize += (int)lifreq.lifr_addr.sa_len -
+ (int)(sizeof (struct sockaddr));
+#else
+ cpsize = sizeof lifreq.lifr_name + lifreq.lifr_addr.sa_len;
+#endif /* HAVE_MINIMUM_IFREQ */
+#elif defined SIOCGIFCONF_ADDR
+ cpsize = sizeof lifreq;
+#else
+ cpsize = sizeof lifreq.lifr_name;
+ /* XXX maybe this should be a hard error? */
+ if (ioctl(s, SIOCGLIFADDR, (char *)&lifreq) < 0)
+ continue;
+#endif
+ switch (lifreq.lifr_addr.ss_family) {
+ case AF_INET:
+ if (*have_v4 == 0) {
+ memcpy(&in4,
+ &((struct sockaddr_in *)
+ &lifreq.lifr_addr)->sin_addr,
+ sizeof in4);
+ if (in4.s_addr == INADDR_ANY)
+ break;
+ n = ioctl(s, SIOCGLIFFLAGS, (char *)&lifreq);
+ if (n < 0)
+ break;
+ if ((lifreq.lifr_flags & IFF_UP) == 0)
+ break;
+ *have_v4 = 1;
+ }
+ break;
+ case AF_INET6:
+ if (*have_v6 == 0) {
+ memcpy(&in6,
+ &((struct sockaddr_in6 *)
+ &lifreq.lifr_addr)->sin6_addr, sizeof in6);
+ if (memcmp(&in6, &in6addr_any, sizeof in6) == 0)
+ break;
+ n = ioctl(s, SIOCGLIFFLAGS, (char *)&lifreq);
+ if (n < 0)
+ break;
+ if ((lifreq.lifr_flags & IFF_UP) == 0)
+ break;
+ *have_v6 = 1;
+ }
+ break;
+ }
+ }
+ if (buf != NULL)
+ memput(buf, bufsiz);
+ close(s);
+ /* printf("scan interface -> 4=%d 6=%d\n", *have_v4, *have_v6); */
+ return;
+ cleanup:
+ if (buf != NULL)
+ memput(buf, bufsiz);
+ if (s != -1)
+ close(s);
+ /* printf("scan interface -> 4=%d 6=%d\n", *have_v4, *have_v6); */
+ return;
+}
+#endif
+
+#if ( defined(__linux__) || defined(__linux) || defined(LINUX) )
+#ifndef IF_NAMESIZE
+# ifdef IFNAMSIZ
+# define IF_NAMESIZE IFNAMSIZ
+# else
+# define IF_NAMESIZE 16
+# endif
+#endif
+static void
+scan_linux6(int *have_v6) {
+ FILE *proc = NULL;
+ char address[33];
+ char name[IF_NAMESIZE+1];
+ int ifindex, prefix, flag3, flag4;
+
+ proc = fopen("/proc/net/if_inet6", "r");
+ if (proc == NULL)
+ return;
+
+ if (fscanf(proc, "%32[a-f0-9] %x %x %x %x %16s\n",
+ address, &ifindex, &prefix, &flag3, &flag4, name) == 6)
+ *have_v6 = 1;
+ fclose(proc);
+ return;
+}
+#endif
+
+static int
+scan_interfaces(int *have_v4, int *have_v6) {
+ struct ifconf ifc;
+ union {
+ char _pad[256]; /*%< leave space for IPv6 addresses */
+ struct ifreq ifreq;
+ } u;
+ struct in_addr in4;
+ struct in6_addr in6;
+ char *buf = NULL, *cp, *cplim;
+ static unsigned int bufsiz = 4095;
+ int s, n;
+ size_t cpsize;
+
+ /* Set to zero. Used as loop terminators below. */
+ *have_v4 = *have_v6 = 0;
+
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFADDR) && \
+ !defined(IRIX_EMUL_IOCTL_SIOCGIFCONF)
+ /*
+ * Try to scan the interfaces using IPv6 ioctls().
+ */
+ scan_interfaces6(have_v4, have_v6);
+ if (*have_v4 != 0 && *have_v6 != 0)
+ return (0);
+#endif
+#ifdef __linux
+ scan_linux6(have_v6);
+#endif
+
+ /* Get interface list from system. */
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+ goto err_ret;
+
+ /*
+ * Grow buffer until large enough to contain all interface
+ * descriptions.
+ */
+ for (;;) {
+ buf = memget(bufsiz);
+ if (buf == NULL)
+ goto err_ret;
+ ifc.ifc_len = bufsiz;
+ ifc.ifc_buf = buf;
+#ifdef IRIX_EMUL_IOCTL_SIOCGIFCONF
+ /*
+ * This is a fix for IRIX OS in which the call to ioctl with
+ * the flag SIOCGIFCONF may not return an entry for all the
+ * interfaces like most flavors of Unix.
+ */
+ if (emul_ioctl(&ifc) >= 0)
+ break;
+#else
+ if ((n = ioctl(s, SIOCGIFCONF, (char *)&ifc)) != -1) {
+ /*
+ * Some OS's just return what will fit rather
+ * than set EINVAL if the buffer is too small
+ * to fit all the interfaces in. If
+ * ifc.ifc_len is too near to the end of the
+ * buffer we will grow it just in case and
+ * retry.
+ */
+ if (ifc.ifc_len + 2 * sizeof(u.ifreq) < bufsiz)
+ break;
+ }
+#endif
+ if ((n == -1) && errno != EINVAL)
+ goto err_ret;
+
+ if (bufsiz > 1000000)
+ goto err_ret;
+
+ memput(buf, bufsiz);
+ bufsiz += 4096;
+ }
+
+ /* Parse system's interface list. */
+ cplim = buf + ifc.ifc_len; /*%< skip over if's with big ifr_addr's */
+ for (cp = buf;
+ (*have_v4 == 0 || *have_v6 == 0) && cp < cplim;
+ cp += cpsize) {
+ memcpy(&u.ifreq, cp, sizeof u.ifreq);
+#ifdef HAVE_SA_LEN
+#ifdef FIX_ZERO_SA_LEN
+ if (u.ifreq.ifr_addr.sa_len == 0)
+ u.ifreq.ifr_addr.sa_len = 16;
+#endif
+#ifdef HAVE_MINIMUM_IFREQ
+ cpsize = sizeof u.ifreq;
+ if (u.ifreq.ifr_addr.sa_len > sizeof (struct sockaddr))
+ cpsize += (int)u.ifreq.ifr_addr.sa_len -
+ (int)(sizeof (struct sockaddr));
+#else
+ cpsize = sizeof u.ifreq.ifr_name + u.ifreq.ifr_addr.sa_len;
+#endif /* HAVE_MINIMUM_IFREQ */
+ if (cpsize > sizeof u.ifreq && cpsize <= sizeof u)
+ memcpy(&u.ifreq, cp, cpsize);
+#elif defined SIOCGIFCONF_ADDR
+ cpsize = sizeof u.ifreq;
+#else
+ cpsize = sizeof u.ifreq.ifr_name;
+ /* XXX maybe this should be a hard error? */
+ if (ioctl(s, SIOCGIFADDR, (char *)&u.ifreq) < 0)
+ continue;
+#endif
+ switch (u.ifreq.ifr_addr.sa_family) {
+ case AF_INET:
+ if (*have_v4 == 0) {
+ memcpy(&in4,
+ &((struct sockaddr_in *)
+ &u.ifreq.ifr_addr)->sin_addr,
+ sizeof in4);
+ if (in4.s_addr == INADDR_ANY)
+ break;
+ n = ioctl(s, SIOCGIFFLAGS, (char *)&u.ifreq);
+ if (n < 0)
+ break;
+ if ((u.ifreq.ifr_flags & IFF_UP) == 0)
+ break;
+ *have_v4 = 1;
+ }
+ break;
+ case AF_INET6:
+ if (*have_v6 == 0) {
+ memcpy(&in6,
+ &((struct sockaddr_in6 *)
+ &u.ifreq.ifr_addr)->sin6_addr,
+ sizeof in6);
+ if (memcmp(&in6, &in6addr_any, sizeof in6) == 0)
+ break;
+ n = ioctl(s, SIOCGIFFLAGS, (char *)&u.ifreq);
+ if (n < 0)
+ break;
+ if ((u.ifreq.ifr_flags & IFF_UP) == 0)
+ break;
+ *have_v6 = 1;
+ }
+ break;
+ }
+ }
+ if (buf != NULL)
+ memput(buf, bufsiz);
+ close(s);
+ /* printf("scan interface -> 4=%d 6=%d\n", *have_v4, *have_v6); */
+ return (0);
+ err_ret:
+ if (buf != NULL)
+ memput(buf, bufsiz);
+ if (s != -1)
+ close(s);
+ /* printf("scan interface -> 4=%d 6=%d\n", *have_v4, *have_v6); */
+ return (-1);
+}
+
+static struct hostent *
+copyandmerge(struct hostent *he1, struct hostent *he2, int af, int *error_num) {
+ struct hostent *he = NULL;
+ int addresses = 1; /*%< NULL terminator */
+ int names = 1; /*%< NULL terminator */
+ int len = 0;
+ char **cpp, **npp;
+
+ /*
+ * Work out array sizes;
+ */
+ if (he1 != NULL) {
+ cpp = he1->h_addr_list;
+ while (*cpp != NULL) {
+ addresses++;
+ cpp++;
+ }
+ cpp = he1->h_aliases;
+ while (*cpp != NULL) {
+ names++;
+ cpp++;
+ }
+ }
+
+ if (he2 != NULL) {
+ cpp = he2->h_addr_list;
+ while (*cpp != NULL) {
+ addresses++;
+ cpp++;
+ }
+ if (he1 == NULL) {
+ cpp = he2->h_aliases;
+ while (*cpp != NULL) {
+ names++;
+ cpp++;
+ }
+ }
+ }
+
+ if (addresses == 1) {
+ *error_num = NO_ADDRESS;
+ return (NULL);
+ }
+
+ he = memget(sizeof *he);
+ if (he == NULL)
+ goto no_recovery;
+
+ he->h_addr_list = memget(sizeof(char *) * (addresses));
+ if (he->h_addr_list == NULL)
+ goto cleanup0;
+ memset(he->h_addr_list, 0, sizeof(char *) * (addresses));
+
+ /* copy addresses */
+ npp = he->h_addr_list;
+ if (he1 != NULL) {
+ cpp = he1->h_addr_list;
+ while (*cpp != NULL) {
+ *npp = memget((af == AF_INET) ? INADDRSZ : IN6ADDRSZ);
+ if (*npp == NULL)
+ goto cleanup1;
+ /* convert to mapped if required */
+ if (af == AF_INET6 && he1->h_addrtype == AF_INET) {
+ memcpy(*npp, in6addr_mapped,
+ sizeof in6addr_mapped);
+ memcpy(*npp + sizeof in6addr_mapped, *cpp,
+ INADDRSZ);
+ } else {
+ memcpy(*npp, *cpp,
+ (af == AF_INET) ? INADDRSZ : IN6ADDRSZ);
+ }
+ cpp++;
+ npp++;
+ }
+ }
+
+ if (he2 != NULL) {
+ cpp = he2->h_addr_list;
+ while (*cpp != NULL) {
+ *npp = memget((af == AF_INET) ? INADDRSZ : IN6ADDRSZ);
+ if (*npp == NULL)
+ goto cleanup1;
+ /* convert to mapped if required */
+ if (af == AF_INET6 && he2->h_addrtype == AF_INET) {
+ memcpy(*npp, in6addr_mapped,
+ sizeof in6addr_mapped);
+ memcpy(*npp + sizeof in6addr_mapped, *cpp,
+ INADDRSZ);
+ } else {
+ memcpy(*npp, *cpp,
+ (af == AF_INET) ? INADDRSZ : IN6ADDRSZ);
+ }
+ cpp++;
+ npp++;
+ }
+ }
+
+ he->h_aliases = memget(sizeof(char *) * (names));
+ if (he->h_aliases == NULL)
+ goto cleanup1;
+ memset(he->h_aliases, 0, sizeof(char *) * (names));
+
+ /* copy aliases */
+ npp = he->h_aliases;
+ cpp = (he1 != NULL) ? he1->h_aliases : he2->h_aliases;
+ while (*cpp != NULL) {
+ len = strlen (*cpp) + 1;
+ *npp = memget(len);
+ if (*npp == NULL)
+ goto cleanup2;
+ strcpy(*npp, *cpp);
+ npp++;
+ cpp++;
+ }
+
+ /* copy hostname */
+ he->h_name = memget(strlen((he1 != NULL) ?
+ he1->h_name : he2->h_name) + 1);
+ if (he->h_name == NULL)
+ goto cleanup2;
+ strcpy(he->h_name, (he1 != NULL) ? he1->h_name : he2->h_name);
+
+ /* set address type and length */
+ he->h_addrtype = af;
+ he->h_length = (af == AF_INET) ? INADDRSZ : IN6ADDRSZ;
+ return(he);
+
+ cleanup2:
+ cpp = he->h_aliases;
+ while (*cpp != NULL) {
+ memput(*cpp, strlen(*cpp) + 1);
+ cpp++;
+ }
+ memput(he->h_aliases, sizeof(char *) * (names));
+
+ cleanup1:
+ cpp = he->h_addr_list;
+ while (*cpp != NULL) {
+ memput(*cpp, (af == AF_INET) ? INADDRSZ : IN6ADDRSZ);
+ *cpp = NULL;
+ cpp++;
+ }
+ memput(he->h_addr_list, sizeof(char *) * (addresses));
+
+ cleanup0:
+ memput(he, sizeof *he);
+
+ no_recovery:
+ *error_num = NO_RECOVERY;
+ return (NULL);
+}
+
+static struct net_data *
+init() {
+ struct net_data *net_data;
+
+ if (!(net_data = net_data_init(NULL)))
+ goto error;
+ if (!net_data->ho) {
+ net_data->ho = (*net_data->irs->ho_map)(net_data->irs);
+ if (!net_data->ho || !net_data->res) {
+ error:
+ errno = EIO;
+
+#ifdef SUNW_SETHERRNO
+ h_errno = NETDB_INTERNAL;
+#endif /* SUNW_SETHERRNO */
+ if (net_data && net_data->res)
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+
+ (*net_data->ho->res_set)(net_data->ho, net_data->res, NULL);
+ }
+
+ return (net_data);
+}
+
+static void
+freepvt(struct net_data *net_data) {
+ if (net_data->ho_data) {
+ free(net_data->ho_data);
+ net_data->ho_data = NULL;
+ }
+}
+
+static struct hostent *
+fakeaddr(const char *name, int af, struct net_data *net_data) {
+ struct pvt *pvt;
+
+ freepvt(net_data);
+ net_data->ho_data = malloc(sizeof (struct pvt));
+ if (!net_data->ho_data) {
+ errno = ENOMEM;
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ pvt = net_data->ho_data;
+#ifndef __bsdi__
+ /*
+ * Unlike its forebear(inet_aton), our friendly inet_pton() is strict
+ * in its interpretation of its input, and it will only return "1" if
+ * the input string is a formally valid(and thus unambiguous with
+ * respect to host names) internet address specification for this AF.
+ *
+ * This means "telnet 0xdeadbeef" and "telnet 127.1" are dead now.
+ */
+ if (inet_pton(af, name, pvt->addr) != 1) {
+#else
+ /* BSDI XXX
+ * We put this back to inet_aton -- we really want the old behavior
+ * Long live 127.1...
+ */
+ if ((af != AF_INET ||
+ inet_aton(name, (struct in_addr *)pvt->addr) != 1) &&
+ inet_pton(af, name, pvt->addr) != 1) {
+#endif
+ RES_SET_H_ERRNO(net_data->res, HOST_NOT_FOUND);
+ return (NULL);
+ }
+ strncpy(pvt->name, name, NS_MAXDNAME);
+ pvt->name[NS_MAXDNAME] = '\0';
+ if (af == AF_INET && (net_data->res->options & RES_USE_INET6) != 0U) {
+ map_v4v6_address(pvt->addr, pvt->addr);
+ af = AF_INET6;
+ }
+ pvt->host.h_addrtype = af;
+ switch(af) {
+ case AF_INET:
+ pvt->host.h_length = NS_INADDRSZ;
+ break;
+ case AF_INET6:
+ pvt->host.h_length = NS_IN6ADDRSZ;
+ break;
+ default:
+ errno = EAFNOSUPPORT;
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ pvt->host.h_name = pvt->name;
+ pvt->host.h_aliases = pvt->aliases;
+ pvt->aliases[0] = NULL;
+ pvt->addrs[0] = (char *)pvt->addr;
+ pvt->addrs[1] = NULL;
+ pvt->host.h_addr_list = pvt->addrs;
+ RES_SET_H_ERRNO(net_data->res, NETDB_SUCCESS);
+ return (&pvt->host);
+}
+
+#ifdef grot /*%< for future use in gethostbyaddr(), for "SUNSECURITY" */
+ struct hostent *rhp;
+ char **haddr;
+ u_long old_options;
+ char hname2[MAXDNAME+1];
+
+ if (af == AF_INET) {
+ /*
+ * turn off search as the name should be absolute,
+ * 'localhost' should be matched by defnames
+ */
+ strncpy(hname2, hp->h_name, MAXDNAME);
+ hname2[MAXDNAME] = '\0';
+ old_options = net_data->res->options;
+ net_data->res->options &= ~RES_DNSRCH;
+ net_data->res->options |= RES_DEFNAMES;
+ if (!(rhp = gethostbyname(hname2))) {
+ net_data->res->options = old_options;
+ RES_SET_H_ERRNO(net_data->res, HOST_NOT_FOUND);
+ return (NULL);
+ }
+ net_data->res->options = old_options;
+ for (haddr = rhp->h_addr_list; *haddr; haddr++)
+ if (!memcmp(*haddr, addr, INADDRSZ))
+ break;
+ if (!*haddr) {
+ RES_SET_H_ERRNO(net_data->res, HOST_NOT_FOUND);
+ return (NULL);
+ }
+ }
+#endif /* grot */
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/gethostent_r.c b/usr/src/lib/libresolv2_joy/common/irs/gethostent_r.c
new file mode 100644
index 0000000000..1971677c5d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/gethostent_r.c
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: gethostent_r.c,v 1.9 2005/09/03 12:41:37 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <port_before.h>
+#if !defined(_REENTRANT) || !defined(DO_PTHREADS)
+ static int gethostent_r_not_required = 0;
+#else
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <sys/param.h>
+#include <port_after.h>
+
+#pragma redefine extname res_gethostbyname joy_res_gethostbyname
+#pragma redefine extname res_gethostbyaddr joy_res_gethostbyaddr
+
+#ifdef HOST_R_RETURN
+
+static HOST_R_RETURN
+copy_hostent(struct hostent *, struct hostent *, HOST_R_COPY_ARGS);
+
+HOST_R_RETURN
+gethostbyname_r(const char *name, struct hostent *hptr, HOST_R_ARGS) {
+ struct hostent *he = gethostbyname(name);
+#ifdef HOST_R_SETANSWER
+ int n = 0;
+#endif
+
+#ifdef HOST_R_ERRNO
+ HOST_R_ERRNO;
+#endif
+
+#ifdef HOST_R_SETANSWER
+ if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = hptr;
+
+ return (n);
+#else
+ if (he == NULL)
+ return (HOST_R_BAD);
+
+ return (copy_hostent(he, hptr, HOST_R_COPY));
+#endif
+}
+
+HOST_R_RETURN
+gethostbyaddr_r(const char *addr, int len, int type,
+ struct hostent *hptr, HOST_R_ARGS) {
+ struct hostent *he = gethostbyaddr(addr, len, type);
+#ifdef HOST_R_SETANSWER
+ int n = 0;
+#endif
+
+#ifdef HOST_R_ERRNO
+ HOST_R_ERRNO;
+#endif
+
+#ifdef HOST_R_SETANSWER
+ if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = hptr;
+
+ return (n);
+#else
+ if (he == NULL)
+ return (HOST_R_BAD);
+
+ return (copy_hostent(he, hptr, HOST_R_COPY));
+#endif
+}
+
+/*%
+ * These assume a single context is in operation per thread.
+ * If this is not the case we will need to call irs directly
+ * rather than through the base functions.
+ */
+
+HOST_R_RETURN
+gethostent_r(struct hostent *hptr, HOST_R_ARGS) {
+ struct hostent *he = gethostent();
+#ifdef HOST_R_SETANSWER
+ int n = 0;
+#endif
+
+#ifdef HOST_R_ERRNO
+ HOST_R_ERRNO;
+#endif
+
+#ifdef HOST_R_SETANSWER
+ if (he == NULL || (n = copy_hostent(he, hptr, HOST_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = hptr;
+
+ return (n);
+#else
+ if (he == NULL)
+ return (HOST_R_BAD);
+
+ return (copy_hostent(he, hptr, HOST_R_COPY));
+#endif
+}
+
+HOST_R_SET_RETURN
+#ifdef HOST_R_ENT_ARGS
+sethostent_r(int stay_open, HOST_R_ENT_ARGS)
+#else
+sethostent_r(int stay_open)
+#endif
+{
+#ifdef HOST_R_ENT_ARGS
+ UNUSED(hdptr);
+#endif
+ sethostent(stay_open);
+#ifdef HOST_R_SET_RESULT
+ return (HOST_R_SET_RESULT);
+#endif
+}
+
+HOST_R_END_RETURN
+#ifdef HOST_R_ENT_ARGS
+endhostent_r(HOST_R_ENT_ARGS)
+#else
+endhostent_r(void)
+#endif
+{
+#ifdef HOST_R_ENT_ARGS
+ UNUSED(hdptr);
+#endif
+ endhostent();
+ HOST_R_END_RESULT(HOST_R_OK);
+}
+
+/* Private */
+
+#ifndef HOSTENT_DATA
+static HOST_R_RETURN
+copy_hostent(struct hostent *he, struct hostent *hptr, HOST_R_COPY_ARGS) {
+ char *cp;
+ char **ptr;
+ int i, n;
+ int nptr, len;
+
+ /* Find out the amount of space required to store the answer. */
+ nptr = 2; /*%< NULL ptrs */
+ len = (char *)ALIGN(buf) - buf;
+ for (i = 0; he->h_addr_list[i]; i++, nptr++) {
+ len += he->h_length;
+ }
+ for (i = 0; he->h_aliases[i]; i++, nptr++) {
+ len += strlen(he->h_aliases[i]) + 1;
+ }
+ len += strlen(he->h_name) + 1;
+ len += nptr * sizeof(char*);
+
+ if (len > buflen) {
+ errno = ERANGE;
+ return (HOST_R_BAD);
+ }
+
+ /* copy address size and type */
+ hptr->h_addrtype = he->h_addrtype;
+ n = hptr->h_length = he->h_length;
+
+ ptr = (char **)ALIGN(buf);
+ cp = (char *)ALIGN(buf) + nptr * sizeof(char *);
+
+ /* copy address list */
+ hptr->h_addr_list = ptr;
+ for (i = 0; he->h_addr_list[i]; i++ , ptr++) {
+ memcpy(cp, he->h_addr_list[i], n);
+ hptr->h_addr_list[i] = cp;
+ cp += n;
+ }
+ hptr->h_addr_list[i] = NULL;
+ ptr++;
+
+ /* copy official name */
+ n = strlen(he->h_name) + 1;
+ strcpy(cp, he->h_name);
+ hptr->h_name = cp;
+ cp += n;
+
+ /* copy aliases */
+ hptr->h_aliases = ptr;
+ for (i = 0 ; he->h_aliases[i]; i++) {
+ n = strlen(he->h_aliases[i]) + 1;
+ strcpy(cp, he->h_aliases[i]);
+ hptr->h_aliases[i] = cp;
+ cp += n;
+ }
+ hptr->h_aliases[i] = NULL;
+
+ return (HOST_R_OK);
+}
+#else /* !HOSTENT_DATA */
+static int
+copy_hostent(struct hostent *he, struct hostent *hptr, HOST_R_COPY_ARGS) {
+ char *cp, *eob;
+ int i, n;
+
+ /* copy address size and type */
+ hptr->h_addrtype = he->h_addrtype;
+ n = hptr->h_length = he->h_length;
+
+ /* copy up to first 35 addresses */
+ i = 0;
+ cp = hdptr->hostbuf;
+ eob = hdptr->hostbuf + sizeof(hdptr->hostbuf);
+ hptr->h_addr_list = hdptr->h_addr_ptrs;
+ while (he->h_addr_list[i] && i < (_MAXADDRS)) {
+ if (n < (eob - cp)) {
+ memcpy(cp, he->h_addr_list[i], n);
+ hptr->h_addr_list[i] = cp;
+ cp += n;
+ } else {
+ break;
+ }
+ i++;
+ }
+ hptr->h_addr_list[i] = NULL;
+
+ /* copy official name */
+ if ((n = strlen(he->h_name) + 1) < (eob - cp)) {
+ strcpy(cp, he->h_name);
+ hptr->h_name = cp;
+ cp += n;
+ } else {
+ return (-1);
+ }
+
+ /* copy aliases */
+ i = 0;
+ hptr->h_aliases = hdptr->host_aliases;
+ while (he->h_aliases[i] && i < (_MAXALIASES-1)) {
+ if ((n = strlen(he->h_aliases[i]) + 1) < (eob - cp)) {
+ strcpy(cp, he->h_aliases[i]);
+ hptr->h_aliases[i] = cp;
+ cp += n;
+ } else {
+ break;
+ }
+ i++;
+ }
+ hptr->h_aliases[i] = NULL;
+
+ return (HOST_R_OK);
+}
+#endif /* !HOSTENT_DATA */
+#else /* HOST_R_RETURN */
+ static int gethostent_r_unknown_system = 0;
+#endif /* HOST_R_RETURN */
+#endif /* !defined(_REENTRANT) || !defined(DO_PTHREADS) */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getnameinfo.c b/usr/src/lib/libresolv2_joy/common/irs/getnameinfo.c
new file mode 100644
index 0000000000..360bda8bfe
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getnameinfo.c
@@ -0,0 +1,334 @@
+/*
+ * Issues to be discussed:
+ * - Thread safe-ness must be checked
+ */
+
+#if ( defined(__linux__) || defined(__linux) || defined(LINUX) )
+#ifndef IF_NAMESIZE
+# ifdef IFNAMSIZ
+# define IF_NAMESIZE IFNAMSIZ
+# else
+# define IF_NAMESIZE 16
+# endif
+#endif
+#endif
+
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by WIDE Project and
+ * its contributors.
+ * 4. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <port_before.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <string.h>
+#include <stddef.h>
+
+#include <port_after.h>
+
+/*%
+ * Note that a_off will be dynamically adjusted so that to be consistent
+ * with the definition of sockaddr_in{,6}.
+ * The value presented below is just a guess.
+ */
+static struct afd {
+ int a_af;
+ int a_addrlen;
+ size_t a_socklen;
+ int a_off;
+} afdl [] = {
+ /* first entry is linked last... */
+ {PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in),
+ offsetof(struct sockaddr_in, sin_addr)},
+ {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6),
+ offsetof(struct sockaddr_in6, sin6_addr)},
+ {0, 0, 0, 0},
+};
+
+struct sockinet {
+#ifdef HAVE_SA_LEN
+ u_char si_len;
+#endif
+ u_char si_family;
+ u_short si_port;
+};
+
+static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *,
+ size_t, int));
+#ifdef HAVE_SIN6_SCOPE_ID
+static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int));
+#endif
+
+int
+getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
+ const struct sockaddr *sa;
+ size_t salen;
+ char *host;
+ size_t hostlen;
+ char *serv;
+ size_t servlen;
+ int flags;
+{
+ struct afd *afd;
+ struct servent *sp;
+ struct hostent *hp;
+ u_short port;
+#ifdef HAVE_SA_LEN
+ size_t len;
+#endif
+ int family, i;
+ const char *addr;
+ char *p;
+ char numserv[512];
+ char numaddr[512];
+ const struct sockaddr_in6 *sin6;
+
+ if (sa == NULL)
+ return EAI_FAIL;
+
+#ifdef HAVE_SA_LEN
+ len = sa->sa_len;
+ if (len != salen) return EAI_FAIL;
+#endif
+
+ family = sa->sa_family;
+ for (i = 0; afdl[i].a_af; i++)
+ if (afdl[i].a_af == family) {
+ afd = &afdl[i];
+ goto found;
+ }
+ return EAI_FAMILY;
+
+ found:
+ if (salen != afd->a_socklen) return EAI_FAIL;
+
+ port = ((const struct sockinet *)sa)->si_port; /*%< network byte order */
+ addr = (const char *)sa + afd->a_off;
+
+ if (serv == NULL || servlen == 0U) {
+ /*
+ * rfc2553bis says that serv == NULL or servlen == 0 means that
+ * the caller does not want the result.
+ */
+ } else if (flags & NI_NUMERICSERV) {
+ sprintf(numserv, "%d", ntohs(port));
+ if (strlen(numserv) > servlen)
+ return EAI_MEMORY;
+ strcpy(serv, numserv);
+ } else {
+ sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
+ if (sp) {
+ if (strlen(sp->s_name) + 1 > servlen)
+ return EAI_MEMORY;
+ strcpy(serv, sp->s_name);
+ } else
+ return EAI_NONAME;
+ }
+
+ switch (sa->sa_family) {
+ case AF_INET:
+ if (ntohl(*(const u_int32_t *)addr) >> IN_CLASSA_NSHIFT == 0)
+ flags |= NI_NUMERICHOST;
+ break;
+ case AF_INET6:
+ sin6 = (const struct sockaddr_in6 *)sa;
+ switch (sin6->sin6_addr.s6_addr[0]) {
+ case 0x00:
+ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr))
+ ;
+ else if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))
+ ;
+ else
+ flags |= NI_NUMERICHOST;
+ break;
+ default:
+ if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
+ flags |= NI_NUMERICHOST;
+ else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))
+ flags |= NI_NUMERICHOST;
+ break;
+ }
+ break;
+ }
+ if (host == NULL || hostlen == 0U) {
+ /*
+ * rfc2553bis says that host == NULL or hostlen == 0 means that
+ * the caller does not want the result.
+ */
+ } else if (flags & NI_NUMERICHOST) {
+ goto numeric;
+ } else {
+ hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af);
+
+ if (hp) {
+ if (flags & NI_NOFQDN) {
+ p = strchr(hp->h_name, '.');
+ if (p) *p = '\0';
+ }
+ if (strlen(hp->h_name) + 1 > hostlen)
+ return EAI_MEMORY;
+ strcpy(host, hp->h_name);
+ } else {
+ if (flags & NI_NAMEREQD)
+ return EAI_NONAME;
+ numeric:
+ switch(afd->a_af) {
+ case AF_INET6:
+ {
+ int error;
+
+ if ((error = ip6_parsenumeric(sa, addr, host,
+ hostlen,
+ flags)) != 0)
+ return(error);
+ break;
+ }
+
+ default:
+ if (inet_ntop(afd->a_af, addr, numaddr,
+ sizeof(numaddr)) == NULL)
+ return EAI_NONAME;
+ if (strlen(numaddr) + 1 > hostlen)
+ return EAI_MEMORY;
+ strcpy(host, numaddr);
+ }
+ }
+ }
+ return(0);
+}
+
+static int
+ip6_parsenumeric(const struct sockaddr *sa, const char *addr, char *host,
+ size_t hostlen, int flags)
+{
+ size_t numaddrlen;
+ char numaddr[512];
+
+#ifndef HAVE_SIN6_SCOPE_ID
+ UNUSED(sa);
+ UNUSED(flags);
+#endif
+
+ if (inet_ntop(AF_INET6, addr, numaddr, sizeof(numaddr))
+ == NULL)
+ return EAI_SYSTEM;
+
+ numaddrlen = strlen(numaddr);
+ if (numaddrlen + 1 > hostlen) /*%< don't forget terminator */
+ return EAI_MEMORY;
+ strcpy(host, numaddr);
+
+#ifdef HAVE_SIN6_SCOPE_ID
+ if (((const struct sockaddr_in6 *)sa)->sin6_scope_id) {
+ char scopebuf[MAXHOSTNAMELEN]; /*%< XXX */
+ int scopelen;
+
+ /* ip6_sa2str never fails */
+ scopelen = ip6_sa2str((const struct sockaddr_in6 *)sa,
+ scopebuf, sizeof(scopebuf), flags);
+
+ if (scopelen + 1 + numaddrlen + 1 > hostlen)
+ return EAI_MEMORY;
+
+ /* construct <numeric-addr><delim><scopeid> */
+ memcpy(host + numaddrlen + 1, scopebuf,
+ scopelen);
+ host[numaddrlen] = SCOPE_DELIMITER;
+ host[numaddrlen + 1 + scopelen] = '\0';
+ }
+#endif
+
+ return 0;
+}
+
+#ifdef HAVE_SIN6_SCOPE_ID
+/* ARGSUSED */
+static int
+ip6_sa2str(const struct sockaddr_in6 *sa6, char *buf,
+ size_t bufsiz, int flags)
+{
+#ifdef USE_IFNAMELINKID
+ unsigned int ifindex = (unsigned int)sa6->sin6_scope_id;
+ const struct in6_addr *a6 = &sa6->sin6_addr;
+#endif
+ char tmp[64];
+
+#ifdef NI_NUMERICSCOPE
+ if (flags & NI_NUMERICSCOPE) {
+ sprintf(tmp, "%u", sa6->sin6_scope_id);
+ if (bufsiz != 0U) {
+ strncpy(buf, tmp, bufsiz - 1);
+ buf[bufsiz - 1] = '\0';
+ }
+ return(strlen(tmp));
+ }
+#endif
+
+#ifdef USE_IFNAMELINKID
+ /*
+ * For a link-local address, convert the index to an interface
+ * name, assuming a one-to-one mapping between links and interfaces.
+ * Note, however, that this assumption is stronger than the
+ * specification of the scoped address architecture; the
+ * specficication says that more than one interfaces can belong to
+ * a single link.
+ */
+
+ /* if_indextoname() does not take buffer size. not a good api... */
+ if ((IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) &&
+ bufsiz >= IF_NAMESIZE) {
+ char *p = if_indextoname(ifindex, buf);
+ if (p) {
+ return(strlen(p));
+ }
+ }
+#endif
+
+ /* last resort */
+ sprintf(tmp, "%u", sa6->sin6_scope_id);
+ if (bufsiz != 0U) {
+ strncpy(buf, tmp, bufsiz - 1);
+ buf[bufsiz - 1] = '\0';
+ }
+ return(strlen(tmp));
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getnetent.c b/usr/src/lib/libresolv2_joy/common/irs/getnetent.c
new file mode 100644
index 0000000000..0d00699e81
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getnetent.c
@@ -0,0 +1,345 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: getnetent.c,v 1.7 2005/04/27 04:56:25 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#if !defined(__BIND_NOSTATIC)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "irs_data.h"
+
+/* Definitions */
+
+struct pvt {
+ struct netent netent;
+ char * aliases[1];
+ char name[MAXDNAME + 1];
+};
+
+/* Forward */
+
+static struct net_data *init(void);
+static struct netent *nw_to_net(struct nwent *, struct net_data *);
+static void freepvt(struct net_data *);
+static struct netent *fakeaddr(const char *, int af, struct net_data *);
+
+/* Portability */
+
+#ifndef INADDR_NONE
+# define INADDR_NONE 0xffffffff
+#endif
+
+/* Public */
+
+struct netent *
+getnetent() {
+ struct net_data *net_data = init();
+
+ return (getnetent_p(net_data));
+}
+
+struct netent *
+getnetbyname(const char *name) {
+ struct net_data *net_data = init();
+
+ return (getnetbyname_p(name, net_data));
+}
+
+struct netent *
+getnetbyaddr(unsigned long net, int type) {
+ struct net_data *net_data = init();
+
+ return (getnetbyaddr_p(net, type, net_data));
+}
+
+void
+setnetent(int stayopen) {
+ struct net_data *net_data = init();
+
+ setnetent_p(stayopen, net_data);
+}
+
+
+void
+endnetent() {
+ struct net_data *net_data = init();
+
+ endnetent_p(net_data);
+}
+
+/* Shared private. */
+
+struct netent *
+getnetent_p(struct net_data *net_data) {
+ struct irs_nw *nw;
+
+ if (!net_data || !(nw = net_data->nw))
+ return (NULL);
+ net_data->nww_last = (*nw->next)(nw);
+ net_data->nw_last = nw_to_net(net_data->nww_last, net_data);
+ return (net_data->nw_last);
+}
+
+struct netent *
+getnetbyname_p(const char *name, struct net_data *net_data) {
+ struct irs_nw *nw;
+ struct netent *np;
+ char **nap;
+
+ if (!net_data || !(nw = net_data->nw))
+ return (NULL);
+ if (net_data->nw_stayopen && net_data->nw_last) {
+ if (!strcmp(net_data->nw_last->n_name, name))
+ return (net_data->nw_last);
+ for (nap = net_data->nw_last->n_aliases; nap && *nap; nap++)
+ if (!strcmp(name, *nap))
+ return (net_data->nw_last);
+ }
+ if ((np = fakeaddr(name, AF_INET, net_data)) != NULL)
+ return (np);
+ net_data->nww_last = (*nw->byname)(nw, name, AF_INET);
+ net_data->nw_last = nw_to_net(net_data->nww_last, net_data);
+ if (!net_data->nw_stayopen)
+ endnetent();
+ return (net_data->nw_last);
+}
+
+struct netent *
+getnetbyaddr_p(unsigned long net, int type, struct net_data *net_data) {
+ struct irs_nw *nw;
+ u_char addr[4];
+ int bits;
+
+ if (!net_data || !(nw = net_data->nw))
+ return (NULL);
+ if (net_data->nw_stayopen && net_data->nw_last)
+ if (type == net_data->nw_last->n_addrtype &&
+ net == net_data->nw_last->n_net)
+ return (net_data->nw_last);
+
+ /* cannonize net(host order) */
+ if (net < 256UL) {
+ net <<= 24;
+ bits = 8;
+ } else if (net < 65536UL) {
+ net <<= 16;
+ bits = 16;
+ } else if (net < 16777216UL) {
+ net <<= 8;
+ bits = 24;
+ } else
+ bits = 32;
+
+ /* convert to net order */
+ addr[0] = (0xFF000000 & net) >> 24;
+ addr[1] = (0x00FF0000 & net) >> 16;
+ addr[2] = (0x0000FF00 & net) >> 8;
+ addr[3] = (0x000000FF & net);
+
+ /* reduce bits to as close to natural number as possible */
+ if ((bits == 32) && (addr[0] < 224) && (addr[3] == 0)) {
+ if ((addr[0] < 192) && (addr[2] == 0)) {
+ if ((addr[0] < 128) && (addr[1] == 0))
+ bits = 8;
+ else
+ bits = 16;
+ } else {
+ bits = 24;
+ }
+ }
+
+ net_data->nww_last = (*nw->byaddr)(nw, addr, bits, AF_INET);
+ net_data->nw_last = nw_to_net(net_data->nww_last, net_data);
+ if (!net_data->nw_stayopen)
+ endnetent();
+ return (net_data->nw_last);
+}
+
+
+
+
+void
+setnetent_p(int stayopen, struct net_data *net_data) {
+ struct irs_nw *nw;
+
+ if (!net_data || !(nw = net_data->nw))
+ return;
+ freepvt(net_data);
+ (*nw->rewind)(nw);
+ net_data->nw_stayopen = (stayopen != 0);
+ if (stayopen == 0)
+ net_data_minimize(net_data);
+}
+
+void
+endnetent_p(struct net_data *net_data) {
+ struct irs_nw *nw;
+
+ if ((net_data != NULL) && ((nw = net_data->nw) != NULL))
+ (*nw->minimize)(nw);
+}
+
+/* Private */
+
+static struct net_data *
+init() {
+ struct net_data *net_data;
+
+ if (!(net_data = net_data_init(NULL)))
+ goto error;
+ if (!net_data->nw) {
+ net_data->nw = (*net_data->irs->nw_map)(net_data->irs);
+
+ if (!net_data->nw || !net_data->res) {
+ error:
+ errno = EIO;
+ return (NULL);
+ }
+ (*net_data->nw->res_set)(net_data->nw, net_data->res, NULL);
+ }
+
+ return (net_data);
+}
+
+static void
+freepvt(struct net_data *net_data) {
+ if (net_data->nw_data) {
+ free(net_data->nw_data);
+ net_data->nw_data = NULL;
+ }
+}
+
+static struct netent *
+fakeaddr(const char *name, int af, struct net_data *net_data) {
+ struct pvt *pvt;
+ const char *cp;
+ u_long tmp;
+
+ if (af != AF_INET) {
+ /* XXX should support IPv6 some day */
+ errno = EAFNOSUPPORT;
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ if (!isascii((unsigned char)(name[0])) ||
+ !isdigit((unsigned char)(name[0])))
+ return (NULL);
+ for (cp = name; *cp; ++cp)
+ if (!isascii(*cp) || (!isdigit((unsigned char)*cp) && *cp != '.'))
+ return (NULL);
+ if (*--cp == '.')
+ return (NULL);
+
+ /* All-numeric, no dot at the end. */
+
+ tmp = inet_network(name);
+ if (tmp == INADDR_NONE) {
+ RES_SET_H_ERRNO(net_data->res, HOST_NOT_FOUND);
+ return (NULL);
+ }
+
+ /* Valid network number specified.
+ * Fake up a netent as if we'd actually
+ * done a lookup.
+ */
+ freepvt(net_data);
+ net_data->nw_data = malloc(sizeof (struct pvt));
+ if (!net_data->nw_data) {
+ errno = ENOMEM;
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ pvt = net_data->nw_data;
+
+ strncpy(pvt->name, name, MAXDNAME);
+ pvt->name[MAXDNAME] = '\0';
+ pvt->netent.n_name = pvt->name;
+ pvt->netent.n_addrtype = AF_INET;
+ pvt->netent.n_aliases = pvt->aliases;
+ pvt->aliases[0] = NULL;
+ pvt->netent.n_net = tmp;
+
+ return (&pvt->netent);
+}
+
+static struct netent *
+nw_to_net(struct nwent *nwent, struct net_data *net_data) {
+ struct pvt *pvt;
+ u_long addr = 0;
+ int i;
+ int msbyte;
+
+ if (!nwent || nwent->n_addrtype != AF_INET)
+ return (NULL);
+ freepvt(net_data);
+ net_data->nw_data = malloc(sizeof (struct pvt));
+ if (!net_data->nw_data) {
+ errno = ENOMEM;
+ RES_SET_H_ERRNO(net_data->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ pvt = net_data->nw_data;
+ pvt->netent.n_name = nwent->n_name;
+ pvt->netent.n_aliases = nwent->n_aliases;
+ pvt->netent.n_addrtype = nwent->n_addrtype;
+
+/*%
+ * What this code does: Converts net addresses from network to host form.
+ *
+ * msbyte: the index of the most significant byte in the n_addr array.
+ *
+ * Shift bytes in significant order into addr. When all signicant
+ * bytes are in, zero out bits in the LSB that are not part of the network.
+ */
+ msbyte = nwent->n_length / 8 +
+ ((nwent->n_length % 8) != 0 ? 1 : 0) - 1;
+ for (i = 0; i <= msbyte; i++)
+ addr = (addr << 8) | ((unsigned char *)nwent->n_addr)[i];
+ i = (32 - nwent->n_length) % 8;
+ if (i != 0)
+ addr &= ~((1 << (i + 1)) - 1);
+ pvt->netent.n_net = addr;
+ return (&pvt->netent);
+}
+
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getnetent_r.c b/usr/src/lib/libresolv2_joy/common/irs/getnetent_r.c
new file mode 100644
index 0000000000..9fb52bc394
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getnetent_r.c
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: getnetent_r.c,v 1.6 2005/09/03 12:41:38 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <port_before.h>
+#if !defined(_REENTRANT) || !defined(DO_PTHREADS)
+ static int getnetent_r_not_required = 0;
+#else
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <sys/param.h>
+#include <port_after.h>
+
+#ifdef NET_R_RETURN
+
+static NET_R_RETURN
+copy_netent(struct netent *, struct netent *, NET_R_COPY_ARGS);
+
+NET_R_RETURN
+getnetbyname_r(const char *name, struct netent *nptr, NET_R_ARGS) {
+ struct netent *ne = getnetbyname(name);
+#ifdef NET_R_SETANSWER
+ int n = 0;
+
+ if (ne == NULL || (n = copy_netent(ne, nptr, NET_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = ne;
+ if (ne == NULL)
+ *h_errnop = h_errno;
+ return (n);
+#else
+ if (ne == NULL)
+ return (NET_R_BAD);
+
+ return (copy_netent(ne, nptr, NET_R_COPY));
+#endif
+}
+
+#ifndef GETNETBYADDR_ADDR_T
+#define GETNETBYADDR_ADDR_T long
+#endif
+NET_R_RETURN
+getnetbyaddr_r(GETNETBYADDR_ADDR_T addr, int type, struct netent *nptr, NET_R_ARGS) {
+ struct netent *ne = getnetbyaddr(addr, type);
+#ifdef NET_R_SETANSWER
+ int n = 0;
+
+ if (ne == NULL || (n = copy_netent(ne, nptr, NET_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = ne;
+ if (ne == NULL)
+ *h_errnop = h_errno;
+ return (n);
+#else
+
+ if (ne == NULL)
+ return (NET_R_BAD);
+
+ return (copy_netent(ne, nptr, NET_R_COPY));
+#endif
+}
+
+/*%
+ * These assume a single context is in operation per thread.
+ * If this is not the case we will need to call irs directly
+ * rather than through the base functions.
+ */
+
+NET_R_RETURN
+getnetent_r(struct netent *nptr, NET_R_ARGS) {
+ struct netent *ne = getnetent();
+#ifdef NET_R_SETANSWER
+ int n = 0;
+
+ if (ne == NULL || (n = copy_netent(ne, nptr, NET_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = ne;
+ if (ne == NULL)
+ *h_errnop = h_errno;
+ return (n);
+#else
+
+ if (ne == NULL)
+ return (NET_R_BAD);
+
+ return (copy_netent(ne, nptr, NET_R_COPY));
+#endif
+}
+
+NET_R_SET_RETURN
+#ifdef NET_R_ENT_ARGS
+setnetent_r(int stay_open, NET_R_ENT_ARGS)
+#else
+setnetent_r(int stay_open)
+#endif
+{
+#ifdef NET_R_ENT_ARGS
+ UNUSED(ndptr);
+#endif
+ setnetent(stay_open);
+#ifdef NET_R_SET_RESULT
+ return (NET_R_SET_RESULT);
+#endif
+}
+
+NET_R_END_RETURN
+#ifdef NET_R_ENT_ARGS
+endnetent_r(NET_R_ENT_ARGS)
+#else
+endnetent_r()
+#endif
+{
+#ifdef NET_R_ENT_ARGS
+ UNUSED(ndptr);
+#endif
+ endnetent();
+ NET_R_END_RESULT(NET_R_OK);
+}
+
+/* Private */
+
+#ifndef NETENT_DATA
+static NET_R_RETURN
+copy_netent(struct netent *ne, struct netent *nptr, NET_R_COPY_ARGS) {
+ char *cp;
+ int i, n;
+ int numptr, len;
+
+ /* Find out the amount of space required to store the answer. */
+ numptr = 1; /*%< NULL ptr */
+ len = (char *)ALIGN(buf) - buf;
+ for (i = 0; ne->n_aliases[i]; i++, numptr++) {
+ len += strlen(ne->n_aliases[i]) + 1;
+ }
+ len += strlen(ne->n_name) + 1;
+ len += numptr * sizeof(char*);
+
+ if (len > (int)buflen) {
+ errno = ERANGE;
+ return (NET_R_BAD);
+ }
+
+ /* copy net value and type */
+ nptr->n_addrtype = ne->n_addrtype;
+ nptr->n_net = ne->n_net;
+
+ cp = (char *)ALIGN(buf) + numptr * sizeof(char *);
+
+ /* copy official name */
+ n = strlen(ne->n_name) + 1;
+ strcpy(cp, ne->n_name);
+ nptr->n_name = cp;
+ cp += n;
+
+ /* copy aliases */
+ nptr->n_aliases = (char **)ALIGN(buf);
+ for (i = 0 ; ne->n_aliases[i]; i++) {
+ n = strlen(ne->n_aliases[i]) + 1;
+ strcpy(cp, ne->n_aliases[i]);
+ nptr->n_aliases[i] = cp;
+ cp += n;
+ }
+ nptr->n_aliases[i] = NULL;
+
+ return (NET_R_OK);
+}
+#else /* !NETENT_DATA */
+static int
+copy_netent(struct netent *ne, struct netent *nptr, NET_R_COPY_ARGS) {
+ char *cp, *eob;
+ int i, n;
+
+ /* copy net value and type */
+ nptr->n_addrtype = ne->n_addrtype;
+ nptr->n_net = ne->n_net;
+
+ /* copy official name */
+ cp = ndptr->line;
+ eob = ndptr->line + sizeof(ndptr->line);
+ if ((n = strlen(ne->n_name) + 1) < (eob - cp)) {
+ strcpy(cp, ne->n_name);
+ nptr->n_name = cp;
+ cp += n;
+ } else {
+ return (-1);
+ }
+
+ /* copy aliases */
+ i = 0;
+ nptr->n_aliases = ndptr->net_aliases;
+ while (ne->n_aliases[i] && i < (_MAXALIASES-1)) {
+ if ((n = strlen(ne->n_aliases[i]) + 1) < (eob - cp)) {
+ strcpy(cp, ne->n_aliases[i]);
+ nptr->n_aliases[i] = cp;
+ cp += n;
+ } else {
+ break;
+ }
+ i++;
+ }
+ nptr->n_aliases[i] = NULL;
+
+ return (NET_R_OK);
+}
+#endif /* !NETENT_DATA */
+#else /* NET_R_RETURN */
+ static int getnetent_r_unknown_system = 0;
+#endif /* NET_R_RETURN */
+#endif /* !defined(_REENTRANT) || !defined(DO_PTHREADS) */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getnetgrent.c b/usr/src/lib/libresolv2_joy/common/irs/getnetgrent.c
new file mode 100644
index 0000000000..40b3e5a8ad
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getnetgrent.c
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996-1999, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: getnetgrent.c,v 1.6 2008/11/14 02:36:51 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports */
+
+#include "port_before.h"
+
+#if !defined(__BIND_NOSTATIC)
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_data.h"
+
+/* Forward */
+
+static struct net_data *init(void);
+
+
+/* Public */
+
+#ifndef SETNETGRENT_ARGS
+#define SETNETGRENT_ARGS const char *netgroup
+#endif
+void
+setnetgrent(SETNETGRENT_ARGS) {
+ struct net_data *net_data = init();
+
+ setnetgrent_p(netgroup, net_data);
+}
+
+void
+endnetgrent(void) {
+ struct net_data *net_data = init();
+
+ endnetgrent_p(net_data);
+}
+
+#ifndef INNETGR_ARGS
+#define INNETGR_ARGS const char *netgroup, const char *host, \
+ const char *user, const char *domain
+#endif
+int
+innetgr(INNETGR_ARGS) {
+ struct net_data *net_data = init();
+
+ return (innetgr_p(netgroup, host, user, domain, net_data));
+}
+
+int
+getnetgrent(NGR_R_CONST char **host, NGR_R_CONST char **user,
+ NGR_R_CONST char **domain)
+{
+ struct net_data *net_data = init();
+ const char *ch, *cu, *cd;
+ int ret;
+
+ ret = getnetgrent_p(&ch, &cu, &cd, net_data);
+ if (ret != 1)
+ return (ret);
+
+ DE_CONST(ch, *host);
+ DE_CONST(cu, *user);
+ DE_CONST(cd, *domain);
+ return (ret);
+}
+
+/* Shared private. */
+
+void
+setnetgrent_p(const char *netgroup, struct net_data *net_data) {
+ struct irs_ng *ng;
+
+ if ((net_data != NULL) && ((ng = net_data->ng) != NULL))
+ (*ng->rewind)(ng, netgroup);
+}
+
+void
+endnetgrent_p(struct net_data *net_data) {
+ struct irs_ng *ng;
+
+ if (!net_data)
+ return;
+ if ((ng = net_data->ng) != NULL)
+ (*ng->close)(ng);
+ net_data->ng = NULL;
+}
+
+int
+innetgr_p(const char *netgroup, const char *host,
+ const char *user, const char *domain,
+ struct net_data *net_data) {
+ struct irs_ng *ng;
+
+ if (!net_data || !(ng = net_data->ng))
+ return (0);
+ return ((*ng->test)(ng, netgroup, host, user, domain));
+}
+
+int
+getnetgrent_p(const char **host, const char **user, const char **domain,
+ struct net_data *net_data ) {
+ struct irs_ng *ng;
+
+ if (!net_data || !(ng = net_data->ng))
+ return (0);
+ return ((*ng->next)(ng, host, user, domain));
+}
+
+/* Private */
+
+static struct net_data *
+init(void) {
+ struct net_data *net_data;
+
+ if (!(net_data = net_data_init(NULL)))
+ goto error;
+ if (!net_data->ng) {
+ net_data->ng = (*net_data->irs->ng_map)(net_data->irs);
+ if (!net_data->ng) {
+ error:
+ errno = EIO;
+ return (NULL);
+ }
+ }
+
+ return (net_data);
+}
+
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getnetgrent_r.c b/usr/src/lib/libresolv2_joy/common/irs/getnetgrent_r.c
new file mode 100644
index 0000000000..aa8810320d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getnetgrent_r.c
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998, 1999, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: getnetgrent_r.c,v 1.14 2008/11/14 02:36:51 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <port_before.h>
+#if !defined(_REENTRANT) || !defined(DO_PTHREADS)
+ static int getnetgrent_r_not_required = 0;
+#else
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <port_after.h>
+
+#ifdef NGR_R_RETURN
+#ifndef NGR_R_PRIVATE
+#define NGR_R_PRIVATE 0
+#endif
+
+static NGR_R_RETURN
+copy_protoent(NGR_R_CONST char **, NGR_R_CONST char **, NGR_R_CONST char **,
+ const char *, const char *, const char *, NGR_R_COPY_ARGS);
+
+NGR_R_RETURN
+innetgr_r(const char *netgroup, const char *host, const char *user,
+ const char *domain) {
+ char *ng, *ho, *us, *dom;
+
+ DE_CONST(netgroup, ng);
+ DE_CONST(host, ho);
+ DE_CONST(user, us);
+ DE_CONST(domain, dom);
+
+ return (innetgr(ng, ho, us, dom));
+}
+
+/*%
+ * These assume a single context is in operation per thread.
+ * If this is not the case we will need to call irs directly
+ * rather than through the base functions.
+ */
+
+NGR_R_RETURN
+getnetgrent_r(NGR_R_CONST char **machinep, NGR_R_CONST char **userp,
+ NGR_R_CONST char **domainp, NGR_R_ARGS)
+{
+ NGR_R_CONST char *mp, *up, *dp;
+ int res = getnetgrent(&mp, &up, &dp);
+
+ if (res != 1)
+ return (res);
+
+ return (copy_protoent(machinep, userp, domainp,
+ mp, up, dp, NGR_R_COPY));
+}
+
+#if NGR_R_PRIVATE == 2
+struct private {
+ char *buf;
+};
+
+#endif
+NGR_R_SET_RETURN
+#ifdef NGR_R_SET_ARGS
+setnetgrent_r(NGR_R_SET_CONST char *netgroup, NGR_R_SET_ARGS)
+#else
+setnetgrent_r(NGR_R_SET_CONST char *netgroup)
+#endif
+{
+#if NGR_R_PRIVATE == 2
+ struct private *p;
+#endif
+ char *tmp;
+#if defined(NGR_R_SET_ARGS) && NGR_R_PRIVATE == 0
+ UNUSED(buf);
+ UNUSED(buflen);
+#endif
+
+ DE_CONST(netgroup, tmp);
+ setnetgrent(tmp);
+
+#if NGR_R_PRIVATE == 1
+ *buf = NULL;
+#elif NGR_R_PRIVATE == 2
+ *buf = p = malloc(sizeof(struct private));
+ if (p == NULL)
+#ifdef NGR_R_SET_RESULT
+ return (NGR_R_BAD);
+#else
+ return;
+#endif
+ p->buf = NULL;
+#endif
+#ifdef NGR_R_SET_RESULT
+ return (NGR_R_SET_RESULT);
+#endif
+}
+
+NGR_R_END_RETURN
+#ifdef NGR_R_END_ARGS
+endnetgrent_r(NGR_R_END_ARGS)
+#else
+endnetgrent_r(void)
+#endif
+{
+#if NGR_R_PRIVATE == 2
+ struct private *p = buf;
+#endif
+#if defined(NGR_R_SET_ARGS) && NGR_R_PRIVATE == 0
+ UNUSED(buf);
+ UNUSED(buflen);
+#endif
+
+ endnetgrent();
+#if NGR_R_PRIVATE == 1
+ if (*buf != NULL)
+ free(*buf);
+ *buf = NULL;
+#elif NGR_R_PRIVATE == 2
+ if (p->buf != NULL)
+ free(p->buf);
+ free(p);
+#endif
+ NGR_R_END_RESULT(NGR_R_OK);
+}
+
+/* Private */
+
+static int
+copy_protoent(NGR_R_CONST char **machinep, NGR_R_CONST char **userp,
+ NGR_R_CONST char **domainp, const char *mp, const char *up,
+ const char *dp, NGR_R_COPY_ARGS)
+{
+#if NGR_R_PRIVATE == 2
+ struct private *p = buf;
+#endif
+ char *cp;
+ int n;
+ int len;
+
+ /* Find out the amount of space required to store the answer. */
+ len = 0;
+ if (mp != NULL) len += strlen(mp) + 1;
+ if (up != NULL) len += strlen(up) + 1;
+ if (dp != NULL) len += strlen(dp) + 1;
+
+#if NGR_R_PRIVATE == 1
+ if (*buf != NULL)
+ free(*buf);
+ *buf = malloc(len);
+ if (*buf == NULL)
+ return(NGR_R_BAD);
+ cp = *buf;
+#elif NGR_R_PRIVATE == 2
+ if (p->buf)
+ free(p->buf);
+ p->buf = malloc(len);
+ if (p->buf == NULL)
+ return(NGR_R_BAD);
+ cp = p->buf;
+#else
+ if (len > (int)buflen) {
+ errno = ERANGE;
+ return (NGR_R_BAD);
+ }
+ cp = buf;
+#endif
+
+ if (mp != NULL) {
+ n = strlen(mp) + 1;
+ strcpy(cp, mp);
+ *machinep = cp;
+ cp += n;
+ } else
+ *machinep = NULL;
+
+ if (up != NULL) {
+ n = strlen(up) + 1;
+ strcpy(cp, up);
+ *userp = cp;
+ cp += n;
+ } else
+ *userp = NULL;
+
+ if (dp != NULL) {
+ n = strlen(dp) + 1;
+ strcpy(cp, dp);
+ *domainp = cp;
+ cp += n;
+ } else
+ *domainp = NULL;
+
+ return (NGR_R_OK);
+}
+#else /* NGR_R_RETURN */
+ static int getnetgrent_r_unknown_system = 0;
+#endif /* NGR_R_RETURN */
+#endif /* !defined(_REENTRANT) || !defined(DO_PTHREADS) */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getprotoent.c b/usr/src/lib/libresolv2_joy/common/irs/getprotoent.c
new file mode 100644
index 0000000000..32a1040916
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getprotoent.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: getprotoent.c,v 1.4 2005/04/27 04:56:26 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#if !defined(__BIND_NOSTATIC)
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_data.h"
+
+/* Forward */
+
+static struct net_data *init(void);
+
+/* Public */
+
+struct protoent *
+getprotoent() {
+ struct net_data *net_data = init();
+
+ return (getprotoent_p(net_data));
+}
+
+struct protoent *
+getprotobyname(const char *name) {
+ struct net_data *net_data = init();
+
+ return (getprotobyname_p(name, net_data));
+}
+
+struct protoent *
+getprotobynumber(int proto) {
+ struct net_data *net_data = init();
+
+ return (getprotobynumber_p(proto, net_data));
+}
+
+void
+setprotoent(int stayopen) {
+ struct net_data *net_data = init();
+
+ setprotoent_p(stayopen, net_data);
+}
+
+void
+endprotoent() {
+ struct net_data *net_data = init();
+
+ endprotoent_p(net_data);
+}
+
+/* Shared private. */
+
+struct protoent *
+getprotoent_p(struct net_data *net_data) {
+ struct irs_pr *pr;
+
+ if (!net_data || !(pr = net_data->pr))
+ return (NULL);
+ net_data->pr_last = (*pr->next)(pr);
+ return (net_data->pr_last);
+}
+
+struct protoent *
+getprotobyname_p(const char *name, struct net_data *net_data) {
+ struct irs_pr *pr;
+ char **pap;
+
+ if (!net_data || !(pr = net_data->pr))
+ return (NULL);
+ if (net_data->pr_stayopen && net_data->pr_last) {
+ if (!strcmp(net_data->pr_last->p_name, name))
+ return (net_data->pr_last);
+ for (pap = net_data->pr_last->p_aliases; pap && *pap; pap++)
+ if (!strcmp(name, *pap))
+ return (net_data->pr_last);
+ }
+ net_data->pr_last = (*pr->byname)(pr, name);
+ if (!net_data->pr_stayopen)
+ endprotoent();
+ return (net_data->pr_last);
+}
+
+struct protoent *
+getprotobynumber_p(int proto, struct net_data *net_data) {
+ struct irs_pr *pr;
+
+ if (!net_data || !(pr = net_data->pr))
+ return (NULL);
+ if (net_data->pr_stayopen && net_data->pr_last)
+ if (net_data->pr_last->p_proto == proto)
+ return (net_data->pr_last);
+ net_data->pr_last = (*pr->bynumber)(pr, proto);
+ if (!net_data->pr_stayopen)
+ endprotoent();
+ return (net_data->pr_last);
+}
+
+void
+setprotoent_p(int stayopen, struct net_data *net_data) {
+ struct irs_pr *pr;
+
+ if (!net_data || !(pr = net_data->pr))
+ return;
+ (*pr->rewind)(pr);
+ net_data->pr_stayopen = (stayopen != 0);
+ if (stayopen == 0)
+ net_data_minimize(net_data);
+}
+
+void
+endprotoent_p(struct net_data *net_data) {
+ struct irs_pr *pr;
+
+ if ((net_data != NULL) && ((pr = net_data->pr) != NULL))
+ (*pr->minimize)(pr);
+}
+
+/* Private */
+
+static struct net_data *
+init() {
+ struct net_data *net_data;
+
+ if (!(net_data = net_data_init(NULL)))
+ goto error;
+ if (!net_data->pr) {
+ net_data->pr = (*net_data->irs->pr_map)(net_data->irs);
+
+ if (!net_data->pr || !net_data->res) {
+ error:
+ errno = EIO;
+ return (NULL);
+ }
+ (*net_data->pr->res_set)(net_data->pr, net_data->res, NULL);
+ }
+
+ return (net_data);
+}
+
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getprotoent_r.c b/usr/src/lib/libresolv2_joy/common/irs/getprotoent_r.c
new file mode 100644
index 0000000000..d5d9ae53b6
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getprotoent_r.c
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: getprotoent_r.c,v 1.6 2006/08/01 01:14:16 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <port_before.h>
+#if !defined(_REENTRANT) || !defined(DO_PTHREADS)
+ static int getprotoent_r_not_required = 0;
+#else
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <port_after.h>
+
+#ifdef PROTO_R_RETURN
+
+static PROTO_R_RETURN
+copy_protoent(struct protoent *, struct protoent *, PROTO_R_COPY_ARGS);
+
+PROTO_R_RETURN
+getprotobyname_r(const char *name, struct protoent *pptr, PROTO_R_ARGS) {
+ struct protoent *pe = getprotobyname(name);
+#ifdef PROTO_R_SETANSWER
+ int n = 0;
+
+ if (pe == NULL || (n = copy_protoent(pe, pptr, PROTO_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = pptr;
+
+ return (n);
+#else
+ if (pe == NULL)
+ return (PROTO_R_BAD);
+
+ return (copy_protoent(pe, pptr, PROTO_R_COPY));
+#endif
+}
+
+PROTO_R_RETURN
+getprotobynumber_r(int proto, struct protoent *pptr, PROTO_R_ARGS) {
+ struct protoent *pe = getprotobynumber(proto);
+#ifdef PROTO_R_SETANSWER
+ int n = 0;
+
+ if (pe == NULL || (n = copy_protoent(pe, pptr, PROTO_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = pptr;
+
+ return (n);
+#else
+ if (pe == NULL)
+ return (PROTO_R_BAD);
+
+ return (copy_protoent(pe, pptr, PROTO_R_COPY));
+#endif
+}
+
+/*%
+ * These assume a single context is in operation per thread.
+ * If this is not the case we will need to call irs directly
+ * rather than through the base functions.
+ */
+
+PROTO_R_RETURN
+getprotoent_r(struct protoent *pptr, PROTO_R_ARGS) {
+ struct protoent *pe = getprotoent();
+#ifdef PROTO_R_SETANSWER
+ int n = 0;
+
+ if (pe == NULL || (n = copy_protoent(pe, pptr, PROTO_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = pptr;
+
+ return (n);
+#else
+ if (pe == NULL)
+ return (PROTO_R_BAD);
+
+ return (copy_protoent(pe, pptr, PROTO_R_COPY));
+#endif
+}
+
+PROTO_R_SET_RETURN
+#ifdef PROTO_R_ENT_ARGS
+setprotoent_r(int stay_open, PROTO_R_ENT_ARGS)
+#else
+setprotoent_r(int stay_open)
+#endif
+{
+#ifdef PROTO_R_ENT_UNUSED
+ PROTO_R_ENT_UNUSED;
+#endif
+ setprotoent(stay_open);
+#ifdef PROTO_R_SET_RESULT
+ return (PROTO_R_SET_RESULT);
+#endif
+}
+
+PROTO_R_END_RETURN
+#ifdef PROTO_R_ENT_ARGS
+endprotoent_r(PROTO_R_ENT_ARGS)
+#else
+endprotoent_r()
+#endif
+{
+#ifdef PROTO_R_ENT_UNUSED
+ PROTO_R_ENT_UNUSED;
+#endif
+ endprotoent();
+ PROTO_R_END_RESULT(PROTO_R_OK);
+}
+
+/* Private */
+
+#ifndef PROTOENT_DATA
+static PROTO_R_RETURN
+copy_protoent(struct protoent *pe, struct protoent *pptr, PROTO_R_COPY_ARGS) {
+ char *cp;
+ int i, n;
+ int numptr, len;
+
+ /* Find out the amount of space required to store the answer. */
+ numptr = 1; /*%< NULL ptr */
+ len = (char *)ALIGN(buf) - buf;
+ for (i = 0; pe->p_aliases[i]; i++, numptr++) {
+ len += strlen(pe->p_aliases[i]) + 1;
+ }
+ len += strlen(pe->p_name) + 1;
+ len += numptr * sizeof(char*);
+
+ if (len > (int)buflen) {
+ errno = ERANGE;
+ return (PROTO_R_BAD);
+ }
+
+ /* copy protocol value*/
+ pptr->p_proto = pe->p_proto;
+
+ cp = (char *)ALIGN(buf) + numptr * sizeof(char *);
+
+ /* copy official name */
+ n = strlen(pe->p_name) + 1;
+ strcpy(cp, pe->p_name);
+ pptr->p_name = cp;
+ cp += n;
+
+ /* copy aliases */
+ pptr->p_aliases = (char **)ALIGN(buf);
+ for (i = 0 ; pe->p_aliases[i]; i++) {
+ n = strlen(pe->p_aliases[i]) + 1;
+ strcpy(cp, pe->p_aliases[i]);
+ pptr->p_aliases[i] = cp;
+ cp += n;
+ }
+ pptr->p_aliases[i] = NULL;
+
+ return (PROTO_R_OK);
+}
+#else /* !PROTOENT_DATA */
+static int
+copy_protoent(struct protoent *pe, struct protoent *pptr, PROTO_R_COPY_ARGS) {
+ char *cp, *eob;
+ int i, n;
+
+ /* copy protocol value */
+ pptr->p_proto = pe->p_proto;
+
+ /* copy official name */
+ cp = pdptr->line;
+ eob = pdptr->line + sizeof(pdptr->line);
+ if ((n = strlen(pe->p_name) + 1) < (eob - cp)) {
+ strcpy(cp, pe->p_name);
+ pptr->p_name = cp;
+ cp += n;
+ } else {
+ return (-1);
+ }
+
+ /* copy aliases */
+ i = 0;
+ pptr->p_aliases = pdptr->proto_aliases;
+ while (pe->p_aliases[i] && i < (_MAXALIASES-1)) {
+ if ((n = strlen(pe->p_aliases[i]) + 1) < (eob - cp)) {
+ strcpy(cp, pe->p_aliases[i]);
+ pptr->p_aliases[i] = cp;
+ cp += n;
+ } else {
+ break;
+ }
+ i++;
+ }
+ pptr->p_aliases[i] = NULL;
+
+ return (PROTO_R_OK);
+}
+#endif /* PROTOENT_DATA */
+#else /* PROTO_R_RETURN */
+ static int getprotoent_r_unknown_system = 0;
+#endif /* PROTO_R_RETURN */
+#endif /* !defined(_REENTRANT) || !defined(DO_PTHREADS) */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getservent.c b/usr/src/lib/libresolv2_joy/common/irs/getservent.c
new file mode 100644
index 0000000000..31af67e659
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getservent.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: getservent.c,v 1.4 2005/04/27 04:56:26 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#if !defined(__BIND_NOSTATIC)
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_data.h"
+
+/* Forward */
+
+static struct net_data *init(void);
+
+/* Public */
+
+struct servent *
+getservent(void) {
+ struct net_data *net_data = init();
+
+ return (getservent_p(net_data));
+}
+
+struct servent *
+getservbyname(const char *name, const char *proto) {
+ struct net_data *net_data = init();
+
+ return (getservbyname_p(name, proto, net_data));
+}
+
+struct servent *
+getservbyport(int port, const char *proto) {
+ struct net_data *net_data = init();
+
+ return (getservbyport_p(port, proto, net_data));
+}
+
+void
+setservent(int stayopen) {
+ struct net_data *net_data = init();
+
+ setservent_p(stayopen, net_data);
+}
+
+void
+endservent() {
+ struct net_data *net_data = init();
+
+ endservent_p(net_data);
+}
+
+/* Shared private. */
+
+struct servent *
+getservent_p(struct net_data *net_data) {
+ struct irs_sv *sv;
+
+ if (!net_data || !(sv = net_data->sv))
+ return (NULL);
+ net_data->sv_last = (*sv->next)(sv);
+ return (net_data->sv_last);
+}
+
+struct servent *
+getservbyname_p(const char *name, const char *proto,
+ struct net_data *net_data) {
+ struct irs_sv *sv;
+ char **sap;
+
+ if (!net_data || !(sv = net_data->sv))
+ return (NULL);
+ if (net_data->sv_stayopen && net_data->sv_last)
+ if (!proto || !strcmp(net_data->sv_last->s_proto, proto)) {
+ if (!strcmp(net_data->sv_last->s_name, name))
+ return (net_data->sv_last);
+ for (sap = net_data->sv_last->s_aliases;
+ sap && *sap; sap++)
+ if (!strcmp(name, *sap))
+ return (net_data->sv_last);
+ }
+ net_data->sv_last = (*sv->byname)(sv, name, proto);
+ if (!net_data->sv_stayopen)
+ endservent();
+ return (net_data->sv_last);
+}
+
+struct servent *
+getservbyport_p(int port, const char *proto, struct net_data *net_data) {
+ struct irs_sv *sv;
+
+ if (!net_data || !(sv = net_data->sv))
+ return (NULL);
+ if (net_data->sv_stayopen && net_data->sv_last)
+ if (port == net_data->sv_last->s_port &&
+ ( !proto ||
+ !strcmp(net_data->sv_last->s_proto, proto)))
+ return (net_data->sv_last);
+ net_data->sv_last = (*sv->byport)(sv, port, proto);
+ return (net_data->sv_last);
+}
+
+void
+setservent_p(int stayopen, struct net_data *net_data) {
+ struct irs_sv *sv;
+
+ if (!net_data || !(sv = net_data->sv))
+ return;
+ (*sv->rewind)(sv);
+ net_data->sv_stayopen = (stayopen != 0);
+ if (stayopen == 0)
+ net_data_minimize(net_data);
+}
+
+void
+endservent_p(struct net_data *net_data) {
+ struct irs_sv *sv;
+
+ if ((net_data != NULL) && ((sv = net_data->sv) != NULL))
+ (*sv->minimize)(sv);
+}
+
+/* Private */
+
+static struct net_data *
+init() {
+ struct net_data *net_data;
+
+ if (!(net_data = net_data_init(NULL)))
+ goto error;
+ if (!net_data->sv) {
+ net_data->sv = (*net_data->irs->sv_map)(net_data->irs);
+
+ if (!net_data->sv || !net_data->res) {
+ error:
+ errno = EIO;
+ return (NULL);
+ }
+ (*net_data->sv->res_set)(net_data->sv, net_data->res, NULL);
+ }
+
+ return (net_data);
+}
+
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/getservent_r.c b/usr/src/lib/libresolv2_joy/common/irs/getservent_r.c
new file mode 100644
index 0000000000..42d1e46163
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/getservent_r.c
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: getservent_r.c,v 1.6 2006/08/01 01:14:16 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <port_before.h>
+#if !defined(_REENTRANT) || !defined(DO_PTHREADS)
+ static int getservent_r_not_required = 0;
+#else
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <sys/param.h>
+#include <port_after.h>
+
+#ifdef SERV_R_RETURN
+
+static SERV_R_RETURN
+copy_servent(struct servent *, struct servent *, SERV_R_COPY_ARGS);
+
+SERV_R_RETURN
+getservbyname_r(const char *name, const char *proto,
+ struct servent *sptr, SERV_R_ARGS) {
+ struct servent *se = getservbyname(name, proto);
+#ifdef SERV_R_SETANSWER
+ int n = 0;
+
+ if (se == NULL || (n = copy_servent(se, sptr, SERV_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = sptr;
+
+ return (n);
+#else
+ if (se == NULL)
+ return (SERV_R_BAD);
+
+ return (copy_servent(se, sptr, SERV_R_COPY));
+#endif
+}
+
+SERV_R_RETURN
+getservbyport_r(int port, const char *proto,
+ struct servent *sptr, SERV_R_ARGS) {
+ struct servent *se = getservbyport(port, proto);
+#ifdef SERV_R_SETANSWER
+ int n = 0;
+
+ if (se == NULL || (n = copy_servent(se, sptr, SERV_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = sptr;
+
+ return (n);
+#else
+ if (se == NULL)
+ return (SERV_R_BAD);
+
+ return (copy_servent(se, sptr, SERV_R_COPY));
+#endif
+}
+
+/*%
+ * These assume a single context is in operation per thread.
+ * If this is not the case we will need to call irs directly
+ * rather than through the base functions.
+ */
+
+SERV_R_RETURN
+getservent_r(struct servent *sptr, SERV_R_ARGS) {
+ struct servent *se = getservent();
+#ifdef SERV_R_SETANSWER
+ int n = 0;
+
+ if (se == NULL || (n = copy_servent(se, sptr, SERV_R_COPY)) != 0)
+ *answerp = NULL;
+ else
+ *answerp = sptr;
+
+ return (n);
+#else
+ if (se == NULL)
+ return (SERV_R_BAD);
+
+ return (copy_servent(se, sptr, SERV_R_COPY));
+#endif
+}
+
+SERV_R_SET_RETURN
+#ifdef SERV_R_ENT_ARGS
+setservent_r(int stay_open, SERV_R_ENT_ARGS)
+#else
+setservent_r(int stay_open)
+#endif
+{
+#ifdef SERV_R_ENT_UNUSED
+ SERV_R_ENT_UNUSED;
+#endif
+ setservent(stay_open);
+#ifdef SERV_R_SET_RESULT
+ return (SERV_R_SET_RESULT);
+#endif
+}
+
+SERV_R_END_RETURN
+#ifdef SERV_R_ENT_ARGS
+endservent_r(SERV_R_ENT_ARGS)
+#else
+endservent_r()
+#endif
+{
+#ifdef SERV_R_ENT_UNUSED
+ SERV_R_ENT_UNUSED;
+#endif
+ endservent();
+ SERV_R_END_RESULT(SERV_R_OK);
+}
+
+/* Private */
+
+#ifndef SERVENT_DATA
+static SERV_R_RETURN
+copy_servent(struct servent *se, struct servent *sptr, SERV_R_COPY_ARGS) {
+ char *cp;
+ int i, n;
+ int numptr, len;
+
+ /* Find out the amount of space required to store the answer. */
+ numptr = 1; /*%< NULL ptr */
+ len = (char *)ALIGN(buf) - buf;
+ for (i = 0; se->s_aliases[i]; i++, numptr++) {
+ len += strlen(se->s_aliases[i]) + 1;
+ }
+ len += strlen(se->s_name) + 1;
+ len += strlen(se->s_proto) + 1;
+ len += numptr * sizeof(char*);
+
+ if (len > (int)buflen) {
+ errno = ERANGE;
+ return (SERV_R_BAD);
+ }
+
+ /* copy port value */
+ sptr->s_port = se->s_port;
+
+ cp = (char *)ALIGN(buf) + numptr * sizeof(char *);
+
+ /* copy official name */
+ n = strlen(se->s_name) + 1;
+ strcpy(cp, se->s_name);
+ sptr->s_name = cp;
+ cp += n;
+
+ /* copy aliases */
+ sptr->s_aliases = (char **)ALIGN(buf);
+ for (i = 0 ; se->s_aliases[i]; i++) {
+ n = strlen(se->s_aliases[i]) + 1;
+ strcpy(cp, se->s_aliases[i]);
+ sptr->s_aliases[i] = cp;
+ cp += n;
+ }
+ sptr->s_aliases[i] = NULL;
+
+ /* copy proto */
+ n = strlen(se->s_proto) + 1;
+ strcpy(cp, se->s_proto);
+ sptr->s_proto = cp;
+ cp += n;
+
+ return (SERV_R_OK);
+}
+#else /* !SERVENT_DATA */
+static int
+copy_servent(struct servent *se, struct servent *sptr, SERV_R_COPY_ARGS) {
+ char *cp, *eob;
+ int i, n;
+
+ /* copy port value */
+ sptr->s_port = se->s_port;
+
+ /* copy official name */
+ cp = sdptr->line;
+ eob = sdptr->line + sizeof(sdptr->line);
+ if ((n = strlen(se->s_name) + 1) < (eob - cp)) {
+ strcpy(cp, se->s_name);
+ sptr->s_name = cp;
+ cp += n;
+ } else {
+ return (-1);
+ }
+
+ /* copy aliases */
+ i = 0;
+ sptr->s_aliases = sdptr->serv_aliases;
+ while (se->s_aliases[i] && i < (_MAXALIASES-1)) {
+ if ((n = strlen(se->s_aliases[i]) + 1) < (eob - cp)) {
+ strcpy(cp, se->s_aliases[i]);
+ sptr->s_aliases[i] = cp;
+ cp += n;
+ } else {
+ break;
+ }
+ i++;
+ }
+ sptr->s_aliases[i] = NULL;
+
+ /* copy proto */
+ if ((n = strlen(se->s_proto) + 1) < (eob - cp)) {
+ strcpy(cp, se->s_proto);
+ sptr->s_proto = cp;
+ cp += n;
+ } else {
+ return (-1);
+ }
+
+ return (SERV_R_OK);
+}
+#endif /* !SERVENT_DATA */
+#else /*SERV_R_RETURN */
+ static int getservent_r_unknown_system = 0;
+#endif /*SERV_R_RETURN */
+#endif /* !defined(_REENTRANT) || !defined(DO_PTHREADS) */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/hesiod.c b/usr/src/lib/libresolv2_joy/common/irs/hesiod.c
new file mode 100644
index 0000000000..7641bf80ac
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/hesiod.c
@@ -0,0 +1,505 @@
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: hesiod.c,v 1.7 2005/07/28 06:51:48 marka Exp $";
+#endif
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/*! \file
+ * \brief
+ * hesiod.c --- the core portion of the hesiod resolver.
+ *
+ * This file is derived from the hesiod library from Project Athena;
+ * It has been extensively rewritten by Theodore Ts'o to have a more
+ * thread-safe interface.
+ * \author
+ * This file is primarily maintained by &lt;tytso@mit.edu&gt; and &lt;ghudson@mit.edu&gt;.
+ */
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "port_after.h"
+
+#include "pathnames.h"
+#include "hesiod.h"
+#include "hesiod_p.h"
+
+/* Forward */
+
+int hesiod_init(void **context);
+void hesiod_end(void *context);
+char * hesiod_to_bind(void *context, const char *name,
+ const char *type);
+char ** hesiod_resolve(void *context, const char *name,
+ const char *type);
+void hesiod_free_list(void *context, char **list);
+
+static int parse_config_file(struct hesiod_p *ctx, const char *filename);
+static char ** get_txt_records(struct hesiod_p *ctx, int class,
+ const char *name);
+static int init(struct hesiod_p *ctx);
+
+/* Public */
+
+/*%
+ * This function is called to initialize a hesiod_p.
+ */
+int
+hesiod_init(void **context) {
+ struct hesiod_p *ctx;
+ char *cp;
+
+ ctx = malloc(sizeof(struct hesiod_p));
+ if (ctx == 0) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ memset(ctx, 0, sizeof (*ctx));
+
+ if (parse_config_file(ctx, _PATH_HESIOD_CONF) < 0) {
+#ifdef DEF_RHS
+ /*
+ * Use compiled in defaults.
+ */
+ ctx->LHS = malloc(strlen(DEF_LHS) + 1);
+ ctx->RHS = malloc(strlen(DEF_RHS) + 1);
+ if (ctx->LHS == NULL || ctx->RHS == NULL) {
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ strcpy(ctx->LHS, DEF_LHS); /* (checked) */
+ strcpy(ctx->RHS, DEF_RHS); /* (checked) */
+#else
+ goto cleanup;
+#endif
+ }
+ /*
+ * The default RHS can be overridden by an environment
+ * variable.
+ */
+ if ((cp = getenv("HES_DOMAIN")) != NULL) {
+ size_t RHSlen = strlen(cp) + 2;
+ if (ctx->RHS)
+ free(ctx->RHS);
+ ctx->RHS = malloc(RHSlen);
+ if (!ctx->RHS) {
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ if (cp[0] == '.') {
+ strcpy(ctx->RHS, cp); /* (checked) */
+ } else {
+ strcpy(ctx->RHS, "."); /* (checked) */
+ strcat(ctx->RHS, cp); /* (checked) */
+ }
+ }
+
+ /*
+ * If there is no default hesiod realm set, we return an
+ * error.
+ */
+ if (!ctx->RHS) {
+ errno = ENOEXEC;
+ goto cleanup;
+ }
+
+#if 0
+ if (res_ninit(ctx->res) < 0)
+ goto cleanup;
+#endif
+
+ *context = ctx;
+ return (0);
+
+ cleanup:
+ hesiod_end(ctx);
+ return (-1);
+}
+
+/*%
+ * This function deallocates the hesiod_p
+ */
+void
+hesiod_end(void *context) {
+ struct hesiod_p *ctx = (struct hesiod_p *) context;
+ int save_errno = errno;
+
+ if (ctx->res)
+ res_nclose(ctx->res);
+ if (ctx->RHS)
+ free(ctx->RHS);
+ if (ctx->LHS)
+ free(ctx->LHS);
+ if (ctx->res && ctx->free_res)
+ (*ctx->free_res)(ctx->res);
+ free(ctx);
+ errno = save_errno;
+}
+
+/*%
+ * This function takes a hesiod (name, type) and returns a DNS
+ * name which is to be resolved.
+ */
+char *
+hesiod_to_bind(void *context, const char *name, const char *type) {
+ struct hesiod_p *ctx = (struct hesiod_p *) context;
+ char *bindname;
+ char **rhs_list = NULL;
+ const char *RHS, *cp;
+
+ /* Decide what our RHS is, and set cp to the end of the actual name. */
+ if ((cp = strchr(name, '@')) != NULL) {
+ if (strchr(cp + 1, '.'))
+ RHS = cp + 1;
+ else if ((rhs_list = hesiod_resolve(context, cp + 1,
+ "rhs-extension")) != NULL)
+ RHS = *rhs_list;
+ else {
+ errno = ENOENT;
+ return (NULL);
+ }
+ } else {
+ RHS = ctx->RHS;
+ cp = name + strlen(name);
+ }
+
+ /*
+ * Allocate the space we need, including up to three periods and
+ * the terminating NUL.
+ */
+ if ((bindname = malloc((cp - name) + strlen(type) + strlen(RHS) +
+ (ctx->LHS ? strlen(ctx->LHS) : 0) + 4)) == NULL) {
+ errno = ENOMEM;
+ if (rhs_list)
+ hesiod_free_list(context, rhs_list);
+ return NULL;
+ }
+
+ /* Now put together the DNS name. */
+ memcpy(bindname, name, cp - name);
+ bindname[cp - name] = '\0';
+ strcat(bindname, ".");
+ strcat(bindname, type);
+ if (ctx->LHS) {
+ if (ctx->LHS[0] != '.')
+ strcat(bindname, ".");
+ strcat(bindname, ctx->LHS);
+ }
+ if (RHS[0] != '.')
+ strcat(bindname, ".");
+ strcat(bindname, RHS);
+
+ if (rhs_list)
+ hesiod_free_list(context, rhs_list);
+
+ return (bindname);
+}
+
+/*%
+ * This is the core function. Given a hesiod (name, type), it
+ * returns an array of strings returned by the resolver.
+ */
+char **
+hesiod_resolve(void *context, const char *name, const char *type) {
+ struct hesiod_p *ctx = (struct hesiod_p *) context;
+ char *bindname = hesiod_to_bind(context, name, type);
+ char **retvec;
+
+ if (bindname == NULL)
+ return (NULL);
+ if (init(ctx) == -1) {
+ free(bindname);
+ return (NULL);
+ }
+
+ if ((retvec = get_txt_records(ctx, C_IN, bindname))) {
+ free(bindname);
+ return (retvec);
+ }
+
+ if (errno != ENOENT)
+ return (NULL);
+
+ retvec = get_txt_records(ctx, C_HS, bindname);
+ free(bindname);
+ return (retvec);
+}
+
+void
+hesiod_free_list(void *context, char **list) {
+ char **p;
+
+ UNUSED(context);
+
+ for (p = list; *p; p++)
+ free(*p);
+ free(list);
+}
+
+/*%
+ * This function parses the /etc/hesiod.conf file
+ */
+static int
+parse_config_file(struct hesiod_p *ctx, const char *filename) {
+ char *key, *data, *cp, **cpp;
+ char buf[MAXDNAME+7];
+ FILE *fp;
+
+ /*
+ * Clear the existing configuration variable, just in case
+ * they're set.
+ */
+ if (ctx->RHS)
+ free(ctx->RHS);
+ if (ctx->LHS)
+ free(ctx->LHS);
+ ctx->RHS = ctx->LHS = 0;
+
+ /*
+ * Now open and parse the file...
+ */
+ if (!(fp = fopen(filename, "r")))
+ return (-1);
+
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ cp = buf;
+ if (*cp == '#' || *cp == '\n' || *cp == '\r')
+ continue;
+ while(*cp == ' ' || *cp == '\t')
+ cp++;
+ key = cp;
+ while(*cp != ' ' && *cp != '\t' && *cp != '=')
+ cp++;
+ *cp++ = '\0';
+
+ while(*cp == ' ' || *cp == '\t' || *cp == '=')
+ cp++;
+ data = cp;
+ while(*cp != ' ' && *cp != '\n' && *cp != '\r')
+ cp++;
+ *cp++ = '\0';
+
+ if (strcmp(key, "lhs") == 0)
+ cpp = &ctx->LHS;
+ else if (strcmp(key, "rhs") == 0)
+ cpp = &ctx->RHS;
+ else
+ continue;
+
+ *cpp = malloc(strlen(data) + 1);
+ if (!*cpp) {
+ errno = ENOMEM;
+ goto cleanup;
+ }
+ strcpy(*cpp, data);
+ }
+ fclose(fp);
+ return (0);
+
+ cleanup:
+ fclose(fp);
+ if (ctx->RHS)
+ free(ctx->RHS);
+ if (ctx->LHS)
+ free(ctx->LHS);
+ ctx->RHS = ctx->LHS = 0;
+ return (-1);
+}
+
+/*%
+ * Given a DNS class and a DNS name, do a lookup for TXT records, and
+ * return a list of them.
+ */
+static char **
+get_txt_records(struct hesiod_p *ctx, int class, const char *name) {
+ struct {
+ int type; /*%< RR type */
+ int class; /*%< RR class */
+ int dlen; /*%< len of data section */
+ u_char *data; /*%< pointer to data */
+ } rr;
+ HEADER *hp;
+ u_char qbuf[MAX_HESRESP], abuf[MAX_HESRESP];
+ u_char *cp, *erdata, *eom;
+ char *dst, *edst, **list;
+ int ancount, qdcount;
+ int i, j, n, skip;
+
+ /*
+ * Construct the query and send it.
+ */
+ n = res_nmkquery(ctx->res, QUERY, name, class, T_TXT, NULL, 0,
+ NULL, qbuf, MAX_HESRESP);
+ if (n < 0) {
+ errno = EMSGSIZE;
+ return (NULL);
+ }
+ n = res_nsend(ctx->res, qbuf, n, abuf, MAX_HESRESP);
+ if (n < 0) {
+ errno = ECONNREFUSED;
+ return (NULL);
+ }
+ if (n < HFIXEDSZ) {
+ errno = EMSGSIZE;
+ return (NULL);
+ }
+
+ /*
+ * OK, parse the result.
+ */
+ hp = (HEADER *) abuf;
+ ancount = ntohs(hp->ancount);
+ qdcount = ntohs(hp->qdcount);
+ cp = abuf + sizeof(HEADER);
+ eom = abuf + n;
+
+ /* Skip query, trying to get to the answer section which follows. */
+ for (i = 0; i < qdcount; i++) {
+ skip = dn_skipname(cp, eom);
+ if (skip < 0 || cp + skip + QFIXEDSZ > eom) {
+ errno = EMSGSIZE;
+ return (NULL);
+ }
+ cp += skip + QFIXEDSZ;
+ }
+
+ list = malloc((ancount + 1) * sizeof(char *));
+ if (!list) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ j = 0;
+ for (i = 0; i < ancount; i++) {
+ skip = dn_skipname(cp, eom);
+ if (skip < 0) {
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ cp += skip;
+ if (cp + 3 * INT16SZ + INT32SZ > eom) {
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ rr.type = ns_get16(cp);
+ cp += INT16SZ;
+ rr.class = ns_get16(cp);
+ cp += INT16SZ + INT32SZ; /*%< skip the ttl, too */
+ rr.dlen = ns_get16(cp);
+ cp += INT16SZ;
+ if (cp + rr.dlen > eom) {
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ rr.data = cp;
+ cp += rr.dlen;
+ if (rr.class != class || rr.type != T_TXT)
+ continue;
+ if (!(list[j] = malloc(rr.dlen)))
+ goto cleanup;
+ dst = list[j++];
+ edst = dst + rr.dlen;
+ erdata = rr.data + rr.dlen;
+ cp = rr.data;
+ while (cp < erdata) {
+ n = (unsigned char) *cp++;
+ if (cp + n > eom || dst + n > edst) {
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ memcpy(dst, cp, n);
+ cp += n;
+ dst += n;
+ }
+ if (cp != erdata) {
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ *dst = '\0';
+ }
+ list[j] = NULL;
+ if (j == 0) {
+ errno = ENOENT;
+ goto cleanup;
+ }
+ return (list);
+
+ cleanup:
+ for (i = 0; i < j; i++)
+ free(list[i]);
+ free(list);
+ return (NULL);
+}
+
+struct __res_state *
+__hesiod_res_get(void *context) {
+ struct hesiod_p *ctx = context;
+
+ if (!ctx->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (res == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ __hesiod_res_set(ctx, res, free);
+ }
+
+ return (ctx->res);
+}
+
+void
+__hesiod_res_set(void *context, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct hesiod_p *ctx = context;
+
+ if (ctx->res && ctx->free_res) {
+ res_nclose(ctx->res);
+ (*ctx->free_res)(ctx->res);
+ }
+
+ ctx->res = res;
+ ctx->free_res = free_res;
+}
+
+static int
+init(struct hesiod_p *ctx) {
+
+ if (!ctx->res && !__hesiod_res_get(ctx))
+ return (-1);
+
+ if (((ctx->res->options & RES_INIT) == 0U) &&
+ (res_ninit(ctx->res) == -1))
+ return (-1);
+
+ return (0);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/irs/hesiod_p.h b/usr/src/lib/libresolv2_joy/common/irs/hesiod_p.h
new file mode 100644
index 0000000000..99da15d0cd
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/hesiod_p.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: hesiod_p.h,v 1.3 2005/04/27 04:56:27 sra Exp $
+ */
+
+#ifndef _HESIOD_P_H_INCLUDED
+#define _HESIOD_P_H_INCLUDED
+
+/** \file
+ * \brief
+ * hesiod_p.h -- private definitions for the hesiod library.
+ *
+ * \author
+ * This file is primarily maintained by tytso@mit.edu and ghudson@mit.edu.
+ */
+
+#define DEF_RHS ".Athena.MIT.EDU" /*%< Defaults if HESIOD_CONF */
+#define DEF_LHS ".ns" /*%< file is not */
+ /*%< present. */
+struct hesiod_p {
+ char * LHS; /*%< normally ".ns" */
+ char * RHS; /*%< AKA the default hesiod domain */
+ struct __res_state * res; /*%< resolver context */
+ void (*free_res)(void *);
+ void (*res_set)(struct hesiod_p *, struct __res_state *,
+ void (*)(void *));
+ struct __res_state * (*res_get)(struct hesiod_p *);
+};
+
+#define MAX_HESRESP 1024
+
+#endif /*_HESIOD_P_H_INCLUDED*/
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp.c b/usr/src/lib/libresolv2_joy/common/irs/irp.c
new file mode 100644
index 0000000000..ef10631c22
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp.c
@@ -0,0 +1,583 @@
+/*
+ * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996, 1998-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: irp.c,v 1.12 2008/11/14 02:36:51 marka Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <syslog.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#include <isc/memcluster.h>
+
+#include <irs.h>
+#include <irp.h>
+
+#include "irs_p.h"
+#include "irp_p.h"
+
+#include "port_after.h"
+
+/* Forward. */
+
+static void irp_close(struct irs_acc *);
+
+#define LINEINCR 128
+
+#if !defined(SUN_LEN)
+#define SUN_LEN(su) \
+ (sizeof (*(su)) - sizeof ((su)->sun_path) + strlen((su)->sun_path))
+#endif
+
+
+/* Public */
+
+
+/* send errors to syslog if true. */
+int irp_log_errors = 1;
+
+/*%
+ * This module handles the irp module connection to irpd.
+ *
+ * The client expects a synchronous interface to functions like
+ * getpwnam(3), so we can't use the ctl_* i/o library on this end of
+ * the wire (it's used in the server).
+ */
+
+/*%
+ * irs_acc *irs_irp_acc(const char *options);
+ *
+ * Initialize the irp module.
+ */
+struct irs_acc *
+irs_irp_acc(const char *options) {
+ struct irs_acc *acc;
+ struct irp_p *irp;
+
+ UNUSED(options);
+
+ if (!(acc = memget(sizeof *acc))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(acc, 0x5e, sizeof *acc);
+ if (!(irp = memget(sizeof *irp))) {
+ errno = ENOMEM;
+ free(acc);
+ return (NULL);
+ }
+ irp->inlast = 0;
+ irp->incurr = 0;
+ irp->fdCxn = -1;
+ acc->private = irp;
+
+#ifdef WANT_IRS_GR
+ acc->gr_map = irs_irp_gr;
+#else
+ acc->gr_map = NULL;
+#endif
+#ifdef WANT_IRS_PW
+ acc->pw_map = irs_irp_pw;
+#else
+ acc->pw_map = NULL;
+#endif
+ acc->sv_map = irs_irp_sv;
+ acc->pr_map = irs_irp_pr;
+ acc->ho_map = irs_irp_ho;
+ acc->nw_map = irs_irp_nw;
+ acc->ng_map = irs_irp_ng;
+ acc->close = irp_close;
+ return (acc);
+}
+
+
+int
+irs_irp_connection_setup(struct irp_p *cxndata, int *warned) {
+ if (irs_irp_is_connected(cxndata)) {
+ return (0);
+ } else if (irs_irp_connect(cxndata) != 0) {
+ if (warned != NULL && !*warned) {
+ syslog(LOG_ERR, "irpd connection failed: %m\n");
+ (*warned)++;
+ }
+
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*%
+ * int irs_irp_connect(void);
+ *
+ * Sets up the connection to the remote irpd server.
+ *
+ * Returns:
+ *
+ * 0 on success, -1 on failure.
+ *
+ */
+int
+irs_irp_connect(struct irp_p *pvt) {
+ int flags;
+ struct sockaddr *addr;
+ struct sockaddr_in iaddr;
+#ifndef NO_SOCKADDR_UN
+ struct sockaddr_un uaddr;
+#endif
+ long ipaddr;
+ const char *irphost;
+ int code;
+ char text[256];
+ int socklen = 0;
+
+ if (pvt->fdCxn != -1) {
+ perror("fd != 1");
+ return (-1);
+ }
+
+#ifndef NO_SOCKADDR_UN
+ memset(&uaddr, 0, sizeof uaddr);
+#endif
+ memset(&iaddr, 0, sizeof iaddr);
+
+ irphost = getenv(IRPD_HOST_ENV);
+ if (irphost == NULL) {
+ irphost = "127.0.0.1";
+ }
+
+#ifndef NO_SOCKADDR_UN
+ if (irphost[0] == '/') {
+ addr = (struct sockaddr *)&uaddr;
+ strncpy(uaddr.sun_path, irphost, sizeof uaddr.sun_path);
+ uaddr.sun_family = AF_UNIX;
+ socklen = SUN_LEN(&uaddr);
+#ifdef HAVE_SA_LEN
+ uaddr.sun_len = socklen;
+#endif
+ } else
+#endif
+ {
+ if (inet_pton(AF_INET, irphost, &ipaddr) != 1) {
+ errno = EADDRNOTAVAIL;
+ perror("inet_pton");
+ return (-1);
+ }
+
+ addr = (struct sockaddr *)&iaddr;
+ socklen = sizeof iaddr;
+#ifdef HAVE_SA_LEN
+ iaddr.sin_len = socklen;
+#endif
+ iaddr.sin_family = AF_INET;
+ iaddr.sin_port = htons(IRPD_PORT);
+ iaddr.sin_addr.s_addr = ipaddr;
+ }
+
+
+ pvt->fdCxn = socket(addr->sa_family, SOCK_STREAM, PF_UNSPEC);
+ if (pvt->fdCxn < 0) {
+ perror("socket");
+ return (-1);
+ }
+
+ if (connect(pvt->fdCxn, addr, socklen) != 0) {
+ perror("connect");
+ return (-1);
+ }
+
+ flags = fcntl(pvt->fdCxn, F_GETFL, 0);
+ if (flags < 0) {
+ close(pvt->fdCxn);
+ perror("close");
+ return (-1);
+ }
+
+#if 0
+ flags |= O_NONBLOCK;
+ if (fcntl(pvt->fdCxn, F_SETFL, flags) < 0) {
+ close(pvt->fdCxn);
+ perror("fcntl");
+ return (-1);
+ }
+#endif
+
+ code = irs_irp_read_response(pvt, text, sizeof text);
+ if (code != IRPD_WELCOME_CODE) {
+ if (irp_log_errors) {
+ syslog(LOG_WARNING, "Connection failed: %s", text);
+ }
+ irs_irp_disconnect(pvt);
+ return (-1);
+ }
+
+ return (0);
+}
+
+/*%
+ * int irs_irp_is_connected(struct irp_p *pvt);
+ *
+ * Returns:
+ *
+ * Non-zero if streams are setup to remote.
+ *
+ */
+
+int
+irs_irp_is_connected(struct irp_p *pvt) {
+ return (pvt->fdCxn >= 0);
+}
+
+/*%
+ * void
+ * irs_irp_disconnect(struct irp_p *pvt);
+ *
+ * Closes streams to remote.
+ */
+
+void
+irs_irp_disconnect(struct irp_p *pvt) {
+ if (pvt->fdCxn != -1) {
+ close(pvt->fdCxn);
+ pvt->fdCxn = -1;
+ }
+}
+
+
+
+int
+irs_irp_read_line(struct irp_p *pvt, char *buffer, int len) {
+ char *realstart = &pvt->inbuffer[0];
+ char *p, *start, *end;
+ int spare;
+ int i;
+ int buffpos = 0;
+ int left = len - 1;
+
+ while (left > 0) {
+ start = p = &pvt->inbuffer[pvt->incurr];
+ end = &pvt->inbuffer[pvt->inlast];
+
+ while (p != end && *p != '\n')
+ p++;
+
+ if (p == end) {
+ /* Found no newline so shift data down if necessary
+ * and append new data to buffer
+ */
+ if (start > realstart) {
+ memmove(realstart, start, end - start);
+ pvt->inlast = end - start;
+ start = realstart;
+ pvt->incurr = 0;
+ end = &pvt->inbuffer[pvt->inlast];
+ }
+
+ spare = sizeof (pvt->inbuffer) - pvt->inlast;
+
+ p = end;
+ i = read(pvt->fdCxn, end, spare);
+ if (i < 0) {
+ close(pvt->fdCxn);
+ pvt->fdCxn = -1;
+ return (buffpos > 0 ? buffpos : -1);
+ } else if (i == 0) {
+ return (buffpos);
+ }
+
+ end += i;
+ pvt->inlast += i;
+
+ while (p != end && *p != '\n')
+ p++;
+ }
+
+ if (p == end) {
+ /* full buffer and still no newline */
+ i = sizeof pvt->inbuffer;
+ } else {
+ /* include newline */
+ i = p - start + 1;
+ }
+
+ if (i > left)
+ i = left;
+ memcpy(buffer + buffpos, start, i);
+ pvt->incurr += i;
+ buffpos += i;
+ buffer[buffpos] = '\0';
+
+ if (p != end) {
+ left = 0;
+ } else {
+ left -= i;
+ }
+ }
+
+#if 0
+ fprintf(stderr, "read line: %s\n", buffer);
+#endif
+ return (buffpos);
+}
+
+/*%
+ * int irp_read_response(struct irp_p *pvt);
+ *
+ * Returns:
+ *
+ * The number found at the beginning of the line read from
+ * FP. 0 on failure(0 is not a legal response code). The
+ * rest of the line is discarded.
+ *
+ */
+
+int
+irs_irp_read_response(struct irp_p *pvt, char *text, size_t textlen) {
+ char line[1024];
+ int code;
+ char *p;
+
+ if (irs_irp_read_line(pvt, line, sizeof line) <= 0) {
+ return (0);
+ }
+
+ p = strchr(line, '\n');
+ if (p == NULL) {
+ return (0);
+ }
+
+ if (sscanf(line, "%d", &code) != 1) {
+ code = 0;
+ } else if (text != NULL && textlen > 0U) {
+ p = line;
+ while (isspace((unsigned char)*p)) p++;
+ while (isdigit((unsigned char)*p)) p++;
+ while (isspace((unsigned char)*p)) p++;
+ strncpy(text, p, textlen - 1);
+ p[textlen - 1] = '\0';
+ }
+
+ return (code);
+}
+
+/*%
+ * char *irp_read_body(struct irp_p *pvt, size_t *size);
+ *
+ * Read in the body of a response. Terminated by a line with
+ * just a dot on it. Lines should be terminated with a CR-LF
+ * sequence, but we're nt piccky if the CR is missing.
+ * No leading dot escaping is done as the protcol doesn't
+ * use leading dots anywhere.
+ *
+ * Returns:
+ *
+ * Pointer to null-terminated buffer allocated by memget.
+ * *SIZE is set to the length of the buffer.
+ *
+ */
+
+char *
+irs_irp_read_body(struct irp_p *pvt, size_t *size) {
+ char line[1024];
+ u_int linelen;
+ size_t len = LINEINCR;
+ char *buffer = memget(len);
+ int idx = 0;
+
+ if (buffer == NULL)
+ return (NULL);
+
+ for (;;) {
+ if (irs_irp_read_line(pvt, line, sizeof line) <= 0 ||
+ strchr(line, '\n') == NULL)
+ goto death;
+
+ linelen = strlen(line);
+
+ if (line[linelen - 1] != '\n')
+ goto death;
+
+ /* We're not strict about missing \r. Should we be?? */
+ if (linelen > 2 && line[linelen - 2] == '\r') {
+ line[linelen - 2] = '\n';
+ line[linelen - 1] = '\0';
+ linelen--;
+ }
+
+ if (linelen == 2 && line[0] == '.') {
+ *size = len;
+ buffer[idx] = '\0';
+
+ return (buffer);
+ }
+
+ if (linelen > (len - (idx + 1))) {
+ char *p = memget(len + LINEINCR);
+
+ if (p == NULL)
+ goto death;
+ memcpy(p, buffer, len);
+ memput(buffer, len);
+ buffer = p;
+ len += LINEINCR;
+ }
+
+ memcpy(buffer + idx, line, linelen);
+ idx += linelen;
+ }
+ death:
+ memput(buffer, len);
+ return (NULL);
+}
+
+/*%
+ * int irs_irp_get_full_response(struct irp_p *pvt, int *code,
+ * char **body, size_t *bodylen);
+ *
+ * Gets the response to a command. If the response indicates
+ * there's a body to follow(code % 10 == 1), then the
+ * body buffer is allcoated with memget and stored in
+ * *BODY. The length of the allocated body buffer is stored
+ * in *BODY. The caller must give the body buffer back to
+ * memput when done. The results code is stored in *CODE.
+ *
+ * Returns:
+ *
+ * 0 if a result was read. -1 on some sort of failure.
+ *
+ */
+
+int
+irs_irp_get_full_response(struct irp_p *pvt, int *code, char *text,
+ size_t textlen, char **body, size_t *bodylen) {
+ int result = irs_irp_read_response(pvt, text, textlen);
+
+ *body = NULL;
+
+ if (result == 0) {
+ return (-1);
+ }
+
+ *code = result;
+
+ /* Code that matches 2xx is a good result code.
+ * Code that matches xx1 means there's a response body coming.
+ */
+ if ((result / 100) == 2 && (result % 10) == 1) {
+ *body = irs_irp_read_body(pvt, bodylen);
+ if (*body == NULL) {
+ return (-1);
+ }
+ }
+
+ return (0);
+}
+
+/*%
+ * int irs_irp_send_command(struct irp_p *pvt, const char *fmt, ...);
+ *
+ * Sends command to remote connected via the PVT
+ * structure. FMT and args after it are fprintf-like
+ * arguments for formatting.
+ *
+ * Returns:
+ *
+ * 0 on success, -1 on failure.
+ */
+
+int
+irs_irp_send_command(struct irp_p *pvt, const char *fmt, ...) {
+ va_list ap;
+ char buffer[1024];
+ int pos = 0;
+ int i, todo;
+
+
+ if (pvt->fdCxn < 0) {
+ return (-1);
+ }
+
+ va_start(ap, fmt);
+ (void) vsprintf(buffer, fmt, ap);
+ todo = strlen(buffer);
+ va_end(ap);
+ if (todo > (int)sizeof(buffer) - 3) {
+ syslog(LOG_CRIT, "memory overrun in irs_irp_send_command()");
+ exit(1);
+ }
+ strcat(buffer, "\r\n");
+ todo = strlen(buffer);
+
+ while (todo > 0) {
+ i = write(pvt->fdCxn, buffer + pos, todo);
+#if 0
+ /* XXX brister */
+ fprintf(stderr, "Wrote: \"");
+ fwrite(buffer + pos, sizeof (char), todo, stderr);
+ fprintf(stderr, "\"\n");
+#endif
+ if (i < 0) {
+ close(pvt->fdCxn);
+ pvt->fdCxn = -1;
+ return (-1);
+ }
+ todo -= i;
+ }
+
+ return (0);
+}
+
+
+/* Methods */
+
+/*%
+ * void irp_close(struct irs_acc *this)
+ *
+ */
+
+static void
+irp_close(struct irs_acc *this) {
+ struct irp_p *irp = (struct irp_p *)this->private;
+
+ if (irp != NULL) {
+ irs_irp_disconnect(irp);
+ memput(irp, sizeof *irp);
+ }
+
+ memput(this, sizeof *this);
+}
+
+
+
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp_ho.c b/usr/src/lib/libresolv2_joy/common/irs/irp_ho.c
new file mode 100644
index 0000000000..b0de31dc89
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp_ho.c
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996,1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: irp_ho.c,v 1.3 2005/04/27 04:56:28 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports. */
+
+#include "port_before.h"
+
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
+#include <irs.h>
+#include <irp.h>
+#include <isc/irpmarshall.h>
+#include <isc/memcluster.h>
+
+#include "irs_p.h"
+#include "dns_p.h"
+#include "irp_p.h"
+
+#include "port_after.h"
+
+/* Definitions. */
+
+#define MAXALIASES 35
+#define MAXADDRS 35
+#define Max(a,b) ((a) > (b) ? (a) : (b))
+
+
+struct pvt {
+ struct irp_p *girpdata;
+ int warned;
+ struct hostent host;
+};
+
+/* Forward. */
+
+static void ho_close(struct irs_ho *this);
+static struct hostent * ho_byname(struct irs_ho *this, const char *name);
+static struct hostent * ho_byname2(struct irs_ho *this, const char *name,
+ int af);
+static struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
+ int len, int af);
+static struct hostent * ho_next(struct irs_ho *this);
+static void ho_rewind(struct irs_ho *this);
+static void ho_minimize(struct irs_ho *this);
+
+static void free_host(struct hostent *ho);
+static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,
+ const struct addrinfo *pai);
+
+/* Public. */
+
+/*%
+ * struct irs_ho * irs_irp_ho(struct irs_acc *this)
+ *
+ * Notes:
+ *
+ * Initializes the irp_ho module.
+ *
+ */
+
+struct irs_ho *
+irs_irp_ho(struct irs_acc *this) {
+ struct irs_ho *ho;
+ struct pvt *pvt;
+
+ if (!(ho = memget(sizeof *ho))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ho, 0x0, sizeof *ho);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(ho, sizeof *ho);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->girpdata = this->private;
+
+ ho->private = pvt;
+ ho->close = ho_close;
+ ho->byname = ho_byname;
+ ho->byname2 = ho_byname2;
+ ho->byaddr = ho_byaddr;
+ ho->next = ho_next;
+ ho->rewind = ho_rewind;
+ ho->minimize = ho_minimize;
+ ho->addrinfo = ho_addrinfo;
+
+ return (ho);
+}
+
+/* Methods. */
+
+/*%
+ * Closes down the module.
+ *
+ */
+
+static void
+ho_close(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ ho_minimize(this);
+
+ free_host(&pvt->host);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+
+
+/*
+ * struct hostent * ho_byname(struct irs_ho *this, const char *name)
+ *
+ */
+
+static struct hostent *
+ho_byname(struct irs_ho *this, const char *name) {
+ return (ho_byname2(this, name, AF_INET));
+}
+
+
+
+
+
+/*
+ * struct hostent * ho_byname2(struct irs_ho *this, const char *name, int af)
+ *
+ */
+
+static struct hostent *
+ho_byname2(struct irs_ho *this, const char *name, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *ho = &pvt->host;
+ char *body = NULL;
+ size_t bodylen;
+ int code;
+ char text[256];
+
+ if (ho->h_name != NULL &&
+ strcmp(name, ho->h_name) == 0 &&
+ af == ho->h_addrtype) {
+ return (ho);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "gethostbyname2 %s %s",
+ name, ADDR_T_STR(af)) != 0)
+ return (NULL);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETHOST_OK) {
+ free_host(ho);
+ if (irp_unmarshall_ho(ho, body) != 0) {
+ ho = NULL;
+ }
+ } else {
+ ho = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (ho);
+}
+
+
+
+/*
+ * struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
+ * int len, int af)
+ *
+ */
+
+static struct hostent *
+ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *ho = &pvt->host;
+ char *body = NULL;
+ size_t bodylen;
+ int code;
+ char **p;
+ char paddr[MAXPADDRSIZE];
+ char text[256];
+
+ if (ho->h_name != NULL &&
+ af == ho->h_addrtype &&
+ len == ho->h_length) {
+ for (p = ho->h_addr_list ; *p != NULL ; p++) {
+ if (memcmp(*p, addr, len) == 0)
+ return (ho);
+ }
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (inet_ntop(af, addr, paddr, sizeof paddr) == NULL) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "gethostbyaddr %s %s",
+ paddr, ADDR_T_STR(af)) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETHOST_OK) {
+ free_host(ho);
+ if (irp_unmarshall_ho(ho, body) != 0) {
+ ho = NULL;
+ }
+ } else {
+ ho = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (ho);
+}
+
+/*%
+ * The implementation for gethostent(3). The first time it's
+ * called all the data is pulled from the remote(i.e. what
+ * the maximum number of gethostent(3) calls would return)
+ * and that data is cached.
+ *
+ */
+
+static struct hostent *
+ho_next(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *ho = &pvt->host;
+ char *body;
+ size_t bodylen;
+ int code;
+ char text[256];
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "gethostent") != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETHOST_OK) {
+ free_host(ho);
+ if (irp_unmarshall_ho(ho, body) != 0) {
+ ho = NULL;
+ }
+ } else {
+ ho = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (ho);
+}
+
+/*%
+ * void ho_rewind(struct irs_ho *this)
+ *
+ */
+
+static void
+ho_rewind(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char text[256];
+ int code;
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return;
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "sethostent") != 0) {
+ return;
+ }
+
+ code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
+ if (code != IRPD_GETHOST_SETOK) {
+ if (irp_log_errors) {
+ syslog(LOG_WARNING, "sethostent failed: %s", text);
+ }
+ }
+
+ return;
+}
+
+/*%
+ * void ho_minimize(struct irs_ho *this)
+ *
+ */
+
+static void
+ho_minimize(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ free_host(&pvt->host);
+
+ irs_irp_disconnect(pvt->girpdata);
+}
+
+/*%
+ * void free_host(struct hostent *ho)
+ *
+ */
+
+static void
+free_host(struct hostent *ho) {
+ char **p;
+
+ if (ho == NULL) {
+ return;
+ }
+
+ if (ho->h_name != NULL)
+ free(ho->h_name);
+
+ if (ho->h_aliases != NULL) {
+ for (p = ho->h_aliases ; *p != NULL ; p++)
+ free(*p);
+ free(ho->h_aliases);
+ }
+
+ if (ho->h_addr_list != NULL) {
+ for (p = ho->h_addr_list ; *p != NULL ; p++)
+ free(*p);
+ free(ho->h_addr_list);
+ }
+}
+
+/* dummy */
+static struct addrinfo *
+ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai)
+{
+ UNUSED(this);
+ UNUSED(name);
+ UNUSED(pai);
+ return(NULL);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp_ng.c b/usr/src/lib/libresolv2_joy/common/irs/irp_ng.c
new file mode 100644
index 0000000000..1af862cab4
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp_ng.c
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: irp_ng.c,v 1.4 2006/12/07 04:46:27 marka Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <syslog.h>
+
+#include <irs.h>
+#include <irp.h>
+#include <isc/memcluster.h>
+#include <isc/irpmarshall.h>
+
+#include "irs_p.h"
+#include "irp_p.h"
+
+#include "port_after.h"
+
+/* Definitions */
+
+struct pvt {
+ struct irp_p *girpdata;
+ int warned;
+};
+
+
+/* Forward */
+
+static void ng_rewind(struct irs_ng *, const char*);
+static void ng_close(struct irs_ng *);
+static int ng_next(struct irs_ng *, const char **, const char **,
+ const char **);
+static int ng_test(struct irs_ng *, const char *,
+ const char *, const char *,
+ const char *);
+static void ng_minimize(struct irs_ng *);
+
+
+/* Public */
+
+/*%
+ * Intialize the irp netgroup module.
+ *
+ */
+
+struct irs_ng *
+irs_irp_ng(struct irs_acc *this) {
+ struct irs_ng *ng;
+ struct pvt *pvt;
+
+ if (!(ng = memget(sizeof *ng))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ng, 0x5e, sizeof *ng);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(ng, sizeof *ng);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->girpdata = this->private;
+
+ ng->private = pvt;
+ ng->close = ng_close;
+ ng->next = ng_next;
+ ng->test = ng_test;
+ ng->rewind = ng_rewind;
+ ng->minimize = ng_minimize;
+ return (ng);
+}
+
+/* Methods */
+
+
+
+/*
+ * void ng_close(struct irs_ng *this)
+ *
+ */
+
+static void
+ng_close(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ ng_minimize(this);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+
+
+
+/*
+ * void ng_rewind(struct irs_ng *this, const char *group)
+ *
+ *
+ */
+
+static void
+ng_rewind(struct irs_ng *this, const char *group) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char text[256];
+ int code;
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return;
+ }
+
+ if (irs_irp_send_command(pvt->girpdata,
+ "setnetgrent %s", group) != 0) {
+ return;
+ }
+
+ code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
+ if (code != IRPD_GETNETGR_SETOK) {
+ if (irp_log_errors) {
+ syslog(LOG_WARNING, "setnetgrent(%s) failed: %s",
+ group, text);
+ }
+ }
+
+ return;
+}
+
+/*
+ * Get the next netgroup item from the cache.
+ *
+ */
+
+static int
+ng_next(struct irs_ng *this, const char **host, const char **user,
+ const char **domain)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ int code;
+ char *body = NULL;
+ size_t bodylen;
+ int rval = 0;
+ char text[256];
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (0);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getnetgrent") != 0)
+ return (0);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (0);
+ }
+
+ if (code == IRPD_GETNETGR_OK) {
+ if (irp_unmarshall_ng(host, user, domain, body) == 0) {
+ rval = 1;
+ }
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (rval);
+}
+
+/*
+ * Search for a match in a netgroup.
+ *
+ */
+
+static int
+ng_test(struct irs_ng *this, const char *name,
+ const char *host, const char *user, const char *domain)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *body = NULL;
+ size_t bodylen = 0;
+ int code;
+ char text[256];
+ int rval = 0;
+
+ UNUSED(name);
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (0);
+ }
+
+ if (irp_marshall_ng(host, user, domain, &body, &bodylen) != 0) {
+ return (0);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "innetgr %s", body) == 0) {
+ code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
+ if (code == IRPD_GETNETGR_MATCHES) {
+ rval = 1;
+ }
+ }
+
+ memput(body, bodylen);
+
+ return (rval);
+}
+
+
+
+
+/*
+ * void ng_minimize(struct irs_ng *this)
+ *
+ */
+
+static void
+ng_minimize(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ irs_irp_disconnect(pvt->girpdata);
+}
+
+
+
+
+/* Private */
+
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp_nw.c b/usr/src/lib/libresolv2_joy/common/irs/irp_nw.c
new file mode 100644
index 0000000000..3f2381f95d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp_nw.c
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996,1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: irp_nw.c,v 1.4 2006/03/09 23:57:56 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#if 0
+
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+
+#include <irs.h>
+#include <irp.h>
+#include <isc/irpmarshall.h>
+
+#include <isc/memcluster.h>
+#include <isc/misc.h>
+
+#include "irs_p.h"
+#include "lcl_p.h"
+#include "irp_p.h"
+
+#include "port_after.h"
+
+#define MAXALIASES 35
+#define MAXADDRSIZE 4
+
+struct pvt {
+ struct irp_p *girpdata;
+ int warned;
+ struct nwent net;
+};
+
+/* Forward */
+
+static void nw_close(struct irs_nw *);
+static struct nwent * nw_byname(struct irs_nw *, const char *, int);
+static struct nwent * nw_byaddr(struct irs_nw *, void *, int, int);
+static struct nwent * nw_next(struct irs_nw *);
+static void nw_rewind(struct irs_nw *);
+static void nw_minimize(struct irs_nw *);
+
+static void free_nw(struct nwent *nw);
+
+
+/* Public */
+
+/*%
+ * struct irs_nw * irs_irp_nw(struct irs_acc *this)
+ *
+ */
+
+struct irs_nw *
+irs_irp_nw(struct irs_acc *this) {
+ struct irs_nw *nw;
+ struct pvt *pvt;
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+
+ if (!(nw = memget(sizeof *nw))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(nw, 0x0, sizeof *nw);
+ pvt->girpdata = this->private;
+
+ nw->private = pvt;
+ nw->close = nw_close;
+ nw->byname = nw_byname;
+ nw->byaddr = nw_byaddr;
+ nw->next = nw_next;
+ nw->rewind = nw_rewind;
+ nw->minimize = nw_minimize;
+ return (nw);
+}
+
+/* Methods */
+
+/*%
+ * void nw_close(struct irs_nw *this)
+ *
+ */
+
+static void
+nw_close(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ nw_minimize(this);
+
+ free_nw(&pvt->net);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+/*%
+ * struct nwent * nw_byaddr(struct irs_nw *this, void *net,
+ * int length, int type)
+ *
+ */
+
+static struct nwent *
+nw_byaddr(struct irs_nw *this, void *net, int length, int type) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct nwent *nw = &pvt->net;
+ char *body = NULL;
+ size_t bodylen;
+ int code;
+ char paddr[24]; /*%< bigenough for ip4 w/ cidr spec. */
+ char text[256];
+
+ if (inet_net_ntop(type, net, length, paddr, sizeof paddr) == NULL) {
+ return (NULL);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getnetbyaddr %s %s",
+ paddr, ADDR_T_STR(type)) != 0)
+ return (NULL);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETNET_OK) {
+ free_nw(nw);
+ if (irp_unmarshall_nw(nw, body) != 0) {
+ nw = NULL;
+ }
+ } else {
+ nw = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (nw);
+}
+
+/*%
+ * struct nwent * nw_byname(struct irs_nw *this, const char *name, int type)
+ *
+ */
+
+static struct nwent *
+nw_byname(struct irs_nw *this, const char *name, int type) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct nwent *nw = &pvt->net;
+ char *body = NULL;
+ size_t bodylen;
+ int code;
+ char text[256];
+
+ if (nw->n_name != NULL &&
+ strcmp(name, nw->n_name) == 0 &&
+ nw->n_addrtype == type) {
+ return (nw);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getnetbyname %s", name) != 0)
+ return (NULL);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETNET_OK) {
+ free_nw(nw);
+ if (irp_unmarshall_nw(nw, body) != 0) {
+ nw = NULL;
+ }
+ } else {
+ nw = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (nw);
+}
+
+/*%
+ * void nw_rewind(struct irs_nw *this)
+ *
+ */
+
+static void
+nw_rewind(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char text[256];
+ int code;
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return;
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "setnetent") != 0) {
+ return;
+ }
+
+ code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
+ if (code != IRPD_GETNET_SETOK) {
+ if (irp_log_errors) {
+ syslog(LOG_WARNING, "setnetent failed: %s", text);
+ }
+ }
+
+ return;
+}
+
+/*%
+ * Prepares the cache if necessary and returns the first, or
+ * next item from it.
+ */
+
+static struct nwent *
+nw_next(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct nwent *nw = &pvt->net;
+ char *body;
+ size_t bodylen;
+ int code;
+ char text[256];
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getnetent") != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETNET_OK) {
+ free_nw(nw);
+ if (irp_unmarshall_nw(nw, body) != 0) {
+ nw = NULL;
+ }
+ } else {
+ nw = NULL;
+ }
+
+ if (body != NULL)
+ memput(body, bodylen);
+ return (nw);
+}
+
+/*%
+ * void nw_minimize(struct irs_nw *this)
+ *
+ */
+
+static void
+nw_minimize(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ irs_irp_disconnect(pvt->girpdata);
+}
+
+
+
+
+/* private. */
+
+/*%
+ * deallocate all the memory irp_unmarshall_pw allocated.
+ *
+ */
+
+static void
+free_nw(struct nwent *nw) {
+ char **p;
+
+ if (nw == NULL)
+ return;
+
+ if (nw->n_name != NULL)
+ free(nw->n_name);
+
+ if (nw->n_aliases != NULL) {
+ for (p = nw->n_aliases ; *p != NULL ; p++) {
+ free(*p);
+ }
+ free(nw->n_aliases);
+ }
+
+ if (nw->n_addr != NULL)
+ free(nw->n_addr);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp_p.h b/usr/src/lib/libresolv2_joy/common/irs/irp_p.h
new file mode 100644
index 0000000000..4f943f81bd
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp_p.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: irp_p.h,v 1.5 2005/04/27 04:56:28 sra Exp $
+ */
+
+#ifndef _IRP_P_H_INCLUDED
+#define _IRP_P_H_INCLUDED
+
+#include <stdio.h>
+
+struct irp_p {
+ char inbuffer[1024];
+ int inlast; /*%< index of one past the last char in buffer */
+ int incurr; /*%< index of the next char to be read from buffer */
+ int fdCxn;
+};
+
+/*
+ * Externs.
+ */
+
+extern struct irs_acc * irs_irp_acc __P((const char *));
+extern struct irs_gr * irs_irp_gr __P((struct irs_acc *));
+extern struct irs_pw * irs_irp_pw __P((struct irs_acc *));
+extern struct irs_sv * irs_irp_sv __P((struct irs_acc *));
+extern struct irs_pr * irs_irp_pr __P((struct irs_acc *));
+extern struct irs_ho * irs_irp_ho __P((struct irs_acc *));
+extern struct irs_nw * irs_irp_nw __P((struct irs_acc *));
+extern struct irs_ng * irs_irp_ng __P((struct irs_acc *));
+
+int irs_irp_connect(struct irp_p *pvt);
+int irs_irp_is_connected(struct irp_p *pvt);
+void irs_irp_disconnect(struct irp_p *pvt);
+int irs_irp_read_response(struct irp_p *pvt, char *text, size_t textlen);
+char *irs_irp_read_body(struct irp_p *pvt, size_t *size);
+int irs_irp_get_full_response(struct irp_p *pvt, int *code,
+ char *text, size_t textlen,
+ char **body, size_t *bodylen);
+
+extern int irp_log_errors;
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp_pr.c b/usr/src/lib/libresolv2_joy/common/irs/irp_pr.c
new file mode 100644
index 0000000000..ea876e8281
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp_pr.c
@@ -0,0 +1,327 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: irp_pr.c,v 1.3 2005/04/27 04:56:29 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* extern */
+
+#include "port_before.h"
+
+#include <syslog.h>
+#include <sys/types.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <syslog.h>
+
+#include <irs.h>
+#include <irp.h>
+#include <isc/memcluster.h>
+#include <isc/irpmarshall.h>
+
+#include "irs_p.h"
+#include "lcl_p.h"
+#include "irp_p.h"
+
+#include "port_after.h"
+
+
+#define MAXALIASES 35
+
+/* Types */
+
+struct pvt {
+ struct irp_p *girpdata;
+ int warned;
+ struct protoent proto;
+};
+
+/* Forward */
+
+static void pr_close(struct irs_pr *);
+static struct protoent * pr_next(struct irs_pr *);
+static struct protoent * pr_byname(struct irs_pr *, const char *);
+static struct protoent * pr_bynumber(struct irs_pr *, int);
+static void pr_rewind(struct irs_pr *);
+static void pr_minimize(struct irs_pr *);
+
+static void free_proto(struct protoent *pr);
+
+/* Public */
+
+/*%
+ * struct irs_pr * irs_irp_pr(struct irs_acc *this)
+ *
+ */
+
+struct irs_pr *
+irs_irp_pr(struct irs_acc *this) {
+ struct irs_pr *pr;
+ struct pvt *pvt;
+
+ if (!(pr = memget(sizeof *pr))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pr, 0x0, sizeof *pr);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(pr, sizeof *pr);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->girpdata = this->private;
+
+ pr->private = pvt;
+ pr->close = pr_close;
+ pr->byname = pr_byname;
+ pr->bynumber = pr_bynumber;
+ pr->next = pr_next;
+ pr->rewind = pr_rewind;
+ pr->minimize = pr_minimize;
+ return (pr);
+}
+
+/* Methods */
+
+/*%
+ * void pr_close(struct irs_pr *this)
+ *
+ */
+
+static void
+pr_close(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ pr_minimize(this);
+
+ free_proto(&pvt->proto);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+/*%
+ * struct protoent * pr_byname(struct irs_pr *this, const char *name)
+ *
+ */
+
+static struct protoent *
+pr_byname(struct irs_pr *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct protoent *pr = &pvt->proto;
+ char *body = NULL;
+ size_t bodylen;
+ int code;
+ int i;
+ char text[256];
+
+ if (pr->p_name != NULL && strcmp(name, pr->p_name) == 0) {
+ return (pr);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ i = irs_irp_send_command(pvt->girpdata, "getprotobyname %s", name);
+ if (i != 0)
+ return (NULL);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETPROTO_OK) {
+ free_proto(pr);
+ if (irp_unmarshall_pr(pr, body) != 0) {
+ pr = NULL;
+ }
+ } else {
+ pr = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (pr);
+}
+
+/*%
+ * struct protoent * pr_bynumber(struct irs_pr *this, int proto)
+ *
+ */
+
+static struct protoent *
+pr_bynumber(struct irs_pr *this, int proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct protoent *pr = &pvt->proto;
+ char *body = NULL;
+ size_t bodylen;
+ int code;
+ int i;
+ char text[256];
+
+ if (pr->p_name != NULL && proto == pr->p_proto) {
+ return (pr);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ i = irs_irp_send_command(pvt->girpdata, "getprotobynumber %d", proto);
+ if (i != 0)
+ return (NULL);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETPROTO_OK) {
+ free_proto(pr);
+ if (irp_unmarshall_pr(pr, body) != 0) {
+ pr = NULL;
+ }
+ } else {
+ pr = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (pr);
+}
+
+/*%
+ * void pr_rewind(struct irs_pr *this)
+ *
+ */
+
+static void
+pr_rewind(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char text[256];
+ int code;
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return;
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "setprotoent") != 0) {
+ return;
+ }
+
+ code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
+ if (code != IRPD_GETPROTO_SETOK) {
+ if (irp_log_errors) {
+ syslog(LOG_WARNING, "setprotoent failed: %s", text);
+ }
+ }
+
+ return;
+}
+
+/*%
+ * Prepares the cache if necessary and returns the next item in it.
+ *
+ */
+
+static struct protoent *
+pr_next(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct protoent *pr = &pvt->proto;
+ char *body;
+ size_t bodylen;
+ int code;
+ char text[256];
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getprotoent") != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETPROTO_OK) {
+ free_proto(pr);
+ if (irp_unmarshall_pr(pr, body) != 0) {
+ pr = NULL;
+ }
+ } else {
+ pr = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (pr);
+}
+
+/*%
+ * void pr_minimize(struct irs_pr *this)
+ *
+ */
+
+static void
+pr_minimize(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ irs_irp_disconnect(pvt->girpdata);
+}
+
+/*%
+ * Deallocate all the memory irp_unmarshall_pr allocated.
+ *
+ */
+
+static void
+free_proto(struct protoent *pr) {
+ char **p;
+
+ if (pr == NULL)
+ return;
+
+ if (pr->p_name != NULL)
+ free(pr->p_name);
+
+ for (p = pr->p_aliases ; p != NULL && *p != NULL ; p++)
+ free(*p);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irp_sv.c b/usr/src/lib/libresolv2_joy/common/irs/irp_sv.c
new file mode 100644
index 0000000000..577e697fe6
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irp_sv.c
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996,1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: irp_sv.c,v 1.3 2005/04/27 04:56:29 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* extern */
+
+#include "port_before.h"
+
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#ifdef IRS_LCL_SV_DB
+#include <db.h>
+#endif
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <syslog.h>
+
+#include <irs.h>
+#include <irp.h>
+#include <isc/irpmarshall.h>
+#include <isc/memcluster.h>
+
+#include "irs_p.h"
+#include "lcl_p.h"
+#include "irp_p.h"
+
+#include "port_after.h"
+
+/* Types */
+
+struct pvt {
+ struct irp_p *girpdata;
+ int warned;
+ struct servent service;
+};
+
+/* Forward */
+
+static void sv_close(struct irs_sv*);
+static struct servent * sv_next(struct irs_sv *);
+static struct servent * sv_byname(struct irs_sv *, const char *,
+ const char *);
+static struct servent * sv_byport(struct irs_sv *, int, const char *);
+static void sv_rewind(struct irs_sv *);
+static void sv_minimize(struct irs_sv *);
+
+static void free_service(struct servent *sv);
+
+
+
+/* Public */
+
+/*%
+ * struct irs_sv * irs_irp_sv(struct irs_acc *this)
+ *
+ */
+
+struct irs_sv *
+irs_irp_sv(struct irs_acc *this) {
+ struct irs_sv *sv;
+ struct pvt *pvt;
+
+ if ((sv = memget(sizeof *sv)) == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(sv, 0x0, sizeof *sv);
+
+ if ((pvt = memget(sizeof *pvt)) == NULL) {
+ memput(sv, sizeof *sv);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pvt->girpdata = this->private;
+
+ sv->private = pvt;
+ sv->close = sv_close;
+ sv->next = sv_next;
+ sv->byname = sv_byname;
+ sv->byport = sv_byport;
+ sv->rewind = sv_rewind;
+ sv->minimize = sv_minimize;
+
+ return (sv);
+}
+
+/* Methods */
+
+/*%
+ * void sv_close(struct irs_sv *this)
+ *
+ */
+
+static void
+sv_close(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ sv_minimize(this);
+
+ free_service(&pvt->service);
+
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+/*%
+ * Fills the cache if necessary and returns the next item from it.
+ *
+ */
+
+static struct servent *
+sv_next(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct servent *sv = &pvt->service;
+ char *body;
+ size_t bodylen;
+ int code;
+ char text[256];
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getservent") != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETSERVICE_OK) {
+ free_service(sv);
+ if (irp_unmarshall_sv(sv, body) != 0) {
+ sv = NULL;
+ }
+ } else {
+ sv = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (sv);
+}
+
+/*%
+ * struct servent * sv_byname(struct irs_sv *this, const char *name,
+ * const char *proto)
+ *
+ */
+
+static struct servent *
+sv_byname(struct irs_sv *this, const char *name, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct servent *sv = &pvt->service;
+ char *body;
+ char text[256];
+ size_t bodylen;
+ int code;
+
+ if (sv->s_name != NULL &&
+ strcmp(name, sv->s_name) == 0 &&
+ strcasecmp(proto, sv->s_proto) == 0) {
+ return (sv);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getservbyname %s %s",
+ name, proto) != 0)
+ return (NULL);
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETSERVICE_OK) {
+ free_service(sv);
+ if (irp_unmarshall_sv(sv, body) != 0) {
+ sv = NULL;
+ }
+ } else {
+ sv = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (sv);
+}
+
+/*%
+ * struct servent * sv_byport(struct irs_sv *this, int port,
+ * const char *proto)
+ *
+ */
+
+static struct servent *
+sv_byport(struct irs_sv *this, int port, const char *proto) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct servent *sv = &pvt->service;
+ char *body;
+ size_t bodylen;
+ char text[256];
+ int code;
+
+ if (sv->s_name != NULL &&
+ port == sv->s_port &&
+ strcasecmp(proto, sv->s_proto) == 0) {
+ return (sv);
+ }
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "getservbyport %d %s",
+ ntohs((short)port), proto) != 0) {
+ return (NULL);
+ }
+
+ if (irs_irp_get_full_response(pvt->girpdata, &code,
+ text, sizeof text,
+ &body, &bodylen) != 0) {
+ return (NULL);
+ }
+
+ if (code == IRPD_GETSERVICE_OK) {
+ free_service(sv);
+ if (irp_unmarshall_sv(sv, body) != 0) {
+ sv = NULL;
+ }
+ } else {
+ sv = NULL;
+ }
+
+ if (body != NULL) {
+ memput(body, bodylen);
+ }
+
+ return (sv);
+}
+
+/*%
+ * void sv_rewind(struct irs_sv *this)
+ *
+ */
+
+static void
+sv_rewind(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char text[256];
+ int code;
+
+ if (irs_irp_connection_setup(pvt->girpdata, &pvt->warned) != 0) {
+ return;
+ }
+
+ if (irs_irp_send_command(pvt->girpdata, "setservent") != 0) {
+ return;
+ }
+
+ code = irs_irp_read_response(pvt->girpdata, text, sizeof text);
+ if (code != IRPD_GETSERVICE_SETOK) {
+ if (irp_log_errors) {
+ syslog(LOG_WARNING, "setservent failed: %s", text);
+ }
+ }
+
+ return;
+}
+
+/*%
+ * void sv_minimize(struct irs_sv *this)
+ *
+ */
+
+static void
+sv_minimize(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ irs_irp_disconnect(pvt->girpdata);
+}
+
+
+
+
+
+
+static void
+free_service(struct servent *sv) {
+ char **p;
+
+ if (sv == NULL) {
+ return;
+ }
+
+ if (sv->s_name != NULL) {
+ free(sv->s_name);
+ }
+
+ for (p = sv->s_aliases ; p != NULL && *p != NULL ; p++) {
+ free(*p);
+ }
+
+ if (sv->s_proto != NULL) {
+ free(sv->s_proto);
+ }
+}
+
+
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irpmarshall.c b/usr/src/lib/libresolv2_joy/common/irs/irpmarshall.c
new file mode 100644
index 0000000000..85ffff1866
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irpmarshall.c
@@ -0,0 +1,2301 @@
+/*
+ * Copyright(c) 1989, 1993, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: irpmarshall.c,v 1.7 2006/03/09 23:57:56 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#if 0
+
+Check values are in approrpriate endian order.
+
+Double check memory allocations on unmarhsalling
+
+#endif
+
+
+/* Extern */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <stdio.h>
+#include <ctype.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <utmp.h>
+#include <unistd.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+#include <isc/irpmarshall.h>
+
+#include "port_after.h"
+
+
+#ifndef HAVE_STRNDUP
+static char *strndup(const char *str, size_t len);
+#endif
+
+static char **splitarray(const char *buffer, const char *buffend, char delim);
+static int joinarray(char * const * argv, char *buffer, char delim);
+static char *getfield(char **res, size_t reslen, char **buffer, char delim);
+static size_t joinlength(char * const *argv);
+static void free_array(char **argv, size_t entries);
+
+#define ADDR_T_STR(x) (x == AF_INET ? "AF_INET" :\
+ (x == AF_INET6 ? "AF_INET6" : "UNKNOWN"))
+
+#define MAXPADDRSIZE (sizeof "255.255.255.255" + 1)
+
+static char COMMA = ',';
+
+static const char *COMMASTR = ",";
+static const char *COLONSTR = ":";
+
+
+
+/* See big comment at bottom of irpmarshall.h for description. */
+
+
+#ifdef WANT_IRS_PW
+/* +++++++++++++++++++++++++ struct passwd +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_pw(const struct passwd *pw, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on sucess, -1 on failure.
+ *
+ */
+
+int
+irp_marshall_pw(const struct passwd *pw, char **buffer, size_t *len) {
+ size_t need = 1 ; /*%< for null byte */
+ char pwUid[24];
+ char pwGid[24];
+ char pwChange[24];
+ char pwExpire[24];
+ const char *pwClass;
+ const char *fieldsep = COLONSTR;
+
+ if (pw == NULL || len == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ sprintf(pwUid, "%ld", (long)pw->pw_uid);
+ sprintf(pwGid, "%ld", (long)pw->pw_gid);
+
+#ifdef HAVE_PW_CHANGE
+ sprintf(pwChange, "%ld", (long)pw->pw_change);
+#else
+ pwChange[0] = '0';
+ pwChange[1] = '\0';
+#endif
+
+#ifdef HAVE_PW_EXPIRE
+ sprintf(pwExpire, "%ld", (long)pw->pw_expire);
+#else
+ pwExpire[0] = '0';
+ pwExpire[1] = '\0';
+#endif
+
+#ifdef HAVE_PW_CLASS
+ pwClass = pw->pw_class;
+#else
+ pwClass = "";
+#endif
+
+ need += strlen(pw->pw_name) + 1; /*%< one for fieldsep */
+ need += strlen(pw->pw_passwd) + 1;
+ need += strlen(pwUid) + 1;
+ need += strlen(pwGid) + 1;
+ need += strlen(pwClass) + 1;
+ need += strlen(pwChange) + 1;
+ need += strlen(pwExpire) + 1;
+ need += strlen(pw->pw_gecos) + 1;
+ need += strlen(pw->pw_dir) + 1;
+ need += strlen(pw->pw_shell) + 1;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ strcpy(*buffer, pw->pw_name); strcat(*buffer, fieldsep);
+ strcat(*buffer, pw->pw_passwd); strcat(*buffer, fieldsep);
+ strcat(*buffer, pwUid); strcat(*buffer, fieldsep);
+ strcat(*buffer, pwGid); strcat(*buffer, fieldsep);
+ strcat(*buffer, pwClass); strcat(*buffer, fieldsep);
+ strcat(*buffer, pwChange); strcat(*buffer, fieldsep);
+ strcat(*buffer, pwExpire); strcat(*buffer, fieldsep);
+ strcat(*buffer, pw->pw_gecos); strcat(*buffer, fieldsep);
+ strcat(*buffer, pw->pw_dir); strcat(*buffer, fieldsep);
+ strcat(*buffer, pw->pw_shell); strcat(*buffer, fieldsep);
+
+ return (0);
+}
+
+/*%
+ * int irp_unmarshall_pw(struct passwd *pw, char *buffer)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure
+ *
+ */
+
+int
+irp_unmarshall_pw(struct passwd *pw, char *buffer) {
+ char *name, *pass, *class, *gecos, *dir, *shell;
+ uid_t pwuid;
+ gid_t pwgid;
+ time_t pwchange;
+ time_t pwexpire;
+ char *p;
+ long t;
+ char tmpbuf[24];
+ char *tb = &tmpbuf[0];
+ char fieldsep = ':';
+ int myerrno = EINVAL;
+
+ name = pass = class = gecos = dir = shell = NULL;
+ p = buffer;
+
+ /* pw_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0) {
+ goto error;
+ }
+
+ /* pw_passwd field */
+ pass = NULL;
+ if (getfield(&pass, 0, &p, fieldsep) == NULL) { /*%< field can be empty */
+ goto error;
+ }
+
+
+ /* pw_uid field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ pwuid = (uid_t)t;
+ if ((long) pwuid != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+
+
+ /* pw_gid field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ pwgid = (gid_t)t;
+ if ((long)pwgid != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+
+
+ /* pw_class field */
+ class = NULL;
+ if (getfield(&class, 0, &p, fieldsep) == NULL) {
+ goto error;
+ }
+
+
+
+ /* pw_change field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ pwchange = (time_t)t;
+ if ((long)pwchange != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+
+
+ /* pw_expire field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ pwexpire = (time_t)t;
+ if ((long) pwexpire != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+
+
+ /* pw_gecos field */
+ gecos = NULL;
+ if (getfield(&gecos, 0, &p, fieldsep) == NULL) {
+ goto error;
+ }
+
+
+
+ /* pw_dir field */
+ dir = NULL;
+ if (getfield(&dir, 0, &p, fieldsep) == NULL) {
+ goto error;
+ }
+
+
+
+ /* pw_shell field */
+ shell = NULL;
+ if (getfield(&shell, 0, &p, fieldsep) == NULL) {
+ goto error;
+ }
+
+
+
+ pw->pw_name = name;
+ pw->pw_passwd = pass;
+ pw->pw_uid = pwuid;
+ pw->pw_gid = pwgid;
+ pw->pw_gecos = gecos;
+ pw->pw_dir = dir;
+ pw->pw_shell = shell;
+
+#ifdef HAVE_PW_CHANGE
+ pw->pw_change = pwchange;
+#endif
+#ifdef HAVE_PW_CLASS
+ pw->pw_class = class;
+#endif
+#ifdef HAVE_PW_EXPIRE
+ pw->pw_expire = pwexpire;
+#endif
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ if (pass != NULL) free(pass);
+ if (gecos != NULL) free(gecos);
+ if (dir != NULL) free(dir);
+ if (shell != NULL) free(shell);
+
+ return (-1);
+}
+
+/* ------------------------- struct passwd ------------------------- */
+#endif /* WANT_IRS_PW */
+/* +++++++++++++++++++++++++ struct group +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_gr(const struct group *gr, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h.
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure
+ */
+
+int
+irp_marshall_gr(const struct group *gr, char **buffer, size_t *len) {
+ size_t need = 1; /*%< for null byte */
+ char grGid[24];
+ const char *fieldsep = COLONSTR;
+
+ if (gr == NULL || len == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ sprintf(grGid, "%ld", (long)gr->gr_gid);
+
+ need += strlen(gr->gr_name) + 1;
+#ifndef MISSING_GR_PASSWD
+ need += strlen(gr->gr_passwd) + 1;
+#else
+ need++;
+#endif
+ need += strlen(grGid) + 1;
+ need += joinlength(gr->gr_mem) + 1;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ strcpy(*buffer, gr->gr_name); strcat(*buffer, fieldsep);
+#ifndef MISSING_GR_PASSWD
+ strcat(*buffer, gr->gr_passwd);
+#endif
+ strcat(*buffer, fieldsep);
+ strcat(*buffer, grGid); strcat(*buffer, fieldsep);
+ joinarray(gr->gr_mem, *buffer, COMMA) ; strcat(*buffer, fieldsep);
+
+ return (0);
+}
+
+/*%
+ * int irp_unmarshall_gr(struct group *gr, char *buffer)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ *
+ */
+
+int
+irp_unmarshall_gr(struct group *gr, char *buffer) {
+ char *p, *q;
+ gid_t grgid;
+ long t;
+ char *name = NULL;
+ char *pass = NULL;
+ char **members = NULL;
+ char tmpbuf[24];
+ char *tb;
+ char fieldsep = ':';
+ int myerrno = EINVAL;
+
+ if (gr == NULL || buffer == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ p = buffer;
+
+ /* gr_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
+ goto error;
+ }
+
+
+ /* gr_passwd field */
+ pass = NULL;
+ if (getfield(&pass, 0, &p, fieldsep) == NULL) {
+ goto error;
+ }
+
+
+ /* gr_gid field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ grgid = (gid_t)t;
+ if ((long) grgid != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+
+ /* gr_mem field. Member names are separated by commas */
+ q = strchr(p, fieldsep);
+ if (q == NULL) {
+ goto error;
+ }
+ members = splitarray(p, q, COMMA);
+ if (members == NULL) {
+ myerrno = errno;
+ goto error;
+ }
+ p = q + 1;
+
+
+ gr->gr_name = name;
+#ifndef MISSING_GR_PASSWD
+ gr->gr_passwd = pass;
+#endif
+ gr->gr_gid = grgid;
+ gr->gr_mem = members;
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ if (pass != NULL) free(pass);
+
+ return (-1);
+}
+
+
+/* ------------------------- struct group ------------------------- */
+
+
+
+
+/* +++++++++++++++++++++++++ struct servent +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_sv(const struct servent *sv, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure.
+ *
+ */
+
+int
+irp_marshall_sv(const struct servent *sv, char **buffer, size_t *len) {
+ size_t need = 1; /*%< for null byte */
+ char svPort[24];
+ const char *fieldsep = COLONSTR;
+ short realport;
+
+ if (sv == NULL || len == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ /* the int s_port field is actually a short in network order. We
+ want host order to make the marshalled data look correct */
+ realport = ntohs((short)sv->s_port);
+ sprintf(svPort, "%d", realport);
+
+ need += strlen(sv->s_name) + 1;
+ need += joinlength(sv->s_aliases) + 1;
+ need += strlen(svPort) + 1;
+ need += strlen(sv->s_proto) + 1;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ strcpy(*buffer, sv->s_name); strcat(*buffer, fieldsep);
+ joinarray(sv->s_aliases, *buffer, COMMA); strcat(*buffer, fieldsep);
+ strcat(*buffer, svPort); strcat(*buffer, fieldsep);
+ strcat(*buffer, sv->s_proto); strcat(*buffer, fieldsep);
+
+ return (0);
+}
+
+/*%
+ * int irp_unmarshall_sv(struct servent *sv, char *buffer)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure.
+ *
+ */
+
+int
+irp_unmarshall_sv(struct servent *sv, char *buffer) {
+ char *p, *q;
+ short svport;
+ long t;
+ char *name = NULL;
+ char *proto = NULL;
+ char **aliases = NULL;
+ char tmpbuf[24];
+ char *tb;
+ char fieldsep = ':';
+ int myerrno = EINVAL;
+
+ if (sv == NULL || buffer == NULL)
+ return (-1);
+
+ p = buffer;
+
+
+ /* s_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
+ goto error;
+ }
+
+
+ /* s_aliases field */
+ q = strchr(p, fieldsep);
+ if (q == NULL) {
+ goto error;
+ }
+ aliases = splitarray(p, q, COMMA);
+ if (aliases == NULL) {
+ myerrno = errno;
+ goto error;
+ }
+ p = q + 1;
+
+
+ /* s_port field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ svport = (short)t;
+ if ((long) svport != t) { /*%< value must have been too big. */
+ goto error;
+ }
+ svport = htons(svport);
+
+ /* s_proto field */
+ proto = NULL;
+ if (getfield(&proto, 0, &p, fieldsep) == NULL) {
+ goto error;
+ }
+
+ sv->s_name = name;
+ sv->s_aliases = aliases;
+ sv->s_port = svport;
+ sv->s_proto = proto;
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ if (proto != NULL) free(proto);
+ free_array(aliases, 0);
+
+ return (-1);
+}
+
+
+/* ------------------------- struct servent ------------------------- */
+
+/* +++++++++++++++++++++++++ struct protoent +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_pr(struct protoent *pr, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ *
+ */
+
+int
+irp_marshall_pr(struct protoent *pr, char **buffer, size_t *len) {
+ size_t need = 1; /*%< for null byte */
+ char prProto[24];
+ const char *fieldsep = COLONSTR;
+
+ if (pr == NULL || len == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ sprintf(prProto, "%d", (int)pr->p_proto);
+
+ need += strlen(pr->p_name) + 1;
+ need += joinlength(pr->p_aliases) + 1;
+ need += strlen(prProto) + 1;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ strcpy(*buffer, pr->p_name); strcat(*buffer, fieldsep);
+ joinarray(pr->p_aliases, *buffer, COMMA); strcat(*buffer, fieldsep);
+ strcat(*buffer, prProto); strcat(*buffer, fieldsep);
+
+ return (0);
+
+}
+
+/*%
+ * int irp_unmarshall_pr(struct protoent *pr, char *buffer)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure
+ *
+ */
+
+int irp_unmarshall_pr(struct protoent *pr, char *buffer) {
+ char *p, *q;
+ int prproto;
+ long t;
+ char *name = NULL;
+ char **aliases = NULL;
+ char tmpbuf[24];
+ char *tb;
+ char fieldsep = ':';
+ int myerrno = EINVAL;
+
+ if (pr == NULL || buffer == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ p = buffer;
+
+ /* p_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
+ goto error;
+ }
+
+
+ /* p_aliases field */
+ q = strchr(p, fieldsep);
+ if (q == NULL) {
+ goto error;
+ }
+ aliases = splitarray(p, q, COMMA);
+ if (aliases == NULL) {
+ myerrno = errno;
+ goto error;
+ }
+ p = q + 1;
+
+
+ /* p_proto field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ prproto = (int)t;
+ if ((long) prproto != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+ pr->p_name = name;
+ pr->p_aliases = aliases;
+ pr->p_proto = prproto;
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ free_array(aliases, 0);
+
+ return (-1);
+}
+
+/* ------------------------- struct protoent ------------------------- */
+
+
+
+/* +++++++++++++++++++++++++ struct hostent +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_ho(struct hostent *ho, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h.
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure.
+ *
+ */
+
+int
+irp_marshall_ho(struct hostent *ho, char **buffer, size_t *len) {
+ size_t need = 1; /*%< for null byte */
+ char hoaddrtype[24];
+ char holength[24];
+ char **av;
+ char *p;
+ int addrlen;
+ int malloced = 0;
+ size_t remlen;
+ const char *fieldsep = "@";
+
+ if (ho == NULL || len == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ switch(ho->h_addrtype) {
+ case AF_INET:
+ strcpy(hoaddrtype, "AF_INET");
+ break;
+
+ case AF_INET6:
+ strcpy(hoaddrtype, "AF_INET6");
+ break;
+
+ default:
+ errno = EINVAL;
+ return (-1);
+ }
+
+ sprintf(holength, "%d", ho->h_length);
+
+ need += strlen(ho->h_name) + 1;
+ need += joinlength(ho->h_aliases) + 1;
+ need += strlen(hoaddrtype) + 1;
+ need += strlen(holength) + 1;
+
+ /* we determine an upper bound on the string length needed, not an
+ exact length. */
+ addrlen = (ho->h_addrtype == AF_INET ? 16 : 46) ; /*%< XX other AF's?? */
+ for (av = ho->h_addr_list; av != NULL && *av != NULL ; av++)
+ need += addrlen;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ malloced = 1;
+ }
+
+ strcpy(*buffer, ho->h_name); strcat(*buffer, fieldsep);
+ joinarray(ho->h_aliases, *buffer, COMMA); strcat(*buffer, fieldsep);
+ strcat(*buffer, hoaddrtype); strcat(*buffer, fieldsep);
+ strcat(*buffer, holength); strcat(*buffer, fieldsep);
+
+ p = *buffer + strlen(*buffer);
+ remlen = need - strlen(*buffer);
+ for (av = ho->h_addr_list ; av != NULL && *av != NULL ; av++) {
+ if (inet_ntop(ho->h_addrtype, *av, p, remlen) == NULL) {
+ goto error;
+ }
+ if (*(av + 1) != NULL)
+ strcat(p, COMMASTR);
+ remlen -= strlen(p);
+ p += strlen(p);
+ }
+ strcat(*buffer, fieldsep);
+
+ return (0);
+
+ error:
+ if (malloced) {
+ memput(*buffer, need);
+ }
+
+ return (-1);
+}
+
+/*%
+ * int irp_unmarshall_ho(struct hostent *ho, char *buffer)
+ *
+ * notes: \li
+ *
+ * See irpmarshall.h.
+ *
+ * return: \li
+ *
+ * 0 on success, -1 on failure.
+ *
+ */
+
+int
+irp_unmarshall_ho(struct hostent *ho, char *buffer) {
+ char *p, *q, *r;
+ int hoaddrtype;
+ int holength;
+ long t;
+ char *name;
+ char **aliases = NULL;
+ char **hohaddrlist = NULL;
+ size_t hoaddrsize;
+ char tmpbuf[24];
+ char *tb;
+ char **alist;
+ int addrcount;
+ char fieldsep = '@';
+ int myerrno = EINVAL;
+
+ if (ho == NULL || buffer == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ p = buffer;
+
+ /* h_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
+ goto error;
+ }
+
+
+ /* h_aliases field */
+ q = strchr(p, fieldsep);
+ if (q == NULL) {
+ goto error;
+ }
+ aliases = splitarray(p, q, COMMA);
+ if (aliases == NULL) {
+ myerrno = errno;
+ goto error;
+ }
+ p = q + 1;
+
+
+ /* h_addrtype field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ if (strcmp(tmpbuf, "AF_INET") == 0)
+ hoaddrtype = AF_INET;
+ else if (strcmp(tmpbuf, "AF_INET6") == 0)
+ hoaddrtype = AF_INET6;
+ else
+ goto error;
+
+
+ /* h_length field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ t = strtol(tmpbuf, &tb, 10);
+ if (*tb) {
+ goto error; /*%< junk in value */
+ }
+ holength = (int)t;
+ if ((long) holength != t) { /*%< value must have been too big. */
+ goto error;
+ }
+
+
+ /* h_addr_list field */
+ q = strchr(p, fieldsep);
+ if (q == NULL)
+ goto error;
+
+ /* count how many addresss are in there */
+ if (q > p + 1) {
+ for (addrcount = 1, r = p ; r != q ; r++) {
+ if (*r == COMMA)
+ addrcount++;
+ }
+ } else {
+ addrcount = 0;
+ }
+
+ hoaddrsize = (addrcount + 1) * sizeof (char *);
+ hohaddrlist = malloc(hoaddrsize);
+ if (hohaddrlist == NULL) {
+ myerrno = ENOMEM;
+ goto error;
+ }
+
+ memset(hohaddrlist, 0x0, hoaddrsize);
+
+ alist = hohaddrlist;
+ for (t = 0, r = p ; r != q ; p = r + 1, t++) {
+ char saved;
+ while (r != q && *r != COMMA) r++;
+ saved = *r;
+ *r = 0x0;
+
+ alist[t] = malloc(hoaddrtype == AF_INET ? 4 : 16);
+ if (alist[t] == NULL) {
+ myerrno = ENOMEM;
+ goto error;
+ }
+
+ if (inet_pton(hoaddrtype, p, alist[t]) == -1)
+ goto error;
+ *r = saved;
+ }
+ alist[t] = NULL;
+
+ ho->h_name = name;
+ ho->h_aliases = aliases;
+ ho->h_addrtype = hoaddrtype;
+ ho->h_length = holength;
+ ho->h_addr_list = hohaddrlist;
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ free_array(hohaddrlist, 0);
+ free_array(aliases, 0);
+
+ return (-1);
+}
+
+/* ------------------------- struct hostent------------------------- */
+
+
+
+/* +++++++++++++++++++++++++ struct netgrp +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_ng(const char *host, const char *user,
+ * const char *domain, char *buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See note for irp_marshall_ng_start
+ *
+ * return: \li
+ *
+ * 0 on success, 0 on failure.
+ *
+ */
+
+int
+irp_marshall_ng(const char *host, const char *user, const char *domain,
+ char **buffer, size_t *len) {
+ size_t need = 1; /*%< for nul byte */
+ const char *fieldsep = ",";
+
+ if (len == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ need += 4; /*%< two parens and two commas */
+ need += (host == NULL ? 0 : strlen(host));
+ need += (user == NULL ? 0 : strlen(user));
+ need += (domain == NULL ? 0 : strlen(domain));
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ } else if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ (*buffer)[0] = '(';
+ (*buffer)[1] = '\0';
+
+ if (host != NULL)
+ strcat(*buffer, host);
+ strcat(*buffer, fieldsep);
+
+ if (user != NULL)
+ strcat(*buffer, user);
+ strcat(*buffer, fieldsep);
+
+ if (domain != NULL)
+ strcat(*buffer, domain);
+ strcat(*buffer, ")");
+
+ return (0);
+}
+
+
+
+/* ---------- */
+
+/*%
+ * int irp_unmarshall_ng(const char **host, const char **user,
+ * const char **domain, char *buffer)
+ *
+ * notes: \li
+ *
+ * Unpacks the BUFFER into 3 character arrays it allocates and assigns
+ * to *HOST, *USER and *DOMAIN. If any field of the value is empty,
+ * then the corresponding paramater value will be set to NULL.
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ */
+
+int
+irp_unmarshall_ng(const char **hostp, const char **userp, const char **domainp,
+ char *buffer)
+{
+ char *p, *q;
+ char fieldsep = ',';
+ int myerrno = EINVAL;
+ char *host, *user, *domain;
+
+ if (userp == NULL || hostp == NULL ||
+ domainp == NULL || buffer == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ host = user = domain = NULL;
+
+ p = buffer;
+ while (isspace((unsigned char)*p)) {
+ p++;
+ }
+ if (*p != '(') {
+ goto error;
+ }
+
+ q = p + 1;
+ while (*q && *q != fieldsep)
+ q++;
+ if (!*q) {
+ goto error;
+ } else if (q > p + 1) {
+ host = strndup(p, q - p);
+ }
+
+ p = q + 1;
+ if (!*p) {
+ goto error;
+ } else if (*p != fieldsep) {
+ q = p + 1;
+ while (*q && *q != fieldsep)
+ q++;
+ if (!*q) {
+ goto error;
+ }
+ user = strndup(p, q - p);
+ } else {
+ p++;
+ }
+
+ if (!*p) {
+ goto error;
+ } else if (*p != ')') {
+ q = p + 1;
+ while (*q && *q != ')')
+ q++;
+ if (!*q) {
+ goto error;
+ }
+ domain = strndup(p, q - p);
+ }
+ *hostp = host;
+ *userp = user;
+ *domainp = domain;
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (host != NULL) free(host);
+ if (user != NULL) free(user);
+
+ return (-1);
+}
+
+/* ------------------------- struct netgrp ------------------------- */
+
+
+
+
+/* +++++++++++++++++++++++++ struct nwent +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_nw(struct nwent *ne, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See at top.
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ *
+ */
+
+int
+irp_marshall_nw(struct nwent *ne, char **buffer, size_t *len) {
+ size_t need = 1; /*%< for null byte */
+ char nAddrType[24];
+ char nNet[MAXPADDRSIZE];
+ const char *fieldsep = COLONSTR;
+
+ if (ne == NULL || len == NULL) {
+ return (-1);
+ }
+
+ strcpy(nAddrType, ADDR_T_STR(ne->n_addrtype));
+
+ if (inet_net_ntop(ne->n_addrtype, ne->n_addr, ne->n_length,
+ nNet, sizeof nNet) == NULL) {
+ return (-1);
+ }
+
+
+ need += strlen(ne->n_name) + 1;
+ need += joinlength(ne->n_aliases) + 1;
+ need += strlen(nAddrType) + 1;
+ need += strlen(nNet) + 1;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ strcpy(*buffer, ne->n_name); strcat(*buffer, fieldsep);
+ joinarray(ne->n_aliases, *buffer, COMMA) ; strcat(*buffer, fieldsep);
+ strcat(*buffer, nAddrType); strcat(*buffer, fieldsep);
+ strcat(*buffer, nNet); strcat(*buffer, fieldsep);
+
+ return (0);
+}
+
+/*%
+ * int irp_unmarshall_nw(struct nwent *ne, char *buffer)
+ *
+ * notes: \li
+ *
+ * See note up top.
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ *
+ */
+
+int
+irp_unmarshall_nw(struct nwent *ne, char *buffer) {
+ char *p, *q;
+ int naddrtype;
+ long nnet;
+ int bits;
+ char *name = NULL;
+ char **aliases = NULL;
+ char tmpbuf[24];
+ char *tb;
+ char fieldsep = ':';
+ int myerrno = EINVAL;
+
+ if (ne == NULL || buffer == NULL) {
+ goto error;
+ }
+
+ p = buffer;
+
+ /* n_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
+ goto error;
+ }
+
+
+ /* n_aliases field. Aliases are separated by commas */
+ q = strchr(p, fieldsep);
+ if (q == NULL) {
+ goto error;
+ }
+ aliases = splitarray(p, q, COMMA);
+ if (aliases == NULL) {
+ myerrno = errno;
+ goto error;
+ }
+ p = q + 1;
+
+
+ /* h_addrtype field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ if (strcmp(tmpbuf, "AF_INET") == 0)
+ naddrtype = AF_INET;
+ else if (strcmp(tmpbuf, "AF_INET6") == 0)
+ naddrtype = AF_INET6;
+ else
+ goto error;
+
+
+ /* n_net field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ nnet = 0;
+ bits = inet_net_pton(naddrtype, tmpbuf, &nnet, sizeof nnet);
+ if (bits < 0) {
+ goto error;
+ }
+
+ /* nnet = ntohl(nnet); */ /* keep in network order for nwent */
+
+ ne->n_name = name;
+ ne->n_aliases = aliases;
+ ne->n_addrtype = naddrtype;
+ ne->n_length = bits;
+ ne->n_addr = malloc(sizeof nnet);
+ if (ne->n_addr == NULL) {
+ goto error;
+ }
+
+ memcpy(ne->n_addr, &nnet, sizeof nnet);
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ free_array(aliases, 0);
+
+ return (-1);
+}
+
+
+/* ------------------------- struct nwent ------------------------- */
+
+
+/* +++++++++++++++++++++++++ struct netent +++++++++++++++++++++++++ */
+
+/*%
+ * int irp_marshall_ne(struct netent *ne, char **buffer, size_t *len)
+ *
+ * notes: \li
+ *
+ * See at top.
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ *
+ */
+
+int
+irp_marshall_ne(struct netent *ne, char **buffer, size_t *len) {
+ size_t need = 1; /*%< for null byte */
+ char nAddrType[24];
+ char nNet[MAXPADDRSIZE];
+ const char *fieldsep = COLONSTR;
+ long nval;
+
+ if (ne == NULL || len == NULL) {
+ return (-1);
+ }
+
+ strcpy(nAddrType, ADDR_T_STR(ne->n_addrtype));
+
+ nval = htonl(ne->n_net);
+ if (inet_ntop(ne->n_addrtype, &nval, nNet, sizeof nNet) == NULL) {
+ return (-1);
+ }
+
+ need += strlen(ne->n_name) + 1;
+ need += joinlength(ne->n_aliases) + 1;
+ need += strlen(nAddrType) + 1;
+ need += strlen(nNet) + 1;
+
+ if (buffer == NULL) {
+ *len = need;
+ return (0);
+ }
+
+ if (*buffer != NULL && need > *len) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (*buffer == NULL) {
+ need += 2; /*%< for CRLF */
+ *buffer = memget(need);
+ if (*buffer == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ *len = need;
+ }
+
+ strcpy(*buffer, ne->n_name); strcat(*buffer, fieldsep);
+ joinarray(ne->n_aliases, *buffer, COMMA) ; strcat(*buffer, fieldsep);
+ strcat(*buffer, nAddrType); strcat(*buffer, fieldsep);
+ strcat(*buffer, nNet); strcat(*buffer, fieldsep);
+
+ return (0);
+}
+
+/*%
+ * int irp_unmarshall_ne(struct netent *ne, char *buffer)
+ *
+ * notes: \li
+ *
+ * See note up top.
+ *
+ * return: \li
+ *
+ * 0 on success and -1 on failure.
+ *
+ */
+
+int
+irp_unmarshall_ne(struct netent *ne, char *buffer) {
+ char *p, *q;
+ int naddrtype;
+ long nnet;
+ int bits;
+ char *name = NULL;
+ char **aliases = NULL;
+ char tmpbuf[24];
+ char *tb;
+ char fieldsep = ':';
+ int myerrno = EINVAL;
+
+ if (ne == NULL || buffer == NULL) {
+ goto error;
+ }
+
+ p = buffer;
+
+ /* n_name field */
+ name = NULL;
+ if (getfield(&name, 0, &p, fieldsep) == NULL || strlen(name) == 0U) {
+ goto error;
+ }
+
+
+ /* n_aliases field. Aliases are separated by commas */
+ q = strchr(p, fieldsep);
+ if (q == NULL) {
+ goto error;
+ }
+ aliases = splitarray(p, q, COMMA);
+ if (aliases == NULL) {
+ myerrno = errno;
+ goto error;
+ }
+ p = q + 1;
+
+
+ /* h_addrtype field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ if (strcmp(tmpbuf, "AF_INET") == 0)
+ naddrtype = AF_INET;
+ else if (strcmp(tmpbuf, "AF_INET6") == 0)
+ naddrtype = AF_INET6;
+ else
+ goto error;
+
+
+ /* n_net field */
+ tb = tmpbuf;
+ if (getfield(&tb, sizeof tmpbuf, &p, fieldsep) == NULL ||
+ strlen(tb) == 0U) {
+ goto error;
+ }
+ bits = inet_net_pton(naddrtype, tmpbuf, &nnet, sizeof nnet);
+ if (bits < 0) {
+ goto error;
+ }
+ nnet = ntohl(nnet);
+
+ ne->n_name = name;
+ ne->n_aliases = aliases;
+ ne->n_addrtype = naddrtype;
+ ne->n_net = nnet;
+
+ return (0);
+
+ error:
+ errno = myerrno;
+
+ if (name != NULL) free(name);
+ free_array(aliases, 0);
+
+ return (-1);
+}
+
+
+/* ------------------------- struct netent ------------------------- */
+
+
+/* =========================================================================== */
+
+/*%
+ * static char ** splitarray(const char *buffer, const char *buffend, char delim)
+ *
+ * notes: \li
+ *
+ * Split a delim separated astring. Not allowed
+ * to have two delims next to each other. BUFFER points to begining of
+ * string, BUFFEND points to one past the end of the string
+ * (i.e. points at where the null byte would be if null
+ * terminated).
+ *
+ * return: \li
+ *
+ * Returns a malloced array of pointers, each pointer pointing to a
+ * malloced string. If BUFEER is an empty string, then return values is
+ * array of 1 pointer that is NULL. Returns NULL on failure.
+ *
+ */
+
+static char **
+splitarray(const char *buffer, const char *buffend, char delim) {
+ const char *p, *q;
+ int count = 0;
+ char **arr = NULL;
+ char **aptr;
+
+ if (buffend < buffer)
+ return (NULL);
+ else if (buffend > buffer && *buffer == delim)
+ return (NULL);
+ else if (buffend > buffer && *(buffend - 1) == delim)
+ return (NULL);
+
+ /* count the number of field and make sure none are empty */
+ if (buffend > buffer + 1) {
+ for (count = 1, q = buffer ; q != buffend ; q++) {
+ if (*q == delim) {
+ if (q > buffer && (*(q - 1) == delim)) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ count++;
+ }
+ }
+ }
+
+ if (count > 0) {
+ count++ ; /*%< for NULL at end */
+ aptr = arr = malloc(count * sizeof (char *));
+ if (aptr == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+
+ memset(arr, 0x0, count * sizeof (char *));
+ for (p = buffer ; p < buffend ; p++) {
+ for (q = p ; *q != delim && q != buffend ; q++)
+ /* nothing */;
+ *aptr = strndup(p, q - p);
+
+ p = q;
+ aptr++;
+ }
+ *aptr = NULL;
+ } else {
+ arr = malloc(sizeof (char *));
+ if (arr == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+
+ *arr = NULL;
+ }
+
+ return (arr);
+}
+
+/*%
+ * static size_t joinlength(char * const *argv)
+ *
+ * return: \li
+ *
+ * the number of bytes in all the arrays pointed at
+ * by argv, including their null bytes(which will usually be turned
+ * into commas).
+ *
+ *
+ */
+
+static size_t
+joinlength(char * const *argv) {
+ int len = 0;
+
+ while (argv && *argv) {
+ len += (strlen(*argv) + 1);
+ argv++;
+ }
+
+ return (len);
+}
+
+/*%
+ * int joinarray(char * const *argv, char *buffer, char delim)
+ *
+ * notes: \li
+ *
+ * Copy all the ARGV strings into the end of BUFFER
+ * separating them with DELIM. BUFFER is assumed to have
+ * enough space to hold everything and to be already null-terminated.
+ *
+ * return: \li
+ *
+ * 0 unless argv or buffer is NULL.
+ *
+ *
+ */
+
+static int
+joinarray(char * const *argv, char *buffer, char delim) {
+ char * const *p;
+ char sep[2];
+
+ if (argv == NULL || buffer == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ sep[0] = delim;
+ sep[1] = 0x0;
+
+ for (p = argv ; *p != NULL ; p++) {
+ strcat(buffer, *p);
+ if (*(p + 1) != NULL) {
+ strcat(buffer, sep);
+ }
+ }
+
+ return (0);
+}
+
+/*%
+ * static char * getfield(char **res, size_t reslen, char **ptr, char delim)
+ *
+ * notes: \li
+ *
+ * Stores in *RES, which is a buffer of length RESLEN, a
+ * copy of the bytes from *PTR up to and including the first
+ * instance of DELIM. If *RES is NULL, then it will be
+ * assigned a malloced buffer to hold the copy. *PTR is
+ * modified to point at the found delimiter.
+ *
+ * return: \li
+ *
+ * If there was no delimiter, then NULL is returned,
+ * otherewise *RES is returned.
+ *
+ */
+
+static char *
+getfield(char **res, size_t reslen, char **ptr, char delim) {
+ char *q;
+
+ if (res == NULL || ptr == NULL || *ptr == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ q = strchr(*ptr, delim);
+
+ if (q == NULL) {
+ errno = EINVAL;
+ return (NULL);
+ } else {
+ if (*res == NULL) {
+ *res = strndup(*ptr, q - *ptr);
+ } else {
+ if ((size_t)(q - *ptr + 1) > reslen) { /*%< to big for res */
+ errno = EINVAL;
+ return (NULL);
+ } else {
+ strncpy(*res, *ptr, q - *ptr);
+ (*res)[q - *ptr] = 0x0;
+ }
+ }
+ *ptr = q + 1;
+ }
+
+ return (*res);
+}
+
+
+
+
+
+#ifndef HAVE_STRNDUP
+/*
+ * static char * strndup(const char *str, size_t len)
+ *
+ * notes: \li
+ *
+ * like strdup, except do len bytes instead of the whole string. Always
+ * null-terminates.
+ *
+ * return: \li
+ *
+ * The newly malloced string.
+ *
+ */
+
+static char *
+strndup(const char *str, size_t len) {
+ char *p = malloc(len + 1);
+
+ if (p == NULL)
+ return (NULL);
+ strncpy(p, str, len);
+ p[len] = 0x0;
+ return (p);
+}
+#endif
+
+#if WANT_MAIN
+
+/*%
+ * static int strcmp_nws(const char *a, const char *b)
+ *
+ * notes: \li
+ *
+ * do a strcmp, except uneven lengths of whitespace compare the same
+ *
+ * return: \li
+ *
+ */
+
+static int
+strcmp_nws(const char *a, const char *b) {
+ while (*a && *b) {
+ if (isspace(*a) && isspace(*b)) {
+ do {
+ a++;
+ } while (isspace(*a));
+ do {
+ b++;
+ } while (isspace(*b));
+ }
+ if (*a < *b)
+ return (-1);
+ else if (*a > *b)
+ return (1);
+
+ a++;
+ b++;;
+ }
+
+ if (*a == *b)
+ return (0);
+ else if (*a > *b)
+ return (1);
+ else
+ return (-1);
+}
+
+#endif
+
+/*%
+ * static void free_array(char **argv, size_t entries)
+ *
+ * notes: \li
+ *
+ * Free argv and each of the pointers inside it. The end of
+ * the array is when a NULL pointer is found inside. If
+ * entries is > 0, then NULL pointers inside the array do
+ * not indicate the end of the array.
+ *
+ */
+
+static void
+free_array(char **argv, size_t entries) {
+ char **p = argv;
+ int useEntries = (entries > 0U);
+
+ if (argv == NULL)
+ return;
+
+ while ((useEntries && entries > 0U) || *p) {
+ if (*p)
+ free(*p);
+ p++;
+ if (useEntries)
+ entries--;
+ }
+ free(argv);
+}
+
+
+
+
+
+/* ************************************************** */
+
+#if WANT_MAIN
+
+/*% takes an option to indicate what sort of marshalling(read the code) and
+ an argument. If the argument looks like a marshalled buffer(has a ':'
+ embedded) then it's unmarshalled and the remarshalled and the new string
+ is compared to the old one.
+*/
+
+int
+main(int argc, char **argv) {
+ char buffer[1024];
+ char *b = &buffer[0];
+ size_t len = sizeof buffer;
+ char option;
+
+ if (argc < 2 || argv[1][0] != '-')
+ exit(1);
+
+ option = argv[1][1];
+ argv++;
+ argc--;
+
+
+#if 0
+ {
+ char buff[10];
+ char *p = argv[1], *q = &buff[0];
+
+ while (getfield(&q, sizeof buff, &p, ':') != NULL) {
+ printf("field: \"%s\"\n", q);
+ p++;
+ }
+ printf("p is now \"%s\"\n", p);
+ }
+#endif
+
+#if 0
+ {
+ char **x = splitarray(argv[1], argv[1] + strlen(argv[1]),
+ argv[2][0]);
+ char **p;
+
+ if (x == NULL)
+ printf("split failed\n");
+
+ for (p = x ; p != NULL && *p != NULL ; p++) {
+ printf("\"%s\"\n", *p);
+ }
+ }
+#endif
+
+#if 1
+ switch(option) {
+ case 'n': {
+ struct nwent ne;
+ int i;
+
+ if (strchr(argv[1], ':') != NULL) {
+ if (irp_unmarshall_nw(&ne, argv[1]) != 0) {
+ printf("Unmarhsalling failed\n");
+ exit(1);
+ }
+
+ printf("Name: \"%s\"\n", ne.n_name);
+ printf("Aliases:");
+ for (i = 0 ; ne.n_aliases[i] != NULL ; i++)
+ printf("\n\t\"%s\"", ne.n_aliases[i]);
+ printf("\nAddrtype: %s\n", ADDR_T_STR(ne.n_addrtype));
+ inet_net_ntop(ne.n_addrtype, ne.n_addr, ne.n_length,
+ buffer, sizeof buffer);
+ printf("Net: \"%s\"\n", buffer);
+ *((long*)ne.n_addr) = htonl(*((long*)ne.n_addr));
+ inet_net_ntop(ne.n_addrtype, ne.n_addr, ne.n_length,
+ buffer, sizeof buffer);
+ printf("Corrected Net: \"%s\"\n", buffer);
+ } else {
+ struct netent *np1 = getnetbyname(argv[1]);
+ ne.n_name = np1->n_name;
+ ne.n_aliases = np1->n_aliases;
+ ne.n_addrtype = np1->n_addrtype;
+ ne.n_addr = &np1->n_net;
+ ne.n_length = (IN_CLASSA(np1->n_net) ?
+ 8 :
+ (IN_CLASSB(np1->n_net) ?
+ 16 :
+ (IN_CLASSC(np1->n_net) ?
+ 24 : -1)));
+ np1->n_net = htonl(np1->n_net);
+ if (irp_marshall_nw(&ne, &b, &len) != 0) {
+ printf("Marshalling failed\n");
+ }
+ printf("%s\n", b);
+ }
+ break;
+ }
+
+
+ case 'r': {
+ char **hosts, **users, **domains;
+ size_t entries;
+ int i;
+ char *buff;
+ size_t size;
+ char *ngname;
+
+ if (strchr(argv[1], '(') != NULL) {
+ if (irp_unmarshall_ng(&ngname, &entries,
+ &hosts, &users, &domains,
+ argv[1]) != 0) {
+ printf("unmarshall failed\n");
+ exit(1);
+ }
+
+#define STRVAL(x) (x == NULL ? "*" : x)
+
+ printf("%s {\n", ngname);
+ for (i = 0 ; i < entries ; i++)
+ printf("\t\"%s\" : \"%s\" : \"%s\"\n",
+ STRVAL(hosts[i]),
+ STRVAL(users[i]),
+ STRVAL(domains[i]));
+ printf("}\n\n\n");
+
+
+ irp_marshall_ng_start(ngname, NULL, &size);
+ for (i = 0 ; i < entries ; i++)
+ irp_marshall_ng_next(hosts[i], users[i],
+ domains[i], NULL, &size);
+ irp_marshall_ng_end(NULL, &size);
+
+ buff = malloc(size);
+
+ irp_marshall_ng_start(ngname, buff, &size);
+ for (i = 0 ; i < entries ; i++) {
+ if (irp_marshall_ng_next(hosts[i], users[i],
+ domains[i], buff,
+ &size) != 0)
+ printf("next marshalling failed.\n");
+ }
+ irp_marshall_ng_end(buff, &size);
+
+ if (strcmp_nws(argv[1], buff) != 0) {
+ printf("compare failed:\n\t%s\n\t%s\n",
+ buffer, argv[1]);
+ } else {
+ printf("compare ok\n");
+ }
+ } else {
+ char *h, *u, *d, *buff;
+ size_t size;
+
+ /* run through two times. First to figure out how
+ much of a buffer we need. Second to do the
+ actual marshalling */
+
+ setnetgrent(argv[1]);
+ irp_marshall_ng_start(argv[1], NULL, &size);
+ while (getnetgrent(&h, &u, &d) == 1)
+ irp_marshall_ng_next(h, u, d, NULL, &size);
+ irp_marshall_ng_end(NULL, &size);
+ endnetgrent(argv[1]);
+
+ buff = malloc(size);
+
+ setnetgrent(argv[1]);
+ if (irp_marshall_ng_start(argv[1], buff, &size) != 0)
+ printf("Marshalling start failed\n");
+
+ while (getnetgrent(&h, &u, &d) == 1) {
+ if (irp_marshall_ng_next(h, u, d, buff, &size)
+ != 0) {
+ printf("Marshalling failed\n");
+ }
+ }
+
+ irp_marshall_ng_end(buff, &size);
+ endnetgrent();
+
+ printf("success: %s\n", buff);
+ }
+ break;
+ }
+
+
+
+ case 'h': {
+ struct hostent he, *hp;
+ int i;
+
+
+ if (strchr(argv[1], '@') != NULL) {
+ if (irp_unmarshall_ho(&he, argv[1]) != 0) {
+ printf("unmarshall failed\n");
+ exit(1);
+ }
+
+ printf("Host: \"%s\"\nAliases:", he.h_name);
+ for (i = 0 ; he.h_aliases[i] != NULL ; i++)
+ printf("\n\t\t\"%s\"", he.h_aliases[i]);
+ printf("\nAddr Type: \"%s\"\n",
+ ADDR_T_STR(he.h_addrtype));
+ printf("Length: %d\nAddresses:", he.h_length);
+ for (i = 0 ; he.h_addr_list[i] != 0 ; i++) {
+ inet_ntop(he.h_addrtype, he.h_addr_list[i],
+ buffer, sizeof buffer);
+ printf("\n\t\"%s\"\n", buffer);
+ }
+ printf("\n\n");
+
+ irp_marshall_ho(&he, &b, &len);
+ if (strcmp(argv[1], buffer) != 0) {
+ printf("compare failed:\n\t\"%s\"\n\t\"%s\"\n",
+ buffer, argv[1]);
+ } else {
+ printf("compare ok\n");
+ }
+ } else {
+ if ((hp = gethostbyname(argv[1])) == NULL) {
+ perror("gethostbyname");
+ printf("\"%s\"\n", argv[1]);
+ exit(1);
+ }
+
+ if (irp_marshall_ho(hp, &b, &len) != 0) {
+ printf("irp_marshall_ho failed\n");
+ exit(1);
+ }
+
+ printf("success: \"%s\"\n", buffer);
+ }
+ break;
+ }
+
+
+ case 's': {
+ struct servent *sv;
+ struct servent sv1;
+
+ if (strchr(argv[1], ':') != NULL) {
+ sv = &sv1;
+ memset(sv, 0xef, sizeof (struct servent));
+ if (irp_unmarshall_sv(sv, argv[1]) != 0) {
+ printf("unmarshall failed\n");
+
+ }
+
+ irp_marshall_sv(sv, &b, &len);
+ if (strcmp(argv[1], buffer) != 0) {
+ printf("compare failed:\n\t\"%s\"\n\t\"%s\"\n",
+ buffer, argv[1]);
+ } else {
+ printf("compare ok\n");
+ }
+ } else {
+ if ((sv = getservbyname(argv[1], argv[2])) == NULL) {
+ perror("getservent");
+ exit(1);
+ }
+
+ if (irp_marshall_sv(sv, &b, &len) != 0) {
+ printf("irp_marshall_sv failed\n");
+ exit(1);
+ }
+
+ printf("success: \"%s\"\n", buffer);
+ }
+ break;
+ }
+
+ case 'g': {
+ struct group *gr;
+ struct group gr1;
+
+ if (strchr(argv[1], ':') != NULL) {
+ gr = &gr1;
+ memset(gr, 0xef, sizeof (struct group));
+ if (irp_unmarshall_gr(gr, argv[1]) != 0) {
+ printf("unmarshall failed\n");
+
+ }
+
+ irp_marshall_gr(gr, &b, &len);
+ if (strcmp(argv[1], buffer) != 0) {
+ printf("compare failed:\n\t\"%s\"\n\t\"%s\"\n",
+ buffer, argv[1]);
+ } else {
+ printf("compare ok\n");
+ }
+ } else {
+ if ((gr = getgrnam(argv[1])) == NULL) {
+ perror("getgrnam");
+ exit(1);
+ }
+
+ if (irp_marshall_gr(gr, &b, &len) != 0) {
+ printf("irp_marshall_gr failed\n");
+ exit(1);
+ }
+
+ printf("success: \"%s\"\n", buffer);
+ }
+ break;
+ }
+
+
+ case 'p': {
+ struct passwd *pw;
+ struct passwd pw1;
+
+ if (strchr(argv[1], ':') != NULL) {
+ pw = &pw1;
+ memset(pw, 0xef, sizeof (*pw));
+ if (irp_unmarshall_pw(pw, argv[1]) != 0) {
+ printf("unmarshall failed\n");
+ exit(1);
+ }
+
+ printf("User: \"%s\"\nPasswd: \"%s\"\nUid: %ld\nGid: %ld\n",
+ pw->pw_name, pw->pw_passwd, (long)pw->pw_uid,
+ (long)pw->pw_gid);
+ printf("Class: \"%s\"\nChange: %ld\nGecos: \"%s\"\n",
+ pw->pw_class, (long)pw->pw_change, pw->pw_gecos);
+ printf("Shell: \"%s\"\nDirectory: \"%s\"\n",
+ pw->pw_shell, pw->pw_dir);
+
+ pw = getpwnam(pw->pw_name);
+ irp_marshall_pw(pw, &b, &len);
+ if (strcmp(argv[1], buffer) != 0) {
+ printf("compare failed:\n\t\"%s\"\n\t\"%s\"\n",
+ buffer, argv[1]);
+ } else {
+ printf("compare ok\n");
+ }
+ } else {
+ if ((pw = getpwnam(argv[1])) == NULL) {
+ perror("getpwnam");
+ exit(1);
+ }
+
+ if (irp_marshall_pw(pw, &b, &len) != 0) {
+ printf("irp_marshall_pw failed\n");
+ exit(1);
+ }
+
+ printf("success: \"%s\"\n", buffer);
+ }
+ break;
+ }
+
+ default:
+ printf("Wrong option: %c\n", option);
+ break;
+ }
+
+#endif
+
+ return (0);
+}
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irs_data.c b/usr/src/lib/libresolv2_joy/common/irs/irs_data.c
new file mode 100644
index 0000000000..f12ca20f38
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irs_data.c
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: irs_data.c,v 1.12 2007/08/27 03:32:26 marka Exp $";
+#endif
+
+#include "port_before.h"
+
+#ifndef __BIND_NOSTATIC
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+#include <isc/memcluster.h>
+
+#ifdef DO_PTHREADS
+#include <pthread.h>
+#endif
+
+#include <irs.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#include "irs_data.h"
+#undef _res
+#if !(__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+#undef h_errno
+extern int h_errno;
+#endif
+
+extern struct __res_state _res;
+
+#ifdef DO_PTHREADS
+static pthread_key_t key;
+static int once = 0;
+#else
+static struct net_data *net_data;
+#endif
+
+void
+irs_destroy(void) {
+#ifndef DO_PTHREADS
+ if (net_data != NULL)
+ net_data_destroy(net_data);
+ net_data = NULL;
+#endif
+}
+
+void
+net_data_destroy(void *p) {
+ struct net_data *net_data = p;
+
+ res_ndestroy(net_data->res);
+ if (net_data->gr != NULL) {
+ (*net_data->gr->close)(net_data->gr);
+ net_data->gr = NULL;
+ }
+ if (net_data->pw != NULL) {
+ (*net_data->pw->close)(net_data->pw);
+ net_data->pw = NULL;
+ }
+ if (net_data->sv != NULL) {
+ (*net_data->sv->close)(net_data->sv);
+ net_data->sv = NULL;
+ }
+ if (net_data->pr != NULL) {
+ (*net_data->pr->close)(net_data->pr);
+ net_data->pr = NULL;
+ }
+ if (net_data->ho != NULL) {
+ (*net_data->ho->close)(net_data->ho);
+ net_data->ho = NULL;
+ }
+ if (net_data->nw != NULL) {
+ (*net_data->nw->close)(net_data->nw);
+ net_data->nw = NULL;
+ }
+ if (net_data->ng != NULL) {
+ (*net_data->ng->close)(net_data->ng);
+ net_data->ng = NULL;
+ }
+ if (net_data->ho_data != NULL) {
+ free(net_data->ho_data);
+ net_data->ho_data = NULL;
+ }
+ if (net_data->nw_data != NULL) {
+ free(net_data->nw_data);
+ net_data->nw_data = NULL;
+ }
+
+ (*net_data->irs->close)(net_data->irs);
+ memput(net_data, sizeof *net_data);
+}
+
+/*%
+ * applications that need a specific config file other than
+ * _PATH_IRS_CONF should call net_data_init directly rather than letting
+ * the various wrapper functions make the first call. - brister
+ */
+
+struct net_data *
+net_data_init(const char *conf_file) {
+#ifdef DO_PTHREADS
+#ifndef LIBBIND_MUTEX_INITIALIZER
+#define LIBBIND_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#endif
+ static pthread_mutex_t keylock = LIBBIND_MUTEX_INITIALIZER;
+ struct net_data *net_data;
+
+ if (!once) {
+ if (pthread_mutex_lock(&keylock) != 0)
+ return (NULL);
+ if (!once) {
+ if (pthread_key_create(&key, net_data_destroy) != 0) {
+ (void)pthread_mutex_unlock(&keylock);
+ return (NULL);
+ }
+ once = 1;
+ }
+ if (pthread_mutex_unlock(&keylock) != 0)
+ return (NULL);
+ }
+ net_data = pthread_getspecific(key);
+#endif
+
+ if (net_data == NULL) {
+ net_data = net_data_create(conf_file);
+ if (net_data == NULL)
+ return (NULL);
+#ifdef DO_PTHREADS
+ if (pthread_setspecific(key, net_data) != 0) {
+ net_data_destroy(net_data);
+ return (NULL);
+ }
+#endif
+ }
+
+ return (net_data);
+}
+
+struct net_data *
+net_data_create(const char *conf_file) {
+ struct net_data *net_data;
+
+ net_data = memget(sizeof (struct net_data));
+ if (net_data == NULL)
+ return (NULL);
+ memset(net_data, 0, sizeof (struct net_data));
+
+ if ((net_data->irs = irs_gen_acc("", conf_file)) == NULL) {
+ memput(net_data, sizeof (struct net_data));
+ return (NULL);
+ }
+#ifndef DO_PTHREADS
+ (*net_data->irs->res_set)(net_data->irs, &_res, NULL);
+#endif
+
+ net_data->res = (*net_data->irs->res_get)(net_data->irs);
+ if (net_data->res == NULL) {
+ (*net_data->irs->close)(net_data->irs);
+ memput(net_data, sizeof (struct net_data));
+ return (NULL);
+ }
+
+ if ((net_data->res->options & RES_INIT) == 0U &&
+ res_ninit(net_data->res) == -1) {
+ (*net_data->irs->close)(net_data->irs);
+ memput(net_data, sizeof (struct net_data));
+ return (NULL);
+ }
+
+ return (net_data);
+}
+
+void
+net_data_minimize(struct net_data *net_data) {
+ res_nclose(net_data->res);
+}
+
+#ifdef _REENTRANT
+struct __res_state *
+__res_state(void) {
+ /* NULL param here means use the default config file. */
+ struct net_data *net_data = net_data_init(NULL);
+ if (net_data && net_data->res)
+ return (net_data->res);
+
+ return (&_res);
+}
+#else
+#ifdef __linux
+struct __res_state *
+__res_state(void) {
+ return (&_res);
+}
+#endif
+#endif
+
+int *
+__h_errno(void) {
+ /* NULL param here means use the default config file. */
+ struct net_data *net_data = net_data_init(NULL);
+ if (net_data && net_data->res)
+ return (&net_data->res->res_h_errno);
+#ifdef ORIGINAL_ISC_CODE
+#if !(__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+ return(&_res.res_h_errno);
+#else
+ return (&h_errno);
+#endif
+#else
+ return (&h_errno);
+#endif /* ORIGINAL_ISC_CODE */
+}
+
+void
+__h_errno_set(struct __res_state *res, int err) {
+
+
+#if (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+ res->res_h_errno = err;
+#else
+ h_errno = res->res_h_errno = err;
+#endif
+}
+
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irs_data.h b/usr/src/lib/libresolv2_joy/common/irs/irs_data.h
new file mode 100644
index 0000000000..cb814fd8b1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irs_data.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: irs_data.h,v 1.3 2005/04/27 04:56:30 sra Exp $
+ */
+
+#ifndef __BIND_NOSTATIC
+
+#define net_data_init __net_data_init
+
+struct net_data {
+ struct irs_acc * irs;
+
+ struct irs_gr * gr;
+ struct irs_pw * pw;
+ struct irs_sv * sv;
+ struct irs_pr * pr;
+ struct irs_ho * ho;
+ struct irs_nw * nw;
+ struct irs_ng * ng;
+
+ struct group * gr_last;
+ struct passwd * pw_last;
+ struct servent * sv_last;
+ struct protoent * pr_last;
+ struct netent * nw_last; /*%< should have been ne_last */
+ struct nwent * nww_last;
+ struct hostent * ho_last;
+
+ unsigned int gr_stayopen :1;
+ unsigned int pw_stayopen :1;
+ unsigned int sv_stayopen :1;
+ unsigned int pr_stayopen :1;
+ unsigned int ho_stayopen :1;
+ unsigned int nw_stayopen :1;
+
+ void * nw_data;
+ void * ho_data;
+
+ struct __res_state * res; /*%< for gethostent.c */
+};
+
+extern struct net_data * net_data_init(const char *conf_file);
+extern void net_data_minimize(struct net_data *);
+
+#endif /*__BIND_NOSTATIC*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/irs_p.h b/usr/src/lib/libresolv2_joy/common/irs/irs_p.h
new file mode 100644
index 0000000000..2a0a933fce
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/irs_p.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: irs_p.h,v 1.3 2005/04/27 04:56:30 sra Exp $
+ */
+
+#ifndef _IRS_P_H_INCLUDED
+#define _IRS_P_H_INCLUDED
+
+#include <stdio.h>
+
+#include "pathnames.h"
+
+#define IRS_SV_MAXALIASES 35
+
+struct lcl_sv {
+ FILE * fp;
+ char line[BUFSIZ+1];
+ struct servent serv;
+ char * serv_aliases[IRS_SV_MAXALIASES];
+};
+
+#define irs_nul_ng __irs_nul_ng
+#define map_v4v6_address __map_v4v6_address
+#define make_group_list __make_group_list
+#define irs_lclsv_fnxt __irs_lclsv_fnxt
+
+extern void map_v4v6_address(const char *src, char *dst);
+extern int make_group_list(struct irs_gr *, const char *,
+ gid_t, gid_t *, int *);
+extern struct irs_ng * irs_nul_ng(struct irs_acc *);
+extern struct servent * irs_lclsv_fnxt(struct lcl_sv *);
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl.c b/usr/src/lib/libresolv2_joy/common/irs/lcl.c
new file mode 100644
index 0000000000..9dd6967b87
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: lcl.c,v 1.4 2005/04/27 04:56:30 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <isc/memcluster.h>
+
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "lcl_p.h"
+
+/* Forward. */
+
+static void lcl_close(struct irs_acc *);
+static struct __res_state * lcl_res_get(struct irs_acc *);
+static void lcl_res_set(struct irs_acc *, struct __res_state *,
+ void (*)(void *));
+
+/* Public */
+
+struct irs_acc *
+irs_lcl_acc(const char *options) {
+ struct irs_acc *acc;
+ struct lcl_p *lcl;
+
+ UNUSED(options);
+
+ if (!(acc = memget(sizeof *acc))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(acc, 0x5e, sizeof *acc);
+ if (!(lcl = memget(sizeof *lcl))) {
+ errno = ENOMEM;
+ free(acc);
+ return (NULL);
+ }
+ memset(lcl, 0x5e, sizeof *lcl);
+ lcl->res = NULL;
+ lcl->free_res = NULL;
+ acc->private = lcl;
+#ifdef WANT_IRS_GR
+ acc->gr_map = irs_lcl_gr;
+#else
+ acc->gr_map = NULL;
+#endif
+#ifdef WANT_IRS_PW
+ acc->pw_map = irs_lcl_pw;
+#else
+ acc->pw_map = NULL;
+#endif
+ acc->sv_map = irs_lcl_sv;
+ acc->pr_map = irs_lcl_pr;
+ acc->ho_map = irs_lcl_ho;
+ acc->nw_map = irs_lcl_nw;
+ acc->ng_map = irs_lcl_ng;
+ acc->res_get = lcl_res_get;
+ acc->res_set = lcl_res_set;
+ acc->close = lcl_close;
+ return (acc);
+}
+
+/* Methods */
+static struct __res_state *
+lcl_res_get(struct irs_acc *this) {
+ struct lcl_p *lcl = (struct lcl_p *)this->private;
+
+ if (lcl->res == NULL) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (res == NULL)
+ return (NULL);
+ memset(res, 0, sizeof *res);
+ lcl_res_set(this, res, free);
+ }
+
+ if ((lcl->res->options & RES_INIT) == 0U &&
+ res_ninit(lcl->res) < 0)
+ return (NULL);
+
+ return (lcl->res);
+}
+
+static void
+lcl_res_set(struct irs_acc *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct lcl_p *lcl = (struct lcl_p *)this->private;
+
+ if (lcl->res && lcl->free_res) {
+ res_nclose(lcl->res);
+ (*lcl->free_res)(lcl->res);
+ }
+
+ lcl->res = res;
+ lcl->free_res = free_res;
+}
+
+static void
+lcl_close(struct irs_acc *this) {
+ struct lcl_p *lcl = (struct lcl_p *)this->private;
+
+ if (lcl) {
+ if (lcl->free_res)
+ (*lcl->free_res)(lcl->res);
+ memput(lcl, sizeof *lcl);
+ }
+ memput(this, sizeof *this);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl_ho.c b/usr/src/lib/libresolv2_joy/common/irs/lcl_ho.c
new file mode 100644
index 0000000000..17c9a5e725
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl_ho.c
@@ -0,0 +1,578 @@
+/*
+ * Copyright (c) 1985, 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* from gethostnamadr.c 8.1 (Berkeley) 6/4/93 */
+/* BIND Id: gethnamaddr.c,v 8.15 1996/05/22 04:56:30 vixie Exp $ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: lcl_ho.c,v 1.5 2006/03/09 23:57:56 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports. */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "dns_p.h"
+#include "lcl_p.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) sprintf x
+#endif
+
+/* Definitions. */
+
+#define MAXALIASES 35
+#define MAXADDRS 35
+#define Max(a,b) ((a) > (b) ? (a) : (b))
+
+#if PACKETSZ > 1024
+#define MAXPACKET PACKETSZ
+#else
+#define MAXPACKET 1024
+#endif
+
+struct pvt {
+ FILE * fp;
+ struct hostent host;
+ char * h_addr_ptrs[MAXADDRS + 1];
+ char * host_aliases[MAXALIASES];
+ char hostbuf[8*1024];
+ u_char host_addr[16]; /*%< IPv4 or IPv6 */
+ struct __res_state *res;
+ void (*free_res)(void *);
+};
+
+typedef union {
+ int32_t al;
+ char ac;
+} align;
+
+static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
+static const u_char tunnelled[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0,0 };
+
+/* Forward. */
+
+static void ho_close(struct irs_ho *this);
+static struct hostent * ho_byname(struct irs_ho *this, const char *name);
+static struct hostent * ho_byname2(struct irs_ho *this, const char *name,
+ int af);
+static struct hostent * ho_byaddr(struct irs_ho *this, const void *addr,
+ int len, int af);
+static struct hostent * ho_next(struct irs_ho *this);
+static void ho_rewind(struct irs_ho *this);
+static void ho_minimize(struct irs_ho *this);
+static struct __res_state * ho_res_get(struct irs_ho *this);
+static void ho_res_set(struct irs_ho *this,
+ struct __res_state *res,
+ void (*free_res)(void *));
+static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,
+ const struct addrinfo *pai);
+
+static size_t ns_namelen(const char *);
+static int init(struct irs_ho *this);
+
+/* Portability. */
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+
+/* Public. */
+
+struct irs_ho *
+irs_lcl_ho(struct irs_acc *this) {
+ struct irs_ho *ho;
+ struct pvt *pvt;
+
+ UNUSED(this);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ if (!(ho = memget(sizeof *ho))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ho, 0x5e, sizeof *ho);
+ ho->private = pvt;
+ ho->close = ho_close;
+ ho->byname = ho_byname;
+ ho->byname2 = ho_byname2;
+ ho->byaddr = ho_byaddr;
+ ho->next = ho_next;
+ ho->rewind = ho_rewind;
+ ho->minimize = ho_minimize;
+ ho->res_get = ho_res_get;
+ ho->res_set = ho_res_set;
+ ho->addrinfo = ho_addrinfo;
+ return (ho);
+}
+
+/* Methods. */
+
+static void
+ho_close(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ ho_minimize(this);
+ if (pvt->fp)
+ (void) fclose(pvt->fp);
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct hostent *
+ho_byname(struct irs_ho *this, const char *name) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *hp;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ if (pvt->res->options & RES_USE_INET6) {
+ hp = ho_byname2(this, name, AF_INET6);
+ if (hp)
+ return (hp);
+ }
+ return (ho_byname2(this, name, AF_INET));
+}
+
+static struct hostent *
+ho_byname2(struct irs_ho *this, const char *name, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *hp;
+ char **hap;
+ size_t n;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ ho_rewind(this);
+ n = ns_namelen(name);
+ while ((hp = ho_next(this)) != NULL) {
+ size_t nn;
+
+ if (hp->h_addrtype != af)
+ continue;
+ nn = ns_namelen(hp->h_name);
+ if (strncasecmp(hp->h_name, name, Max(n, nn)) == 0)
+ goto found;
+ for (hap = hp->h_aliases; *hap; hap++) {
+ nn = ns_namelen(*hap);
+ if (strncasecmp(*hap, name, Max(n, nn)) == 0)
+ goto found;
+ }
+ }
+ found:
+ if (!hp) {
+ RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND);
+ return (NULL);
+ }
+ RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
+ return (hp);
+}
+
+static struct hostent *
+ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ const u_char *uaddr = addr;
+ struct hostent *hp;
+ int size;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ if (af == AF_INET6 && len == IN6ADDRSZ &&
+ (!memcmp(uaddr, mapped, sizeof mapped) ||
+ !memcmp(uaddr, tunnelled, sizeof tunnelled))) {
+ /* Unmap. */
+ addr = (const u_char *)addr + sizeof mapped;
+ uaddr += sizeof mapped;
+ af = AF_INET;
+ len = INADDRSZ;
+ }
+ switch (af) {
+ case AF_INET:
+ size = INADDRSZ;
+ break;
+ case AF_INET6:
+ size = IN6ADDRSZ;
+ break;
+ default:
+ errno = EAFNOSUPPORT;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ if (size > len) {
+ errno = EINVAL;
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+
+ /*
+ * Do the search.
+ */
+ ho_rewind(this);
+ while ((hp = ho_next(this)) != NULL) {
+ char **hap;
+
+ for (hap = hp->h_addr_list; *hap; hap++) {
+ const u_char *taddr = (const u_char *)*hap;
+ int taf = hp->h_addrtype;
+ int tlen = hp->h_length;
+
+ if (taf == AF_INET6 && tlen == IN6ADDRSZ &&
+ (!memcmp(taddr, mapped, sizeof mapped) ||
+ !memcmp(taddr, tunnelled, sizeof tunnelled))) {
+ /* Unmap. */
+ taddr += sizeof mapped;
+ taf = AF_INET;
+ tlen = INADDRSZ;
+ }
+ if (taf == af && tlen == len &&
+ !memcmp(taddr, uaddr, tlen))
+ goto found;
+ }
+ }
+ found:
+ if (!hp) {
+ RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND);
+ return (NULL);
+ }
+ RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
+ return (hp);
+}
+
+static struct hostent *
+ho_next(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *cp, **q, *p;
+ char *bufp, *ndbuf, *dbuf = NULL;
+ int c, af, len, bufsiz, offset;
+
+ if (init(this) == -1)
+ return (NULL);
+
+ if (!pvt->fp)
+ ho_rewind(this);
+ if (!pvt->fp) {
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ bufp = pvt->hostbuf;
+ bufsiz = sizeof pvt->hostbuf;
+ offset = 0;
+ again:
+ if (!(p = fgets(bufp + offset, bufsiz - offset, pvt->fp))) {
+ RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND);
+ if (dbuf)
+ free(dbuf);
+ return (NULL);
+ }
+ if (!strchr(p, '\n') && !feof(pvt->fp)) {
+#define GROWBUF 1024
+ /* allocate space for longer line */
+ if (dbuf == NULL) {
+ if ((ndbuf = malloc(bufsiz + GROWBUF)) != NULL)
+ strcpy(ndbuf, bufp);
+ } else
+ ndbuf = realloc(dbuf, bufsiz + GROWBUF);
+ if (ndbuf) {
+ dbuf = ndbuf;
+ bufp = dbuf;
+ bufsiz += GROWBUF;
+ offset = strlen(dbuf);
+ } else {
+ /* allocation failed; skip this long line */
+ while ((c = getc(pvt->fp)) != EOF)
+ if (c == '\n')
+ break;
+ if (c != EOF)
+ ungetc(c, pvt->fp);
+ }
+ goto again;
+ }
+
+ p -= offset;
+ offset = 0;
+
+ if (*p == '#')
+ goto again;
+ if ((cp = strpbrk(p, "#\n")) != NULL)
+ *cp = '\0';
+ if (!(cp = strpbrk(p, " \t")))
+ goto again;
+ *cp++ = '\0';
+ if (inet_pton(AF_INET6, p, pvt->host_addr) > 0) {
+ af = AF_INET6;
+ len = IN6ADDRSZ;
+ } else if (inet_aton(p, (struct in_addr *)pvt->host_addr) > 0) {
+ if (pvt->res->options & RES_USE_INET6) {
+ map_v4v6_address((char*)pvt->host_addr,
+ (char*)pvt->host_addr);
+ af = AF_INET6;
+ len = IN6ADDRSZ;
+ } else {
+ af = AF_INET;
+ len = INADDRSZ;
+ }
+ } else {
+ goto again;
+ }
+ pvt->h_addr_ptrs[0] = (char *)pvt->host_addr;
+ pvt->h_addr_ptrs[1] = NULL;
+ pvt->host.h_addr_list = pvt->h_addr_ptrs;
+ pvt->host.h_length = len;
+ pvt->host.h_addrtype = af;
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ pvt->host.h_name = cp;
+ q = pvt->host.h_aliases = pvt->host_aliases;
+ if ((cp = strpbrk(cp, " \t")) != NULL)
+ *cp++ = '\0';
+ while (cp && *cp) {
+ if (*cp == ' ' || *cp == '\t') {
+ cp++;
+ continue;
+ }
+ if (q < &pvt->host_aliases[MAXALIASES - 1])
+ *q++ = cp;
+ if ((cp = strpbrk(cp, " \t")) != NULL)
+ *cp++ = '\0';
+ }
+ *q = NULL;
+ if (dbuf)
+ free(dbuf);
+ RES_SET_H_ERRNO(pvt->res, NETDB_SUCCESS);
+ return (&pvt->host);
+}
+
+static void
+ho_rewind(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp) {
+ if (fseek(pvt->fp, 0L, SEEK_SET) == 0)
+ return;
+ (void)fclose(pvt->fp);
+ }
+ if (!(pvt->fp = fopen(_PATH_HOSTS, "r")))
+ return;
+ if (fcntl(fileno(pvt->fp), F_SETFD, 1) < 0) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+}
+
+static void
+ho_minimize(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp != NULL) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+ if (pvt->res)
+ res_nclose(pvt->res);
+}
+
+static struct __res_state *
+ho_res_get(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ ho_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+ho_res_set(struct irs_ho *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+}
+
+struct lcl_res_target {
+ struct lcl_res_target *next;
+ int family;
+};
+
+/* XXX */
+extern struct addrinfo *hostent2addrinfo __P((struct hostent *,
+ const struct addrinfo *pai));
+
+static struct addrinfo *
+ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct hostent *hp;
+ struct lcl_res_target q, q2, *p;
+ struct addrinfo sentinel, *cur;
+
+ memset(&q, 0, sizeof(q2));
+ memset(&q2, 0, sizeof(q2));
+ memset(&sentinel, 0, sizeof(sentinel));
+ cur = &sentinel;
+
+ switch(pai->ai_family) {
+ case AF_UNSPEC: /*%< INET6 then INET4 */
+ q.family = AF_INET6;
+ q.next = &q2;
+ q2.family = AF_INET;
+ break;
+ case AF_INET6:
+ q.family = AF_INET6;
+ break;
+ case AF_INET:
+ q.family = AF_INET;
+ break;
+ default:
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY); /*%< ??? */
+ return(NULL);
+ }
+
+ for (p = &q; p; p = p->next) {
+ struct addrinfo *ai;
+
+ hp = (*this->byname2)(this, name, p->family);
+ if (hp == NULL) {
+ /* byname2 should've set an appropriate error */
+ continue;
+ }
+ if ((hp->h_name == NULL) || (hp->h_name[0] == 0) ||
+ (hp->h_addr_list[0] == NULL)) {
+ RES_SET_H_ERRNO(pvt->res, NO_RECOVERY);
+ continue;
+ }
+
+ ai = hostent2addrinfo(hp, pai);
+ if (ai) {
+ cur->ai_next = ai;
+ while (cur->ai_next)
+ cur = cur->ai_next;
+ }
+ }
+
+ if (sentinel.ai_next == NULL)
+ RES_SET_H_ERRNO(pvt->res, HOST_NOT_FOUND);
+
+ return(sentinel.ai_next);
+}
+
+/* Private. */
+
+static size_t
+ns_namelen(const char *s) {
+ int i;
+
+ for (i = strlen(s); i > 0 && s[i-1] == '.'; i--)
+ (void)NULL;
+ return ((size_t) i);
+}
+
+static int
+init(struct irs_ho *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res && !ho_res_get(this))
+ return (-1);
+ if (((pvt->res->options & RES_INIT) == 0U) &&
+ res_ninit(pvt->res) == -1)
+ return (-1);
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl_ng.c b/usr/src/lib/libresolv2_joy/common/irs/lcl_ng.c
new file mode 100644
index 0000000000..319725ce70
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl_ng.c
@@ -0,0 +1,446 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: lcl_ng.c,v 1.3 2005/04/27 04:56:31 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "lcl_p.h"
+
+/* Definitions */
+
+#define NG_HOST 0 /*%< Host name */
+#define NG_USER 1 /*%< User name */
+#define NG_DOM 2 /*%< and Domain name */
+#define LINSIZ 1024 /*%< Length of netgroup file line */
+/*
+ * XXX Warning XXX
+ * This code is a hack-and-slash special. It realy needs to be
+ * rewritten with things like strdup, and realloc in mind.
+ * More reasonable data structures would not be a bad thing.
+ */
+
+/*%
+ * Static Variables and functions used by setnetgrent(), getnetgrent() and
+ * endnetgrent().
+ *
+ * There are two linked lists:
+ * \li linelist is just used by setnetgrent() to parse the net group file via.
+ * parse_netgrp()
+ * \li netgrp is the list of entries for the current netgroup
+ */
+struct linelist {
+ struct linelist *l_next; /*%< Chain ptr. */
+ int l_parsed; /*%< Flag for cycles */
+ char * l_groupname; /*%< Name of netgroup */
+ char * l_line; /*%< Netgroup entrie(s) to be parsed */
+};
+
+struct ng_old_struct {
+ struct ng_old_struct *ng_next; /*%< Chain ptr */
+ char * ng_str[3]; /*%< Field pointers, see below */
+};
+
+struct pvt {
+ FILE *fp;
+ struct linelist *linehead;
+ struct ng_old_struct *nextgrp;
+ struct {
+ struct ng_old_struct *gr;
+ char *grname;
+ } grouphead;
+};
+
+/* Forward */
+
+static void ng_rewind(struct irs_ng *, const char*);
+static void ng_close(struct irs_ng *);
+static int ng_next(struct irs_ng *, const char **,
+ const char **, const char **);
+static int ng_test(struct irs_ng *, const char *,
+ const char *, const char *,
+ const char *);
+static void ng_minimize(struct irs_ng *);
+
+static int parse_netgrp(struct irs_ng *, const char*);
+static struct linelist *read_for_group(struct irs_ng *, const char *);
+static void freelists(struct irs_ng *);
+
+/* Public */
+
+struct irs_ng *
+irs_lcl_ng(struct irs_acc *this) {
+ struct irs_ng *ng;
+ struct pvt *pvt;
+
+ UNUSED(this);
+
+ if (!(ng = memget(sizeof *ng))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ng, 0x5e, sizeof *ng);
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(ng, sizeof *ng);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ ng->private = pvt;
+ ng->close = ng_close;
+ ng->next = ng_next;
+ ng->test = ng_test;
+ ng->rewind = ng_rewind;
+ ng->minimize = ng_minimize;
+ return (ng);
+}
+
+/* Methods */
+
+static void
+ng_close(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp != NULL)
+ fclose(pvt->fp);
+ freelists(this);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+/*%
+ * Parse the netgroup file looking for the netgroup and build the list
+ * of netgrp structures. Let parse_netgrp() and read_for_group() do
+ * most of the work.
+ */
+static void
+ng_rewind(struct irs_ng *this, const char *group) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp != NULL && fseek(pvt->fp, SEEK_CUR, 0L) == -1) {
+ fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+
+ if (pvt->fp == NULL || pvt->grouphead.gr == NULL ||
+ strcmp(group, pvt->grouphead.grname)) {
+ freelists(this);
+ if (pvt->fp != NULL)
+ fclose(pvt->fp);
+ pvt->fp = fopen(_PATH_NETGROUP, "r");
+ if (pvt->fp != NULL) {
+ if (parse_netgrp(this, group))
+ freelists(this);
+ if (!(pvt->grouphead.grname = strdup(group)))
+ freelists(this);
+ fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+ }
+ pvt->nextgrp = pvt->grouphead.gr;
+}
+
+/*%
+ * Get the next netgroup off the list.
+ */
+static int
+ng_next(struct irs_ng *this, const char **host, const char **user,
+ const char **domain)
+{
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->nextgrp) {
+ *host = pvt->nextgrp->ng_str[NG_HOST];
+ *user = pvt->nextgrp->ng_str[NG_USER];
+ *domain = pvt->nextgrp->ng_str[NG_DOM];
+ pvt->nextgrp = pvt->nextgrp->ng_next;
+ return (1);
+ }
+ return (0);
+}
+
+/*%
+ * Search for a match in a netgroup.
+ */
+static int
+ng_test(struct irs_ng *this, const char *name,
+ const char *host, const char *user, const char *domain)
+{
+ const char *ng_host, *ng_user, *ng_domain;
+
+ ng_rewind(this, name);
+ while (ng_next(this, &ng_host, &ng_user, &ng_domain))
+ if ((host == NULL || ng_host == NULL ||
+ !strcmp(host, ng_host)) &&
+ (user == NULL || ng_user == NULL ||
+ !strcmp(user, ng_user)) &&
+ (domain == NULL || ng_domain == NULL ||
+ !strcmp(domain, ng_domain))) {
+ freelists(this);
+ return (1);
+ }
+ freelists(this);
+ return (0);
+}
+
+static void
+ng_minimize(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp != NULL) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+}
+
+/* Private */
+
+/*%
+ * endnetgrent() - cleanup
+ */
+static void
+freelists(struct irs_ng *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct linelist *lp, *olp;
+ struct ng_old_struct *gp, *ogp;
+
+ lp = pvt->linehead;
+ while (lp) {
+ olp = lp;
+ lp = lp->l_next;
+ free(olp->l_groupname);
+ free(olp->l_line);
+ free((char *)olp);
+ }
+ pvt->linehead = NULL;
+ if (pvt->grouphead.grname) {
+ free(pvt->grouphead.grname);
+ pvt->grouphead.grname = NULL;
+ }
+ gp = pvt->grouphead.gr;
+ while (gp) {
+ ogp = gp;
+ gp = gp->ng_next;
+ if (ogp->ng_str[NG_HOST])
+ free(ogp->ng_str[NG_HOST]);
+ if (ogp->ng_str[NG_USER])
+ free(ogp->ng_str[NG_USER]);
+ if (ogp->ng_str[NG_DOM])
+ free(ogp->ng_str[NG_DOM]);
+ free((char *)ogp);
+ }
+ pvt->grouphead.gr = NULL;
+}
+
+/*%
+ * Parse the netgroup file setting up the linked lists.
+ */
+static int
+parse_netgrp(struct irs_ng *this, const char *group) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *spos, *epos;
+ int len, strpos;
+ char *pos, *gpos;
+ struct ng_old_struct *grp;
+ struct linelist *lp = pvt->linehead;
+
+ /*
+ * First, see if the line has already been read in.
+ */
+ while (lp) {
+ if (!strcmp(group, lp->l_groupname))
+ break;
+ lp = lp->l_next;
+ }
+ if (lp == NULL &&
+ (lp = read_for_group(this, group)) == NULL)
+ return (1);
+ if (lp->l_parsed) {
+ /*fprintf(stderr, "Cycle in netgroup %s\n", lp->l_groupname);*/
+ return (1);
+ } else
+ lp->l_parsed = 1;
+ pos = lp->l_line;
+ while (*pos != '\0') {
+ if (*pos == '(') {
+ if (!(grp = malloc(sizeof (struct ng_old_struct)))) {
+ freelists(this);
+ errno = ENOMEM;
+ return (1);
+ }
+ memset(grp, 0, sizeof (struct ng_old_struct));
+ grp->ng_next = pvt->grouphead.gr;
+ pvt->grouphead.gr = grp;
+ pos++;
+ gpos = strsep(&pos, ")");
+ for (strpos = 0; strpos < 3; strpos++) {
+ if ((spos = strsep(&gpos, ","))) {
+ while (*spos == ' ' || *spos == '\t')
+ spos++;
+ if ((epos = strpbrk(spos, " \t"))) {
+ *epos = '\0';
+ len = epos - spos;
+ } else
+ len = strlen(spos);
+ if (len > 0) {
+ if(!(grp->ng_str[strpos]
+ = (char *)
+ malloc(len + 1))) {
+ freelists(this);
+ return (1);
+ }
+ memcpy(grp->ng_str[strpos],
+ spos,
+ len + 1);
+ }
+ } else
+ goto errout;
+ }
+ } else {
+ spos = strsep(&pos, ", \t");
+ if (spos != NULL && parse_netgrp(this, spos)) {
+ freelists(this);
+ return (1);
+ }
+ }
+ if (pos == NULL)
+ break;
+ while (*pos == ' ' || *pos == ',' || *pos == '\t')
+ pos++;
+ }
+ return (0);
+ errout:
+ /*fprintf(stderr, "Bad netgroup %s at ..%s\n", lp->l_groupname,
+ spos);*/
+ return (1);
+}
+
+/*%
+ * Read the netgroup file and save lines until the line for the netgroup
+ * is found. Return 1 if eof is encountered.
+ */
+static struct linelist *
+read_for_group(struct irs_ng *this, const char *group) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *pos, *spos, *linep = NULL, *olinep;
+ int len, olen, cont;
+ struct linelist *lp;
+ char line[LINSIZ + 1];
+
+ while (fgets(line, LINSIZ, pvt->fp) != NULL) {
+ pos = line;
+ if (*pos == '#')
+ continue;
+ while (*pos == ' ' || *pos == '\t')
+ pos++;
+ spos = pos;
+ while (*pos != ' ' && *pos != '\t' && *pos != '\n' &&
+ *pos != '\0')
+ pos++;
+ len = pos - spos;
+ while (*pos == ' ' || *pos == '\t')
+ pos++;
+ if (*pos != '\n' && *pos != '\0') {
+ if (!(lp = malloc(sizeof (*lp)))) {
+ freelists(this);
+ return (NULL);
+ }
+ lp->l_parsed = 0;
+ if (!(lp->l_groupname = malloc(len + 1))) {
+ free(lp);
+ freelists(this);
+ return (NULL);
+ }
+ memcpy(lp->l_groupname, spos, len);
+ *(lp->l_groupname + len) = '\0';
+ len = strlen(pos);
+ olen = 0;
+ olinep = NULL;
+
+ /*
+ * Loop around handling line continuations.
+ */
+ do {
+ if (*(pos + len - 1) == '\n')
+ len--;
+ if (*(pos + len - 1) == '\\') {
+ len--;
+ cont = 1;
+ } else
+ cont = 0;
+ if (len > 0) {
+ if (!(linep = malloc(olen + len + 1))){
+ if (olen > 0)
+ free(olinep);
+ free(lp->l_groupname);
+ free(lp);
+ freelists(this);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ if (olen > 0) {
+ memcpy(linep, olinep, olen);
+ free(olinep);
+ }
+ memcpy(linep + olen, pos, len);
+ olen += len;
+ *(linep + olen) = '\0';
+ olinep = linep;
+ }
+ if (cont) {
+ if (fgets(line, LINSIZ, pvt->fp)) {
+ pos = line;
+ len = strlen(pos);
+ } else
+ cont = 0;
+ }
+ } while (cont);
+ lp->l_line = linep;
+ lp->l_next = pvt->linehead;
+ pvt->linehead = lp;
+
+ /*
+ * If this is the one we wanted, we are done.
+ */
+ if (!strcmp(lp->l_groupname, group))
+ return (lp);
+ }
+ }
+ return (NULL);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl_nw.c b/usr/src/lib/libresolv2_joy/common/irs/lcl_nw.c
new file mode 100644
index 0000000000..2e5cd55a6c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl_nw.c
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) 1989, 1993, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: lcl_nw.c,v 1.4 2005/04/27 04:56:31 sra Exp $";
+/* from getgrent.c 8.2 (Berkeley) 3/21/94"; */
+/* from BSDI Id: getgrent.c,v 2.8 1996/05/28 18:15:14 bostic Exp $ */
+#endif /* LIBC_SCCS and not lint */
+
+/* Imports */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include <isc/misc.h>
+#include "irs_p.h"
+#include "lcl_p.h"
+
+#define MAXALIASES 35
+#define MAXADDRSIZE 4
+
+struct pvt {
+ FILE * fp;
+ char line[BUFSIZ+1];
+ struct nwent net;
+ char * aliases[MAXALIASES];
+ char addr[MAXADDRSIZE];
+ struct __res_state * res;
+ void (*free_res)(void *);
+};
+
+/* Forward */
+
+static void nw_close(struct irs_nw *);
+static struct nwent * nw_byname(struct irs_nw *, const char *, int);
+static struct nwent * nw_byaddr(struct irs_nw *, void *, int, int);
+static struct nwent * nw_next(struct irs_nw *);
+static void nw_rewind(struct irs_nw *);
+static void nw_minimize(struct irs_nw *);
+static struct __res_state * nw_res_get(struct irs_nw *this);
+static void nw_res_set(struct irs_nw *this,
+ struct __res_state *res,
+ void (*free_res)(void *));
+
+static int init(struct irs_nw *this);
+
+/* Portability. */
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+
+/* Public */
+
+struct irs_nw *
+irs_lcl_nw(struct irs_acc *this) {
+ struct irs_nw *nw;
+ struct pvt *pvt;
+
+ UNUSED(this);
+
+ if (!(pvt = memget(sizeof *pvt))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ if (!(nw = memget(sizeof *nw))) {
+ memput(pvt, sizeof *pvt);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(nw, 0x5e, sizeof *nw);
+ nw->private = pvt;
+ nw->close = nw_close;
+ nw->byname = nw_byname;
+ nw->byaddr = nw_byaddr;
+ nw->next = nw_next;
+ nw->rewind = nw_rewind;
+ nw->minimize = nw_minimize;
+ nw->res_get = nw_res_get;
+ nw->res_set = nw_res_set;
+ return (nw);
+}
+
+/* Methods */
+
+static void
+nw_close(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ nw_minimize(this);
+ if (pvt->res && pvt->free_res)
+ (*pvt->free_res)(pvt->res);
+ if (pvt->fp)
+ (void)fclose(pvt->fp);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct nwent *
+nw_byaddr(struct irs_nw *this, void *net, int length, int type) {
+ struct nwent *p;
+
+ if (init(this) == -1)
+ return(NULL);
+
+ nw_rewind(this);
+ while ((p = nw_next(this)) != NULL)
+ if (p->n_addrtype == type && p->n_length == length)
+ if (bitncmp(p->n_addr, net, length) == 0)
+ break;
+ return (p);
+}
+
+static struct nwent *
+nw_byname(struct irs_nw *this, const char *name, int type) {
+ struct nwent *p;
+ char **ap;
+
+ if (init(this) == -1)
+ return(NULL);
+
+ nw_rewind(this);
+ while ((p = nw_next(this)) != NULL) {
+ if (ns_samename(p->n_name, name) == 1 &&
+ p->n_addrtype == type)
+ break;
+ for (ap = p->n_aliases; *ap; ap++)
+ if ((ns_samename(*ap, name) == 1) &&
+ (p->n_addrtype == type))
+ goto found;
+ }
+ found:
+ return (p);
+}
+
+static void
+nw_rewind(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp) {
+ if (fseek(pvt->fp, 0L, SEEK_SET) == 0)
+ return;
+ (void)fclose(pvt->fp);
+ }
+ if (!(pvt->fp = fopen(_PATH_NETWORKS, "r")))
+ return;
+ if (fcntl(fileno(pvt->fp), F_SETFD, 1) < 0) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+}
+
+static struct nwent *
+nw_next(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ struct nwent *ret = NULL;
+ char *p, *cp, **q;
+ char *bufp, *ndbuf, *dbuf = NULL;
+ int c, bufsiz, offset = 0;
+
+ if (init(this) == -1)
+ return(NULL);
+
+ if (pvt->fp == NULL)
+ nw_rewind(this);
+ if (pvt->fp == NULL) {
+ RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);
+ return (NULL);
+ }
+ bufp = pvt->line;
+ bufsiz = sizeof(pvt->line);
+
+ again:
+ p = fgets(bufp + offset, bufsiz - offset, pvt->fp);
+ if (p == NULL)
+ goto cleanup;
+ if (!strchr(p, '\n') && !feof(pvt->fp)) {
+#define GROWBUF 1024
+ /* allocate space for longer line */
+ if (dbuf == NULL) {
+ if ((ndbuf = malloc(bufsiz + GROWBUF)) != NULL)
+ strcpy(ndbuf, bufp);
+ } else
+ ndbuf = realloc(dbuf, bufsiz + GROWBUF);
+ if (ndbuf) {
+ dbuf = ndbuf;
+ bufp = dbuf;
+ bufsiz += GROWBUF;
+ offset = strlen(dbuf);
+ } else {
+ /* allocation failed; skip this long line */
+ while ((c = getc(pvt->fp)) != EOF)
+ if (c == '\n')
+ break;
+ if (c != EOF)
+ ungetc(c, pvt->fp);
+ }
+ goto again;
+ }
+
+ p -= offset;
+ offset = 0;
+
+ if (*p == '#')
+ goto again;
+
+ cp = strpbrk(p, "#\n");
+ if (cp != NULL)
+ *cp = '\0';
+ pvt->net.n_name = p;
+ cp = strpbrk(p, " \t");
+ if (cp == NULL)
+ goto again;
+ *cp++ = '\0';
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ p = strpbrk(cp, " \t");
+ if (p != NULL)
+ *p++ = '\0';
+ pvt->net.n_length = inet_net_pton(AF_INET, cp, pvt->addr,
+ sizeof pvt->addr);
+ if (pvt->net.n_length < 0)
+ goto again;
+ pvt->net.n_addrtype = AF_INET;
+ pvt->net.n_addr = pvt->addr;
+ q = pvt->net.n_aliases = pvt->aliases;
+ if (p != NULL) {
+ cp = p;
+ while (cp && *cp) {
+ if (*cp == ' ' || *cp == '\t') {
+ cp++;
+ continue;
+ }
+ if (q < &pvt->aliases[MAXALIASES - 1])
+ *q++ = cp;
+ cp = strpbrk(cp, " \t");
+ if (cp != NULL)
+ *cp++ = '\0';
+ }
+ }
+ *q = NULL;
+ ret = &pvt->net;
+
+ cleanup:
+ if (dbuf)
+ free(dbuf);
+
+ return (ret);
+}
+
+static void
+nw_minimize(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res)
+ res_nclose(pvt->res);
+ if (pvt->fp != NULL) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+}
+
+static struct __res_state *
+nw_res_get(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (!res) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(res, 0, sizeof *res);
+ nw_res_set(this, res, free);
+ }
+
+ return (pvt->res);
+}
+
+static void
+nw_res_set(struct irs_nw *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->res && pvt->free_res) {
+ res_nclose(pvt->res);
+ (*pvt->free_res)(pvt->res);
+ }
+
+ pvt->res = res;
+ pvt->free_res = free_res;
+}
+
+static int
+init(struct irs_nw *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (!pvt->res && !nw_res_get(this))
+ return (-1);
+ if (((pvt->res->options & RES_INIT) == 0U) &&
+ res_ninit(pvt->res) == -1)
+ return (-1);
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl_p.h b/usr/src/lib/libresolv2_joy/common/irs/lcl_p.h
new file mode 100644
index 0000000000..e3f4f009cb
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl_p.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: lcl_p.h,v 1.3 2005/04/27 04:56:31 sra Exp $
+ */
+
+/*! \file
+ * \brief
+ * lcl_p.h - private include file for the local accessor functions.
+ */
+
+#ifndef _LCL_P_H_INCLUDED
+#define _LCL_P_H_INCLUDED
+
+/*%
+ * Object state.
+ */
+struct lcl_p {
+ struct __res_state * res;
+ void (*free_res) __P((void *));
+};
+
+/*
+ * Externs.
+ */
+
+extern struct irs_acc * irs_lcl_acc __P((const char *));
+extern struct irs_gr * irs_lcl_gr __P((struct irs_acc *));
+extern struct irs_pw * irs_lcl_pw __P((struct irs_acc *));
+extern struct irs_sv * irs_lcl_sv __P((struct irs_acc *));
+extern struct irs_pr * irs_lcl_pr __P((struct irs_acc *));
+extern struct irs_ho * irs_lcl_ho __P((struct irs_acc *));
+extern struct irs_nw * irs_lcl_nw __P((struct irs_acc *));
+extern struct irs_ng * irs_lcl_ng __P((struct irs_acc *));
+
+#endif /*_LCL_P_H_INCLUDED*/
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl_pr.c b/usr/src/lib/libresolv2_joy/common/irs/lcl_pr.c
new file mode 100644
index 0000000000..e1538530eb
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl_pr.c
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 1989, 1993, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: lcl_pr.c,v 1.4 2006/03/09 23:57:56 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* extern */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "lcl_p.h"
+
+#ifndef _PATH_PROTOCOLS
+#define _PATH_PROTOCOLS "/etc/protocols"
+#endif
+#define MAXALIASES 35
+
+/* Types */
+
+struct pvt {
+ FILE * fp;
+ char line[BUFSIZ+1];
+ char * dbuf;
+ struct protoent proto;
+ char * proto_aliases[MAXALIASES];
+};
+
+/* Forward */
+
+static void pr_close(struct irs_pr *);
+static struct protoent * pr_next(struct irs_pr *);
+static struct protoent * pr_byname(struct irs_pr *, const char *);
+static struct protoent * pr_bynumber(struct irs_pr *, int);
+static void pr_rewind(struct irs_pr *);
+static void pr_minimize(struct irs_pr *);
+
+/* Portability. */
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+
+/* Public */
+
+struct irs_pr *
+irs_lcl_pr(struct irs_acc *this) {
+ struct irs_pr *pr;
+ struct pvt *pvt;
+
+ if (!(pr = memget(sizeof *pr))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ if (!(pvt = memget(sizeof *pvt))) {
+ memput(pr, sizeof *this);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ pr->private = pvt;
+ pr->close = pr_close;
+ pr->byname = pr_byname;
+ pr->bynumber = pr_bynumber;
+ pr->next = pr_next;
+ pr->rewind = pr_rewind;
+ pr->minimize = pr_minimize;
+ pr->res_get = NULL;
+ pr->res_set = NULL;
+ return (pr);
+}
+
+/* Methods */
+
+static void
+pr_close(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp)
+ (void) fclose(pvt->fp);
+ if (pvt->dbuf)
+ free(pvt->dbuf);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct protoent *
+pr_byname(struct irs_pr *this, const char *name) {
+
+ struct protoent *p;
+ char **cp;
+
+ pr_rewind(this);
+ while ((p = pr_next(this))) {
+ if (!strcmp(p->p_name, name))
+ goto found;
+ for (cp = p->p_aliases; *cp; cp++)
+ if (!strcmp(*cp, name))
+ goto found;
+ }
+ found:
+ return (p);
+}
+
+static struct protoent *
+pr_bynumber(struct irs_pr *this, int proto) {
+ struct protoent *p;
+
+ pr_rewind(this);
+ while ((p = pr_next(this)))
+ if (p->p_proto == proto)
+ break;
+ return (p);
+}
+
+static void
+pr_rewind(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp) {
+ if (fseek(pvt->fp, 0L, SEEK_SET) == 0)
+ return;
+ (void)fclose(pvt->fp);
+ }
+ if (!(pvt->fp = fopen(_PATH_PROTOCOLS, "r" )))
+ return;
+ if (fcntl(fileno(pvt->fp), F_SETFD, 1) < 0) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+}
+
+static struct protoent *
+pr_next(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+ char *p, *cp, **q;
+ char *bufp, *ndbuf, *dbuf = NULL;
+ int c, bufsiz, offset;
+
+ if (!pvt->fp)
+ pr_rewind(this);
+ if (!pvt->fp)
+ return (NULL);
+ if (pvt->dbuf) {
+ free(pvt->dbuf);
+ pvt->dbuf = NULL;
+ }
+ bufp = pvt->line;
+ bufsiz = BUFSIZ;
+ offset = 0;
+ again:
+ if ((p = fgets(bufp + offset, bufsiz - offset, pvt->fp)) == NULL) {
+ if (dbuf)
+ free(dbuf);
+ return (NULL);
+ }
+ if (!strchr(p, '\n') && !feof(pvt->fp)) {
+#define GROWBUF 1024
+ /* allocate space for longer line */
+ if (dbuf == NULL) {
+ if ((ndbuf = malloc(bufsiz + GROWBUF)) != NULL)
+ strcpy(ndbuf, bufp);
+ } else
+ ndbuf = realloc(dbuf, bufsiz + GROWBUF);
+ if (ndbuf) {
+ dbuf = ndbuf;
+ bufp = dbuf;
+ bufsiz += GROWBUF;
+ offset = strlen(dbuf);
+ } else {
+ /* allocation failed; skip this long line */
+ while ((c = getc(pvt->fp)) != EOF)
+ if (c == '\n')
+ break;
+ if (c != EOF)
+ ungetc(c, pvt->fp);
+ }
+ goto again;
+ }
+
+ p -= offset;
+ offset = 0;
+
+ if (*p == '#')
+ goto again;
+ cp = strpbrk(p, "#\n");
+ if (cp != NULL)
+ *cp = '\0';
+ pvt->proto.p_name = p;
+ cp = strpbrk(p, " \t");
+ if (cp == NULL)
+ goto again;
+ *cp++ = '\0';
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ p = strpbrk(cp, " \t");
+ if (p != NULL)
+ *p++ = '\0';
+ pvt->proto.p_proto = atoi(cp);
+ q = pvt->proto.p_aliases = pvt->proto_aliases;
+ if (p != NULL) {
+ cp = p;
+ while (cp && *cp) {
+ if (*cp == ' ' || *cp == '\t') {
+ cp++;
+ continue;
+ }
+ if (q < &pvt->proto_aliases[MAXALIASES - 1])
+ *q++ = cp;
+ cp = strpbrk(cp, " \t");
+ if (cp != NULL)
+ *cp++ = '\0';
+ }
+ }
+ *q = NULL;
+ pvt->dbuf = dbuf;
+ return (&pvt->proto);
+}
+
+static void
+pr_minimize(struct irs_pr *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->fp != NULL) {
+ (void)fclose(pvt->fp);
+ pvt->fp = NULL;
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/lcl_sv.c b/usr/src/lib/libresolv2_joy/common/irs/lcl_sv.c
new file mode 100644
index 0000000000..ad6526430c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/lcl_sv.c
@@ -0,0 +1,432 @@
+/*
+ * Copyright (c) 1989, 1993, 1995
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: lcl_sv.c,v 1.4 2005/04/27 04:56:31 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/* extern */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#ifdef IRS_LCL_SV_DB
+#include <db.h>
+#endif
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "lcl_p.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/* Types */
+
+struct pvt {
+#ifdef IRS_LCL_SV_DB
+ DB * dbh;
+ int dbf;
+#endif
+ struct lcl_sv sv;
+};
+
+/* Forward */
+
+static void sv_close(struct irs_sv*);
+static struct servent * sv_next(struct irs_sv *);
+static struct servent * sv_byname(struct irs_sv *, const char *,
+ const char *);
+static struct servent * sv_byport(struct irs_sv *, int, const char *);
+static void sv_rewind(struct irs_sv *);
+static void sv_minimize(struct irs_sv *);
+/*global*/ struct servent * irs_lclsv_fnxt(struct lcl_sv *);
+#ifdef IRS_LCL_SV_DB
+static struct servent * sv_db_rec(struct lcl_sv *, DBT *, DBT *);
+#endif
+
+/* Portability */
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+
+/* Public */
+
+struct irs_sv *
+irs_lcl_sv(struct irs_acc *this) {
+ struct irs_sv *sv;
+ struct pvt *pvt;
+
+ UNUSED(this);
+
+ if ((sv = memget(sizeof *sv)) == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(sv, 0x5e, sizeof *sv);
+ if ((pvt = memget(sizeof *pvt)) == NULL) {
+ memput(sv, sizeof *sv);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(pvt, 0, sizeof *pvt);
+ sv->private = pvt;
+ sv->close = sv_close;
+ sv->next = sv_next;
+ sv->byname = sv_byname;
+ sv->byport = sv_byport;
+ sv->rewind = sv_rewind;
+ sv->minimize = sv_minimize;
+ sv->res_get = NULL;
+ sv->res_set = NULL;
+#ifdef IRS_LCL_SV_DB
+ pvt->dbf = R_FIRST;
+#endif
+ return (sv);
+}
+
+/* Methods */
+
+static void
+sv_close(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+#ifdef IRS_LCL_SV_DB
+ if (pvt->dbh != NULL)
+ (*pvt->dbh->close)(pvt->dbh);
+#endif
+ if (pvt->sv.fp)
+ fclose(pvt->sv.fp);
+ memput(pvt, sizeof *pvt);
+ memput(this, sizeof *this);
+}
+
+static struct servent *
+sv_byname(struct irs_sv *this, const char *name, const char *proto) {
+#ifdef IRS_LCL_SV_DB
+ struct pvt *pvt = (struct pvt *)this->private;
+#endif
+ struct servent *p;
+ char **cp;
+
+ sv_rewind(this);
+#ifdef IRS_LCL_SV_DB
+ if (pvt->dbh != NULL) {
+ DBT key, data;
+
+ /* Note that (sizeof "/") == 2. */
+ if ((strlen(name) + sizeof "/" + proto ? strlen(proto) : 0)
+ > sizeof pvt->sv.line)
+ goto try_local;
+ key.data = pvt->sv.line;
+ key.size = SPRINTF((pvt->sv.line, "%s/%s", name,
+ proto ? proto : "")) + 1;
+ if (proto != NULL) {
+ if ((*pvt->dbh->get)(pvt->dbh, &key, &data, 0) != 0)
+ return (NULL);
+ } else if ((*pvt->dbh->seq)(pvt->dbh, &key, &data, R_CURSOR)
+ != 0)
+ return (NULL);
+ return (sv_db_rec(&pvt->sv, &key, &data));
+ }
+ try_local:
+#endif
+
+ while ((p = sv_next(this))) {
+ if (strcmp(name, p->s_name) == 0)
+ goto gotname;
+ for (cp = p->s_aliases; *cp; cp++)
+ if (strcmp(name, *cp) == 0)
+ goto gotname;
+ continue;
+ gotname:
+ if (proto == NULL || strcmp(p->s_proto, proto) == 0)
+ break;
+ }
+ return (p);
+}
+
+static struct servent *
+sv_byport(struct irs_sv *this, int port, const char *proto) {
+#ifdef IRS_LCL_SV_DB
+ struct pvt *pvt = (struct pvt *)this->private;
+#endif
+ struct servent *p;
+
+ sv_rewind(this);
+#ifdef IRS_LCL_SV_DB
+ if (pvt->dbh != NULL) {
+ DBT key, data;
+ u_short *ports;
+
+ ports = (u_short *)pvt->sv.line;
+ ports[0] = 0;
+ ports[1] = port;
+ key.data = ports;
+ key.size = sizeof(u_short) * 2;
+ if (proto && *proto) {
+ strncpy((char *)ports + key.size, proto,
+ BUFSIZ - key.size);
+ key.size += strlen((char *)ports + key.size) + 1;
+ if ((*pvt->dbh->get)(pvt->dbh, &key, &data, 0) != 0)
+ return (NULL);
+ } else {
+ if ((*pvt->dbh->seq)(pvt->dbh, &key, &data, R_CURSOR)
+ != 0)
+ return (NULL);
+ }
+ return (sv_db_rec(&pvt->sv, &key, &data));
+ }
+#endif
+ while ((p = sv_next(this))) {
+ if (p->s_port != port)
+ continue;
+ if (proto == NULL || strcmp(p->s_proto, proto) == 0)
+ break;
+ }
+ return (p);
+}
+
+static void
+sv_rewind(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+ if (pvt->sv.fp) {
+ if (fseek(pvt->sv.fp, 0L, SEEK_SET) == 0)
+ return;
+ (void)fclose(pvt->sv.fp);
+ pvt->sv.fp = NULL;
+ }
+#ifdef IRS_LCL_SV_DB
+ pvt->dbf = R_FIRST;
+ if (pvt->dbh != NULL)
+ return;
+ pvt->dbh = dbopen(_PATH_SERVICES_DB, O_RDONLY,O_RDONLY,DB_BTREE, NULL);
+ if (pvt->dbh != NULL) {
+ if (fcntl((*pvt->dbh->fd)(pvt->dbh), F_SETFD, 1) < 0) {
+ (*pvt->dbh->close)(pvt->dbh);
+ pvt->dbh = NULL;
+ }
+ return;
+ }
+#endif
+ if ((pvt->sv.fp = fopen(_PATH_SERVICES, "r")) == NULL)
+ return;
+ if (fcntl(fileno(pvt->sv.fp), F_SETFD, 1) < 0) {
+ (void)fclose(pvt->sv.fp);
+ pvt->sv.fp = NULL;
+ }
+}
+
+static struct servent *
+sv_next(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+#ifdef IRS_LCL_SV_DB
+ if (pvt->dbh == NULL && pvt->sv.fp == NULL)
+#else
+ if (pvt->sv.fp == NULL)
+#endif
+ sv_rewind(this);
+
+#ifdef IRS_LCL_SV_DB
+ if (pvt->dbh != NULL) {
+ DBT key, data;
+
+ while ((*pvt->dbh->seq)(pvt->dbh, &key, &data, pvt->dbf) == 0){
+ pvt->dbf = R_NEXT;
+ if (((char *)key.data)[0])
+ continue;
+ return (sv_db_rec(&pvt->sv, &key, &data));
+ }
+ }
+#endif
+
+ if (pvt->sv.fp == NULL)
+ return (NULL);
+ return (irs_lclsv_fnxt(&pvt->sv));
+}
+
+static void
+sv_minimize(struct irs_sv *this) {
+ struct pvt *pvt = (struct pvt *)this->private;
+
+#ifdef IRS_LCL_SV_DB
+ if (pvt->dbh != NULL) {
+ (*pvt->dbh->close)(pvt->dbh);
+ pvt->dbh = NULL;
+ }
+#endif
+ if (pvt->sv.fp != NULL) {
+ (void)fclose(pvt->sv.fp);
+ pvt->sv.fp = NULL;
+ }
+}
+
+/* Quasipublic. */
+
+struct servent *
+irs_lclsv_fnxt(struct lcl_sv *sv) {
+ char *p, *cp, **q;
+
+ again:
+ if ((p = fgets(sv->line, BUFSIZ, sv->fp)) == NULL)
+ return (NULL);
+ if (*p == '#')
+ goto again;
+ sv->serv.s_name = p;
+ while (*p && *p != '\n' && *p != ' ' && *p != '\t' && *p != '#')
+ ++p;
+ if (*p == '\0' || *p == '#' || *p == '\n')
+ goto again;
+ *p++ = '\0';
+ while (*p == ' ' || *p == '\t')
+ p++;
+ if (*p == '\0' || *p == '#' || *p == '\n')
+ goto again;
+ sv->serv.s_port = htons((u_short)strtol(p, &cp, 10));
+ if (cp == p || (*cp != '/' && *cp != ','))
+ goto again;
+ p = cp + 1;
+ sv->serv.s_proto = p;
+
+ q = sv->serv.s_aliases = sv->serv_aliases;
+
+ while (*p && *p != '\n' && *p != ' ' && *p != '\t' && *p != '#')
+ ++p;
+
+ while (*p == ' ' || *p == '\t') {
+ *p++ = '\0';
+ while (*p == ' ' || *p == '\t')
+ ++p;
+ if (*p == '\0' || *p == '#' || *p == '\n')
+ break;
+ if (q < &sv->serv_aliases[IRS_SV_MAXALIASES - 1])
+ *q++ = p;
+ while (*p && *p != '\n' && *p != ' ' && *p != '\t' && *p != '#')
+ ++p;
+ }
+
+ *p = '\0';
+ *q = NULL;
+ return (&sv->serv);
+}
+
+/* Private. */
+
+#ifdef IRS_LCL_SV_DB
+static struct servent *
+sv_db_rec(struct lcl_sv *sv, DBT *key, DBT *data) {
+ char *p, **q;
+ int n;
+
+ p = data->data;
+ p[data->size - 1] = '\0'; /*%< should be, but we depend on it */
+ if (((char *)key->data)[0] == '\0') {
+ if (key->size < sizeof(u_short)*2 || data->size < 2)
+ return (NULL);
+ sv->serv.s_port = ((u_short *)key->data)[1];
+ n = strlen(p) + 1;
+ if ((size_t)n > sizeof(sv->line)) {
+ n = sizeof(sv->line);
+ }
+ memcpy(sv->line, p, n);
+ sv->serv.s_name = sv->line;
+ if ((sv->serv.s_proto = strchr(sv->line, '/')) != NULL)
+ *(sv->serv.s_proto)++ = '\0';
+ p += n;
+ data->size -= n;
+ } else {
+ if (data->size < sizeof(u_short) + 1)
+ return (NULL);
+ if (key->size > sizeof(sv->line))
+ key->size = sizeof(sv->line);
+ ((char *)key->data)[key->size - 1] = '\0';
+ memcpy(sv->line, key->data, key->size);
+ sv->serv.s_name = sv->line;
+ if ((sv->serv.s_proto = strchr(sv->line, '/')) != NULL)
+ *(sv->serv.s_proto)++ = '\0';
+ sv->serv.s_port = *(u_short *)data->data;
+ p += sizeof(u_short);
+ data->size -= sizeof(u_short);
+ }
+ q = sv->serv.s_aliases = sv->serv_aliases;
+ while (data->size > 0 && q < &sv->serv_aliases[IRS_SV_MAXALIASES - 1]) {
+
+ *q++ = p;
+ n = strlen(p) + 1;
+ data->size -= n;
+ p += n;
+ }
+ *q = NULL;
+ return (&sv->serv);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/nis.c b/usr/src/lib/libresolv2_joy/common/irs/nis.c
new file mode 100644
index 0000000000..ac1796543c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/nis.c
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: nis.c,v 1.3 2005/04/27 04:56:32 sra Exp $";
+#endif
+
+/* Imports */
+
+#include "port_before.h"
+
+#ifdef WANT_IRS_NIS
+
+#include <rpc/rpc.h>
+#include <rpc/xdr.h>
+#include <rpcsvc/yp_prot.h>
+#include <rpcsvc/ypclnt.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef T_NULL
+#undef T_NULL /* Silence re-definition warning of T_NULL. */
+#endif
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <isc/memcluster.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "hesiod.h"
+#include "nis_p.h"
+
+/* Forward */
+
+static void nis_close(struct irs_acc *);
+static struct __res_state * nis_res_get(struct irs_acc *);
+static void nis_res_set(struct irs_acc *, struct __res_state *,
+ void (*)(void *));
+
+/* Public */
+
+struct irs_acc *
+irs_nis_acc(const char *options) {
+ struct nis_p *nis;
+ struct irs_acc *acc;
+ char *domain;
+
+ UNUSED(options);
+
+ if (yp_get_default_domain(&domain) != 0)
+ return (NULL);
+ if (!(nis = memget(sizeof *nis))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(nis, 0, sizeof *nis);
+ if (!(acc = memget(sizeof *acc))) {
+ memput(nis, sizeof *nis);
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(acc, 0x5e, sizeof *acc);
+ acc->private = nis;
+ nis->domain = strdup(domain);
+#ifdef WANT_IRS_GR
+ acc->gr_map = irs_nis_gr;
+#else
+ acc->gr_map = NULL;
+#endif
+#ifdef WANT_IRS_PW
+ acc->pw_map = irs_nis_pw;
+#else
+ acc->pw_map = NULL;
+#endif
+ acc->sv_map = irs_nis_sv;
+ acc->pr_map = irs_nis_pr;
+ acc->ho_map = irs_nis_ho;
+ acc->nw_map = irs_nis_nw;
+ acc->ng_map = irs_nis_ng;
+ acc->res_get = nis_res_get;
+ acc->res_set = nis_res_set;
+ acc->close = nis_close;
+ return (acc);
+}
+
+/* Methods */
+
+static struct __res_state *
+nis_res_get(struct irs_acc *this) {
+ struct nis_p *nis = (struct nis_p *)this->private;
+
+ if (nis->res == NULL) {
+ struct __res_state *res;
+ res = (struct __res_state *)malloc(sizeof *res);
+ if (res == NULL)
+ return (NULL);
+ memset(res, 0, sizeof *res);
+ nis_res_set(this, res, free);
+ }
+
+ if ((nis->res->options & RES_INIT) == 0 &&
+ res_ninit(nis->res) < 0)
+ return (NULL);
+
+ return (nis->res);
+}
+
+static void
+nis_res_set(struct irs_acc *this, struct __res_state *res,
+ void (*free_res)(void *)) {
+ struct nis_p *nis = (struct nis_p *)this->private;
+
+ if (nis->res && nis->free_res) {
+ res_nclose(nis->res);
+ (*nis->free_res)(nis->res);
+ }
+
+ nis->res = res;
+ nis->free_res = free_res;
+}
+
+static void
+nis_close(struct irs_acc *this) {
+ struct nis_p *nis = (struct nis_p *)this->private;
+
+ if (nis->res && nis->free_res)
+ (*nis->free_res)(nis->res);
+ free(nis->domain);
+ memput(nis, sizeof *nis);
+ memput(this, sizeof *this);
+}
+
+#endif /*WANT_IRS_NIS*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/nis_p.h b/usr/src/lib/libresolv2_joy/common/irs/nis_p.h
new file mode 100644
index 0000000000..70e2948d67
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/nis_p.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: nis_p.h,v 1.3 2005/04/27 04:56:33 sra Exp $
+ */
+
+/*! \file
+ * \brief
+ * nis_p.h - private include file for the NIS functions.
+ */
+
+/*%
+ * Object state.
+ */
+struct nis_p {
+ char * domain;
+ struct __res_state * res;
+ void (*free_res) __P((void *));
+};
+
+
+/*
+ * Methods.
+ */
+
+extern struct irs_gr * irs_nis_gr __P((struct irs_acc *));
+extern struct irs_pw * irs_nis_pw __P((struct irs_acc *));
+extern struct irs_sv * irs_nis_sv __P((struct irs_acc *));
+extern struct irs_pr * irs_nis_pr __P((struct irs_acc *));
+extern struct irs_ho * irs_nis_ho __P((struct irs_acc *));
+extern struct irs_nw * irs_nis_nw __P((struct irs_acc *));
+extern struct irs_ng * irs_nis_ng __P((struct irs_acc *));
diff --git a/usr/src/lib/libresolv2_joy/common/irs/nul_ng.c b/usr/src/lib/libresolv2_joy/common/irs/nul_ng.c
new file mode 100644
index 0000000000..504813bde1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/nul_ng.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: nul_ng.c,v 1.3 2005/04/27 04:56:34 sra Exp $";
+#endif
+
+/*! \file
+ * \brief
+ * nul_ng.c - the netgroup accessor null map
+ */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <netdb.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <irs.h>
+#include <isc/memcluster.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+#include "hesiod.h"
+#include "dns_p.h"
+
+/* Forward. */
+
+static void ng_close(struct irs_ng *);
+static int ng_next(struct irs_ng *, const char **,
+ const char **, const char **);
+static int ng_test(struct irs_ng *,
+ const char *, const char *,
+ const char *, const char *);
+static void ng_rewind(struct irs_ng *, const char *);
+static void ng_minimize(struct irs_ng *);
+
+/* Public. */
+
+struct irs_ng *
+irs_nul_ng(struct irs_acc *this) {
+ struct irs_ng *ng;
+
+ UNUSED(this);
+
+ if (!(ng = memget(sizeof *ng))) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ memset(ng, 0x5e, sizeof *ng);
+ ng->private = NULL;
+ ng->close = ng_close;
+ ng->next = ng_next;
+ ng->test = ng_test;
+ ng->rewind = ng_rewind;
+ ng->minimize = ng_minimize;
+ return (ng);
+}
+
+/* Methods. */
+
+static void
+ng_close(struct irs_ng *this) {
+ memput(this, sizeof *this);
+}
+
+/* ARGSUSED */
+static int
+ng_next(struct irs_ng *this, const char **host, const char **user,
+ const char **domain)
+{
+ UNUSED(this);
+ UNUSED(host);
+ UNUSED(user);
+ UNUSED(domain);
+ errno = ENOENT;
+ return (-1);
+}
+
+static int
+ng_test(struct irs_ng *this, const char *name,
+ const char *user, const char *host, const char *domain)
+{
+ UNUSED(this);
+ UNUSED(name);
+ UNUSED(user);
+ UNUSED(host);
+ UNUSED(domain);
+ errno = ENODEV;
+ return (-1);
+}
+
+static void
+ng_rewind(struct irs_ng *this, const char *netgroup) {
+ UNUSED(this);
+ UNUSED(netgroup);
+ /* NOOP */
+}
+
+static void
+ng_minimize(struct irs_ng *this) {
+ UNUSED(this);
+ /* NOOP */
+}
diff --git a/usr/src/lib/libresolv2_joy/common/irs/pathnames.h b/usr/src/lib/libresolv2_joy/common/irs/pathnames.h
new file mode 100644
index 0000000000..1646842155
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/pathnames.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: pathnames.h,v 1.3 2005/04/27 04:56:34 sra Exp $
+ */
+
+#ifndef _PATH_IRS_CONF
+#define _PATH_IRS_CONF "/etc/irs.conf"
+#endif
+
+#ifndef _PATH_NETWORKS
+#define _PATH_NETWORKS "/etc/networks"
+#endif
+
+#ifndef _PATH_GROUP
+#define _PATH_GROUP "/etc/group"
+#endif
+
+#ifndef _PATH_NETGROUP
+#define _PATH_NETGROUP "/etc/netgroup"
+#endif
+
+#ifndef _PATH_SERVICES
+#define _PATH_SERVICES "/etc/services"
+#endif
+
+#ifdef IRS_LCL_SV_DB
+#ifndef _PATH_SERVICES_DB
+#define _PATH_SERVICES_DB _PATH_SERVICES ".db"
+#endif
+#endif
+
+#ifndef _PATH_HESIOD_CONF
+#define _PATH_HESIOD_CONF "/etc/hesiod.conf"
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/irs/util.c b/usr/src/lib/libresolv2_joy/common/irs/util.c
new file mode 100644
index 0000000000..9c70eabddc
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/irs/util.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: util.c,v 1.3 2005/04/27 04:56:34 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <irs.h>
+
+#include "port_after.h"
+
+#include "irs_p.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) sprintf x
+#endif
+
+void
+map_v4v6_address(const char *src, char *dst) {
+ u_char *p = (u_char *)dst;
+ char tmp[NS_INADDRSZ];
+ int i;
+
+ /* Stash a temporary copy so our caller can update in place. */
+ memcpy(tmp, src, NS_INADDRSZ);
+ /* Mark this ipv6 addr as a mapped ipv4. */
+ for (i = 0; i < 10; i++)
+ *p++ = 0x00;
+ *p++ = 0xff;
+ *p++ = 0xff;
+ /* Retrieve the saved copy and we're done. */
+ memcpy((void*)p, tmp, NS_INADDRSZ);
+}
+
+int
+make_group_list(struct irs_gr *this, const char *name,
+ gid_t basegid, gid_t *groups, int *ngroups)
+{
+ struct group *grp;
+ int i, ng;
+ int ret, maxgroups;
+
+ ret = -1;
+ ng = 0;
+ maxgroups = *ngroups;
+ /*
+ * When installing primary group, duplicate it;
+ * the first element of groups is the effective gid
+ * and will be overwritten when a setgid file is executed.
+ */
+ if (ng >= maxgroups)
+ goto done;
+ groups[ng++] = basegid;
+ if (ng >= maxgroups)
+ goto done;
+ groups[ng++] = basegid;
+ /*
+ * Scan the group file to find additional groups.
+ */
+ (*this->rewind)(this);
+ while ((grp = (*this->next)(this)) != NULL) {
+ if ((gid_t)grp->gr_gid == basegid)
+ continue;
+ for (i = 0; grp->gr_mem[i]; i++) {
+ if (!strcmp(grp->gr_mem[i], name)) {
+ if (ng >= maxgroups)
+ goto done;
+ groups[ng++] = grp->gr_gid;
+ break;
+ }
+ }
+ }
+ ret = 0;
+ done:
+ *ngroups = ng;
+ return (ret);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/assertions.c b/usr/src/lib/libresolv2_joy/common/isc/assertions.c
new file mode 100644
index 0000000000..b71e5a32d3
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/assertions.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997, 1999, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: assertions.c,v 1.5 2008/11/14 02:36:51 marka Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/assertions.h>
+
+#include "port_after.h"
+
+/*
+ * Forward.
+ */
+
+static void default_assertion_failed(const char *, int, assertion_type,
+ const char *, int);
+
+/*
+ * Public.
+ */
+
+assertion_failure_callback __assertion_failed = default_assertion_failed;
+
+void
+set_assertion_failure_callback(assertion_failure_callback f) {
+ if (f == NULL)
+ __assertion_failed = default_assertion_failed;
+ else
+ __assertion_failed = f;
+}
+
+const char *
+assertion_type_to_text(assertion_type type) {
+ const char *result;
+
+ switch (type) {
+ case assert_require:
+ result = "REQUIRE";
+ break;
+ case assert_ensure:
+ result = "ENSURE";
+ break;
+ case assert_insist:
+ result = "INSIST";
+ break;
+ case assert_invariant:
+ result = "INVARIANT";
+ break;
+ default:
+ result = NULL;
+ }
+ return (result);
+}
+
+/*
+ * Private.
+ */
+
+/* coverity[+kill] */
+static void
+default_assertion_failed(const char *file, int line, assertion_type type,
+ const char *cond, int print_errno)
+{
+ fprintf(stderr, "%s:%d: %s(%s)%s%s failed.\n",
+ file, line, assertion_type_to_text(type), cond,
+ (print_errno) ? ": " : "",
+ (print_errno) ? strerror(errno) : "");
+ abort();
+ /* NOTREACHED */
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/base64.c b/usr/src/lib/libresolv2_joy/common/isc/base64.c
new file mode 100644
index 0000000000..79c35722b1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/base64.c
@@ -0,0 +1,333 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: base64.c,v 1.4 2005/04/27 04:56:34 sra Exp $";
+#endif /* not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "port_after.h"
+
+#ifndef ORIGINAL_ISC_CODE
+#pragma weak __b64_ntop = b64_ntop
+#pragma weak __b64_pton = b64_pton
+#endif /* ORIGINAL_ISC_CODE */
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+ The following encoding technique is taken from RFC1521 by Borenstein
+ and Freed. It is reproduced here in a slightly edited form for
+ convenience.
+
+ A 65-character subset of US-ASCII is used, enabling 6 bits to be
+ represented per printable character. (The extra 65th character, "=",
+ is used to signify a special processing function.)
+
+ The encoding process represents 24-bit groups of input bits as output
+ strings of 4 encoded characters. Proceeding from left to right, a
+ 24-bit input group is formed by concatenating 3 8-bit input groups.
+ These 24 bits are then treated as 4 concatenated 6-bit groups, each
+ of which is translated into a single digit in the base64 alphabet.
+
+ Each 6-bit group is used as an index into an array of 64 printable
+ characters. The character referenced by the index is placed in the
+ output string.
+
+ Table 1: The Base64 Alphabet
+
+ Value Encoding Value Encoding Value Encoding Value Encoding
+ 0 A 17 R 34 i 51 z
+ 1 B 18 S 35 j 52 0
+ 2 C 19 T 36 k 53 1
+ 3 D 20 U 37 l 54 2
+ 4 E 21 V 38 m 55 3
+ 5 F 22 W 39 n 56 4
+ 6 G 23 X 40 o 57 5
+ 7 H 24 Y 41 p 58 6
+ 8 I 25 Z 42 q 59 7
+ 9 J 26 a 43 r 60 8
+ 10 K 27 b 44 s 61 9
+ 11 L 28 c 45 t 62 +
+ 12 M 29 d 46 u 63 /
+ 13 N 30 e 47 v
+ 14 O 31 f 48 w (pad) =
+ 15 P 32 g 49 x
+ 16 Q 33 h 50 y
+
+ Special processing is performed if fewer than 24 bits are available
+ at the end of the data being encoded. A full encoding quantum is
+ always completed at the end of a quantity. When fewer than 24 input
+ bits are available in an input group, zero bits are added (on the
+ right) to form an integral number of 6-bit groups. Padding at the
+ end of the data is performed using the '=' character.
+
+ Since all base64 input is an integral number of octets, only the
+ -------------------------------------------------
+ following cases can arise:
+
+ (1) the final quantum of encoding input is an integral
+ multiple of 24 bits; here, the final unit of encoded
+ output will be an integral multiple of 4 characters
+ with no "=" padding,
+ (2) the final quantum of encoding input is exactly 8 bits;
+ here, the final unit of encoded output will be two
+ characters followed by two "=" padding characters, or
+ (3) the final quantum of encoding input is exactly 16 bits;
+ here, the final unit of encoded output will be three
+ characters followed by one "=" padding character.
+ */
+
+int
+b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
+ size_t datalength = 0;
+ u_char input[3];
+ u_char output[4];
+ size_t i;
+
+ while (2U < srclength) {
+ input[0] = *src++;
+ input[1] = *src++;
+ input[2] = *src++;
+ srclength -= 3;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ output[3] = input[2] & 0x3f;
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+ Assert(output[3] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Base64[output[3]];
+ }
+
+ /* Now we worry about padding. */
+ if (0U != srclength) {
+ /* Get what's left. */
+ input[0] = input[1] = input[2] = '\0';
+ for (i = 0; i < srclength; i++)
+ input[i] = *src++;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ if (srclength == 1U)
+ target[datalength++] = Pad64;
+ else
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Pad64;
+ }
+ if (datalength >= targsize)
+ return (-1);
+ target[datalength] = '\0'; /*%< Returned value doesn't count \\0. */
+ return (datalength);
+}
+
+/* skips all whitespace anywhere.
+ converts characters, four at a time, starting at (or after)
+ src from base - 64 numbers into three 8 bit bytes in the target area.
+ it returns the number of data bytes stored at the target, or -1 on error.
+ */
+
+int
+b64_pton(src, target, targsize)
+ char const *src;
+ u_char *target;
+ size_t targsize;
+{
+ int tarindex, state, ch;
+ char *pos;
+
+ state = 0;
+ tarindex = 0;
+
+ while ((ch = *src++) != '\0') {
+ if (isspace(ch)) /*%< Skip whitespace anywhere. */
+ continue;
+
+ if (ch == Pad64)
+ break;
+
+ pos = strchr(Base64, ch);
+ if (pos == 0) /*%< A non-base64 character. */
+ return (-1);
+
+ switch (state) {
+ case 0:
+ if (target) {
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] = (pos - Base64) << 2;
+ }
+ state = 1;
+ break;
+ case 1:
+ if (target) {
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64) >> 4;
+ target[tarindex+1] = ((pos - Base64) & 0x0f)
+ << 4 ;
+ }
+ tarindex++;
+ state = 2;
+ break;
+ case 2:
+ if (target) {
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64) >> 2;
+ target[tarindex+1] = ((pos - Base64) & 0x03)
+ << 6;
+ }
+ tarindex++;
+ state = 3;
+ break;
+ case 3:
+ if (target) {
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] |= (pos - Base64);
+ }
+ tarindex++;
+ state = 0;
+ break;
+ default:
+ abort();
+ }
+ }
+
+ /*
+ * We are done decoding Base-64 chars. Let's see if we ended
+ * on a byte boundary, and/or with erroneous trailing characters.
+ */
+
+ if (ch == Pad64) { /*%< We got a pad char. */
+ ch = *src++; /*%< Skip it, get next. */
+ switch (state) {
+ case 0: /*%< Invalid = in first position */
+ case 1: /*%< Invalid = in second position */
+ return (-1);
+
+ case 2: /*%< Valid, means one byte of info */
+ /* Skip any number of spaces. */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (!isspace(ch))
+ break;
+ /* Make sure there is another trailing = sign. */
+ if (ch != Pad64)
+ return (-1);
+ ch = *src++; /*%< Skip the = */
+ /* Fall through to "single trailing =" case. */
+ /* FALLTHROUGH */
+
+ case 3: /*%< Valid, means two bytes of info */
+ /*
+ * We know this char is an =. Is there anything but
+ * whitespace after it?
+ */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (!isspace(ch))
+ return (-1);
+
+ /*
+ * Now make sure for cases 2 and 3 that the "extra"
+ * bits that slopped past the last full byte were
+ * zeros. If we don't check them, they become a
+ * subliminal channel.
+ */
+ if (target && target[tarindex] != 0)
+ return (-1);
+ }
+ } else {
+ /*
+ * We ended by seeing the end of the string. Make sure we
+ * have no partial bytes lying around.
+ */
+ if (state != 0)
+ return (-1);
+ }
+
+ return (tarindex);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/bitncmp.c b/usr/src/lib/libresolv2_joy/common/isc/bitncmp.c
new file mode 100644
index 0000000000..efe5009292
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/bitncmp.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996, 1999, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: bitncmp.c,v 1.5 2008/11/14 02:36:51 marka Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+
+#include <string.h>
+
+#include "port_after.h"
+
+#include <isc/misc.h>
+
+/*%
+ * int
+ * bitncmp(l, r, n)
+ * compare bit masks l and r, for n bits.
+ * return:
+ * -1, 1, or 0 in the libc tradition.
+ * note:
+ * network byte order assumed. this means 192.5.5.240/28 has
+ * 0x11110000 in its fourth octet.
+ * author:
+ * Paul Vixie (ISC), June 1996
+ */
+int
+bitncmp(const void *l, const void *r, int n) {
+ u_int lb, rb;
+ int x, b;
+
+ b = n / 8;
+ x = memcmp(l, r, b);
+ if (x || (n % 8) == 0)
+ return (x);
+
+ lb = ((const u_char *)l)[b];
+ rb = ((const u_char *)r)[b];
+ for (b = n % 8; b > 0; b--) {
+ if ((lb & 0x80) != (rb & 0x80)) {
+ if (lb & 0x80)
+ return (1);
+ return (-1);
+ }
+ lb <<= 1;
+ rb <<= 1;
+ }
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ctl_clnt.c b/usr/src/lib/libresolv2_joy/common/isc/ctl_clnt.c
new file mode 100644
index 0000000000..f71001a6d4
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ctl_clnt.c
@@ -0,0 +1,620 @@
+/*
+ * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "$Id: ctl_clnt.c,v 1.11 2008/11/14 02:36:51 marka Exp $";
+#endif /* not lint */
+
+/* Extern. */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+
+#include <isc/assertions.h>
+#include <isc/ctl.h>
+#include <isc/eventlib.h>
+#include <isc/list.h>
+#include <isc/memcluster.h>
+
+#include "ctl_p.h"
+
+#include "port_after.h"
+
+/* Constants. */
+
+
+/* Macros. */
+
+#define donefunc_p(ctx) ((ctx).donefunc != NULL)
+#define arpacode_p(line) (isdigit((unsigned char)(line[0])) && \
+ isdigit((unsigned char)(line[1])) && \
+ isdigit((unsigned char)(line[2])))
+#define arpacont_p(line) (line[3] == '-')
+#define arpadone_p(line) (line[3] == ' ' || line[3] == '\t' || \
+ line[3] == '\r' || line[3] == '\0')
+
+/* Types. */
+
+enum state {
+ initializing = 0, connecting, connected, destroyed
+};
+
+struct ctl_tran {
+ LINK(struct ctl_tran) link;
+ LINK(struct ctl_tran) wlink;
+ struct ctl_cctx * ctx;
+ struct ctl_buf outbuf;
+ ctl_clntdone donefunc;
+ void * uap;
+};
+
+struct ctl_cctx {
+ enum state state;
+ evContext ev;
+ int sock;
+ ctl_logfunc logger;
+ ctl_clntdone donefunc;
+ void * uap;
+ evConnID coID;
+ evTimerID tiID;
+ evFileID rdID;
+ evStreamID wrID;
+ struct ctl_buf inbuf;
+ struct timespec timeout;
+ LIST(struct ctl_tran) tran;
+ LIST(struct ctl_tran) wtran;
+};
+
+/* Forward. */
+
+static struct ctl_tran *new_tran(struct ctl_cctx *, ctl_clntdone, void *, int);
+static void start_write(struct ctl_cctx *);
+static void destroy(struct ctl_cctx *, int);
+static void error(struct ctl_cctx *);
+static void new_state(struct ctl_cctx *, enum state);
+static void conn_done(evContext, void *, int,
+ const void *, int,
+ const void *, int);
+static void write_done(evContext, void *, int, int);
+static void start_read(struct ctl_cctx *);
+static void stop_read(struct ctl_cctx *);
+static void readable(evContext, void *, int, int);
+static void start_timer(struct ctl_cctx *);
+static void stop_timer(struct ctl_cctx *);
+static void touch_timer(struct ctl_cctx *);
+static void timer(evContext, void *,
+ struct timespec, struct timespec);
+
+#ifndef HAVE_MEMCHR
+static void *
+memchr(const void *b, int c, size_t len) {
+ const unsigned char *p = b;
+ size_t i;
+
+ for (i = 0; i < len; i++, p++)
+ if (*p == (unsigned char)c)
+ return ((void *)p);
+ return (NULL);
+}
+#endif
+
+/* Private data. */
+
+static const char * const state_names[] = {
+ "initializing", "connecting", "connected", "destroyed"
+};
+
+/* Public. */
+
+/*%
+ * void
+ * ctl_client()
+ * create, condition, and connect to a listener on the control port.
+ */
+struct ctl_cctx *
+ctl_client(evContext lev, const struct sockaddr *cap, size_t cap_len,
+ const struct sockaddr *sap, size_t sap_len,
+ ctl_clntdone donefunc, void *uap,
+ u_int timeout, ctl_logfunc logger)
+{
+ static const char me[] = "ctl_client";
+ static const int on = 1;
+ struct ctl_cctx *ctx;
+ struct sockaddr *captmp;
+
+ if (logger == NULL)
+ logger = ctl_logger;
+ ctx = memget(sizeof *ctx);
+ if (ctx == NULL) {
+ (*logger)(ctl_error, "%s: getmem: %s", me, strerror(errno));
+ goto fatal;
+ }
+ ctx->state = initializing;
+ ctx->ev = lev;
+ ctx->logger = logger;
+ ctx->timeout = evConsTime(timeout, 0);
+ ctx->donefunc = donefunc;
+ ctx->uap = uap;
+ ctx->coID.opaque = NULL;
+ ctx->tiID.opaque = NULL;
+ ctx->rdID.opaque = NULL;
+ ctx->wrID.opaque = NULL;
+ buffer_init(ctx->inbuf);
+ INIT_LIST(ctx->tran);
+ INIT_LIST(ctx->wtran);
+ ctx->sock = socket(sap->sa_family, SOCK_STREAM, PF_UNSPEC);
+ if (ctx->sock > evHighestFD(ctx->ev)) {
+ ctx->sock = -1;
+ errno = ENOTSOCK;
+ }
+ if (ctx->sock < 0) {
+ (*ctx->logger)(ctl_error, "%s: socket: %s",
+ me, strerror(errno));
+ goto fatal;
+ }
+ if (cap != NULL) {
+ if (setsockopt(ctx->sock, SOL_SOCKET, SO_REUSEADDR,
+ (const char *)&on, sizeof on) != 0) {
+ (*ctx->logger)(ctl_warning,
+ "%s: setsockopt(REUSEADDR): %s",
+ me, strerror(errno));
+ }
+ DE_CONST(cap, captmp);
+ if (bind(ctx->sock, captmp, cap_len) < 0) {
+ (*ctx->logger)(ctl_error, "%s: bind: %s", me,
+ strerror(errno));
+ goto fatal;
+ }
+ }
+ if (evConnect(lev, ctx->sock, (const struct sockaddr *)sap, sap_len,
+ conn_done, ctx, &ctx->coID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: evConnect(fd %d): %s",
+ me, ctx->sock, strerror(errno));
+ fatal:
+ if (ctx != NULL) {
+ if (ctx->sock >= 0)
+ close(ctx->sock);
+ memput(ctx, sizeof *ctx);
+ }
+ return (NULL);
+ }
+ new_state(ctx, connecting);
+ return (ctx);
+}
+
+/*%
+ * void
+ * ctl_endclient(ctx)
+ * close a client and release all of its resources.
+ */
+void
+ctl_endclient(struct ctl_cctx *ctx) {
+ if (ctx->state != destroyed)
+ destroy(ctx, 0);
+ memput(ctx, sizeof *ctx);
+}
+
+/*%
+ * int
+ * ctl_command(ctx, cmd, len, donefunc, uap)
+ * Queue a transaction, which will begin with sending cmd
+ * and complete by calling donefunc with the answer.
+ */
+int
+ctl_command(struct ctl_cctx *ctx, const char *cmd, size_t len,
+ ctl_clntdone donefunc, void *uap)
+{
+ struct ctl_tran *tran;
+ char *pc;
+ unsigned int n;
+
+ switch (ctx->state) {
+ case destroyed:
+ errno = ENOTCONN;
+ return (-1);
+ case connecting:
+ case connected:
+ break;
+ default:
+ abort();
+ }
+ if (len >= (size_t)MAX_LINELEN) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ tran = new_tran(ctx, donefunc, uap, 1);
+ if (tran == NULL)
+ return (-1);
+ if (ctl_bufget(&tran->outbuf, ctx->logger) < 0)
+ return (-1);
+ memcpy(tran->outbuf.text, cmd, len);
+ tran->outbuf.used = len;
+ for (pc = tran->outbuf.text, n = 0; n < tran->outbuf.used; pc++, n++)
+ if (!isascii((unsigned char)*pc) ||
+ !isprint((unsigned char)*pc))
+ *pc = '\040';
+ start_write(ctx);
+ return (0);
+}
+
+/* Private. */
+
+static struct ctl_tran *
+new_tran(struct ctl_cctx *ctx, ctl_clntdone donefunc, void *uap, int w) {
+ struct ctl_tran *new = memget(sizeof *new);
+
+ if (new == NULL)
+ return (NULL);
+ new->ctx = ctx;
+ buffer_init(new->outbuf);
+ new->donefunc = donefunc;
+ new->uap = uap;
+ INIT_LINK(new, link);
+ INIT_LINK(new, wlink);
+ APPEND(ctx->tran, new, link);
+ if (w)
+ APPEND(ctx->wtran, new, wlink);
+ return (new);
+}
+
+static void
+start_write(struct ctl_cctx *ctx) {
+ static const char me[] = "isc/ctl_clnt::start_write";
+ struct ctl_tran *tran;
+ struct iovec iov[2], *iovp = iov;
+ char * tmp;
+
+ REQUIRE(ctx->state == connecting || ctx->state == connected);
+ /* If there is a write in progress, don't try to write more yet. */
+ if (ctx->wrID.opaque != NULL)
+ return;
+ /* If there are no trans, make sure timer is off, and we're done. */
+ if (EMPTY(ctx->wtran)) {
+ if (ctx->tiID.opaque != NULL)
+ stop_timer(ctx);
+ return;
+ }
+ /* Pull it off the head of the write queue. */
+ tran = HEAD(ctx->wtran);
+ UNLINK(ctx->wtran, tran, wlink);
+ /* Since there are some trans, make sure timer is successfully "on". */
+ if (ctx->tiID.opaque != NULL)
+ touch_timer(ctx);
+ else
+ start_timer(ctx);
+ if (ctx->state == destroyed)
+ return;
+ /* Marshall a newline-terminated message and clock it out. */
+ *iovp++ = evConsIovec(tran->outbuf.text, tran->outbuf.used);
+ DE_CONST("\r\n", tmp);
+ *iovp++ = evConsIovec(tmp, 2);
+ if (evWrite(ctx->ev, ctx->sock, iov, iovp - iov,
+ write_done, tran, &ctx->wrID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: evWrite: %s", me,
+ strerror(errno));
+ error(ctx);
+ return;
+ }
+ if (evTimeRW(ctx->ev, ctx->wrID, ctx->tiID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: evTimeRW: %s", me,
+ strerror(errno));
+ error(ctx);
+ return;
+ }
+}
+
+static void
+destroy(struct ctl_cctx *ctx, int notify) {
+ struct ctl_tran *this, *next;
+
+ if (ctx->sock != -1) {
+ (void) close(ctx->sock);
+ ctx->sock = -1;
+ }
+ switch (ctx->state) {
+ case connecting:
+ REQUIRE(ctx->wrID.opaque == NULL);
+ REQUIRE(EMPTY(ctx->tran));
+ /*
+ * This test is nec'y since destroy() can be called from
+ * start_read() while the state is still "connecting".
+ */
+ if (ctx->coID.opaque != NULL) {
+ (void)evCancelConn(ctx->ev, ctx->coID);
+ ctx->coID.opaque = NULL;
+ }
+ break;
+ case connected:
+ REQUIRE(ctx->coID.opaque == NULL);
+ if (ctx->wrID.opaque != NULL) {
+ (void)evCancelRW(ctx->ev, ctx->wrID);
+ ctx->wrID.opaque = NULL;
+ }
+ if (ctx->rdID.opaque != NULL)
+ stop_read(ctx);
+ break;
+ case destroyed:
+ break;
+ default:
+ abort();
+ }
+ if (allocated_p(ctx->inbuf))
+ ctl_bufput(&ctx->inbuf);
+ for (this = HEAD(ctx->tran); this != NULL; this = next) {
+ next = NEXT(this, link);
+ if (allocated_p(this->outbuf))
+ ctl_bufput(&this->outbuf);
+ if (notify && this->donefunc != NULL)
+ (*this->donefunc)(ctx, this->uap, NULL, 0);
+ memput(this, sizeof *this);
+ }
+ if (ctx->tiID.opaque != NULL)
+ stop_timer(ctx);
+ new_state(ctx, destroyed);
+}
+
+static void
+error(struct ctl_cctx *ctx) {
+ REQUIRE(ctx->state != destroyed);
+ destroy(ctx, 1);
+}
+
+static void
+new_state(struct ctl_cctx *ctx, enum state new_state) {
+ static const char me[] = "isc/ctl_clnt::new_state";
+
+ (*ctx->logger)(ctl_debug, "%s: %s -> %s", me,
+ state_names[ctx->state], state_names[new_state]);
+ ctx->state = new_state;
+}
+
+static void
+conn_done(evContext ev, void *uap, int fd,
+ const void *la, int lalen,
+ const void *ra, int ralen)
+{
+ static const char me[] = "isc/ctl_clnt::conn_done";
+ struct ctl_cctx *ctx = uap;
+ struct ctl_tran *tran;
+
+ UNUSED(ev);
+ UNUSED(la);
+ UNUSED(lalen);
+ UNUSED(ra);
+ UNUSED(ralen);
+
+ ctx->coID.opaque = NULL;
+ if (fd < 0) {
+ (*ctx->logger)(ctl_error, "%s: evConnect: %s", me,
+ strerror(errno));
+ error(ctx);
+ return;
+ }
+ new_state(ctx, connected);
+ tran = new_tran(ctx, ctx->donefunc, ctx->uap, 0);
+ if (tran == NULL) {
+ (*ctx->logger)(ctl_error, "%s: new_tran failed: %s", me,
+ strerror(errno));
+ error(ctx);
+ return;
+ }
+ start_read(ctx);
+ if (ctx->state == destroyed) {
+ (*ctx->logger)(ctl_error, "%s: start_read failed: %s",
+ me, strerror(errno));
+ error(ctx);
+ return;
+ }
+}
+
+static void
+write_done(evContext lev, void *uap, int fd, int bytes) {
+ struct ctl_tran *tran = (struct ctl_tran *)uap;
+ struct ctl_cctx *ctx = tran->ctx;
+
+ UNUSED(lev);
+ UNUSED(fd);
+
+ ctx->wrID.opaque = NULL;
+ if (ctx->tiID.opaque != NULL)
+ touch_timer(ctx);
+ ctl_bufput(&tran->outbuf);
+ start_write(ctx);
+ if (bytes < 0)
+ destroy(ctx, 1);
+ else
+ start_read(ctx);
+}
+
+static void
+start_read(struct ctl_cctx *ctx) {
+ static const char me[] = "isc/ctl_clnt::start_read";
+
+ REQUIRE(ctx->state == connecting || ctx->state == connected);
+ REQUIRE(ctx->rdID.opaque == NULL);
+ if (evSelectFD(ctx->ev, ctx->sock, EV_READ, readable, ctx,
+ &ctx->rdID) < 0)
+ {
+ (*ctx->logger)(ctl_error, "%s: evSelect(fd %d): %s", me,
+ ctx->sock, strerror(errno));
+ error(ctx);
+ return;
+ }
+}
+
+static void
+stop_read(struct ctl_cctx *ctx) {
+ REQUIRE(ctx->coID.opaque == NULL);
+ REQUIRE(ctx->rdID.opaque != NULL);
+ (void)evDeselectFD(ctx->ev, ctx->rdID);
+ ctx->rdID.opaque = NULL;
+}
+
+static void
+readable(evContext ev, void *uap, int fd, int evmask) {
+ static const char me[] = "isc/ctl_clnt::readable";
+ struct ctl_cctx *ctx = uap;
+ struct ctl_tran *tran;
+ ssize_t n;
+ char *eos;
+
+ UNUSED(ev);
+
+ REQUIRE(ctx != NULL);
+ REQUIRE(fd >= 0);
+ REQUIRE(evmask == EV_READ);
+ REQUIRE(ctx->state == connected);
+ REQUIRE(!EMPTY(ctx->tran));
+ tran = HEAD(ctx->tran);
+ if (!allocated_p(ctx->inbuf) &&
+ ctl_bufget(&ctx->inbuf, ctx->logger) < 0) {
+ (*ctx->logger)(ctl_error, "%s: can't get an input buffer", me);
+ error(ctx);
+ return;
+ }
+ n = read(ctx->sock, ctx->inbuf.text + ctx->inbuf.used,
+ MAX_LINELEN - ctx->inbuf.used);
+ if (n <= 0) {
+ (*ctx->logger)(ctl_warning, "%s: read: %s", me,
+ (n == 0) ? "Unexpected EOF" : strerror(errno));
+ error(ctx);
+ return;
+ }
+ if (ctx->tiID.opaque != NULL)
+ touch_timer(ctx);
+ ctx->inbuf.used += n;
+ (*ctx->logger)(ctl_debug, "%s: read %d, used %d", me,
+ n, ctx->inbuf.used);
+ again:
+ eos = memchr(ctx->inbuf.text, '\n', ctx->inbuf.used);
+ if (eos != NULL && eos != ctx->inbuf.text && eos[-1] == '\r') {
+ int done = 0;
+
+ eos[-1] = '\0';
+ if (!arpacode_p(ctx->inbuf.text)) {
+ /* XXX Doesn't FTP do this sometimes? Is it legal? */
+ (*ctx->logger)(ctl_error, "%s: no arpa code (%s)", me,
+ ctx->inbuf.text);
+ error(ctx);
+ return;
+ }
+ if (arpadone_p(ctx->inbuf.text))
+ done = 1;
+ else if (arpacont_p(ctx->inbuf.text))
+ done = 0;
+ else {
+ /* XXX Doesn't FTP do this sometimes? Is it legal? */
+ (*ctx->logger)(ctl_error, "%s: no arpa flag (%s)", me,
+ ctx->inbuf.text);
+ error(ctx);
+ return;
+ }
+ (*tran->donefunc)(ctx, tran->uap, ctx->inbuf.text,
+ (done ? 0 : CTL_MORE));
+ ctx->inbuf.used -= ((eos - ctx->inbuf.text) + 1);
+ if (ctx->inbuf.used == 0U)
+ ctl_bufput(&ctx->inbuf);
+ else
+ memmove(ctx->inbuf.text, eos + 1, ctx->inbuf.used);
+ if (done) {
+ UNLINK(ctx->tran, tran, link);
+ memput(tran, sizeof *tran);
+ stop_read(ctx);
+ start_write(ctx);
+ return;
+ }
+ if (allocated_p(ctx->inbuf))
+ goto again;
+ return;
+ }
+ if (ctx->inbuf.used == (size_t)MAX_LINELEN) {
+ (*ctx->logger)(ctl_error, "%s: line too long (%-10s...)", me,
+ ctx->inbuf.text);
+ error(ctx);
+ }
+}
+
+/* Timer related stuff. */
+
+static void
+start_timer(struct ctl_cctx *ctx) {
+ static const char me[] = "isc/ctl_clnt::start_timer";
+
+ REQUIRE(ctx->tiID.opaque == NULL);
+ if (evSetIdleTimer(ctx->ev, timer, ctx, ctx->timeout, &ctx->tiID) < 0){
+ (*ctx->logger)(ctl_error, "%s: evSetIdleTimer: %s", me,
+ strerror(errno));
+ error(ctx);
+ return;
+ }
+}
+
+static void
+stop_timer(struct ctl_cctx *ctx) {
+ static const char me[] = "isc/ctl_clnt::stop_timer";
+
+ REQUIRE(ctx->tiID.opaque != NULL);
+ if (evClearIdleTimer(ctx->ev, ctx->tiID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: evClearIdleTimer: %s", me,
+ strerror(errno));
+ error(ctx);
+ return;
+ }
+ ctx->tiID.opaque = NULL;
+}
+
+static void
+touch_timer(struct ctl_cctx *ctx) {
+ REQUIRE(ctx->tiID.opaque != NULL);
+
+ evTouchIdleTimer(ctx->ev, ctx->tiID);
+}
+
+static void
+timer(evContext ev, void *uap, struct timespec due, struct timespec itv) {
+ static const char me[] = "isc/ctl_clnt::timer";
+ struct ctl_cctx *ctx = uap;
+
+ UNUSED(ev);
+ UNUSED(due);
+ UNUSED(itv);
+
+ ctx->tiID.opaque = NULL;
+ (*ctx->logger)(ctl_error, "%s: timeout after %u seconds while %s", me,
+ ctx->timeout.tv_sec, state_names[ctx->state]);
+ error(ctx);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ctl_p.c b/usr/src/lib/libresolv2_joy/common/isc/ctl_p.c
new file mode 100644
index 0000000000..7ab719a5e6
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ctl_p.c
@@ -0,0 +1,188 @@
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "$Id: ctl_p.c,v 1.4 2005/04/27 04:56:35 sra Exp $";
+#endif /* not lint */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Extern. */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include <isc/assertions.h>
+#include <isc/eventlib.h>
+#include <isc/logging.h>
+#include <isc/memcluster.h>
+#include <isc/ctl.h>
+
+#include "ctl_p.h"
+
+#include "port_after.h"
+
+/* Constants. */
+
+const char * const ctl_sevnames[] = {
+ "debug", "warning", "error"
+};
+
+/* Public. */
+
+/*%
+ * ctl_logger()
+ * if ctl_startup()'s caller didn't specify a logger, this one
+ * is used. this pollutes stderr with all kinds of trash so it will
+ * probably never be used in real applications.
+ */
+void
+ctl_logger(enum ctl_severity severity, const char *format, ...) {
+ va_list ap;
+ static const char me[] = "ctl_logger";
+
+ fprintf(stderr, "%s(%s): ", me, ctl_sevnames[severity]);
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ fputc('\n', stderr);
+}
+
+int
+ctl_bufget(struct ctl_buf *buf, ctl_logfunc logger) {
+ static const char me[] = "ctl_bufget";
+
+ REQUIRE(!allocated_p(*buf) && buf->used == 0U);
+ buf->text = memget(MAX_LINELEN);
+ if (!allocated_p(*buf)) {
+ (*logger)(ctl_error, "%s: getmem: %s", me, strerror(errno));
+ return (-1);
+ }
+ buf->used = 0;
+ return (0);
+}
+
+void
+ctl_bufput(struct ctl_buf *buf) {
+
+ REQUIRE(allocated_p(*buf));
+ memput(buf->text, MAX_LINELEN);
+ buf->text = NULL;
+ buf->used = 0;
+}
+
+const char *
+ctl_sa_ntop(const struct sockaddr *sa,
+ char *buf, size_t size,
+ ctl_logfunc logger)
+{
+ static const char me[] = "ctl_sa_ntop";
+ static const char punt[] = "[0].-1";
+ char tmp[INET6_ADDRSTRLEN];
+
+ switch (sa->sa_family) {
+ case AF_INET6: {
+ const struct sockaddr_in6 *in6 =
+ (const struct sockaddr_in6 *) sa;
+
+ if (inet_ntop(in6->sin6_family, &in6->sin6_addr, tmp, sizeof tmp)
+ == NULL) {
+ (*logger)(ctl_error, "%s: inet_ntop(%u %04x): %s",
+ me, in6->sin6_family,
+ in6->sin6_port, strerror(errno));
+ return (punt);
+ }
+ if (strlen(tmp) + sizeof "[].65535" > size) {
+ (*logger)(ctl_error, "%s: buffer overflow", me);
+ return (punt);
+ }
+ (void) sprintf(buf, "[%s].%u", tmp, ntohs(in6->sin6_port));
+ return (buf);
+ }
+ case AF_INET: {
+ const struct sockaddr_in *in =
+ (const struct sockaddr_in *) sa;
+
+ if (inet_ntop(in->sin_family, &in->sin_addr, tmp, sizeof tmp)
+ == NULL) {
+ (*logger)(ctl_error, "%s: inet_ntop(%u %04x %08x): %s",
+ me, in->sin_family,
+ in->sin_port, in->sin_addr.s_addr,
+ strerror(errno));
+ return (punt);
+ }
+ if (strlen(tmp) + sizeof "[].65535" > size) {
+ (*logger)(ctl_error, "%s: buffer overflow", me);
+ return (punt);
+ }
+ (void) sprintf(buf, "[%s].%u", tmp, ntohs(in->sin_port));
+ return (buf);
+ }
+#ifndef NO_SOCKADDR_UN
+ case AF_UNIX: {
+ const struct sockaddr_un *un =
+ (const struct sockaddr_un *) sa;
+ unsigned int x = sizeof un->sun_path;
+
+ if (x > size)
+ x = size;
+ strncpy(buf, un->sun_path, x - 1);
+ buf[x - 1] = '\0';
+ return (buf);
+ }
+#endif
+ default:
+ return (punt);
+ }
+}
+
+void
+ctl_sa_copy(const struct sockaddr *src, struct sockaddr *dst) {
+ switch (src->sa_family) {
+ case AF_INET6:
+ *((struct sockaddr_in6 *)dst) =
+ *((const struct sockaddr_in6 *)src);
+ break;
+ case AF_INET:
+ *((struct sockaddr_in *)dst) =
+ *((const struct sockaddr_in *)src);
+ break;
+#ifndef NO_SOCKADDR_UN
+ case AF_UNIX:
+ *((struct sockaddr_un *)dst) =
+ *((const struct sockaddr_un *)src);
+ break;
+#endif
+ default:
+ *dst = *src;
+ break;
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ctl_p.h b/usr/src/lib/libresolv2_joy/common/isc/ctl_p.h
new file mode 100644
index 0000000000..18a52ae39c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ctl_p.h
@@ -0,0 +1,28 @@
+struct ctl_buf {
+ char * text;
+ size_t used;
+};
+
+#define MAX_LINELEN 990 /*%< Like SMTP. */
+#ifndef NO_SOCKADDR_UN
+#define MAX_NTOP PATH_MAX
+#else
+#define MAX_NTOP (sizeof "[255.255.255.255].65535")
+#endif
+
+#define allocated_p(Buf) ((Buf).text != NULL)
+#define buffer_init(Buf) ((Buf).text = 0, (Buf.used) = 0)
+
+#define ctl_bufget __ctl_bufget
+#define ctl_bufput __ctl_bufput
+#define ctl_sa_ntop __ctl_sa_ntop
+#define ctl_sa_copy __ctl_sa_copy
+
+int ctl_bufget(struct ctl_buf *, ctl_logfunc);
+void ctl_bufput(struct ctl_buf *);
+const char * ctl_sa_ntop(const struct sockaddr *, char *, size_t,
+ ctl_logfunc);
+void ctl_sa_copy(const struct sockaddr *,
+ struct sockaddr *);
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ctl_srvr.c b/usr/src/lib/libresolv2_joy/common/isc/ctl_srvr.c
new file mode 100644
index 0000000000..8fd7a21ffa
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ctl_srvr.c
@@ -0,0 +1,787 @@
+/*
+ * Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "$Id: ctl_srvr.c,v 1.10 2008/11/14 02:36:51 marka Exp $";
+#endif /* not lint */
+
+/* Extern. */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+
+#include <isc/assertions.h>
+#include <isc/ctl.h>
+#include <isc/eventlib.h>
+#include <isc/list.h>
+#include <isc/logging.h>
+#include <isc/memcluster.h>
+
+#include "ctl_p.h"
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/* Macros. */
+
+#define lastverb_p(verb) (verb->name == NULL || verb->func == NULL)
+#define address_expr ctl_sa_ntop((struct sockaddr *)&sess->sa, \
+ tmp, sizeof tmp, ctx->logger)
+
+/* Types. */
+
+enum state {
+ available = 0, initializing, writing, reading, reading_data,
+ processing, idling, quitting, closing
+};
+
+union sa_un {
+ struct sockaddr_in in;
+#ifndef NO_SOCKADDR_UN
+ struct sockaddr_un un;
+#endif
+};
+
+struct ctl_sess {
+ LINK(struct ctl_sess) link;
+ struct ctl_sctx * ctx;
+ enum state state;
+ int sock;
+ union sa_un sa;
+ evFileID rdID;
+ evStreamID wrID;
+ evTimerID rdtiID;
+ evTimerID wrtiID;
+ struct ctl_buf inbuf;
+ struct ctl_buf outbuf;
+ const struct ctl_verb * verb;
+ u_int helpcode;
+ const void * respctx;
+ u_int respflags;
+ ctl_srvrdone donefunc;
+ void * uap;
+ void * csctx;
+};
+
+struct ctl_sctx {
+ evContext ev;
+ void * uctx;
+ u_int unkncode;
+ u_int timeoutcode;
+ const struct ctl_verb * verbs;
+ const struct ctl_verb * connverb;
+ int sock;
+ int max_sess;
+ int cur_sess;
+ struct timespec timeout;
+ ctl_logfunc logger;
+ evConnID acID;
+ LIST(struct ctl_sess) sess;
+};
+
+/* Forward. */
+
+static void ctl_accept(evContext, void *, int,
+ const void *, int,
+ const void *, int);
+static void ctl_close(struct ctl_sess *);
+static void ctl_new_state(struct ctl_sess *,
+ enum state,
+ const char *);
+static void ctl_start_read(struct ctl_sess *);
+static void ctl_stop_read(struct ctl_sess *);
+static void ctl_readable(evContext, void *, int, int);
+static void ctl_rdtimeout(evContext, void *,
+ struct timespec,
+ struct timespec);
+static void ctl_wrtimeout(evContext, void *,
+ struct timespec,
+ struct timespec);
+static void ctl_docommand(struct ctl_sess *);
+static void ctl_writedone(evContext, void *, int, int);
+static void ctl_morehelp(struct ctl_sctx *,
+ struct ctl_sess *,
+ const struct ctl_verb *,
+ const char *,
+ u_int, const void *, void *);
+static void ctl_signal_done(struct ctl_sctx *,
+ struct ctl_sess *);
+
+/* Private data. */
+
+static const char * state_names[] = {
+ "available", "initializing", "writing", "reading",
+ "reading_data", "processing", "idling", "quitting", "closing"
+};
+
+static const char space[] = " ";
+
+static const struct ctl_verb fakehelpverb = {
+ "fakehelp", ctl_morehelp , NULL
+};
+
+/* Public. */
+
+/*%
+ * void
+ * ctl_server()
+ * create, condition, and start a listener on the control port.
+ */
+struct ctl_sctx *
+ctl_server(evContext lev, const struct sockaddr *sap, size_t sap_len,
+ const struct ctl_verb *verbs,
+ u_int unkncode, u_int timeoutcode,
+ u_int timeout, int backlog, int max_sess,
+ ctl_logfunc logger, void *uctx)
+{
+ static const char me[] = "ctl_server";
+ static const int on = 1;
+ const struct ctl_verb *connverb;
+ struct ctl_sctx *ctx;
+ int save_errno;
+
+ if (logger == NULL)
+ logger = ctl_logger;
+ for (connverb = verbs;
+ connverb->name != NULL && connverb->func != NULL;
+ connverb++)
+ if (connverb->name[0] == '\0')
+ break;
+ if (connverb->func == NULL) {
+ (*logger)(ctl_error, "%s: no connection verb found", me);
+ return (NULL);
+ }
+ ctx = memget(sizeof *ctx);
+ if (ctx == NULL) {
+ (*logger)(ctl_error, "%s: getmem: %s", me, strerror(errno));
+ return (NULL);
+ }
+ ctx->ev = lev;
+ ctx->uctx = uctx;
+ ctx->unkncode = unkncode;
+ ctx->timeoutcode = timeoutcode;
+ ctx->verbs = verbs;
+ ctx->timeout = evConsTime(timeout, 0);
+ ctx->logger = logger;
+ ctx->connverb = connverb;
+ ctx->max_sess = max_sess;
+ ctx->cur_sess = 0;
+ INIT_LIST(ctx->sess);
+ ctx->sock = socket(sap->sa_family, SOCK_STREAM, PF_UNSPEC);
+ if (ctx->sock > evHighestFD(ctx->ev)) {
+ ctx->sock = -1;
+ errno = ENOTSOCK;
+ }
+ if (ctx->sock < 0) {
+ save_errno = errno;
+ (*ctx->logger)(ctl_error, "%s: socket: %s",
+ me, strerror(errno));
+ memput(ctx, sizeof *ctx);
+ errno = save_errno;
+ return (NULL);
+ }
+ if (ctx->sock > evHighestFD(lev)) {
+ close(ctx->sock);
+ (*ctx->logger)(ctl_error, "%s: file descriptor > evHighestFD");
+ errno = ENFILE;
+ memput(ctx, sizeof *ctx);
+ return (NULL);
+ }
+#ifdef NO_UNIX_REUSEADDR
+ if (sap->sa_family != AF_UNIX)
+#endif
+ if (setsockopt(ctx->sock, SOL_SOCKET, SO_REUSEADDR,
+ (const char *)&on, sizeof on) != 0) {
+ (*ctx->logger)(ctl_warning,
+ "%s: setsockopt(REUSEADDR): %s",
+ me, strerror(errno));
+ }
+ if (bind(ctx->sock, sap, sap_len) < 0) {
+ char tmp[MAX_NTOP];
+ save_errno = errno;
+ (*ctx->logger)(ctl_error, "%s: bind: %s: %s",
+ me, ctl_sa_ntop((const struct sockaddr *)sap,
+ tmp, sizeof tmp, ctx->logger),
+ strerror(save_errno));
+ close(ctx->sock);
+ memput(ctx, sizeof *ctx);
+ errno = save_errno;
+ return (NULL);
+ }
+ if (fcntl(ctx->sock, F_SETFD, 1) < 0) {
+ (*ctx->logger)(ctl_warning, "%s: fcntl: %s", me,
+ strerror(errno));
+ }
+ if (evListen(lev, ctx->sock, backlog, ctl_accept, ctx,
+ &ctx->acID) < 0) {
+ save_errno = errno;
+ (*ctx->logger)(ctl_error, "%s: evListen(fd %d): %s",
+ me, ctx->sock, strerror(errno));
+ close(ctx->sock);
+ memput(ctx, sizeof *ctx);
+ errno = save_errno;
+ return (NULL);
+ }
+ (*ctx->logger)(ctl_debug, "%s: new ctx %p, sock %d",
+ me, ctx, ctx->sock);
+ return (ctx);
+}
+
+/*%
+ * void
+ * ctl_endserver(ctx)
+ * if the control listener is open, close it. clean out all eventlib
+ * stuff. close all active sessions.
+ */
+void
+ctl_endserver(struct ctl_sctx *ctx) {
+ static const char me[] = "ctl_endserver";
+ struct ctl_sess *this, *next;
+
+ (*ctx->logger)(ctl_debug, "%s: ctx %p, sock %d, acID %p, sess %p",
+ me, ctx, ctx->sock, ctx->acID.opaque, ctx->sess);
+ if (ctx->acID.opaque != NULL) {
+ (void)evCancelConn(ctx->ev, ctx->acID);
+ ctx->acID.opaque = NULL;
+ }
+ if (ctx->sock != -1) {
+ (void) close(ctx->sock);
+ ctx->sock = -1;
+ }
+ for (this = HEAD(ctx->sess); this != NULL; this = next) {
+ next = NEXT(this, link);
+ ctl_close(this);
+ }
+ memput(ctx, sizeof *ctx);
+}
+
+/*%
+ * If body is non-NULL then it we add a "." line after it.
+ * Caller must have escaped lines with leading ".".
+ */
+void
+ctl_response(struct ctl_sess *sess, u_int code, const char *text,
+ u_int flags, const void *respctx, ctl_srvrdone donefunc,
+ void *uap, const char *body, size_t bodylen)
+{
+ static const char me[] = "ctl_response";
+ struct iovec iov[3], *iovp = iov;
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP], *pc;
+ int n;
+
+ REQUIRE(sess->state == initializing ||
+ sess->state == processing ||
+ sess->state == reading_data ||
+ sess->state == writing);
+ REQUIRE(sess->wrtiID.opaque == NULL);
+ REQUIRE(sess->wrID.opaque == NULL);
+ ctl_new_state(sess, writing, me);
+ sess->donefunc = donefunc;
+ sess->uap = uap;
+ if (!allocated_p(sess->outbuf) &&
+ ctl_bufget(&sess->outbuf, ctx->logger) < 0) {
+ (*ctx->logger)(ctl_error, "%s: %s: cant get an output buffer",
+ me, address_expr);
+ goto untimely;
+ }
+ if (sizeof "000-\r\n" + strlen(text) > (size_t)MAX_LINELEN) {
+ (*ctx->logger)(ctl_error, "%s: %s: output buffer ovf, closing",
+ me, address_expr);
+ goto untimely;
+ }
+ sess->outbuf.used = SPRINTF((sess->outbuf.text, "%03d%c%s\r\n",
+ code, (flags & CTL_MORE) != 0 ? '-' : ' ',
+ text));
+ for (pc = sess->outbuf.text, n = 0;
+ n < (int)sess->outbuf.used-2; pc++, n++)
+ if (!isascii((unsigned char)*pc) ||
+ !isprint((unsigned char)*pc))
+ *pc = '\040';
+ *iovp++ = evConsIovec(sess->outbuf.text, sess->outbuf.used);
+ if (body != NULL) {
+ char *tmp;
+ DE_CONST(body, tmp);
+ *iovp++ = evConsIovec(tmp, bodylen);
+ DE_CONST(".\r\n", tmp);
+ *iovp++ = evConsIovec(tmp, 3);
+ }
+ (*ctx->logger)(ctl_debug, "%s: [%d] %s", me,
+ sess->outbuf.used, sess->outbuf.text);
+ if (evWrite(ctx->ev, sess->sock, iov, iovp - iov,
+ ctl_writedone, sess, &sess->wrID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: %s: evWrite: %s", me,
+ address_expr, strerror(errno));
+ goto untimely;
+ }
+ if (evSetIdleTimer(ctx->ev, ctl_wrtimeout, sess, ctx->timeout,
+ &sess->wrtiID) < 0)
+ {
+ (*ctx->logger)(ctl_error, "%s: %s: evSetIdleTimer: %s", me,
+ address_expr, strerror(errno));
+ goto untimely;
+ }
+ if (evTimeRW(ctx->ev, sess->wrID, sess->wrtiID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: %s: evTimeRW: %s", me,
+ address_expr, strerror(errno));
+ untimely:
+ ctl_signal_done(ctx, sess);
+ ctl_close(sess);
+ return;
+ }
+ sess->respctx = respctx;
+ sess->respflags = flags;
+}
+
+void
+ctl_sendhelp(struct ctl_sess *sess, u_int code) {
+ static const char me[] = "ctl_sendhelp";
+ struct ctl_sctx *ctx = sess->ctx;
+
+ sess->helpcode = code;
+ sess->verb = &fakehelpverb;
+ ctl_morehelp(ctx, sess, NULL, me, CTL_MORE,
+ (const void *)ctx->verbs, NULL);
+}
+
+void *
+ctl_getcsctx(struct ctl_sess *sess) {
+ return (sess->csctx);
+}
+
+void *
+ctl_setcsctx(struct ctl_sess *sess, void *csctx) {
+ void *old = sess->csctx;
+
+ sess->csctx = csctx;
+ return (old);
+}
+
+/* Private functions. */
+
+static void
+ctl_accept(evContext lev, void *uap, int fd,
+ const void *lav, int lalen,
+ const void *rav, int ralen)
+{
+ static const char me[] = "ctl_accept";
+ struct ctl_sctx *ctx = uap;
+ struct ctl_sess *sess = NULL;
+ char tmp[MAX_NTOP];
+
+ UNUSED(lev);
+ UNUSED(lalen);
+ UNUSED(ralen);
+
+ if (fd < 0) {
+ (*ctx->logger)(ctl_error, "%s: accept: %s",
+ me, strerror(errno));
+ return;
+ }
+ if (ctx->cur_sess == ctx->max_sess) {
+ (*ctx->logger)(ctl_error, "%s: %s: too many control sessions",
+ me, ctl_sa_ntop((const struct sockaddr *)rav,
+ tmp, sizeof tmp,
+ ctx->logger));
+ (void) close(fd);
+ return;
+ }
+ sess = memget(sizeof *sess);
+ if (sess == NULL) {
+ (*ctx->logger)(ctl_error, "%s: memget: %s", me,
+ strerror(errno));
+ (void) close(fd);
+ return;
+ }
+ if (fcntl(fd, F_SETFD, 1) < 0) {
+ (*ctx->logger)(ctl_warning, "%s: fcntl: %s", me,
+ strerror(errno));
+ }
+ ctx->cur_sess++;
+ INIT_LINK(sess, link);
+ APPEND(ctx->sess, sess, link);
+ sess->ctx = ctx;
+ sess->sock = fd;
+ sess->wrID.opaque = NULL;
+ sess->rdID.opaque = NULL;
+ sess->wrtiID.opaque = NULL;
+ sess->rdtiID.opaque = NULL;
+ sess->respctx = NULL;
+ sess->csctx = NULL;
+ if (((const struct sockaddr *)rav)->sa_family == AF_UNIX)
+ ctl_sa_copy((const struct sockaddr *)lav,
+ (struct sockaddr *)&sess->sa);
+ else
+ ctl_sa_copy((const struct sockaddr *)rav,
+ (struct sockaddr *)&sess->sa);
+ sess->donefunc = NULL;
+ buffer_init(sess->inbuf);
+ buffer_init(sess->outbuf);
+ sess->state = available;
+ ctl_new_state(sess, initializing, me);
+ sess->verb = ctx->connverb;
+ (*ctx->logger)(ctl_debug, "%s: %s: accepting (fd %d)",
+ me, address_expr, sess->sock);
+ (*ctx->connverb->func)(ctx, sess, ctx->connverb, "", 0,
+ (const struct sockaddr *)rav, ctx->uctx);
+}
+
+static void
+ctl_new_state(struct ctl_sess *sess, enum state new_state, const char *reason)
+{
+ static const char me[] = "ctl_new_state";
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP];
+
+ (*ctx->logger)(ctl_debug, "%s: %s: %s -> %s (%s)",
+ me, address_expr,
+ state_names[sess->state],
+ state_names[new_state], reason);
+ sess->state = new_state;
+}
+
+static void
+ctl_close(struct ctl_sess *sess) {
+ static const char me[] = "ctl_close";
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP];
+
+ REQUIRE(sess->state == initializing ||
+ sess->state == writing ||
+ sess->state == reading ||
+ sess->state == processing ||
+ sess->state == reading_data ||
+ sess->state == idling);
+ REQUIRE(sess->sock != -1);
+ if (sess->state == reading || sess->state == reading_data)
+ ctl_stop_read(sess);
+ else if (sess->state == writing) {
+ if (sess->wrID.opaque != NULL) {
+ (void) evCancelRW(ctx->ev, sess->wrID);
+ sess->wrID.opaque = NULL;
+ }
+ if (sess->wrtiID.opaque != NULL) {
+ (void) evClearIdleTimer(ctx->ev, sess->wrtiID);
+ sess->wrtiID.opaque = NULL;
+ }
+ }
+ ctl_new_state(sess, closing, me);
+ (void) close(sess->sock);
+ if (allocated_p(sess->inbuf))
+ ctl_bufput(&sess->inbuf);
+ if (allocated_p(sess->outbuf))
+ ctl_bufput(&sess->outbuf);
+ (*ctx->logger)(ctl_debug, "%s: %s: closed (fd %d)",
+ me, address_expr, sess->sock);
+ UNLINK(ctx->sess, sess, link);
+ memput(sess, sizeof *sess);
+ ctx->cur_sess--;
+}
+
+static void
+ctl_start_read(struct ctl_sess *sess) {
+ static const char me[] = "ctl_start_read";
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP];
+
+ REQUIRE(sess->state == initializing ||
+ sess->state == writing ||
+ sess->state == processing ||
+ sess->state == idling);
+ REQUIRE(sess->rdtiID.opaque == NULL);
+ REQUIRE(sess->rdID.opaque == NULL);
+ sess->inbuf.used = 0;
+ if (evSetIdleTimer(ctx->ev, ctl_rdtimeout, sess, ctx->timeout,
+ &sess->rdtiID) < 0)
+ {
+ (*ctx->logger)(ctl_error, "%s: %s: evSetIdleTimer: %s", me,
+ address_expr, strerror(errno));
+ ctl_close(sess);
+ return;
+ }
+ if (evSelectFD(ctx->ev, sess->sock, EV_READ,
+ ctl_readable, sess, &sess->rdID) < 0) {
+ (*ctx->logger)(ctl_error, "%s: %s: evSelectFD: %s", me,
+ address_expr, strerror(errno));
+ return;
+ }
+ ctl_new_state(sess, reading, me);
+}
+
+static void
+ctl_stop_read(struct ctl_sess *sess) {
+ static const char me[] = "ctl_stop_read";
+ struct ctl_sctx *ctx = sess->ctx;
+
+ REQUIRE(sess->state == reading || sess->state == reading_data);
+ REQUIRE(sess->rdID.opaque != NULL);
+ (void) evDeselectFD(ctx->ev, sess->rdID);
+ sess->rdID.opaque = NULL;
+ if (sess->rdtiID.opaque != NULL) {
+ (void) evClearIdleTimer(ctx->ev, sess->rdtiID);
+ sess->rdtiID.opaque = NULL;
+ }
+ ctl_new_state(sess, idling, me);
+}
+
+static void
+ctl_readable(evContext lev, void *uap, int fd, int evmask) {
+ static const char me[] = "ctl_readable";
+ struct ctl_sess *sess = uap;
+ struct ctl_sctx *ctx;
+ char *eos, tmp[MAX_NTOP];
+ ssize_t n;
+
+ REQUIRE(sess != NULL);
+ REQUIRE(fd >= 0);
+ REQUIRE(evmask == EV_READ);
+ REQUIRE(sess->state == reading || sess->state == reading_data);
+
+ ctx = sess->ctx;
+ evTouchIdleTimer(lev, sess->rdtiID);
+ if (!allocated_p(sess->inbuf) &&
+ ctl_bufget(&sess->inbuf, ctx->logger) < 0) {
+ (*ctx->logger)(ctl_error, "%s: %s: cant get an input buffer",
+ me, address_expr);
+ ctl_close(sess);
+ return;
+ }
+ n = read(sess->sock, sess->inbuf.text + sess->inbuf.used,
+ MAX_LINELEN - sess->inbuf.used);
+ if (n <= 0) {
+ (*ctx->logger)(ctl_debug, "%s: %s: read: %s",
+ me, address_expr,
+ (n == 0) ? "Unexpected EOF" : strerror(errno));
+ ctl_close(sess);
+ return;
+ }
+ sess->inbuf.used += n;
+ eos = memchr(sess->inbuf.text, '\n', sess->inbuf.used);
+ if (eos != NULL && eos != sess->inbuf.text && eos[-1] == '\r') {
+ eos[-1] = '\0';
+ if ((sess->respflags & CTL_DATA) != 0) {
+ INSIST(sess->verb != NULL);
+ (*sess->verb->func)(sess->ctx, sess, sess->verb,
+ sess->inbuf.text,
+ CTL_DATA, sess->respctx,
+ sess->ctx->uctx);
+ } else {
+ ctl_stop_read(sess);
+ ctl_docommand(sess);
+ }
+ sess->inbuf.used -= ((eos - sess->inbuf.text) + 1);
+ if (sess->inbuf.used == 0U)
+ ctl_bufput(&sess->inbuf);
+ else
+ memmove(sess->inbuf.text, eos + 1, sess->inbuf.used);
+ return;
+ }
+ if (sess->inbuf.used == (size_t)MAX_LINELEN) {
+ (*ctx->logger)(ctl_error, "%s: %s: line too long, closing",
+ me, address_expr);
+ ctl_close(sess);
+ }
+}
+
+static void
+ctl_wrtimeout(evContext lev, void *uap,
+ struct timespec due,
+ struct timespec itv)
+{
+ static const char me[] = "ctl_wrtimeout";
+ struct ctl_sess *sess = uap;
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP];
+
+ UNUSED(lev);
+ UNUSED(due);
+ UNUSED(itv);
+
+ REQUIRE(sess->state == writing);
+ sess->wrtiID.opaque = NULL;
+ (*ctx->logger)(ctl_warning, "%s: %s: write timeout, closing",
+ me, address_expr);
+ if (sess->wrID.opaque != NULL) {
+ (void) evCancelRW(ctx->ev, sess->wrID);
+ sess->wrID.opaque = NULL;
+ }
+ ctl_signal_done(ctx, sess);
+ ctl_new_state(sess, processing, me);
+ ctl_close(sess);
+}
+
+static void
+ctl_rdtimeout(evContext lev, void *uap,
+ struct timespec due,
+ struct timespec itv)
+{
+ static const char me[] = "ctl_rdtimeout";
+ struct ctl_sess *sess = uap;
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP];
+
+ UNUSED(lev);
+ UNUSED(due);
+ UNUSED(itv);
+
+ REQUIRE(sess->state == reading);
+ sess->rdtiID.opaque = NULL;
+ (*ctx->logger)(ctl_warning, "%s: %s: timeout, closing",
+ me, address_expr);
+ if (sess->state == reading || sess->state == reading_data)
+ ctl_stop_read(sess);
+ ctl_signal_done(ctx, sess);
+ ctl_new_state(sess, processing, me);
+ ctl_response(sess, ctx->timeoutcode, "Timeout.", CTL_EXIT, NULL,
+ NULL, NULL, NULL, 0);
+}
+
+static void
+ctl_docommand(struct ctl_sess *sess) {
+ static const char me[] = "ctl_docommand";
+ char *name, *rest, tmp[MAX_NTOP];
+ struct ctl_sctx *ctx = sess->ctx;
+ const struct ctl_verb *verb;
+
+ REQUIRE(allocated_p(sess->inbuf));
+ (*ctx->logger)(ctl_debug, "%s: %s: \"%s\" [%u]",
+ me, address_expr,
+ sess->inbuf.text, (u_int)sess->inbuf.used);
+ ctl_new_state(sess, processing, me);
+ name = sess->inbuf.text + strspn(sess->inbuf.text, space);
+ rest = name + strcspn(name, space);
+ if (*rest != '\0') {
+ *rest++ = '\0';
+ rest += strspn(rest, space);
+ }
+ for (verb = ctx->verbs;
+ verb != NULL && verb->name != NULL && verb->func != NULL;
+ verb++)
+ if (verb->name[0] != '\0' && strcasecmp(name, verb->name) == 0)
+ break;
+ if (verb != NULL && verb->name != NULL && verb->func != NULL) {
+ sess->verb = verb;
+ (*verb->func)(ctx, sess, verb, rest, 0, NULL, ctx->uctx);
+ } else {
+ char buf[1100];
+
+ if (sizeof "Unrecognized command \"\" (args \"\")" +
+ strlen(name) + strlen(rest) > sizeof buf)
+ strcpy(buf, "Unrecognized command (buf ovf)");
+ else
+ sprintf(buf,
+ "Unrecognized command \"%s\" (args \"%s\")",
+ name, rest);
+ ctl_response(sess, ctx->unkncode, buf, 0, NULL, NULL, NULL,
+ NULL, 0);
+ }
+}
+
+static void
+ctl_writedone(evContext lev, void *uap, int fd, int bytes) {
+ static const char me[] = "ctl_writedone";
+ struct ctl_sess *sess = uap;
+ struct ctl_sctx *ctx = sess->ctx;
+ char tmp[MAX_NTOP];
+ int save_errno = errno;
+
+ UNUSED(lev);
+ UNUSED(uap);
+
+ REQUIRE(sess->state == writing);
+ REQUIRE(fd == sess->sock);
+ REQUIRE(sess->wrtiID.opaque != NULL);
+ sess->wrID.opaque = NULL;
+ (void) evClearIdleTimer(ctx->ev, sess->wrtiID);
+ sess->wrtiID.opaque = NULL;
+ if (bytes < 0) {
+ (*ctx->logger)(ctl_error, "%s: %s: %s",
+ me, address_expr, strerror(save_errno));
+ ctl_close(sess);
+ return;
+ }
+
+ INSIST(allocated_p(sess->outbuf));
+ ctl_bufput(&sess->outbuf);
+ if ((sess->respflags & CTL_EXIT) != 0) {
+ ctl_signal_done(ctx, sess);
+ ctl_close(sess);
+ return;
+ } else if ((sess->respflags & CTL_MORE) != 0) {
+ INSIST(sess->verb != NULL);
+ (*sess->verb->func)(sess->ctx, sess, sess->verb, "",
+ CTL_MORE, sess->respctx, sess->ctx->uctx);
+ } else {
+ ctl_signal_done(ctx, sess);
+ ctl_start_read(sess);
+ }
+}
+
+static void
+ctl_morehelp(struct ctl_sctx *ctx, struct ctl_sess *sess,
+ const struct ctl_verb *verb, const char *text,
+ u_int respflags, const void *respctx, void *uctx)
+{
+ const struct ctl_verb *this = respctx, *next = this + 1;
+
+ UNUSED(ctx);
+ UNUSED(verb);
+ UNUSED(text);
+ UNUSED(uctx);
+
+ REQUIRE(!lastverb_p(this));
+ REQUIRE((respflags & CTL_MORE) != 0);
+ if (lastverb_p(next))
+ respflags &= ~CTL_MORE;
+ ctl_response(sess, sess->helpcode, this->help, respflags, next,
+ NULL, NULL, NULL, 0);
+}
+
+static void
+ctl_signal_done(struct ctl_sctx *ctx, struct ctl_sess *sess) {
+ if (sess->donefunc != NULL) {
+ (*sess->donefunc)(ctx, sess, sess->uap);
+ sess->donefunc = NULL;
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ev_connects.c b/usr/src/lib/libresolv2_joy/common/isc/ev_connects.c
new file mode 100644
index 0000000000..38dfdbe512
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ev_connects.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* ev_connects.c - implement asynch connect/accept for the eventlib
+ * vix 16sep96 [initial]
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: ev_connects.c,v 1.8 2006/03/09 23:57:56 marka Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+
+#include <unistd.h>
+
+#include <isc/eventlib.h>
+#include <isc/assertions.h>
+#include "eventlib_p.h"
+
+#include "port_after.h"
+
+/* Macros. */
+
+#define GETXXXNAME(f, s, sa, len) ( \
+ (f((s), (&sa), (&len)) >= 0) ? 0 : \
+ (errno != EAFNOSUPPORT && errno != EOPNOTSUPP) ? -1 : ( \
+ memset(&(sa), 0, sizeof (sa)), \
+ (len) = sizeof (sa), \
+ (sa).sa_family = AF_UNIX, \
+ 0 \
+ ) \
+ )
+
+/* Forward. */
+
+static void listener(evContext ctx, void *uap, int fd, int evmask);
+static void connector(evContext ctx, void *uap, int fd, int evmask);
+
+/* Public. */
+
+int
+evListen(evContext opaqueCtx, int fd, int maxconn,
+ evConnFunc func, void *uap, evConnID *id)
+{
+ evContext_p *ctx = opaqueCtx.opaque;
+ evConn *new;
+ int mode;
+
+ OKNEW(new);
+ new->flags = EV_CONN_LISTEN;
+ OKFREE(mode = fcntl(fd, F_GETFL, NULL), new); /*%< side effect: validate fd. */
+ /*
+ * Remember the nonblocking status. We assume that either evSelectFD
+ * has not been done to this fd, or that if it has then the caller
+ * will evCancelConn before they evDeselectFD. If our assumptions
+ * are not met, then we might restore the old nonblocking status
+ * incorrectly.
+ */
+ if ((mode & PORT_NONBLOCK) == 0) {
+#ifdef USE_FIONBIO_IOCTL
+ int on = 1;
+ OKFREE(ioctl(fd, FIONBIO, (char *)&on), new);
+#else
+ OKFREE(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK), new);
+#endif
+ new->flags |= EV_CONN_BLOCK;
+ }
+ OKFREE(listen(fd, maxconn), new);
+ if (evSelectFD(opaqueCtx, fd, EV_READ, listener, new, &new->file) < 0){
+ int save = errno;
+
+ FREE(new);
+ errno = save;
+ return (-1);
+ }
+ new->flags |= EV_CONN_SELECTED;
+ new->func = func;
+ new->uap = uap;
+ new->fd = fd;
+ if (ctx->conns != NULL)
+ ctx->conns->prev = new;
+ new->prev = NULL;
+ new->next = ctx->conns;
+ ctx->conns = new;
+ if (id)
+ id->opaque = new;
+ return (0);
+}
+
+int
+evConnect(evContext opaqueCtx, int fd, const void *ra, int ralen,
+ evConnFunc func, void *uap, evConnID *id)
+{
+ evContext_p *ctx = opaqueCtx.opaque;
+ evConn *new;
+
+ OKNEW(new);
+ new->flags = 0;
+ /* Do the select() first to get the socket into nonblocking mode. */
+ if (evSelectFD(opaqueCtx, fd, EV_MASK_ALL,
+ connector, new, &new->file) < 0) {
+ int save = errno;
+
+ FREE(new);
+ errno = save;
+ return (-1);
+ }
+ new->flags |= EV_CONN_SELECTED;
+ if (connect(fd, ra, ralen) < 0 &&
+ errno != EWOULDBLOCK &&
+ errno != EAGAIN &&
+ errno != EINPROGRESS) {
+ int save = errno;
+
+ (void) evDeselectFD(opaqueCtx, new->file);
+ FREE(new);
+ errno = save;
+ return (-1);
+ }
+ /* No error, or EWOULDBLOCK. select() tells when it's ready. */
+ new->func = func;
+ new->uap = uap;
+ new->fd = fd;
+ if (ctx->conns != NULL)
+ ctx->conns->prev = new;
+ new->prev = NULL;
+ new->next = ctx->conns;
+ ctx->conns = new;
+ if (id)
+ id->opaque = new;
+ return (0);
+}
+
+int
+evCancelConn(evContext opaqueCtx, evConnID id) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evConn *this = id.opaque;
+ evAccept *acc, *nxtacc;
+ int mode;
+
+ if ((this->flags & EV_CONN_SELECTED) != 0)
+ (void) evDeselectFD(opaqueCtx, this->file);
+ if ((this->flags & EV_CONN_BLOCK) != 0) {
+ mode = fcntl(this->fd, F_GETFL, NULL);
+ if (mode == -1) {
+ if (errno != EBADF)
+ return (-1);
+ } else {
+#ifdef USE_FIONBIO_IOCTL
+ int off = 0;
+ OK(ioctl(this->fd, FIONBIO, (char *)&off));
+#else
+ OK(fcntl(this->fd, F_SETFL, mode & ~PORT_NONBLOCK));
+#endif
+ }
+ }
+
+ /* Unlink from ctx->conns. */
+ if (this->prev != NULL)
+ this->prev->next = this->next;
+ else
+ ctx->conns = this->next;
+ if (this->next != NULL)
+ this->next->prev = this->prev;
+
+ /*
+ * Remove `this' from the ctx->accepts list (zero or more times).
+ */
+ for (acc = HEAD(ctx->accepts), nxtacc = NULL;
+ acc != NULL;
+ acc = nxtacc)
+ {
+ nxtacc = NEXT(acc, link);
+ if (acc->conn == this) {
+ UNLINK(ctx->accepts, acc, link);
+ close(acc->fd);
+ FREE(acc);
+ }
+ }
+
+ /* Wrap up and get out. */
+ FREE(this);
+ return (0);
+}
+
+int evHold(evContext opaqueCtx, evConnID id) {
+ evConn *this = id.opaque;
+
+ if ((this->flags & EV_CONN_LISTEN) == 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ if ((this->flags & EV_CONN_SELECTED) == 0)
+ return (0);
+ this->flags &= ~EV_CONN_SELECTED;
+ return (evDeselectFD(opaqueCtx, this->file));
+}
+
+int evUnhold(evContext opaqueCtx, evConnID id) {
+ evConn *this = id.opaque;
+ int ret;
+
+ if ((this->flags & EV_CONN_LISTEN) == 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ if ((this->flags & EV_CONN_SELECTED) != 0)
+ return (0);
+ ret = evSelectFD(opaqueCtx, this->fd, EV_READ, listener, this,
+ &this->file);
+ if (ret == 0)
+ this->flags |= EV_CONN_SELECTED;
+ return (ret);
+}
+
+int
+evTryAccept(evContext opaqueCtx, evConnID id, int *sys_errno) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evConn *conn = id.opaque;
+ evAccept *new;
+
+ if ((conn->flags & EV_CONN_LISTEN) == 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ OKNEW(new);
+ new->conn = conn;
+ new->ralen = sizeof new->ra;
+ new->fd = accept(conn->fd, &new->ra.sa, &new->ralen);
+ if (new->fd > ctx->highestFD) {
+ close(new->fd);
+ new->fd = -1;
+ new->ioErrno = ENOTSOCK;
+ }
+ if (new->fd >= 0) {
+ new->lalen = sizeof new->la;
+ if (GETXXXNAME(getsockname, new->fd, new->la.sa, new->lalen) < 0) {
+ new->ioErrno = errno;
+ (void) close(new->fd);
+ new->fd = -1;
+ } else
+ new->ioErrno = 0;
+ } else {
+ new->ioErrno = errno;
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ FREE(new);
+ return (-1);
+ }
+ }
+ INIT_LINK(new, link);
+ APPEND(ctx->accepts, new, link);
+ *sys_errno = new->ioErrno;
+ return (0);
+}
+
+/* Private. */
+
+static void
+listener(evContext opaqueCtx, void *uap, int fd, int evmask) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evConn *conn = uap;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in;
+#ifndef NO_SOCKADDR_UN
+ struct sockaddr_un un;
+#endif
+ } la, ra;
+ int new;
+ ISC_SOCKLEN_T lalen = 0, ralen;
+
+ REQUIRE((evmask & EV_READ) != 0);
+ ralen = sizeof ra;
+ new = accept(fd, &ra.sa, &ralen);
+ if (new > ctx->highestFD) {
+ close(new);
+ new = -1;
+ errno = ENOTSOCK;
+ }
+ if (new >= 0) {
+ lalen = sizeof la;
+ if (GETXXXNAME(getsockname, new, la.sa, lalen) < 0) {
+ int save = errno;
+
+ (void) close(new);
+ errno = save;
+ new = -1;
+ }
+ } else if (errno == EAGAIN || errno == EWOULDBLOCK)
+ return;
+ (*conn->func)(opaqueCtx, conn->uap, new, &la.sa, lalen, &ra.sa, ralen);
+}
+
+static void
+connector(evContext opaqueCtx, void *uap, int fd, int evmask) {
+ evConn *conn = uap;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in;
+#ifndef NO_SOCKADDR_UN
+ struct sockaddr_un un;
+#endif
+ } la, ra;
+ ISC_SOCKLEN_T lalen, ralen;
+#ifndef NETREAD_BROKEN
+ char buf[1];
+#endif
+ void *conn_uap;
+ evConnFunc conn_func;
+ evConnID id;
+ int socket_errno = 0;
+ ISC_SOCKLEN_T optlen;
+
+ UNUSED(evmask);
+
+ lalen = sizeof la;
+ ralen = sizeof ra;
+ conn_uap = conn->uap;
+ conn_func = conn->func;
+ id.opaque = conn;
+#ifdef SO_ERROR
+ optlen = sizeof socket_errno;
+ if (fd < 0 &&
+ getsockopt(conn->fd, SOL_SOCKET, SO_ERROR, (char *)&socket_errno,
+ &optlen) < 0)
+ socket_errno = errno;
+ else
+ errno = socket_errno;
+#endif
+ if (evCancelConn(opaqueCtx, id) < 0 ||
+ socket_errno ||
+#ifdef NETREAD_BROKEN
+ 0 ||
+#else
+ read(fd, buf, 0) < 0 ||
+#endif
+ GETXXXNAME(getsockname, fd, la.sa, lalen) < 0 ||
+ GETXXXNAME(getpeername, fd, ra.sa, ralen) < 0) {
+ int save = errno;
+
+ (void) close(fd); /*%< XXX closing caller's fd */
+ errno = save;
+ fd = -1;
+ }
+ (*conn_func)(opaqueCtx, conn_uap, fd, &la.sa, lalen, &ra.sa, ralen);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ev_files.c b/usr/src/lib/libresolv2_joy/common/isc/ev_files.c
new file mode 100644
index 0000000000..b12baf1aaa
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ev_files.c
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* ev_files.c - implement asynch file IO for the eventlib
+ * vix 11sep95 [initial]
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: ev_files.c,v 1.8 2005/07/28 06:51:48 marka Exp $";
+#endif
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <isc/eventlib.h>
+#include "eventlib_p.h"
+
+#include "port_after.h"
+
+static evFile *FindFD(const evContext_p *ctx, int fd, int eventmask);
+
+int
+evSelectFD(evContext opaqueCtx,
+ int fd,
+ int eventmask,
+ evFileFunc func,
+ void *uap,
+ evFileID *opaqueID
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evFile *id;
+ int mode;
+
+ evPrintf(ctx, 1,
+ "evSelectFD(ctx %p, fd %d, mask 0x%x, func %p, uap %p)\n",
+ ctx, fd, eventmask, func, uap);
+ if (eventmask == 0 || (eventmask & ~EV_MASK_ALL) != 0)
+ EV_ERR(EINVAL);
+#ifndef USE_POLL
+ if (fd > ctx->highestFD)
+ EV_ERR(EINVAL);
+#endif
+ OK(mode = fcntl(fd, F_GETFL, NULL)); /*%< side effect: validate fd. */
+ /*
+ * The first time we touch a file descriptor, we need to check to see
+ * if the application already had it in O_NONBLOCK mode and if so, all
+ * of our deselect()'s have to leave it in O_NONBLOCK. If not, then
+ * all but our last deselect() has to leave it in O_NONBLOCK.
+ */
+#ifdef USE_POLL
+ /* Make sure both ctx->pollfds[] and ctx->fdTable[] are large enough */
+ if (fd >= ctx->maxnfds && evPollfdRealloc(ctx, 1, fd) != 0)
+ EV_ERR(ENOMEM);
+#endif /* USE_POLL */
+ id = FindFD(ctx, fd, EV_MASK_ALL);
+ if (id == NULL) {
+ if (mode & PORT_NONBLOCK)
+ FD_SET(fd, &ctx->nonblockBefore);
+ else {
+#ifdef USE_FIONBIO_IOCTL
+ int on = 1;
+ OK(ioctl(fd, FIONBIO, (char *)&on));
+#else
+ OK(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK));
+#endif
+ FD_CLR(fd, &ctx->nonblockBefore);
+ }
+ }
+
+ /*
+ * If this descriptor is already in use, search for it again to see
+ * if any of the eventmask bits we want to set are already captured.
+ * We cannot usefully capture the same fd event more than once in the
+ * same context.
+ */
+ if (id != NULL && FindFD(ctx, fd, eventmask) != NULL)
+ EV_ERR(ETOOMANYREFS);
+
+ /* Allocate and fill. */
+ OKNEW(id);
+ id->func = func;
+ id->uap = uap;
+ id->fd = fd;
+ id->eventmask = eventmask;
+
+ /*
+ * Insert at head. Order could be important for performance if we
+ * believe that evGetNext()'s accesses to the fd_sets will be more
+ * serial and therefore more cache-lucky if the list is ordered by
+ * ``fd.'' We do not believe these things, so we don't do it.
+ *
+ * The interesting sequence is where GetNext() has cached a select()
+ * result and the caller decides to evSelectFD() on some descriptor.
+ * Since GetNext() starts at the head, it can miss new entries we add
+ * at the head. This is not a serious problem since the event being
+ * evSelectFD()'d for has to occur before evSelectFD() is called for
+ * the file event to be considered "missed" -- a real corner case.
+ * Maintaining a "tail" pointer for ctx->files would fix this, but I'm
+ * not sure it would be ``more correct.''
+ */
+ if (ctx->files != NULL)
+ ctx->files->prev = id;
+ id->prev = NULL;
+ id->next = ctx->files;
+ ctx->files = id;
+
+ /* Insert into fd table. */
+ if (ctx->fdTable[fd] != NULL)
+ ctx->fdTable[fd]->fdprev = id;
+ id->fdprev = NULL;
+ id->fdnext = ctx->fdTable[fd];
+ ctx->fdTable[fd] = id;
+
+ /* Turn on the appropriate bits in the {rd,wr,ex}Next fd_set's. */
+ if (eventmask & EV_READ)
+ FD_SET(fd, &ctx->rdNext);
+ if (eventmask & EV_WRITE)
+ FD_SET(fd, &ctx->wrNext);
+ if (eventmask & EV_EXCEPT)
+ FD_SET(fd, &ctx->exNext);
+
+ /* Update fdMax. */
+ if (fd > ctx->fdMax)
+ ctx->fdMax = fd;
+
+ /* Remember the ID if the caller provided us a place for it. */
+ if (opaqueID)
+ opaqueID->opaque = id;
+
+ return (0);
+}
+
+int
+evDeselectFD(evContext opaqueCtx, evFileID opaqueID) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evFile *del = opaqueID.opaque;
+ evFile *cur;
+ int mode, eventmask;
+
+ if (!del) {
+ evPrintf(ctx, 11, "evDeselectFD(NULL) ignored\n");
+ errno = EINVAL;
+ return (-1);
+ }
+
+ evPrintf(ctx, 1, "evDeselectFD(fd %d, mask 0x%x)\n",
+ del->fd, del->eventmask);
+
+ /* Get the mode. Unless the file has been closed, errors are bad. */
+ mode = fcntl(del->fd, F_GETFL, NULL);
+ if (mode == -1 && errno != EBADF)
+ EV_ERR(errno);
+
+ /* Remove from the list of files. */
+ if (del->prev != NULL)
+ del->prev->next = del->next;
+ else
+ ctx->files = del->next;
+ if (del->next != NULL)
+ del->next->prev = del->prev;
+
+ /* Remove from the fd table. */
+ if (del->fdprev != NULL)
+ del->fdprev->fdnext = del->fdnext;
+ else
+ ctx->fdTable[del->fd] = del->fdnext;
+ if (del->fdnext != NULL)
+ del->fdnext->fdprev = del->fdprev;
+
+ /*
+ * If the file descriptor does not appear in any other select() entry,
+ * and if !EV_WASNONBLOCK, and if we got no EBADF when we got the mode
+ * earlier, then: restore the fd to blocking status.
+ */
+ if (!(cur = FindFD(ctx, del->fd, EV_MASK_ALL)) &&
+ !FD_ISSET(del->fd, &ctx->nonblockBefore) &&
+ mode != -1) {
+ /*
+ * Note that we won't return an error status to the caller if
+ * this fcntl() fails since (a) we've already done the work
+ * and (b) the caller didn't ask us anything about O_NONBLOCK.
+ */
+#ifdef USE_FIONBIO_IOCTL
+ int off = 0;
+ (void) ioctl(del->fd, FIONBIO, (char *)&off);
+#else
+ (void) fcntl(del->fd, F_SETFL, mode & ~PORT_NONBLOCK);
+#endif
+ }
+
+ /*
+ * Now find all other uses of this descriptor and OR together an event
+ * mask so that we don't turn off {rd,wr,ex}Next bits that some other
+ * file event is using. As an optimization, stop if the event mask
+ * fills.
+ */
+ eventmask = 0;
+ for ((void)NULL;
+ cur != NULL && eventmask != EV_MASK_ALL;
+ cur = cur->next)
+ if (cur->fd == del->fd)
+ eventmask |= cur->eventmask;
+
+ /* OK, now we know which bits we can clear out. */
+ if (!(eventmask & EV_READ)) {
+ FD_CLR(del->fd, &ctx->rdNext);
+ if (FD_ISSET(del->fd, &ctx->rdLast)) {
+ FD_CLR(del->fd, &ctx->rdLast);
+ ctx->fdCount--;
+ }
+ }
+ if (!(eventmask & EV_WRITE)) {
+ FD_CLR(del->fd, &ctx->wrNext);
+ if (FD_ISSET(del->fd, &ctx->wrLast)) {
+ FD_CLR(del->fd, &ctx->wrLast);
+ ctx->fdCount--;
+ }
+ }
+ if (!(eventmask & EV_EXCEPT)) {
+ FD_CLR(del->fd, &ctx->exNext);
+ if (FD_ISSET(del->fd, &ctx->exLast)) {
+ FD_CLR(del->fd, &ctx->exLast);
+ ctx->fdCount--;
+ }
+ }
+
+ /* If this was the maxFD, find the new one. */
+ if (del->fd == ctx->fdMax) {
+ ctx->fdMax = -1;
+ for (cur = ctx->files; cur; cur = cur->next)
+ if (cur->fd > ctx->fdMax)
+ ctx->fdMax = cur->fd;
+ }
+
+ /* If this was the fdNext, cycle that to the next entry. */
+ if (del == ctx->fdNext)
+ ctx->fdNext = del->next;
+
+ /* Couldn't free it before now since we were using fields out of it. */
+ FREE(del);
+
+ return (0);
+}
+
+static evFile *
+FindFD(const evContext_p *ctx, int fd, int eventmask) {
+ evFile *id;
+
+ for (id = ctx->fdTable[fd]; id != NULL; id = id->fdnext)
+ if (id->fd == fd && (id->eventmask & eventmask) != 0)
+ break;
+ return (id);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ev_streams.c b/usr/src/lib/libresolv2_joy/common/isc/ev_streams.c
new file mode 100644
index 0000000000..5dad36d04a
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ev_streams.c
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* ev_streams.c - implement asynch stream file IO for the eventlib
+ * vix 04mar96 [initial]
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: ev_streams.c,v 1.5 2005/04/27 04:56:36 sra Exp $";
+#endif
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+
+#include <errno.h>
+
+#include <isc/eventlib.h>
+#include <isc/assertions.h>
+#include "eventlib_p.h"
+
+#include "port_after.h"
+
+static int copyvec(evStream *str, const struct iovec *iov, int iocnt);
+static void consume(evStream *str, size_t bytes);
+static void done(evContext opaqueCtx, evStream *str);
+static void writable(evContext opaqueCtx, void *uap, int fd, int evmask);
+static void readable(evContext opaqueCtx, void *uap, int fd, int evmask);
+
+struct iovec
+evConsIovec(void *buf, size_t cnt) {
+ struct iovec ret;
+
+ memset(&ret, 0xf5, sizeof ret);
+ ret.iov_base = buf;
+ ret.iov_len = cnt;
+ return (ret);
+}
+
+int
+evWrite(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt,
+ evStreamFunc func, void *uap, evStreamID *id)
+{
+ evContext_p *ctx = opaqueCtx.opaque;
+ evStream *new;
+ int save;
+
+ OKNEW(new);
+ new->func = func;
+ new->uap = uap;
+ new->fd = fd;
+ new->flags = 0;
+ if (evSelectFD(opaqueCtx, fd, EV_WRITE, writable, new, &new->file) < 0)
+ goto free;
+ if (copyvec(new, iov, iocnt) < 0)
+ goto free;
+ new->prevDone = NULL;
+ new->nextDone = NULL;
+ if (ctx->streams != NULL)
+ ctx->streams->prev = new;
+ new->prev = NULL;
+ new->next = ctx->streams;
+ ctx->streams = new;
+ if (id != NULL)
+ id->opaque = new;
+ return (0);
+ free:
+ save = errno;
+ FREE(new);
+ errno = save;
+ return (-1);
+}
+
+int
+evRead(evContext opaqueCtx, int fd, const struct iovec *iov, int iocnt,
+ evStreamFunc func, void *uap, evStreamID *id)
+{
+ evContext_p *ctx = opaqueCtx.opaque;
+ evStream *new;
+ int save;
+
+ OKNEW(new);
+ new->func = func;
+ new->uap = uap;
+ new->fd = fd;
+ new->flags = 0;
+ if (evSelectFD(opaqueCtx, fd, EV_READ, readable, new, &new->file) < 0)
+ goto free;
+ if (copyvec(new, iov, iocnt) < 0)
+ goto free;
+ new->prevDone = NULL;
+ new->nextDone = NULL;
+ if (ctx->streams != NULL)
+ ctx->streams->prev = new;
+ new->prev = NULL;
+ new->next = ctx->streams;
+ ctx->streams = new;
+ if (id)
+ id->opaque = new;
+ return (0);
+ free:
+ save = errno;
+ FREE(new);
+ errno = save;
+ return (-1);
+}
+
+int
+evTimeRW(evContext opaqueCtx, evStreamID id, evTimerID timer) /*ARGSUSED*/ {
+ evStream *str = id.opaque;
+
+ UNUSED(opaqueCtx);
+
+ str->timer = timer;
+ str->flags |= EV_STR_TIMEROK;
+ return (0);
+}
+
+int
+evUntimeRW(evContext opaqueCtx, evStreamID id) /*ARGSUSED*/ {
+ evStream *str = id.opaque;
+
+ UNUSED(opaqueCtx);
+
+ str->flags &= ~EV_STR_TIMEROK;
+ return (0);
+}
+
+int
+evCancelRW(evContext opaqueCtx, evStreamID id) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evStream *old = id.opaque;
+
+ /*
+ * The streams list is doubly threaded. First, there's ctx->streams
+ * that's used by evDestroy() to find and cancel all streams. Second,
+ * there's ctx->strDone (head) and ctx->strLast (tail) which thread
+ * through the potentially smaller number of "IO completed" streams,
+ * used in evGetNext() to avoid scanning the entire list.
+ */
+
+ /* Unlink from ctx->streams. */
+ if (old->prev != NULL)
+ old->prev->next = old->next;
+ else
+ ctx->streams = old->next;
+ if (old->next != NULL)
+ old->next->prev = old->prev;
+
+ /*
+ * If 'old' is on the ctx->strDone list, remove it. Update
+ * ctx->strLast if necessary.
+ */
+ if (old->prevDone == NULL && old->nextDone == NULL) {
+ /*
+ * Either 'old' is the only item on the done list, or it's
+ * not on the done list. If the former, then we unlink it
+ * from the list. If the latter, we leave the list alone.
+ */
+ if (ctx->strDone == old) {
+ ctx->strDone = NULL;
+ ctx->strLast = NULL;
+ }
+ } else {
+ if (old->prevDone != NULL)
+ old->prevDone->nextDone = old->nextDone;
+ else
+ ctx->strDone = old->nextDone;
+ if (old->nextDone != NULL)
+ old->nextDone->prevDone = old->prevDone;
+ else
+ ctx->strLast = old->prevDone;
+ }
+
+ /* Deallocate the stream. */
+ if (old->file.opaque)
+ evDeselectFD(opaqueCtx, old->file);
+ memput(old->iovOrig, sizeof (struct iovec) * old->iovOrigCount);
+ FREE(old);
+ return (0);
+}
+
+/* Copy a scatter/gather vector and initialize a stream handler's IO. */
+static int
+copyvec(evStream *str, const struct iovec *iov, int iocnt) {
+ int i;
+
+ str->iovOrig = (struct iovec *)memget(sizeof(struct iovec) * iocnt);
+ if (str->iovOrig == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+ str->ioTotal = 0;
+ for (i = 0; i < iocnt; i++) {
+ str->iovOrig[i] = iov[i];
+ str->ioTotal += iov[i].iov_len;
+ }
+ str->iovOrigCount = iocnt;
+ str->iovCur = str->iovOrig;
+ str->iovCurCount = str->iovOrigCount;
+ str->ioDone = 0;
+ return (0);
+}
+
+/* Pull off or truncate lead iovec(s). */
+static void
+consume(evStream *str, size_t bytes) {
+ while (bytes > 0U) {
+ if (bytes < (size_t)str->iovCur->iov_len) {
+ str->iovCur->iov_len -= bytes;
+ str->iovCur->iov_base = (void *)
+ ((u_char *)str->iovCur->iov_base + bytes);
+ str->ioDone += bytes;
+ bytes = 0;
+ } else {
+ bytes -= str->iovCur->iov_len;
+ str->ioDone += str->iovCur->iov_len;
+ str->iovCur++;
+ str->iovCurCount--;
+ }
+ }
+}
+
+/* Add a stream to Done list and deselect the FD. */
+static void
+done(evContext opaqueCtx, evStream *str) {
+ evContext_p *ctx = opaqueCtx.opaque;
+
+ if (ctx->strLast != NULL) {
+ str->prevDone = ctx->strLast;
+ ctx->strLast->nextDone = str;
+ ctx->strLast = str;
+ } else {
+ INSIST(ctx->strDone == NULL);
+ ctx->strDone = ctx->strLast = str;
+ }
+ evDeselectFD(opaqueCtx, str->file);
+ str->file.opaque = NULL;
+ /* evDrop() will call evCancelRW() on us. */
+}
+
+/* Dribble out some bytes on the stream. (Called by evDispatch().) */
+static void
+writable(evContext opaqueCtx, void *uap, int fd, int evmask) {
+ evStream *str = uap;
+ int bytes;
+
+ UNUSED(evmask);
+
+ bytes = writev(fd, str->iovCur, str->iovCurCount);
+ if (bytes > 0) {
+ if ((str->flags & EV_STR_TIMEROK) != 0)
+ evTouchIdleTimer(opaqueCtx, str->timer);
+ consume(str, bytes);
+ } else {
+ if (bytes < 0 && errno != EINTR) {
+ str->ioDone = -1;
+ str->ioErrno = errno;
+ }
+ }
+ if (str->ioDone == -1 || str->ioDone == str->ioTotal)
+ done(opaqueCtx, str);
+}
+
+/* Scoop up some bytes from the stream. (Called by evDispatch().) */
+static void
+readable(evContext opaqueCtx, void *uap, int fd, int evmask) {
+ evStream *str = uap;
+ int bytes;
+
+ UNUSED(evmask);
+
+ bytes = readv(fd, str->iovCur, str->iovCurCount);
+ if (bytes > 0) {
+ if ((str->flags & EV_STR_TIMEROK) != 0)
+ evTouchIdleTimer(opaqueCtx, str->timer);
+ consume(str, bytes);
+ } else {
+ if (bytes == 0)
+ str->ioDone = 0;
+ else {
+ if (errno != EINTR) {
+ str->ioDone = -1;
+ str->ioErrno = errno;
+ }
+ }
+ }
+ if (str->ioDone <= 0 || str->ioDone == str->ioTotal)
+ done(opaqueCtx, str);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ev_timers.c b/usr/src/lib/libresolv2_joy/common/isc/ev_timers.c
new file mode 100644
index 0000000000..12ac2cebca
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ev_timers.c
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* ev_timers.c - implement timers for the eventlib
+ * vix 09sep95 [initial]
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: ev_timers.c,v 1.6 2005/04/27 04:56:36 sra Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <errno.h>
+
+#include <isc/assertions.h>
+#include <isc/eventlib.h>
+#include "eventlib_p.h"
+
+#include "port_after.h"
+
+/* Constants. */
+
+#define MILLION 1000000
+#define BILLION 1000000000
+
+/* Forward. */
+
+static int due_sooner(void *, void *);
+static void set_index(void *, int);
+static void free_timer(void *, void *);
+static void print_timer(void *, void *);
+static void idle_timeout(evContext, void *, struct timespec, struct timespec);
+
+/* Private type. */
+
+typedef struct {
+ evTimerFunc func;
+ void * uap;
+ struct timespec lastTouched;
+ struct timespec max_idle;
+ evTimer * timer;
+} idle_timer;
+
+/* Public. */
+
+struct timespec
+evConsTime(time_t sec, long nsec) {
+ struct timespec x;
+
+ x.tv_sec = sec;
+ x.tv_nsec = nsec;
+ return (x);
+}
+
+struct timespec
+evAddTime(struct timespec addend1, struct timespec addend2) {
+ struct timespec x;
+
+ x.tv_sec = addend1.tv_sec + addend2.tv_sec;
+ x.tv_nsec = addend1.tv_nsec + addend2.tv_nsec;
+ if (x.tv_nsec >= BILLION) {
+ x.tv_sec++;
+ x.tv_nsec -= BILLION;
+ }
+ return (x);
+}
+
+struct timespec
+evSubTime(struct timespec minuend, struct timespec subtrahend) {
+ struct timespec x;
+
+ x.tv_sec = minuend.tv_sec - subtrahend.tv_sec;
+ if (minuend.tv_nsec >= subtrahend.tv_nsec)
+ x.tv_nsec = minuend.tv_nsec - subtrahend.tv_nsec;
+ else {
+ x.tv_nsec = BILLION - subtrahend.tv_nsec + minuend.tv_nsec;
+ x.tv_sec--;
+ }
+ return (x);
+}
+
+int
+evCmpTime(struct timespec a, struct timespec b) {
+ long x = a.tv_sec - b.tv_sec;
+
+ if (x == 0L)
+ x = a.tv_nsec - b.tv_nsec;
+ return (x < 0L ? (-1) : x > 0L ? (1) : (0));
+}
+
+struct timespec
+evNowTime() {
+ struct timeval now;
+#ifdef CLOCK_REALTIME
+ struct timespec tsnow;
+ int m = CLOCK_REALTIME;
+
+#ifdef CLOCK_MONOTONIC
+ if (__evOptMonoTime)
+ m = CLOCK_MONOTONIC;
+#endif
+ if (clock_gettime(m, &tsnow) == 0)
+ return (tsnow);
+#endif
+ if (gettimeofday(&now, NULL) < 0)
+ return (evConsTime(0, 0));
+ return (evTimeSpec(now));
+}
+
+struct timespec
+evUTCTime() {
+ struct timeval now;
+#ifdef CLOCK_REALTIME
+ struct timespec tsnow;
+ if (clock_gettime(CLOCK_REALTIME, &tsnow) == 0)
+ return (tsnow);
+#endif
+ if (gettimeofday(&now, NULL) < 0)
+ return (evConsTime(0, 0));
+ return (evTimeSpec(now));
+}
+
+struct timespec
+evLastEventTime(evContext opaqueCtx) {
+ evContext_p *ctx = opaqueCtx.opaque;
+
+ return (ctx->lastEventTime);
+}
+
+struct timespec
+evTimeSpec(struct timeval tv) {
+ struct timespec ts;
+
+ ts.tv_sec = tv.tv_sec;
+ ts.tv_nsec = tv.tv_usec * 1000;
+ return (ts);
+}
+
+struct timeval
+evTimeVal(struct timespec ts) {
+ struct timeval tv;
+
+ tv.tv_sec = ts.tv_sec;
+ tv.tv_usec = ts.tv_nsec / 1000;
+ return (tv);
+}
+
+int
+evSetTimer(evContext opaqueCtx,
+ evTimerFunc func,
+ void *uap,
+ struct timespec due,
+ struct timespec inter,
+ evTimerID *opaqueID
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evTimer *id;
+
+ evPrintf(ctx, 1,
+"evSetTimer(ctx %p, func %p, uap %p, due %ld.%09ld, inter %ld.%09ld)\n",
+ ctx, func, uap,
+ (long)due.tv_sec, due.tv_nsec,
+ (long)inter.tv_sec, inter.tv_nsec);
+
+#ifdef __hpux
+ /*
+ * tv_sec and tv_nsec are unsigned.
+ */
+ if (due.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+
+ if (inter.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+#else
+ if (due.tv_sec < 0 || due.tv_nsec < 0 || due.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+
+ if (inter.tv_sec < 0 || inter.tv_nsec < 0 || inter.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+#endif
+
+ /* due={0,0} is a magic cookie meaning "now." */
+ if (due.tv_sec == (time_t)0 && due.tv_nsec == 0L)
+ due = evNowTime();
+
+ /* Allocate and fill. */
+ OKNEW(id);
+ id->func = func;
+ id->uap = uap;
+ id->due = due;
+ id->inter = inter;
+
+ if (heap_insert(ctx->timers, id) < 0)
+ return (-1);
+
+ /* Remember the ID if the caller provided us a place for it. */
+ if (opaqueID)
+ opaqueID->opaque = id;
+
+ if (ctx->debug > 7) {
+ evPrintf(ctx, 7, "timers after evSetTimer:\n");
+ (void) heap_for_each(ctx->timers, print_timer, (void *)ctx);
+ }
+
+ return (0);
+}
+
+int
+evClearTimer(evContext opaqueCtx, evTimerID id) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evTimer *del = id.opaque;
+
+ if (ctx->cur != NULL &&
+ ctx->cur->type == Timer &&
+ ctx->cur->u.timer.this == del) {
+ evPrintf(ctx, 8, "deferring delete of timer (executing)\n");
+ /*
+ * Setting the interval to zero ensures that evDrop() will
+ * clean up the timer.
+ */
+ del->inter = evConsTime(0, 0);
+ return (0);
+ }
+
+ if (heap_element(ctx->timers, del->index) != del)
+ EV_ERR(ENOENT);
+
+ if (heap_delete(ctx->timers, del->index) < 0)
+ return (-1);
+ FREE(del);
+
+ if (ctx->debug > 7) {
+ evPrintf(ctx, 7, "timers after evClearTimer:\n");
+ (void) heap_for_each(ctx->timers, print_timer, (void *)ctx);
+ }
+
+ return (0);
+}
+
+int
+evConfigTimer(evContext opaqueCtx,
+ evTimerID id,
+ const char *param,
+ int value
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evTimer *timer = id.opaque;
+ int result=0;
+
+ UNUSED(value);
+
+ if (heap_element(ctx->timers, timer->index) != timer)
+ EV_ERR(ENOENT);
+
+ if (strcmp(param, "rate") == 0)
+ timer->mode |= EV_TMR_RATE;
+ else if (strcmp(param, "interval") == 0)
+ timer->mode &= ~EV_TMR_RATE;
+ else
+ EV_ERR(EINVAL);
+
+ return (result);
+}
+
+int
+evResetTimer(evContext opaqueCtx,
+ evTimerID id,
+ evTimerFunc func,
+ void *uap,
+ struct timespec due,
+ struct timespec inter
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evTimer *timer = id.opaque;
+ struct timespec old_due;
+ int result=0;
+
+ if (heap_element(ctx->timers, timer->index) != timer)
+ EV_ERR(ENOENT);
+
+#ifdef __hpux
+ /*
+ * tv_sec and tv_nsec are unsigned.
+ */
+ if (due.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+
+ if (inter.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+#else
+ if (due.tv_sec < 0 || due.tv_nsec < 0 || due.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+
+ if (inter.tv_sec < 0 || inter.tv_nsec < 0 || inter.tv_nsec >= BILLION)
+ EV_ERR(EINVAL);
+#endif
+
+ old_due = timer->due;
+
+ timer->func = func;
+ timer->uap = uap;
+ timer->due = due;
+ timer->inter = inter;
+
+ switch (evCmpTime(due, old_due)) {
+ case -1:
+ result = heap_increased(ctx->timers, timer->index);
+ break;
+ case 0:
+ result = 0;
+ break;
+ case 1:
+ result = heap_decreased(ctx->timers, timer->index);
+ break;
+ }
+
+ if (ctx->debug > 7) {
+ evPrintf(ctx, 7, "timers after evResetTimer:\n");
+ (void) heap_for_each(ctx->timers, print_timer, (void *)ctx);
+ }
+
+ return (result);
+}
+
+int
+evSetIdleTimer(evContext opaqueCtx,
+ evTimerFunc func,
+ void *uap,
+ struct timespec max_idle,
+ evTimerID *opaqueID
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ idle_timer *tt;
+
+ /* Allocate and fill. */
+ OKNEW(tt);
+ tt->func = func;
+ tt->uap = uap;
+ tt->lastTouched = ctx->lastEventTime;
+ tt->max_idle = max_idle;
+
+ if (evSetTimer(opaqueCtx, idle_timeout, tt,
+ evAddTime(ctx->lastEventTime, max_idle),
+ max_idle, opaqueID) < 0) {
+ FREE(tt);
+ return (-1);
+ }
+
+ tt->timer = opaqueID->opaque;
+
+ return (0);
+}
+
+int
+evClearIdleTimer(evContext opaqueCtx, evTimerID id) {
+ evTimer *del = id.opaque;
+ idle_timer *tt = del->uap;
+
+ FREE(tt);
+ return (evClearTimer(opaqueCtx, id));
+}
+
+int
+evResetIdleTimer(evContext opaqueCtx,
+ evTimerID opaqueID,
+ evTimerFunc func,
+ void *uap,
+ struct timespec max_idle
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evTimer *timer = opaqueID.opaque;
+ idle_timer *tt = timer->uap;
+
+ tt->func = func;
+ tt->uap = uap;
+ tt->lastTouched = ctx->lastEventTime;
+ tt->max_idle = max_idle;
+
+ return (evResetTimer(opaqueCtx, opaqueID, idle_timeout, tt,
+ evAddTime(ctx->lastEventTime, max_idle),
+ max_idle));
+}
+
+int
+evTouchIdleTimer(evContext opaqueCtx, evTimerID id) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evTimer *t = id.opaque;
+ idle_timer *tt = t->uap;
+
+ tt->lastTouched = ctx->lastEventTime;
+
+ return (0);
+}
+
+/* Public to the rest of eventlib. */
+
+heap_context
+evCreateTimers(const evContext_p *ctx) {
+
+ UNUSED(ctx);
+
+ return (heap_new(due_sooner, set_index, 2048));
+}
+
+void
+evDestroyTimers(const evContext_p *ctx) {
+ (void) heap_for_each(ctx->timers, free_timer, NULL);
+ (void) heap_free(ctx->timers);
+}
+
+/* Private. */
+
+static int
+due_sooner(void *a, void *b) {
+ evTimer *a_timer, *b_timer;
+
+ a_timer = a;
+ b_timer = b;
+ return (evCmpTime(a_timer->due, b_timer->due) < 0);
+}
+
+static void
+set_index(void *what, int index) {
+ evTimer *timer;
+
+ timer = what;
+ timer->index = index;
+}
+
+static void
+free_timer(void *what, void *uap) {
+ evTimer *t = what;
+
+ UNUSED(uap);
+
+ FREE(t);
+}
+
+static void
+print_timer(void *what, void *uap) {
+ evTimer *cur = what;
+ evContext_p *ctx = uap;
+
+ cur = what;
+ evPrintf(ctx, 7,
+ " func %p, uap %p, due %ld.%09ld, inter %ld.%09ld\n",
+ cur->func, cur->uap,
+ (long)cur->due.tv_sec, cur->due.tv_nsec,
+ (long)cur->inter.tv_sec, cur->inter.tv_nsec);
+}
+
+static void
+idle_timeout(evContext opaqueCtx,
+ void *uap,
+ struct timespec due,
+ struct timespec inter
+) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ idle_timer *this = uap;
+ struct timespec idle;
+
+ UNUSED(due);
+ UNUSED(inter);
+
+ idle = evSubTime(ctx->lastEventTime, this->lastTouched);
+ if (evCmpTime(idle, this->max_idle) >= 0) {
+ (this->func)(opaqueCtx, this->uap, this->timer->due,
+ this->max_idle);
+ /*
+ * Setting the interval to zero will cause the timer to
+ * be cleaned up in evDrop().
+ */
+ this->timer->inter = evConsTime(0, 0);
+ FREE(this);
+ } else {
+ /* evDrop() will reschedule the timer. */
+ this->timer->inter = evSubTime(this->max_idle, idle);
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/ev_waits.c b/usr/src/lib/libresolv2_joy/common/isc/ev_waits.c
new file mode 100644
index 0000000000..99da1526c7
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/ev_waits.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* ev_waits.c - implement deferred function calls for the eventlib
+ * vix 05dec95 [initial]
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: ev_waits.c,v 1.4 2005/04/27 04:56:36 sra Exp $";
+#endif
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <errno.h>
+
+#include <isc/eventlib.h>
+#include <isc/assertions.h>
+#include "eventlib_p.h"
+
+#include "port_after.h"
+
+/* Forward. */
+
+static void print_waits(evContext_p *ctx);
+static evWaitList * evNewWaitList(evContext_p *);
+static void evFreeWaitList(evContext_p *, evWaitList *);
+static evWaitList * evGetWaitList(evContext_p *, const void *, int);
+
+
+/* Public. */
+
+/*%
+ * Enter a new wait function on the queue.
+ */
+int
+evWaitFor(evContext opaqueCtx, const void *tag,
+ evWaitFunc func, void *uap, evWaitID *id)
+{
+ evContext_p *ctx = opaqueCtx.opaque;
+ evWait *new;
+ evWaitList *wl = evGetWaitList(ctx, tag, 1);
+
+ OKNEW(new);
+ new->func = func;
+ new->uap = uap;
+ new->tag = tag;
+ new->next = NULL;
+ if (wl->last != NULL)
+ wl->last->next = new;
+ else
+ wl->first = new;
+ wl->last = new;
+ if (id != NULL)
+ id->opaque = new;
+ if (ctx->debug >= 9)
+ print_waits(ctx);
+ return (0);
+}
+
+/*%
+ * Mark runnable all waiting functions having a certain tag.
+ */
+int
+evDo(evContext opaqueCtx, const void *tag) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evWaitList *wl = evGetWaitList(ctx, tag, 0);
+ evWait *first;
+
+ if (!wl) {
+ errno = ENOENT;
+ return (-1);
+ }
+
+ first = wl->first;
+ INSIST(first != NULL);
+
+ if (ctx->waitDone.last != NULL)
+ ctx->waitDone.last->next = first;
+ else
+ ctx->waitDone.first = first;
+ ctx->waitDone.last = wl->last;
+ evFreeWaitList(ctx, wl);
+
+ return (0);
+}
+
+/*%
+ * Remove a waiting (or ready to run) function from the queue.
+ */
+int
+evUnwait(evContext opaqueCtx, evWaitID id) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evWait *this, *prev;
+ evWaitList *wl;
+ int found = 0;
+
+ this = id.opaque;
+ INSIST(this != NULL);
+ wl = evGetWaitList(ctx, this->tag, 0);
+ if (wl != NULL) {
+ for (prev = NULL, this = wl->first;
+ this != NULL;
+ prev = this, this = this->next)
+ if (this == (evWait *)id.opaque) {
+ found = 1;
+ if (prev != NULL)
+ prev->next = this->next;
+ else
+ wl->first = this->next;
+ if (wl->last == this)
+ wl->last = prev;
+ if (wl->first == NULL)
+ evFreeWaitList(ctx, wl);
+ break;
+ }
+ }
+
+ if (!found) {
+ /* Maybe it's done */
+ for (prev = NULL, this = ctx->waitDone.first;
+ this != NULL;
+ prev = this, this = this->next)
+ if (this == (evWait *)id.opaque) {
+ found = 1;
+ if (prev != NULL)
+ prev->next = this->next;
+ else
+ ctx->waitDone.first = this->next;
+ if (ctx->waitDone.last == this)
+ ctx->waitDone.last = prev;
+ break;
+ }
+ }
+
+ if (!found) {
+ errno = ENOENT;
+ return (-1);
+ }
+
+ FREE(this);
+
+ if (ctx->debug >= 9)
+ print_waits(ctx);
+
+ return (0);
+}
+
+int
+evDefer(evContext opaqueCtx, evWaitFunc func, void *uap) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evWait *new;
+
+ OKNEW(new);
+ new->func = func;
+ new->uap = uap;
+ new->tag = NULL;
+ new->next = NULL;
+ if (ctx->waitDone.last != NULL)
+ ctx->waitDone.last->next = new;
+ else
+ ctx->waitDone.first = new;
+ ctx->waitDone.last = new;
+ if (ctx->debug >= 9)
+ print_waits(ctx);
+ return (0);
+}
+
+/* Private. */
+
+static void
+print_waits(evContext_p *ctx) {
+ evWaitList *wl;
+ evWait *this;
+
+ evPrintf(ctx, 9, "wait waiting:\n");
+ for (wl = ctx->waitLists; wl != NULL; wl = wl->next) {
+ INSIST(wl->first != NULL);
+ evPrintf(ctx, 9, " tag %p:", wl->first->tag);
+ for (this = wl->first; this != NULL; this = this->next)
+ evPrintf(ctx, 9, " %p", this);
+ evPrintf(ctx, 9, "\n");
+ }
+ evPrintf(ctx, 9, "wait done:");
+ for (this = ctx->waitDone.first; this != NULL; this = this->next)
+ evPrintf(ctx, 9, " %p", this);
+ evPrintf(ctx, 9, "\n");
+}
+
+static evWaitList *
+evNewWaitList(evContext_p *ctx) {
+ evWaitList *new;
+
+ NEW(new);
+ if (new == NULL)
+ return (NULL);
+ new->first = new->last = NULL;
+ new->prev = NULL;
+ new->next = ctx->waitLists;
+ if (new->next != NULL)
+ new->next->prev = new;
+ ctx->waitLists = new;
+ return (new);
+}
+
+static void
+evFreeWaitList(evContext_p *ctx, evWaitList *this) {
+
+ INSIST(this != NULL);
+
+ if (this->prev != NULL)
+ this->prev->next = this->next;
+ else
+ ctx->waitLists = this->next;
+ if (this->next != NULL)
+ this->next->prev = this->prev;
+ FREE(this);
+}
+
+static evWaitList *
+evGetWaitList(evContext_p *ctx, const void *tag, int should_create) {
+ evWaitList *this;
+
+ for (this = ctx->waitLists; this != NULL; this = this->next) {
+ if (this->first != NULL && this->first->tag == tag)
+ break;
+ }
+ if (this == NULL && should_create)
+ this = evNewWaitList(ctx);
+ return (this);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/eventlib.c b/usr/src/lib/libresolv2_joy/common/isc/eventlib.c
new file mode 100644
index 0000000000..be4a7848b9
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/eventlib.c
@@ -0,0 +1,933 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* eventlib.c - implement glue for the eventlib
+ * vix 09sep95 [initial]
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: eventlib.c,v 1.10 2006/03/09 23:57:56 marka Exp $";
+#endif
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#ifdef SOLARIS2
+#include <limits.h>
+#endif /* SOLARIS2 */
+
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <isc/eventlib.h>
+#include <isc/assertions.h>
+#include "eventlib_p.h"
+
+#include "port_after.h"
+
+int __evOptMonoTime;
+
+#ifdef USE_POLL
+#define pselect Pselect
+#endif /* USE_POLL */
+
+/* Forward. */
+
+#if defined(NEED_PSELECT) || defined(USE_POLL)
+static int pselect(int, void *, void *, void *,
+ struct timespec *,
+ const sigset_t *);
+#endif
+
+int __evOptMonoTime;
+
+/* Public. */
+
+int
+evCreate(evContext *opaqueCtx) {
+ evContext_p *ctx;
+
+ /* Make sure the memory heap is initialized. */
+ if (meminit(0, 0) < 0 && errno != EEXIST)
+ return (-1);
+
+ OKNEW(ctx);
+
+ /* Global. */
+ ctx->cur = NULL;
+
+ /* Debugging. */
+ ctx->debug = 0;
+ ctx->output = NULL;
+
+ /* Connections. */
+ ctx->conns = NULL;
+ INIT_LIST(ctx->accepts);
+
+ /* Files. */
+ ctx->files = NULL;
+#ifdef USE_POLL
+ ctx->pollfds = NULL;
+ ctx->maxnfds = 0;
+ ctx->firstfd = 0;
+ emulMaskInit(ctx, rdLast, EV_READ, 1);
+ emulMaskInit(ctx, rdNext, EV_READ, 0);
+ emulMaskInit(ctx, wrLast, EV_WRITE, 1);
+ emulMaskInit(ctx, wrNext, EV_WRITE, 0);
+ emulMaskInit(ctx, exLast, EV_EXCEPT, 1);
+ emulMaskInit(ctx, exNext, EV_EXCEPT, 0);
+ emulMaskInit(ctx, nonblockBefore, EV_WASNONBLOCKING, 0);
+#endif /* USE_POLL */
+ FD_ZERO(&ctx->rdNext);
+ FD_ZERO(&ctx->wrNext);
+ FD_ZERO(&ctx->exNext);
+ FD_ZERO(&ctx->nonblockBefore);
+ ctx->fdMax = -1;
+ ctx->fdNext = NULL;
+ ctx->fdCount = 0; /*%< Invalidate {rd,wr,ex}Last. */
+#ifndef USE_POLL
+ ctx->highestFD = FD_SETSIZE - 1;
+ memset(ctx->fdTable, 0, sizeof ctx->fdTable);
+#else
+ ctx->highestFD = INT_MAX / sizeof(struct pollfd);
+ ctx->fdTable = NULL;
+#endif /* USE_POLL */
+#ifdef EVENTLIB_TIME_CHECKS
+ ctx->lastFdCount = 0;
+#endif
+
+ /* Streams. */
+ ctx->streams = NULL;
+ ctx->strDone = NULL;
+ ctx->strLast = NULL;
+
+ /* Timers. */
+ ctx->lastEventTime = evNowTime();
+#ifdef EVENTLIB_TIME_CHECKS
+ ctx->lastSelectTime = ctx->lastEventTime;
+#endif
+ ctx->timers = evCreateTimers(ctx);
+ if (ctx->timers == NULL)
+ return (-1);
+
+ /* Waits. */
+ ctx->waitLists = NULL;
+ ctx->waitDone.first = ctx->waitDone.last = NULL;
+ ctx->waitDone.prev = ctx->waitDone.next = NULL;
+
+ opaqueCtx->opaque = ctx;
+ return (0);
+}
+
+void
+evSetDebug(evContext opaqueCtx, int level, FILE *output) {
+ evContext_p *ctx = opaqueCtx.opaque;
+
+ ctx->debug = level;
+ ctx->output = output;
+}
+
+int
+evDestroy(evContext opaqueCtx) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ int revs = 424242; /*%< Doug Adams. */
+ evWaitList *this_wl, *next_wl;
+ evWait *this_wait, *next_wait;
+
+ /* Connections. */
+ while (revs-- > 0 && ctx->conns != NULL) {
+ evConnID id;
+
+ id.opaque = ctx->conns;
+ (void) evCancelConn(opaqueCtx, id);
+ }
+ INSIST(revs >= 0);
+
+ /* Streams. */
+ while (revs-- > 0 && ctx->streams != NULL) {
+ evStreamID id;
+
+ id.opaque = ctx->streams;
+ (void) evCancelRW(opaqueCtx, id);
+ }
+
+ /* Files. */
+ while (revs-- > 0 && ctx->files != NULL) {
+ evFileID id;
+
+ id.opaque = ctx->files;
+ (void) evDeselectFD(opaqueCtx, id);
+ }
+ INSIST(revs >= 0);
+
+ /* Timers. */
+ evDestroyTimers(ctx);
+
+ /* Waits. */
+ for (this_wl = ctx->waitLists;
+ revs-- > 0 && this_wl != NULL;
+ this_wl = next_wl) {
+ next_wl = this_wl->next;
+ for (this_wait = this_wl->first;
+ revs-- > 0 && this_wait != NULL;
+ this_wait = next_wait) {
+ next_wait = this_wait->next;
+ FREE(this_wait);
+ }
+ FREE(this_wl);
+ }
+ for (this_wait = ctx->waitDone.first;
+ revs-- > 0 && this_wait != NULL;
+ this_wait = next_wait) {
+ next_wait = this_wait->next;
+ FREE(this_wait);
+ }
+
+ FREE(ctx);
+ return (0);
+}
+
+int
+evGetNext(evContext opaqueCtx, evEvent *opaqueEv, int options) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ struct timespec nextTime;
+ evTimer *nextTimer;
+ evEvent_p *new;
+ int x, pselect_errno, timerPast;
+#ifdef EVENTLIB_TIME_CHECKS
+ struct timespec interval;
+#endif
+
+ /* Ensure that exactly one of EV_POLL or EV_WAIT was specified. */
+ x = ((options & EV_POLL) != 0) + ((options & EV_WAIT) != 0);
+ if (x != 1)
+ EV_ERR(EINVAL);
+
+ /* Get the time of day. We'll do this again after select() blocks. */
+ ctx->lastEventTime = evNowTime();
+
+ again:
+ /* Finished accept()'s do not require a select(). */
+ if (!EMPTY(ctx->accepts)) {
+ OKNEW(new);
+ new->type = Accept;
+ new->u.accept.this = HEAD(ctx->accepts);
+ UNLINK(ctx->accepts, HEAD(ctx->accepts), link);
+ opaqueEv->opaque = new;
+ return (0);
+ }
+
+ /* Stream IO does not require a select(). */
+ if (ctx->strDone != NULL) {
+ OKNEW(new);
+ new->type = Stream;
+ new->u.stream.this = ctx->strDone;
+ ctx->strDone = ctx->strDone->nextDone;
+ if (ctx->strDone == NULL)
+ ctx->strLast = NULL;
+ opaqueEv->opaque = new;
+ return (0);
+ }
+
+ /* Waits do not require a select(). */
+ if (ctx->waitDone.first != NULL) {
+ OKNEW(new);
+ new->type = Wait;
+ new->u.wait.this = ctx->waitDone.first;
+ ctx->waitDone.first = ctx->waitDone.first->next;
+ if (ctx->waitDone.first == NULL)
+ ctx->waitDone.last = NULL;
+ opaqueEv->opaque = new;
+ return (0);
+ }
+
+ /* Get the status and content of the next timer. */
+ if ((nextTimer = heap_element(ctx->timers, 1)) != NULL) {
+ nextTime = nextTimer->due;
+ timerPast = (evCmpTime(nextTime, ctx->lastEventTime) <= 0);
+ } else
+ timerPast = 0; /*%< Make gcc happy. */
+ evPrintf(ctx, 9, "evGetNext: fdCount %d\n", ctx->fdCount);
+ if (ctx->fdCount == 0) {
+ static const struct timespec NoTime = {0, 0L};
+ enum { JustPoll, Block, Timer } m;
+ struct timespec t, *tp;
+
+ /* Are there any events at all? */
+ if ((options & EV_WAIT) != 0 && !nextTimer && ctx->fdMax == -1)
+ EV_ERR(ENOENT);
+
+ /* Figure out what select()'s timeout parameter should be. */
+ if ((options & EV_POLL) != 0) {
+ m = JustPoll;
+ t = NoTime;
+ tp = &t;
+ } else if (nextTimer == NULL) {
+ m = Block;
+ /* ``t'' unused. */
+ tp = NULL;
+ } else if (timerPast) {
+ m = JustPoll;
+ t = NoTime;
+ tp = &t;
+ } else {
+ m = Timer;
+ /* ``t'' filled in later. */
+ tp = &t;
+ }
+#ifdef EVENTLIB_TIME_CHECKS
+ if (ctx->debug > 0) {
+ interval = evSubTime(ctx->lastEventTime,
+ ctx->lastSelectTime);
+ if (interval.tv_sec > 0 || interval.tv_nsec > 0)
+ evPrintf(ctx, 1,
+ "time between pselect() %u.%09u count %d\n",
+ interval.tv_sec, interval.tv_nsec,
+ ctx->lastFdCount);
+ }
+#endif
+ do {
+#ifndef USE_POLL
+ /* XXX need to copy only the bits we are using. */
+ ctx->rdLast = ctx->rdNext;
+ ctx->wrLast = ctx->wrNext;
+ ctx->exLast = ctx->exNext;
+#else
+ /*
+ * The pollfd structure uses separate fields for
+ * the input and output events (corresponding to
+ * the ??Next and ??Last fd sets), so there's no
+ * need to copy one to the other.
+ */
+#endif /* USE_POLL */
+ if (m == Timer) {
+ INSIST(tp == &t);
+ t = evSubTime(nextTime, ctx->lastEventTime);
+ }
+
+ /* XXX should predict system's earliness and adjust. */
+ x = pselect(ctx->fdMax+1,
+ &ctx->rdLast, &ctx->wrLast, &ctx->exLast,
+ tp, NULL);
+ pselect_errno = errno;
+
+#ifndef USE_POLL
+ evPrintf(ctx, 4, "select() returns %d (err: %s)\n",
+ x, (x == -1) ? strerror(errno) : "none");
+#else
+ evPrintf(ctx, 4, "poll() returns %d (err: %s)\n",
+ x, (x == -1) ? strerror(errno) : "none");
+#endif /* USE_POLL */
+ /* Anything but a poll can change the time. */
+ if (m != JustPoll)
+ ctx->lastEventTime = evNowTime();
+
+ /* Select() likes to finish about 10ms early. */
+ } while (x == 0 && m == Timer &&
+ evCmpTime(ctx->lastEventTime, nextTime) < 0);
+#ifdef EVENTLIB_TIME_CHECKS
+ ctx->lastSelectTime = ctx->lastEventTime;
+#endif
+ if (x < 0) {
+ if (pselect_errno == EINTR) {
+ if ((options & EV_NULL) != 0)
+ goto again;
+ OKNEW(new);
+ new->type = Null;
+ /* No data. */
+ opaqueEv->opaque = new;
+ return (0);
+ }
+ if (pselect_errno == EBADF) {
+ for (x = 0; x <= ctx->fdMax; x++) {
+ struct stat sb;
+
+ if (FD_ISSET(x, &ctx->rdNext) == 0 &&
+ FD_ISSET(x, &ctx->wrNext) == 0 &&
+ FD_ISSET(x, &ctx->exNext) == 0)
+ continue;
+ if (fstat(x, &sb) == -1 &&
+ errno == EBADF)
+ evPrintf(ctx, 1, "EBADF: %d\n",
+ x);
+ }
+ abort();
+ }
+ EV_ERR(pselect_errno);
+ }
+ if (x == 0 && (nextTimer == NULL || !timerPast) &&
+ (options & EV_POLL))
+ EV_ERR(EWOULDBLOCK);
+ ctx->fdCount = x;
+#ifdef EVENTLIB_TIME_CHECKS
+ ctx->lastFdCount = x;
+#endif
+ }
+ INSIST(nextTimer || ctx->fdCount);
+
+ /* Timers go first since we'd like them to be accurate. */
+ if (nextTimer && !timerPast) {
+ /* Has anything happened since we blocked? */
+ timerPast = (evCmpTime(nextTime, ctx->lastEventTime) <= 0);
+ }
+ if (nextTimer && timerPast) {
+ OKNEW(new);
+ new->type = Timer;
+ new->u.timer.this = nextTimer;
+ opaqueEv->opaque = new;
+ return (0);
+ }
+
+ /* No timers, so there should be a ready file descriptor. */
+ x = 0;
+ while (ctx->fdCount > 0) {
+ evFile *fid;
+ int fd, eventmask;
+
+ if (ctx->fdNext == NULL) {
+ if (++x == 2) {
+ /*
+ * Hitting the end twice means that the last
+ * select() found some FD's which have since
+ * been deselected.
+ *
+ * On some systems, the count returned by
+ * selects is the total number of bits in
+ * all masks that are set, and on others it's
+ * the number of fd's that have some bit set,
+ * and on others, it's just broken. We
+ * always assume that it's the number of
+ * bits set in all masks, because that's what
+ * the man page says it should do, and
+ * the worst that can happen is we do an
+ * extra select().
+ */
+ ctx->fdCount = 0;
+ break;
+ }
+ ctx->fdNext = ctx->files;
+ }
+ fid = ctx->fdNext;
+ ctx->fdNext = fid->next;
+
+ fd = fid->fd;
+ eventmask = 0;
+ if (FD_ISSET(fd, &ctx->rdLast))
+ eventmask |= EV_READ;
+ if (FD_ISSET(fd, &ctx->wrLast))
+ eventmask |= EV_WRITE;
+ if (FD_ISSET(fd, &ctx->exLast))
+ eventmask |= EV_EXCEPT;
+ eventmask &= fid->eventmask;
+ if (eventmask != 0) {
+ if ((eventmask & EV_READ) != 0) {
+ FD_CLR(fd, &ctx->rdLast);
+ ctx->fdCount--;
+ }
+ if ((eventmask & EV_WRITE) != 0) {
+ FD_CLR(fd, &ctx->wrLast);
+ ctx->fdCount--;
+ }
+ if ((eventmask & EV_EXCEPT) != 0) {
+ FD_CLR(fd, &ctx->exLast);
+ ctx->fdCount--;
+ }
+ OKNEW(new);
+ new->type = File;
+ new->u.file.this = fid;
+ new->u.file.eventmask = eventmask;
+ opaqueEv->opaque = new;
+ return (0);
+ }
+ }
+ if (ctx->fdCount < 0) {
+ /*
+ * select()'s count is off on a number of systems, and
+ * can result in fdCount < 0.
+ */
+ evPrintf(ctx, 4, "fdCount < 0 (%d)\n", ctx->fdCount);
+ ctx->fdCount = 0;
+ }
+
+ /* We get here if the caller deselect()'s an FD. Gag me with a goto. */
+ goto again;
+}
+
+int
+evDispatch(evContext opaqueCtx, evEvent opaqueEv) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evEvent_p *ev = opaqueEv.opaque;
+#ifdef EVENTLIB_TIME_CHECKS
+ void *func;
+ struct timespec start_time;
+ struct timespec interval;
+#endif
+
+#ifdef EVENTLIB_TIME_CHECKS
+ if (ctx->debug > 0)
+ start_time = evNowTime();
+#endif
+ ctx->cur = ev;
+ switch (ev->type) {
+ case Accept: {
+ evAccept *this = ev->u.accept.this;
+
+ evPrintf(ctx, 5,
+ "Dispatch.Accept: fd %d -> %d, func %p, uap %p\n",
+ this->conn->fd, this->fd,
+ this->conn->func, this->conn->uap);
+ errno = this->ioErrno;
+ (this->conn->func)(opaqueCtx, this->conn->uap, this->fd,
+ &this->la, this->lalen,
+ &this->ra, this->ralen);
+#ifdef EVENTLIB_TIME_CHECKS
+ func = this->conn->func;
+#endif
+ break;
+ }
+ case File: {
+ evFile *this = ev->u.file.this;
+ int eventmask = ev->u.file.eventmask;
+
+ evPrintf(ctx, 5,
+ "Dispatch.File: fd %d, mask 0x%x, func %p, uap %p\n",
+ this->fd, this->eventmask, this->func, this->uap);
+ (this->func)(opaqueCtx, this->uap, this->fd, eventmask);
+#ifdef EVENTLIB_TIME_CHECKS
+ func = this->func;
+#endif
+ break;
+ }
+ case Stream: {
+ evStream *this = ev->u.stream.this;
+
+ evPrintf(ctx, 5,
+ "Dispatch.Stream: fd %d, func %p, uap %p\n",
+ this->fd, this->func, this->uap);
+ errno = this->ioErrno;
+ (this->func)(opaqueCtx, this->uap, this->fd, this->ioDone);
+#ifdef EVENTLIB_TIME_CHECKS
+ func = this->func;
+#endif
+ break;
+ }
+ case Timer: {
+ evTimer *this = ev->u.timer.this;
+
+ evPrintf(ctx, 5, "Dispatch.Timer: func %p, uap %p\n",
+ this->func, this->uap);
+ (this->func)(opaqueCtx, this->uap, this->due, this->inter);
+#ifdef EVENTLIB_TIME_CHECKS
+ func = this->func;
+#endif
+ break;
+ }
+ case Wait: {
+ evWait *this = ev->u.wait.this;
+
+ evPrintf(ctx, 5,
+ "Dispatch.Wait: tag %p, func %p, uap %p\n",
+ this->tag, this->func, this->uap);
+ (this->func)(opaqueCtx, this->uap, this->tag);
+#ifdef EVENTLIB_TIME_CHECKS
+ func = this->func;
+#endif
+ break;
+ }
+ case Null: {
+ /* No work. */
+#ifdef EVENTLIB_TIME_CHECKS
+ func = NULL;
+#endif
+ break;
+ }
+ default: {
+ abort();
+ }
+ }
+#ifdef EVENTLIB_TIME_CHECKS
+ if (ctx->debug > 0) {
+ interval = evSubTime(evNowTime(), start_time);
+ /*
+ * Complain if it took longer than 50 milliseconds.
+ *
+ * We call getuid() to make an easy to find mark in a kernel
+ * trace.
+ */
+ if (interval.tv_sec > 0 || interval.tv_nsec > 50000000)
+ evPrintf(ctx, 1,
+ "dispatch interval %u.%09u uid %d type %d func %p\n",
+ interval.tv_sec, interval.tv_nsec,
+ getuid(), ev->type, func);
+ }
+#endif
+ ctx->cur = NULL;
+ evDrop(opaqueCtx, opaqueEv);
+ return (0);
+}
+
+void
+evDrop(evContext opaqueCtx, evEvent opaqueEv) {
+ evContext_p *ctx = opaqueCtx.opaque;
+ evEvent_p *ev = opaqueEv.opaque;
+
+ switch (ev->type) {
+ case Accept: {
+ FREE(ev->u.accept.this);
+ break;
+ }
+ case File: {
+ /* No work. */
+ break;
+ }
+ case Stream: {
+ evStreamID id;
+
+ id.opaque = ev->u.stream.this;
+ (void) evCancelRW(opaqueCtx, id);
+ break;
+ }
+ case Timer: {
+ evTimer *this = ev->u.timer.this;
+ evTimerID opaque;
+
+ /* Check to see whether the user func cleared the timer. */
+ if (heap_element(ctx->timers, this->index) != this) {
+ evPrintf(ctx, 5, "Dispatch.Timer: timer rm'd?\n");
+ break;
+ }
+ /*
+ * Timer is still there. Delete it if it has expired,
+ * otherwise set it according to its next interval.
+ */
+ if (this->inter.tv_sec == (time_t)0 &&
+ this->inter.tv_nsec == 0L) {
+ opaque.opaque = this;
+ (void) evClearTimer(opaqueCtx, opaque);
+ } else {
+ opaque.opaque = this;
+ (void) evResetTimer(opaqueCtx, opaque, this->func,
+ this->uap,
+ evAddTime((this->mode & EV_TMR_RATE) ?
+ this->due :
+ ctx->lastEventTime,
+ this->inter),
+ this->inter);
+ }
+ break;
+ }
+ case Wait: {
+ FREE(ev->u.wait.this);
+ break;
+ }
+ case Null: {
+ /* No work. */
+ break;
+ }
+ default: {
+ abort();
+ }
+ }
+ FREE(ev);
+}
+
+int
+evMainLoop(evContext opaqueCtx) {
+ evEvent event;
+ int x;
+
+ while ((x = evGetNext(opaqueCtx, &event, EV_WAIT)) == 0)
+ if ((x = evDispatch(opaqueCtx, event)) < 0)
+ break;
+ return (x);
+}
+
+int
+evHighestFD(evContext opaqueCtx) {
+ evContext_p *ctx = opaqueCtx.opaque;
+
+ return (ctx->highestFD);
+}
+
+void
+evPrintf(const evContext_p *ctx, int level, const char *fmt, ...) {
+ va_list ap;
+
+ va_start(ap, fmt);
+ if (ctx->output != NULL && ctx->debug >= level) {
+ vfprintf(ctx->output, fmt, ap);
+ fflush(ctx->output);
+ }
+ va_end(ap);
+}
+
+int
+evSetOption(evContext *opaqueCtx, const char *option, int value) {
+ /* evContext_p *ctx = opaqueCtx->opaque; */
+
+ UNUSED(opaqueCtx);
+ UNUSED(value);
+#ifndef CLOCK_MONOTONIC
+ UNUSED(option);
+#endif
+
+#ifdef CLOCK_MONOTONIC
+ if (strcmp(option, "monotime") == 0) {
+ if (opaqueCtx != NULL)
+ errno = EINVAL;
+ if (value == 0 || value == 1) {
+ __evOptMonoTime = value;
+ return (0);
+ } else {
+ errno = EINVAL;
+ return (-1);
+ }
+ }
+#endif
+ errno = ENOENT;
+ return (-1);
+}
+
+int
+evGetOption(evContext *opaqueCtx, const char *option, int *value) {
+ /* evContext_p *ctx = opaqueCtx->opaque; */
+
+ UNUSED(opaqueCtx);
+#ifndef CLOCK_MONOTONIC
+ UNUSED(value);
+ UNUSED(option);
+#endif
+
+#ifdef CLOCK_MONOTONIC
+ if (strcmp(option, "monotime") == 0) {
+ if (opaqueCtx != NULL)
+ errno = EINVAL;
+ *value = __evOptMonoTime;
+ return (0);
+ }
+#endif
+ errno = ENOENT;
+ return (-1);
+}
+
+#if defined(NEED_PSELECT) || defined(USE_POLL)
+/* XXX needs to move to the porting library. */
+static int
+pselect(int nfds, void *rfds, void *wfds, void *efds,
+ struct timespec *tsp,
+ const sigset_t *sigmask)
+{
+ struct timeval tv, *tvp;
+ sigset_t sigs;
+ int n;
+#ifdef USE_POLL
+ int polltimeout = INFTIM;
+ evContext_p *ctx;
+ struct pollfd *fds;
+ nfds_t pnfds;
+
+ UNUSED(nfds);
+#endif /* USE_POLL */
+
+ if (tsp) {
+ tvp = &tv;
+ tv = evTimeVal(*tsp);
+#ifdef USE_POLL
+ polltimeout = 1000 * tv.tv_sec + tv.tv_usec / 1000;
+#endif /* USE_POLL */
+ } else
+ tvp = NULL;
+ if (sigmask)
+ sigprocmask(SIG_SETMASK, sigmask, &sigs);
+#ifndef USE_POLL
+ n = select(nfds, rfds, wfds, efds, tvp);
+#else
+ /*
+ * rfds, wfds, and efds should all be from the same evContext_p,
+ * so any of them will do. If they're all NULL, the caller is
+ * presumably calling us to block.
+ */
+ if (rfds != NULL)
+ ctx = ((__evEmulMask *)rfds)->ctx;
+ else if (wfds != NULL)
+ ctx = ((__evEmulMask *)wfds)->ctx;
+ else if (efds != NULL)
+ ctx = ((__evEmulMask *)efds)->ctx;
+ else
+ ctx = NULL;
+ if (ctx != NULL && ctx->fdMax != -1) {
+ fds = &(ctx->pollfds[ctx->firstfd]);
+ pnfds = ctx->fdMax - ctx->firstfd + 1;
+ } else {
+ fds = NULL;
+ pnfds = 0;
+ }
+ n = poll(fds, pnfds, polltimeout);
+ if (n > 0) {
+ int i, e;
+
+ INSIST(ctx != NULL);
+ for (e = 0, i = ctx->firstfd; i <= ctx->fdMax; i++) {
+ if (ctx->pollfds[i].fd < 0)
+ continue;
+ if (FD_ISSET(i, &ctx->rdLast))
+ e++;
+ if (FD_ISSET(i, &ctx->wrLast))
+ e++;
+ if (FD_ISSET(i, &ctx->exLast))
+ e++;
+ }
+ n = e;
+ }
+#endif /* USE_POLL */
+ if (sigmask)
+ sigprocmask(SIG_SETMASK, &sigs, NULL);
+ if (tsp)
+ *tsp = evTimeSpec(tv);
+ return (n);
+}
+#endif
+
+#ifdef USE_POLL
+int
+evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd) {
+
+ int i, maxnfds;
+ void *pollfds, *fdTable;
+
+ if (fd < ctx->maxnfds)
+ return (0);
+
+ /* Don't allow ridiculously small values for pollfd_chunk_size */
+ if (pollfd_chunk_size < 20)
+ pollfd_chunk_size = 20;
+
+ maxnfds = (1 + (fd/pollfd_chunk_size)) * pollfd_chunk_size;
+
+ pollfds = realloc(ctx->pollfds, maxnfds * sizeof(*ctx->pollfds));
+ if (pollfds != NULL)
+ ctx->pollfds = pollfds;
+ fdTable = realloc(ctx->fdTable, maxnfds * sizeof(*ctx->fdTable));
+ if (fdTable != NULL)
+ ctx->fdTable = fdTable;
+
+ if (pollfds == NULL || fdTable == NULL) {
+ evPrintf(ctx, 2, "pollfd() realloc (%ld) failed\n",
+ (long)maxnfds*sizeof(struct pollfd));
+ return (-1);
+ }
+
+ for (i = ctx->maxnfds; i < maxnfds; i++) {
+ ctx->pollfds[i].fd = -1;
+ ctx->pollfds[i].events = 0;
+ ctx->fdTable[i] = 0;
+ }
+
+ ctx->maxnfds = maxnfds;
+
+ return (0);
+}
+
+/* Find the appropriate 'events' or 'revents' field in the pollfds array */
+short *
+__fd_eventfield(int fd, __evEmulMask *maskp) {
+
+ evContext_p *ctx = (evContext_p *)maskp->ctx;
+
+ if (!maskp->result || maskp->type == EV_WASNONBLOCKING)
+ return (&(ctx->pollfds[fd].events));
+ else
+ return (&(ctx->pollfds[fd].revents));
+}
+
+/* Translate to poll(2) event */
+short
+__poll_event(__evEmulMask *maskp) {
+
+ switch ((maskp)->type) {
+ case EV_READ:
+ return (POLLRDNORM);
+ case EV_WRITE:
+ return (POLLWRNORM);
+ case EV_EXCEPT:
+ return (POLLRDBAND | POLLPRI | POLLWRBAND);
+ case EV_WASNONBLOCKING:
+ return (POLLHUP);
+ default:
+ return (0);
+ }
+}
+
+/*
+ * Clear the events corresponding to the specified mask. If this leaves
+ * the events mask empty (apart from the POLLHUP bit), set the fd field
+ * to -1 so that poll(2) will ignore this fd.
+ */
+void
+__fd_clr(int fd, __evEmulMask *maskp) {
+
+ evContext_p *ctx = maskp->ctx;
+
+ *__fd_eventfield(fd, maskp) &= ~__poll_event(maskp);
+ if ((ctx->pollfds[fd].events & ~POLLHUP) == 0) {
+ ctx->pollfds[fd].fd = -1;
+ if (fd == ctx->fdMax)
+ while (ctx->fdMax > ctx->firstfd &&
+ ctx->pollfds[ctx->fdMax].fd < 0)
+ ctx->fdMax--;
+ if (fd == ctx->firstfd)
+ while (ctx->firstfd <= ctx->fdMax &&
+ ctx->pollfds[ctx->firstfd].fd < 0)
+ ctx->firstfd++;
+ /*
+ * Do we have a empty set of descriptors?
+ */
+ if (ctx->firstfd > ctx->fdMax) {
+ ctx->fdMax = -1;
+ ctx->firstfd = 0;
+ }
+ }
+}
+
+/*
+ * Set the events bit(s) corresponding to the specified mask. If the events
+ * field has any other bits than POLLHUP set, also set the fd field so that
+ * poll(2) will watch this fd.
+ */
+void
+__fd_set(int fd, __evEmulMask *maskp) {
+
+ evContext_p *ctx = maskp->ctx;
+
+ *__fd_eventfield(fd, maskp) |= __poll_event(maskp);
+ if ((ctx->pollfds[fd].events & ~POLLHUP) != 0) {
+ ctx->pollfds[fd].fd = fd;
+ if (fd < ctx->firstfd || ctx->fdMax == -1)
+ ctx->firstfd = fd;
+ if (fd > ctx->fdMax)
+ ctx->fdMax = fd;
+ }
+}
+#endif /* USE_POLL */
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/eventlib_p.h b/usr/src/lib/libresolv2_joy/common/isc/eventlib_p.h
new file mode 100644
index 0000000000..0a3614ab23
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/eventlib_p.h
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file
+ * \brief private interfaces for eventlib
+ * \author vix 09sep95 [initial]
+ *
+ * $Id: eventlib_p.h,v 1.9 2006/03/09 23:57:56 marka Exp $
+ */
+
+#ifndef _EVENTLIB_P_H
+#define _EVENTLIB_P_H
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/un.h>
+
+#define EVENTLIB_DEBUG 1
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/heap.h>
+#include <isc/list.h>
+#include <isc/memcluster.h>
+
+#define EV_MASK_ALL (EV_READ | EV_WRITE | EV_EXCEPT)
+#define EV_ERR(e) return (errno = (e), -1)
+#define OK(x) if ((x) < 0) EV_ERR(errno); else (void)NULL
+#define OKFREE(x, y) if ((x) < 0) { FREE((y)); EV_ERR(errno); } \
+ else (void)NULL
+
+#define NEW(p) if (((p) = memget(sizeof *(p))) != NULL) \
+ FILL(p); \
+ else \
+ (void)NULL;
+#define OKNEW(p) if (!((p) = memget(sizeof *(p)))) { \
+ errno = ENOMEM; \
+ return (-1); \
+ } else \
+ FILL(p)
+#define FREE(p) memput((p), sizeof *(p))
+
+#if EVENTLIB_DEBUG
+#define FILL(p) memset((p), 0xF5, sizeof *(p))
+#else
+#define FILL(p)
+#endif
+
+#ifdef USE_POLL
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+#include <poll.h>
+#endif /* USE_POLL */
+
+typedef struct evConn {
+ evConnFunc func;
+ void * uap;
+ int fd;
+ int flags;
+#define EV_CONN_LISTEN 0x0001 /*%< Connection is a listener. */
+#define EV_CONN_SELECTED 0x0002 /*%< evSelectFD(conn->file). */
+#define EV_CONN_BLOCK 0x0004 /*%< Listener fd was blocking. */
+ evFileID file;
+ struct evConn * prev;
+ struct evConn * next;
+} evConn;
+
+typedef struct evAccept {
+ int fd;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in;
+#ifndef NO_SOCKADDR_UN
+ struct sockaddr_un un;
+#endif
+ } la;
+ ISC_SOCKLEN_T lalen;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in in;
+#ifndef NO_SOCKADDR_UN
+ struct sockaddr_un un;
+#endif
+ } ra;
+ ISC_SOCKLEN_T ralen;
+ int ioErrno;
+ evConn * conn;
+ LINK(struct evAccept) link;
+} evAccept;
+
+typedef struct evFile {
+ evFileFunc func;
+ void * uap;
+ int fd;
+ int eventmask;
+ int preemptive;
+ struct evFile * prev;
+ struct evFile * next;
+ struct evFile * fdprev;
+ struct evFile * fdnext;
+} evFile;
+
+typedef struct evStream {
+ evStreamFunc func;
+ void * uap;
+ evFileID file;
+ evTimerID timer;
+ int flags;
+#define EV_STR_TIMEROK 0x0001 /*%< IFF timer valid. */
+ int fd;
+ struct iovec * iovOrig;
+ int iovOrigCount;
+ struct iovec * iovCur;
+ int iovCurCount;
+ int ioTotal;
+ int ioDone;
+ int ioErrno;
+ struct evStream *prevDone, *nextDone;
+ struct evStream *prev, *next;
+} evStream;
+
+typedef struct evTimer {
+ evTimerFunc func;
+ void * uap;
+ struct timespec due, inter;
+ int index;
+ int mode;
+#define EV_TMR_RATE 1
+} evTimer;
+
+typedef struct evWait {
+ evWaitFunc func;
+ void * uap;
+ const void * tag;
+ struct evWait * next;
+} evWait;
+
+typedef struct evWaitList {
+ evWait * first;
+ evWait * last;
+ struct evWaitList * prev;
+ struct evWaitList * next;
+} evWaitList;
+
+typedef struct evEvent_p {
+ enum { Accept, File, Stream, Timer, Wait, Free, Null } type;
+ union {
+ struct { evAccept *this; } accept;
+ struct { evFile *this; int eventmask; } file;
+ struct { evStream *this; } stream;
+ struct { evTimer *this; } timer;
+ struct { evWait *this; } wait;
+ struct { struct evEvent_p *next; } free;
+ struct { const void *placeholder; } null;
+ } u;
+} evEvent_p;
+
+#ifdef USE_POLL
+typedef struct {
+ void *ctx; /* pointer to the evContext_p */
+ uint32_t type; /* READ, WRITE, EXCEPT, nonblk */
+ uint32_t result; /* 1 => revents, 0 => events */
+} __evEmulMask;
+
+#define emulMaskInit(ctx, field, ev, lastnext) \
+ ctx->field.ctx = ctx; \
+ ctx->field.type = ev; \
+ ctx->field.result = lastnext;
+
+extern short *__fd_eventfield(int fd, __evEmulMask *maskp);
+extern short __poll_event(__evEmulMask *maskp);
+extern void __fd_clr(int fd, __evEmulMask *maskp);
+extern void __fd_set(int fd, __evEmulMask *maskp);
+
+#undef FD_ZERO
+#define FD_ZERO(maskp)
+
+#undef FD_SET
+#define FD_SET(fd, maskp) \
+ __fd_set(fd, maskp)
+
+#undef FD_CLR
+#define FD_CLR(fd, maskp) \
+ __fd_clr(fd, maskp)
+
+#undef FD_ISSET
+#define FD_ISSET(fd, maskp) \
+ ((*__fd_eventfield(fd, maskp) & __poll_event(maskp)) != 0)
+
+#endif /* USE_POLL */
+
+typedef struct {
+ /* Global. */
+ const evEvent_p *cur;
+ /* Debugging. */
+ int debug;
+ FILE *output;
+ /* Connections. */
+ evConn *conns;
+ LIST(evAccept) accepts;
+ /* Files. */
+ evFile *files, *fdNext;
+#ifndef USE_POLL
+ fd_set rdLast, rdNext;
+ fd_set wrLast, wrNext;
+ fd_set exLast, exNext;
+ fd_set nonblockBefore;
+ int fdMax, fdCount, highestFD;
+ evFile *fdTable[FD_SETSIZE];
+#else
+ struct pollfd *pollfds; /* Allocated as needed */
+ evFile **fdTable; /* Ditto */
+ int maxnfds; /* # elements in above */
+ int firstfd; /* First active fd */
+ int fdMax; /* Last active fd */
+ int fdCount; /* # fd:s with I/O */
+ int highestFD; /* max fd allowed by OS */
+ __evEmulMask rdLast, rdNext;
+ __evEmulMask wrLast, wrNext;
+ __evEmulMask exLast, exNext;
+ __evEmulMask nonblockBefore;
+#endif /* USE_POLL */
+#ifdef EVENTLIB_TIME_CHECKS
+ struct timespec lastSelectTime;
+ int lastFdCount;
+#endif
+ /* Streams. */
+ evStream *streams;
+ evStream *strDone, *strLast;
+ /* Timers. */
+ struct timespec lastEventTime;
+ heap_context timers;
+ /* Waits. */
+ evWaitList *waitLists;
+ evWaitList waitDone;
+} evContext_p;
+
+/* eventlib.c */
+#define evPrintf __evPrintf
+void evPrintf(const evContext_p *ctx, int level, const char *fmt, ...)
+ ISC_FORMAT_PRINTF(3, 4);
+
+#ifdef USE_POLL
+extern int evPollfdRealloc(evContext_p *ctx, int pollfd_chunk_size, int fd);
+#endif /* USE_POLL */
+
+/* ev_timers.c */
+#define evCreateTimers __evCreateTimers
+heap_context evCreateTimers(const evContext_p *);
+#define evDestroyTimers __evDestroyTimers
+void evDestroyTimers(const evContext_p *);
+
+/* ev_waits.c */
+#define evFreeWait __evFreeWait
+evWait *evFreeWait(evContext_p *ctx, evWait *old);
+
+/* Global options */
+extern int __evOptMonoTime;
+
+#endif /*_EVENTLIB_P_H*/
diff --git a/usr/src/lib/libresolv2_joy/common/isc/heap.c b/usr/src/lib/libresolv2_joy/common/isc/heap.c
new file mode 100644
index 0000000000..3d22b6fc71
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/heap.c
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1997,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*%
+ * Heap implementation of priority queues adapted from the following:
+ *
+ * _Introduction to Algorithms_, Cormen, Leiserson, and Rivest,
+ * MIT Press / McGraw Hill, 1990, ISBN 0-262-03141-8, chapter 7.
+ *
+ * _Algorithms_, Second Edition, Sedgewick, Addison-Wesley, 1988,
+ * ISBN 0-201-06673-4, chapter 11.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: heap.c,v 1.4 2006/03/09 23:57:56 marka Exp $";
+#endif /* not lint */
+
+#include "port_before.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include "port_after.h"
+
+#include <isc/heap.h>
+
+/*%
+ * Note: to make heap_parent and heap_left easy to compute, the first
+ * element of the heap array is not used; i.e. heap subscripts are 1-based,
+ * not 0-based.
+ */
+#define heap_parent(i) ((i) >> 1)
+#define heap_left(i) ((i) << 1)
+
+#define ARRAY_SIZE_INCREMENT 512
+
+heap_context
+heap_new(heap_higher_priority_func higher_priority, heap_index_func index,
+ int array_size_increment) {
+ heap_context ctx;
+
+ if (higher_priority == NULL)
+ return (NULL);
+
+ ctx = (heap_context)malloc(sizeof (struct heap_context));
+ if (ctx == NULL)
+ return (NULL);
+
+ ctx->array_size = 0;
+ if (array_size_increment == 0)
+ ctx->array_size_increment = ARRAY_SIZE_INCREMENT;
+ else
+ ctx->array_size_increment = array_size_increment;
+ ctx->heap_size = 0;
+ ctx->heap = NULL;
+ ctx->higher_priority = higher_priority;
+ ctx->index = index;
+ return (ctx);
+}
+
+int
+heap_free(heap_context ctx) {
+ if (ctx == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (ctx->heap != NULL)
+ free(ctx->heap);
+ free(ctx);
+
+ return (0);
+}
+
+static int
+heap_resize(heap_context ctx) {
+ void **new_heap;
+
+ ctx->array_size += ctx->array_size_increment;
+ new_heap = (void **)realloc(ctx->heap,
+ (ctx->array_size) * (sizeof (void *)));
+ if (new_heap == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+ ctx->heap = new_heap;
+ return (0);
+}
+
+static void
+float_up(heap_context ctx, int i, void *elt) {
+ int p;
+
+ for ( p = heap_parent(i);
+ i > 1 && ctx->higher_priority(elt, ctx->heap[p]);
+ i = p, p = heap_parent(i) ) {
+ ctx->heap[i] = ctx->heap[p];
+ if (ctx->index != NULL)
+ (ctx->index)(ctx->heap[i], i);
+ }
+ ctx->heap[i] = elt;
+ if (ctx->index != NULL)
+ (ctx->index)(ctx->heap[i], i);
+}
+
+static void
+sink_down(heap_context ctx, int i, void *elt) {
+ int j, size, half_size;
+
+ size = ctx->heap_size;
+ half_size = size / 2;
+ while (i <= half_size) {
+ /* find smallest of the (at most) two children */
+ j = heap_left(i);
+ if (j < size && ctx->higher_priority(ctx->heap[j+1],
+ ctx->heap[j]))
+ j++;
+ if (ctx->higher_priority(elt, ctx->heap[j]))
+ break;
+ ctx->heap[i] = ctx->heap[j];
+ if (ctx->index != NULL)
+ (ctx->index)(ctx->heap[i], i);
+ i = j;
+ }
+ ctx->heap[i] = elt;
+ if (ctx->index != NULL)
+ (ctx->index)(ctx->heap[i], i);
+}
+
+int
+heap_insert(heap_context ctx, void *elt) {
+ int i;
+
+ if (ctx == NULL || elt == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ i = ++ctx->heap_size;
+ if (ctx->heap_size >= ctx->array_size && heap_resize(ctx) < 0)
+ return (-1);
+
+ float_up(ctx, i, elt);
+
+ return (0);
+}
+
+int
+heap_delete(heap_context ctx, int i) {
+ void *elt;
+ int less;
+
+ if (ctx == NULL || i < 1 || i > ctx->heap_size) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ if (i == ctx->heap_size) {
+ ctx->heap_size--;
+ } else {
+ elt = ctx->heap[ctx->heap_size--];
+ less = ctx->higher_priority(elt, ctx->heap[i]);
+ ctx->heap[i] = elt;
+ if (less)
+ float_up(ctx, i, ctx->heap[i]);
+ else
+ sink_down(ctx, i, ctx->heap[i]);
+ }
+
+ return (0);
+}
+
+int
+heap_increased(heap_context ctx, int i) {
+ if (ctx == NULL || i < 1 || i > ctx->heap_size) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ float_up(ctx, i, ctx->heap[i]);
+
+ return (0);
+}
+
+int
+heap_decreased(heap_context ctx, int i) {
+ if (ctx == NULL || i < 1 || i > ctx->heap_size) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ sink_down(ctx, i, ctx->heap[i]);
+
+ return (0);
+}
+
+void *
+heap_element(heap_context ctx, int i) {
+ if (ctx == NULL || i < 1 || i > ctx->heap_size) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ return (ctx->heap[i]);
+}
+
+int
+heap_for_each(heap_context ctx, heap_for_each_func action, void *uap) {
+ int i;
+
+ if (ctx == NULL || action == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ for (i = 1; i <= ctx->heap_size; i++)
+ (action)(ctx->heap[i], uap);
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/hex.c b/usr/src/lib/libresolv2_joy/common/isc/hex.c
new file mode 100644
index 0000000000..e43be4f3b5
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/hex.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2001 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <port_before.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <isc/misc.h>
+#include <port_after.h>
+
+static const char hex[17] = "0123456789abcdef";
+
+int
+isc_gethexstring(unsigned char *buf, size_t len, int count, FILE *fp,
+ int *multiline)
+{
+ int c, n;
+ unsigned char x;
+ char *s;
+ int result = count;
+
+ x = 0; /*%< silence compiler */
+ n = 0;
+ while (count > 0) {
+ c = fgetc(fp);
+
+ if ((c == EOF) ||
+ (c == '\n' && !*multiline) ||
+ (c == '(' && *multiline) ||
+ (c == ')' && !*multiline))
+ goto formerr;
+ /* comment */
+ if (c == ';') {
+ do {
+ c = fgetc(fp);
+ } while (c != EOF && c != '\n');
+ if (c == '\n' && *multiline)
+ continue;
+ goto formerr;
+ }
+ /* white space */
+ if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
+ continue;
+ /* multiline */
+ if ('(' == c || c == ')') {
+ *multiline = (c == '(' /*)*/);
+ continue;
+ }
+ if ((s = strchr(hex, tolower(c))) == NULL)
+ goto formerr;
+ x = (x<<4) | (s - hex);
+ if (++n == 2) {
+ if (len > 0U) {
+ *buf++ = x;
+ len--;
+ } else
+ result = -1;
+ count--;
+ n = 0;
+ }
+ }
+ return (result);
+
+ formerr:
+ if (c == '\n')
+ ungetc(c, fp);
+ return (-1);
+}
+
+void
+isc_puthexstring(FILE *fp, const unsigned char *buf, size_t buflen,
+ size_t len1, size_t len2, const char *sep)
+{
+ size_t i = 0;
+
+ if (len1 < 4U)
+ len1 = 4;
+ if (len2 < 4U)
+ len2 = 4;
+ while (buflen > 0U) {
+ fputc(hex[(buf[0]>>4)&0xf], fp);
+ fputc(hex[buf[0]&0xf], fp);
+ i += 2;
+ buflen--;
+ buf++;
+ if (i >= len1 && sep != NULL) {
+ fputs(sep, fp);
+ i = 0;
+ len1 = len2;
+ }
+ }
+}
+
+void
+isc_tohex(const unsigned char *buf, size_t buflen, char *t) {
+ while (buflen > 0U) {
+ *t++ = hex[(buf[0]>>4)&0xf];
+ *t++ = hex[buf[0]&0xf];
+ buf++;
+ buflen--;
+ }
+ *t = '\0';
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/logging.c b/usr/src/lib/libresolv2_joy/common/isc/logging.c
new file mode 100644
index 0000000000..8c2af2b9e3
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/logging.c
@@ -0,0 +1,716 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1996-1999, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: logging.c,v 1.9 2008/11/14 02:36:51 marka Exp $";
+#endif /* not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <syslog.h>
+#include <errno.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <isc/assertions.h>
+#include <isc/logging.h>
+#include <isc/memcluster.h>
+#include <isc/misc.h>
+
+#include "port_after.h"
+
+#include "logging_p.h"
+
+static const int syslog_priority[] = { LOG_DEBUG, LOG_INFO, LOG_NOTICE,
+ LOG_WARNING, LOG_ERR, LOG_CRIT };
+
+static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+
+static const char *level_text[] = {
+ "info: ", "notice: ", "warning: ", "error: ", "critical: "
+};
+
+static void
+version_rename(log_channel chan) {
+ unsigned int ver;
+ char old_name[PATH_MAX+1];
+ char new_name[PATH_MAX+1];
+
+ ver = chan->out.file.versions;
+ if (ver < 1)
+ return;
+ if (ver > LOG_MAX_VERSIONS)
+ ver = LOG_MAX_VERSIONS;
+ /*
+ * Need to have room for '.nn' (XXX assumes LOG_MAX_VERSIONS < 100)
+ */
+ if (strlen(chan->out.file.name) > (size_t)(PATH_MAX-3))
+ return;
+ for (ver--; ver > 0; ver--) {
+ sprintf(old_name, "%s.%d", chan->out.file.name, ver-1);
+ sprintf(new_name, "%s.%d", chan->out.file.name, ver);
+ (void)isc_movefile(old_name, new_name);
+ }
+ sprintf(new_name, "%s.0", chan->out.file.name);
+ (void)isc_movefile(chan->out.file.name, new_name);
+}
+
+FILE *
+log_open_stream(log_channel chan) {
+ FILE *stream;
+ int fd, flags;
+ struct stat sb;
+ int regular;
+
+ if (chan == NULL || chan->type != log_file) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /*
+ * Don't open already open streams
+ */
+ if (chan->out.file.stream != NULL)
+ return (chan->out.file.stream);
+
+ if (stat(chan->out.file.name, &sb) < 0) {
+ if (errno != ENOENT) {
+ syslog(LOG_ERR,
+ "log_open_stream: stat of %s failed: %s",
+ chan->out.file.name, strerror(errno));
+ chan->flags |= LOG_CHANNEL_BROKEN;
+ return (NULL);
+ }
+ regular = 1;
+ } else
+ regular = (sb.st_mode & S_IFREG);
+
+ if (chan->out.file.versions) {
+ if (!regular) {
+ syslog(LOG_ERR,
+ "log_open_stream: want versions but %s isn't a regular file",
+ chan->out.file.name);
+ chan->flags |= LOG_CHANNEL_BROKEN;
+ errno = EINVAL;
+ return (NULL);
+ }
+ }
+
+ flags = O_WRONLY|O_CREAT|O_APPEND;
+
+ if ((chan->flags & LOG_TRUNCATE) != 0) {
+ if (regular) {
+ (void)unlink(chan->out.file.name);
+ flags |= O_EXCL;
+ } else {
+ syslog(LOG_ERR,
+ "log_open_stream: want truncation but %s isn't a regular file",
+ chan->out.file.name);
+ chan->flags |= LOG_CHANNEL_BROKEN;
+ errno = EINVAL;
+ return (NULL);
+ }
+ }
+
+ fd = open(chan->out.file.name, flags,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+ if (fd < 0) {
+ syslog(LOG_ERR, "log_open_stream: open(%s) failed: %s",
+ chan->out.file.name, strerror(errno));
+ chan->flags |= LOG_CHANNEL_BROKEN;
+ return (NULL);
+ }
+ stream = fdopen(fd, "a");
+ if (stream == NULL) {
+ syslog(LOG_ERR, "log_open_stream: fdopen() failed");
+ chan->flags |= LOG_CHANNEL_BROKEN;
+ return (NULL);
+ }
+ (void) fchown(fd, chan->out.file.owner, chan->out.file.group);
+
+ chan->out.file.stream = stream;
+ return (stream);
+}
+
+int
+log_close_stream(log_channel chan) {
+ FILE *stream;
+
+ if (chan == NULL || chan->type != log_file) {
+ errno = EINVAL;
+ return (0);
+ }
+ stream = chan->out.file.stream;
+ chan->out.file.stream = NULL;
+ if (stream != NULL && fclose(stream) == EOF)
+ return (-1);
+ return (0);
+}
+
+void
+log_close_debug_channels(log_context lc) {
+ log_channel_list lcl;
+ int i;
+
+ for (i = 0; i < lc->num_categories; i++)
+ for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl->next)
+ if (lcl->channel->type == log_file &&
+ lcl->channel->out.file.stream != NULL &&
+ lcl->channel->flags & LOG_REQUIRE_DEBUG)
+ (void)log_close_stream(lcl->channel);
+}
+
+FILE *
+log_get_stream(log_channel chan) {
+ if (chan == NULL || chan->type != log_file) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ return (chan->out.file.stream);
+}
+
+char *
+log_get_filename(log_channel chan) {
+ if (chan == NULL || chan->type != log_file) {
+ errno = EINVAL;
+ return (NULL);
+ }
+ return (chan->out.file.name);
+}
+
+int
+log_check_channel(log_context lc, int level, log_channel chan) {
+ int debugging, chan_level;
+
+ REQUIRE(lc != NULL);
+
+ debugging = ((lc->flags & LOG_OPTION_DEBUG) != 0);
+
+ /*
+ * If not debugging, short circuit debugging messages very early.
+ */
+ if (level > 0 && !debugging)
+ return (0);
+
+ if ((chan->flags & (LOG_CHANNEL_BROKEN|LOG_CHANNEL_OFF)) != 0)
+ return (0);
+
+ /* Some channels only log when debugging is on. */
+ if ((chan->flags & LOG_REQUIRE_DEBUG) && !debugging)
+ return (0);
+
+ /* Some channels use the global level. */
+ if ((chan->flags & LOG_USE_CONTEXT_LEVEL) != 0) {
+ chan_level = lc->level;
+ } else
+ chan_level = chan->level;
+
+ if (level > chan_level)
+ return (0);
+
+ return (1);
+}
+
+int
+log_check(log_context lc, int category, int level) {
+ log_channel_list lcl;
+ int debugging;
+
+ REQUIRE(lc != NULL);
+
+ debugging = ((lc->flags & LOG_OPTION_DEBUG) != 0);
+
+ /*
+ * If not debugging, short circuit debugging messages very early.
+ */
+ if (level > 0 && !debugging)
+ return (0);
+
+ if (category < 0 || category > lc->num_categories)
+ category = 0; /*%< use default */
+ lcl = lc->categories[category];
+ if (lcl == NULL) {
+ category = 0;
+ lcl = lc->categories[0];
+ }
+
+ for ( /* nothing */; lcl != NULL; lcl = lcl->next) {
+ if (log_check_channel(lc, level, lcl->channel))
+ return (1);
+ }
+ return (0);
+}
+
+void
+log_vwrite(log_context lc, int category, int level, const char *format,
+ va_list args) {
+ log_channel_list lcl;
+ int pri, debugging, did_vsprintf = 0;
+ int original_category;
+ FILE *stream;
+ log_channel chan;
+ struct timeval tv;
+ struct tm *local_tm;
+#ifdef HAVE_TIME_R
+ struct tm tm_tmp;
+#endif
+ time_t tt;
+ const char *category_name;
+ const char *level_str;
+ char time_buf[256];
+ char level_buf[256];
+
+ REQUIRE(lc != NULL);
+
+ debugging = (lc->flags & LOG_OPTION_DEBUG);
+
+ /*
+ * If not debugging, short circuit debugging messages very early.
+ */
+ if (level > 0 && !debugging)
+ return;
+
+ if (category < 0 || category > lc->num_categories)
+ category = 0; /*%< use default */
+ original_category = category;
+ lcl = lc->categories[category];
+ if (lcl == NULL) {
+ category = 0;
+ lcl = lc->categories[0];
+ }
+
+ /*
+ * Get the current time and format it.
+ */
+ time_buf[0]='\0';
+ if (gettimeofday(&tv, NULL) < 0) {
+ syslog(LOG_INFO, "gettimeofday failed in log_vwrite()");
+ } else {
+ tt = tv.tv_sec;
+#ifdef HAVE_TIME_R
+ local_tm = localtime_r(&tt, &tm_tmp);
+#else
+ local_tm = localtime(&tt);
+#endif
+ if (local_tm != NULL) {
+ sprintf(time_buf, "%02d-%s-%4d %02d:%02d:%02d.%03ld ",
+ local_tm->tm_mday, months[local_tm->tm_mon],
+ local_tm->tm_year+1900, local_tm->tm_hour,
+ local_tm->tm_min, local_tm->tm_sec,
+ (long)tv.tv_usec/1000);
+ }
+ }
+
+ /*
+ * Make a string representation of the current category and level
+ */
+
+ if (lc->category_names != NULL &&
+ lc->category_names[original_category] != NULL)
+ category_name = lc->category_names[original_category];
+ else
+ category_name = "";
+
+ if (level >= log_critical) {
+ if (level >= 0) {
+ sprintf(level_buf, "debug %d: ", level);
+ level_str = level_buf;
+ } else
+ level_str = level_text[-level-1];
+ } else {
+ sprintf(level_buf, "level %d: ", level);
+ level_str = level_buf;
+ }
+
+ /*
+ * Write the message to channels.
+ */
+ for ( /* nothing */; lcl != NULL; lcl = lcl->next) {
+ chan = lcl->channel;
+
+ if (!log_check_channel(lc, level, chan))
+ continue;
+
+ if (!did_vsprintf) {
+ (void)vsprintf(lc->buffer, format, args);
+ if (strlen(lc->buffer) > (size_t)LOG_BUFFER_SIZE) {
+ syslog(LOG_CRIT,
+ "memory overrun in log_vwrite()");
+ exit(1);
+ }
+ did_vsprintf = 1;
+ }
+
+ switch (chan->type) {
+ case log_syslog:
+ if (level >= log_critical)
+ pri = (level >= 0) ? 0 : -level;
+ else
+ pri = -log_critical;
+ syslog(chan->out.facility|syslog_priority[pri],
+ "%s%s%s%s",
+ (chan->flags & LOG_TIMESTAMP) ? time_buf : "",
+ (chan->flags & LOG_PRINT_CATEGORY) ?
+ category_name : "",
+ (chan->flags & LOG_PRINT_LEVEL) ?
+ level_str : "",
+ lc->buffer);
+ break;
+ case log_file:
+ stream = chan->out.file.stream;
+ if (stream == NULL) {
+ stream = log_open_stream(chan);
+ if (stream == NULL)
+ break;
+ }
+ if (chan->out.file.max_size != ULONG_MAX) {
+ long pos;
+
+ pos = ftell(stream);
+ if (pos >= 0 &&
+ (unsigned long)pos >
+ chan->out.file.max_size) {
+ /*
+ * try to roll over the log files,
+ * ignoring all all return codes
+ * except the open (we don't want
+ * to write any more anyway)
+ */
+ log_close_stream(chan);
+ version_rename(chan);
+ stream = log_open_stream(chan);
+ if (stream == NULL)
+ break;
+ }
+ }
+ fprintf(stream, "%s%s%s%s\n",
+ (chan->flags & LOG_TIMESTAMP) ? time_buf : "",
+ (chan->flags & LOG_PRINT_CATEGORY) ?
+ category_name : "",
+ (chan->flags & LOG_PRINT_LEVEL) ?
+ level_str : "",
+ lc->buffer);
+ fflush(stream);
+ break;
+ case log_null:
+ break;
+ default:
+ syslog(LOG_ERR,
+ "unknown channel type in log_vwrite()");
+ }
+ }
+}
+
+void
+log_write(log_context lc, int category, int level, const char *format, ...) {
+ va_list args;
+
+ va_start(args, format);
+ log_vwrite(lc, category, level, format, args);
+ va_end(args);
+}
+
+/*%
+ * Functions to create, set, or destroy contexts
+ */
+
+int
+log_new_context(int num_categories, char **category_names, log_context *lc) {
+ log_context nlc;
+
+ nlc = memget(sizeof (struct log_context));
+ if (nlc == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+ nlc->num_categories = num_categories;
+ nlc->category_names = category_names;
+ nlc->categories = memget(num_categories * sizeof (log_channel_list));
+ if (nlc->categories == NULL) {
+ memput(nlc, sizeof (struct log_context));
+ errno = ENOMEM;
+ return (-1);
+ }
+ memset(nlc->categories, '\0',
+ num_categories * sizeof (log_channel_list));
+ nlc->flags = 0U;
+ nlc->level = 0;
+ *lc = nlc;
+ return (0);
+}
+
+void
+log_free_context(log_context lc) {
+ log_channel_list lcl, lcl_next;
+ log_channel chan;
+ int i;
+
+ REQUIRE(lc != NULL);
+
+ for (i = 0; i < lc->num_categories; i++)
+ for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl_next) {
+ lcl_next = lcl->next;
+ chan = lcl->channel;
+ (void)log_free_channel(chan);
+ memput(lcl, sizeof (struct log_channel_list));
+ }
+ memput(lc->categories,
+ lc->num_categories * sizeof (log_channel_list));
+ memput(lc, sizeof (struct log_context));
+}
+
+int
+log_add_channel(log_context lc, int category, log_channel chan) {
+ log_channel_list lcl;
+
+ if (lc == NULL || category < 0 || category >= lc->num_categories) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ lcl = memget(sizeof (struct log_channel_list));
+ if (lcl == NULL) {
+ errno = ENOMEM;
+ return(-1);
+ }
+ lcl->channel = chan;
+ lcl->next = lc->categories[category];
+ lc->categories[category] = lcl;
+ chan->references++;
+ return (0);
+}
+
+int
+log_remove_channel(log_context lc, int category, log_channel chan) {
+ log_channel_list lcl, prev_lcl, next_lcl;
+ int found = 0;
+
+ if (lc == NULL || category < 0 || category >= lc->num_categories) {
+ errno = EINVAL;
+ return (-1);
+ }
+
+ for (prev_lcl = NULL, lcl = lc->categories[category];
+ lcl != NULL;
+ lcl = next_lcl) {
+ next_lcl = lcl->next;
+ if (lcl->channel == chan) {
+ log_free_channel(chan);
+ if (prev_lcl != NULL)
+ prev_lcl->next = next_lcl;
+ else
+ lc->categories[category] = next_lcl;
+ memput(lcl, sizeof (struct log_channel_list));
+ /*
+ * We just set found instead of returning because
+ * the channel might be on the list more than once.
+ */
+ found = 1;
+ } else
+ prev_lcl = lcl;
+ }
+ if (!found) {
+ errno = ENOENT;
+ return (-1);
+ }
+ return (0);
+}
+
+int
+log_option(log_context lc, int option, int value) {
+ if (lc == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ switch (option) {
+ case LOG_OPTION_DEBUG:
+ if (value)
+ lc->flags |= option;
+ else
+ lc->flags &= ~option;
+ break;
+ case LOG_OPTION_LEVEL:
+ lc->level = value;
+ break;
+ default:
+ errno = EINVAL;
+ return (-1);
+ }
+ return (0);
+}
+
+int
+log_category_is_active(log_context lc, int category) {
+ if (lc == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ if (category >= 0 && category < lc->num_categories &&
+ lc->categories[category] != NULL)
+ return (1);
+ return (0);
+}
+
+log_channel
+log_new_syslog_channel(unsigned int flags, int level, int facility) {
+ log_channel chan;
+
+ chan = memget(sizeof (struct log_channel));
+ if (chan == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ chan->type = log_syslog;
+ chan->flags = flags;
+ chan->level = level;
+ chan->out.facility = facility;
+ chan->references = 0;
+ return (chan);
+}
+
+log_channel
+log_new_file_channel(unsigned int flags, int level,
+ const char *name, FILE *stream, unsigned int versions,
+ unsigned long max_size) {
+ log_channel chan;
+
+ chan = memget(sizeof (struct log_channel));
+ if (chan == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ chan->type = log_file;
+ chan->flags = flags;
+ chan->level = level;
+ if (name != NULL) {
+ size_t len;
+
+ len = strlen(name);
+ /*
+ * Quantize length to a multiple of 256. There's space for the
+ * NUL, since if len is a multiple of 256, the size chosen will
+ * be the next multiple.
+ */
+ chan->out.file.name_size = ((len / 256) + 1) * 256;
+ chan->out.file.name = memget(chan->out.file.name_size);
+ if (chan->out.file.name == NULL) {
+ memput(chan, sizeof (struct log_channel));
+ errno = ENOMEM;
+ return (NULL);
+ }
+ /* This is safe. */
+ strcpy(chan->out.file.name, name);
+ } else {
+ chan->out.file.name_size = 0;
+ chan->out.file.name = NULL;
+ }
+ chan->out.file.stream = stream;
+ chan->out.file.versions = versions;
+ chan->out.file.max_size = max_size;
+ chan->out.file.owner = getuid();
+ chan->out.file.group = getgid();
+ chan->references = 0;
+ return (chan);
+}
+
+int
+log_set_file_owner(log_channel chan, uid_t owner, gid_t group) {
+ if (chan->type != log_file) {
+ errno = EBADF;
+ return (-1);
+ }
+ chan->out.file.owner = owner;
+ chan->out.file.group = group;
+ return (0);
+}
+
+log_channel
+log_new_null_channel() {
+ log_channel chan;
+
+ chan = memget(sizeof (struct log_channel));
+ if (chan == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ chan->type = log_null;
+ chan->flags = LOG_CHANNEL_OFF;
+ chan->level = log_info;
+ chan->references = 0;
+ return (chan);
+}
+
+int
+log_inc_references(log_channel chan) {
+ if (chan == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
+ chan->references++;
+ return (0);
+}
+
+int
+log_dec_references(log_channel chan) {
+ if (chan == NULL || chan->references <= 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ chan->references--;
+ return (0);
+}
+
+log_channel_type
+log_get_channel_type(log_channel chan) {
+ REQUIRE(chan != NULL);
+
+ return (chan->type);
+}
+
+int
+log_free_channel(log_channel chan) {
+ if (chan == NULL || chan->references <= 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ chan->references--;
+ if (chan->references == 0) {
+ if (chan->type == log_file) {
+ if ((chan->flags & LOG_CLOSE_STREAM) &&
+ chan->out.file.stream != NULL)
+ (void)fclose(chan->out.file.stream);
+ if (chan->out.file.name != NULL)
+ memput(chan->out.file.name,
+ chan->out.file.name_size);
+ }
+ memput(chan, sizeof (struct log_channel));
+ }
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/logging_p.h b/usr/src/lib/libresolv2_joy/common/isc/logging_p.h
new file mode 100644
index 0000000000..5e6314f190
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/logging_p.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef LOGGING_P_H
+#define LOGGING_P_H
+
+typedef struct log_file_desc {
+ char *name;
+ size_t name_size;
+ FILE *stream;
+ unsigned int versions;
+ unsigned long max_size;
+ uid_t owner;
+ gid_t group;
+} log_file_desc;
+
+typedef union log_output {
+ int facility;
+ log_file_desc file;
+} log_output;
+
+struct log_channel {
+ int level; /*%< don't log messages > level */
+ log_channel_type type;
+ log_output out;
+ unsigned int flags;
+ int references;
+};
+
+typedef struct log_channel_list {
+ log_channel channel;
+ struct log_channel_list *next;
+} *log_channel_list;
+
+#define LOG_BUFFER_SIZE 20480
+
+struct log_context {
+ int num_categories;
+ char **category_names;
+ log_channel_list *categories;
+ int flags;
+ int level;
+ char buffer[LOG_BUFFER_SIZE];
+};
+
+#endif /* !LOGGING_P_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/memcluster.c b/usr/src/lib/libresolv2_joy/common/isc/memcluster.c
new file mode 100644
index 0000000000..515793fd6a
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/memcluster.c
@@ -0,0 +1,588 @@
+/*
+ * Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1997,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/* When this symbol is defined allocations via memget are made slightly
+ bigger and some debugging info stuck before and after the region given
+ back to the caller. */
+/* #define DEBUGGING_MEMCLUSTER */
+#define MEMCLUSTER_ATEND
+
+
+#if !defined(LINT) && !defined(CODECENTER)
+static const char rcsid[] = "$Id: memcluster.c,v 1.11 2006/08/30 23:34:38 marka Exp $";
+#endif /* not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include <isc/memcluster.h>
+#include <isc/assertions.h>
+
+#include "port_after.h"
+
+#ifdef MEMCLUSTER_RECORD
+#ifndef DEBUGGING_MEMCLUSTER
+#define DEBUGGING_MEMCLUSTER
+#endif
+#endif
+
+#define DEF_MAX_SIZE 1100
+#define DEF_MEM_TARGET 4096
+
+typedef u_int32_t fence_t;
+
+typedef struct {
+ void * next;
+#if defined(DEBUGGING_MEMCLUSTER)
+#if defined(MEMCLUSTER_RECORD)
+ const char * file;
+ int line;
+#endif
+ size_t size;
+ fence_t fencepost;
+#endif
+} memcluster_element;
+
+#define SMALL_SIZE_LIMIT sizeof(memcluster_element)
+#define P_SIZE sizeof(void *)
+#define FRONT_FENCEPOST 0xfebafeba
+#define BACK_FENCEPOST 0xabefabef
+#define FENCEPOST_SIZE 4
+
+#ifndef MEMCLUSTER_LITTLE_MALLOC
+#define MEMCLUSTER_BIG_MALLOC 1
+#define NUM_BASIC_BLOCKS 64
+#endif
+
+struct stats {
+ u_long gets;
+ u_long totalgets;
+ u_long blocks;
+ u_long freefrags;
+};
+
+#ifdef DO_PTHREADS
+#include <pthread.h>
+static pthread_mutex_t memlock = PTHREAD_MUTEX_INITIALIZER;
+#define MEMLOCK (void)pthread_mutex_lock(&memlock)
+#define MEMUNLOCK (void)pthread_mutex_unlock(&memlock)
+#else
+/*
+ * Catch bad lock usage in non threaded build.
+ */
+static unsigned int memlock = 0;
+#define MEMLOCK do { INSIST(memlock == 0); memlock = 1; } while (0)
+#define MEMUNLOCK do { INSIST(memlock == 1); memlock = 0; } while (0)
+#endif /* DO_PTHEADS */
+
+/* Private data. */
+
+static size_t max_size;
+static size_t mem_target;
+#ifndef MEMCLUSTER_BIG_MALLOC
+static size_t mem_target_half;
+static size_t mem_target_fudge;
+#endif
+static memcluster_element ** freelists;
+#ifdef MEMCLUSTER_RECORD
+static memcluster_element ** activelists;
+#endif
+#ifdef MEMCLUSTER_BIG_MALLOC
+static memcluster_element * basic_blocks;
+#endif
+static struct stats * stats;
+
+/* Forward. */
+
+static size_t quantize(size_t);
+#if defined(DEBUGGING_MEMCLUSTER)
+static void check(unsigned char *, int, size_t);
+#endif
+
+/* Public. */
+
+int
+meminit(size_t init_max_size, size_t target_size) {
+
+#if defined(DEBUGGING_MEMCLUSTER)
+ INSIST(sizeof(fence_t) == FENCEPOST_SIZE);
+#endif
+ if (freelists != NULL) {
+ errno = EEXIST;
+ return (-1);
+ }
+ if (init_max_size == 0U)
+ max_size = DEF_MAX_SIZE;
+ else
+ max_size = init_max_size;
+ if (target_size == 0U)
+ mem_target = DEF_MEM_TARGET;
+ else
+ mem_target = target_size;
+#ifndef MEMCLUSTER_BIG_MALLOC
+ mem_target_half = mem_target / 2;
+ mem_target_fudge = mem_target + mem_target / 4;
+#endif
+ freelists = malloc(max_size * sizeof (memcluster_element *));
+ stats = malloc((max_size+1) * sizeof (struct stats));
+ if (freelists == NULL || stats == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+ memset(freelists, 0,
+ max_size * sizeof (memcluster_element *));
+ memset(stats, 0, (max_size + 1) * sizeof (struct stats));
+#ifdef MEMCLUSTER_RECORD
+ activelists = malloc((max_size + 1) * sizeof (memcluster_element *));
+ if (activelists == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+ memset(activelists, 0,
+ (max_size + 1) * sizeof (memcluster_element *));
+#endif
+#ifdef MEMCLUSTER_BIG_MALLOC
+ basic_blocks = NULL;
+#endif
+ return (0);
+}
+
+void *
+__memget(size_t size) {
+ return (__memget_record(size, NULL, 0));
+}
+
+void *
+__memget_record(size_t size, const char *file, int line) {
+ size_t new_size = quantize(size);
+#if defined(DEBUGGING_MEMCLUSTER)
+ memcluster_element *e;
+ char *p;
+ fence_t fp = BACK_FENCEPOST;
+#endif
+ void *ret;
+
+ MEMLOCK;
+
+#if !defined(MEMCLUSTER_RECORD)
+ UNUSED(file);
+ UNUSED(line);
+#endif
+ if (freelists == NULL) {
+ if (meminit(0, 0) == -1) {
+ MEMUNLOCK;
+ return (NULL);
+ }
+ }
+ if (size == 0U) {
+ MEMUNLOCK;
+ errno = EINVAL;
+ return (NULL);
+ }
+ if (size >= max_size || new_size >= max_size) {
+ /* memget() was called on something beyond our upper limit. */
+ stats[max_size].gets++;
+ stats[max_size].totalgets++;
+#if defined(DEBUGGING_MEMCLUSTER)
+ e = malloc(new_size);
+ if (e == NULL) {
+ MEMUNLOCK;
+ errno = ENOMEM;
+ return (NULL);
+ }
+ e->next = NULL;
+ e->size = size;
+#ifdef MEMCLUSTER_RECORD
+ e->file = file;
+ e->line = line;
+ e->next = activelists[max_size];
+ activelists[max_size] = e;
+#endif
+ MEMUNLOCK;
+ e->fencepost = FRONT_FENCEPOST;
+ p = (char *)e + sizeof *e + size;
+ memcpy(p, &fp, sizeof fp);
+ return ((char *)e + sizeof *e);
+#else
+ MEMUNLOCK;
+ return (malloc(size));
+#endif
+ }
+
+ /*
+ * If there are no blocks in the free list for this size, get a chunk
+ * of memory and then break it up into "new_size"-sized blocks, adding
+ * them to the free list.
+ */
+ if (freelists[new_size] == NULL) {
+ int i, frags;
+ size_t total_size;
+ void *new;
+ char *curr, *next;
+
+#ifdef MEMCLUSTER_BIG_MALLOC
+ if (basic_blocks == NULL) {
+ new = malloc(NUM_BASIC_BLOCKS * mem_target);
+ if (new == NULL) {
+ MEMUNLOCK;
+ errno = ENOMEM;
+ return (NULL);
+ }
+ curr = new;
+ next = curr + mem_target;
+ for (i = 0; i < (NUM_BASIC_BLOCKS - 1); i++) {
+ ((memcluster_element *)curr)->next = next;
+ curr = next;
+ next += mem_target;
+ }
+ /*
+ * curr is now pointing at the last block in the
+ * array.
+ */
+ ((memcluster_element *)curr)->next = NULL;
+ basic_blocks = new;
+ }
+ total_size = mem_target;
+ new = basic_blocks;
+ basic_blocks = basic_blocks->next;
+#else
+ if (new_size > mem_target_half)
+ total_size = mem_target_fudge;
+ else
+ total_size = mem_target;
+ new = malloc(total_size);
+ if (new == NULL) {
+ MEMUNLOCK;
+ errno = ENOMEM;
+ return (NULL);
+ }
+#endif
+ frags = total_size / new_size;
+ stats[new_size].blocks++;
+ stats[new_size].freefrags += frags;
+ /* Set up a linked-list of blocks of size "new_size". */
+ curr = new;
+ next = curr + new_size;
+ for (i = 0; i < (frags - 1); i++) {
+#if defined (DEBUGGING_MEMCLUSTER)
+ memset(curr, 0xa5, new_size);
+#endif
+ ((memcluster_element *)curr)->next = next;
+ curr = next;
+ next += new_size;
+ }
+ /* curr is now pointing at the last block in the array. */
+#if defined (DEBUGGING_MEMCLUSTER)
+ memset(curr, 0xa5, new_size);
+#endif
+ ((memcluster_element *)curr)->next = freelists[new_size];
+ freelists[new_size] = new;
+ }
+
+ /* The free list uses the "rounded-up" size "new_size". */
+#if defined (DEBUGGING_MEMCLUSTER)
+ e = freelists[new_size];
+ ret = (char *)e + sizeof *e;
+ /*
+ * Check to see if this buffer has been written to while on free list.
+ */
+ check(ret, 0xa5, new_size - sizeof *e);
+ /*
+ * Mark memory we are returning.
+ */
+ memset(ret, 0xe5, size);
+#else
+ ret = freelists[new_size];
+#endif
+ freelists[new_size] = freelists[new_size]->next;
+#if defined(DEBUGGING_MEMCLUSTER)
+ e->next = NULL;
+ e->size = size;
+ e->fencepost = FRONT_FENCEPOST;
+#ifdef MEMCLUSTER_RECORD
+ e->file = file;
+ e->line = line;
+ e->next = activelists[size];
+ activelists[size] = e;
+#endif
+ p = (char *)e + sizeof *e + size;
+ memcpy(p, &fp, sizeof fp);
+#endif
+
+ /*
+ * The stats[] uses the _actual_ "size" requested by the
+ * caller, with the caveat (in the code above) that "size" >= the
+ * max. size (max_size) ends up getting recorded as a call to
+ * max_size.
+ */
+ stats[size].gets++;
+ stats[size].totalgets++;
+ stats[new_size].freefrags--;
+ MEMUNLOCK;
+#if defined(DEBUGGING_MEMCLUSTER)
+ return ((char *)e + sizeof *e);
+#else
+ return (ret);
+#endif
+}
+
+/*%
+ * This is a call from an external caller,
+ * so we want to count this as a user "put".
+ */
+void
+__memput(void *mem, size_t size) {
+ __memput_record(mem, size, NULL, 0);
+}
+
+void
+__memput_record(void *mem, size_t size, const char *file, int line) {
+ size_t new_size = quantize(size);
+#if defined (DEBUGGING_MEMCLUSTER)
+ memcluster_element *e;
+ memcluster_element *el;
+#ifdef MEMCLUSTER_RECORD
+ memcluster_element *prev;
+#endif
+ fence_t fp;
+ char *p;
+#endif
+
+ MEMLOCK;
+
+#if !defined (MEMCLUSTER_RECORD)
+ UNUSED(file);
+ UNUSED(line);
+#endif
+
+ REQUIRE(freelists != NULL);
+
+ if (size == 0U) {
+ MEMUNLOCK;
+ errno = EINVAL;
+ return;
+ }
+
+#if defined (DEBUGGING_MEMCLUSTER)
+ e = (memcluster_element *) ((char *)mem - sizeof *e);
+ INSIST(e->fencepost == FRONT_FENCEPOST);
+ INSIST(e->size == size);
+ p = (char *)e + sizeof *e + size;
+ memcpy(&fp, p, sizeof fp);
+ INSIST(fp == BACK_FENCEPOST);
+ INSIST(((u_long)mem % 4) == 0);
+#ifdef MEMCLUSTER_RECORD
+ prev = NULL;
+ if (size == max_size || new_size >= max_size)
+ el = activelists[max_size];
+ else
+ el = activelists[size];
+ while (el != NULL && el != e) {
+ prev = el;
+ el = el->next;
+ }
+ INSIST(el != NULL); /*%< double free */
+ if (prev == NULL) {
+ if (size == max_size || new_size >= max_size)
+ activelists[max_size] = el->next;
+ else
+ activelists[size] = el->next;
+ } else
+ prev->next = el->next;
+#endif
+#endif
+
+ if (size == max_size || new_size >= max_size) {
+ /* memput() called on something beyond our upper limit */
+#if defined(DEBUGGING_MEMCLUSTER)
+ free(e);
+#else
+ free(mem);
+#endif
+
+ INSIST(stats[max_size].gets != 0U);
+ stats[max_size].gets--;
+ MEMUNLOCK;
+ return;
+ }
+
+ /* The free list uses the "rounded-up" size "new_size": */
+#if defined(DEBUGGING_MEMCLUSTER)
+ memset(mem, 0xa5, new_size - sizeof *e); /*%< catch write after free */
+ e->size = 0; /*%< catch double memput() */
+#ifdef MEMCLUSTER_RECORD
+ e->file = file;
+ e->line = line;
+#endif
+#ifdef MEMCLUSTER_ATEND
+ e->next = NULL;
+ el = freelists[new_size];
+ while (el != NULL && el->next != NULL)
+ el = el->next;
+ if (el)
+ el->next = e;
+ else
+ freelists[new_size] = e;
+#else
+ e->next = freelists[new_size];
+ freelists[new_size] = (void *)e;
+#endif
+#else
+ ((memcluster_element *)mem)->next = freelists[new_size];
+ freelists[new_size] = (memcluster_element *)mem;
+#endif
+
+ /*
+ * The stats[] uses the _actual_ "size" requested by the
+ * caller, with the caveat (in the code above) that "size" >= the
+ * max. size (max_size) ends up getting recorded as a call to
+ * max_size.
+ */
+ INSIST(stats[size].gets != 0U);
+ stats[size].gets--;
+ stats[new_size].freefrags++;
+ MEMUNLOCK;
+}
+
+void *
+__memget_debug(size_t size, const char *file, int line) {
+ void *ptr;
+ ptr = __memget_record(size, file, line);
+ fprintf(stderr, "%s:%d: memget(%lu) -> %p\n", file, line,
+ (u_long)size, ptr);
+ return (ptr);
+}
+
+void
+__memput_debug(void *ptr, size_t size, const char *file, int line) {
+ fprintf(stderr, "%s:%d: memput(%p, %lu)\n", file, line, ptr,
+ (u_long)size);
+ __memput_record(ptr, size, file, line);
+}
+
+/*%
+ * Print the stats[] on the stream "out" with suitable formatting.
+ */
+void
+memstats(FILE *out) {
+ size_t i;
+#ifdef MEMCLUSTER_RECORD
+ memcluster_element *e;
+#endif
+
+ MEMLOCK;
+
+ if (freelists == NULL) {
+ MEMUNLOCK;
+ return;
+ }
+ for (i = 1; i <= max_size; i++) {
+ const struct stats *s = &stats[i];
+
+ if (s->totalgets == 0U && s->gets == 0U)
+ continue;
+ fprintf(out, "%s%5lu: %11lu gets, %11lu rem",
+ (i == max_size) ? ">=" : " ",
+ (unsigned long)i, s->totalgets, s->gets);
+ if (s->blocks != 0U)
+ fprintf(out, " (%lu bl, %lu ff)",
+ s->blocks, s->freefrags);
+ fputc('\n', out);
+ }
+#ifdef MEMCLUSTER_RECORD
+ fprintf(out, "Active Memory:\n");
+ for (i = 1; i <= max_size; i++) {
+ if ((e = activelists[i]) != NULL)
+ while (e != NULL) {
+ fprintf(out, "%s:%d %p:%lu\n",
+ e->file != NULL ? e->file :
+ "<UNKNOWN>", e->line,
+ (char *)e + sizeof *e,
+ (u_long)e->size);
+ e = e->next;
+ }
+ }
+#endif
+ MEMUNLOCK;
+}
+
+int
+memactive(void) {
+ size_t i;
+
+ if (stats == NULL)
+ return (0);
+ for (i = 1; i <= max_size; i++)
+ if (stats[i].gets != 0U)
+ return (1);
+ return (0);
+}
+
+/* Private. */
+
+/*%
+ * Round up size to a multiple of sizeof(void *). This guarantees that a
+ * block is at least sizeof void *, and that we won't violate alignment
+ * restrictions, both of which are needed to make lists of blocks.
+ */
+static size_t
+quantize(size_t size) {
+ int remainder;
+ /*
+ * If there is no remainder for the integer division of
+ *
+ * (rightsize/P_SIZE)
+ *
+ * then we already have a good size; if not, then we need
+ * to round up the result in order to get a size big
+ * enough to satisfy the request _and_ aligned on P_SIZE boundaries.
+ */
+ remainder = size % P_SIZE;
+ if (remainder != 0)
+ size += P_SIZE - remainder;
+#if defined(DEBUGGING_MEMCLUSTER)
+ return (size + SMALL_SIZE_LIMIT + sizeof (int));
+#else
+ return (size);
+#endif
+}
+
+#if defined(DEBUGGING_MEMCLUSTER)
+static void
+check(unsigned char *a, int value, size_t len) {
+ size_t i;
+ for (i = 0; i < len; i++)
+ INSIST(a[i] == value);
+}
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/movefile.c b/usr/src/lib/libresolv2_joy/common/isc/movefile.c
new file mode 100644
index 0000000000..0ffc7047e2
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/movefile.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2000 by Internet Software Consortium, Inc.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+#include <port_before.h>
+#include <stdio.h>
+#include <isc/misc.h>
+#include <port_after.h>
+#ifndef HAVE_MOVEFILE
+/*
+ * rename() is lame (can't overwrite an existing file) on some systems.
+ * use movefile() instead, and let lame OS ports do what they need to.
+ */
+
+int
+isc_movefile(const char *oldname, const char *newname) {
+ return (rename(oldname, newname));
+}
+#else
+ static int os_port_has_isc_movefile = 1;
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/isc/tree.c b/usr/src/lib/libresolv2_joy/common/isc/tree.c
new file mode 100644
index 0000000000..8ba675fbe8
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/isc/tree.c
@@ -0,0 +1,534 @@
+#ifndef LINT
+static const char rcsid[] = "$Id: tree.c,v 1.4 2005/04/27 04:56:39 sra Exp $";
+#endif
+
+/*%
+ * tree - balanced binary tree library
+ *
+ * vix 05apr94 [removed vixie.h dependencies; cleaned up formatting, names]
+ * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes]
+ * vix 23jun86 [added delete uar to add for replaced nodes]
+ * vix 20jun86 [added tree_delete per wirth a+ds (mod2 v.) p. 224]
+ * vix 06feb86 [added tree_mung()]
+ * vix 02feb86 [added tree balancing from wirth "a+ds=p" p. 220-221]
+ * vix 14dec85 [written]
+ */
+
+/*%
+ * This program text was created by Paul Vixie using examples from the book:
+ * "Algorithms & Data Structures," Niklaus Wirth, Prentice-Hall, 1986, ISBN
+ * 0-13-022005-1. Any errors in the conversion from Modula-2 to C are Paul
+ * Vixie's.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*#define DEBUG "tree"*/
+
+#include "port_before.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#include <isc/memcluster.h>
+#include <isc/tree.h>
+
+#ifdef DEBUG
+static int debugDepth = 0;
+static char *debugFuncs[256];
+# define ENTER(proc) { \
+ debugFuncs[debugDepth] = proc; \
+ fprintf(stderr, "ENTER(%d:%s.%s)\n", \
+ debugDepth, DEBUG, \
+ debugFuncs[debugDepth]); \
+ debugDepth++; \
+ }
+# define RET(value) { \
+ debugDepth--; \
+ fprintf(stderr, "RET(%d:%s.%s)\n", \
+ debugDepth, DEBUG, \
+ debugFuncs[debugDepth]); \
+ return (value); \
+ }
+# define RETV { \
+ debugDepth--; \
+ fprintf(stderr, "RETV(%d:%s.%s)\n", \
+ debugDepth, DEBUG, \
+ debugFuncs[debugDepth]); \
+ return; \
+ }
+# define MSG(msg) fprintf(stderr, "MSG(%s)\n", msg);
+#else
+# define ENTER(proc) ;
+# define RET(value) return (value);
+# define RETV return;
+# define MSG(msg) ;
+#endif
+
+#ifndef TRUE
+# define TRUE 1
+# define FALSE 0
+#endif
+
+static tree * sprout(tree **, tree_t, int *, int (*)(), void (*)());
+static int delete(tree **, int (*)(), tree_t, void (*)(), int *, int *);
+static void del(tree **, int *, tree **, void (*)(), int *);
+static void bal_L(tree **, int *);
+static void bal_R(tree **, int *);
+
+void
+tree_init(tree **ppr_tree) {
+ ENTER("tree_init")
+ *ppr_tree = NULL;
+ RETV
+}
+
+tree_t
+tree_srch(tree **ppr_tree, int (*pfi_compare)(tree_t, tree_t), tree_t p_user) {
+ ENTER("tree_srch")
+
+ if (*ppr_tree) {
+ int i_comp = (*pfi_compare)(p_user, (**ppr_tree).data);
+
+ if (i_comp > 0)
+ RET(tree_srch(&(**ppr_tree).right,
+ pfi_compare,
+ p_user))
+
+ if (i_comp < 0)
+ RET(tree_srch(&(**ppr_tree).left,
+ pfi_compare,
+ p_user))
+
+ /* not higher, not lower... this must be the one.
+ */
+ RET((**ppr_tree).data)
+ }
+
+ /* grounded. NOT found.
+ */
+ RET(NULL)
+}
+
+tree_t
+tree_add(tree **ppr_tree, int (*pfi_compare)(tree_t, tree_t),
+ tree_t p_user, void (*pfv_uar)())
+{
+ int i_balance = FALSE;
+
+ ENTER("tree_add")
+ if (!sprout(ppr_tree, p_user, &i_balance, pfi_compare, pfv_uar))
+ RET(NULL)
+ RET(p_user)
+}
+
+int
+tree_delete(tree **ppr_p, int (*pfi_compare)(tree_t, tree_t),
+ tree_t p_user, void (*pfv_uar)())
+{
+ int i_balance = FALSE, i_uar_called = FALSE;
+
+ ENTER("tree_delete");
+ RET(delete(ppr_p, pfi_compare, p_user, pfv_uar,
+ &i_balance, &i_uar_called))
+}
+
+int
+tree_trav(tree **ppr_tree, int (*pfi_uar)(tree_t)) {
+ ENTER("tree_trav")
+
+ if (!*ppr_tree)
+ RET(TRUE)
+
+ if (!tree_trav(&(**ppr_tree).left, pfi_uar))
+ RET(FALSE)
+ if (!(*pfi_uar)((**ppr_tree).data))
+ RET(FALSE)
+ if (!tree_trav(&(**ppr_tree).right, pfi_uar))
+ RET(FALSE)
+ RET(TRUE)
+}
+
+void
+tree_mung(tree **ppr_tree, void (*pfv_uar)(tree_t)) {
+ ENTER("tree_mung")
+ if (*ppr_tree) {
+ tree_mung(&(**ppr_tree).left, pfv_uar);
+ tree_mung(&(**ppr_tree).right, pfv_uar);
+ if (pfv_uar)
+ (*pfv_uar)((**ppr_tree).data);
+ memput(*ppr_tree, sizeof(tree));
+ *ppr_tree = NULL;
+ }
+ RETV
+}
+
+static tree *
+sprout(tree **ppr, tree_t p_data, int *pi_balance,
+ int (*pfi_compare)(tree_t, tree_t), void (*pfv_delete)(tree_t))
+{
+ tree *p1, *p2, *sub;
+ int cmp;
+
+ ENTER("sprout")
+
+ /* are we grounded? if so, add the node "here" and set the rebalance
+ * flag, then exit.
+ */
+ if (!*ppr) {
+ MSG("grounded. adding new node, setting h=true")
+ *ppr = (tree *) memget(sizeof(tree));
+ if (*ppr) {
+ (*ppr)->left = NULL;
+ (*ppr)->right = NULL;
+ (*ppr)->bal = 0;
+ (*ppr)->data = p_data;
+ *pi_balance = TRUE;
+ }
+ RET(*ppr);
+ }
+
+ /* compare the data using routine passed by caller.
+ */
+ cmp = (*pfi_compare)(p_data, (*ppr)->data);
+
+ /* if LESS, prepare to move to the left.
+ */
+ if (cmp < 0) {
+ MSG("LESS. sprouting left.")
+ sub = sprout(&(*ppr)->left, p_data, pi_balance,
+ pfi_compare, pfv_delete);
+ if (sub && *pi_balance) { /*%< left branch has grown */
+ MSG("LESS: left branch has grown")
+ switch ((*ppr)->bal) {
+ case 1:
+ /* right branch WAS longer; bal is ok now */
+ MSG("LESS: case 1.. bal restored implicitly")
+ (*ppr)->bal = 0;
+ *pi_balance = FALSE;
+ break;
+ case 0:
+ /* balance WAS okay; now left branch longer */
+ MSG("LESS: case 0.. balnce bad but still ok")
+ (*ppr)->bal = -1;
+ break;
+ case -1:
+ /* left branch was already too long. rebal */
+ MSG("LESS: case -1: rebalancing")
+ p1 = (*ppr)->left;
+ if (p1->bal == -1) { /*%< LL */
+ MSG("LESS: single LL")
+ (*ppr)->left = p1->right;
+ p1->right = *ppr;
+ (*ppr)->bal = 0;
+ *ppr = p1;
+ } else { /*%< double LR */
+ MSG("LESS: double LR")
+
+ p2 = p1->right;
+ p1->right = p2->left;
+ p2->left = p1;
+
+ (*ppr)->left = p2->right;
+ p2->right = *ppr;
+
+ if (p2->bal == -1)
+ (*ppr)->bal = 1;
+ else
+ (*ppr)->bal = 0;
+
+ if (p2->bal == 1)
+ p1->bal = -1;
+ else
+ p1->bal = 0;
+ *ppr = p2;
+ } /*else*/
+ (*ppr)->bal = 0;
+ *pi_balance = FALSE;
+ } /*switch*/
+ } /*if*/
+ RET(sub)
+ } /*if*/
+
+ /* if MORE, prepare to move to the right.
+ */
+ if (cmp > 0) {
+ MSG("MORE: sprouting to the right")
+ sub = sprout(&(*ppr)->right, p_data, pi_balance,
+ pfi_compare, pfv_delete);
+ if (sub && *pi_balance) {
+ MSG("MORE: right branch has grown")
+
+ switch ((*ppr)->bal) {
+ case -1:
+ MSG("MORE: balance was off, fixed implicitly")
+ (*ppr)->bal = 0;
+ *pi_balance = FALSE;
+ break;
+ case 0:
+ MSG("MORE: balance was okay, now off but ok")
+ (*ppr)->bal = 1;
+ break;
+ case 1:
+ MSG("MORE: balance was off, need to rebalance")
+ p1 = (*ppr)->right;
+ if (p1->bal == 1) { /*%< RR */
+ MSG("MORE: single RR")
+ (*ppr)->right = p1->left;
+ p1->left = *ppr;
+ (*ppr)->bal = 0;
+ *ppr = p1;
+ } else { /*%< double RL */
+ MSG("MORE: double RL")
+
+ p2 = p1->left;
+ p1->left = p2->right;
+ p2->right = p1;
+
+ (*ppr)->right = p2->left;
+ p2->left = *ppr;
+
+ if (p2->bal == 1)
+ (*ppr)->bal = -1;
+ else
+ (*ppr)->bal = 0;
+
+ if (p2->bal == -1)
+ p1->bal = 1;
+ else
+ p1->bal = 0;
+
+ *ppr = p2;
+ } /*else*/
+ (*ppr)->bal = 0;
+ *pi_balance = FALSE;
+ } /*switch*/
+ } /*if*/
+ RET(sub)
+ } /*if*/
+
+ /* not less, not more: this is the same key! replace...
+ */
+ MSG("FOUND: Replacing data value")
+ *pi_balance = FALSE;
+ if (pfv_delete)
+ (*pfv_delete)((*ppr)->data);
+ (*ppr)->data = p_data;
+ RET(*ppr)
+}
+
+static int
+delete(tree **ppr_p, int (*pfi_compare)(tree_t, tree_t), tree_t p_user,
+ void (*pfv_uar)(tree_t), int *pi_balance, int *pi_uar_called)
+{
+ tree *pr_q;
+ int i_comp, i_ret;
+
+ ENTER("delete")
+
+ if (*ppr_p == NULL) {
+ MSG("key not in tree")
+ RET(FALSE)
+ }
+
+ i_comp = (*pfi_compare)((*ppr_p)->data, p_user);
+ if (i_comp > 0) {
+ MSG("too high - scan left")
+ i_ret = delete(&(*ppr_p)->left, pfi_compare, p_user, pfv_uar,
+ pi_balance, pi_uar_called);
+ if (*pi_balance)
+ bal_L(ppr_p, pi_balance);
+ } else if (i_comp < 0) {
+ MSG("too low - scan right")
+ i_ret = delete(&(*ppr_p)->right, pfi_compare, p_user, pfv_uar,
+ pi_balance, pi_uar_called);
+ if (*pi_balance)
+ bal_R(ppr_p, pi_balance);
+ } else {
+ MSG("equal")
+ pr_q = *ppr_p;
+ if (pr_q->right == NULL) {
+ MSG("right subtree null")
+ *ppr_p = pr_q->left;
+ *pi_balance = TRUE;
+ } else if (pr_q->left == NULL) {
+ MSG("right subtree non-null, left subtree null")
+ *ppr_p = pr_q->right;
+ *pi_balance = TRUE;
+ } else {
+ MSG("neither subtree null")
+ del(&pr_q->left, pi_balance, &pr_q,
+ pfv_uar, pi_uar_called);
+ if (*pi_balance)
+ bal_L(ppr_p, pi_balance);
+ }
+ if (!*pi_uar_called && pfv_uar)
+ (*pfv_uar)(pr_q->data);
+ /* Thanks to wuth@castrov.cuc.ab.ca for the following stmt. */
+ memput(pr_q, sizeof(tree));
+ i_ret = TRUE;
+ }
+ RET(i_ret)
+}
+
+static void
+del(tree **ppr_r, int *pi_balance, tree **ppr_q,
+ void (*pfv_uar)(tree_t), int *pi_uar_called)
+{
+ ENTER("del")
+
+ if ((*ppr_r)->right != NULL) {
+ del(&(*ppr_r)->right, pi_balance, ppr_q,
+ pfv_uar, pi_uar_called);
+ if (*pi_balance)
+ bal_R(ppr_r, pi_balance);
+ } else {
+ if (pfv_uar)
+ (*pfv_uar)((*ppr_q)->data);
+ *pi_uar_called = TRUE;
+ (*ppr_q)->data = (*ppr_r)->data;
+ *ppr_q = *ppr_r;
+ *ppr_r = (*ppr_r)->left;
+ *pi_balance = TRUE;
+ }
+
+ RETV
+}
+
+static void
+bal_L(tree **ppr_p, int *pi_balance) {
+ tree *p1, *p2;
+ int b1, b2;
+
+ ENTER("bal_L")
+ MSG("left branch has shrunk")
+
+ switch ((*ppr_p)->bal) {
+ case -1:
+ MSG("was imbalanced, fixed implicitly")
+ (*ppr_p)->bal = 0;
+ break;
+ case 0:
+ MSG("was okay, is now one off")
+ (*ppr_p)->bal = 1;
+ *pi_balance = FALSE;
+ break;
+ case 1:
+ MSG("was already off, this is too much")
+ p1 = (*ppr_p)->right;
+ b1 = p1->bal;
+ if (b1 >= 0) {
+ MSG("single RR")
+ (*ppr_p)->right = p1->left;
+ p1->left = *ppr_p;
+ if (b1 == 0) {
+ MSG("b1 == 0")
+ (*ppr_p)->bal = 1;
+ p1->bal = -1;
+ *pi_balance = FALSE;
+ } else {
+ MSG("b1 != 0")
+ (*ppr_p)->bal = 0;
+ p1->bal = 0;
+ }
+ *ppr_p = p1;
+ } else {
+ MSG("double RL")
+ p2 = p1->left;
+ b2 = p2->bal;
+ p1->left = p2->right;
+ p2->right = p1;
+ (*ppr_p)->right = p2->left;
+ p2->left = *ppr_p;
+ if (b2 == 1)
+ (*ppr_p)->bal = -1;
+ else
+ (*ppr_p)->bal = 0;
+ if (b2 == -1)
+ p1->bal = 1;
+ else
+ p1->bal = 0;
+ *ppr_p = p2;
+ p2->bal = 0;
+ }
+ }
+ RETV
+}
+
+static void
+bal_R(tree **ppr_p, int *pi_balance) {
+ tree *p1, *p2;
+ int b1, b2;
+
+ ENTER("bal_R")
+ MSG("right branch has shrunk")
+ switch ((*ppr_p)->bal) {
+ case 1:
+ MSG("was imbalanced, fixed implicitly")
+ (*ppr_p)->bal = 0;
+ break;
+ case 0:
+ MSG("was okay, is now one off")
+ (*ppr_p)->bal = -1;
+ *pi_balance = FALSE;
+ break;
+ case -1:
+ MSG("was already off, this is too much")
+ p1 = (*ppr_p)->left;
+ b1 = p1->bal;
+ if (b1 <= 0) {
+ MSG("single LL")
+ (*ppr_p)->left = p1->right;
+ p1->right = *ppr_p;
+ if (b1 == 0) {
+ MSG("b1 == 0")
+ (*ppr_p)->bal = -1;
+ p1->bal = 1;
+ *pi_balance = FALSE;
+ } else {
+ MSG("b1 != 0")
+ (*ppr_p)->bal = 0;
+ p1->bal = 0;
+ }
+ *ppr_p = p1;
+ } else {
+ MSG("double LR")
+ p2 = p1->right;
+ b2 = p2->bal;
+ p1->right = p2->left;
+ p2->left = p1;
+ (*ppr_p)->left = p2->right;
+ p2->right = *ppr_p;
+ if (b2 == -1)
+ (*ppr_p)->bal = 1;
+ else
+ (*ppr_p)->bal = 0;
+ if (b2 == 1)
+ p1->bal = -1;
+ else
+ p1->bal = 0;
+ *ppr_p = p2;
+ p2->bal = 0;
+ }
+ }
+ RETV
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/llib-lresolv_joy b/usr/src/lib/libresolv2_joy/common/llib-lresolv_joy
new file mode 100644
index 0000000000..aedd06a0fa
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/llib-lresolv_joy
@@ -0,0 +1,59 @@
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+/*
+ * Copyright (c) 1997-1999 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
+/*
+ * usr/src/lib/libresolv2 routines
+ */
+
+int dn_skipname(const uchar_t *, const uchar_t *);
+void fp_query(const u_char *, FILE *);
+const uchar_t * p_cdname(const uchar_t *, const uchar_t *, FILE *);
+const char * p_class(int);
+void p_query(const u_char *);
+const char * p_time(unsigned int);
+const char * p_type(int);
+void putlong(unsigned int, uchar_t *);
+uint32_t _getlong(const u_char *);
+uint16_t _getshort(const u_char *);
+const char * hstrerror(int);
+int res_init(void);
+int res_mkquery(int, const char *, int, int, const u_char *,
+ int, const u_char *, u_char *, int);
+int res_query(const char *, int, int, u_char *, int);
+int res_querydomain(const char *, const char *, int, int,
+ u_char *, int);
+int res_search(const char *, int, int, u_char *, int);
+int res_send(const u_char *, int, u_char *, int);
+int res_update(ns_updrec *);
+int res_ninit(res_state);
+void fp_resstat(const res_state, FILE *);
+const char * res_hostalias(const res_state, const char *, char *, size_t);
+int res_nquery(res_state, const char *, int, int, u_char *, int);
+int res_nsearch(res_state, const char *, int, int, u_char *, int);
+int res_nquerydomain(res_state, const char *, const char *,
+ int, int, u_char *, int);
+int res_nmkquery(res_state, int, const char *, int, int,
+ const u_char *, int, const u_char *,
+ u_char *, int);
+int res_nsend(res_state, const u_char *, int, u_char *, int);
+int res_nmkupdate(res_state, ns_updrec *, u_char *, int);
+void res_nclose(res_state);
+int res_nsendsigned(res_state, const u_char *, int, ns_tsig_key *,
+ u_char *, int);
+int dn_comp(const char *, u_char *, int, u_char **, u_char **);
+int dn_expand(const u_char *, const u_char *, const u_char *,
+ char *, int);
diff --git a/usr/src/lib/libresolv2_joy/common/mapfile-vers b/usr/src/lib/libresolv2_joy/common/mapfile-vers
new file mode 100644
index 0000000000..e0c66a1c96
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/mapfile-vers
@@ -0,0 +1,60 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+$mapfile_version 2
+
+SYMBOL_VERSION SUNWprivate {
+ global:
+ joy_dn_expand;
+ joy_res_nsearch;
+ joy_res_ninit;
+ joy_res_ndestroy;
+ joy_res_gethostbyaddr;
+ joy_res_gethostbyname;
+ joy_res_gethostbyname2;
+ joy_res_sethostent;
+ joy_res_endhostent;
+ __joy_res_override_retry;
+ __joy_res_unset_no_hosts_fallback;
+ __joy_res_set_no_hosts_fallback;
+ __joy_h_errno;
+ __joy_ns_get16;
+ __joy_ns_get32;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_date.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_date.c
new file mode 100644
index 0000000000..292375af63
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_date.c
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_date.c,v 1.6 2005/04/27 04:56:39 sra Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/* Forward. */
+
+static int datepart(const char *, int, int, int, int *);
+
+/* Public. */
+
+/*%
+ * Convert a date in ASCII into the number of seconds since
+ * 1 January 1970 (GMT assumed). Format is yyyymmddhhmmss, all
+ * digits required, no spaces allowed.
+ */
+
+u_int32_t
+ns_datetosecs(const char *cp, int *errp) {
+ struct tm time;
+ u_int32_t result;
+ int mdays, i;
+ static const int days_per_month[12] =
+ {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+ if (strlen(cp) != 14U) {
+ *errp = 1;
+ return (0);
+ }
+ *errp = 0;
+
+ memset(&time, 0, sizeof time);
+ time.tm_year = datepart(cp + 0, 4, 1990, 9999, errp) - 1900;
+ time.tm_mon = datepart(cp + 4, 2, 01, 12, errp) - 1;
+ time.tm_mday = datepart(cp + 6, 2, 01, 31, errp);
+ time.tm_hour = datepart(cp + 8, 2, 00, 23, errp);
+ time.tm_min = datepart(cp + 10, 2, 00, 59, errp);
+ time.tm_sec = datepart(cp + 12, 2, 00, 59, errp);
+ if (*errp) /*%< Any parse errors? */
+ return (0);
+
+ /*
+ * OK, now because timegm() is not available in all environments,
+ * we will do it by hand. Roll up sleeves, curse the gods, begin!
+ */
+
+#define SECS_PER_DAY ((u_int32_t)24*60*60)
+#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
+
+ result = time.tm_sec; /*%< Seconds */
+ result += time.tm_min * 60; /*%< Minutes */
+ result += time.tm_hour * (60*60); /*%< Hours */
+ result += (time.tm_mday - 1) * SECS_PER_DAY; /*%< Days */
+ /* Months are trickier. Look without leaping, then leap */
+ mdays = 0;
+ for (i = 0; i < time.tm_mon; i++)
+ mdays += days_per_month[i];
+ result += mdays * SECS_PER_DAY; /*%< Months */
+ if (time.tm_mon > 1 && isleap(1900+time.tm_year))
+ result += SECS_PER_DAY; /*%< Add leapday for this year */
+ /* First figure years without leapdays, then add them in. */
+ /* The loop is slow, FIXME, but simple and accurate. */
+ result += (time.tm_year - 70) * (SECS_PER_DAY*365); /*%< Years */
+ for (i = 70; i < time.tm_year; i++)
+ if (isleap(1900+i))
+ result += SECS_PER_DAY; /*%< Add leapday for prev year */
+ return (result);
+}
+
+/* Private. */
+
+/*%
+ * Parse part of a date. Set error flag if any error.
+ * Don't reset the flag if there is no error.
+ */
+static int
+datepart(const char *buf, int size, int min, int max, int *errp) {
+ int result = 0;
+ int i;
+
+ for (i = 0; i < size; i++) {
+ if (!isdigit((unsigned char)(buf[i])))
+ *errp = 1;
+ result = (result * 10) + buf[i] - '0';
+ }
+ if (result < min)
+ *errp = 1;
+ if (result > max)
+ *errp = 1;
+ return (result);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_name.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_name.c
new file mode 100644
index 0000000000..f6b0accef1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_name.c
@@ -0,0 +1,1153 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_name.c,v 1.11 2009/01/23 19:59:16 each Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <limits.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+#define NS_TYPE_ELT 0x40 /*%< EDNS0 extended label type */
+#define DNS_LABELTYPE_BITSTRING 0x41
+
+/* Data. */
+
+static const char digits[] = "0123456789";
+
+static const char digitvalue[256] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*16*/
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*32*/
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*48*/
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /*64*/
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*80*/
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*96*/
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*112*/
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*128*/
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*256*/
+};
+
+/* Forward. */
+
+static int special(int);
+static int printable(int);
+static int dn_find(const u_char *, const u_char *,
+ const u_char * const *,
+ const u_char * const *);
+static int encode_bitsring(const char **, const char *,
+ unsigned char **, unsigned char **,
+ unsigned const char *);
+static int labellen(const u_char *);
+static int decode_bitstring(const unsigned char **,
+ char *, const char *);
+
+/* Public. */
+
+/*%
+ * Convert an encoded domain name to printable ascii as per RFC1035.
+
+ * return:
+ *\li Number of bytes written to buffer, or -1 (with errno set)
+ *
+ * notes:
+ *\li The root is returned as "."
+ *\li All other domains are returned in non absolute form
+ */
+int
+ns_name_ntop(const u_char *src, char *dst, size_t dstsiz)
+{
+ const u_char *cp;
+ char *dn, *eom;
+ u_char c;
+ u_int n;
+ int l;
+
+ cp = src;
+ dn = dst;
+ eom = dst + dstsiz;
+
+ while ((n = *cp++) != 0) {
+ if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
+ /* Some kind of compression pointer. */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (dn != dst) {
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = '.';
+ }
+ if ((l = labellen(cp - 1)) < 0) {
+ errno = EMSGSIZE; /*%< XXX */
+ return (-1);
+ }
+ if (dn + l >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if ((n & NS_CMPRSFLGS) == NS_TYPE_ELT) {
+ int m;
+
+ if (n != DNS_LABELTYPE_BITSTRING) {
+ /* XXX: labellen should reject this case */
+ errno = EINVAL;
+ return (-1);
+ }
+ if ((m = decode_bitstring(&cp, dn, eom)) < 0)
+ {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ dn += m;
+ continue;
+ }
+ for ((void)NULL; l > 0; l--) {
+ c = *cp++;
+ if (special(c)) {
+ if (dn + 1 >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = '\\';
+ *dn++ = (char)c;
+ } else if (!printable(c)) {
+ if (dn + 3 >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = '\\';
+ *dn++ = digits[c / 100];
+ *dn++ = digits[(c % 100) / 10];
+ *dn++ = digits[c % 10];
+ } else {
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = (char)c;
+ }
+ }
+ }
+ if (dn == dst) {
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = '.';
+ }
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = '\0';
+ return (dn - dst);
+}
+
+/*%
+ * Convert a ascii string into an encoded domain name as per RFC1035.
+ *
+ * return:
+ *
+ *\li -1 if it fails
+ *\li 1 if string was fully qualified
+ *\li 0 is string was not fully qualified
+ *
+ * notes:
+ *\li Enforces label and domain length limits.
+ */
+int
+ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
+ return (ns_name_pton2(src, dst, dstsiz, NULL));
+}
+
+/*
+ * ns_name_pton2(src, dst, dstsiz, *dstlen)
+ * Convert a ascii string into an encoded domain name as per RFC1035.
+ * return:
+ * -1 if it fails
+ * 1 if string was fully qualified
+ * 0 is string was not fully qualified
+ * side effects:
+ * fills in *dstlen (if non-NULL)
+ * notes:
+ * Enforces label and domain length limits.
+ */
+int
+ns_name_pton2(const char *src, u_char *dst, size_t dstsiz, size_t *dstlen) {
+ u_char *label, *bp, *eom;
+ int c, n, escaped, e = 0;
+ char *cp;
+
+ escaped = 0;
+ bp = dst;
+ eom = dst + dstsiz;
+ label = bp++;
+
+ while ((c = *src++) != 0) {
+ if (escaped) {
+ if (c == '[') { /*%< start a bit string label */
+ if ((cp = strchr(src, ']')) == NULL) {
+ errno = EINVAL; /*%< ??? */
+ return (-1);
+ }
+ if ((e = encode_bitsring(&src, cp + 2,
+ &label, &bp, eom))
+ != 0) {
+ errno = e;
+ return (-1);
+ }
+ escaped = 0;
+ label = bp++;
+ if ((c = *src++) == 0)
+ goto done;
+ else if (c != '.') {
+ errno = EINVAL;
+ return (-1);
+ }
+ continue;
+ }
+ else if ((cp = strchr(digits, c)) != NULL) {
+ n = (cp - digits) * 100;
+ if ((c = *src++) == 0 ||
+ (cp = strchr(digits, c)) == NULL) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ n += (cp - digits) * 10;
+ if ((c = *src++) == 0 ||
+ (cp = strchr(digits, c)) == NULL) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ n += (cp - digits);
+ if (n > 255) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ c = n;
+ }
+ escaped = 0;
+ } else if (c == '\\') {
+ escaped = 1;
+ continue;
+ } else if (c == '.') {
+ c = (bp - label - 1);
+ if ((c & NS_CMPRSFLGS) != 0) { /*%< Label too big. */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (label >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *label = c;
+ /* Fully qualified ? */
+ if (*src == '\0') {
+ if (c != 0) {
+ if (bp >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *bp++ = '\0';
+ }
+ if ((bp - dst) > MAXCDNAME) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (dstlen != NULL)
+ *dstlen = (bp - dst);
+ return (1);
+ }
+ if (c == 0 || *src == '.') {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ label = bp++;
+ continue;
+ }
+ if (bp >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *bp++ = (u_char)c;
+ }
+ c = (bp - label - 1);
+ if ((c & NS_CMPRSFLGS) != 0) { /*%< Label too big. */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ done:
+ if (label >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *label = c;
+ if (c != 0) {
+ if (bp >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *bp++ = 0;
+ }
+ if ((bp - dst) > MAXCDNAME) { /*%< src too big */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (dstlen != NULL)
+ *dstlen = (bp - dst);
+ return (0);
+}
+
+/*%
+ * Convert a network strings labels into all lowercase.
+ *
+ * return:
+ *\li Number of bytes written to buffer, or -1 (with errno set)
+ *
+ * notes:
+ *\li Enforces label and domain length limits.
+ */
+
+int
+ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz)
+{
+ const u_char *cp;
+ u_char *dn, *eom;
+ u_char c;
+ u_int n;
+ int l;
+
+ cp = src;
+ dn = dst;
+ eom = dst + dstsiz;
+
+ if (dn >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ while ((n = *cp++) != 0) {
+ if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
+ /* Some kind of compression pointer. */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *dn++ = n;
+ if ((l = labellen(cp - 1)) < 0) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (dn + l >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ for ((void)NULL; l > 0; l--) {
+ c = *cp++;
+ if (isascii(c) && isupper(c))
+ *dn++ = tolower(c);
+ else
+ *dn++ = c;
+ }
+ }
+ *dn++ = '\0';
+ return (dn - dst);
+}
+
+/*%
+ * Unpack a domain name from a message, source may be compressed.
+ *
+ * return:
+ *\li -1 if it fails, or consumed octets if it succeeds.
+ */
+int
+ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
+ u_char *dst, size_t dstsiz)
+{
+ return (ns_name_unpack2(msg, eom, src, dst, dstsiz, NULL));
+}
+
+/*
+ * ns_name_unpack2(msg, eom, src, dst, dstsiz, *dstlen)
+ * Unpack a domain name from a message, source may be compressed.
+ * return:
+ * -1 if it fails, or consumed octets if it succeeds.
+ * side effect:
+ * fills in *dstlen (if non-NULL).
+ */
+int
+ns_name_unpack2(const u_char *msg, const u_char *eom, const u_char *src,
+ u_char *dst, size_t dstsiz, size_t *dstlen)
+{
+ const u_char *srcp, *dstlim;
+ u_char *dstp;
+ int n, len, checked, l;
+
+ len = -1;
+ checked = 0;
+ dstp = dst;
+ srcp = src;
+ dstlim = dst + dstsiz;
+ if (srcp < msg || srcp >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ /* Fetch next label in domain name. */
+ while ((n = *srcp++) != 0) {
+ /* Check for indirection. */
+ switch (n & NS_CMPRSFLGS) {
+ case 0:
+ case NS_TYPE_ELT:
+ /* Limit checks. */
+ if ((l = labellen(srcp - 1)) < 0) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (dstp + l + 1 >= dstlim || srcp + l >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ checked += l + 1;
+ *dstp++ = n;
+ memcpy(dstp, srcp, l);
+ dstp += l;
+ srcp += l;
+ break;
+
+ case NS_CMPRSFLGS:
+ if (srcp >= eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (len < 0)
+ len = srcp - src + 1;
+ srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
+ if (srcp < msg || srcp >= eom) { /*%< Out of range. */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ checked += 2;
+ /*
+ * Check for loops in the compressed name;
+ * if we've looked at the whole message,
+ * there must be a loop.
+ */
+ if (checked >= eom - msg) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ break;
+
+ default:
+ errno = EMSGSIZE;
+ return (-1); /*%< flag error */
+ }
+ }
+ *dstp++ = 0;
+ if (dstlen != NULL)
+ *dstlen = dstp - dst;
+ if (len < 0)
+ len = srcp - src;
+ return (len);
+}
+
+/*%
+ * Pack domain name 'domain' into 'comp_dn'.
+ *
+ * return:
+ *\li Size of the compressed name, or -1.
+ *
+ * notes:
+ *\li 'dnptrs' is an array of pointers to previous compressed names.
+ *\li dnptrs[0] is a pointer to the beginning of the message. The array
+ * ends with NULL.
+ *\li 'lastdnptr' is a pointer to the end of the array pointed to
+ * by 'dnptrs'.
+ *
+ * Side effects:
+ *\li The list of pointers in dnptrs is updated for labels inserted into
+ * the message as we compress the name. If 'dnptr' is NULL, we don't
+ * try to compress names. If 'lastdnptr' is NULL, we don't update the
+ * list.
+ */
+int
+ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
+ const u_char **dnptrs, const u_char **lastdnptr)
+{
+ u_char *dstp;
+ const u_char **cpp, **lpp, *eob, *msg;
+ const u_char *srcp;
+ int n, l, first = 1;
+
+ srcp = src;
+ dstp = dst;
+ eob = dstp + dstsiz;
+ lpp = cpp = NULL;
+ if (dnptrs != NULL) {
+ if ((msg = *dnptrs++) != NULL) {
+ for (cpp = dnptrs; *cpp != NULL; cpp++)
+ (void)NULL;
+ lpp = cpp; /*%< end of list to search */
+ }
+ } else
+ msg = NULL;
+
+ /* make sure the domain we are about to add is legal */
+ l = 0;
+ do {
+ int l0;
+
+ n = *srcp;
+ if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if ((l0 = labellen(srcp)) < 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ l += l0 + 1;
+ if (l > MAXCDNAME) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ srcp += l0 + 1;
+ } while (n != 0);
+
+ /* from here on we need to reset compression pointer array on error */
+ srcp = src;
+ do {
+ /* Look to see if we can use pointers. */
+ n = *srcp;
+ if (n != 0 && msg != NULL) {
+ l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
+ (const u_char * const *)lpp);
+ if (l >= 0) {
+ if (dstp + 1 >= eob) {
+ goto cleanup;
+ }
+ *dstp++ = (l >> 8) | NS_CMPRSFLGS;
+ *dstp++ = l % 256;
+ return (dstp - dst);
+ }
+ /* Not found, save it. */
+ if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
+ (dstp - msg) < 0x4000 && first) {
+ *cpp++ = dstp;
+ *cpp = NULL;
+ first = 0;
+ }
+ }
+ /* copy label to buffer */
+ if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
+ /* Should not happen. */
+ goto cleanup;
+ }
+ n = labellen(srcp);
+ if (dstp + 1 + n >= eob) {
+ goto cleanup;
+ }
+ memcpy(dstp, srcp, n + 1);
+ srcp += n + 1;
+ dstp += n + 1;
+ } while (n != 0);
+
+ if (dstp > eob) {
+cleanup:
+ if (msg != NULL)
+ *lpp = NULL;
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ return (dstp - dst);
+}
+
+/*%
+ * Expand compressed domain name to presentation format.
+ *
+ * return:
+ *\li Number of bytes read out of `src', or -1 (with errno set).
+ *
+ * note:
+ *\li Root domain returns as "." not "".
+ */
+int
+ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
+ char *dst, size_t dstsiz)
+{
+ u_char tmp[NS_MAXCDNAME];
+ int n;
+
+ if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
+ return (-1);
+ if (ns_name_ntop(tmp, dst, dstsiz) == -1)
+ return (-1);
+ return (n);
+}
+
+/*%
+ * Compress a domain name into wire format, using compression pointers.
+ *
+ * return:
+ *\li Number of bytes consumed in `dst' or -1 (with errno set).
+ *
+ * notes:
+ *\li 'dnptrs' is an array of pointers to previous compressed names.
+ *\li dnptrs[0] is a pointer to the beginning of the message.
+ *\li The list ends with NULL. 'lastdnptr' is a pointer to the end of the
+ * array pointed to by 'dnptrs'. Side effect is to update the list of
+ * pointers for labels inserted into the message as we compress the name.
+ *\li If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
+ * is NULL, we don't update the list.
+ */
+int
+ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
+ const u_char **dnptrs, const u_char **lastdnptr)
+{
+ u_char tmp[NS_MAXCDNAME];
+
+ if (ns_name_pton(src, tmp, sizeof tmp) == -1)
+ return (-1);
+ return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
+}
+
+/*%
+ * Reset dnptrs so that there are no active references to pointers at or
+ * after src.
+ */
+void
+ns_name_rollback(const u_char *src, const u_char **dnptrs,
+ const u_char **lastdnptr)
+{
+ while (dnptrs < lastdnptr && *dnptrs != NULL) {
+ if (*dnptrs >= src) {
+ *dnptrs = NULL;
+ break;
+ }
+ dnptrs++;
+ }
+}
+
+/*%
+ * Advance *ptrptr to skip over the compressed name it points at.
+ *
+ * return:
+ *\li 0 on success, -1 (with errno set) on failure.
+ */
+int
+ns_name_skip(const u_char **ptrptr, const u_char *eom)
+{
+ const u_char *cp;
+ u_int n;
+ int l;
+
+ cp = *ptrptr;
+ while (cp < eom && (n = *cp++) != 0) {
+ /* Check for indirection. */
+ switch (n & NS_CMPRSFLGS) {
+ case 0: /*%< normal case, n == len */
+ cp += n;
+ continue;
+ case NS_TYPE_ELT: /*%< EDNS0 extended label */
+ if ((l = labellen(cp - 1)) < 0) {
+ errno = EMSGSIZE; /*%< XXX */
+ return (-1);
+ }
+ cp += l;
+ continue;
+ case NS_CMPRSFLGS: /*%< indirection */
+ cp++;
+ break;
+ default: /*%< illegal type */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ break;
+ }
+ if (cp > eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *ptrptr = cp;
+ return (0);
+}
+
+/* Find the number of octets an nname takes up, including the root label.
+ * (This is basically ns_name_skip() without compression-pointer support.)
+ * ((NOTE: can only return zero if passed-in namesiz argument is zero.))
+ */
+ssize_t
+ns_name_length(ns_nname_ct nname, size_t namesiz) {
+ ns_nname_ct orig = nname;
+ u_int n;
+
+ while (namesiz-- > 0 && (n = *nname++) != 0) {
+ if ((n & NS_CMPRSFLGS) != 0) {
+ errno = EISDIR;
+ return (-1);
+ }
+ if (n > namesiz) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ nname += n;
+ namesiz -= n;
+ }
+ return (nname - orig);
+}
+
+/* Compare two nname's for equality. Return -1 on error (setting errno).
+ */
+int
+ns_name_eq(ns_nname_ct a, size_t as, ns_nname_ct b, size_t bs) {
+ ns_nname_ct ae = a + as, be = b + bs;
+ int ac, bc;
+
+ while (ac = *a, bc = *b, ac != 0 && bc != 0) {
+ if ((ac & NS_CMPRSFLGS) != 0 || (bc & NS_CMPRSFLGS) != 0) {
+ errno = EISDIR;
+ return (-1);
+ }
+ if (a + ac >= ae || b + bc >= be) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (ac != bc || strncasecmp((const char *) ++a,
+ (const char *) ++b, ac) != 0)
+ return (0);
+ a += ac, b += bc;
+ }
+ return (ac == 0 && bc == 0);
+}
+
+/* Is domain "A" owned by (at or below) domain "B"?
+ */
+int
+ns_name_owned(ns_namemap_ct a, int an, ns_namemap_ct b, int bn) {
+ /* If A is shorter, it cannot be owned by B. */
+ if (an < bn)
+ return (0);
+
+ /* If they are unequal before the length of the shorter, A cannot... */
+ while (bn > 0) {
+ if (a->len != b->len ||
+ strncasecmp((const char *) a->base,
+ (const char *) b->base, a->len) != 0)
+ return (0);
+ a++, an--;
+ b++, bn--;
+ }
+
+ /* A might be longer or not, but either way, B owns it. */
+ return (1);
+}
+
+/* Build an array of <base,len> tuples from an nname, top-down order.
+ * Return the number of tuples (labels) thus discovered.
+ */
+int
+ns_name_map(ns_nname_ct nname, size_t namelen, ns_namemap_t map, int mapsize) {
+ u_int n;
+ int l;
+
+ n = *nname++;
+ namelen--;
+
+ /* Root zone? */
+ if (n == 0) {
+ /* Extra data follows name? */
+ if (namelen > 0) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ return (0);
+ }
+
+ /* Compression pointer? */
+ if ((n & NS_CMPRSFLGS) != 0) {
+ errno = EISDIR;
+ return (-1);
+ }
+
+ /* Label too long? */
+ if (n > namelen) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+
+ /* Recurse to get rest of name done first. */
+ l = ns_name_map(nname + n, namelen - n, map, mapsize);
+ if (l < 0)
+ return (-1);
+
+ /* Too many labels? */
+ if (l >= mapsize) {
+ errno = ENAMETOOLONG;
+ return (-1);
+ }
+
+ /* We're on our way back up-stack, store current map data. */
+ map[l].base = nname;
+ map[l].len = n;
+ return (l + 1);
+}
+
+/* Count the labels in a domain name. Root counts, so COM. has two. This
+ * is to make the result comparable to the result of ns_name_map().
+ */
+int
+ns_name_labels(ns_nname_ct nname, size_t namesiz) {
+ int ret = 0;
+ u_int n;
+
+ while (namesiz-- > 0 && (n = *nname++) != 0) {
+ if ((n & NS_CMPRSFLGS) != 0) {
+ errno = EISDIR;
+ return (-1);
+ }
+ if (n > namesiz) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ nname += n;
+ namesiz -= n;
+ ret++;
+ }
+ return (ret + 1);
+}
+
+/* Private. */
+
+/*%
+ * Thinking in noninternationalized USASCII (per the DNS spec),
+ * is this characted special ("in need of quoting") ?
+ *
+ * return:
+ *\li boolean.
+ */
+static int
+special(int ch) {
+ switch (ch) {
+ case 0x22: /*%< '"' */
+ case 0x2E: /*%< '.' */
+ case 0x3B: /*%< ';' */
+ case 0x5C: /*%< '\\' */
+ case 0x28: /*%< '(' */
+ case 0x29: /*%< ')' */
+ /* Special modifiers in zone files. */
+ case 0x40: /*%< '@' */
+ case 0x24: /*%< '$' */
+ return (1);
+ default:
+ return (0);
+ }
+}
+
+/*%
+ * Thinking in noninternationalized USASCII (per the DNS spec),
+ * is this character visible and not a space when printed ?
+ *
+ * return:
+ *\li boolean.
+ */
+static int
+printable(int ch) {
+ return (ch > 0x20 && ch < 0x7f);
+}
+
+/*%
+ * Thinking in noninternationalized USASCII (per the DNS spec),
+ * convert this character to lower case if it's upper case.
+ */
+static int
+mklower(int ch) {
+ if (ch >= 0x41 && ch <= 0x5A)
+ return (ch + 0x20);
+ return (ch);
+}
+
+/*%
+ * Search for the counted-label name in an array of compressed names.
+ *
+ * return:
+ *\li offset from msg if found, or -1.
+ *
+ * notes:
+ *\li dnptrs is the pointer to the first name on the list,
+ *\li not the pointer to the start of the message.
+ */
+static int
+dn_find(const u_char *domain, const u_char *msg,
+ const u_char * const *dnptrs,
+ const u_char * const *lastdnptr)
+{
+ const u_char *dn, *cp, *sp;
+ const u_char * const *cpp;
+ u_int n;
+
+ for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
+ sp = *cpp;
+ /*
+ * terminate search on:
+ * root label
+ * compression pointer
+ * unusable offset
+ */
+ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 &&
+ (sp - msg) < 0x4000) {
+ dn = domain;
+ cp = sp;
+ while ((n = *cp++) != 0) {
+ /*
+ * check for indirection
+ */
+ switch (n & NS_CMPRSFLGS) {
+ case 0: /*%< normal case, n == len */
+ n = labellen(cp - 1); /*%< XXX */
+ if (n != *dn++)
+ goto next;
+
+ for ((void)NULL; n > 0; n--)
+ if (mklower(*dn++) !=
+ mklower(*cp++))
+ goto next;
+ /* Is next root for both ? */
+ if (*dn == '\0' && *cp == '\0')
+ return (sp - msg);
+ if (*dn)
+ continue;
+ goto next;
+ case NS_CMPRSFLGS: /*%< indirection */
+ cp = msg + (((n & 0x3f) << 8) | *cp);
+ break;
+
+ default: /*%< illegal type */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ }
+ next: ;
+ sp += *sp + 1;
+ }
+ }
+ errno = ENOENT;
+ return (-1);
+}
+
+static int
+decode_bitstring(const unsigned char **cpp, char *dn, const char *eom)
+{
+ const unsigned char *cp = *cpp;
+ char *beg = dn, tc;
+ int b, blen, plen, i;
+
+ if ((blen = (*cp & 0xff)) == 0)
+ blen = 256;
+ plen = (blen + 3) / 4;
+ plen += sizeof("\\[x/]") + (blen > 99 ? 3 : (blen > 9) ? 2 : 1);
+ if (dn + plen >= eom)
+ return (-1);
+
+ cp++;
+ i = SPRINTF((dn, "\\[x"));
+ if (i < 0)
+ return (-1);
+ dn += i;
+ for (b = blen; b > 7; b -= 8, cp++) {
+ i = SPRINTF((dn, "%02x", *cp & 0xff));
+ if (i < 0)
+ return (-1);
+ dn += i;
+ }
+ if (b > 4) {
+ tc = *cp++;
+ i = SPRINTF((dn, "%02x", tc & (0xff << (8 - b))));
+ if (i < 0)
+ return (-1);
+ dn += i;
+ } else if (b > 0) {
+ tc = *cp++;
+ i = SPRINTF((dn, "%1x",
+ ((tc >> 4) & 0x0f) & (0x0f << (4 - b))));
+ if (i < 0)
+ return (-1);
+ dn += i;
+ }
+ i = SPRINTF((dn, "/%d]", blen));
+ if (i < 0)
+ return (-1);
+ dn += i;
+
+ *cpp = cp;
+ return (dn - beg);
+}
+
+static int
+encode_bitsring(const char **bp, const char *end, unsigned char **labelp,
+ unsigned char ** dst, unsigned const char *eom)
+{
+ int afterslash = 0;
+ const char *cp = *bp;
+ unsigned char *tp;
+ char c;
+ const char *beg_blen;
+ char *end_blen = NULL;
+ int value = 0, count = 0, tbcount = 0, blen = 0;
+
+ beg_blen = end_blen = NULL;
+
+ /* a bitstring must contain at least 2 characters */
+ if (end - cp < 2)
+ return (EINVAL);
+
+ /* XXX: currently, only hex strings are supported */
+ if (*cp++ != 'x')
+ return (EINVAL);
+ if (!isxdigit((*cp) & 0xff)) /*%< reject '\[x/BLEN]' */
+ return (EINVAL);
+
+ for (tp = *dst + 1; cp < end && tp < eom; cp++) {
+ switch((c = *cp)) {
+ case ']': /*%< end of the bitstring */
+ if (afterslash) {
+ if (beg_blen == NULL)
+ return (EINVAL);
+ blen = (int)strtol(beg_blen, &end_blen, 10);
+ if (*end_blen != ']')
+ return (EINVAL);
+ }
+ if (count)
+ *tp++ = ((value << 4) & 0xff);
+ cp++; /*%< skip ']' */
+ goto done;
+ case '/':
+ afterslash = 1;
+ break;
+ default:
+ if (afterslash) {
+ if (!isdigit(c&0xff))
+ return (EINVAL);
+ if (beg_blen == NULL) {
+
+ if (c == '0') {
+ /* blen never begings with 0 */
+ return (EINVAL);
+ }
+ beg_blen = cp;
+ }
+ } else {
+ if (!isxdigit(c&0xff))
+ return (EINVAL);
+ value <<= 4;
+ value += digitvalue[(int)c];
+ count += 4;
+ tbcount += 4;
+ if (tbcount > 256)
+ return (EINVAL);
+ if (count == 8) {
+ *tp++ = value;
+ count = 0;
+ }
+ }
+ break;
+ }
+ }
+ done:
+ if (cp >= end || tp >= eom)
+ return (EMSGSIZE);
+
+ /*
+ * bit length validation:
+ * If a <length> is present, the number of digits in the <bit-data>
+ * MUST be just sufficient to contain the number of bits specified
+ * by the <length>. If there are insignificant bits in a final
+ * hexadecimal or octal digit, they MUST be zero.
+ * RFC2673, Section 3.2.
+ */
+ if (blen > 0) {
+ int traillen;
+
+ if (((blen + 3) & ~3) != tbcount)
+ return (EINVAL);
+ traillen = tbcount - blen; /*%< between 0 and 3 */
+ if (((value << (8 - traillen)) & 0xff) != 0)
+ return (EINVAL);
+ }
+ else
+ blen = tbcount;
+ if (blen == 256)
+ blen = 0;
+
+ /* encode the type and the significant bit fields */
+ **labelp = DNS_LABELTYPE_BITSTRING;
+ **dst = blen;
+
+ *bp = cp;
+ *dst = tp;
+
+ return (0);
+}
+
+static int
+labellen(const u_char *lp)
+{
+ int bitlen;
+ u_char l = *lp;
+
+ if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
+ /* should be avoided by the caller */
+ return (-1);
+ }
+
+ if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) {
+ if (l == DNS_LABELTYPE_BITSTRING) {
+ if ((bitlen = *(lp + 1)) == 0)
+ bitlen = 256;
+ return ((bitlen + 7 ) / 8 + 1);
+ }
+ return (-1); /*%< unknwon ELT */
+ }
+ return (l);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_netint.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_netint.c
new file mode 100644
index 0000000000..e196217f9b
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_netint.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_netint.c,v 1.3 2005/04/27 04:56:40 sra Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+
+#include <arpa/nameser.h>
+
+#include "port_after.h"
+
+#pragma redefine_extname __ns_get16 __joy_ns_get16
+#pragma redefine_extname __ns_get32 __joy_ns_get32
+
+/* Public. */
+
+u_int
+ns_get16(const u_char *src) {
+ u_int dst;
+
+ NS_GET16(dst, src);
+ return (dst);
+}
+
+u_long
+ns_get32(const u_char *src) {
+ u_long dst;
+
+ NS_GET32(dst, src);
+ return (dst);
+}
+
+void
+ns_put16(u_int src, u_char *dst) {
+ NS_PUT16(src, dst);
+}
+
+void
+ns_put32(u_long src, u_char *dst) {
+ NS_PUT32(src, dst);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_newmsg.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_newmsg.c
new file mode 100644
index 0000000000..c18dd060e1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_newmsg.c
@@ -0,0 +1,273 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_newmsg.c,v 1.3 2009/02/26 10:48:57 marka Exp $";
+#endif
+
+#include <port_before.h>
+
+#include <arpa/nameser.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <string.h>
+
+#include <port_after.h>
+
+static int rdcpy(ns_newmsg *, ns_type, const u_char *, size_t);
+
+/* Initialize a "newmsg" object to empty.
+ */
+int
+ns_newmsg_init(u_char *buffer, size_t bufsiz, ns_newmsg *handle) {
+ ns_msg *msg = &handle->msg;
+
+ memset(handle, 0, sizeof *handle);
+ msg->_msg = buffer;
+ msg->_eom = buffer + bufsiz;
+ msg->_sect = ns_s_qd;
+ msg->_rrnum = 0;
+ msg->_msg_ptr = buffer + NS_HFIXEDSZ;
+ handle->dnptrs[0] = msg->_msg;
+ handle->dnptrs[1] = NULL;
+ handle->lastdnptr = &handle->dnptrs[sizeof handle->dnptrs /
+ sizeof handle->dnptrs[0] - 1];
+ return (0);
+}
+
+/* Initialize a "newmsg" object by copying an existing parsed message.
+ */
+int
+ns_newmsg_copy(ns_newmsg *handle, ns_msg *msg) {
+ ns_flag flag;
+ ns_sect sect;
+
+ ns_newmsg_id(handle, ns_msg_id(*msg));
+ for (flag = ns_f_qr; flag < ns_f_max; flag++)
+ ns_newmsg_flag(handle, flag, ns_msg_getflag(*msg, flag));
+ for (sect = ns_s_qd; sect < ns_s_max; sect++) {
+ int i, count;
+
+ count = ns_msg_count(*msg, sect);
+ for (i = 0; i < count; i++) {
+ ns_rr2 rr;
+ int x;
+
+ if (ns_parserr2(msg, sect, i, &rr) < 0)
+ return (-1);
+ if (sect == ns_s_qd)
+ x = ns_newmsg_q(handle,
+ ns_rr_nname(rr),
+ ns_rr_type(rr),
+ ns_rr_class(rr));
+ else
+ x = ns_newmsg_rr(handle, sect,
+ ns_rr_nname(rr),
+ ns_rr_type(rr),
+ ns_rr_class(rr),
+ ns_rr_ttl(rr),
+ ns_rr_rdlen(rr),
+ ns_rr_rdata(rr));
+ if (x < 0)
+ return (-1);
+ }
+ }
+ return (0);
+}
+
+/* Set the message-ID in a "newmsg" object.
+ */
+void
+ns_newmsg_id(ns_newmsg *handle, u_int16_t id) {
+ ns_msg *msg = &handle->msg;
+
+ msg->_id = id;
+}
+
+/* Set a flag (including rcode or opcode) in a "newmsg" object.
+ */
+void
+ns_newmsg_flag(ns_newmsg *handle, ns_flag flag, u_int value) {
+ extern struct _ns_flagdata _ns_flagdata[16];
+ struct _ns_flagdata *fd = &_ns_flagdata[flag];
+ ns_msg *msg = &handle->msg;
+
+ assert(flag < ns_f_max);
+ msg->_flags &= (~fd->mask);
+ msg->_flags |= (value << fd->shift);
+}
+
+/* Add a question (or zone, if it's an update) to a "newmsg" object.
+ */
+int
+ns_newmsg_q(ns_newmsg *handle, ns_nname_ct qname,
+ ns_type qtype, ns_class qclass)
+{
+ ns_msg *msg = &handle->msg;
+ u_char *t;
+ int n;
+
+ if (msg->_sect != ns_s_qd) {
+ errno = ENODEV;
+ return (-1);
+ }
+ t = (u_char *) (unsigned long) msg->_msg_ptr;
+ if (msg->_rrnum == 0)
+ msg->_sections[ns_s_qd] = t;
+ n = ns_name_pack(qname, t, msg->_eom - t,
+ handle->dnptrs, handle->lastdnptr);
+ if (n < 0)
+ return (-1);
+ t += n;
+ if (t + QFIXEDSZ >= msg->_eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ NS_PUT16(qtype, t);
+ NS_PUT16(qclass, t);
+ msg->_msg_ptr = t;
+ msg->_counts[ns_s_qd] = ++msg->_rrnum;
+ return (0);
+}
+
+/* Add an RR to a "newmsg" object.
+ */
+int
+ns_newmsg_rr(ns_newmsg *handle, ns_sect sect,
+ ns_nname_ct name, ns_type type,
+ ns_class rr_class, u_int32_t ttl,
+ u_int16_t rdlen, const u_char *rdata)
+{
+ ns_msg *msg = &handle->msg;
+ u_char *t;
+ int n;
+
+ if (sect < msg->_sect) {
+ errno = ENODEV;
+ return (-1);
+ }
+ t = (u_char *) (unsigned long) msg->_msg_ptr;
+ if (sect > msg->_sect) {
+ msg->_sect = sect;
+ msg->_sections[sect] = t;
+ msg->_rrnum = 0;
+ }
+ n = ns_name_pack(name, t, msg->_eom - t,
+ handle->dnptrs, handle->lastdnptr);
+ if (n < 0)
+ return (-1);
+ t += n;
+ if (t + RRFIXEDSZ + rdlen >= msg->_eom) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ NS_PUT16(type, t);
+ NS_PUT16(rr_class, t);
+ NS_PUT32(ttl, t);
+ msg->_msg_ptr = t;
+ if (rdcpy(handle, type, rdata, rdlen) < 0)
+ return (-1);
+ msg->_counts[sect] = ++msg->_rrnum;
+ return (0);
+}
+
+/* Complete a "newmsg" object and return its size for use in write().
+ * (Note: the "newmsg" object is also made ready for ns_parserr() etc.)
+ */
+size_t
+ns_newmsg_done(ns_newmsg *handle) {
+ ns_msg *msg = &handle->msg;
+ ns_sect sect;
+ u_char *t;
+
+ t = (u_char *) (unsigned long) msg->_msg;
+ NS_PUT16(msg->_id, t);
+ NS_PUT16(msg->_flags, t);
+ for (sect = 0; sect < ns_s_max; sect++)
+ NS_PUT16(msg->_counts[sect], t);
+ msg->_eom = msg->_msg_ptr;
+ msg->_sect = ns_s_max;
+ msg->_rrnum = -1;
+ msg->_msg_ptr = NULL;
+ return (msg->_eom - msg->_msg);
+}
+
+/* Private. */
+
+/* Copy an RDATA, using compression pointers where RFC1035 permits.
+ */
+static int
+rdcpy(ns_newmsg *handle, ns_type type, const u_char *rdata, size_t rdlen) {
+ ns_msg *msg = &handle->msg;
+ u_char *p = (u_char *) (unsigned long) msg->_msg_ptr;
+ u_char *t = p + NS_INT16SZ;
+ u_char *s = t;
+ int n;
+
+ switch (type) {
+ case ns_t_soa:
+ /* MNAME. */
+ n = ns_name_pack(rdata, t, msg->_eom - t,
+ handle->dnptrs, handle->lastdnptr);
+ if (n < 0)
+ return (-1);
+ t += n;
+ if (ns_name_skip(&rdata, msg->_eom) < 0)
+ return (-1);
+
+ /* ANAME. */
+ n = ns_name_pack(rdata, t, msg->_eom - t,
+ handle->dnptrs, handle->lastdnptr);
+ if (n < 0)
+ return (-1);
+ t += n;
+ if (ns_name_skip(&rdata, msg->_eom) < 0)
+ return (-1);
+
+ /* Serial, Refresh, Retry, Expiry, and Minimum. */
+ if ((msg->_eom - t) < (NS_INT32SZ * 5)) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ memcpy(t, rdata, NS_INT32SZ * 5);
+ t += (NS_INT32SZ * 5);
+ break;
+ case ns_t_ptr:
+ case ns_t_cname:
+ case ns_t_ns:
+ /* PTRDNAME, CNAME, or NSDNAME. */
+ n = ns_name_pack(rdata, t, msg->_eom - t,
+ handle->dnptrs, handle->lastdnptr);
+ if (n < 0)
+ return (-1);
+ t += n;
+ break;
+ default:
+ memcpy(t, rdata, rdlen);
+ t += rdlen;
+ }
+ NS_PUT16(t - s, p);
+ msg->_msg_ptr = t;
+ return (0);
+}
+
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_parse.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_parse.c
new file mode 100644
index 0000000000..ba11eea707
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_parse.c
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_parse.c,v 1.10 2009/01/23 19:59:16 each Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <string.h>
+
+#include "port_after.h"
+
+/* Forward. */
+
+static void setsection(ns_msg *msg, ns_sect sect);
+
+/* Macros. */
+
+#if !defined(SOLARIS2) || defined(__COVERITY__)
+#define RETERR(err) do { errno = (err); return (-1); } while (0)
+#else
+#define RETERR(err) \
+ do { errno = (err); if (errno == errno) return (-1); } while (0)
+#endif
+
+#define PARSE_FMT_PRESO 0 /* Parse using presentation-format names */
+#define PARSE_FMT_WIRE 1 /* Parse using network-format names */
+
+/* Public. */
+
+/* These need to be in the same order as the nres.h:ns_flag enum. */
+struct _ns_flagdata _ns_flagdata[16] = {
+ { 0x8000, 15 }, /*%< qr. */
+ { 0x7800, 11 }, /*%< opcode. */
+ { 0x0400, 10 }, /*%< aa. */
+ { 0x0200, 9 }, /*%< tc. */
+ { 0x0100, 8 }, /*%< rd. */
+ { 0x0080, 7 }, /*%< ra. */
+ { 0x0040, 6 }, /*%< z. */
+ { 0x0020, 5 }, /*%< ad. */
+ { 0x0010, 4 }, /*%< cd. */
+ { 0x000f, 0 }, /*%< rcode. */
+ { 0x0000, 0 }, /*%< expansion (1/6). */
+ { 0x0000, 0 }, /*%< expansion (2/6). */
+ { 0x0000, 0 }, /*%< expansion (3/6). */
+ { 0x0000, 0 }, /*%< expansion (4/6). */
+ { 0x0000, 0 }, /*%< expansion (5/6). */
+ { 0x0000, 0 }, /*%< expansion (6/6). */
+};
+
+int ns_msg_getflag(ns_msg handle, int flag) {
+ return(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift);
+}
+
+int
+ns_skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) {
+ const u_char *optr = ptr;
+
+ for ((void)NULL; count > 0; count--) {
+ int b, rdlength;
+
+ b = dn_skipname(ptr, eom);
+ if (b < 0)
+ RETERR(EMSGSIZE);
+ ptr += b/*Name*/ + NS_INT16SZ/*Type*/ + NS_INT16SZ/*Class*/;
+ if (section != ns_s_qd) {
+ if (ptr + NS_INT32SZ + NS_INT16SZ > eom)
+ RETERR(EMSGSIZE);
+ ptr += NS_INT32SZ/*TTL*/;
+ NS_GET16(rdlength, ptr);
+ ptr += rdlength/*RData*/;
+ }
+ }
+ if (ptr > eom)
+ RETERR(EMSGSIZE);
+ return (ptr - optr);
+}
+
+int
+ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
+ const u_char *eom = msg + msglen;
+ int i;
+
+ handle->_msg = msg;
+ handle->_eom = eom;
+ if (msg + NS_INT16SZ > eom)
+ RETERR(EMSGSIZE);
+ NS_GET16(handle->_id, msg);
+ if (msg + NS_INT16SZ > eom)
+ RETERR(EMSGSIZE);
+ NS_GET16(handle->_flags, msg);
+ for (i = 0; i < ns_s_max; i++) {
+ if (msg + NS_INT16SZ > eom)
+ RETERR(EMSGSIZE);
+ NS_GET16(handle->_counts[i], msg);
+ }
+ for (i = 0; i < ns_s_max; i++)
+ if (handle->_counts[i] == 0)
+ handle->_sections[i] = NULL;
+ else {
+ int b = ns_skiprr(msg, eom, (ns_sect)i,
+ handle->_counts[i]);
+
+ if (b < 0)
+ return (-1);
+ handle->_sections[i] = msg;
+ msg += b;
+ }
+ if (msg != eom)
+ RETERR(EMSGSIZE);
+ setsection(handle, ns_s_max);
+ return (0);
+}
+
+int
+ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
+ int b;
+ int tmp;
+
+ /* Make section right. */
+ tmp = section;
+ if (tmp < 0 || section >= ns_s_max)
+ RETERR(ENODEV);
+ if (section != handle->_sect)
+ setsection(handle, section);
+
+ /* Make rrnum right. */
+ if (rrnum == -1)
+ rrnum = handle->_rrnum;
+ if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
+ RETERR(ENODEV);
+ if (rrnum < handle->_rrnum)
+ setsection(handle, section);
+ if (rrnum > handle->_rrnum) {
+ b = ns_skiprr(handle->_msg_ptr, handle->_eom, section,
+ rrnum - handle->_rrnum);
+
+ if (b < 0)
+ return (-1);
+ handle->_msg_ptr += b;
+ handle->_rrnum = rrnum;
+ }
+
+ /* Do the parse. */
+ b = dn_expand(handle->_msg, handle->_eom,
+ handle->_msg_ptr, rr->name, NS_MAXDNAME);
+ if (b < 0)
+ return (-1);
+ handle->_msg_ptr += b;
+ if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
+ RETERR(EMSGSIZE);
+ NS_GET16(rr->type, handle->_msg_ptr);
+ NS_GET16(rr->rr_class, handle->_msg_ptr);
+ if (section == ns_s_qd) {
+ rr->ttl = 0;
+ rr->rdlength = 0;
+ rr->rdata = NULL;
+ } else {
+ if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
+ RETERR(EMSGSIZE);
+ NS_GET32(rr->ttl, handle->_msg_ptr);
+ NS_GET16(rr->rdlength, handle->_msg_ptr);
+ if (handle->_msg_ptr + rr->rdlength > handle->_eom)
+ RETERR(EMSGSIZE);
+ rr->rdata = handle->_msg_ptr;
+ handle->_msg_ptr += rr->rdlength;
+ }
+ if (++handle->_rrnum > handle->_counts[(int)section])
+ setsection(handle, (ns_sect)((int)section + 1));
+
+ /* All done. */
+ return (0);
+}
+
+/*
+ * This is identical to the above but uses network-format (uncompressed) names.
+ */
+int
+ns_parserr2(ns_msg *handle, ns_sect section, int rrnum, ns_rr2 *rr) {
+ int b;
+ int tmp;
+
+ /* Make section right. */
+ if ((tmp = section) < 0 || section >= ns_s_max)
+ RETERR(ENODEV);
+ if (section != handle->_sect)
+ setsection(handle, section);
+
+ /* Make rrnum right. */
+ if (rrnum == -1)
+ rrnum = handle->_rrnum;
+ if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
+ RETERR(ENODEV);
+ if (rrnum < handle->_rrnum)
+ setsection(handle, section);
+ if (rrnum > handle->_rrnum) {
+ b = ns_skiprr(handle->_msg_ptr, handle->_eom, section,
+ rrnum - handle->_rrnum);
+
+ if (b < 0)
+ return (-1);
+ handle->_msg_ptr += b;
+ handle->_rrnum = rrnum;
+ }
+
+ /* Do the parse. */
+ b = ns_name_unpack2(handle->_msg, handle->_eom, handle->_msg_ptr,
+ rr->nname, NS_MAXNNAME, &rr->nnamel);
+ if (b < 0)
+ return (-1);
+ handle->_msg_ptr += b;
+ if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
+ RETERR(EMSGSIZE);
+ NS_GET16(rr->type, handle->_msg_ptr);
+ NS_GET16(rr->rr_class, handle->_msg_ptr);
+ if (section == ns_s_qd) {
+ rr->ttl = 0;
+ rr->rdlength = 0;
+ rr->rdata = NULL;
+ } else {
+ if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
+ RETERR(EMSGSIZE);
+ NS_GET32(rr->ttl, handle->_msg_ptr);
+ NS_GET16(rr->rdlength, handle->_msg_ptr);
+ if (handle->_msg_ptr + rr->rdlength > handle->_eom)
+ RETERR(EMSGSIZE);
+ rr->rdata = handle->_msg_ptr;
+ handle->_msg_ptr += rr->rdlength;
+ }
+ if (++handle->_rrnum > handle->_counts[(int)section])
+ setsection(handle, (ns_sect)((int)section + 1));
+
+ /* All done. */
+ return (0);
+}
+
+/* Private. */
+
+static void
+setsection(ns_msg *msg, ns_sect sect) {
+ msg->_sect = sect;
+ if (sect == ns_s_max) {
+ msg->_rrnum = -1;
+ msg->_msg_ptr = NULL;
+ } else {
+ msg->_rrnum = 0;
+ msg->_msg_ptr = msg->_sections[(int)sect];
+ }
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_print.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_print.c
new file mode 100644
index 0000000000..e70df376c1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_print.c
@@ -0,0 +1,1242 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_print.c,v 1.12 2009/03/03 05:29:58 each Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <isc/assertions.h>
+#include <isc/dst.h>
+#include <errno.h>
+#include <resolv_joy.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/* Forward. */
+
+static size_t prune_origin(const char *name, const char *origin);
+static int charstr(const u_char *rdata, const u_char *edata,
+ char **buf, size_t *buflen);
+static int addname(const u_char *msg, size_t msglen,
+ const u_char **p, const char *origin,
+ char **buf, size_t *buflen);
+static void addlen(size_t len, char **buf, size_t *buflen);
+static int addstr(const char *src, size_t len,
+ char **buf, size_t *buflen);
+static int addtab(size_t len, size_t target, int spaced,
+ char **buf, size_t *buflen);
+
+/* Macros. */
+
+#define T(x) \
+ do { \
+ if ((x) < 0) \
+ return (-1); \
+ } while (0)
+
+static const char base32hex[] =
+ "0123456789ABCDEFGHIJKLMNOPQRSTUV=0123456789abcdefghijklmnopqrstuv";
+
+/* Public. */
+
+/*%
+ * Convert an RR to presentation format.
+ *
+ * return:
+ *\li Number of characters written to buf, or -1 (check errno).
+ */
+int
+ns_sprintrr(const ns_msg *handle, const ns_rr *rr,
+ const char *name_ctx, const char *origin,
+ char *buf, size_t buflen)
+{
+ int n;
+
+ n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle),
+ ns_rr_name(*rr), ns_rr_class(*rr), ns_rr_type(*rr),
+ ns_rr_ttl(*rr), ns_rr_rdata(*rr), ns_rr_rdlen(*rr),
+ name_ctx, origin, buf, buflen);
+ return (n);
+}
+
+/*%
+ * Convert the fields of an RR into presentation format.
+ *
+ * return:
+ *\li Number of characters written to buf, or -1 (check errno).
+ */
+int
+ns_sprintrrf(const u_char *msg, size_t msglen,
+ const char *name, ns_class class, ns_type type,
+ u_long ttl, const u_char *rdata, size_t rdlen,
+ const char *name_ctx, const char *origin,
+ char *buf, size_t buflen)
+{
+ const char *obuf = buf;
+ const u_char *edata = rdata + rdlen;
+ int spaced = 0;
+
+ const char *comment;
+ char tmp[100];
+ int len, x;
+
+ /*
+ * Owner.
+ */
+ if (name_ctx != NULL && ns_samename(name_ctx, name) == 1) {
+ T(addstr("\t\t\t", 3, &buf, &buflen));
+ } else {
+ len = prune_origin(name, origin);
+ if (*name == '\0') {
+ goto root;
+ } else if (len == 0) {
+ T(addstr("@\t\t\t", 4, &buf, &buflen));
+ } else {
+ T(addstr(name, len, &buf, &buflen));
+ /* Origin not used or not root, and no trailing dot? */
+ if (((origin == NULL || origin[0] == '\0') ||
+ (origin[0] != '.' && origin[1] != '\0' &&
+ name[len] == '\0')) && name[len - 1] != '.') {
+ root:
+ T(addstr(".", 1, &buf, &buflen));
+ len++;
+ }
+ T(spaced = addtab(len, 24, spaced, &buf, &buflen));
+ }
+ }
+
+ /*
+ * TTL, Class, Type.
+ */
+ T(x = ns_format_ttl(ttl, buf, buflen));
+ addlen(x, &buf, &buflen);
+ len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
+ T(addstr(tmp, len, &buf, &buflen));
+ T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
+
+ /*
+ * RData.
+ */
+ switch (type) {
+ case ns_t_a:
+ if (rdlen != (size_t)NS_INADDRSZ)
+ goto formerr;
+ (void) inet_ntop(AF_INET, rdata, buf, buflen);
+ addlen(strlen(buf), &buf, &buflen);
+ break;
+
+ case ns_t_cname:
+ case ns_t_mb:
+ case ns_t_mg:
+ case ns_t_mr:
+ case ns_t_ns:
+ case ns_t_ptr:
+ case ns_t_dname:
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ break;
+
+ case ns_t_hinfo:
+ case ns_t_isdn:
+ /* First word. */
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ T(addstr(" ", 1, &buf, &buflen));
+
+
+ /* Second word, optional in ISDN records. */
+ if (type == ns_t_isdn && rdata == edata)
+ break;
+
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ break;
+
+ case ns_t_soa: {
+ u_long t;
+
+ /* Server name. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Administrator name. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" (\n", 3, &buf, &buflen));
+ spaced = 0;
+
+ if ((edata - rdata) != 5*NS_INT32SZ)
+ goto formerr;
+
+ /* Serial number. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
+ len = SPRINTF((tmp, "%lu", t));
+ T(addstr(tmp, len, &buf, &buflen));
+ T(spaced = addtab(len, 16, spaced, &buf, &buflen));
+ T(addstr("; serial\n", 9, &buf, &buflen));
+ spaced = 0;
+
+ /* Refresh interval. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
+ T(len = ns_format_ttl(t, buf, buflen));
+ addlen(len, &buf, &buflen);
+ T(spaced = addtab(len, 16, spaced, &buf, &buflen));
+ T(addstr("; refresh\n", 10, &buf, &buflen));
+ spaced = 0;
+
+ /* Retry interval. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
+ T(len = ns_format_ttl(t, buf, buflen));
+ addlen(len, &buf, &buflen);
+ T(spaced = addtab(len, 16, spaced, &buf, &buflen));
+ T(addstr("; retry\n", 8, &buf, &buflen));
+ spaced = 0;
+
+ /* Expiry. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
+ T(len = ns_format_ttl(t, buf, buflen));
+ addlen(len, &buf, &buflen);
+ T(spaced = addtab(len, 16, spaced, &buf, &buflen));
+ T(addstr("; expiry\n", 9, &buf, &buflen));
+ spaced = 0;
+
+ /* Minimum TTL. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ T(addstr("\t\t\t\t\t", 5, &buf, &buflen));
+ T(len = ns_format_ttl(t, buf, buflen));
+ addlen(len, &buf, &buflen);
+ T(addstr(" )", 2, &buf, &buflen));
+ T(spaced = addtab(len, 16, spaced, &buf, &buflen));
+ T(addstr("; minimum\n", 10, &buf, &buflen));
+
+ break;
+ }
+
+ case ns_t_mx:
+ case ns_t_afsdb:
+ case ns_t_rt:
+ case ns_t_kx: {
+ u_int t;
+
+ if (rdlen < (size_t)NS_INT16SZ)
+ goto formerr;
+
+ /* Priority. */
+ t = ns_get16(rdata);
+ rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u ", t));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Target. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ break;
+ }
+
+ case ns_t_px: {
+ u_int t;
+
+ if (rdlen < (size_t)NS_INT16SZ)
+ goto formerr;
+
+ /* Priority. */
+ t = ns_get16(rdata);
+ rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u ", t));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Name1. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Name2. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ break;
+ }
+
+ case ns_t_x25:
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ break;
+
+ case ns_t_txt:
+ case ns_t_spf:
+ while (rdata < edata) {
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ if (rdata < edata)
+ T(addstr(" ", 1, &buf, &buflen));
+ }
+ break;
+
+ case ns_t_nsap: {
+ char t[2+255*3];
+
+ (void) inet_nsap_ntoa(rdlen, rdata, t);
+ T(addstr(t, strlen(t), &buf, &buflen));
+ break;
+ }
+
+ case ns_t_aaaa:
+ if (rdlen != (size_t)NS_IN6ADDRSZ)
+ goto formerr;
+ (void) inet_ntop(AF_INET6, rdata, buf, buflen);
+ addlen(strlen(buf), &buf, &buflen);
+ break;
+
+ case ns_t_loc: {
+ char t[255];
+
+ /* XXX protocol format checking? */
+ (void) loc_ntoa(rdata, t);
+ T(addstr(t, strlen(t), &buf, &buflen));
+ break;
+ }
+
+ case ns_t_naptr: {
+ u_int order, preference;
+ char t[50];
+
+ if (rdlen < 2U*NS_INT16SZ)
+ goto formerr;
+
+ /* Order, Precedence. */
+ order = ns_get16(rdata); rdata += NS_INT16SZ;
+ preference = ns_get16(rdata); rdata += NS_INT16SZ;
+ len = SPRINTF((t, "%u %u ", order, preference));
+ T(addstr(t, len, &buf, &buflen));
+
+ /* Flags. */
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Service. */
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Regexp. */
+ T(len = charstr(rdata, edata, &buf, &buflen));
+ if (len < 0)
+ return (-1);
+ if (len == 0)
+ goto formerr;
+ rdata += len;
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Server. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ break;
+ }
+
+ case ns_t_srv: {
+ u_int priority, weight, port;
+ char t[50];
+
+ if (rdlen < 3U*NS_INT16SZ)
+ goto formerr;
+
+ /* Priority, Weight, Port. */
+ priority = ns_get16(rdata); rdata += NS_INT16SZ;
+ weight = ns_get16(rdata); rdata += NS_INT16SZ;
+ port = ns_get16(rdata); rdata += NS_INT16SZ;
+ len = SPRINTF((t, "%u %u %u ", priority, weight, port));
+ T(addstr(t, len, &buf, &buflen));
+
+ /* Server. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ break;
+ }
+
+ case ns_t_minfo:
+ case ns_t_rp:
+ /* Name1. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Name2. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ break;
+
+ case ns_t_wks: {
+ int n, lcnt;
+
+ if (rdlen < 1U + NS_INT32SZ)
+ goto formerr;
+
+ /* Address. */
+ (void) inet_ntop(AF_INET, rdata, buf, buflen);
+ addlen(strlen(buf), &buf, &buflen);
+ rdata += NS_INADDRSZ;
+
+ /* Protocol. */
+ len = SPRINTF((tmp, " %u ( ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata += NS_INT8SZ;
+
+ /* Bit map. */
+ n = 0;
+ lcnt = 0;
+ while (rdata < edata) {
+ u_int c = *rdata++;
+ do {
+ if (c & 0200) {
+ if (lcnt == 0) {
+ T(addstr("\n\t\t\t\t", 5,
+ &buf, &buflen));
+ lcnt = 10;
+ spaced = 0;
+ }
+ len = SPRINTF((tmp, "%d ", n));
+ T(addstr(tmp, len, &buf, &buflen));
+ lcnt--;
+ }
+ c <<= 1;
+ } while (++n & 07);
+ }
+ T(addstr(")", 1, &buf, &buflen));
+
+ break;
+ }
+
+ case ns_t_key:
+ case ns_t_dnskey: {
+ char base64_key[NS_MD5RSA_MAX_BASE64];
+ u_int keyflags, protocol, algorithm, key_id;
+ const char *leader;
+ int n;
+
+ if (rdlen < 0U + NS_INT16SZ + NS_INT8SZ + NS_INT8SZ)
+ goto formerr;
+
+ /* Key flags, Protocol, Algorithm. */
+ key_id = dst_s_dns_key_id(rdata, edata-rdata);
+ keyflags = ns_get16(rdata); rdata += NS_INT16SZ;
+ protocol = *rdata++;
+ algorithm = *rdata++;
+ len = SPRINTF((tmp, "0x%04x %u %u",
+ keyflags, protocol, algorithm));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Public key data. */
+ len = b64_ntop(rdata, edata - rdata,
+ base64_key, sizeof base64_key);
+ if (len < 0)
+ goto formerr;
+ if (len > 15) {
+ T(addstr(" (", 2, &buf, &buflen));
+ leader = "\n\t\t";
+ spaced = 0;
+ } else
+ leader = " ";
+ for (n = 0; n < len; n += 48) {
+ T(addstr(leader, strlen(leader), &buf, &buflen));
+ T(addstr(base64_key + n, MIN(len - n, 48),
+ &buf, &buflen));
+ }
+ if (len > 15)
+ T(addstr(" )", 2, &buf, &buflen));
+ n = SPRINTF((tmp, " ; key_tag= %u", key_id));
+ T(addstr(tmp, n, &buf, &buflen));
+
+ break;
+ }
+
+ case ns_t_sig:
+ case ns_t_rrsig: {
+ char base64_key[NS_MD5RSA_MAX_BASE64];
+ u_int type, algorithm, labels, footprint;
+ const char *leader;
+ u_long t;
+ int n;
+
+ if (rdlen < 22U)
+ goto formerr;
+
+ /* Type covered, Algorithm, Label count, Original TTL. */
+ type = ns_get16(rdata); rdata += NS_INT16SZ;
+ algorithm = *rdata++;
+ labels = *rdata++;
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s %d %d %lu ",
+ p_type(type), algorithm, labels, t));
+ T(addstr(tmp, len, &buf, &buflen));
+ if (labels > (u_int)dn_count_labels(name))
+ goto formerr;
+
+ /* Signature expiry. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Time signed. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Signature Footprint. */
+ footprint = ns_get16(rdata); rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u ", footprint));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Signer's name. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ /* Signature. */
+ len = b64_ntop(rdata, edata - rdata,
+ base64_key, sizeof base64_key);
+ if (len > 15) {
+ T(addstr(" (", 2, &buf, &buflen));
+ leader = "\n\t\t";
+ spaced = 0;
+ } else
+ leader = " ";
+ if (len < 0)
+ goto formerr;
+ for (n = 0; n < len; n += 48) {
+ T(addstr(leader, strlen(leader), &buf, &buflen));
+ T(addstr(base64_key + n, MIN(len - n, 48),
+ &buf, &buflen));
+ }
+ if (len > 15)
+ T(addstr(" )", 2, &buf, &buflen));
+ break;
+ }
+
+ case ns_t_nxt: {
+ int n, c;
+
+ /* Next domain name. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ /* Type bit map. */
+ n = edata - rdata;
+ for (c = 0; c < n*8; c++)
+ if (NS_NXT_BIT_ISSET(c, rdata)) {
+ len = SPRINTF((tmp, " %s", p_type(c)));
+ T(addstr(tmp, len, &buf, &buflen));
+ }
+ break;
+ }
+
+ case ns_t_cert: {
+ u_int c_type, key_tag, alg;
+ int n;
+ unsigned int siz;
+ char base64_cert[8192], tmp[40];
+ const char *leader;
+
+ c_type = ns_get16(rdata); rdata += NS_INT16SZ;
+ key_tag = ns_get16(rdata); rdata += NS_INT16SZ;
+ alg = (u_int) *rdata++;
+
+ len = SPRINTF((tmp, "%d %d %d ", c_type, key_tag, alg));
+ T(addstr(tmp, len, &buf, &buflen));
+ siz = (edata-rdata)*4/3 + 4; /* "+4" accounts for trailing \0 */
+ if (siz > sizeof(base64_cert) * 3/4) {
+ const char *str = "record too long to print";
+ T(addstr(str, strlen(str), &buf, &buflen));
+ }
+ else {
+ len = b64_ntop(rdata, edata-rdata, base64_cert, siz);
+
+ if (len < 0)
+ goto formerr;
+ else if (len > 15) {
+ T(addstr(" (", 2, &buf, &buflen));
+ leader = "\n\t\t";
+ spaced = 0;
+ }
+ else
+ leader = " ";
+
+ for (n = 0; n < len; n += 48) {
+ T(addstr(leader, strlen(leader),
+ &buf, &buflen));
+ T(addstr(base64_cert + n, MIN(len - n, 48),
+ &buf, &buflen));
+ }
+ if (len > 15)
+ T(addstr(" )", 2, &buf, &buflen));
+ }
+ break;
+ }
+
+ case ns_t_tkey: {
+ /* KJD - need to complete this */
+ u_long t;
+ int mode, err, keysize;
+
+ /* Algorithm name. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Inception. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Experation. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Mode , Error, Key Size. */
+ /* Priority, Weight, Port. */
+ mode = ns_get16(rdata); rdata += NS_INT16SZ;
+ err = ns_get16(rdata); rdata += NS_INT16SZ;
+ keysize = ns_get16(rdata); rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u %u %u ", mode, err, keysize));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* XXX need to dump key, print otherdata length & other data */
+ break;
+ }
+
+ case ns_t_tsig: {
+ /* BEW - need to complete this */
+ int n;
+
+ T(len = addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" ", 1, &buf, &buflen));
+ rdata += 8; /*%< time */
+ n = ns_get16(rdata); rdata += INT16SZ;
+ rdata += n; /*%< sig */
+ n = ns_get16(rdata); rdata += INT16SZ; /*%< original id */
+ sprintf(buf, "%d", ns_get16(rdata));
+ rdata += INT16SZ;
+ addlen(strlen(buf), &buf, &buflen);
+ break;
+ }
+
+ case ns_t_a6: {
+ struct in6_addr a;
+ int pbyte, pbit;
+
+ /* prefix length */
+ if (rdlen == 0U) goto formerr;
+ len = SPRINTF((tmp, "%d ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ pbit = *rdata;
+ if (pbit > 128) goto formerr;
+ pbyte = (pbit & ~7) / 8;
+ rdata++;
+
+ /* address suffix: provided only when prefix len != 128 */
+ if (pbit < 128) {
+ if (rdata + pbyte >= edata) goto formerr;
+ memset(&a, 0, sizeof(a));
+ memcpy(&a.s6_addr[pbyte], rdata, sizeof(a) - pbyte);
+ (void) inet_ntop(AF_INET6, &a, buf, buflen);
+ addlen(strlen(buf), &buf, &buflen);
+ rdata += sizeof(a) - pbyte;
+ }
+
+ /* prefix name: provided only when prefix len > 0 */
+ if (pbit == 0)
+ break;
+ if (rdata >= edata) goto formerr;
+ T(addstr(" ", 1, &buf, &buflen));
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ break;
+ }
+
+ case ns_t_opt: {
+ len = SPRINTF((tmp, "%u bytes", class));
+ T(addstr(tmp, len, &buf, &buflen));
+ break;
+ }
+
+ case ns_t_ds:
+ case ns_t_dlv:
+ case ns_t_sshfp: {
+ u_int t;
+
+ if (type == ns_t_ds || type == ns_t_dlv) {
+ if (rdlen < 4U) goto formerr;
+ t = ns_get16(rdata);
+ rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u ", t));
+ T(addstr(tmp, len, &buf, &buflen));
+ } else
+ if (rdlen < 2U) goto formerr;
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ while (rdata < edata) {
+ len = SPRINTF((tmp, "%02X", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+ }
+ break;
+ }
+
+ case ns_t_nsec3:
+ case ns_t_nsec3param: {
+ u_int t, w, l, j, k, c;
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ t = ns_get16(rdata);
+ rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u ", t));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ t = *rdata++;
+ if (t == 0) {
+ T(addstr("-", 1, &buf, &buflen));
+ } else {
+ while (t-- > 0) {
+ len = SPRINTF((tmp, "%02X", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+ }
+ }
+ if (type == ns_t_nsec3param)
+ break;
+ T(addstr(" ", 1, &buf, &buflen));
+
+ t = *rdata++;
+ while (t > 0) {
+ switch (t) {
+ case 1:
+ tmp[0] = base32hex[((rdata[0]>>3)&0x1f)];
+ tmp[1] = base32hex[((rdata[0]<<2)&0x1c)];
+ tmp[2] = tmp[3] = tmp[4] = '=';
+ tmp[5] = tmp[6] = tmp[7] = '=';
+ break;
+ case 2:
+ tmp[0] = base32hex[((rdata[0]>>3)&0x1f)];
+ tmp[1] = base32hex[((rdata[0]<<2)&0x1c)|
+ ((rdata[1]>>6)&0x03)];
+ tmp[2] = base32hex[((rdata[1]>>1)&0x1f)];
+ tmp[3] = base32hex[((rdata[1]<<4)&0x10)];
+ tmp[4] = tmp[5] = tmp[6] = tmp[7] = '=';
+ break;
+ case 3:
+ tmp[0] = base32hex[((rdata[0]>>3)&0x1f)];
+ tmp[1] = base32hex[((rdata[0]<<2)&0x1c)|
+ ((rdata[1]>>6)&0x03)];
+ tmp[2] = base32hex[((rdata[1]>>1)&0x1f)];
+ tmp[3] = base32hex[((rdata[1]<<4)&0x10)|
+ ((rdata[2]>>4)&0x0f)];
+ tmp[4] = base32hex[((rdata[2]<<1)&0x1e)];
+ tmp[5] = tmp[6] = tmp[7] = '=';
+ break;
+ case 4:
+ tmp[0] = base32hex[((rdata[0]>>3)&0x1f)];
+ tmp[1] = base32hex[((rdata[0]<<2)&0x1c)|
+ ((rdata[1]>>6)&0x03)];
+ tmp[2] = base32hex[((rdata[1]>>1)&0x1f)];
+ tmp[3] = base32hex[((rdata[1]<<4)&0x10)|
+ ((rdata[2]>>4)&0x0f)];
+ tmp[4] = base32hex[((rdata[2]<<1)&0x1e)|
+ ((rdata[3]>>7)&0x01)];
+ tmp[5] = base32hex[((rdata[3]>>2)&0x1f)];
+ tmp[6] = base32hex[(rdata[3]<<3)&0x18];
+ tmp[7] = '=';
+ break;
+ default:
+ tmp[0] = base32hex[((rdata[0]>>3)&0x1f)];
+ tmp[1] = base32hex[((rdata[0]<<2)&0x1c)|
+ ((rdata[1]>>6)&0x03)];
+ tmp[2] = base32hex[((rdata[1]>>1)&0x1f)];
+ tmp[3] = base32hex[((rdata[1]<<4)&0x10)|
+ ((rdata[2]>>4)&0x0f)];
+ tmp[4] = base32hex[((rdata[2]<<1)&0x1e)|
+ ((rdata[3]>>7)&0x01)];
+ tmp[5] = base32hex[((rdata[3]>>2)&0x1f)];
+ tmp[6] = base32hex[((rdata[3]<<3)&0x18)|
+ ((rdata[4]>>5)&0x07)];
+ tmp[7] = base32hex[(rdata[4]&0x1f)];
+ break;
+ }
+ T(addstr(tmp, 8, &buf, &buflen));
+ if (t >= 5) {
+ rdata += 5;
+ t -= 5;
+ } else {
+ rdata += t;
+ t -= t;
+ }
+ }
+
+ while (rdata < edata) {
+ w = *rdata++;
+ l = *rdata++;
+ for (j = 0; j < l; j++) {
+ if (rdata[j] == 0)
+ continue;
+ for (k = 0; k < 8; k++) {
+ if ((rdata[j] & (0x80 >> k)) == 0)
+ continue;
+ c = w * 256 + j * 8 + k;
+ len = SPRINTF((tmp, " %s", p_type(c)));
+ T(addstr(tmp, len, &buf, &buflen));
+ }
+ }
+ rdata += l;
+ }
+ break;
+ }
+
+ case ns_t_nsec: {
+ u_int w, l, j, k, c;
+
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+
+ while (rdata < edata) {
+ w = *rdata++;
+ l = *rdata++;
+ for (j = 0; j < l; j++) {
+ if (rdata[j] == 0)
+ continue;
+ for (k = 0; k < 8; k++) {
+ if ((rdata[j] & (0x80 >> k)) == 0)
+ continue;
+ c = w * 256 + j * 8 + k;
+ len = SPRINTF((tmp, " %s", p_type(c)));
+ T(addstr(tmp, len, &buf, &buflen));
+ }
+ }
+ rdata += l;
+ }
+ break;
+ }
+
+ case ns_t_dhcid: {
+ int n;
+ unsigned int siz;
+ char base64_dhcid[8192];
+ const char *leader;
+
+ siz = (edata-rdata)*4/3 + 4; /* "+4" accounts for trailing \0 */
+ if (siz > sizeof(base64_dhcid) * 3/4) {
+ const char *str = "record too long to print";
+ T(addstr(str, strlen(str), &buf, &buflen));
+ } else {
+ len = b64_ntop(rdata, edata-rdata, base64_dhcid, siz);
+
+ if (len < 0)
+ goto formerr;
+
+ else if (len > 15) {
+ T(addstr(" (", 2, &buf, &buflen));
+ leader = "\n\t\t";
+ spaced = 0;
+ }
+ else
+ leader = " ";
+
+ for (n = 0; n < len; n += 48) {
+ T(addstr(leader, strlen(leader),
+ &buf, &buflen));
+ T(addstr(base64_dhcid + n, MIN(len - n, 48),
+ &buf, &buflen));
+ }
+ if (len > 15)
+ T(addstr(" )", 2, &buf, &buflen));
+ }
+ }
+
+ case ns_t_ipseckey: {
+ int n;
+ unsigned int siz;
+ char base64_key[8192];
+ const char *leader;
+
+ if (rdlen < 2)
+ goto formerr;
+
+ switch (rdata[1]) {
+ case 0:
+ case 3:
+ if (rdlen < 3)
+ goto formerr;
+ break;
+ case 1:
+ if (rdlen < 7)
+ goto formerr;
+ break;
+ case 2:
+ if (rdlen < 19)
+ goto formerr;
+ break;
+ default:
+ comment = "unknown IPSECKEY gateway type";
+ goto hexify;
+ }
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ len = SPRINTF((tmp, "%u ", *rdata));
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+
+ switch (rdata[-2]) {
+ case 0:
+ T(addstr(".", 1, &buf, &buflen));
+ break;
+ case 1:
+ (void) inet_ntop(AF_INET, rdata, buf, buflen);
+ addlen(strlen(buf), &buf, &buflen);
+ rdata += 4;
+ break;
+ case 2:
+ (void) inet_ntop(AF_INET6, rdata, buf, buflen);
+ addlen(strlen(buf), &buf, &buflen);
+ rdata += 16;
+ break;
+ case 3:
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ break;
+ }
+
+ if (rdata >= edata)
+ break;
+
+ siz = (edata-rdata)*4/3 + 4; /* "+4" accounts for trailing \0 */
+ if (siz > sizeof(base64_key) * 3/4) {
+ const char *str = "record too long to print";
+ T(addstr(str, strlen(str), &buf, &buflen));
+ } else {
+ len = b64_ntop(rdata, edata-rdata, base64_key, siz);
+
+ if (len < 0)
+ goto formerr;
+
+ else if (len > 15) {
+ T(addstr(" (", 2, &buf, &buflen));
+ leader = "\n\t\t";
+ spaced = 0;
+ }
+ else
+ leader = " ";
+
+ for (n = 0; n < len; n += 48) {
+ T(addstr(leader, strlen(leader),
+ &buf, &buflen));
+ T(addstr(base64_key + n, MIN(len - n, 48),
+ &buf, &buflen));
+ }
+ if (len > 15)
+ T(addstr(" )", 2, &buf, &buflen));
+ }
+ }
+
+ case ns_t_hip: {
+ unsigned int i, hip_len, algorithm, key_len;
+ char base64_key[NS_MD5RSA_MAX_BASE64];
+ unsigned int siz;
+ const char *leader = "\n\t\t\t\t\t";
+
+ hip_len = *rdata++;
+ algorithm = *rdata++;
+ key_len = ns_get16(rdata);
+ rdata += NS_INT16SZ;
+
+ siz = key_len*4/3 + 4; /* "+4" accounts for trailing \0 */
+ if (siz > sizeof(base64_key) * 3/4) {
+ const char *str = "record too long to print";
+ T(addstr(str, strlen(str), &buf, &buflen));
+ } else {
+ len = sprintf(tmp, "( %u ", algorithm);
+ T(addstr(tmp, len, &buf, &buflen));
+
+ for (i = 0; i < hip_len; i++) {
+ len = sprintf(tmp, "%02X", *rdata);
+ T(addstr(tmp, len, &buf, &buflen));
+ rdata++;
+ }
+ T(addstr(leader, strlen(leader), &buf, &buflen));
+
+ len = b64_ntop(rdata, key_len, base64_key, siz);
+ if (len < 0)
+ goto formerr;
+
+ T(addstr(base64_key, len, &buf, &buflen));
+
+ rdata += key_len;
+ while (rdata < edata) {
+ T(addstr(leader, strlen(leader), &buf, &buflen));
+ T(addname(msg, msglen, &rdata, origin,
+ &buf, &buflen));
+ }
+ T(addstr(" )", 2, &buf, &buflen));
+ }
+ break;
+ }
+
+ default:
+ comment = "unknown RR type";
+ goto hexify;
+ }
+ return (buf - obuf);
+ formerr:
+ comment = "RR format error";
+ hexify: {
+ int n, m;
+ char *p;
+
+ len = SPRINTF((tmp, "\\# %u%s\t; %s", (unsigned)(edata - rdata),
+ rdlen != 0U ? " (" : "", comment));
+ T(addstr(tmp, len, &buf, &buflen));
+ while (rdata < edata) {
+ p = tmp;
+ p += SPRINTF((p, "\n\t"));
+ spaced = 0;
+ n = MIN(16, edata - rdata);
+ for (m = 0; m < n; m++)
+ p += SPRINTF((p, "%02x ", rdata[m]));
+ T(addstr(tmp, p - tmp, &buf, &buflen));
+ if (n < 16) {
+ T(addstr(")", 1, &buf, &buflen));
+ T(addtab(p - tmp + 1, 48, spaced, &buf, &buflen));
+ }
+ p = tmp;
+ p += SPRINTF((p, "; "));
+ for (m = 0; m < n; m++)
+ *p++ = (isascii(rdata[m]) && isprint(rdata[m]))
+ ? rdata[m]
+ : '.';
+ T(addstr(tmp, p - tmp, &buf, &buflen));
+ rdata += n;
+ }
+ return (buf - obuf);
+ }
+}
+
+/* Private. */
+
+/*%
+ * size_t
+ * prune_origin(name, origin)
+ * Find out if the name is at or under the current origin.
+ * return:
+ * Number of characters in name before start of origin,
+ * or length of name if origin does not match.
+ * notes:
+ * This function should share code with samedomain().
+ */
+static size_t
+prune_origin(const char *name, const char *origin) {
+ const char *oname = name;
+
+ while (*name != '\0') {
+ if (origin != NULL && ns_samename(name, origin) == 1)
+ return (name - oname - (name > oname));
+ while (*name != '\0') {
+ if (*name == '\\') {
+ name++;
+ /* XXX need to handle \nnn form. */
+ if (*name == '\0')
+ break;
+ } else if (*name == '.') {
+ name++;
+ break;
+ }
+ name++;
+ }
+ }
+ return (name - oname);
+}
+
+/*%
+ * int
+ * charstr(rdata, edata, buf, buflen)
+ * Format a <character-string> into the presentation buffer.
+ * return:
+ * Number of rdata octets consumed
+ * 0 for protocol format error
+ * -1 for output buffer error
+ * side effects:
+ * buffer is advanced on success.
+ */
+static int
+charstr(const u_char *rdata, const u_char *edata, char **buf, size_t *buflen) {
+ const u_char *odata = rdata;
+ size_t save_buflen = *buflen;
+ char *save_buf = *buf;
+
+ if (addstr("\"", 1, buf, buflen) < 0)
+ goto enospc;
+ if (rdata < edata) {
+ int n = *rdata;
+
+ if (rdata + 1 + n <= edata) {
+ rdata++;
+ while (n-- > 0) {
+ if (strchr("\n\"\\", *rdata) != NULL)
+ if (addstr("\\", 1, buf, buflen) < 0)
+ goto enospc;
+ if (addstr((const char *)rdata, 1,
+ buf, buflen) < 0)
+ goto enospc;
+ rdata++;
+ }
+ }
+ }
+ if (addstr("\"", 1, buf, buflen) < 0)
+ goto enospc;
+ return (rdata - odata);
+ enospc:
+ errno = ENOSPC;
+ *buf = save_buf;
+ *buflen = save_buflen;
+ return (-1);
+}
+
+static int
+addname(const u_char *msg, size_t msglen,
+ const u_char **pp, const char *origin,
+ char **buf, size_t *buflen)
+{
+ size_t newlen, save_buflen = *buflen;
+ char *save_buf = *buf;
+ int n;
+
+ n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen);
+ if (n < 0)
+ goto enospc; /*%< Guess. */
+ newlen = prune_origin(*buf, origin);
+ if (**buf == '\0') {
+ goto root;
+ } else if (newlen == 0U) {
+ /* Use "@" instead of name. */
+ if (newlen + 2 > *buflen)
+ goto enospc; /* No room for "@\0". */
+ (*buf)[newlen++] = '@';
+ (*buf)[newlen] = '\0';
+ } else {
+ if (((origin == NULL || origin[0] == '\0') ||
+ (origin[0] != '.' && origin[1] != '\0' &&
+ (*buf)[newlen] == '\0')) && (*buf)[newlen - 1] != '.') {
+ /* No trailing dot. */
+ root:
+ if (newlen + 2 > *buflen)
+ goto enospc; /* No room for ".\0". */
+ (*buf)[newlen++] = '.';
+ (*buf)[newlen] = '\0';
+ }
+ }
+ *pp += n;
+ addlen(newlen, buf, buflen);
+ **buf = '\0';
+ return (newlen);
+ enospc:
+ errno = ENOSPC;
+ *buf = save_buf;
+ *buflen = save_buflen;
+ return (-1);
+}
+
+static void
+addlen(size_t len, char **buf, size_t *buflen) {
+ INSIST(len <= *buflen);
+ *buf += len;
+ *buflen -= len;
+}
+
+static int
+addstr(const char *src, size_t len, char **buf, size_t *buflen) {
+ if (len >= *buflen) {
+ errno = ENOSPC;
+ return (-1);
+ }
+ memcpy(*buf, src, len);
+ addlen(len, buf, buflen);
+ **buf = '\0';
+ return (0);
+}
+
+static int
+addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) {
+ size_t save_buflen = *buflen;
+ char *save_buf = *buf;
+ int t;
+
+ if (spaced || len >= target - 1) {
+ T(addstr(" ", 2, buf, buflen));
+ spaced = 1;
+ } else {
+ for (t = (target - len - 1) / 8; t >= 0; t--)
+ if (addstr("\t", 1, buf, buflen) < 0) {
+ *buflen = save_buflen;
+ *buf = save_buf;
+ return (-1);
+ }
+ spaced = 0;
+ }
+ return (spaced);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_rdata.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_rdata.c
new file mode 100644
index 0000000000..eac4052278
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_rdata.c
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_rdata.c,v 1.2 2009/01/23 23:49:15 tbox Exp $";
+#endif
+
+#include "port_before.h"
+
+#if __OpenBSD__
+#include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <resolv_joy.h>
+#include <string.h>
+
+#include "port_after.h"
+
+#define CONSUME_SRC \
+ do { \
+ rdata += n, rdlen -= n; \
+ } while (0)
+
+#define CONSUME_DST \
+ do { \
+ nrdata += n, nrdsiz -= n, nrdlen += n; \
+ } while (0)
+
+#define UNPACK_DNAME \
+ do { \
+ size_t t; \
+ \
+ if ((n = ns_name_unpack2(msg,eom,rdata,nrdata,nrdsiz,&t))<0) {\
+ errno = EMSGSIZE; \
+ return (-1); \
+ } \
+ CONSUME_SRC; \
+ n = t; \
+ CONSUME_DST; \
+ } while (0)
+
+#define UNPACK_SOME(x) \
+ do { \
+ n = (x); \
+ if ((size_t)n > rdlen || (size_t)n > nrdsiz) { \
+ errno = EMSGSIZE; \
+ return (-1); \
+ } \
+ memcpy(nrdata, rdata, n); \
+ CONSUME_SRC; CONSUME_DST; \
+ } while (0)
+
+#define UNPACK_REST(x) \
+ do { \
+ n = (x); \
+ if ((size_t)n != rdlen) { \
+ errno = EMSGSIZE; \
+ return (-1); \
+ } \
+ memcpy(nrdata, rdata, n); \
+ CONSUME_SRC; CONSUME_DST; \
+ } while (0)
+
+ssize_t
+ns_rdata_unpack(const u_char *msg, const u_char *eom,
+ ns_type type, const u_char *rdata, size_t rdlen,
+ u_char *nrdata, size_t nrdsiz)
+{
+ size_t nrdlen = 0;
+ int n;
+
+ switch (type) {
+ case ns_t_a:
+ UNPACK_REST(NS_INADDRSZ);
+ break;
+ case ns_t_aaaa:
+ UNPACK_REST(NS_IN6ADDRSZ);
+ break;
+ case ns_t_cname:
+ case ns_t_mb:
+ case ns_t_mg:
+ case ns_t_mr:
+ case ns_t_ns:
+ case ns_t_ptr:
+ case ns_t_dname:
+ UNPACK_DNAME;
+ break;
+ case ns_t_soa:
+ UNPACK_DNAME;
+ UNPACK_DNAME;
+ UNPACK_SOME(NS_INT32SZ * 5);
+ break;
+ case ns_t_mx:
+ case ns_t_afsdb:
+ case ns_t_rt:
+ UNPACK_SOME(NS_INT16SZ);
+ UNPACK_DNAME;
+ break;
+ case ns_t_px:
+ UNPACK_SOME(NS_INT16SZ);
+ UNPACK_DNAME;
+ UNPACK_DNAME;
+ break;
+ case ns_t_srv:
+ UNPACK_SOME(NS_INT16SZ * 3);
+ UNPACK_DNAME;
+ break;
+ case ns_t_minfo:
+ case ns_t_rp:
+ UNPACK_DNAME;
+ UNPACK_DNAME;
+ break;
+ default:
+ UNPACK_SOME(rdlen);
+ break;
+ }
+ if (rdlen > 0) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ return (nrdlen);
+}
+
+#define EQUAL_CONSUME \
+ do { \
+ rdata1 += n, rdlen1 -= n; \
+ rdata2 += n, rdlen2 -= n; \
+ } while (0)
+
+#define EQUAL_DNAME \
+ do { \
+ ssize_t n; \
+ \
+ if (rdlen1 != rdlen2) \
+ return (0); \
+ n = ns_name_eq(rdata1, rdlen1, rdata2, rdlen2); \
+ if (n <= 0) \
+ return (n); \
+ n = rdlen1; \
+ EQUAL_CONSUME; \
+ } while (0)
+
+#define EQUAL_SOME(x) \
+ do { \
+ size_t n = (x); \
+ \
+ if (n > rdlen1 || n > rdlen2) { \
+ errno = EMSGSIZE; \
+ return (-1); \
+ } \
+ if (memcmp(rdata1, rdata2, n) != 0) \
+ return (0); \
+ EQUAL_CONSUME; \
+ } while (0)
+
+int
+ns_rdata_equal(ns_type type,
+ const u_char *rdata1, size_t rdlen1,
+ const u_char *rdata2, size_t rdlen2)
+{
+ switch (type) {
+ case ns_t_cname:
+ case ns_t_mb:
+ case ns_t_mg:
+ case ns_t_mr:
+ case ns_t_ns:
+ case ns_t_ptr:
+ case ns_t_dname:
+ EQUAL_DNAME;
+ break;
+ case ns_t_soa:
+ /* "There can be only one." --Highlander */
+ break;
+ case ns_t_mx:
+ case ns_t_afsdb:
+ case ns_t_rt:
+ EQUAL_SOME(NS_INT16SZ);
+ EQUAL_DNAME;
+ break;
+ case ns_t_px:
+ EQUAL_SOME(NS_INT16SZ);
+ EQUAL_DNAME;
+ EQUAL_DNAME;
+ break;
+ case ns_t_srv:
+ EQUAL_SOME(NS_INT16SZ * 3);
+ EQUAL_DNAME;
+ break;
+ case ns_t_minfo:
+ case ns_t_rp:
+ EQUAL_DNAME;
+ EQUAL_DNAME;
+ break;
+ default:
+ EQUAL_SOME(rdlen1);
+ break;
+ }
+ if (rdlen1 != 0 || rdlen2 != 0)
+ return (0);
+ return (1);
+}
+
+#define REFERS_DNAME \
+ do { \
+ int n; \
+ \
+ n = ns_name_eq(rdata, rdlen, nname, NS_MAXNNAME); \
+ if (n < 0) \
+ return (-1); \
+ if (n > 0) \
+ return (1); \
+ n = dn_skipname(rdata, rdata + rdlen); \
+ if (n < 0) \
+ return (-1); \
+ CONSUME_SRC; \
+ } while (0)
+
+#define REFERS_SOME(x) \
+ do { \
+ size_t n = (x); \
+ \
+ if (n > rdlen) { \
+ errno = EMSGSIZE; \
+ return (-1); \
+ } \
+ CONSUME_SRC; \
+ } while (0)
+
+int
+ns_rdata_refers(ns_type type,
+ const u_char *rdata, size_t rdlen,
+ const u_char *nname)
+{
+ switch (type) {
+ case ns_t_cname:
+ case ns_t_mb:
+ case ns_t_mg:
+ case ns_t_mr:
+ case ns_t_ns:
+ case ns_t_ptr:
+ case ns_t_dname:
+ REFERS_DNAME;
+ break;
+ case ns_t_soa:
+ REFERS_DNAME;
+ REFERS_DNAME;
+ REFERS_SOME(NS_INT32SZ * 5);
+ break;
+ case ns_t_mx:
+ case ns_t_afsdb:
+ case ns_t_rt:
+ REFERS_SOME(NS_INT16SZ);
+ REFERS_DNAME;
+ break;
+ case ns_t_px:
+ REFERS_SOME(NS_INT16SZ);
+ REFERS_DNAME;
+ REFERS_DNAME;
+ break;
+ case ns_t_srv:
+ REFERS_SOME(NS_INT16SZ * 3);
+ REFERS_DNAME;
+ break;
+ case ns_t_minfo:
+ case ns_t_rp:
+ REFERS_DNAME;
+ REFERS_DNAME;
+ break;
+ default:
+ REFERS_SOME(rdlen);
+ break;
+ }
+ if (rdlen != 0) {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ return (0);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_samedomain.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_samedomain.c
new file mode 100644
index 0000000000..5e9f5cab54
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_samedomain.c
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_samedomain.c,v 1.6 2005/04/27 04:56:40 sra Exp $";
+#endif
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <arpa/nameser.h>
+#include <errno.h>
+#include <string.h>
+
+#include "port_after.h"
+
+/*%
+ * Check whether a name belongs to a domain.
+ *
+ * Inputs:
+ *\li a - the domain whose ancestory is being verified
+ *\li b - the potential ancestor we're checking against
+ *
+ * Return:
+ *\li boolean - is a at or below b?
+ *
+ * Notes:
+ *\li Trailing dots are first removed from name and domain.
+ * Always compare complete subdomains, not only whether the
+ * domain name is the trailing string of the given name.
+ *
+ *\li "host.foobar.top" lies in "foobar.top" and in "top" and in ""
+ * but NOT in "bar.top"
+ */
+
+int
+ns_samedomain(const char *a, const char *b) {
+ size_t la, lb;
+ int diff, i, escaped;
+ const char *cp;
+
+ la = strlen(a);
+ lb = strlen(b);
+
+ /* Ignore a trailing label separator (i.e. an unescaped dot) in 'a'. */
+ if (la != 0U && a[la - 1] == '.') {
+ escaped = 0;
+ /* Note this loop doesn't get executed if la==1. */
+ for (i = la - 2; i >= 0; i--)
+ if (a[i] == '\\') {
+ if (escaped)
+ escaped = 0;
+ else
+ escaped = 1;
+ } else
+ break;
+ if (!escaped)
+ la--;
+ }
+
+ /* Ignore a trailing label separator (i.e. an unescaped dot) in 'b'. */
+ if (lb != 0U && b[lb - 1] == '.') {
+ escaped = 0;
+ /* note this loop doesn't get executed if lb==1 */
+ for (i = lb - 2; i >= 0; i--)
+ if (b[i] == '\\') {
+ if (escaped)
+ escaped = 0;
+ else
+ escaped = 1;
+ } else
+ break;
+ if (!escaped)
+ lb--;
+ }
+
+ /* lb == 0 means 'b' is the root domain, so 'a' must be in 'b'. */
+ if (lb == 0U)
+ return (1);
+
+ /* 'b' longer than 'a' means 'a' can't be in 'b'. */
+ if (lb > la)
+ return (0);
+
+ /* 'a' and 'b' being equal at this point indicates sameness. */
+ if (lb == la)
+ return (strncasecmp(a, b, lb) == 0);
+
+ /* Ok, we know la > lb. */
+
+ diff = la - lb;
+
+ /*
+ * If 'a' is only 1 character longer than 'b', then it can't be
+ * a subdomain of 'b' (because of the need for the '.' label
+ * separator).
+ */
+ if (diff < 2)
+ return (0);
+
+ /*
+ * If the character before the last 'lb' characters of 'b'
+ * isn't '.', then it can't be a match (this lets us avoid
+ * having "foobar.com" match "bar.com").
+ */
+ if (a[diff - 1] != '.')
+ return (0);
+
+ /*
+ * We're not sure about that '.', however. It could be escaped
+ * and thus not a really a label separator.
+ */
+ escaped = 0;
+ for (i = diff - 2; i >= 0; i--)
+ if (a[i] == '\\') {
+ if (escaped)
+ escaped = 0;
+ else
+ escaped = 1;
+ } else
+ break;
+ if (escaped)
+ return (0);
+
+ /* Now compare aligned trailing substring. */
+ cp = a + diff;
+ return (strncasecmp(cp, b, lb) == 0);
+}
+
+/*%
+ * is "a" a subdomain of "b"?
+ */
+int
+ns_subdomain(const char *a, const char *b) {
+ return (ns_samename(a, b) != 1 && ns_samedomain(a, b));
+}
+
+/*%
+ * make a canonical copy of domain name "src"
+ *
+ * notes:
+ * \code
+ * foo -> foo.
+ * foo. -> foo.
+ * foo.. -> foo.
+ * foo\. -> foo\..
+ * foo\\. -> foo\\.
+ * \endcode
+ */
+
+int
+ns_makecanon(const char *src, char *dst, size_t dstsize) {
+ size_t n = strlen(src);
+
+ if (n + sizeof "." > dstsize) { /*%< Note: sizeof == 2 */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ strcpy(dst, src);
+ while (n >= 1U && dst[n - 1] == '.') /*%< Ends in "." */
+ if (n >= 2U && dst[n - 2] == '\\' && /*%< Ends in "\." */
+ (n < 3U || dst[n - 3] != '\\')) /*%< But not "\\." */
+ break;
+ else
+ dst[--n] = '\0';
+ dst[n++] = '.';
+ dst[n] = '\0';
+ return (0);
+}
+
+/*%
+ * determine whether domain name "a" is the same as domain name "b"
+ *
+ * return:
+ *\li -1 on error
+ *\li 0 if names differ
+ *\li 1 if names are the same
+ */
+
+int
+ns_samename(const char *a, const char *b) {
+ char ta[NS_MAXDNAME], tb[NS_MAXDNAME];
+
+ if (ns_makecanon(a, ta, sizeof ta) < 0 ||
+ ns_makecanon(b, tb, sizeof tb) < 0)
+ return (-1);
+ if (strcasecmp(ta, tb) == 0)
+ return (1);
+ else
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_sign.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_sign.c
new file mode 100644
index 0000000000..fc7dd19f7b
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_sign.c
@@ -0,0 +1,387 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium, Inc.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_sign.c,v 1.6 2006/03/09 23:57:56 marka Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <isc/dst.h>
+#include <isc/assertions.h>
+
+#include "port_after.h"
+
+#define BOUNDS_CHECK(ptr, count) \
+ do { \
+ if ((ptr) + (count) > eob) { \
+ errno = EMSGSIZE; \
+ return(NS_TSIG_ERROR_NO_SPACE); \
+ } \
+ } while (0)
+
+/*%
+ * ns_sign
+ *
+ * Parameters:
+ *\li msg message to be sent
+ *\li msglen input - length of message
+ * output - length of signed message
+ *\li msgsize length of buffer containing message
+ *\li error value to put in the error field
+ *\li key tsig key used for signing
+ *\li querysig (response), the signature in the query
+ *\li querysiglen (response), the length of the signature in the query
+ *\li sig a buffer to hold the generated signature
+ *\li siglen input - length of signature buffer
+ * output - length of signature
+ *
+ * Errors:
+ *\li - bad input data (-1)
+ *\li - bad key / sign failed (-BADKEY)
+ *\li - not enough space (NS_TSIG_ERROR_NO_SPACE)
+ */
+int
+ns_sign(u_char *msg, int *msglen, int msgsize, int error, void *k,
+ const u_char *querysig, int querysiglen, u_char *sig, int *siglen,
+ time_t in_timesigned)
+{
+ return(ns_sign2(msg, msglen, msgsize, error, k,
+ querysig, querysiglen, sig, siglen,
+ in_timesigned, NULL, NULL));
+}
+
+int
+ns_sign2(u_char *msg, int *msglen, int msgsize, int error, void *k,
+ const u_char *querysig, int querysiglen, u_char *sig, int *siglen,
+ time_t in_timesigned, u_char **dnptrs, u_char **lastdnptr)
+{
+ HEADER *hp = (HEADER *)msg;
+ DST_KEY *key = (DST_KEY *)k;
+ u_char *cp, *eob;
+ u_char *lenp;
+ u_char *alg;
+ int n;
+ time_t timesigned;
+ u_char name[NS_MAXCDNAME];
+
+ dst_init();
+ if (msg == NULL || msglen == NULL || sig == NULL || siglen == NULL)
+ return (-1);
+
+ cp = msg + *msglen;
+ eob = msg + msgsize;
+
+ /* Name. */
+ if (key != NULL && error != ns_r_badsig && error != ns_r_badkey) {
+ n = ns_name_pton(key->dk_key_name, name, sizeof name);
+ if (n != -1)
+ n = ns_name_pack(name, cp, eob - cp,
+ (const u_char **)dnptrs,
+ (const u_char **)lastdnptr);
+
+ } else {
+ n = ns_name_pton("", name, sizeof name);
+ if (n != -1)
+ n = ns_name_pack(name, cp, eob - cp, NULL, NULL);
+ }
+ if (n < 0)
+ return (NS_TSIG_ERROR_NO_SPACE);
+ cp += n;
+
+ /* Type, class, ttl, length (not filled in yet). */
+ BOUNDS_CHECK(cp, INT16SZ + INT16SZ + INT32SZ + INT16SZ);
+ PUTSHORT(ns_t_tsig, cp);
+ PUTSHORT(ns_c_any, cp);
+ PUTLONG(0, cp); /*%< TTL */
+ lenp = cp;
+ cp += 2;
+
+ /* Alg. */
+ if (key != NULL && error != ns_r_badsig && error != ns_r_badkey) {
+ if (key->dk_alg != KEY_HMAC_MD5)
+ return (-ns_r_badkey);
+ n = dn_comp(NS_TSIG_ALG_HMAC_MD5, cp, eob - cp, NULL, NULL);
+ }
+ else
+ n = dn_comp("", cp, eob - cp, NULL, NULL);
+ if (n < 0)
+ return (NS_TSIG_ERROR_NO_SPACE);
+ alg = cp;
+ cp += n;
+
+ /* Time. */
+ BOUNDS_CHECK(cp, INT16SZ + INT32SZ + INT16SZ);
+ PUTSHORT(0, cp);
+ timesigned = time(NULL);
+ if (error != ns_r_badtime)
+ PUTLONG(timesigned, cp);
+ else
+ PUTLONG(in_timesigned, cp);
+ PUTSHORT(NS_TSIG_FUDGE, cp);
+
+ /* Compute the signature. */
+ if (key != NULL && error != ns_r_badsig && error != ns_r_badkey) {
+ void *ctx;
+ u_char buf[NS_MAXCDNAME], *cp2;
+ int n;
+
+ dst_sign_data(SIG_MODE_INIT, key, &ctx, NULL, 0, NULL, 0);
+
+ /* Digest the query signature, if this is a response. */
+ if (querysiglen > 0 && querysig != NULL) {
+ u_int16_t len_n = htons(querysiglen);
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx,
+ (u_char *)&len_n, INT16SZ, NULL, 0);
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx,
+ querysig, querysiglen, NULL, 0);
+ }
+
+ /* Digest the message. */
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx, msg, *msglen,
+ NULL, 0);
+
+ /* Digest the key name. */
+ n = ns_name_ntol(name, buf, sizeof(buf));
+ INSIST(n > 0);
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx, buf, n, NULL, 0);
+
+ /* Digest the class and TTL. */
+ cp2 = buf;
+ PUTSHORT(ns_c_any, cp2);
+ PUTLONG(0, cp2);
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx, buf, cp2-buf,
+ NULL, 0);
+
+ /* Digest the algorithm. */
+ n = ns_name_ntol(alg, buf, sizeof(buf));
+ INSIST(n > 0);
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx, buf, n, NULL, 0);
+
+ /* Digest the time signed, fudge, error, and other data */
+ cp2 = buf;
+ PUTSHORT(0, cp2); /*%< Top 16 bits of time */
+ if (error != ns_r_badtime)
+ PUTLONG(timesigned, cp2);
+ else
+ PUTLONG(in_timesigned, cp2);
+ PUTSHORT(NS_TSIG_FUDGE, cp2);
+ PUTSHORT(error, cp2); /*%< Error */
+ if (error != ns_r_badtime)
+ PUTSHORT(0, cp2); /*%< Other data length */
+ else {
+ PUTSHORT(INT16SZ+INT32SZ, cp2); /*%< Other data length */
+ PUTSHORT(0, cp2); /*%< Top 16 bits of time */
+ PUTLONG(timesigned, cp2);
+ }
+ dst_sign_data(SIG_MODE_UPDATE, key, &ctx, buf, cp2-buf,
+ NULL, 0);
+
+ n = dst_sign_data(SIG_MODE_FINAL, key, &ctx, NULL, 0,
+ sig, *siglen);
+ if (n < 0)
+ return (-ns_r_badkey);
+ *siglen = n;
+ } else
+ *siglen = 0;
+
+ /* Add the signature. */
+ BOUNDS_CHECK(cp, INT16SZ + (*siglen));
+ PUTSHORT(*siglen, cp);
+ memcpy(cp, sig, *siglen);
+ cp += (*siglen);
+
+ /* The original message ID & error. */
+ BOUNDS_CHECK(cp, INT16SZ + INT16SZ);
+ PUTSHORT(ntohs(hp->id), cp); /*%< already in network order */
+ PUTSHORT(error, cp);
+
+ /* Other data. */
+ BOUNDS_CHECK(cp, INT16SZ);
+ if (error != ns_r_badtime)
+ PUTSHORT(0, cp); /*%< Other data length */
+ else {
+ PUTSHORT(INT16SZ+INT32SZ, cp); /*%< Other data length */
+ BOUNDS_CHECK(cp, INT32SZ+INT16SZ);
+ PUTSHORT(0, cp); /*%< Top 16 bits of time */
+ PUTLONG(timesigned, cp);
+ }
+
+ /* Go back and fill in the length. */
+ PUTSHORT(cp - lenp - INT16SZ, lenp);
+
+ hp->arcount = htons(ntohs(hp->arcount) + 1);
+ *msglen = (cp - msg);
+ return (0);
+}
+
+int
+ns_sign_tcp_init(void *k, const u_char *querysig, int querysiglen,
+ ns_tcp_tsig_state *state)
+{
+ dst_init();
+ if (state == NULL || k == NULL || querysig == NULL || querysiglen < 0)
+ return (-1);
+ state->counter = -1;
+ state->key = k;
+ if (state->key->dk_alg != KEY_HMAC_MD5)
+ return (-ns_r_badkey);
+ if (querysiglen > (int)sizeof(state->sig))
+ return (-1);
+ memcpy(state->sig, querysig, querysiglen);
+ state->siglen = querysiglen;
+ return (0);
+}
+
+int
+ns_sign_tcp(u_char *msg, int *msglen, int msgsize, int error,
+ ns_tcp_tsig_state *state, int done)
+{
+ return (ns_sign_tcp2(msg, msglen, msgsize, error, state,
+ done, NULL, NULL));
+}
+
+int
+ns_sign_tcp2(u_char *msg, int *msglen, int msgsize, int error,
+ ns_tcp_tsig_state *state, int done,
+ u_char **dnptrs, u_char **lastdnptr)
+{
+ u_char *cp, *eob, *lenp;
+ u_char buf[MAXDNAME], *cp2;
+ HEADER *hp = (HEADER *)msg;
+ time_t timesigned;
+ int n;
+
+ if (msg == NULL || msglen == NULL || state == NULL)
+ return (-1);
+
+ state->counter++;
+ if (state->counter == 0)
+ return (ns_sign2(msg, msglen, msgsize, error, state->key,
+ state->sig, state->siglen,
+ state->sig, &state->siglen, 0,
+ dnptrs, lastdnptr));
+
+ if (state->siglen > 0) {
+ u_int16_t siglen_n = htons(state->siglen);
+ dst_sign_data(SIG_MODE_INIT, state->key, &state->ctx,
+ NULL, 0, NULL, 0);
+ dst_sign_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ (u_char *)&siglen_n, INT16SZ, NULL, 0);
+ dst_sign_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ state->sig, state->siglen, NULL, 0);
+ state->siglen = 0;
+ }
+
+ dst_sign_data(SIG_MODE_UPDATE, state->key, &state->ctx, msg, *msglen,
+ NULL, 0);
+
+ if (done == 0 && (state->counter % 100 != 0))
+ return (0);
+
+ cp = msg + *msglen;
+ eob = msg + msgsize;
+
+ /* Name. */
+ n = dn_comp(state->key->dk_key_name, cp, eob - cp, dnptrs, lastdnptr);
+ if (n < 0)
+ return (NS_TSIG_ERROR_NO_SPACE);
+ cp += n;
+
+ /* Type, class, ttl, length (not filled in yet). */
+ BOUNDS_CHECK(cp, INT16SZ + INT16SZ + INT32SZ + INT16SZ);
+ PUTSHORT(ns_t_tsig, cp);
+ PUTSHORT(ns_c_any, cp);
+ PUTLONG(0, cp); /*%< TTL */
+ lenp = cp;
+ cp += 2;
+
+ /* Alg. */
+ n = dn_comp(NS_TSIG_ALG_HMAC_MD5, cp, eob - cp, NULL, NULL);
+ if (n < 0)
+ return (NS_TSIG_ERROR_NO_SPACE);
+ cp += n;
+
+ /* Time. */
+ BOUNDS_CHECK(cp, INT16SZ + INT32SZ + INT16SZ);
+ PUTSHORT(0, cp);
+ timesigned = time(NULL);
+ PUTLONG(timesigned, cp);
+ PUTSHORT(NS_TSIG_FUDGE, cp);
+
+ /*
+ * Compute the signature.
+ */
+
+ /* Digest the time signed and fudge. */
+ cp2 = buf;
+ PUTSHORT(0, cp2); /*%< Top 16 bits of time */
+ PUTLONG(timesigned, cp2);
+ PUTSHORT(NS_TSIG_FUDGE, cp2);
+
+ dst_sign_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ buf, cp2 - buf, NULL, 0);
+
+ n = dst_sign_data(SIG_MODE_FINAL, state->key, &state->ctx, NULL, 0,
+ state->sig, sizeof(state->sig));
+ if (n < 0)
+ return (-ns_r_badkey);
+ state->siglen = n;
+
+ /* Add the signature. */
+ BOUNDS_CHECK(cp, INT16SZ + state->siglen);
+ PUTSHORT(state->siglen, cp);
+ memcpy(cp, state->sig, state->siglen);
+ cp += state->siglen;
+
+ /* The original message ID & error. */
+ BOUNDS_CHECK(cp, INT16SZ + INT16SZ);
+ PUTSHORT(ntohs(hp->id), cp); /*%< already in network order */
+ PUTSHORT(error, cp);
+
+ /* Other data. */
+ BOUNDS_CHECK(cp, INT16SZ);
+ PUTSHORT(0, cp);
+
+ /* Go back and fill in the length. */
+ PUTSHORT(cp - lenp - INT16SZ, lenp);
+
+ hp->arcount = htons(ntohs(hp->arcount) + 1);
+ *msglen = (cp - msg);
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_ttl.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_ttl.c
new file mode 100644
index 0000000000..69c2f83f57
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_ttl.c
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_ttl.c,v 1.4 2005/07/28 06:51:49 marka Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/* Forward. */
+
+static int fmt1(int t, char s, char **buf, size_t *buflen);
+
+/* Macros. */
+
+#define T(x) if ((x) < 0) return (-1); else (void)NULL
+
+/* Public. */
+
+int
+ns_format_ttl(u_long src, char *dst, size_t dstlen) {
+ char *odst = dst;
+ int secs, mins, hours, days, weeks, x;
+ char *p;
+
+ secs = src % 60; src /= 60;
+ mins = src % 60; src /= 60;
+ hours = src % 24; src /= 24;
+ days = src % 7; src /= 7;
+ weeks = src; src = 0;
+
+ x = 0;
+ if (weeks) {
+ T(fmt1(weeks, 'W', &dst, &dstlen));
+ x++;
+ }
+ if (days) {
+ T(fmt1(days, 'D', &dst, &dstlen));
+ x++;
+ }
+ if (hours) {
+ T(fmt1(hours, 'H', &dst, &dstlen));
+ x++;
+ }
+ if (mins) {
+ T(fmt1(mins, 'M', &dst, &dstlen));
+ x++;
+ }
+ if (secs || !(weeks || days || hours || mins)) {
+ T(fmt1(secs, 'S', &dst, &dstlen));
+ x++;
+ }
+
+ if (x > 1) {
+ int ch;
+
+ for (p = odst; (ch = *p) != '\0'; p++)
+ if (isascii(ch) && isupper(ch))
+ *p = tolower(ch);
+ }
+
+ return (dst - odst);
+}
+
+int
+ns_parse_ttl(const char *src, u_long *dst) {
+ u_long ttl, tmp;
+ int ch, digits, dirty;
+
+ ttl = 0;
+ tmp = 0;
+ digits = 0;
+ dirty = 0;
+ while ((ch = *src++) != '\0') {
+ if (!isascii(ch) || !isprint(ch))
+ goto einval;
+ if (isdigit(ch)) {
+ tmp *= 10;
+ tmp += (ch - '0');
+ digits++;
+ continue;
+ }
+ if (digits == 0)
+ goto einval;
+ if (islower(ch))
+ ch = toupper(ch);
+ switch (ch) {
+ case 'W': tmp *= 7;
+ case 'D': tmp *= 24;
+ case 'H': tmp *= 60;
+ case 'M': tmp *= 60;
+ case 'S': break;
+ default: goto einval;
+ }
+ ttl += tmp;
+ tmp = 0;
+ digits = 0;
+ dirty = 1;
+ }
+ if (digits > 0) {
+ if (dirty)
+ goto einval;
+ else
+ ttl += tmp;
+ } else if (!dirty)
+ goto einval;
+ *dst = ttl;
+ return (0);
+
+ einval:
+ errno = EINVAL;
+ return (-1);
+}
+
+/* Private. */
+
+static int
+fmt1(int t, char s, char **buf, size_t *buflen) {
+ char tmp[50];
+ size_t len;
+
+ len = SPRINTF((tmp, "%d%c", t, s));
+ if (len + 1 > *buflen)
+ return (-1);
+ strcpy(*buf, tmp);
+ *buf += len;
+ *buflen -= len;
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/nameser/ns_verify.c b/usr/src/lib/libresolv2_joy/common/nameser/ns_verify.c
new file mode 100644
index 0000000000..b4b63d4641
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/nameser/ns_verify.c
@@ -0,0 +1,484 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium, Inc.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id: ns_verify.c,v 1.5 2006/03/09 23:57:56 marka Exp $";
+#endif
+
+/* Import. */
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <isc/dst.h>
+
+#include "port_after.h"
+
+/* Private. */
+
+#define BOUNDS_CHECK(ptr, count) \
+ do { \
+ if ((ptr) + (count) > eom) { \
+ return (NS_TSIG_ERROR_FORMERR); \
+ } \
+ } while (0)
+
+/* Public. */
+
+u_char *
+ns_find_tsig(u_char *msg, u_char *eom) {
+ HEADER *hp = (HEADER *)msg;
+ int n, type;
+ u_char *cp = msg, *start;
+
+ if (msg == NULL || eom == NULL || msg > eom)
+ return (NULL);
+
+ if (cp + HFIXEDSZ >= eom)
+ return (NULL);
+
+ if (hp->arcount == 0)
+ return (NULL);
+
+ cp += HFIXEDSZ;
+
+ n = ns_skiprr(cp, eom, ns_s_qd, ntohs(hp->qdcount));
+ if (n < 0)
+ return (NULL);
+ cp += n;
+
+ n = ns_skiprr(cp, eom, ns_s_an, ntohs(hp->ancount));
+ if (n < 0)
+ return (NULL);
+ cp += n;
+
+ n = ns_skiprr(cp, eom, ns_s_ns, ntohs(hp->nscount));
+ if (n < 0)
+ return (NULL);
+ cp += n;
+
+ n = ns_skiprr(cp, eom, ns_s_ar, ntohs(hp->arcount) - 1);
+ if (n < 0)
+ return (NULL);
+ cp += n;
+
+ start = cp;
+ n = dn_skipname(cp, eom);
+ if (n < 0)
+ return (NULL);
+ cp += n;
+ if (cp + INT16SZ >= eom)
+ return (NULL);
+
+ GETSHORT(type, cp);
+ if (type != ns_t_tsig)
+ return (NULL);
+ return (start);
+}
+
+/* ns_verify
+ *
+ * Parameters:
+ *\li statp res stuff
+ *\li msg received message
+ *\li msglen length of message
+ *\li key tsig key used for verifying.
+ *\li querysig (response), the signature in the query
+ *\li querysiglen (response), the length of the signature in the query
+ *\li sig (query), a buffer to hold the signature
+ *\li siglen (query), input - length of signature buffer
+ * output - length of signature
+ *
+ * Errors:
+ *\li - bad input (-1)
+ *\li - invalid dns message (NS_TSIG_ERROR_FORMERR)
+ *\li - TSIG is not present (NS_TSIG_ERROR_NO_TSIG)
+ *\li - key doesn't match (-ns_r_badkey)
+ *\li - TSIG verification fails with BADKEY (-ns_r_badkey)
+ *\li - TSIG verification fails with BADSIG (-ns_r_badsig)
+ *\li - TSIG verification fails with BADTIME (-ns_r_badtime)
+ *\li - TSIG verification succeeds, error set to BAKEY (ns_r_badkey)
+ *\li - TSIG verification succeeds, error set to BADSIG (ns_r_badsig)
+ *\li - TSIG verification succeeds, error set to BADTIME (ns_r_badtime)
+ */
+int
+ns_verify(u_char *msg, int *msglen, void *k,
+ const u_char *querysig, int querysiglen, u_char *sig, int *siglen,
+ time_t *timesigned, int nostrip)
+{
+ HEADER *hp = (HEADER *)msg;
+ DST_KEY *key = (DST_KEY *)k;
+ u_char *cp = msg, *eom;
+ char name[MAXDNAME], alg[MAXDNAME];
+ u_char *recstart, *rdatastart;
+ u_char *sigstart, *otherstart;
+ int n;
+ int error;
+ u_int16_t type, length;
+ u_int16_t fudge, sigfieldlen, otherfieldlen;
+
+ dst_init();
+ if (msg == NULL || msglen == NULL || *msglen < 0)
+ return (-1);
+
+ eom = msg + *msglen;
+
+ recstart = ns_find_tsig(msg, eom);
+ if (recstart == NULL)
+ return (NS_TSIG_ERROR_NO_TSIG);
+
+ cp = recstart;
+
+ /* Read the key name. */
+ n = dn_expand(msg, eom, cp, name, MAXDNAME);
+ if (n < 0)
+ return (NS_TSIG_ERROR_FORMERR);
+ cp += n;
+
+ /* Read the type. */
+ BOUNDS_CHECK(cp, 2*INT16SZ + INT32SZ + INT16SZ);
+ GETSHORT(type, cp);
+ if (type != ns_t_tsig)
+ return (NS_TSIG_ERROR_NO_TSIG);
+
+ /* Skip the class and TTL, save the length. */
+ cp += INT16SZ + INT32SZ;
+ GETSHORT(length, cp);
+ if (eom - cp != length)
+ return (NS_TSIG_ERROR_FORMERR);
+
+ /* Read the algorithm name. */
+ rdatastart = cp;
+ n = dn_expand(msg, eom, cp, alg, MAXDNAME);
+ if (n < 0)
+ return (NS_TSIG_ERROR_FORMERR);
+ if (ns_samename(alg, NS_TSIG_ALG_HMAC_MD5) != 1)
+ return (-ns_r_badkey);
+ cp += n;
+
+ /* Read the time signed and fudge. */
+ BOUNDS_CHECK(cp, INT16SZ + INT32SZ + INT16SZ);
+ cp += INT16SZ;
+ GETLONG((*timesigned), cp);
+ GETSHORT(fudge, cp);
+
+ /* Read the signature. */
+ BOUNDS_CHECK(cp, INT16SZ);
+ GETSHORT(sigfieldlen, cp);
+ BOUNDS_CHECK(cp, sigfieldlen);
+ sigstart = cp;
+ cp += sigfieldlen;
+
+ /* Skip id and read error. */
+ BOUNDS_CHECK(cp, 2*INT16SZ);
+ cp += INT16SZ;
+ GETSHORT(error, cp);
+
+ /* Parse the other data. */
+ BOUNDS_CHECK(cp, INT16SZ);
+ GETSHORT(otherfieldlen, cp);
+ BOUNDS_CHECK(cp, otherfieldlen);
+ otherstart = cp;
+ cp += otherfieldlen;
+
+ if (cp != eom)
+ return (NS_TSIG_ERROR_FORMERR);
+
+ /* Verify that the key used is OK. */
+ if (key != NULL) {
+ if (key->dk_alg != KEY_HMAC_MD5)
+ return (-ns_r_badkey);
+ if (error != ns_r_badsig && error != ns_r_badkey) {
+ if (ns_samename(key->dk_key_name, name) != 1)
+ return (-ns_r_badkey);
+ }
+ }
+
+ hp->arcount = htons(ntohs(hp->arcount) - 1);
+
+ /*
+ * Do the verification.
+ */
+
+ if (key != NULL && error != ns_r_badsig && error != ns_r_badkey) {
+ void *ctx;
+ u_char buf[MAXDNAME];
+ u_char buf2[MAXDNAME];
+
+ /* Digest the query signature, if this is a response. */
+ dst_verify_data(SIG_MODE_INIT, key, &ctx, NULL, 0, NULL, 0);
+ if (querysiglen > 0 && querysig != NULL) {
+ u_int16_t len_n = htons(querysiglen);
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx,
+ (u_char *)&len_n, INT16SZ, NULL, 0);
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx,
+ querysig, querysiglen, NULL, 0);
+ }
+
+ /* Digest the message. */
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx, msg, recstart - msg,
+ NULL, 0);
+
+ /* Digest the key name. */
+ n = ns_name_pton(name, buf2, sizeof(buf2));
+ if (n < 0)
+ return (-1);
+ n = ns_name_ntol(buf2, buf, sizeof(buf));
+ if (n < 0)
+ return (-1);
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx, buf, n, NULL, 0);
+
+ /* Digest the class and TTL. */
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx,
+ recstart + dn_skipname(recstart, eom) + INT16SZ,
+ INT16SZ + INT32SZ, NULL, 0);
+
+ /* Digest the algorithm. */
+ n = ns_name_pton(alg, buf2, sizeof(buf2));
+ if (n < 0)
+ return (-1);
+ n = ns_name_ntol(buf2, buf, sizeof(buf));
+ if (n < 0)
+ return (-1);
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx, buf, n, NULL, 0);
+
+ /* Digest the time signed and fudge. */
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx,
+ rdatastart + dn_skipname(rdatastart, eom),
+ INT16SZ + INT32SZ + INT16SZ, NULL, 0);
+
+ /* Digest the error and other data. */
+ dst_verify_data(SIG_MODE_UPDATE, key, &ctx,
+ otherstart - INT16SZ - INT16SZ,
+ otherfieldlen + INT16SZ + INT16SZ, NULL, 0);
+
+ n = dst_verify_data(SIG_MODE_FINAL, key, &ctx, NULL, 0,
+ sigstart, sigfieldlen);
+
+ if (n < 0)
+ return (-ns_r_badsig);
+
+ if (sig != NULL && siglen != NULL) {
+ if (*siglen < sigfieldlen)
+ return (NS_TSIG_ERROR_NO_SPACE);
+ memcpy(sig, sigstart, sigfieldlen);
+ *siglen = sigfieldlen;
+ }
+ } else {
+ if (sigfieldlen > 0)
+ return (NS_TSIG_ERROR_FORMERR);
+ if (sig != NULL && siglen != NULL)
+ *siglen = 0;
+ }
+
+ /* Reset the counter, since we still need to check for badtime. */
+ hp->arcount = htons(ntohs(hp->arcount) + 1);
+
+ /* Verify the time. */
+ if (abs((*timesigned) - time(NULL)) > fudge)
+ return (-ns_r_badtime);
+
+ if (nostrip == 0) {
+ *msglen = recstart - msg;
+ hp->arcount = htons(ntohs(hp->arcount) - 1);
+ }
+
+ if (error != NOERROR)
+ return (error);
+
+ return (0);
+}
+
+int
+ns_verify_tcp_init(void *k, const u_char *querysig, int querysiglen,
+ ns_tcp_tsig_state *state)
+{
+ dst_init();
+ if (state == NULL || k == NULL || querysig == NULL || querysiglen < 0)
+ return (-1);
+ state->counter = -1;
+ state->key = k;
+ if (state->key->dk_alg != KEY_HMAC_MD5)
+ return (-ns_r_badkey);
+ if (querysiglen > (int)sizeof(state->sig))
+ return (-1);
+ memcpy(state->sig, querysig, querysiglen);
+ state->siglen = querysiglen;
+ return (0);
+}
+
+int
+ns_verify_tcp(u_char *msg, int *msglen, ns_tcp_tsig_state *state,
+ int required)
+{
+ HEADER *hp = (HEADER *)msg;
+ u_char *recstart, *sigstart;
+ unsigned int sigfieldlen, otherfieldlen;
+ u_char *cp, *eom, *cp2;
+ char name[MAXDNAME], alg[MAXDNAME];
+ u_char buf[MAXDNAME];
+ int n, type, length, fudge, error;
+ time_t timesigned;
+
+ if (msg == NULL || msglen == NULL || state == NULL)
+ return (-1);
+
+ eom = msg + *msglen;
+
+ state->counter++;
+ if (state->counter == 0)
+ return (ns_verify(msg, msglen, state->key,
+ state->sig, state->siglen,
+ state->sig, &state->siglen, &timesigned, 0));
+
+ if (state->siglen > 0) {
+ u_int16_t siglen_n = htons(state->siglen);
+
+ dst_verify_data(SIG_MODE_INIT, state->key, &state->ctx,
+ NULL, 0, NULL, 0);
+ dst_verify_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ (u_char *)&siglen_n, INT16SZ, NULL, 0);
+ dst_verify_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ state->sig, state->siglen, NULL, 0);
+ state->siglen = 0;
+ }
+
+ cp = recstart = ns_find_tsig(msg, eom);
+
+ if (recstart == NULL) {
+ if (required)
+ return (NS_TSIG_ERROR_NO_TSIG);
+ dst_verify_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ msg, *msglen, NULL, 0);
+ return (0);
+ }
+
+ hp->arcount = htons(ntohs(hp->arcount) - 1);
+ dst_verify_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ msg, recstart - msg, NULL, 0);
+
+ /* Read the key name. */
+ n = dn_expand(msg, eom, cp, name, MAXDNAME);
+ if (n < 0)
+ return (NS_TSIG_ERROR_FORMERR);
+ cp += n;
+
+ /* Read the type. */
+ BOUNDS_CHECK(cp, 2*INT16SZ + INT32SZ + INT16SZ);
+ GETSHORT(type, cp);
+ if (type != ns_t_tsig)
+ return (NS_TSIG_ERROR_NO_TSIG);
+
+ /* Skip the class and TTL, save the length. */
+ cp += INT16SZ + INT32SZ;
+ GETSHORT(length, cp);
+ if (eom - cp != length)
+ return (NS_TSIG_ERROR_FORMERR);
+
+ /* Read the algorithm name. */
+ n = dn_expand(msg, eom, cp, alg, MAXDNAME);
+ if (n < 0)
+ return (NS_TSIG_ERROR_FORMERR);
+ if (ns_samename(alg, NS_TSIG_ALG_HMAC_MD5) != 1)
+ return (-ns_r_badkey);
+ cp += n;
+
+ /* Verify that the key used is OK. */
+ if ((ns_samename(state->key->dk_key_name, name) != 1 ||
+ state->key->dk_alg != KEY_HMAC_MD5))
+ return (-ns_r_badkey);
+
+ /* Read the time signed and fudge. */
+ BOUNDS_CHECK(cp, INT16SZ + INT32SZ + INT16SZ);
+ cp += INT16SZ;
+ GETLONG(timesigned, cp);
+ GETSHORT(fudge, cp);
+
+ /* Read the signature. */
+ BOUNDS_CHECK(cp, INT16SZ);
+ GETSHORT(sigfieldlen, cp);
+ BOUNDS_CHECK(cp, sigfieldlen);
+ sigstart = cp;
+ cp += sigfieldlen;
+
+ /* Skip id and read error. */
+ BOUNDS_CHECK(cp, 2*INT16SZ);
+ cp += INT16SZ;
+ GETSHORT(error, cp);
+
+ /* Parse the other data. */
+ BOUNDS_CHECK(cp, INT16SZ);
+ GETSHORT(otherfieldlen, cp);
+ BOUNDS_CHECK(cp, otherfieldlen);
+ cp += otherfieldlen;
+
+ if (cp != eom)
+ return (NS_TSIG_ERROR_FORMERR);
+
+ /*
+ * Do the verification.
+ */
+
+ /* Digest the time signed and fudge. */
+ cp2 = buf;
+ PUTSHORT(0, cp2); /*%< Top 16 bits of time. */
+ PUTLONG(timesigned, cp2);
+ PUTSHORT(NS_TSIG_FUDGE, cp2);
+
+ dst_verify_data(SIG_MODE_UPDATE, state->key, &state->ctx,
+ buf, cp2 - buf, NULL, 0);
+
+ n = dst_verify_data(SIG_MODE_FINAL, state->key, &state->ctx, NULL, 0,
+ sigstart, sigfieldlen);
+ if (n < 0)
+ return (-ns_r_badsig);
+
+ if (sigfieldlen > sizeof(state->sig))
+ return (NS_TSIG_ERROR_NO_SPACE);
+
+ memcpy(state->sig, sigstart, sigfieldlen);
+ state->siglen = sigfieldlen;
+
+ /* Verify the time. */
+ if (abs(timesigned - time(NULL)) > fudge)
+ return (-ns_r_badtime);
+
+ *msglen = recstart - msg;
+
+ if (error != NOERROR)
+ return (error);
+
+ return (0);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/herror.c b/usr/src/lib/libresolv2_joy/common/resolv/herror.c
new file mode 100644
index 0000000000..568ce3ce68
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/herror.c
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: herror.c,v 1.4 2005/04/27 04:56:41 sra Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/uio.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <string.h>
+#include <unistd.h>
+#include <irs.h>
+
+#include "port_after.h"
+
+const char *h_errlist[] = {
+ "Resolver Error 0 (no error)",
+ "Unknown host", /*%< 1 HOST_NOT_FOUND */
+ "Host name lookup failure", /*%< 2 TRY_AGAIN */
+ "Unknown server error", /*%< 3 NO_RECOVERY */
+ "No address associated with name", /*%< 4 NO_ADDRESS */
+};
+int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
+
+#if !(__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)
+#undef h_errno
+int h_errno;
+#endif
+
+/*%
+ * herror --
+ * print the error indicated by the h_errno value.
+ */
+void
+herror(const char *s) {
+ struct iovec iov[4], *v = iov;
+ char *t;
+
+ if (s != NULL && *s != '\0') {
+ DE_CONST(s, t);
+ v->iov_base = t;
+ v->iov_len = strlen(t);
+ v++;
+ DE_CONST(": ", t);
+ v->iov_base = t;
+ v->iov_len = 2;
+ v++;
+ }
+ DE_CONST(hstrerror(*__h_errno()), t);
+ v->iov_base = t;
+ v->iov_len = strlen(v->iov_base);
+ v++;
+ DE_CONST("\n", t);
+ v->iov_base = t;
+ v->iov_len = 1;
+ writev(STDERR_FILENO, iov, (v - iov) + 1);
+}
+
+/*%
+ * hstrerror --
+ * return the string associated with a given "host" errno value.
+ */
+const char *
+hstrerror(int err) {
+ if (err < 0)
+ return ("Resolver internal error");
+ else if (err < h_nerr)
+ return (h_errlist[err]);
+ return ("Unknown resolver error");
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/mtctxres.c b/usr/src/lib/libresolv2_joy/common/resolv/mtctxres.c
new file mode 100644
index 0000000000..2e79b1e7b4
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/mtctxres.c
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#include <port_before.h>
+#ifdef DO_PTHREADS
+#include <pthread.h>
+#endif
+#include <errno.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <string.h>
+#include <resolv_mt.h>
+#include <irs.h>
+#include <port_after.h>
+
+#ifdef DO_PTHREADS
+static pthread_key_t key;
+static int mt_key_initialized = 0;
+
+static int __res_init_ctx(void);
+static void __res_destroy_ctx(void *);
+
+#if defined(sun) && !defined(__GNUC__)
+#pragma init (_mtctxres_init)
+#endif
+#endif
+
+static mtctxres_t sharedctx;
+
+#ifdef DO_PTHREADS
+/*
+ * Initialize the TSD key. By doing this at library load time, we're
+ * implicitly running without interference from other threads, so there's
+ * no need for locking.
+ */
+static void
+_mtctxres_init(void) {
+ int pthread_keycreate_ret;
+
+ pthread_keycreate_ret = pthread_key_create(&key, __res_destroy_ctx);
+ if (pthread_keycreate_ret == 0)
+ mt_key_initialized = 1;
+}
+#endif
+
+/*
+ * To support binaries that used the private MT-safe interface in
+ * Solaris 8, we still need to provide the __res_enable_mt()
+ * and __res_disable_mt() entry points. They're do-nothing routines.
+ */
+int
+__res_enable_mt(void) {
+ return (-1);
+}
+
+int
+__res_disable_mt(void) {
+ return (0);
+}
+
+#ifdef DO_PTHREADS
+static int
+__res_init_ctx(void) {
+
+ mtctxres_t *mt;
+ int ret;
+
+
+ if (pthread_getspecific(key) != 0) {
+ /* Already exists */
+ return (0);
+ }
+
+ if ((mt = malloc(sizeof (mtctxres_t))) == 0) {
+ errno = ENOMEM;
+ return (-1);
+ }
+
+ memset(mt, 0, sizeof (mtctxres_t));
+
+ if ((ret = pthread_setspecific(key, mt)) != 0) {
+ free(mt);
+ errno = ret;
+ return (-1);
+ }
+
+ return (0);
+}
+
+static void
+__res_destroy_ctx(void *value) {
+
+ mtctxres_t *mt = (mtctxres_t *)value;
+
+ if (mt != 0)
+ free(mt);
+}
+#endif
+
+mtctxres_t *
+___mtctxres(void) {
+#ifdef DO_PTHREADS
+ mtctxres_t *mt;
+
+ /*
+ * This if clause should only be executed if we are linking
+ * statically. When linked dynamically _mtctxres_init() should
+ * be called at binding time due the #pragma above.
+ */
+ if (!mt_key_initialized) {
+ static pthread_mutex_t keylock = PTHREAD_MUTEX_INITIALIZER;
+ if (pthread_mutex_lock(&keylock) == 0) {
+ _mtctxres_init();
+ (void) pthread_mutex_unlock(&keylock);
+ }
+ }
+
+ /*
+ * If we have already been called in this thread return the existing
+ * context. Otherwise recreat a new context and return it. If
+ * that fails return a global context.
+ */
+ if (mt_key_initialized) {
+ if (((mt = pthread_getspecific(key)) != 0) ||
+ (__res_init_ctx() == 0 &&
+ (mt = pthread_getspecific(key)) != 0)) {
+ return (mt);
+ }
+ }
+#endif
+ return (&sharedctx);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_comp.c b/usr/src/lib/libresolv2_joy/common/resolv/res_comp.c
new file mode 100644
index 0000000000..c82bf01eb8
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_comp.c
@@ -0,0 +1,287 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (c) 1985, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: res_comp.c,v 1.5 2005/07/28 06:51:50 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+#include <sys/types.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <ctype.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include "port_after.h"
+
+#ifndef ORIGINAL_ISC_CODE
+#pragma weak __dn_skipname = dn_skipname
+#pragma weak __res_dnok = res_dnok
+#pragma weak __res_hnok = res_hnok
+#pragma weak __res_mailok = res_mailok
+#pragma weak __res_ownok = res_ownok
+#endif /* ORIGINAL_ISC_CODE */
+
+/*%
+ * Expand compressed domain name 'src' to full domain name.
+ *
+ * \li 'msg' is a pointer to the begining of the message,
+ * \li 'eom' points to the first location after the message,
+ * \li 'dst' is a pointer to a buffer of size 'dstsiz' for the result.
+ * \li Return size of compressed name or -1 if there was an error.
+ */
+int
+dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
+ char *dst, int dstsiz)
+{
+ int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
+
+ if (n > 0 && dst[0] == '.')
+ dst[0] = '\0';
+ return (n);
+}
+
+/*%
+ * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
+ *
+ * \li Return the size of the compressed name or -1.
+ * \li 'length' is the size of the array pointed to by 'comp_dn'.
+ */
+int
+dn_comp(const char *src, u_char *dst, int dstsiz,
+ u_char **dnptrs, u_char **lastdnptr)
+{
+ return (ns_name_compress(src, dst, (size_t)dstsiz,
+ (const u_char **)dnptrs,
+ (const u_char **)lastdnptr));
+}
+
+
+/*%
+ * Skip over a compressed domain name. Return the size or -1.
+ */
+int
+dn_skipname(const u_char *ptr, const u_char *eom) {
+ const u_char *saveptr = ptr;
+
+ if (ns_name_skip(&ptr, eom) == -1)
+ return (-1);
+ return (ptr - saveptr);
+}
+
+/*%
+ * Verify that a domain name uses an acceptable character set.
+ *
+ * Note the conspicuous absence of ctype macros in these definitions. On
+ * non-ASCII hosts, we can't depend on string literals or ctype macros to
+ * tell us anything about network-format data. The rest of the BIND system
+ * is not careful about this, but for some reason, we're doing it right here.
+ */
+#define PERIOD 0x2e
+#define hyphenchar(c) ((c) == 0x2d)
+#define bslashchar(c) ((c) == 0x5c)
+#ifdef SUNW_HNOK_UNDERSCORE
+#define underscorechar(c) ((c) == 0x5f)
+#endif /* SUNW_HNOK_UNDERSCORE */
+#define periodchar(c) ((c) == PERIOD)
+#define asterchar(c) ((c) == 0x2a)
+#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
+ || ((c) >= 0x61 && (c) <= 0x7a))
+#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
+
+#define borderchar(c) (alphachar(c) || digitchar(c))
+#ifdef SUNW_HNOK_UNDERSCORE
+#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
+#else
+#define middlechar(c) (borderchar(c) || hyphenchar(c))
+#endif /* SUNW_HNOK_UNDERSCORE */
+#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
+
+int
+res_hnok(const char *dn) {
+ int pch = PERIOD, ch = *dn++;
+
+ while (ch != '\0') {
+ int nch = *dn++;
+
+ if (periodchar(ch)) {
+ (void)NULL;
+ } else if (periodchar(pch)) {
+ if (!borderchar(ch))
+ return (0);
+ } else if (periodchar(nch) || nch == '\0') {
+ if (!borderchar(ch))
+ return (0);
+ } else {
+ if (!middlechar(ch))
+ return (0);
+ }
+ pch = ch, ch = nch;
+ }
+ return (1);
+}
+
+/*%
+ * hostname-like (A, MX, WKS) owners can have "*" as their first label
+ * but must otherwise be as a host name.
+ */
+int
+res_ownok(const char *dn) {
+ if (asterchar(dn[0])) {
+ if (periodchar(dn[1]))
+ return (res_hnok(dn+2));
+ if (dn[1] == '\0')
+ return (1);
+ }
+ return (res_hnok(dn));
+}
+
+/*%
+ * SOA RNAMEs and RP RNAMEs can have any printable character in their first
+ * label, but the rest of the name has to look like a host name.
+ */
+int
+res_mailok(const char *dn) {
+ int ch, escaped = 0;
+
+ /* "." is a valid missing representation */
+ if (*dn == '\0')
+ return (1);
+
+ /* otherwise <label>.<hostname> */
+ while ((ch = *dn++) != '\0') {
+ if (!domainchar(ch))
+ return (0);
+ if (!escaped && periodchar(ch))
+ break;
+ if (escaped)
+ escaped = 0;
+ else if (bslashchar(ch))
+ escaped = 1;
+ }
+ if (periodchar(ch))
+ return (res_hnok(dn));
+ return (0);
+}
+
+/*%
+ * This function is quite liberal, since RFC1034's character sets are only
+ * recommendations.
+ */
+int
+res_dnok(const char *dn) {
+ int ch;
+
+ while ((ch = *dn++) != '\0')
+ if (!domainchar(ch))
+ return (0);
+ return (1);
+}
+
+#ifdef BIND_4_COMPAT
+/*%
+ * This module must export the following externally-visible symbols:
+ * ___putlong
+ * ___putshort
+ * __getlong
+ * __getshort
+ * Note that one _ comes from C and the others come from us.
+ */
+
+#ifdef SOLARIS2
+#ifdef __putlong
+#undef __putlong
+#endif
+#ifdef __putshort
+#undef __putshort
+#endif
+#pragma weak putlong = __putlong
+#pragma weak putshort = __putshort
+#endif /* SOLARIS2 */
+
+void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
+void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
+#ifndef __ultrix__
+u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
+u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
+#endif /*__ultrix__*/
+#endif /*BIND_4_COMPAT*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_data.c b/usr/src/lib/libresolv2_joy/common/resolv/res_data.c
new file mode 100644
index 0000000000..f1e0dd030b
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_data.c
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1995-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char rcsid[] = "$Id: res_data.c,v 1.7 2008/12/11 09:59:00 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <res_update.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "port_after.h"
+
+#ifndef ORIGINAL_ISC_CODE
+#pragma weak __fp_nquery = fp_nquery
+#pragma weak __fp_query = fp_query
+#pragma weak __p_query = p_query
+#pragma weak __hostalias = hostalias
+#pragma weak __res_randomid = res_randomid
+#endif
+
+const char *_res_opcodes[] = {
+ "QUERY",
+ "IQUERY",
+ "CQUERYM",
+ "CQUERYU", /*%< experimental */
+ "NOTIFY", /*%< experimental */
+ "UPDATE",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12",
+ "13",
+ "ZONEINIT",
+ "ZONEREF",
+};
+
+#ifdef BIND_UPDATE
+const char *_res_sectioncodes[] = {
+ "ZONE",
+ "PREREQUISITES",
+ "UPDATE",
+ "ADDITIONAL",
+};
+#endif
+
+#undef _res
+#ifndef __BIND_NOSTATIC
+struct __res_state _res
+# if defined(__BIND_RES_TEXT)
+ = { RES_TIMEOUT, } /*%< Motorola, et al. */
+# endif
+ ;
+
+#ifdef ORIGINAL_ISC_CODE
+#if defined(DO_PTHREADS) || defined(__linux)
+#define _res (*__res_state())
+#endif
+#endif
+
+/* Proto. */
+
+int res_ourserver_p(const res_state, const struct sockaddr_in *);
+
+int
+res_init(void) {
+ extern int __res_vinit(res_state, int);
+
+ /*
+ * These three fields used to be statically initialized. This made
+ * it hard to use this code in a shared library. It is necessary,
+ * now that we're doing dynamic initialization here, that we preserve
+ * the old semantics: if an application modifies one of these three
+ * fields of _res before res_init() is called, res_init() will not
+ * alter them. Of course, if an application is setting them to
+ * _zero_ before calling res_init(), hoping to override what used
+ * to be the static default, we can't detect it and unexpected results
+ * will follow. Zero for any of these fields would make no sense,
+ * so one can safely assume that the applications were already getting
+ * unexpected results.
+ *
+ * _res.options is tricky since some apps were known to diddle the bits
+ * before res_init() was first called. We can't replicate that semantic
+ * with dynamic initialization (they may have turned bits off that are
+ * set in RES_DEFAULT). Our solution is to declare such applications
+ * "broken". They could fool us by setting RES_INIT but none do (yet).
+ */
+ if (!_res.retrans)
+ _res.retrans = RES_TIMEOUT;
+ if (!_res.retry)
+ _res.retry = 4;
+ if (!(_res.options & RES_INIT))
+ _res.options = RES_DEFAULT;
+
+ /*
+ * This one used to initialize implicitly to zero, so unless the app
+ * has set it to something in particular, we can randomize it now.
+ */
+ if (!_res.id)
+ _res.id = res_nrandomid(&_res);
+
+ return (__res_vinit(&_res, 1));
+}
+
+void
+p_query(const u_char *msg) {
+ fp_query(msg, stdout);
+}
+
+void
+fp_query(const u_char *msg, FILE *file) {
+ fp_nquery(msg, PACKETSZ, file);
+}
+
+void
+fp_nquery(const u_char *msg, int len, FILE *file) {
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1)
+ return;
+
+ res_pquery(&_res, msg, len, file);
+}
+
+int
+res_mkquery(int op, /*!< opcode of query */
+ const char *dname, /*!< domain name */
+ int class, int type, /*!< class and type of query */
+ const u_char *data, /*!< resource record data */
+ int datalen, /*!< length of data */
+ const u_char *newrr_in, /*!< new rr for modify or append */
+ u_char *buf, /*!< buffer to put query */
+ int buflen) /*!< size of buffer */
+{
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+ return (res_nmkquery(&_res, op, dname, class, type,
+ data, datalen,
+ newrr_in, buf, buflen));
+}
+
+int
+res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+
+ return (res_nmkupdate(&_res, rrecp_in, buf, buflen));
+}
+
+int
+res_query(const char *name, /*!< domain name */
+ int class, int type, /*!< class and type of query */
+ u_char *answer, /*!< buffer to put answer */
+ int anslen) /*!< size of answer buffer */
+{
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+ return (res_nquery(&_res, name, class, type, answer, anslen));
+}
+
+void
+res_send_setqhook(res_send_qhook hook) {
+ _res.qhook = hook;
+}
+
+void
+res_send_setrhook(res_send_rhook hook) {
+ _res.rhook = hook;
+}
+
+int
+res_isourserver(const struct sockaddr_in *inp) {
+ return (res_ourserver_p(&_res, inp));
+}
+
+int
+res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) {
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ /* errno should have been set by res_init() in this case. */
+ return (-1);
+ }
+
+ return (res_nsend(&_res, buf, buflen, ans, anssiz));
+}
+
+int
+res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
+ u_char *ans, int anssiz)
+{
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ /* errno should have been set by res_init() in this case. */
+ return (-1);
+ }
+
+ return (res_nsendsigned(&_res, buf, buflen, key, ans, anssiz));
+}
+
+void
+res_close(void) {
+ res_nclose(&_res);
+}
+
+int
+res_update(ns_updrec *rrecp_in) {
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+
+ return (res_nupdate(&_res, rrecp_in, NULL));
+}
+
+int
+res_search(const char *name, /*!< domain name */
+ int class, int type, /*!< class and type of query */
+ u_char *answer, /*!< buffer to put answer */
+ int anslen) /*!< size of answer */
+{
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+
+ return (res_nsearch(&_res, name, class, type, answer, anslen));
+}
+
+int
+res_querydomain(const char *name,
+ const char *domain,
+ int class, int type, /*!< class and type of query */
+ u_char *answer, /*!< buffer to put answer */
+ int anslen) /*!< size of answer */
+{
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+
+ return (res_nquerydomain(&_res, name, domain,
+ class, type,
+ answer, anslen));
+}
+
+u_int
+res_randomid(void) {
+ if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
+ RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
+ return (-1);
+ }
+
+ return (res_nrandomid(&_res));
+}
+
+const char *
+hostalias(const char *name) {
+ static char abuf[MAXDNAME];
+
+ return (res_hostalias(&_res, name, abuf, sizeof abuf));
+}
+
+#ifdef ultrix
+int
+local_hostname_length(const char *hostname) {
+ int len_host, len_domain;
+
+ if (!*_res.defdname)
+ res_init();
+ len_host = strlen(hostname);
+ len_domain = strlen(_res.defdname);
+ if (len_host > len_domain &&
+ !strcasecmp(hostname + len_host - len_domain, _res.defdname) &&
+ hostname[len_host - len_domain - 1] == '.')
+ return (len_host - len_domain - 1);
+ return (0);
+}
+#endif /*ultrix*/
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_debug.c b/usr/src/lib/libresolv2_joy/common/resolv/res_debug.c
new file mode 100644
index 0000000000..e11fb29612
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_debug.c
@@ -0,0 +1,1252 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1985
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: res_debug.c,v 1.19 2009/02/26 11:20:20 tbox Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <math.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <resolv_mt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "port_after.h"
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) sprintf x
+#endif
+
+extern const char *_res_opcodes[];
+extern const char *_res_sectioncodes[];
+
+#ifndef ORIGINAL_ISC_CODE
+#pragma weak __dn_count_labels = dn_count_labels
+#pragma weak __fp_resstat = fp_resstat
+#pragma weak __loc_aton = loc_aton
+#pragma weak __loc_ntoa = loc_ntoa
+#pragma weak __p_cdname = p_cdname
+#pragma weak __p_class = p_class
+#pragma weak __p_section = p_section
+#pragma weak __p_time = p_time
+#pragma weak __p_type = p_type
+#pragma weak __sym_ntop = sym_ntop
+#pragma weak __sym_ntos = sym_ntos
+#pragma weak __sym_ston = sym_ston
+#endif /* ORIGINAL_ISC_CODE */
+
+/*%
+ * Print the current options.
+ */
+void
+fp_resstat(const res_state statp, FILE *file) {
+ u_long mask;
+
+ fprintf(file, ";; res options:");
+ for (mask = 1; mask != 0U; mask <<= 1)
+ if (statp->options & mask)
+ fprintf(file, " %s", p_option(mask));
+ putc('\n', file);
+}
+
+static void
+do_section(const res_state statp,
+ ns_msg *handle, ns_sect section,
+ int pflag, FILE *file)
+{
+ int n, sflag, rrnum;
+ static int buflen = 2048;
+ char *buf;
+ ns_opcode opcode;
+ ns_rr rr;
+
+ /*
+ * Print answer records.
+ */
+ sflag = (statp->pfcode & pflag);
+ if (statp->pfcode && !sflag)
+ return;
+
+ buf = malloc(buflen);
+ if (buf == NULL) {
+ fprintf(file, ";; memory allocation failure\n");
+ return;
+ }
+
+ opcode = (ns_opcode) ns_msg_getflag(*handle, ns_f_opcode);
+ rrnum = 0;
+ for (;;) {
+ if (ns_parserr(handle, section, rrnum, &rr)) {
+ if (errno != ENODEV)
+ fprintf(file, ";; ns_parserr: %s\n",
+ strerror(errno));
+ else if (rrnum > 0 && sflag != 0 &&
+ (statp->pfcode & RES_PRF_HEAD1))
+ putc('\n', file);
+ goto cleanup;
+ }
+ if (rrnum == 0 && sflag != 0 && (statp->pfcode & RES_PRF_HEAD1))
+ fprintf(file, ";; %s SECTION:\n",
+ p_section(section, opcode));
+ if (section == ns_s_qd)
+ fprintf(file, ";;\t%s, type = %s, class = %s\n",
+ ns_rr_name(rr),
+ p_type(ns_rr_type(rr)),
+ p_class(ns_rr_class(rr)));
+ else if (section == ns_s_ar && ns_rr_type(rr) == ns_t_opt) {
+ u_int16_t optcode, optlen, rdatalen = ns_rr_rdlen(rr);
+ u_int32_t ttl = ns_rr_ttl(rr);
+
+ fprintf(file,
+ "; EDNS: version: %u, udp=%u, flags=%04x\n",
+ (ttl>>16)&0xff, ns_rr_class(rr), ttl&0xffff);
+
+ while (rdatalen >= 4) {
+ const u_char *cp = ns_rr_rdata(rr);
+ int i;
+
+ GETSHORT(optcode, cp);
+ GETSHORT(optlen, cp);
+
+ if (optcode == NS_OPT_NSID) {
+ fputs("; NSID: ", file);
+ if (optlen == 0) {
+ fputs("; NSID\n", file);
+ } else {
+ fputs("; NSID: ", file);
+ for (i = 0; i < optlen; i++)
+ fprintf(file, "%02x ",
+ cp[i]);
+ fputs(" (",file);
+ for (i = 0; i < optlen; i++)
+ fprintf(file, "%c",
+ isprint(cp[i])?
+ cp[i] : '.');
+ fputs(")\n", file);
+ }
+ } else {
+ if (optlen == 0) {
+ fprintf(file, "; OPT=%u\n",
+ optcode);
+ } else {
+ fprintf(file, "; OPT=%u: ",
+ optcode);
+ for (i = 0; i < optlen; i++)
+ fprintf(file, "%02x ",
+ cp[i]);
+ fputs(" (",file);
+ for (i = 0; i < optlen; i++)
+ fprintf(file, "%c",
+ isprint(cp[i]) ?
+ cp[i] : '.');
+ fputs(")\n", file);
+ }
+ }
+ rdatalen -= 4 + optlen;
+ }
+ } else {
+ n = ns_sprintrr(handle, &rr, NULL, NULL,
+ buf, buflen);
+ if (n < 0) {
+ if (errno == ENOSPC) {
+ free(buf);
+ buf = NULL;
+ if (buflen < 131072)
+ buf = malloc(buflen += 1024);
+ if (buf == NULL) {
+ fprintf(file,
+ ";; memory allocation failure\n");
+ return;
+ }
+ continue;
+ }
+ fprintf(file, ";; ns_sprintrr: %s\n",
+ strerror(errno));
+ goto cleanup;
+ }
+ fputs(buf, file);
+ fputc('\n', file);
+ }
+ rrnum++;
+ }
+ cleanup:
+ if (buf != NULL)
+ free(buf);
+}
+
+/*%
+ * Print the contents of a query.
+ * This is intended to be primarily a debugging routine.
+ */
+void
+res_pquery(const res_state statp, const u_char *msg, int len, FILE *file) {
+ ns_msg handle;
+ int qdcount, ancount, nscount, arcount;
+ u_int opcode, rcode, id;
+
+ if (ns_initparse(msg, len, &handle) < 0) {
+ fprintf(file, ";; ns_initparse: %s\n", strerror(errno));
+ return;
+ }
+ opcode = ns_msg_getflag(handle, ns_f_opcode);
+ rcode = ns_msg_getflag(handle, ns_f_rcode);
+ id = ns_msg_id(handle);
+ qdcount = ns_msg_count(handle, ns_s_qd);
+ ancount = ns_msg_count(handle, ns_s_an);
+ nscount = ns_msg_count(handle, ns_s_ns);
+ arcount = ns_msg_count(handle, ns_s_ar);
+
+ /*
+ * Print header fields.
+ */
+ if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEADX) || rcode)
+ fprintf(file,
+ ";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
+ _res_opcodes[opcode], p_rcode(rcode), id);
+ if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEADX))
+ putc(';', file);
+ if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEAD2)) {
+ fprintf(file, "; flags:");
+ if (ns_msg_getflag(handle, ns_f_qr))
+ fprintf(file, " qr");
+ if (ns_msg_getflag(handle, ns_f_aa))
+ fprintf(file, " aa");
+ if (ns_msg_getflag(handle, ns_f_tc))
+ fprintf(file, " tc");
+ if (ns_msg_getflag(handle, ns_f_rd))
+ fprintf(file, " rd");
+ if (ns_msg_getflag(handle, ns_f_ra))
+ fprintf(file, " ra");
+ if (ns_msg_getflag(handle, ns_f_z))
+ fprintf(file, " ??");
+ if (ns_msg_getflag(handle, ns_f_ad))
+ fprintf(file, " ad");
+ if (ns_msg_getflag(handle, ns_f_cd))
+ fprintf(file, " cd");
+ }
+ if ((!statp->pfcode) || (statp->pfcode & RES_PRF_HEAD1)) {
+ fprintf(file, "; %s: %d",
+ p_section(ns_s_qd, opcode), qdcount);
+ fprintf(file, ", %s: %d",
+ p_section(ns_s_an, opcode), ancount);
+ fprintf(file, ", %s: %d",
+ p_section(ns_s_ns, opcode), nscount);
+ fprintf(file, ", %s: %d",
+ p_section(ns_s_ar, opcode), arcount);
+ }
+ if ((!statp->pfcode) || (statp->pfcode &
+ (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
+ putc('\n',file);
+ }
+ /*
+ * Print the various sections.
+ */
+ do_section(statp, &handle, ns_s_qd, RES_PRF_QUES, file);
+ do_section(statp, &handle, ns_s_an, RES_PRF_ANS, file);
+ do_section(statp, &handle, ns_s_ns, RES_PRF_AUTH, file);
+ do_section(statp, &handle, ns_s_ar, RES_PRF_ADD, file);
+ if (qdcount == 0 && ancount == 0 &&
+ nscount == 0 && arcount == 0)
+ putc('\n', file);
+}
+
+const u_char *
+p_cdnname(const u_char *cp, const u_char *msg, int len, FILE *file) {
+ char name[MAXDNAME];
+ int n;
+
+ if ((n = dn_expand(msg, msg + len, cp, name, sizeof name)) < 0)
+ return (NULL);
+ if (name[0] == '\0')
+ putc('.', file);
+ else
+ fputs(name, file);
+ return (cp + n);
+}
+
+const u_char *
+p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
+ return (p_cdnname(cp, msg, PACKETSZ, file));
+}
+
+/*%
+ * Return a fully-qualified domain name from a compressed name (with
+ length supplied). */
+
+const u_char *
+p_fqnname(cp, msg, msglen, name, namelen)
+ const u_char *cp, *msg;
+ int msglen;
+ char *name;
+ int namelen;
+{
+ int n, newlen;
+
+ if ((n = dn_expand(msg, cp + msglen, cp, name, namelen)) < 0)
+ return (NULL);
+ newlen = strlen(name);
+ if (newlen == 0 || name[newlen - 1] != '.') {
+ if (newlen + 1 >= namelen) /*%< Lack space for final dot */
+ return (NULL);
+ else
+ strcpy(name + newlen, ".");
+ }
+ return (cp + n);
+}
+
+/* XXX: the rest of these functions need to become length-limited, too. */
+
+const u_char *
+p_fqname(const u_char *cp, const u_char *msg, FILE *file) {
+ char name[MAXDNAME];
+ const u_char *n;
+
+ n = p_fqnname(cp, msg, MAXCDNAME, name, sizeof name);
+ if (n == NULL)
+ return (NULL);
+ fputs(name, file);
+ return (n);
+}
+
+/*%
+ * Names of RR classes and qclasses. Classes and qclasses are the same, except
+ * that C_ANY is a qclass but not a class. (You can ask for records of class
+ * C_ANY, but you can't have any records of that class in the database.)
+ */
+const struct res_sym __p_class_syms[] = {
+ {C_IN, "IN", (char *)0},
+ {C_CHAOS, "CH", (char *)0},
+ {C_CHAOS, "CHAOS", (char *)0},
+ {C_HS, "HS", (char *)0},
+ {C_HS, "HESIOD", (char *)0},
+ {C_ANY, "ANY", (char *)0},
+ {C_NONE, "NONE", (char *)0},
+ {C_IN, (char *)0, (char *)0}
+};
+
+/*%
+ * Names of message sections.
+ */
+const struct res_sym __p_default_section_syms[] = {
+ {ns_s_qd, "QUERY", (char *)0},
+ {ns_s_an, "ANSWER", (char *)0},
+ {ns_s_ns, "AUTHORITY", (char *)0},
+ {ns_s_ar, "ADDITIONAL", (char *)0},
+ {0, (char *)0, (char *)0}
+};
+
+const struct res_sym __p_update_section_syms[] = {
+ {S_ZONE, "ZONE", (char *)0},
+ {S_PREREQ, "PREREQUISITE", (char *)0},
+ {S_UPDATE, "UPDATE", (char *)0},
+ {S_ADDT, "ADDITIONAL", (char *)0},
+ {0, (char *)0, (char *)0}
+};
+
+const struct res_sym __p_key_syms[] = {
+ {NS_ALG_MD5RSA, "RSA", "RSA KEY with MD5 hash"},
+ {NS_ALG_DH, "DH", "Diffie Hellman"},
+ {NS_ALG_DSA, "DSA", "Digital Signature Algorithm"},
+ {NS_ALG_EXPIRE_ONLY, "EXPIREONLY", "No algorithm"},
+ {NS_ALG_PRIVATE_OID, "PRIVATE", "Algorithm obtained from OID"},
+ {0, NULL, NULL}
+};
+
+const struct res_sym __p_cert_syms[] = {
+ {cert_t_pkix, "PKIX", "PKIX (X.509v3) Certificate"},
+ {cert_t_spki, "SPKI", "SPKI certificate"},
+ {cert_t_pgp, "PGP", "PGP certificate"},
+ {cert_t_url, "URL", "URL Private"},
+ {cert_t_oid, "OID", "OID Private"},
+ {0, NULL, NULL}
+};
+
+/*%
+ * Names of RR types and qtypes. Types and qtypes are the same, except
+ * that T_ANY is a qtype but not a type. (You can ask for records of type
+ * T_ANY, but you can't have any records of that type in the database.)
+ */
+const struct res_sym __p_type_syms[] = {
+ {ns_t_a, "A", "address"},
+ {ns_t_ns, "NS", "name server"},
+ {ns_t_md, "MD", "mail destination (deprecated)"},
+ {ns_t_mf, "MF", "mail forwarder (deprecated)"},
+ {ns_t_cname, "CNAME", "canonical name"},
+ {ns_t_soa, "SOA", "start of authority"},
+ {ns_t_mb, "MB", "mailbox"},
+ {ns_t_mg, "MG", "mail group member"},
+ {ns_t_mr, "MR", "mail rename"},
+ {ns_t_null, "NULL", "null"},
+ {ns_t_wks, "WKS", "well-known service (deprecated)"},
+ {ns_t_ptr, "PTR", "domain name pointer"},
+ {ns_t_hinfo, "HINFO", "host information"},
+ {ns_t_minfo, "MINFO", "mailbox information"},
+ {ns_t_mx, "MX", "mail exchanger"},
+ {ns_t_txt, "TXT", "text"},
+ {ns_t_rp, "RP", "responsible person"},
+ {ns_t_afsdb, "AFSDB", "DCE or AFS server"},
+ {ns_t_x25, "X25", "X25 address"},
+ {ns_t_isdn, "ISDN", "ISDN address"},
+ {ns_t_rt, "RT", "router"},
+ {ns_t_nsap, "NSAP", "nsap address"},
+ {ns_t_nsap_ptr, "NSAP_PTR", "domain name pointer"},
+ {ns_t_sig, "SIG", "signature"},
+ {ns_t_key, "KEY", "key"},
+ {ns_t_px, "PX", "mapping information"},
+ {ns_t_gpos, "GPOS", "geographical position (withdrawn)"},
+ {ns_t_aaaa, "AAAA", "IPv6 address"},
+ {ns_t_loc, "LOC", "location"},
+ {ns_t_nxt, "NXT", "next valid name (unimplemented)"},
+ {ns_t_eid, "EID", "endpoint identifier (unimplemented)"},
+ {ns_t_nimloc, "NIMLOC", "NIMROD locator (unimplemented)"},
+ {ns_t_srv, "SRV", "server selection"},
+ {ns_t_atma, "ATMA", "ATM address (unimplemented)"},
+ {ns_t_naptr, "NAPTR", "naptr"},
+ {ns_t_kx, "KX", "key exchange"},
+ {ns_t_cert, "CERT", "certificate"},
+ {ns_t_a6, "A", "IPv6 address (experminental)"},
+ {ns_t_dname, "DNAME", "non-terminal redirection"},
+ {ns_t_opt, "OPT", "opt"},
+ {ns_t_apl, "apl", "apl"},
+ {ns_t_ds, "DS", "delegation signer"},
+ {ns_t_sshfp, "SSFP", "SSH fingerprint"},
+ {ns_t_ipseckey, "IPSECKEY", "IPSEC key"},
+ {ns_t_rrsig, "RRSIG", "rrsig"},
+ {ns_t_nsec, "NSEC", "nsec"},
+ {ns_t_dnskey, "DNSKEY", "DNS key"},
+ {ns_t_dhcid, "DHCID", "dynamic host configuration identifier"},
+ {ns_t_nsec3, "NSEC3", "nsec3"},
+ {ns_t_nsec3param, "NSEC3PARAM", "NSEC3 parameters"},
+ {ns_t_hip, "HIP", "host identity protocol"},
+ {ns_t_spf, "SPF", "sender policy framework"},
+ {ns_t_tkey, "TKEY", "tkey"},
+ {ns_t_tsig, "TSIG", "transaction signature"},
+ {ns_t_ixfr, "IXFR", "incremental zone transfer"},
+ {ns_t_axfr, "AXFR", "zone transfer"},
+ {ns_t_zxfr, "ZXFR", "compressed zone transfer"},
+ {ns_t_mailb, "MAILB", "mailbox-related data (deprecated)"},
+ {ns_t_maila, "MAILA", "mail agent (deprecated)"},
+ {ns_t_naptr, "NAPTR", "URN Naming Authority"},
+ {ns_t_kx, "KX", "Key Exchange"},
+ {ns_t_cert, "CERT", "Certificate"},
+ {ns_t_a6, "A6", "IPv6 Address"},
+ {ns_t_dname, "DNAME", "dname"},
+ {ns_t_sink, "SINK", "Kitchen Sink (experimental)"},
+ {ns_t_opt, "OPT", "EDNS Options"},
+ {ns_t_any, "ANY", "\"any\""},
+ {ns_t_dlv, "DLV", "DNSSEC look-aside validation"},
+ {0, NULL, NULL}
+};
+
+/*%
+ * Names of DNS rcodes.
+ */
+const struct res_sym __p_rcode_syms[] = {
+ {ns_r_noerror, "NOERROR", "no error"},
+ {ns_r_formerr, "FORMERR", "format error"},
+ {ns_r_servfail, "SERVFAIL", "server failed"},
+ {ns_r_nxdomain, "NXDOMAIN", "no such domain name"},
+ {ns_r_notimpl, "NOTIMP", "not implemented"},
+ {ns_r_refused, "REFUSED", "refused"},
+ {ns_r_yxdomain, "YXDOMAIN", "domain name exists"},
+ {ns_r_yxrrset, "YXRRSET", "rrset exists"},
+ {ns_r_nxrrset, "NXRRSET", "rrset doesn't exist"},
+ {ns_r_notauth, "NOTAUTH", "not authoritative"},
+ {ns_r_notzone, "NOTZONE", "Not in zone"},
+ {ns_r_max, "", ""},
+ {ns_r_badsig, "BADSIG", "bad signature"},
+ {ns_r_badkey, "BADKEY", "bad key"},
+ {ns_r_badtime, "BADTIME", "bad time"},
+ {0, NULL, NULL}
+};
+
+int
+sym_ston(const struct res_sym *syms, const char *name, int *success) {
+ for ((void)NULL; syms->name != 0; syms++) {
+ if (strcasecmp (name, syms->name) == 0) {
+ if (success)
+ *success = 1;
+ return (syms->number);
+ }
+ }
+ if (success)
+ *success = 0;
+ return (syms->number); /*%< The default value. */
+}
+
+const char *
+sym_ntos(const struct res_sym *syms, int number, int *success) {
+ char *unname = sym_ntos_unname;
+
+ for ((void)NULL; syms->name != 0; syms++) {
+ if (number == syms->number) {
+ if (success)
+ *success = 1;
+ return (syms->name);
+ }
+ }
+
+ sprintf(unname, "%d", number); /*%< XXX nonreentrant */
+ if (success)
+ *success = 0;
+ return (unname);
+}
+
+const char *
+sym_ntop(const struct res_sym *syms, int number, int *success) {
+ char *unname = sym_ntop_unname;
+
+ for ((void)NULL; syms->name != 0; syms++) {
+ if (number == syms->number) {
+ if (success)
+ *success = 1;
+ return (syms->humanname);
+ }
+ }
+ sprintf(unname, "%d", number); /*%< XXX nonreentrant */
+ if (success)
+ *success = 0;
+ return (unname);
+}
+
+/*%
+ * Return a string for the type.
+ */
+const char *
+p_type(int type) {
+ int success;
+ const char *result;
+ static char typebuf[20];
+
+ result = sym_ntos(__p_type_syms, type, &success);
+ if (success)
+ return (result);
+ if (type < 0 || type > 0xffff)
+ return ("BADTYPE");
+ sprintf(typebuf, "TYPE%d", type);
+ return (typebuf);
+}
+
+/*%
+ * Return a string for the type.
+ */
+const char *
+p_section(int section, int opcode) {
+ const struct res_sym *symbols;
+
+ switch (opcode) {
+ case ns_o_update:
+ symbols = __p_update_section_syms;
+ break;
+ default:
+ symbols = __p_default_section_syms;
+ break;
+ }
+ return (sym_ntos(symbols, section, (int *)0));
+}
+
+/*%
+ * Return a mnemonic for class.
+ */
+const char *
+p_class(int class) {
+ int success;
+ const char *result;
+ static char classbuf[20];
+
+ result = sym_ntos(__p_class_syms, class, &success);
+ if (success)
+ return (result);
+ if (class < 0 || class > 0xffff)
+ return ("BADCLASS");
+ sprintf(classbuf, "CLASS%d", class);
+ return (classbuf);
+}
+
+/*%
+ * Return a mnemonic for an option
+ */
+const char *
+p_option(u_long option) {
+ char *nbuf = p_option_nbuf;
+
+ switch (option) {
+ case RES_INIT: return "init";
+ case RES_DEBUG: return "debug";
+ case RES_AAONLY: return "aaonly(unimpl)";
+ case RES_USEVC: return "usevc";
+ case RES_PRIMARY: return "primry(unimpl)";
+ case RES_IGNTC: return "igntc";
+ case RES_RECURSE: return "recurs";
+ case RES_DEFNAMES: return "defnam";
+ case RES_STAYOPEN: return "styopn";
+ case RES_DNSRCH: return "dnsrch";
+ case RES_INSECURE1: return "insecure1";
+ case RES_INSECURE2: return "insecure2";
+ case RES_NOALIASES: return "noaliases";
+ case RES_USE_INET6: return "inet6";
+#ifdef RES_USE_EDNS0 /*%< KAME extension */
+ case RES_USE_EDNS0: return "edns0";
+ case RES_NSID: return "nsid";
+#endif
+#ifdef RES_USE_DNAME
+ case RES_USE_DNAME: return "dname";
+#endif
+#ifdef RES_USE_DNSSEC
+ case RES_USE_DNSSEC: return "dnssec";
+#endif
+#ifdef RES_NOTLDQUERY
+ case RES_NOTLDQUERY: return "no-tld-query";
+#endif
+#ifdef RES_NO_NIBBLE2
+ case RES_NO_NIBBLE2: return "no-nibble2";
+#endif
+ /* XXX nonreentrant */
+ default: sprintf(nbuf, "?0x%lx?", (u_long)option);
+ return (nbuf);
+ }
+}
+
+/*%
+ * Return a mnemonic for a time to live.
+ */
+const char *
+p_time(u_int32_t value) {
+ char *nbuf = p_time_nbuf;
+
+ if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
+ sprintf(nbuf, "%u", value);
+ return (nbuf);
+}
+
+/*%
+ * Return a string for the rcode.
+ */
+const char *
+p_rcode(int rcode) {
+ return (sym_ntos(__p_rcode_syms, rcode, (int *)0));
+}
+
+/*%
+ * Return a string for a res_sockaddr_union.
+ */
+const char *
+p_sockun(union res_sockaddr_union u, char *buf, size_t size) {
+ char ret[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:123.123.123.123"];
+
+ switch (u.sin.sin_family) {
+ case AF_INET:
+ inet_ntop(AF_INET, &u.sin.sin_addr, ret, sizeof ret);
+ break;
+#ifdef HAS_INET6_STRUCTS
+ case AF_INET6:
+ inet_ntop(AF_INET6, &u.sin6.sin6_addr, ret, sizeof ret);
+ break;
+#endif
+ default:
+ sprintf(ret, "[af%d]", u.sin.sin_family);
+ break;
+ }
+ if (size > 0U) {
+ strncpy(buf, ret, size - 1);
+ buf[size - 1] = '0';
+ }
+ return (buf);
+}
+
+/*%
+ * routines to convert between on-the-wire RR format and zone file format.
+ * Does not contain conversion to/from decimal degrees; divide or multiply
+ * by 60*60*1000 for that.
+ */
+
+static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
+ 1000000,10000000,100000000,1000000000};
+
+/*% takes an XeY precision/size value, returns a string representation. */
+static const char *
+precsize_ntoa(prec)
+ u_int8_t prec;
+{
+ char *retbuf = precsize_ntoa_retbuf;
+ unsigned long val;
+ int mantissa, exponent;
+
+ mantissa = (int)((prec >> 4) & 0x0f) % 10;
+ exponent = (int)((prec >> 0) & 0x0f) % 10;
+
+ val = mantissa * poweroften[exponent];
+
+ (void) sprintf(retbuf, "%lu.%.2lu", val/100, val%100);
+ return (retbuf);
+}
+
+/*% converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
+static u_int8_t
+precsize_aton(const char **strptr) {
+ unsigned int mval = 0, cmval = 0;
+ u_int8_t retval = 0;
+ const char *cp;
+ int exponent;
+ int mantissa;
+
+ cp = *strptr;
+
+ while (isdigit((unsigned char)*cp))
+ mval = mval * 10 + (*cp++ - '0');
+
+ if (*cp == '.') { /*%< centimeters */
+ cp++;
+ if (isdigit((unsigned char)*cp)) {
+ cmval = (*cp++ - '0') * 10;
+ if (isdigit((unsigned char)*cp)) {
+ cmval += (*cp++ - '0');
+ }
+ }
+ }
+ cmval = (mval * 100) + cmval;
+
+ for (exponent = 0; exponent < 9; exponent++)
+ if (cmval < poweroften[exponent+1])
+ break;
+
+ mantissa = cmval / poweroften[exponent];
+ if (mantissa > 9)
+ mantissa = 9;
+
+ retval = (mantissa << 4) | exponent;
+
+ *strptr = cp;
+
+ return (retval);
+}
+
+/*% converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
+static u_int32_t
+latlon2ul(const char **latlonstrptr, int *which) {
+ const char *cp;
+ u_int32_t retval;
+ int deg = 0, min = 0, secs = 0, secsfrac = 0;
+
+ cp = *latlonstrptr;
+
+ while (isdigit((unsigned char)*cp))
+ deg = deg * 10 + (*cp++ - '0');
+
+ while (isspace((unsigned char)*cp))
+ cp++;
+
+ if (!(isdigit((unsigned char)*cp)))
+ goto fndhemi;
+
+ while (isdigit((unsigned char)*cp))
+ min = min * 10 + (*cp++ - '0');
+
+ while (isspace((unsigned char)*cp))
+ cp++;
+
+ if (!(isdigit((unsigned char)*cp)))
+ goto fndhemi;
+
+ while (isdigit((unsigned char)*cp))
+ secs = secs * 10 + (*cp++ - '0');
+
+ if (*cp == '.') { /*%< decimal seconds */
+ cp++;
+ if (isdigit((unsigned char)*cp)) {
+ secsfrac = (*cp++ - '0') * 100;
+ if (isdigit((unsigned char)*cp)) {
+ secsfrac += (*cp++ - '0') * 10;
+ if (isdigit((unsigned char)*cp)) {
+ secsfrac += (*cp++ - '0');
+ }
+ }
+ }
+ }
+
+ while (!isspace((unsigned char)*cp)) /*%< if any trailing garbage */
+ cp++;
+
+ while (isspace((unsigned char)*cp))
+ cp++;
+
+ fndhemi:
+ switch (*cp) {
+ case 'N': case 'n':
+ case 'E': case 'e':
+ retval = ((unsigned)1<<31)
+ + (((((deg * 60) + min) * 60) + secs) * 1000)
+ + secsfrac;
+ break;
+ case 'S': case 's':
+ case 'W': case 'w':
+ retval = ((unsigned)1<<31)
+ - (((((deg * 60) + min) * 60) + secs) * 1000)
+ - secsfrac;
+ break;
+ default:
+ retval = 0; /*%< invalid value -- indicates error */
+ break;
+ }
+
+ switch (*cp) {
+ case 'N': case 'n':
+ case 'S': case 's':
+ *which = 1; /*%< latitude */
+ break;
+ case 'E': case 'e':
+ case 'W': case 'w':
+ *which = 2; /*%< longitude */
+ break;
+ default:
+ *which = 0; /*%< error */
+ break;
+ }
+
+ cp++; /*%< skip the hemisphere */
+ while (!isspace((unsigned char)*cp)) /*%< if any trailing garbage */
+ cp++;
+
+ while (isspace((unsigned char)*cp)) /*%< move to next field */
+ cp++;
+
+ *latlonstrptr = cp;
+
+ return (retval);
+}
+
+/*%
+ * converts a zone file representation in a string to an RDATA on-the-wire
+ * representation. */
+int
+loc_aton(ascii, binary)
+ const char *ascii;
+ u_char *binary;
+{
+ const char *cp, *maxcp;
+ u_char *bcp;
+
+ u_int32_t latit = 0, longit = 0, alt = 0;
+ u_int32_t lltemp1 = 0, lltemp2 = 0;
+ int altmeters = 0, altfrac = 0, altsign = 1;
+ u_int8_t hp = 0x16; /*%< default = 1e6 cm = 10000.00m = 10km */
+ u_int8_t vp = 0x13; /*%< default = 1e3 cm = 10.00m */
+ u_int8_t siz = 0x12; /*%< default = 1e2 cm = 1.00m */
+ int which1 = 0, which2 = 0;
+
+ cp = ascii;
+ maxcp = cp + strlen(ascii);
+
+ lltemp1 = latlon2ul(&cp, &which1);
+
+ lltemp2 = latlon2ul(&cp, &which2);
+
+ switch (which1 + which2) {
+ case 3: /*%< 1 + 2, the only valid combination */
+ if ((which1 == 1) && (which2 == 2)) { /*%< normal case */
+ latit = lltemp1;
+ longit = lltemp2;
+ } else if ((which1 == 2) && (which2 == 1)) { /*%< reversed */
+ longit = lltemp1;
+ latit = lltemp2;
+ } else { /*%< some kind of brokenness */
+ return (0);
+ }
+ break;
+ default: /*%< we didn't get one of each */
+ return (0);
+ }
+
+ /* altitude */
+ if (*cp == '-') {
+ altsign = -1;
+ cp++;
+ }
+
+ if (*cp == '+')
+ cp++;
+
+ while (isdigit((unsigned char)*cp))
+ altmeters = altmeters * 10 + (*cp++ - '0');
+
+ if (*cp == '.') { /*%< decimal meters */
+ cp++;
+ if (isdigit((unsigned char)*cp)) {
+ altfrac = (*cp++ - '0') * 10;
+ if (isdigit((unsigned char)*cp)) {
+ altfrac += (*cp++ - '0');
+ }
+ }
+ }
+
+ alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
+
+ while (!isspace((unsigned char)*cp) && (cp < maxcp)) /*%< if trailing garbage or m */
+ cp++;
+
+ while (isspace((unsigned char)*cp) && (cp < maxcp))
+ cp++;
+
+ if (cp >= maxcp)
+ goto defaults;
+
+ siz = precsize_aton(&cp);
+
+ while (!isspace((unsigned char)*cp) && (cp < maxcp)) /*%< if trailing garbage or m */
+ cp++;
+
+ while (isspace((unsigned char)*cp) && (cp < maxcp))
+ cp++;
+
+ if (cp >= maxcp)
+ goto defaults;
+
+ hp = precsize_aton(&cp);
+
+ while (!isspace((unsigned char)*cp) && (cp < maxcp)) /*%< if trailing garbage or m */
+ cp++;
+
+ while (isspace((unsigned char)*cp) && (cp < maxcp))
+ cp++;
+
+ if (cp >= maxcp)
+ goto defaults;
+
+ vp = precsize_aton(&cp);
+
+ defaults:
+
+ bcp = binary;
+ *bcp++ = (u_int8_t) 0; /*%< version byte */
+ *bcp++ = siz;
+ *bcp++ = hp;
+ *bcp++ = vp;
+ PUTLONG(latit,bcp);
+ PUTLONG(longit,bcp);
+ PUTLONG(alt,bcp);
+
+ return (16); /*%< size of RR in octets */
+}
+
+/*% takes an on-the-wire LOC RR and formats it in a human readable format. */
+const char *
+loc_ntoa(binary, ascii)
+ const u_char *binary;
+ char *ascii;
+{
+ static const char *error = "?";
+ static char tmpbuf[sizeof
+"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
+ const u_char *cp = binary;
+
+ int latdeg, latmin, latsec, latsecfrac;
+ int longdeg, longmin, longsec, longsecfrac;
+ char northsouth, eastwest;
+ const char *altsign;
+ int altmeters, altfrac;
+
+ const u_int32_t referencealt = 100000 * 100;
+
+ int32_t latval, longval, altval;
+ u_int32_t templ;
+ u_int8_t sizeval, hpval, vpval, versionval;
+
+ char *sizestr, *hpstr, *vpstr;
+
+ versionval = *cp++;
+
+ if (ascii == NULL)
+ ascii = tmpbuf;
+
+ if (versionval) {
+ (void) sprintf(ascii, "; error: unknown LOC RR version");
+ return (ascii);
+ }
+
+ sizeval = *cp++;
+
+ hpval = *cp++;
+ vpval = *cp++;
+
+ GETLONG(templ, cp);
+ latval = (templ - ((unsigned)1<<31));
+
+ GETLONG(templ, cp);
+ longval = (templ - ((unsigned)1<<31));
+
+ GETLONG(templ, cp);
+ if (templ < referencealt) { /*%< below WGS 84 spheroid */
+ altval = referencealt - templ;
+ altsign = "-";
+ } else {
+ altval = templ - referencealt;
+ altsign = "";
+ }
+
+ if (latval < 0) {
+ northsouth = 'S';
+ latval = -latval;
+ } else
+ northsouth = 'N';
+
+ latsecfrac = latval % 1000;
+ latval = latval / 1000;
+ latsec = latval % 60;
+ latval = latval / 60;
+ latmin = latval % 60;
+ latval = latval / 60;
+ latdeg = latval;
+
+ if (longval < 0) {
+ eastwest = 'W';
+ longval = -longval;
+ } else
+ eastwest = 'E';
+
+ longsecfrac = longval % 1000;
+ longval = longval / 1000;
+ longsec = longval % 60;
+ longval = longval / 60;
+ longmin = longval % 60;
+ longval = longval / 60;
+ longdeg = longval;
+
+ altfrac = altval % 100;
+ altmeters = (altval / 100);
+
+ sizestr = strdup(precsize_ntoa(sizeval));
+ hpstr = strdup(precsize_ntoa(hpval));
+ vpstr = strdup(precsize_ntoa(vpval));
+
+ sprintf(ascii,
+ "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %s%d.%.2dm %sm %sm %sm",
+ latdeg, latmin, latsec, latsecfrac, northsouth,
+ longdeg, longmin, longsec, longsecfrac, eastwest,
+ altsign, altmeters, altfrac,
+ (sizestr != NULL) ? sizestr : error,
+ (hpstr != NULL) ? hpstr : error,
+ (vpstr != NULL) ? vpstr : error);
+
+ if (sizestr != NULL)
+ free(sizestr);
+ if (hpstr != NULL)
+ free(hpstr);
+ if (vpstr != NULL)
+ free(vpstr);
+
+ return (ascii);
+}
+
+
+/*% Return the number of DNS hierarchy levels in the name. */
+int
+dn_count_labels(const char *name) {
+ int i, len, count;
+
+ len = strlen(name);
+ for (i = 0, count = 0; i < len; i++) {
+ /* XXX need to check for \. or use named's nlabels(). */
+ if (name[i] == '.')
+ count++;
+ }
+
+ /* don't count initial wildcard */
+ if (name[0] == '*')
+ if (count)
+ count--;
+
+ /* don't count the null label for root. */
+ /* if terminating '.' not found, must adjust */
+ /* count to include last label */
+ if (len > 0 && name[len-1] != '.')
+ count++;
+ return (count);
+}
+
+/*%
+ * Make dates expressed in seconds-since-Jan-1-1970 easy to read.
+ * SIG records are required to be printed like this, by the Secure DNS RFC.
+ */
+char *
+p_secstodate (u_long secs) {
+ char *output = p_secstodate_output;
+ time_t clock = secs;
+ struct tm *time;
+#ifdef HAVE_TIME_R
+ struct tm res;
+
+ time = gmtime_r(&clock, &res);
+#else
+ time = gmtime(&clock);
+#endif
+ time->tm_year += 1900;
+ time->tm_mon += 1;
+ sprintf(output, "%04d%02d%02d%02d%02d%02d",
+ time->tm_year, time->tm_mon, time->tm_mday,
+ time->tm_hour, time->tm_min, time->tm_sec);
+ return (output);
+}
+
+u_int16_t
+res_nametoclass(const char *buf, int *successp) {
+ unsigned long result;
+ char *endptr;
+ int success;
+
+ result = sym_ston(__p_class_syms, buf, &success);
+ if (success)
+ goto done;
+
+ if (strncasecmp(buf, "CLASS", 5) != 0 ||
+ !isdigit((unsigned char)buf[5]))
+ goto done;
+ errno = 0;
+ result = strtoul(buf + 5, &endptr, 10);
+ if (errno == 0 && *endptr == '\0' && result <= 0xffffU)
+ success = 1;
+ done:
+ if (successp)
+ *successp = success;
+ return (result);
+}
+
+u_int16_t
+res_nametotype(const char *buf, int *successp) {
+ unsigned long result;
+ char *endptr;
+ int success;
+
+ result = sym_ston(__p_type_syms, buf, &success);
+ if (success)
+ goto done;
+
+ if (strncasecmp(buf, "type", 4) != 0 ||
+ !isdigit((unsigned char)buf[4]))
+ goto done;
+ errno = 0;
+ result = strtoul(buf + 4, &endptr, 10);
+ if (errno == 0 && *endptr == '\0' && result <= 0xffffU)
+ success = 1;
+ done:
+ if (successp)
+ *successp = success;
+ return (result);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_debug.h b/usr/src/lib/libresolv2_joy/common/resolv/res_debug.h
new file mode 100644
index 0000000000..c28171d7c8
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_debug.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _RES_DEBUG_H_
+#define _RES_DEBUG_H_
+
+#ifndef DEBUG
+# define Dprint(cond, args) /*empty*/
+# define DprintQ(cond, args, query, size) /*empty*/
+# define Aerror(statp, file, string, error, address) /*empty*/
+# define Perror(statp, file, string, error) /*empty*/
+#else
+# define Dprint(cond, args) if (cond) {fprintf args;} else {}
+# define DprintQ(cond, args, query, size) if (cond) {\
+ fprintf args;\
+ res_pquery(statp, query, size, stdout);\
+ } else {}
+#endif
+
+#endif /* _RES_DEBUG_H_ */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_findzonecut.c b/usr/src/lib/libresolv2_joy/common/resolv/res_findzonecut.c
new file mode 100644
index 0000000000..431c0262c1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_findzonecut.c
@@ -0,0 +1,722 @@
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "$Id: res_findzonecut.c,v 1.10 2005/10/11 00:10:16 marka Exp $";
+#endif /* not lint */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Import. */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <netdb.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/list.h>
+
+#include "port_after.h"
+
+#include <resolv_joy.h>
+
+/* Data structures. */
+
+typedef struct rr_a {
+ LINK(struct rr_a) link;
+ union res_sockaddr_union addr;
+} rr_a;
+typedef LIST(rr_a) rrset_a;
+
+typedef struct rr_ns {
+ LINK(struct rr_ns) link;
+ const char * name;
+ unsigned int flags;
+ rrset_a addrs;
+} rr_ns;
+typedef LIST(rr_ns) rrset_ns;
+
+#define RR_NS_HAVE_V4 0x01
+#define RR_NS_HAVE_V6 0x02
+
+/* Forward. */
+
+static int satisfy(res_state, const char *, rrset_ns *,
+ union res_sockaddr_union *, int);
+static int add_addrs(res_state, rr_ns *,
+ union res_sockaddr_union *, int);
+static int get_soa(res_state, const char *, ns_class, int,
+ char *, size_t, char *, size_t,
+ rrset_ns *);
+static int get_ns(res_state, const char *, ns_class, int, rrset_ns *);
+static int get_glue(res_state, ns_class, int, rrset_ns *);
+static int save_ns(res_state, ns_msg *, ns_sect,
+ const char *, ns_class, int, rrset_ns *);
+static int save_a(res_state, ns_msg *, ns_sect,
+ const char *, ns_class, int, rr_ns *);
+static void free_nsrrset(rrset_ns *);
+static void free_nsrr(rrset_ns *, rr_ns *);
+static rr_ns * find_ns(rrset_ns *, const char *);
+static int do_query(res_state, const char *, ns_class, ns_type,
+ u_char *, ns_msg *);
+static void res_dprintf(const char *, ...) ISC_FORMAT_PRINTF(1, 2);
+
+/* Macros. */
+
+#define DPRINTF(x) do {\
+ int save_errno = errno; \
+ if ((statp->options & RES_DEBUG) != 0U) res_dprintf x; \
+ errno = save_errno; \
+ } while (0)
+
+/* Public. */
+
+/*%
+ * find enclosing zone for a <dname,class>, and some server addresses
+ *
+ * parameters:
+ *\li res - resolver context to work within (is modified)
+ *\li dname - domain name whose enclosing zone is desired
+ *\li class - class of dname (and its enclosing zone)
+ *\li zname - found zone name
+ *\li zsize - allocated size of zname
+ *\li addrs - found server addresses
+ *\li naddrs - max number of addrs
+ *
+ * return values:
+ *\li < 0 - an error occurred (check errno)
+ *\li = 0 - zname is now valid, but addrs[] wasn't changed
+ *\li > 0 - zname is now valid, and return value is number of addrs[] found
+ *
+ * notes:
+ *\li this function calls res_nsend() which means it depends on correctly
+ * functioning recursive nameservers (usually defined in /etc/resolv.conf
+ * or its local equivilent).
+ *
+ *\li we start by asking for an SOA<dname,class>. if we get one as an
+ * answer, that just means <dname,class> is a zone top, which is fine.
+ * more than likely we'll be told to go pound sand, in the form of a
+ * negative answer.
+ *
+ *\li note that we are not prepared to deal with referrals since that would
+ * only come from authority servers and our correctly functioning local
+ * recursive server would have followed the referral and got us something
+ * more definite.
+ *
+ *\li if the authority section contains an SOA, this SOA should also be the
+ * closest enclosing zone, since any intermediary zone cuts would've been
+ * returned as referrals and dealt with by our correctly functioning local
+ * recursive name server. but an SOA in the authority section should NOT
+ * match our dname (since that would have been returned in the answer
+ * section). an authority section SOA has to be "above" our dname.
+ *
+ *\li however, since authority section SOA's were once optional, it's
+ * possible that we'll have to go hunting for the enclosing SOA by
+ * ripping labels off the front of our dname -- this is known as "doing
+ * it the hard way."
+ *
+ *\li ultimately we want some server addresses, which are ideally the ones
+ * pertaining to the SOA.MNAME, but only if there is a matching NS RR.
+ * so the second phase (after we find an SOA) is to go looking for the
+ * NS RRset for that SOA's zone.
+ *
+ *\li no answer section processed by this code is allowed to contain CNAME
+ * or DNAME RR's. for the SOA query this means we strip a label and
+ * keep going. for the NS and A queries this means we just give up.
+ */
+
+int
+res_findzonecut(res_state statp, const char *dname, ns_class class, int opts,
+ char *zname, size_t zsize, struct in_addr *addrs, int naddrs)
+{
+ int result, i;
+ union res_sockaddr_union *u;
+
+
+ opts |= RES_IPV4ONLY;
+ opts &= ~RES_IPV6ONLY;
+
+ u = calloc(naddrs, sizeof(*u));
+ if (u == NULL)
+ return(-1);
+
+ result = res_findzonecut2(statp, dname, class, opts, zname, zsize,
+ u, naddrs);
+
+ for (i = 0; i < result; i++) {
+ addrs[i] = u[i].sin.sin_addr;
+ }
+ free(u);
+ return (result);
+}
+
+int
+res_findzonecut2(res_state statp, const char *dname, ns_class class, int opts,
+ char *zname, size_t zsize, union res_sockaddr_union *addrs,
+ int naddrs)
+{
+ char mname[NS_MAXDNAME];
+ u_long save_pfcode;
+ rrset_ns nsrrs;
+ int n;
+
+ DPRINTF(("START dname='%s' class=%s, zsize=%ld, naddrs=%d",
+ dname, p_class(class), (long)zsize, naddrs));
+ save_pfcode = statp->pfcode;
+ statp->pfcode |= RES_PRF_HEAD2 | RES_PRF_HEAD1 | RES_PRF_HEADX |
+ RES_PRF_QUES | RES_PRF_ANS |
+ RES_PRF_AUTH | RES_PRF_ADD;
+ INIT_LIST(nsrrs);
+
+ DPRINTF(("get the soa, and see if it has enough glue"));
+ if ((n = get_soa(statp, dname, class, opts, zname, zsize,
+ mname, sizeof mname, &nsrrs)) < 0 ||
+ ((opts & RES_EXHAUSTIVE) == 0 &&
+ (n = satisfy(statp, mname, &nsrrs, addrs, naddrs)) > 0))
+ goto done;
+
+ DPRINTF(("get the ns rrset and see if it has enough glue"));
+ if ((n = get_ns(statp, zname, class, opts, &nsrrs)) < 0 ||
+ ((opts & RES_EXHAUSTIVE) == 0 &&
+ (n = satisfy(statp, mname, &nsrrs, addrs, naddrs)) > 0))
+ goto done;
+
+ DPRINTF(("get the missing glue and see if it's finally enough"));
+ if ((n = get_glue(statp, class, opts, &nsrrs)) >= 0)
+ n = satisfy(statp, mname, &nsrrs, addrs, naddrs);
+
+ done:
+ DPRINTF(("FINISH n=%d (%s)", n, (n < 0) ? strerror(errno) : "OK"));
+ free_nsrrset(&nsrrs);
+ statp->pfcode = save_pfcode;
+ return (n);
+}
+
+/* Private. */
+
+static int
+satisfy(res_state statp, const char *mname, rrset_ns *nsrrsp,
+ union res_sockaddr_union *addrs, int naddrs)
+{
+ rr_ns *nsrr;
+ int n, x;
+
+ n = 0;
+ nsrr = find_ns(nsrrsp, mname);
+ if (nsrr != NULL) {
+ x = add_addrs(statp, nsrr, addrs, naddrs);
+ addrs += x;
+ naddrs -= x;
+ n += x;
+ }
+ for (nsrr = HEAD(*nsrrsp);
+ nsrr != NULL && naddrs > 0;
+ nsrr = NEXT(nsrr, link))
+ if (ns_samename(nsrr->name, mname) != 1) {
+ x = add_addrs(statp, nsrr, addrs, naddrs);
+ addrs += x;
+ naddrs -= x;
+ n += x;
+ }
+ DPRINTF(("satisfy(%s): %d", mname, n));
+ return (n);
+}
+
+static int
+add_addrs(res_state statp, rr_ns *nsrr,
+ union res_sockaddr_union *addrs, int naddrs)
+{
+ rr_a *arr;
+ int n = 0;
+
+ for (arr = HEAD(nsrr->addrs); arr != NULL; arr = NEXT(arr, link)) {
+ if (naddrs <= 0)
+ return (0);
+ *addrs++ = arr->addr;
+ naddrs--;
+ n++;
+ }
+ DPRINTF(("add_addrs: %d", n));
+ return (n);
+}
+
+static int
+get_soa(res_state statp, const char *dname, ns_class class, int opts,
+ char *zname, size_t zsize, char *mname, size_t msize,
+ rrset_ns *nsrrsp)
+{
+ char tname[NS_MAXDNAME];
+ u_char *resp = NULL;
+ int n, i, ancount, nscount;
+ ns_sect sect;
+ ns_msg msg;
+ u_int rcode;
+
+ /*
+ * Find closest enclosing SOA, even if it's for the root zone.
+ */
+
+ /* First canonicalize dname (exactly one unescaped trailing "."). */
+ if (ns_makecanon(dname, tname, sizeof tname) < 0)
+ goto cleanup;
+ dname = tname;
+
+ resp = malloc(NS_MAXMSG);
+ if (resp == NULL)
+ goto cleanup;
+
+ /* Now grovel the subdomains, hunting for an SOA answer or auth. */
+ for (;;) {
+ /* Leading or inter-label '.' are skipped here. */
+ while (*dname == '.')
+ dname++;
+
+ /* Is there an SOA? */
+ n = do_query(statp, dname, class, ns_t_soa, resp, &msg);
+ if (n < 0) {
+ DPRINTF(("get_soa: do_query('%s', %s) failed (%d)",
+ dname, p_class(class), n));
+ goto cleanup;
+ }
+ if (n > 0) {
+ DPRINTF(("get_soa: CNAME or DNAME found"));
+ sect = ns_s_max, n = 0;
+ } else {
+ rcode = ns_msg_getflag(msg, ns_f_rcode);
+ ancount = ns_msg_count(msg, ns_s_an);
+ nscount = ns_msg_count(msg, ns_s_ns);
+ if (ancount > 0 && rcode == ns_r_noerror)
+ sect = ns_s_an, n = ancount;
+ else if (nscount > 0)
+ sect = ns_s_ns, n = nscount;
+ else
+ sect = ns_s_max, n = 0;
+ }
+ for (i = 0; i < n; i++) {
+ const char *t;
+ const u_char *rdata;
+ ns_rr rr;
+
+ if (ns_parserr(&msg, sect, i, &rr) < 0) {
+ DPRINTF(("get_soa: ns_parserr(%s, %d) failed",
+ p_section(sect, ns_o_query), i));
+ goto cleanup;
+ }
+ if (ns_rr_type(rr) == ns_t_cname ||
+ ns_rr_type(rr) == ns_t_dname)
+ break;
+ if (ns_rr_type(rr) != ns_t_soa ||
+ ns_rr_class(rr) != class)
+ continue;
+ t = ns_rr_name(rr);
+ switch (sect) {
+ case ns_s_an:
+ if (ns_samedomain(dname, t) == 0) {
+ DPRINTF(
+ ("get_soa: ns_samedomain('%s', '%s') == 0",
+ dname, t)
+ );
+ errno = EPROTOTYPE;
+ goto cleanup;
+ }
+ break;
+ case ns_s_ns:
+ if (ns_samename(dname, t) == 1 ||
+ ns_samedomain(dname, t) == 0) {
+ DPRINTF(
+ ("get_soa: ns_samename() || !ns_samedomain('%s', '%s')",
+ dname, t)
+ );
+ errno = EPROTOTYPE;
+ goto cleanup;
+ }
+ break;
+ default:
+ abort();
+ }
+ if (strlen(t) + 1 > zsize) {
+ DPRINTF(("get_soa: zname(%lu) too small (%lu)",
+ (unsigned long)zsize,
+ (unsigned long)strlen(t) + 1));
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ strcpy(zname, t);
+ rdata = ns_rr_rdata(rr);
+ if (ns_name_uncompress(resp, ns_msg_end(msg), rdata,
+ mname, msize) < 0) {
+ DPRINTF(("get_soa: ns_name_uncompress failed")
+ );
+ goto cleanup;
+ }
+ if (save_ns(statp, &msg, ns_s_ns,
+ zname, class, opts, nsrrsp) < 0) {
+ DPRINTF(("get_soa: save_ns failed"));
+ goto cleanup;
+ }
+ free(resp);
+ return (0);
+ }
+
+ /* If we're out of labels, then not even "." has an SOA! */
+ if (*dname == '\0')
+ break;
+
+ /* Find label-terminating "."; top of loop will skip it. */
+ while (*dname != '.') {
+ if (*dname == '\\')
+ if (*++dname == '\0') {
+ errno = EMSGSIZE;
+ goto cleanup;
+ }
+ dname++;
+ }
+ }
+ DPRINTF(("get_soa: out of labels"));
+ errno = EDESTADDRREQ;
+ cleanup:
+ if (resp != NULL)
+ free(resp);
+ return (-1);
+}
+
+static int
+get_ns(res_state statp, const char *zname, ns_class class, int opts,
+ rrset_ns *nsrrsp)
+{
+ u_char *resp;
+ ns_msg msg;
+ int n;
+
+ resp = malloc(NS_MAXMSG);
+ if (resp == NULL)
+ return (-1);
+
+ /* Go and get the NS RRs for this zone. */
+ n = do_query(statp, zname, class, ns_t_ns, resp, &msg);
+ if (n != 0) {
+ DPRINTF(("get_ns: do_query('%s', %s) failed (%d)",
+ zname, p_class(class), n));
+ free(resp);
+ return (-1);
+ }
+
+ /* Remember the NS RRs and associated A RRs that came back. */
+ if (save_ns(statp, &msg, ns_s_an, zname, class, opts, nsrrsp) < 0) {
+ DPRINTF(("get_ns save_ns('%s', %s) failed",
+ zname, p_class(class)));
+ free(resp);
+ return (-1);
+ }
+
+ free(resp);
+ return (0);
+}
+
+static int
+get_glue(res_state statp, ns_class class, int opts, rrset_ns *nsrrsp) {
+ rr_ns *nsrr, *nsrr_n;
+ u_char *resp;
+
+ resp = malloc(NS_MAXMSG);
+ if (resp == NULL)
+ return(-1);
+
+ /* Go and get the A RRs for each empty NS RR on our list. */
+ for (nsrr = HEAD(*nsrrsp); nsrr != NULL; nsrr = nsrr_n) {
+ ns_msg msg;
+ int n;
+
+ nsrr_n = NEXT(nsrr, link);
+
+ if ((nsrr->flags & RR_NS_HAVE_V4) == 0) {
+ n = do_query(statp, nsrr->name, class, ns_t_a,
+ resp, &msg);
+ if (n < 0) {
+ DPRINTF(
+ ("get_glue: do_query('%s', %s') failed",
+ nsrr->name, p_class(class)));
+ goto cleanup;
+ }
+ if (n > 0) {
+ DPRINTF((
+ "get_glue: do_query('%s', %s') CNAME or DNAME found",
+ nsrr->name, p_class(class)));
+ }
+ if (save_a(statp, &msg, ns_s_an, nsrr->name, class,
+ opts, nsrr) < 0) {
+ DPRINTF(("get_glue: save_r('%s', %s) failed",
+ nsrr->name, p_class(class)));
+ goto cleanup;
+ }
+ }
+
+ if ((nsrr->flags & RR_NS_HAVE_V6) == 0) {
+ n = do_query(statp, nsrr->name, class, ns_t_aaaa,
+ resp, &msg);
+ if (n < 0) {
+ DPRINTF(
+ ("get_glue: do_query('%s', %s') failed",
+ nsrr->name, p_class(class)));
+ goto cleanup;
+ }
+ if (n > 0) {
+ DPRINTF((
+ "get_glue: do_query('%s', %s') CNAME or DNAME found",
+ nsrr->name, p_class(class)));
+ }
+ if (save_a(statp, &msg, ns_s_an, nsrr->name, class,
+ opts, nsrr) < 0) {
+ DPRINTF(("get_glue: save_r('%s', %s) failed",
+ nsrr->name, p_class(class)));
+ goto cleanup;
+ }
+ }
+
+ /* If it's still empty, it's just chaff. */
+ if (EMPTY(nsrr->addrs)) {
+ DPRINTF(("get_glue: removing empty '%s' NS",
+ nsrr->name));
+ free_nsrr(nsrrsp, nsrr);
+ }
+ }
+ free(resp);
+ return (0);
+
+ cleanup:
+ free(resp);
+ return (-1);
+}
+
+static int
+save_ns(res_state statp, ns_msg *msg, ns_sect sect,
+ const char *owner, ns_class class, int opts,
+ rrset_ns *nsrrsp)
+{
+ int i;
+
+ for (i = 0; i < ns_msg_count(*msg, sect); i++) {
+ char tname[MAXDNAME];
+ const u_char *rdata;
+ rr_ns *nsrr;
+ ns_rr rr;
+
+ if (ns_parserr(msg, sect, i, &rr) < 0) {
+ DPRINTF(("save_ns: ns_parserr(%s, %d) failed",
+ p_section(sect, ns_o_query), i));
+ return (-1);
+ }
+ if (ns_rr_type(rr) != ns_t_ns ||
+ ns_rr_class(rr) != class ||
+ ns_samename(ns_rr_name(rr), owner) != 1)
+ continue;
+ nsrr = find_ns(nsrrsp, ns_rr_name(rr));
+ if (nsrr == NULL) {
+ nsrr = malloc(sizeof *nsrr);
+ if (nsrr == NULL) {
+ DPRINTF(("save_ns: malloc failed"));
+ return (-1);
+ }
+ rdata = ns_rr_rdata(rr);
+ if (ns_name_uncompress(ns_msg_base(*msg),
+ ns_msg_end(*msg), rdata,
+ tname, sizeof tname) < 0) {
+ DPRINTF(("save_ns: ns_name_uncompress failed")
+ );
+ free(nsrr);
+ return (-1);
+ }
+ nsrr->name = strdup(tname);
+ if (nsrr->name == NULL) {
+ DPRINTF(("save_ns: strdup failed"));
+ free(nsrr);
+ return (-1);
+ }
+ INIT_LINK(nsrr, link);
+ INIT_LIST(nsrr->addrs);
+ nsrr->flags = 0;
+ APPEND(*nsrrsp, nsrr, link);
+ }
+ if (save_a(statp, msg, ns_s_ar,
+ nsrr->name, class, opts, nsrr) < 0) {
+ DPRINTF(("save_ns: save_r('%s', %s) failed",
+ nsrr->name, p_class(class)));
+ return (-1);
+ }
+ }
+ return (0);
+}
+
+static int
+save_a(res_state statp, ns_msg *msg, ns_sect sect,
+ const char *owner, ns_class class, int opts,
+ rr_ns *nsrr)
+{
+ int i;
+
+ for (i = 0; i < ns_msg_count(*msg, sect); i++) {
+ ns_rr rr;
+ rr_a *arr;
+
+ if (ns_parserr(msg, sect, i, &rr) < 0) {
+ DPRINTF(("save_a: ns_parserr(%s, %d) failed",
+ p_section(sect, ns_o_query), i));
+ return (-1);
+ }
+ if ((ns_rr_type(rr) != ns_t_a &&
+ ns_rr_type(rr) != ns_t_aaaa) ||
+ ns_rr_class(rr) != class ||
+ ns_samename(ns_rr_name(rr), owner) != 1 ||
+ ns_rr_rdlen(rr) != NS_INADDRSZ)
+ continue;
+ if ((opts & RES_IPV6ONLY) != 0 && ns_rr_type(rr) != ns_t_aaaa)
+ continue;
+ if ((opts & RES_IPV4ONLY) != 0 && ns_rr_type(rr) != ns_t_a)
+ continue;
+ arr = malloc(sizeof *arr);
+ if (arr == NULL) {
+ DPRINTF(("save_a: malloc failed"));
+ return (-1);
+ }
+ INIT_LINK(arr, link);
+ memset(&arr->addr, 0, sizeof(arr->addr));
+ switch (ns_rr_type(rr)) {
+ case ns_t_a:
+ arr->addr.sin.sin_family = AF_INET;
+#ifdef HAVE_SA_LEN
+ arr->addr.sin.sin_len = sizeof(arr->addr.sin);
+#endif
+ memcpy(&arr->addr.sin.sin_addr, ns_rr_rdata(rr),
+ NS_INADDRSZ);
+ arr->addr.sin.sin_port = htons(NAMESERVER_PORT);
+ nsrr->flags |= RR_NS_HAVE_V4;
+ break;
+ case ns_t_aaaa:
+ arr->addr.sin6.sin6_family = AF_INET6;
+#ifdef HAVE_SA_LEN
+ arr->addr.sin6.sin6_len = sizeof(arr->addr.sin6);
+#endif
+ memcpy(&arr->addr.sin6.sin6_addr, ns_rr_rdata(rr), 16);
+ arr->addr.sin.sin_port = htons(NAMESERVER_PORT);
+ nsrr->flags |= RR_NS_HAVE_V6;
+ break;
+ default:
+ abort();
+ }
+ APPEND(nsrr->addrs, arr, link);
+ }
+ return (0);
+}
+
+static void
+free_nsrrset(rrset_ns *nsrrsp) {
+ rr_ns *nsrr;
+
+ while ((nsrr = HEAD(*nsrrsp)) != NULL)
+ free_nsrr(nsrrsp, nsrr);
+}
+
+static void
+free_nsrr(rrset_ns *nsrrsp, rr_ns *nsrr) {
+ rr_a *arr;
+ char *tmp;
+
+ while ((arr = HEAD(nsrr->addrs)) != NULL) {
+ UNLINK(nsrr->addrs, arr, link);
+ free(arr);
+ }
+ DE_CONST(nsrr->name, tmp);
+ free(tmp);
+ UNLINK(*nsrrsp, nsrr, link);
+ free(nsrr);
+}
+
+static rr_ns *
+find_ns(rrset_ns *nsrrsp, const char *dname) {
+ rr_ns *nsrr;
+
+ for (nsrr = HEAD(*nsrrsp); nsrr != NULL; nsrr = NEXT(nsrr, link))
+ if (ns_samename(nsrr->name, dname) == 1)
+ return (nsrr);
+ return (NULL);
+}
+
+static int
+do_query(res_state statp, const char *dname, ns_class class, ns_type qtype,
+ u_char *resp, ns_msg *msg)
+{
+ u_char req[NS_PACKETSZ];
+ int i, n;
+
+ n = res_nmkquery(statp, ns_o_query, dname, class, qtype,
+ NULL, 0, NULL, req, NS_PACKETSZ);
+ if (n < 0) {
+ DPRINTF(("do_query: res_nmkquery failed"));
+ return (-1);
+ }
+ n = res_nsend(statp, req, n, resp, NS_MAXMSG);
+ if (n < 0) {
+ DPRINTF(("do_query: res_nsend failed"));
+ return (-1);
+ }
+ if (n == 0) {
+ DPRINTF(("do_query: res_nsend returned 0"));
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ if (ns_initparse(resp, n, msg) < 0) {
+ DPRINTF(("do_query: ns_initparse failed"));
+ return (-1);
+ }
+ n = 0;
+ for (i = 0; i < ns_msg_count(*msg, ns_s_an); i++) {
+ ns_rr rr;
+
+ if (ns_parserr(msg, ns_s_an, i, &rr) < 0) {
+ DPRINTF(("do_query: ns_parserr failed"));
+ return (-1);
+ }
+ n += (ns_rr_class(rr) == class &&
+ (ns_rr_type(rr) == ns_t_cname ||
+ ns_rr_type(rr) == ns_t_dname));
+ }
+ return (n);
+}
+
+static void
+res_dprintf(const char *fmt, ...) {
+ va_list ap;
+
+ va_start(ap, fmt);
+ fputs(";; res_findzonecut: ", stderr);
+ vfprintf(stderr, fmt, ap);
+ fputc('\n', stderr);
+ va_end(ap);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_init.c b/usr/src/lib/libresolv2_joy/common/resolv/res_init.c
new file mode 100644
index 0000000000..10254d1931
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_init.c
@@ -0,0 +1,958 @@
+/*
+ * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+
+/*
+ * Copyright (c) 1985, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
+static const char rcsid[] = "$Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <netdb.h>
+
+#ifndef HAVE_MD5
+# include "../dst/md5.h"
+#else
+# ifdef SOLARIS2
+# include <sys/md5.h>
+# endif
+#endif
+#ifndef _MD5_H_
+# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */
+#endif
+
+
+#include "port_after.h"
+
+/* ensure that sockaddr_in6 and IN6ADDR_ANY_INIT are declared / defined */
+#include <resolv_joy.h>
+
+/* ISC purposely put port_after.h before <resolv.h> to force in6 stuff
+ * (above) so we explicitly include port_resolv.h here */
+#include "port_resolv.h"
+
+#include "res_private.h"
+
+/*% Options. Should all be left alone. */
+#define RESOLVSORT
+#define DEBUG
+
+#ifdef SUNW_INITCHKIF
+#include <net/if.h>
+#include <netinet/if_ether.h>
+#include <sys/sockio.h>
+#define MAXIFS 8192
+#endif /* SUNW_INITCHKIF */
+
+#ifdef SOLARIS2
+#include <sys/systeminfo.h>
+#endif
+
+static void res_setoptions __P((res_state, const char *, const char *));
+
+#ifdef RESOLVSORT
+static const char sort_mask[] = "/&";
+#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)
+static u_int32_t net_mask __P((struct in_addr));
+#endif
+
+#if !defined(isascii) /*%< XXX - could be a function */
+# define isascii(c) (!(c & 0200))
+#endif
+
+/*
+ * Resolver state default settings.
+ */
+
+/*%
+ * Set up default settings. If the configuration file exist, the values
+ * there will have precedence. Otherwise, the server address is set to
+ * INADDR_ANY and the default domain name comes from the gethostname().
+ *
+ * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1
+ * rather than INADDR_ANY ("0.0.0.0") as the default name server address
+ * since it was noted that INADDR_ANY actually meant ``the first interface
+ * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface,
+ * it had to be "up" in order for you to reach your own name server. It
+ * was later decided that since the recommended practice is to always
+ * install local static routes through 127.0.0.1 for all your network
+ * interfaces, that we could solve this problem without a code change.
+ *
+ * The configuration file should always be used, since it is the only way
+ * to specify a default domain. If you are running a server on your local
+ * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1"
+ * in the configuration file.
+ *
+ * Return 0 if completes successfully, -1 on error
+ */
+int
+res_ninit(res_state statp) {
+ extern int __res_vinit(res_state, int);
+ return (__res_vinit(statp, 0));
+}
+
+/*% This function has to be reachable by res_data.c but not publically. */
+int
+__res_vinit(res_state statp, int preinit) {
+ register FILE *fp;
+ register char *cp, **pp;
+ register int n;
+ char buf[BUFSIZ];
+ int nserv = 0; /*%< number of nameserver records read from file */
+ int haveenv = 0;
+ int havesearch = 0;
+#ifdef RESOLVSORT
+ int nsort = 0;
+ char *net;
+#endif
+ int dots;
+ union res_sockaddr_union u[2];
+ int maxns = MAXNS;
+
+ RES_SET_H_ERRNO(statp, 0);
+ if (statp->_u._ext.ext != NULL)
+ res_ndestroy(statp);
+
+ if (!preinit) {
+ statp->retrans = RES_TIMEOUT;
+ statp->retry = RES_DFLRETRY;
+ statp->options = RES_DEFAULT;
+ res_rndinit(statp);
+ statp->id = res_nrandomid(statp);
+ }
+
+ memset(u, 0, sizeof(u));
+#ifdef USELOOPBACK
+ u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
+#else
+ u[nserv].sin.sin_addr.s_addr = INADDR_ANY;
+#endif
+ u[nserv].sin.sin_family = AF_INET;
+ u[nserv].sin.sin_port = htons(NAMESERVER_PORT);
+#ifdef HAVE_SA_LEN
+ u[nserv].sin.sin_len = sizeof(struct sockaddr_in);
+#endif
+ nserv++;
+#ifdef HAS_INET6_STRUCTS
+#ifdef USELOOPBACK
+ u[nserv].sin6.sin6_addr = in6addr_loopback;
+#else
+ u[nserv].sin6.sin6_addr = in6addr_any;
+#endif
+ u[nserv].sin6.sin6_family = AF_INET6;
+ u[nserv].sin6.sin6_port = htons(NAMESERVER_PORT);
+#ifdef HAVE_SA_LEN
+ u[nserv].sin6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
+ nserv++;
+#endif
+ statp->nscount = 0;
+ statp->ndots = 1;
+ statp->pfcode = 0;
+ statp->_vcsock = -1;
+ statp->_flags = 0;
+ statp->qhook = NULL;
+ statp->rhook = NULL;
+ statp->_u._ext.nscount = 0;
+ statp->_u._ext.ext = malloc(sizeof(*statp->_u._ext.ext));
+ if (statp->_u._ext.ext != NULL) {
+ memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext));
+ statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr;
+ strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa");
+ strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int");
+ } else {
+ /*
+ * Historically res_init() rarely, if at all, failed.
+ * Examples and applications exist which do not check
+ * our return code. Furthermore several applications
+ * simply call us to get the systems domainname. So
+ * rather then immediately fail here we store the
+ * failure, which is returned later, in h_errno. And
+ * prevent the collection of 'nameserver' information
+ * by setting maxns to 0. Thus applications that fail
+ * to check our return code wont be able to make
+ * queries anyhow.
+ */
+ RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
+ maxns = 0;
+ }
+#ifdef RESOLVSORT
+ statp->nsort = 0;
+#endif
+ res_setservers(statp, u, nserv);
+
+#ifdef SUNW_INITCHKIF
+/*
+ * Short circuit res_init() if no non-loopback interfaces are up. This is
+ * done to avoid boot delays if "dns" comes before "files" in nsswitch.conf.
+ * An additional fix has been added to this code, to count all external
+ * interfaces, which includes the IPv6 interfaces. If no external interfaces
+ * are found, an additional check is carried out to determine if any deprecated
+ * interfaces are up.
+ */
+ {
+ int s;
+ struct lifnum lifn;
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ perror("res_init: socket");
+ goto freedata;
+ }
+ lifn.lifn_family = AF_UNSPEC;
+ lifn.lifn_flags = LIFC_EXTERNAL_SOURCE;
+ if (ioctl(s, SIOCGLIFNUM, (char *)&lifn) < 0) {
+ close(s);
+ goto freedata;
+ }
+ if (lifn.lifn_count == 0) {
+ /*
+ * Check if there are any deprecated interfaces up
+ */
+ struct lifconf lifc;
+ uchar_t *buf;
+ int buflen, i, int_up = 0;
+
+ lifn.lifn_flags = 0;
+ if ((ioctl(s, SIOCGLIFNUM, (char *)&lifn) < 0) ||
+ (lifn.lifn_count < 1)) {
+ close(s);
+ goto freedata;
+ }
+
+ buflen = lifn.lifn_count * sizeof (struct lifreq);
+ buf = (uchar_t *)malloc(buflen);
+ if (buf == NULL) {
+ close(s);
+ goto freedata;
+ }
+
+ lifc.lifc_family = AF_UNSPEC;
+ lifc.lifc_flags = 0;
+ lifc.lifc_len = buflen;
+ lifc.lifc_lifcu.lifcu_buf = (caddr_t)buf;
+ if (ioctl(s, SIOCGLIFCONF, (char *)&lifc) < 0) {
+ close(s);
+ free(buf);
+ goto freedata;
+ }
+
+ for (i = 0; i < lifn.lifn_count; ++i) {
+ struct lifreq *lreqp, lreq;
+
+ lreqp = (struct lifreq *)&lifc.lifc_req[i];
+ strlcpy(lreq.lifr_name, lreqp->lifr_name,
+ sizeof (lreq.lifr_name));
+ if (ioctl(s, SIOCGLIFFLAGS, &lreq) < 0) {
+ close(s);
+ free(buf);
+ goto freedata;
+ }
+ if ((lreq.lifr_flags & IFF_UP) &&
+ !(lreq.lifr_flags & IFF_NOLOCAL) &&
+ !(lreq.lifr_flags & IFF_NOXMIT) &&
+ !(lreq.lifr_flags & IFF_LOOPBACK)) {
+ int_up = 1;
+ break;
+ }
+ }
+ free(buf);
+
+ if (!int_up) {
+ close(s);
+ goto freedata;
+ }
+ }
+ close(s);
+ }
+#endif /* SUNW_INITCHKIF */
+
+#ifdef SOLARIS2
+ /*
+ * The old libresolv derived the defaultdomain from NIS/NIS+.
+ * We want to keep this behaviour
+ */
+ {
+ char buf[sizeof(statp->defdname)], *cp;
+ int ret;
+
+ if ((ret = sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf))) > 0 &&
+ (unsigned int)ret <= sizeof(buf)) {
+ if (buf[0] == '+')
+ buf[0] = '.';
+ cp = strchr(buf, '.');
+ cp = (cp == NULL) ? buf : (cp + 1);
+ strncpy(statp->defdname, cp,
+ sizeof(statp->defdname) - 1);
+ statp->defdname[sizeof(statp->defdname) - 1] = '\0';
+ }
+ }
+#endif /* SOLARIS2 */
+
+ /* Allow user to override the local domain definition */
+ if ((cp = getenv("LOCALDOMAIN")) != NULL) {
+ (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
+ statp->defdname[sizeof(statp->defdname) - 1] = '\0';
+ haveenv++;
+
+ /*
+ * Set search list to be blank-separated strings
+ * from rest of env value. Permits users of LOCALDOMAIN
+ * to still have a search list, and anyone to set the
+ * one that they want to use as an individual (even more
+ * important now that the rfc1535 stuff restricts searches)
+ */
+ cp = statp->defdname;
+ pp = statp->dnsrch;
+ *pp++ = cp;
+ for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
+ if (*cp == '\n') /*%< silly backwards compat */
+ break;
+ else if (*cp == ' ' || *cp == '\t') {
+ *cp = 0;
+ n = 1;
+ } else if (n) {
+ *pp++ = cp;
+ n = 0;
+ havesearch = 1;
+ }
+ }
+ /* null terminate last domain if there are excess */
+ while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
+ cp++;
+ *cp = '\0';
+ *pp++ = 0;
+ }
+
+#define MATCH(line, name) \
+ (!strncmp(line, name, sizeof(name) - 1) && \
+ (line[sizeof(name) - 1] == ' ' || \
+ line[sizeof(name) - 1] == '\t'))
+
+ nserv = 0;
+ if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {
+ /* read the config file */
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ /* skip comments */
+ if (*buf == ';' || *buf == '#')
+ continue;
+ /* read default domain name */
+ if (MATCH(buf, "domain")) {
+ if (haveenv) /*%< skip if have from environ */
+ continue;
+ cp = buf + sizeof("domain") - 1;
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ if ((*cp == '\0') || (*cp == '\n'))
+ continue;
+ strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
+ statp->defdname[sizeof(statp->defdname) - 1] = '\0';
+ if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL)
+ *cp = '\0';
+ havesearch = 0;
+ continue;
+ }
+ /* set search list */
+ if (MATCH(buf, "search")) {
+ if (haveenv) /*%< skip if have from environ */
+ continue;
+ cp = buf + sizeof("search") - 1;
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ if ((*cp == '\0') || (*cp == '\n'))
+ continue;
+ strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
+ statp->defdname[sizeof(statp->defdname) - 1] = '\0';
+ if ((cp = strchr(statp->defdname, '\n')) != NULL)
+ *cp = '\0';
+ /*
+ * Set search list to be blank-separated strings
+ * on rest of line.
+ */
+ cp = statp->defdname;
+ pp = statp->dnsrch;
+ *pp++ = cp;
+ for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
+ if (*cp == ' ' || *cp == '\t') {
+ *cp = 0;
+ n = 1;
+ } else if (n) {
+ *pp++ = cp;
+ n = 0;
+ }
+ }
+ /* null terminate last domain if there are excess */
+ while (*cp != '\0' && *cp != ' ' && *cp != '\t')
+ cp++;
+ *cp = '\0';
+ *pp++ = 0;
+ havesearch = 1;
+ continue;
+ }
+ /* read nameservers to query */
+ if (MATCH(buf, "nameserver") && nserv < maxns) {
+ struct addrinfo hints, *ai;
+ char sbuf[NI_MAXSERV];
+ const size_t minsiz =
+ sizeof(statp->_u._ext.ext->nsaddrs[0]);
+
+ cp = buf + sizeof("nameserver") - 1;
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ cp[strcspn(cp, ";# \t\n")] = '\0';
+ if ((*cp != '\0') && (*cp != '\n')) {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM; /*dummy*/
+ hints.ai_flags = AI_NUMERICHOST;
+ sprintf(sbuf, "%u", NAMESERVER_PORT);
+ if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 &&
+ ai->ai_addrlen <= minsiz) {
+ if (statp->_u._ext.ext != NULL) {
+ memcpy(&statp->_u._ext.ext->nsaddrs[nserv],
+ ai->ai_addr, ai->ai_addrlen);
+ }
+ if (ai->ai_addrlen <=
+ sizeof(statp->nsaddr_list[nserv])) {
+ memcpy(&statp->nsaddr_list[nserv],
+ ai->ai_addr, ai->ai_addrlen);
+ } else
+ statp->nsaddr_list[nserv].sin_family = 0;
+ freeaddrinfo(ai);
+ nserv++;
+ }
+ }
+ continue;
+ }
+#ifdef RESOLVSORT
+ if (MATCH(buf, "sortlist")) {
+ struct in_addr a;
+
+ cp = buf + sizeof("sortlist") - 1;
+ while (nsort < MAXRESOLVSORT) {
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ if (*cp == '\0' || *cp == '\n' || *cp == ';')
+ break;
+ net = cp;
+ while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
+ isascii(*cp) && !isspace((unsigned char)*cp))
+ cp++;
+ n = *cp;
+ *cp = 0;
+ if (inet_aton(net, &a)) {
+ statp->sort_list[nsort].addr = a;
+ if (ISSORTMASK(n)) {
+ *cp++ = n;
+ net = cp;
+ while (*cp && *cp != ';' &&
+ isascii(*cp) &&
+ !isspace((unsigned char)*cp))
+ cp++;
+ n = *cp;
+ *cp = 0;
+ if (inet_aton(net, &a)) {
+ statp->sort_list[nsort].mask = a.s_addr;
+ } else {
+ statp->sort_list[nsort].mask =
+ net_mask(statp->sort_list[nsort].addr);
+ }
+ } else {
+ statp->sort_list[nsort].mask =
+ net_mask(statp->sort_list[nsort].addr);
+ }
+ nsort++;
+ }
+ *cp = n;
+ }
+ continue;
+ }
+#endif
+ if (MATCH(buf, "options")) {
+ res_setoptions(statp, buf + sizeof("options") - 1, "conf");
+ continue;
+ }
+ }
+ if (nserv > 0)
+ statp->nscount = nserv;
+#ifdef RESOLVSORT
+ statp->nsort = nsort;
+#endif
+ (void) fclose(fp);
+ }
+/*
+ * Last chance to get a nameserver. This should not normally
+ * be necessary
+ */
+#ifdef NO_RESOLV_CONF
+ if(nserv == 0)
+ nserv = get_nameservers(statp);
+#endif
+
+ if (statp->defdname[0] == 0 &&
+ gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
+ (cp = strchr(buf, '.')) != NULL)
+ strcpy(statp->defdname, cp + 1);
+
+ /* find components of local domain that might be searched */
+ if (havesearch == 0) {
+ pp = statp->dnsrch;
+ *pp++ = statp->defdname;
+ *pp = NULL;
+
+ dots = 0;
+ for (cp = statp->defdname; *cp; cp++)
+ dots += (*cp == '.');
+
+ cp = statp->defdname;
+ while (pp < statp->dnsrch + MAXDFLSRCH) {
+ if (dots < LOCALDOMAINPARTS)
+ break;
+ cp = strchr(cp, '.') + 1; /*%< we know there is one */
+ *pp++ = cp;
+ dots--;
+ }
+ *pp = NULL;
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG) {
+ printf(";; res_init()... default dnsrch list:\n");
+ for (pp = statp->dnsrch; *pp; pp++)
+ printf(";;\t%s\n", *pp);
+ printf(";;\t..END..\n");
+ }
+#endif
+ }
+
+ if ((cp = getenv("RES_OPTIONS")) != NULL)
+ res_setoptions(statp, cp, "env");
+ statp->options |= RES_INIT;
+ return (statp->res_h_errno);
+#ifdef SUNW_INITCHKIF
+freedata:
+ RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
+ if (statp->_u._ext.ext != NULL) {
+ free(statp->_u._ext.ext);
+ statp->_u._ext.ext = NULL;
+ }
+ return (-1);
+#endif /* SUNW_INITCHKIF */
+
+}
+
+static void
+res_setoptions(res_state statp, const char *options, const char *source)
+{
+ const char *cp = options;
+ int i;
+ struct __res_state_ext *ext = statp->_u._ext.ext;
+
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_setoptions(\"%s\", \"%s\")...\n",
+ options, source);
+#endif
+ while (*cp) {
+ /* skip leading and inner runs of spaces */
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ /* search for and process individual options */
+ if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
+ i = atoi(cp + sizeof("ndots:") - 1);
+ if (i <= RES_MAXNDOTS)
+ statp->ndots = i;
+ else
+ statp->ndots = RES_MAXNDOTS;
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";;\tndots=%d\n", statp->ndots);
+#endif
+ } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) {
+ i = atoi(cp + sizeof("timeout:") - 1);
+ if (i <= RES_MAXRETRANS)
+ statp->retrans = i;
+ else
+ statp->retrans = RES_MAXRETRANS;
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";;\ttimeout=%d\n", statp->retrans);
+#endif
+#ifdef SOLARIS2
+ } else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) {
+ /*
+ * For backward compatibility, 'retrans' is
+ * supported as an alias for 'timeout', though
+ * without an imposed maximum.
+ */
+ statp->retrans = atoi(cp + sizeof("retrans:") - 1);
+ } else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){
+ /*
+ * For backward compatibility, 'retry' is
+ * supported as an alias for 'attempts', though
+ * without an imposed maximum.
+ */
+ statp->retry = atoi(cp + sizeof("retry:") - 1);
+#endif /* SOLARIS2 */
+ } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
+ i = atoi(cp + sizeof("attempts:") - 1);
+ if (i <= RES_MAXRETRY)
+ statp->retry = i;
+ else
+ statp->retry = RES_MAXRETRY;
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";;\tattempts=%d\n", statp->retry);
+#endif
+ } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
+#ifdef DEBUG
+ if (!(statp->options & RES_DEBUG)) {
+ printf(";; res_setoptions(\"%s\", \"%s\")..\n",
+ options, source);
+ statp->options |= RES_DEBUG;
+ }
+ printf(";;\tdebug\n");
+#endif
+ } else if (!strncmp(cp, "no_tld_query",
+ sizeof("no_tld_query") - 1) ||
+ !strncmp(cp, "no-tld-query",
+ sizeof("no-tld-query") - 1)) {
+ statp->options |= RES_NOTLDQUERY;
+ } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
+ statp->options |= RES_USE_INET6;
+ } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
+ statp->options |= RES_ROTATE;
+ } else if (!strncmp(cp, "no-check-names",
+ sizeof("no-check-names") - 1)) {
+ statp->options |= RES_NOCHECKNAME;
+ }
+#ifdef RES_USE_EDNS0
+ else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
+ statp->options |= RES_USE_EDNS0;
+ }
+#endif
+ else if (!strncmp(cp, "dname", sizeof("dname") - 1)) {
+ statp->options |= RES_USE_DNAME;
+ }
+ else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) {
+ if (ext == NULL)
+ goto skip;
+ cp += sizeof("nibble:") - 1;
+ i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1);
+ strncpy(ext->nsuffix, cp, i);
+ ext->nsuffix[i] = '\0';
+ }
+ else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) {
+ if (ext == NULL)
+ goto skip;
+ cp += sizeof("nibble2:") - 1;
+ i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1);
+ strncpy(ext->nsuffix2, cp, i);
+ ext->nsuffix2[i] = '\0';
+ }
+ else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {
+ cp += sizeof("v6revmode:") - 1;
+ /* "nibble" and "bitstring" used to be valid */
+ if (!strncmp(cp, "single", sizeof("single") - 1)) {
+ statp->options |= RES_NO_NIBBLE2;
+ } else if (!strncmp(cp, "both", sizeof("both") - 1)) {
+ statp->options &=
+ ~RES_NO_NIBBLE2;
+ }
+ }
+ else {
+ /* XXX - print a warning here? */
+ }
+ skip:
+ /* skip to next run of spaces */
+ while (*cp && *cp != ' ' && *cp != '\t')
+ cp++;
+ }
+}
+
+#ifdef RESOLVSORT
+/* XXX - should really support CIDR which means explicit masks always. */
+static u_int32_t
+net_mask(in) /*!< XXX - should really use system's version of this */
+ struct in_addr in;
+{
+ register u_int32_t i = ntohl(in.s_addr);
+
+ if (IN_CLASSA(i))
+ return (htonl(IN_CLASSA_NET));
+ else if (IN_CLASSB(i))
+ return (htonl(IN_CLASSB_NET));
+ return (htonl(IN_CLASSC_NET));
+}
+#endif
+
+void
+res_rndinit(res_state statp)
+{
+ struct timeval now;
+ u_int32_t u32;
+ u_int16_t u16;
+
+ gettimeofday(&now, NULL);
+ u32 = now.tv_sec;
+ memcpy(statp->_u._ext._rnd, &u32, 4);
+ u32 = now.tv_usec;
+ memcpy(statp->_u._ext._rnd + 4, &u32, 4);
+ u32 += now.tv_sec;
+ memcpy(statp->_u._ext._rnd + 8, &u32, 4);
+ u16 = getpid();
+ memcpy(statp->_u._ext._rnd + 12, &u16, 2);
+
+}
+
+u_int
+res_nrandomid(res_state statp) {
+ struct timeval now;
+ u_int16_t u16;
+ MD5_CTX ctx;
+
+ gettimeofday(&now, NULL);
+ u16 = (u_int16_t) (now.tv_sec ^ now.tv_usec);
+
+ memcpy(statp->_u._ext._rnd + 14, &u16, 2);
+#ifndef HAVE_MD5
+ MD5_Init(&ctx);
+ MD5_Update(&ctx, statp->_u._ext._rnd, 16);
+ MD5_Final(statp->_u._ext._rnd, &ctx);
+#else
+ MD5Init(&ctx);
+ MD5Update(&ctx, statp->_u._ext._rnd, 16);
+ MD5Final(statp->_u._ext._rnd, &ctx);
+#endif
+ memcpy(&u16, statp->_u._ext._rnd + 14, 2);
+ return ((u_int) u16);
+}
+
+/*%
+ * This routine is for closing the socket if a virtual circuit is used and
+ * the program wants to close it. This provides support for endhostent()
+ * which expects to close the socket.
+ *
+ * This routine is not expected to be user visible.
+ */
+void
+res_nclose(res_state statp) {
+ int ns;
+
+ if (statp->_vcsock >= 0) {
+ (void) close(statp->_vcsock);
+ statp->_vcsock = -1;
+ statp->_flags &= ~(RES_F_VC | RES_F_CONN);
+ }
+ for (ns = 0; ns < statp->_u._ext.nscount; ns++) {
+ if (statp->_u._ext.nssocks[ns] != -1) {
+ (void) close(statp->_u._ext.nssocks[ns]);
+ statp->_u._ext.nssocks[ns] = -1;
+ }
+ }
+}
+
+void
+res_ndestroy(res_state statp) {
+ res_nclose(statp);
+ if (statp->_u._ext.ext != NULL)
+ free(statp->_u._ext.ext);
+ statp->options &= ~RES_INIT;
+ statp->_u._ext.ext = NULL;
+}
+
+const char *
+res_get_nibblesuffix(res_state statp) {
+ if (statp->_u._ext.ext)
+ return (statp->_u._ext.ext->nsuffix);
+ return ("ip6.arpa");
+}
+
+const char *
+res_get_nibblesuffix2(res_state statp) {
+ if (statp->_u._ext.ext)
+ return (statp->_u._ext.ext->nsuffix2);
+ return ("ip6.int");
+}
+
+void
+res_setservers(res_state statp, const union res_sockaddr_union *set, int cnt) {
+ int i, nserv;
+ size_t size;
+
+ /* close open servers */
+ res_nclose(statp);
+
+ /* cause rtt times to be forgotten */
+ statp->_u._ext.nscount = 0;
+
+ nserv = 0;
+ for (i = 0; i < cnt && nserv < MAXNS; i++) {
+ switch (set->sin.sin_family) {
+ case AF_INET:
+ size = sizeof(set->sin);
+ if (statp->_u._ext.ext)
+ memcpy(&statp->_u._ext.ext->nsaddrs[nserv],
+ &set->sin, size);
+ if (size <= sizeof(statp->nsaddr_list[nserv]))
+ memcpy(&statp->nsaddr_list[nserv],
+ &set->sin, size);
+ else
+ statp->nsaddr_list[nserv].sin_family = 0;
+ nserv++;
+ break;
+
+#ifdef HAS_INET6_STRUCTS
+ case AF_INET6:
+ size = sizeof(set->sin6);
+ if (statp->_u._ext.ext)
+ memcpy(&statp->_u._ext.ext->nsaddrs[nserv],
+ &set->sin6, size);
+ if (size <= sizeof(statp->nsaddr_list[nserv]))
+ memcpy(&statp->nsaddr_list[nserv],
+ &set->sin6, size);
+ else
+ statp->nsaddr_list[nserv].sin_family = 0;
+ nserv++;
+ break;
+#endif
+
+ default:
+ break;
+ }
+ set++;
+ }
+ statp->nscount = nserv;
+
+}
+
+int
+res_getservers(res_state statp, union res_sockaddr_union *set, int cnt) {
+ int i;
+ size_t size;
+ u_int16_t family;
+
+ for (i = 0; i < statp->nscount && i < cnt; i++) {
+ if (statp->_u._ext.ext)
+ family = statp->_u._ext.ext->nsaddrs[i].sin.sin_family;
+ else
+ family = statp->nsaddr_list[i].sin_family;
+
+ switch (family) {
+ case AF_INET:
+ size = sizeof(set->sin);
+ if (statp->_u._ext.ext)
+ memcpy(&set->sin,
+ &statp->_u._ext.ext->nsaddrs[i],
+ size);
+ else
+ memcpy(&set->sin, &statp->nsaddr_list[i],
+ size);
+ break;
+
+#ifdef HAS_INET6_STRUCTS
+ case AF_INET6:
+ size = sizeof(set->sin6);
+ if (statp->_u._ext.ext)
+ memcpy(&set->sin6,
+ &statp->_u._ext.ext->nsaddrs[i],
+ size);
+ else
+ memcpy(&set->sin6, &statp->nsaddr_list[i],
+ size);
+ break;
+#endif
+
+ default:
+ set->sin.sin_family = 0;
+ break;
+ }
+ set++;
+ }
+ return (statp->nscount);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_mkquery.c b/usr/src/lib/libresolv2_joy/common/resolv/res_mkquery.c
new file mode 100644
index 0000000000..cf36855e9d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_mkquery.c
@@ -0,0 +1,386 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Portions Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996, 1997, 1988, 1999, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1985, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: res_mkquery.c,v 1.10 2008/12/11 09:59:00 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+#include <sys/types.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+
+#ifdef SUNW_CONFCHECK
+#include <sys/socket.h>
+#include <errno.h>
+#include <sys/stat.h>
+#endif /* SUNW_CONFCHECK */
+
+
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <string.h>
+#include "port_after.h"
+
+/* Options. Leave them on. */
+#define DEBUG
+
+extern const char *_res_opcodes[];
+
+#ifdef SUNW_CONFCHECK
+static int _confcheck(res_state statp);
+#endif /* SUNW_CONFCHECK */
+
+
+/*%
+ * Form all types of queries.
+ * Returns the size of the result or -1.
+ */
+int
+res_nmkquery(res_state statp,
+ int op, /*!< opcode of query */
+ const char *dname, /*!< domain name */
+ int class, int type, /*!< class and type of query */
+ const u_char *data, /*!< resource record data */
+ int datalen, /*!< length of data */
+ const u_char *newrr_in, /*!< new rr for modify or append */
+ u_char *buf, /*!< buffer to put query */
+ int buflen) /*!< size of buffer */
+{
+ register HEADER *hp;
+ register u_char *cp, *ep;
+ register int n;
+ u_char *dnptrs[20], **dpp, **lastdnptr;
+
+ UNUSED(newrr_in);
+
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_nmkquery(%s, %s, %s, %s)\n",
+ _res_opcodes[op], dname, p_class(class), p_type(type));
+#endif
+
+#ifdef SUNW_CONFCHECK
+ /*
+ * 1247019, 1265838, and 4034368: Check to see if we can
+ * bailout quickly.
+ */
+ if (_confcheck(statp) == -1) {
+ RES_SET_H_ERRNO(statp, NO_RECOVERY);
+ return(-1);
+ }
+#endif /* SUNW_CONFCHECK */
+
+ /*
+ * Initialize header fields.
+ */
+ if ((buf == NULL) || (buflen < HFIXEDSZ))
+ return (-1);
+ memset(buf, 0, HFIXEDSZ);
+ hp = (HEADER *) buf;
+ statp->id = res_nrandomid(statp);
+ hp->id = htons(statp->id);
+ hp->opcode = op;
+ hp->rd = (statp->options & RES_RECURSE) != 0U;
+ hp->rcode = NOERROR;
+ cp = buf + HFIXEDSZ;
+ ep = buf + buflen;
+ dpp = dnptrs;
+ *dpp++ = buf;
+ *dpp++ = NULL;
+ lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
+ /*
+ * perform opcode specific processing
+ */
+ switch (op) {
+ case QUERY: /*FALLTHROUGH*/
+ case NS_NOTIFY_OP:
+ if (ep - cp < QFIXEDSZ)
+ return (-1);
+ if ((n = dn_comp(dname, cp, ep - cp - QFIXEDSZ, dnptrs,
+ lastdnptr)) < 0)
+ return (-1);
+ cp += n;
+ ns_put16(type, cp);
+ cp += INT16SZ;
+ ns_put16(class, cp);
+ cp += INT16SZ;
+ hp->qdcount = htons(1);
+ if (op == QUERY || data == NULL)
+ break;
+ /*
+ * Make an additional record for completion domain.
+ */
+ if ((ep - cp) < RRFIXEDSZ)
+ return (-1);
+ n = dn_comp((const char *)data, cp, ep - cp - RRFIXEDSZ,
+ dnptrs, lastdnptr);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ns_put16(T_NULL, cp);
+ cp += INT16SZ;
+ ns_put16(class, cp);
+ cp += INT16SZ;
+ ns_put32(0, cp);
+ cp += INT32SZ;
+ ns_put16(0, cp);
+ cp += INT16SZ;
+ hp->arcount = htons(1);
+ break;
+
+ case IQUERY:
+ /*
+ * Initialize answer section
+ */
+ if (ep - cp < 1 + RRFIXEDSZ + datalen)
+ return (-1);
+ *cp++ = '\0'; /*%< no domain name */
+ ns_put16(type, cp);
+ cp += INT16SZ;
+ ns_put16(class, cp);
+ cp += INT16SZ;
+ ns_put32(0, cp);
+ cp += INT32SZ;
+ ns_put16(datalen, cp);
+ cp += INT16SZ;
+ if (datalen) {
+ memcpy(cp, data, datalen);
+ cp += datalen;
+ }
+ hp->ancount = htons(1);
+ break;
+
+ default:
+ return (-1);
+ }
+ return (cp - buf);
+}
+
+#ifdef RES_USE_EDNS0
+/* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */
+
+int
+res_nopt(res_state statp,
+ int n0, /*%< current offset in buffer */
+ u_char *buf, /*%< buffer to put query */
+ int buflen, /*%< size of buffer */
+ int anslen) /*%< UDP answer buffer size */
+{
+ register HEADER *hp;
+ register u_char *cp, *ep;
+ u_int16_t flags = 0;
+
+#ifdef DEBUG
+ if ((statp->options & RES_DEBUG) != 0U)
+ printf(";; res_nopt()\n");
+#endif
+
+ hp = (HEADER *) buf;
+ cp = buf + n0;
+ ep = buf + buflen;
+
+ if ((ep - cp) < 1 + RRFIXEDSZ)
+ return (-1);
+
+ *cp++ = 0; /*%< "." */
+ ns_put16(ns_t_opt, cp); /*%< TYPE */
+ cp += INT16SZ;
+ ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */
+ cp += INT16SZ;
+ *cp++ = NOERROR; /*%< extended RCODE */
+ *cp++ = 0; /*%< EDNS version */
+
+ if (statp->options & RES_USE_DNSSEC) {
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_opt()... ENDS0 DNSSEC\n");
+#endif
+ flags |= NS_OPT_DNSSEC_OK;
+ }
+ ns_put16(flags, cp);
+ cp += INT16SZ;
+
+ ns_put16(0U, cp); /*%< RDLEN */
+ cp += INT16SZ;
+
+ hp->arcount = htons(ntohs(hp->arcount) + 1);
+
+ return (cp - buf);
+}
+
+/*
+ * Construct variable data (RDATA) block for OPT psuedo-RR, append it
+ * to the buffer, then update the RDLEN field (previously set to zero by
+ * res_nopt()) with the new RDATA length.
+ */
+int
+res_nopt_rdata(res_state statp,
+ int n0, /*%< current offset in buffer */
+ u_char *buf, /*%< buffer to put query */
+ int buflen, /*%< size of buffer */
+ u_char *rdata, /*%< ptr to start of opt rdata */
+ u_short code, /*%< OPTION-CODE */
+ u_short len, /*%< OPTION-LENGTH */
+ u_char *data) /*%< OPTION_DATA */
+{
+ register u_char *cp, *ep;
+
+#ifdef DEBUG
+ if ((statp->options & RES_DEBUG) != 0U)
+ printf(";; res_nopt_rdata()\n");
+#endif
+
+ cp = buf + n0;
+ ep = buf + buflen;
+
+ if ((ep - cp) < (4 + len))
+ return (-1);
+
+ if (rdata < (buf + 2) || rdata >= ep)
+ return (-1);
+
+ ns_put16(code, cp);
+ cp += INT16SZ;
+
+ ns_put16(len, cp);
+ cp += INT16SZ;
+
+ memcpy(cp, data, len);
+ cp += len;
+
+ len = cp - rdata;
+ ns_put16(len, rdata - 2); /* Update RDLEN field */
+
+ return (cp - buf);
+}
+#endif
+
+#ifdef SUNW_CONFCHECK
+
+/*
+ * Time out quickly if there is no /etc/resolv.conf and a TCP connection
+ * to the local DNS server fails.
+ */
+static int _confcheck(res_state statp)
+{
+ int ns;
+ struct stat rc_stat;
+ struct sockaddr_in ns_sin;
+
+ /* First, we check to see if /etc/resolv.conf exists.
+ * If it doesn't, then it is likely that the localhost is
+ * the nameserver.
+ */
+ if (stat(_PATH_RESCONF, &rc_stat) == -1 && errno == ENOENT) {
+
+ /* Next, we check to see if _res.nsaddr is set to loopback.
+ * If it isn't, it has been altered by the application
+ * explicitly and we then want to bail with success.
+ */
+ if (statp->nsaddr.sin_addr.S_un.S_addr ==
+ htonl(INADDR_LOOPBACK)) {
+
+ /* Lastly, we try to connect to the TCP port of the
+ * nameserver. If this fails, then we know that
+ * DNS is misconfigured and we can quickly exit.
+ */
+ ns = socket(AF_INET, SOCK_STREAM, 0);
+ IN_SET_LOOPBACK_ADDR(&ns_sin);
+ ns_sin.sin_port = htons(NAMESERVER_PORT);
+ if (connect(ns, (struct sockaddr *) &ns_sin,
+ sizeof ns_sin) == -1) {
+ close(ns);
+ return(-1);
+ }
+ else {
+ close(ns);
+
+ return(0);
+ }
+ }
+
+ return(0);
+ }
+
+ return (0);
+}
+#endif /* SUNW_CONFCHECK */
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.c b/usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.c
new file mode 100644
index 0000000000..8f73e281d0
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.c
@@ -0,0 +1,1163 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file
+ * \brief
+ * Based on the Dynamic DNS reference implementation by Viraj Bais
+ * &lt;viraj_bais@ccm.fm.intel.com>
+ */
+
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "$Id: res_mkupdate.c,v 1.10 2008/12/11 09:59:00 marka Exp $";
+#endif /* not lint */
+
+#include "port_before.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <res_update.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+
+#include "port_after.h"
+
+/* Options. Leave them on. */
+#define DEBUG
+#define MAXPORT 1024
+
+static int getnum_str(u_char **, u_char *);
+static int gethexnum_str(u_char **, u_char *);
+static int getword_str(char *, int, u_char **, u_char *);
+static int getstr_str(char *, int, u_char **, u_char *);
+
+#define ShrinkBuffer(x) if ((buflen -= x) < 0) return (-2);
+
+/* Forward. */
+
+int res_protocolnumber(const char *);
+int res_servicenumber(const char *);
+
+/*%
+ * Form update packets.
+ * Returns the size of the resulting packet if no error
+ *
+ * On error,
+ * returns
+ *\li -1 if error in reading a word/number in rdata
+ * portion for update packets
+ *\li -2 if length of buffer passed is insufficient
+ *\li -3 if zone section is not the first section in
+ * the linked list, or section order has a problem
+ *\li -4 on a number overflow
+ *\li -5 unknown operation or no records
+ */
+int
+res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) {
+ ns_updrec *rrecp_start = rrecp_in;
+ HEADER *hp;
+ u_char *cp, *sp2, *startp, *endp;
+ int n, i, soanum, multiline;
+ ns_updrec *rrecp;
+ struct in_addr ina;
+ struct in6_addr in6a;
+ char buf2[MAXDNAME];
+ u_char buf3[MAXDNAME];
+ int section, numrrs = 0, counts[ns_s_max];
+ u_int16_t rtype, rclass;
+ u_int32_t n1, rttl;
+ u_char *dnptrs[20], **dpp, **lastdnptr;
+ int siglen, keylen, certlen;
+
+ /*
+ * Initialize header fields.
+ */
+ if ((buf == NULL) || (buflen < HFIXEDSZ))
+ return (-1);
+ memset(buf, 0, HFIXEDSZ);
+ hp = (HEADER *) buf;
+ statp->id = res_nrandomid(statp);
+ hp->id = htons(statp->id);
+ hp->opcode = ns_o_update;
+ hp->rcode = NOERROR;
+ cp = buf + HFIXEDSZ;
+ buflen -= HFIXEDSZ;
+ dpp = dnptrs;
+ *dpp++ = buf;
+ *dpp++ = NULL;
+ lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
+
+ if (rrecp_start == NULL)
+ return (-5);
+ else if (rrecp_start->r_section != S_ZONE)
+ return (-3);
+
+ memset(counts, 0, sizeof counts);
+ for (rrecp = rrecp_start; rrecp; rrecp = NEXT(rrecp, r_glink)) {
+ numrrs++;
+ section = rrecp->r_section;
+ if (section < 0 || section >= ns_s_max)
+ return (-1);
+ counts[section]++;
+ for (i = section + 1; i < ns_s_max; i++)
+ if (counts[i])
+ return (-3);
+ rtype = rrecp->r_type;
+ rclass = rrecp->r_class;
+ rttl = rrecp->r_ttl;
+ /* overload class and type */
+ if (section == S_PREREQ) {
+ rttl = 0;
+ switch (rrecp->r_opcode) {
+ case YXDOMAIN:
+ rclass = C_ANY;
+ rtype = T_ANY;
+ rrecp->r_size = 0;
+ break;
+ case NXDOMAIN:
+ rclass = C_NONE;
+ rtype = T_ANY;
+ rrecp->r_size = 0;
+ break;
+ case NXRRSET:
+ rclass = C_NONE;
+ rrecp->r_size = 0;
+ break;
+ case YXRRSET:
+ if (rrecp->r_size == 0)
+ rclass = C_ANY;
+ break;
+ default:
+ fprintf(stderr,
+ "res_mkupdate: incorrect opcode: %d\n",
+ rrecp->r_opcode);
+ fflush(stderr);
+ return (-1);
+ }
+ } else if (section == S_UPDATE) {
+ switch (rrecp->r_opcode) {
+ case DELETE:
+ rclass = rrecp->r_size == 0 ? C_ANY : C_NONE;
+ break;
+ case ADD:
+ break;
+ default:
+ fprintf(stderr,
+ "res_mkupdate: incorrect opcode: %d\n",
+ rrecp->r_opcode);
+ fflush(stderr);
+ return (-1);
+ }
+ }
+
+ /*
+ * XXX appending default domain to owner name is omitted,
+ * fqdn must be provided
+ */
+ if ((n = dn_comp(rrecp->r_dname, cp, buflen, dnptrs,
+ lastdnptr)) < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n + 2*INT16SZ);
+ PUTSHORT(rtype, cp);
+ PUTSHORT(rclass, cp);
+ if (section == S_ZONE) {
+ if (numrrs != 1 || rrecp->r_type != T_SOA)
+ return (-3);
+ continue;
+ }
+ ShrinkBuffer(INT32SZ + INT16SZ);
+ PUTLONG(rttl, cp);
+ sp2 = cp; /*%< save pointer to length byte */
+ cp += INT16SZ;
+ if (rrecp->r_size == 0) {
+ if (section == S_UPDATE && rclass != C_ANY)
+ return (-1);
+ else {
+ PUTSHORT(0, sp2);
+ continue;
+ }
+ }
+ startp = rrecp->r_data;
+ endp = startp + rrecp->r_size - 1;
+ /* XXX this should be done centrally. */
+ switch (rrecp->r_type) {
+ case T_A:
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ if (!inet_aton(buf2, &ina))
+ return (-1);
+ n1 = ntohl(ina.s_addr);
+ ShrinkBuffer(INT32SZ);
+ PUTLONG(n1, cp);
+ break;
+ case T_CNAME:
+ case T_MB:
+ case T_MG:
+ case T_MR:
+ case T_NS:
+ case T_PTR:
+ case ns_t_dname:
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ break;
+ case T_MINFO:
+ case T_SOA:
+ case T_RP:
+ for (i = 0; i < 2; i++) {
+ if (!getword_str(buf2, sizeof buf2, &startp,
+ endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen,
+ dnptrs, lastdnptr);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ }
+ if (rrecp->r_type == T_SOA) {
+ ShrinkBuffer(5 * INT32SZ);
+ while (isspace(*startp) || !*startp)
+ startp++;
+ if (*startp == '(') {
+ multiline = 1;
+ startp++;
+ } else
+ multiline = 0;
+ /* serial, refresh, retry, expire, minimum */
+ for (i = 0; i < 5; i++) {
+ soanum = getnum_str(&startp, endp);
+ if (soanum < 0)
+ return (-1);
+ PUTLONG(soanum, cp);
+ }
+ if (multiline) {
+ while (isspace(*startp) || !*startp)
+ startp++;
+ if (*startp != ')')
+ return (-1);
+ }
+ }
+ break;
+ case T_MX:
+ case T_AFSDB:
+ case T_RT:
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ break;
+ case T_SRV:
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, NULL, NULL);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ break;
+ case T_PX:
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ PUTSHORT(n, cp);
+ ShrinkBuffer(INT16SZ);
+ for (i = 0; i < 2; i++) {
+ if (!getword_str(buf2, sizeof buf2, &startp,
+ endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, dnptrs,
+ lastdnptr);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ }
+ break;
+ case T_WKS: {
+ char bm[MAXPORT/8];
+ unsigned int maxbm = 0;
+
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ if (!inet_aton(buf2, &ina))
+ return (-1);
+ n1 = ntohl(ina.s_addr);
+ ShrinkBuffer(INT32SZ);
+ PUTLONG(n1, cp);
+
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ if ((i = res_protocolnumber(buf2)) < 0)
+ return (-1);
+ ShrinkBuffer(1);
+ *cp++ = i & 0xff;
+
+ for (i = 0; i < MAXPORT/8 ; i++)
+ bm[i] = 0;
+
+ while (getword_str(buf2, sizeof buf2, &startp, endp)) {
+ if ((n = res_servicenumber(buf2)) <= 0)
+ return (-1);
+
+ if (n < MAXPORT) {
+ bm[n/8] |= (0x80>>(n%8));
+ if ((unsigned)n > maxbm)
+ maxbm = n;
+ } else
+ return (-1);
+ }
+ maxbm = maxbm/8 + 1;
+ ShrinkBuffer(maxbm);
+ memcpy(cp, bm, maxbm);
+ cp += maxbm;
+ break;
+ }
+ case T_HINFO:
+ for (i = 0; i < 2; i++) {
+ if ((n = getstr_str(buf2, sizeof buf2,
+ &startp, endp)) < 0)
+ return (-1);
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ }
+ break;
+ case T_TXT:
+ for (;;) {
+ if ((n = getstr_str(buf2, sizeof buf2,
+ &startp, endp)) < 0) {
+ if (cp != (sp2 + INT16SZ))
+ break;
+ return (-1);
+ }
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ }
+ break;
+ case T_X25:
+ /* RFC1183 */
+ if ((n = getstr_str(buf2, sizeof buf2, &startp,
+ endp)) < 0)
+ return (-1);
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ break;
+ case T_ISDN:
+ /* RFC1183 */
+ if ((n = getstr_str(buf2, sizeof buf2, &startp,
+ endp)) < 0)
+ return (-1);
+ if ((n > 255) || (n == 0))
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ if ((n = getstr_str(buf2, sizeof buf2, &startp,
+ endp)) < 0)
+ n = 0;
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ break;
+ case T_NSAP:
+ if ((n = inet_nsap_addr((char *)startp, (u_char *)buf2, sizeof(buf2))) != 0) {
+ ShrinkBuffer(n);
+ memcpy(cp, buf2, n);
+ cp += n;
+ } else {
+ return (-1);
+ }
+ break;
+ case T_LOC:
+ if ((n = loc_aton((char *)startp, (u_char *)buf2)) != 0) {
+ ShrinkBuffer(n);
+ memcpy(cp, buf2, n);
+ cp += n;
+ } else
+ return (-1);
+ break;
+ case ns_t_sig:
+ {
+ int sig_type, success, dateerror;
+ u_int32_t exptime, timesigned;
+
+ /* type */
+ if ((n = getword_str(buf2, sizeof buf2,
+ &startp, endp)) < 0)
+ return (-1);
+ sig_type = sym_ston(__p_type_syms, buf2, &success);
+ if (!success || sig_type == ns_t_any)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(sig_type, cp);
+ /* alg */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(1);
+ *cp++ = n;
+ /* labels */
+ n = getnum_str(&startp, endp);
+ if (n <= 0 || n > 255)
+ return (-1);
+ ShrinkBuffer(1);
+ *cp++ = n;
+ /* ottl & expire */
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ exptime = ns_datetosecs(buf2, &dateerror);
+ if (!dateerror) {
+ ShrinkBuffer(INT32SZ);
+ PUTLONG(rttl, cp);
+ }
+ else {
+ char *ulendp;
+ u_int32_t ottl;
+
+ errno = 0;
+ ottl = strtoul(buf2, &ulendp, 10);
+ if (errno != 0 ||
+ (ulendp != NULL && *ulendp != '\0'))
+ return (-1);
+ ShrinkBuffer(INT32SZ);
+ PUTLONG(ottl, cp);
+ if (!getword_str(buf2, sizeof buf2, &startp,
+ endp))
+ return (-1);
+ exptime = ns_datetosecs(buf2, &dateerror);
+ if (dateerror)
+ return (-1);
+ }
+ /* expire */
+ ShrinkBuffer(INT32SZ);
+ PUTLONG(exptime, cp);
+ /* timesigned */
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ timesigned = ns_datetosecs(buf2, &dateerror);
+ if (!dateerror) {
+ ShrinkBuffer(INT32SZ);
+ PUTLONG(timesigned, cp);
+ }
+ else
+ return (-1);
+ /* footprint */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ /* signer name */
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, dnptrs, lastdnptr);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ /* sig */
+ if ((n = getword_str(buf2, sizeof buf2,
+ &startp, endp)) < 0)
+ return (-1);
+ siglen = b64_pton(buf2, buf3, sizeof(buf3));
+ if (siglen < 0)
+ return (-1);
+ ShrinkBuffer(siglen);
+ memcpy(cp, buf3, siglen);
+ cp += siglen;
+ break;
+ }
+ case ns_t_key:
+ /* flags */
+ n = gethexnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ /* proto */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(1);
+ *cp++ = n;
+ /* alg */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(1);
+ *cp++ = n;
+ /* key */
+ if ((n = getword_str(buf2, sizeof buf2,
+ &startp, endp)) < 0)
+ return (-1);
+ keylen = b64_pton(buf2, buf3, sizeof(buf3));
+ if (keylen < 0)
+ return (-1);
+ ShrinkBuffer(keylen);
+ memcpy(cp, buf3, keylen);
+ cp += keylen;
+ break;
+ case ns_t_nxt:
+ {
+ int success, nxt_type;
+ u_char data[32];
+ int maxtype;
+
+ /* next name */
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, NULL, NULL);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ maxtype = 0;
+ memset(data, 0, sizeof data);
+ for (;;) {
+ if (!getword_str(buf2, sizeof buf2, &startp,
+ endp))
+ break;
+ nxt_type = sym_ston(__p_type_syms, buf2,
+ &success);
+ if (!success || !ns_t_rr_p(nxt_type))
+ return (-1);
+ NS_NXT_BIT_SET(nxt_type, data);
+ if (nxt_type > maxtype)
+ maxtype = nxt_type;
+ }
+ n = maxtype/NS_NXT_BITS+1;
+ ShrinkBuffer(n);
+ memcpy(cp, data, n);
+ cp += n;
+ break;
+ }
+ case ns_t_cert:
+ /* type */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ /* key tag */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ /* alg */
+ n = getnum_str(&startp, endp);
+ if (n < 0)
+ return (-1);
+ ShrinkBuffer(1);
+ *cp++ = n;
+ /* cert */
+ if ((n = getword_str(buf2, sizeof buf2,
+ &startp, endp)) < 0)
+ return (-1);
+ certlen = b64_pton(buf2, buf3, sizeof(buf3));
+ if (certlen < 0)
+ return (-1);
+ ShrinkBuffer(certlen);
+ memcpy(cp, buf3, certlen);
+ cp += certlen;
+ break;
+ case ns_t_aaaa:
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ if (inet_pton(AF_INET6, buf2, &in6a) <= 0)
+ return (-1);
+ ShrinkBuffer(NS_IN6ADDRSZ);
+ memcpy(cp, &in6a, NS_IN6ADDRSZ);
+ cp += NS_IN6ADDRSZ;
+ break;
+ case ns_t_naptr:
+ /* Order Preference Flags Service Replacement Regexp */
+ /* Order */
+ n = getnum_str(&startp, endp);
+ if (n < 0 || n > 65535)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ /* Preference */
+ n = getnum_str(&startp, endp);
+ if (n < 0 || n > 65535)
+ return (-1);
+ ShrinkBuffer(INT16SZ);
+ PUTSHORT(n, cp);
+ /* Flags */
+ if ((n = getstr_str(buf2, sizeof buf2,
+ &startp, endp)) < 0) {
+ return (-1);
+ }
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ /* Service Classes */
+ if ((n = getstr_str(buf2, sizeof buf2,
+ &startp, endp)) < 0) {
+ return (-1);
+ }
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ /* Pattern */
+ if ((n = getstr_str(buf2, sizeof buf2,
+ &startp, endp)) < 0) {
+ return (-1);
+ }
+ if (n > 255)
+ return (-1);
+ ShrinkBuffer(n+1);
+ *cp++ = n;
+ memcpy(cp, buf2, n);
+ cp += n;
+ /* Replacement */
+ if (!getword_str(buf2, sizeof buf2, &startp, endp))
+ return (-1);
+ n = dn_comp(buf2, cp, buflen, NULL, NULL);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ ShrinkBuffer(n);
+ break;
+ default:
+ return (-1);
+ } /*switch*/
+ n = (u_int16_t)((cp - sp2) - INT16SZ);
+ PUTSHORT(n, sp2);
+ } /*for*/
+
+ hp->qdcount = htons(counts[0]);
+ hp->ancount = htons(counts[1]);
+ hp->nscount = htons(counts[2]);
+ hp->arcount = htons(counts[3]);
+ return (cp - buf);
+}
+
+/*%
+ * Get a whitespace delimited word from a string (not file)
+ * into buf. modify the start pointer to point after the
+ * word in the string.
+ */
+static int
+getword_str(char *buf, int size, u_char **startpp, u_char *endp) {
+ char *cp;
+ int c;
+
+ for (cp = buf; *startpp <= endp; ) {
+ c = **startpp;
+ if (isspace(c) || c == '\0') {
+ if (cp != buf) /*%< trailing whitespace */
+ break;
+ else { /*%< leading whitespace */
+ (*startpp)++;
+ continue;
+ }
+ }
+ (*startpp)++;
+ if (cp >= buf+size-1)
+ break;
+ *cp++ = (u_char)c;
+ }
+ *cp = '\0';
+ return (cp != buf);
+}
+
+/*%
+ * get a white spae delimited string from memory. Process quoted strings
+ * and \\DDD escapes. Return length or -1 on error. Returned string may
+ * contain nulls.
+ */
+static char digits[] = "0123456789";
+static int
+getstr_str(char *buf, int size, u_char **startpp, u_char *endp) {
+ char *cp;
+ int c, c1 = 0;
+ int inquote = 0;
+ int seen_quote = 0;
+ int escape = 0;
+ int dig = 0;
+
+ for (cp = buf; *startpp <= endp; ) {
+ if ((c = **startpp) == '\0')
+ break;
+ /* leading white space */
+ if ((cp == buf) && !seen_quote && isspace(c)) {
+ (*startpp)++;
+ continue;
+ }
+
+ switch (c) {
+ case '\\':
+ if (!escape) {
+ escape = 1;
+ dig = 0;
+ c1 = 0;
+ (*startpp)++;
+ continue;
+ }
+ goto do_escape;
+ case '"':
+ if (!escape) {
+ inquote = !inquote;
+ seen_quote = 1;
+ (*startpp)++;
+ continue;
+ }
+ /* fall through */
+ default:
+ do_escape:
+ if (escape) {
+ switch (c) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ c1 = c1 * 10 +
+ (strchr(digits, c) - digits);
+
+ if (++dig == 3) {
+ c = c1 &0xff;
+ break;
+ }
+ (*startpp)++;
+ continue;
+ }
+ escape = 0;
+ } else if (!inquote && isspace(c))
+ goto done;
+ if (cp >= buf+size-1)
+ goto done;
+ *cp++ = (u_char)c;
+ (*startpp)++;
+ }
+ }
+ done:
+ *cp = '\0';
+ return ((cp == buf)? (seen_quote? 0: -1): (cp - buf));
+}
+
+/*%
+ * Get a whitespace delimited base 16 number from a string (not file) into buf
+ * update the start pointer to point after the number in the string.
+ */
+static int
+gethexnum_str(u_char **startpp, u_char *endp) {
+ int c, n;
+ int seendigit = 0;
+ int m = 0;
+
+ if (*startpp + 2 >= endp || strncasecmp((char *)*startpp, "0x", 2) != 0)
+ return getnum_str(startpp, endp);
+ (*startpp)+=2;
+ for (n = 0; *startpp <= endp; ) {
+ c = **startpp;
+ if (isspace(c) || c == '\0') {
+ if (seendigit) /*%< trailing whitespace */
+ break;
+ else { /*%< leading whitespace */
+ (*startpp)++;
+ continue;
+ }
+ }
+ if (c == ';') {
+ while ((*startpp <= endp) &&
+ ((c = **startpp) != '\n'))
+ (*startpp)++;
+ if (seendigit)
+ break;
+ continue;
+ }
+ if (!isxdigit(c)) {
+ if (c == ')' && seendigit) {
+ (*startpp)--;
+ break;
+ }
+ return (-1);
+ }
+ (*startpp)++;
+ if (isdigit(c))
+ n = n * 16 + (c - '0');
+ else
+ n = n * 16 + (tolower(c) - 'a' + 10);
+ seendigit = 1;
+ }
+ return (n + m);
+}
+
+/*%
+ * Get a whitespace delimited base 10 number from a string (not file) into buf
+ * update the start pointer to point after the number in the string.
+ */
+static int
+getnum_str(u_char **startpp, u_char *endp) {
+ int c, n;
+ int seendigit = 0;
+ int m = 0;
+
+ for (n = 0; *startpp <= endp; ) {
+ c = **startpp;
+ if (isspace(c) || c == '\0') {
+ if (seendigit) /*%< trailing whitespace */
+ break;
+ else { /*%< leading whitespace */
+ (*startpp)++;
+ continue;
+ }
+ }
+ if (c == ';') {
+ while ((*startpp <= endp) &&
+ ((c = **startpp) != '\n'))
+ (*startpp)++;
+ if (seendigit)
+ break;
+ continue;
+ }
+ if (!isdigit(c)) {
+ if (c == ')' && seendigit) {
+ (*startpp)--;
+ break;
+ }
+ return (-1);
+ }
+ (*startpp)++;
+ n = n * 10 + (c - '0');
+ seendigit = 1;
+ }
+ return (n + m);
+}
+
+/*%
+ * Allocate a resource record buffer & save rr info.
+ */
+ns_updrec *
+res_mkupdrec(int section, const char *dname,
+ u_int class, u_int type, u_long ttl) {
+ ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));
+
+ if (!rrecp || !(rrecp->r_dname = strdup(dname))) {
+ if (rrecp)
+ free((char *)rrecp);
+ return (NULL);
+ }
+ INIT_LINK(rrecp, r_link);
+ INIT_LINK(rrecp, r_glink);
+ rrecp->r_class = (ns_class)class;
+ rrecp->r_type = (ns_type)type;
+ rrecp->r_ttl = ttl;
+ rrecp->r_section = (ns_sect)section;
+ return (rrecp);
+}
+
+/*%
+ * Free a resource record buffer created by res_mkupdrec.
+ */
+void
+res_freeupdrec(ns_updrec *rrecp) {
+ /* Note: freeing r_dp is the caller's responsibility. */
+ if (rrecp->r_dname != NULL)
+ free(rrecp->r_dname);
+ free(rrecp);
+}
+
+struct valuelist {
+ struct valuelist * next;
+ struct valuelist * prev;
+ char * name;
+ char * proto;
+ int port;
+};
+static struct valuelist *servicelist, *protolist;
+
+static void
+res_buildservicelist() {
+ struct servent *sp;
+ struct valuelist *slp;
+
+#ifdef MAYBE_HESIOD
+ setservent(0);
+#else
+ setservent(1);
+#endif
+ while ((sp = getservent()) != NULL) {
+ slp = (struct valuelist *)malloc(sizeof(struct valuelist));
+ if (!slp)
+ break;
+ slp->name = strdup(sp->s_name);
+ slp->proto = strdup(sp->s_proto);
+ if ((slp->name == NULL) || (slp->proto == NULL)) {
+ if (slp->name) free(slp->name);
+ if (slp->proto) free(slp->proto);
+ free(slp);
+ break;
+ }
+ slp->port = ntohs((u_int16_t)sp->s_port); /*%< host byt order */
+ slp->next = servicelist;
+ slp->prev = NULL;
+ if (servicelist)
+ servicelist->prev = slp;
+ servicelist = slp;
+ }
+ endservent();
+}
+
+void
+res_destroyservicelist() {
+ struct valuelist *slp, *slp_next;
+
+ for (slp = servicelist; slp != NULL; slp = slp_next) {
+ slp_next = slp->next;
+ free(slp->name);
+ free(slp->proto);
+ free(slp);
+ }
+ servicelist = (struct valuelist *)0;
+}
+
+void
+res_buildprotolist(void) {
+ struct protoent *pp;
+ struct valuelist *slp;
+
+#ifdef MAYBE_HESIOD
+ setprotoent(0);
+#else
+ setprotoent(1);
+#endif
+ while ((pp = getprotoent()) != NULL) {
+ slp = (struct valuelist *)malloc(sizeof(struct valuelist));
+ if (!slp)
+ break;
+ slp->name = strdup(pp->p_name);
+ if (slp->name == NULL) {
+ free(slp);
+ break;
+ }
+ slp->port = pp->p_proto; /*%< host byte order */
+ slp->next = protolist;
+ slp->prev = NULL;
+ if (protolist)
+ protolist->prev = slp;
+ protolist = slp;
+ }
+ endprotoent();
+}
+
+void
+res_destroyprotolist(void) {
+ struct valuelist *plp, *plp_next;
+
+ for (plp = protolist; plp != NULL; plp = plp_next) {
+ plp_next = plp->next;
+ free(plp->name);
+ free(plp);
+ }
+ protolist = (struct valuelist *)0;
+}
+
+static int
+findservice(const char *s, struct valuelist **list) {
+ struct valuelist *lp = *list;
+ int n;
+
+ for (; lp != NULL; lp = lp->next)
+ if (strcasecmp(lp->name, s) == 0) {
+ if (lp != *list) {
+ lp->prev->next = lp->next;
+ if (lp->next)
+ lp->next->prev = lp->prev;
+ (*list)->prev = lp;
+ lp->next = *list;
+ *list = lp;
+ }
+ return (lp->port); /*%< host byte order */
+ }
+ if (sscanf(s, "%d", &n) != 1 || n <= 0)
+ n = -1;
+ return (n);
+}
+
+/*%
+ * Convert service name or (ascii) number to int.
+ */
+int
+res_servicenumber(const char *p) {
+ if (servicelist == (struct valuelist *)0)
+ res_buildservicelist();
+ return (findservice(p, &servicelist));
+}
+
+/*%
+ * Convert protocol name or (ascii) number to int.
+ */
+int
+res_protocolnumber(const char *p) {
+ if (protolist == (struct valuelist *)0)
+ res_buildprotolist();
+ return (findservice(p, &protolist));
+}
+
+static struct servent *
+cgetservbyport(u_int16_t port, const char *proto) { /*%< Host byte order. */
+ struct valuelist **list = &servicelist;
+ struct valuelist *lp = *list;
+ static struct servent serv;
+
+ port = ntohs(port);
+ for (; lp != NULL; lp = lp->next) {
+ if (port != (u_int16_t)lp->port) /*%< Host byte order. */
+ continue;
+ if (strcasecmp(lp->proto, proto) == 0) {
+ if (lp != *list) {
+ lp->prev->next = lp->next;
+ if (lp->next)
+ lp->next->prev = lp->prev;
+ (*list)->prev = lp;
+ lp->next = *list;
+ *list = lp;
+ }
+ serv.s_name = lp->name;
+ serv.s_port = htons((u_int16_t)lp->port);
+ serv.s_proto = lp->proto;
+ return (&serv);
+ }
+ }
+ return (0);
+}
+
+static struct protoent *
+cgetprotobynumber(int proto) { /*%< Host byte order. */
+ struct valuelist **list = &protolist;
+ struct valuelist *lp = *list;
+ static struct protoent prot;
+
+ for (; lp != NULL; lp = lp->next)
+ if (lp->port == proto) { /*%< Host byte order. */
+ if (lp != *list) {
+ lp->prev->next = lp->next;
+ if (lp->next)
+ lp->next->prev = lp->prev;
+ (*list)->prev = lp;
+ lp->next = *list;
+ *list = lp;
+ }
+ prot.p_name = lp->name;
+ prot.p_proto = lp->port; /*%< Host byte order. */
+ return (&prot);
+ }
+ return (0);
+}
+
+const char *
+res_protocolname(int num) {
+ static char number[8];
+ struct protoent *pp;
+
+ if (protolist == (struct valuelist *)0)
+ res_buildprotolist();
+ pp = cgetprotobynumber(num);
+ if (pp == 0) {
+ (void) sprintf(number, "%d", num);
+ return (number);
+ }
+ return (pp->p_name);
+}
+
+const char *
+res_servicename(u_int16_t port, const char *proto) { /*%< Host byte order. */
+ static char number[8];
+ struct servent *ss;
+
+ if (servicelist == (struct valuelist *)0)
+ res_buildservicelist();
+ ss = cgetservbyport(htons(port), proto);
+ if (ss == 0) {
+ (void) sprintf(number, "%d", port);
+ return (number);
+ }
+ return (ss->s_name);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.h b/usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.h
new file mode 100644
index 0000000000..96c452d89e
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_mkupdate.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _RES_MKUPDATE_H_
+#define _RES_MKUPDATE_H_
+
+__BEGIN_DECLS
+__END_DECLS
+
+#endif /* _RES_MKUPDATE_H_ */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_private.h b/usr/src/lib/libresolv2_joy/common/resolv/res_private.h
new file mode 100644
index 0000000000..4e98157ced
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_private.h
@@ -0,0 +1,22 @@
+#ifndef res_private_h
+#define res_private_h
+
+struct __res_state_ext {
+ union res_sockaddr_union nsaddrs[MAXNS];
+ struct sort_list {
+ int af;
+ union {
+ struct in_addr ina;
+ struct in6_addr in6a;
+ } addr, mask;
+ } sort_list[MAXRESOLVSORT];
+ char nsuffix[64];
+ char nsuffix2[64];
+};
+
+extern int
+res_ourserver_p(const res_state statp, const struct sockaddr *sa);
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_query.c b/usr/src/lib/libresolv2_joy/common/resolv/res_query.c
new file mode 100644
index 0000000000..09df3da1fc
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_query.c
@@ -0,0 +1,440 @@
+/*
+ * Portions Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: res_query.c,v 1.11 2008/11/14 02:36:51 marka Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include "port_before.h"
+#include <sys/types.h>
+#include <sys/param.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "port_after.h"
+
+/* Options. Leave them on. */
+#define DEBUG
+
+#if PACKETSZ > 1024
+#define MAXPACKET PACKETSZ
+#else
+#define MAXPACKET 1024
+#endif
+
+/*%
+ * Formulate a normal query, send, and await answer.
+ * Returned answer is placed in supplied buffer "answer".
+ * Perform preliminary check of answer, returning success only
+ * if no error is indicated and the answer count is nonzero.
+ * Return the size of the response on success, -1 on error.
+ * Error number is left in H_ERRNO.
+ *
+ * Caller must parse answer and determine whether it answers the question.
+ */
+int
+res_nquery(res_state statp,
+ const char *name, /*%< domain name */
+ int class, int type, /*%< class and type of query */
+ u_char *answer, /*%< buffer to put answer */
+ int anslen) /*%< size of answer buffer */
+{
+ u_char buf[MAXPACKET];
+ HEADER *hp = (HEADER *) answer;
+ u_int oflags;
+ u_char *rdata;
+ int n;
+
+ oflags = statp->_flags;
+
+again:
+ hp->rcode = NOERROR; /*%< default */
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_query(%s, %d, %d)\n", name, class, type);
+#endif
+
+ n = res_nmkquery(statp, QUERY, name, class, type, NULL, 0, NULL,
+ buf, sizeof(buf));
+#ifdef RES_USE_EDNS0
+ if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
+ (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) {
+ n = res_nopt(statp, n, buf, sizeof(buf), anslen);
+ rdata = &buf[n];
+ if (n > 0 && (statp->options & RES_NSID) != 0U) {
+ n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata,
+ NS_OPT_NSID, 0, NULL);
+ }
+ }
+#endif
+ if (n <= 0) {
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_query: mkquery failed\n");
+#endif
+ RES_SET_H_ERRNO(statp, NO_RECOVERY);
+ return (n);
+ }
+
+ n = res_nsend(statp, buf, n, answer, anslen);
+ if (n < 0) {
+#ifdef RES_USE_EDNS0
+ /* if the query choked with EDNS0, retry without EDNS0 */
+ if ((statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U &&
+ ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) {
+ statp->_flags |= RES_F_EDNS0ERR;
+ if (statp->options & RES_DEBUG)
+ printf(";; res_nquery: retry without EDNS0\n");
+ goto again;
+ }
+#endif
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_query: send error\n");
+#endif
+ RES_SET_H_ERRNO(statp, TRY_AGAIN);
+ return (n);
+ }
+
+ if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; rcode = (%s), counts = an:%d ns:%d ar:%d\n",
+ p_rcode(hp->rcode),
+ ntohs(hp->ancount),
+ ntohs(hp->nscount),
+ ntohs(hp->arcount));
+#endif
+ switch (hp->rcode) {
+ case NXDOMAIN:
+ RES_SET_H_ERRNO(statp, HOST_NOT_FOUND);
+ break;
+ case SERVFAIL:
+ RES_SET_H_ERRNO(statp, TRY_AGAIN);
+ break;
+ case NOERROR:
+ RES_SET_H_ERRNO(statp, NO_DATA);
+ break;
+ case FORMERR:
+ case NOTIMP:
+ case REFUSED:
+ default:
+ RES_SET_H_ERRNO(statp, NO_RECOVERY);
+ break;
+ }
+ return (-1);
+ }
+ return (n);
+}
+
+/*%
+ * Formulate a normal query, send, and retrieve answer in supplied buffer.
+ * Return the size of the response on success, -1 on error.
+ * If enabled, implement search rules until answer or unrecoverable failure
+ * is detected. Error code, if any, is left in H_ERRNO.
+ */
+int
+res_nsearch(res_state statp,
+ const char *name, /*%< domain name */
+ int class, int type, /*%< class and type of query */
+ u_char *answer, /*%< buffer to put answer */
+ int anslen) /*%< size of answer */
+{
+ const char *cp, * const *domain;
+ HEADER *hp = (HEADER *) answer;
+ char tmp[NS_MAXDNAME];
+ u_int dots;
+ int trailing_dot, ret, saved_herrno;
+ int got_nodata = 0, got_servfail = 0, root_on_list = 0;
+ int tried_as_is = 0;
+ int searched = 0;
+
+ errno = 0;
+ RES_SET_H_ERRNO(statp, HOST_NOT_FOUND); /*%< True if we never query. */
+ dots = 0;
+ for (cp = name; *cp != '\0'; cp++)
+ dots += (*cp == '.');
+ trailing_dot = 0;
+ if (cp > name && *--cp == '.')
+ trailing_dot++;
+
+ /* If there aren't any dots, it could be a user-level alias. */
+ if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL)
+ return (res_nquery(statp, cp, class, type, answer, anslen));
+
+ /*
+ * If there are enough dots in the name, let's just give it a
+ * try 'as is'. The threshold can be set with the "ndots" option.
+ * Also, query 'as is', if there is a trailing dot in the name.
+ */
+ saved_herrno = -1;
+ if (dots >= statp->ndots || trailing_dot) {
+ ret = res_nquerydomain(statp, name, NULL, class, type,
+ answer, anslen);
+ if (ret > 0 || trailing_dot)
+ return (ret);
+ saved_herrno = statp->res_h_errno;
+ tried_as_is++;
+ }
+
+ /*
+ * We do at least one level of search if
+ * - there is no dot and RES_DEFNAME is set, or
+ * - there is at least one dot, there is no trailing dot,
+ * and RES_DNSRCH is set.
+ */
+ if ((!dots && (statp->options & RES_DEFNAMES) != 0U) ||
+ (dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0U)) {
+ int done = 0;
+
+ for (domain = (const char * const *)statp->dnsrch;
+ *domain && !done;
+ domain++) {
+ searched = 1;
+
+ if (domain[0][0] == '\0' ||
+ (domain[0][0] == '.' && domain[0][1] == '\0'))
+ root_on_list++;
+
+ ret = res_nquerydomain(statp, name, *domain,
+ class, type,
+ answer, anslen);
+ if (ret > 0)
+ return (ret);
+
+ /*
+ * If no server present, give up.
+ * If name isn't found in this domain,
+ * keep trying higher domains in the search list
+ * (if that's enabled).
+ * On a NO_DATA error, keep trying, otherwise
+ * a wildcard entry of another type could keep us
+ * from finding this entry higher in the domain.
+ * If we get some other error (negative answer or
+ * server failure), then stop searching up,
+ * but try the input name below in case it's
+ * fully-qualified.
+ */
+ if (errno == ECONNREFUSED) {
+ RES_SET_H_ERRNO(statp, TRY_AGAIN);
+ return (-1);
+ }
+
+ switch (statp->res_h_errno) {
+ case NO_DATA:
+ got_nodata++;
+ /* FALLTHROUGH */
+ case HOST_NOT_FOUND:
+ /* keep trying */
+ break;
+ case TRY_AGAIN:
+ if (hp->rcode == SERVFAIL) {
+ /* try next search element, if any */
+ got_servfail++;
+ break;
+ }
+ /* FALLTHROUGH */
+ default:
+ /* anything else implies that we're done */
+ done++;
+ }
+
+ /* if we got here for some reason other than DNSRCH,
+ * we only wanted one iteration of the loop, so stop.
+ */
+ if ((statp->options & RES_DNSRCH) == 0U)
+ done++;
+ }
+ }
+
+ /*
+ * If the query has not already been tried as is then try it
+ * unless RES_NOTLDQUERY is set and there were no dots.
+ */
+ if ((dots || !searched || (statp->options & RES_NOTLDQUERY) == 0U) &&
+ !(tried_as_is || root_on_list)) {
+ ret = res_nquerydomain(statp, name, NULL, class, type,
+ answer, anslen);
+ if (ret > 0)
+ return (ret);
+ }
+
+ /* if we got here, we didn't satisfy the search.
+ * if we did an initial full query, return that query's H_ERRNO
+ * (note that we wouldn't be here if that query had succeeded).
+ * else if we ever got a nodata, send that back as the reason.
+ * else send back meaningless H_ERRNO, that being the one from
+ * the last DNSRCH we did.
+ */
+ if (saved_herrno != -1)
+ RES_SET_H_ERRNO(statp, saved_herrno);
+ else if (got_nodata)
+ RES_SET_H_ERRNO(statp, NO_DATA);
+ else if (got_servfail)
+ RES_SET_H_ERRNO(statp, TRY_AGAIN);
+ return (-1);
+}
+
+/*%
+ * Perform a call on res_query on the concatenation of name and domain,
+ * removing a trailing dot from name if domain is NULL.
+ */
+int
+res_nquerydomain(res_state statp,
+ const char *name,
+ const char *domain,
+ int class, int type, /*%< class and type of query */
+ u_char *answer, /*%< buffer to put answer */
+ int anslen) /*%< size of answer */
+{
+ char nbuf[MAXDNAME];
+ const char *longname = nbuf;
+ int n, d;
+
+#ifdef DEBUG
+ if (statp->options & RES_DEBUG)
+ printf(";; res_nquerydomain(%s, %s, %d, %d)\n",
+ name, domain?domain:"<Nil>", class, type);
+#endif
+ if (domain == NULL) {
+ /*
+ * Check for trailing '.';
+ * copy without '.' if present.
+ */
+ n = strlen(name);
+ if (n >= MAXDNAME) {
+ RES_SET_H_ERRNO(statp, NO_RECOVERY);
+ return (-1);
+ }
+ n--;
+ if (n >= 0 && name[n] == '.') {
+ strncpy(nbuf, name, n);
+ nbuf[n] = '\0';
+ } else
+ longname = name;
+ } else {
+ n = strlen(name);
+ d = strlen(domain);
+ if (n + d + 1 >= MAXDNAME) {
+ RES_SET_H_ERRNO(statp, NO_RECOVERY);
+ return (-1);
+ }
+ sprintf(nbuf, "%s.%s", name, domain);
+ }
+ return (res_nquery(statp, longname, class, type, answer, anslen));
+}
+
+const char *
+res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
+ char *file, *cp1, *cp2;
+ char buf[BUFSIZ];
+ FILE *fp;
+
+ if (statp->options & RES_NOALIASES)
+ return (NULL);
+ file = getenv("HOSTALIASES");
+ if (file == NULL || (fp = fopen(file, "r")) == NULL)
+ return (NULL);
+ setbuf(fp, NULL);
+ buf[sizeof(buf) - 1] = '\0';
+ while (fgets(buf, sizeof(buf), fp)) {
+ for (cp1 = buf; *cp1 && !isspace((unsigned char)*cp1); ++cp1)
+ ;
+ if (!*cp1)
+ break;
+ *cp1 = '\0';
+ if (ns_samename(buf, name) == 1) {
+ while (isspace((unsigned char)*++cp1))
+ ;
+ if (!*cp1)
+ break;
+ for (cp2 = cp1 + 1; *cp2 &&
+ !isspace((unsigned char)*cp2); ++cp2)
+ ;
+ *cp2 = '\0';
+ strncpy(dst, cp1, siz - 1);
+ dst[siz - 1] = '\0';
+ fclose(fp);
+ return (dst);
+ }
+ }
+ fclose(fp);
+ return (NULL);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_send.c b/usr/src/lib/libresolv2_joy/common/resolv/res_send.c
new file mode 100644
index 0000000000..289db4e77d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_send.c
@@ -0,0 +1,1120 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Portions Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 1996-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Copyright (c) 1985, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
+static const char rcsid[] = "$Id: res_send.c,v 1.22 2009/01/22 23:49:23 tbox Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+/*! \file
+ * \brief
+ * Send query to name server and wait for reply.
+ */
+
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <isc/eventlib.h>
+
+#include "port_after.h"
+
+#ifdef USE_POLL
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+#include <poll.h>
+#endif /* USE_POLL */
+
+/* Options. Leave them on. */
+#define DEBUG
+#include "res_debug.h"
+#include "res_private.h"
+
+#define EXT(res) ((res)->_u._ext)
+
+#ifndef USE_POLL
+static const int highestFD = FD_SETSIZE - 1;
+#else
+static int highestFD = 0;
+#endif
+
+/* Forward. */
+
+static int get_salen __P((const struct sockaddr *));
+static struct sockaddr * get_nsaddr __P((res_state, size_t));
+static int send_vc(res_state, const u_char *, int,
+ u_char *, int, int *, int);
+static int send_dg(res_state, const u_char *, int,
+ u_char *, int, int *, int, int,
+ int *, int *);
+static void Aerror(const res_state, FILE *, const char *, int,
+ const struct sockaddr *, int);
+static void Perror(const res_state, FILE *, const char *, int);
+static int sock_eq(struct sockaddr *, struct sockaddr *);
+#if defined(NEED_PSELECT) && !defined(USE_POLL)
+static int pselect(int, void *, void *, void *,
+ struct timespec *,
+ const sigset_t *);
+#endif
+void res_pquery(const res_state, const u_char *, int, FILE *);
+
+#ifndef ORIGINAL_ISC_CODE
+#pragma weak __res_nameinquery = res_nameinquery
+#pragma weak __res_queriesmatch = res_queriesmatch
+#pragma weak res_nisourserver = res_ourserver_p
+#endif /* ORIGINAL_ISC_CODE */
+
+static const int niflags = NI_NUMERICHOST | NI_NUMERICSERV;
+
+/* Public. */
+
+/*%
+ * looks up "ina" in _res.ns_addr_list[]
+ *
+ * returns:
+ *\li 0 : not found
+ *\li >0 : found
+ *
+ * author:
+ *\li paul vixie, 29may94
+ */
+int
+res_ourserver_p(const res_state statp, const struct sockaddr *sa) {
+ const struct sockaddr_in *inp, *srv;
+ const struct sockaddr_in6 *in6p, *srv6;
+ int ns;
+
+ switch (sa->sa_family) {
+ case AF_INET:
+ inp = (const struct sockaddr_in *)sa;
+ for (ns = 0; ns < statp->nscount; ns++) {
+ srv = (struct sockaddr_in *)get_nsaddr(statp, ns);
+ if (srv->sin_family == inp->sin_family &&
+ srv->sin_port == inp->sin_port &&
+ (srv->sin_addr.s_addr == INADDR_ANY ||
+ srv->sin_addr.s_addr == inp->sin_addr.s_addr))
+ return (1);
+ }
+ break;
+ case AF_INET6:
+ if (EXT(statp).ext == NULL)
+ break;
+ in6p = (const struct sockaddr_in6 *)sa;
+ for (ns = 0; ns < statp->nscount; ns++) {
+ srv6 = (struct sockaddr_in6 *)get_nsaddr(statp, ns);
+ if (srv6->sin6_family == in6p->sin6_family &&
+ srv6->sin6_port == in6p->sin6_port &&
+#ifdef HAVE_SIN6_SCOPE_ID
+ (srv6->sin6_scope_id == 0 ||
+ srv6->sin6_scope_id == in6p->sin6_scope_id) &&
+#endif
+ (IN6_IS_ADDR_UNSPECIFIED(&srv6->sin6_addr) ||
+ IN6_ARE_ADDR_EQUAL(&srv6->sin6_addr, &in6p->sin6_addr)))
+ return (1);
+ }
+ break;
+ default:
+ break;
+ }
+ return (0);
+}
+
+/*%
+ * look for (name,type,class) in the query section of packet (buf,eom)
+ *
+ * requires:
+ *\li buf + HFIXEDSZ <= eom
+ *
+ * returns:
+ *\li -1 : format error
+ *\li 0 : not found
+ *\li >0 : found
+ *
+ * author:
+ *\li paul vixie, 29may94
+ */
+int
+res_nameinquery(const char *name, int type, int class,
+ const u_char *buf, const u_char *eom)
+{
+ const u_char *cp = buf + HFIXEDSZ;
+ int qdcount = ntohs(((const HEADER*)buf)->qdcount);
+
+ while (qdcount-- > 0) {
+ char tname[MAXDNAME+1];
+ int n, ttype, tclass;
+
+ n = dn_expand(buf, eom, cp, tname, sizeof tname);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ if (cp + 2 * INT16SZ > eom)
+ return (-1);
+ ttype = ns_get16(cp); cp += INT16SZ;
+ tclass = ns_get16(cp); cp += INT16SZ;
+ if (ttype == type && tclass == class &&
+ ns_samename(tname, name) == 1)
+ return (1);
+ }
+ return (0);
+}
+
+/*%
+ * is there a 1:1 mapping of (name,type,class)
+ * in (buf1,eom1) and (buf2,eom2)?
+ *
+ * returns:
+ *\li -1 : format error
+ *\li 0 : not a 1:1 mapping
+ *\li >0 : is a 1:1 mapping
+ *
+ * author:
+ *\li paul vixie, 29may94
+ */
+int
+res_queriesmatch(const u_char *buf1, const u_char *eom1,
+ const u_char *buf2, const u_char *eom2)
+{
+ const u_char *cp = buf1 + HFIXEDSZ;
+ int qdcount = ntohs(((const HEADER*)buf1)->qdcount);
+
+ if (buf1 + HFIXEDSZ > eom1 || buf2 + HFIXEDSZ > eom2)
+ return (-1);
+
+ /*
+ * Only header section present in replies to
+ * dynamic update packets.
+ */
+ if ((((const HEADER *)buf1)->opcode == ns_o_update) &&
+ (((const HEADER *)buf2)->opcode == ns_o_update))
+ return (1);
+
+ if (qdcount != ntohs(((const HEADER*)buf2)->qdcount))
+ return (0);
+ while (qdcount-- > 0) {
+ char tname[MAXDNAME+1];
+ int n, ttype, tclass;
+
+ n = dn_expand(buf1, eom1, cp, tname, sizeof tname);
+ if (n < 0)
+ return (-1);
+ cp += n;
+ if (cp + 2 * INT16SZ > eom1)
+ return (-1);
+ ttype = ns_get16(cp); cp += INT16SZ;
+ tclass = ns_get16(cp); cp += INT16SZ;
+ if (!res_nameinquery(tname, ttype, tclass, buf2, eom2))
+ return (0);
+ }
+ return (1);
+}
+
+int
+res_nsend(res_state statp,
+ const u_char *buf, int buflen, u_char *ans, int anssiz)
+{
+ int gotsomewhere, terrno, tries, v_circuit, resplen, ns, n;
+ char abuf[NI_MAXHOST];
+
+#ifdef USE_POLL
+ highestFD = sysconf(_SC_OPEN_MAX) - 1;
+#endif
+
+ /* No name servers or res_init() failure */
+ if (statp->nscount == 0 || EXT(statp).ext == NULL) {
+ errno = ESRCH;
+ return (-1);
+ }
+ if (anssiz < HFIXEDSZ) {
+ errno = EINVAL;
+ return (-1);
+ }
+ DprintQ((statp->options & RES_DEBUG) || (statp->pfcode & RES_PRF_QUERY),
+ (stdout, ";; res_send()\n"), buf, buflen);
+ v_circuit = (statp->options & RES_USEVC) || buflen > PACKETSZ;
+ gotsomewhere = 0;
+ terrno = ETIMEDOUT;
+
+ /*
+ * If the ns_addr_list in the resolver context has changed, then
+ * invalidate our cached copy and the associated timing data.
+ */
+ if (EXT(statp).nscount != 0) {
+ int needclose = 0;
+ struct sockaddr_storage peer;
+ ISC_SOCKLEN_T peerlen;
+
+ if (EXT(statp).nscount != statp->nscount)
+ needclose++;
+ else
+ for (ns = 0; ns < statp->nscount; ns++) {
+ if (statp->nsaddr_list[ns].sin_family &&
+ !sock_eq((struct sockaddr *)&statp->nsaddr_list[ns],
+ (struct sockaddr *)&EXT(statp).ext->nsaddrs[ns])) {
+ needclose++;
+ break;
+ }
+
+ if (EXT(statp).nssocks[ns] == -1)
+ continue;
+ peerlen = sizeof(peer);
+ if (getpeername(EXT(statp).nssocks[ns],
+ (struct sockaddr *)&peer, &peerlen) < 0) {
+ needclose++;
+ break;
+ }
+ if (!sock_eq((struct sockaddr *)&peer,
+ get_nsaddr(statp, ns))) {
+ needclose++;
+ break;
+ }
+ }
+ if (needclose) {
+ res_nclose(statp);
+ EXT(statp).nscount = 0;
+ }
+ }
+
+ /*
+ * Maybe initialize our private copy of the ns_addr_list.
+ */
+ if (EXT(statp).nscount == 0) {
+ for (ns = 0; ns < statp->nscount; ns++) {
+ EXT(statp).nstimes[ns] = RES_MAXTIME;
+ EXT(statp).nssocks[ns] = -1;
+ if (!statp->nsaddr_list[ns].sin_family)
+ continue;
+ EXT(statp).ext->nsaddrs[ns].sin =
+ statp->nsaddr_list[ns];
+ }
+ EXT(statp).nscount = statp->nscount;
+ }
+
+ /*
+ * Some resolvers want to even out the load on their nameservers.
+ * Note that RES_BLAST overrides RES_ROTATE.
+ */
+ if ((statp->options & RES_ROTATE) != 0U &&
+ (statp->options & RES_BLAST) == 0U) {
+ union res_sockaddr_union inu;
+ struct sockaddr_in ina;
+ int lastns = statp->nscount - 1;
+ int fd;
+ u_int16_t nstime;
+
+ if (EXT(statp).ext != NULL)
+ inu = EXT(statp).ext->nsaddrs[0];
+ ina = statp->nsaddr_list[0];
+ fd = EXT(statp).nssocks[0];
+ nstime = EXT(statp).nstimes[0];
+ for (ns = 0; ns < lastns; ns++) {
+ if (EXT(statp).ext != NULL)
+ EXT(statp).ext->nsaddrs[ns] =
+ EXT(statp).ext->nsaddrs[ns + 1];
+ statp->nsaddr_list[ns] = statp->nsaddr_list[ns + 1];
+ EXT(statp).nssocks[ns] = EXT(statp).nssocks[ns + 1];
+ EXT(statp).nstimes[ns] = EXT(statp).nstimes[ns + 1];
+ }
+ if (EXT(statp).ext != NULL)
+ EXT(statp).ext->nsaddrs[lastns] = inu;
+ statp->nsaddr_list[lastns] = ina;
+ EXT(statp).nssocks[lastns] = fd;
+ EXT(statp).nstimes[lastns] = nstime;
+ }
+
+ /*
+ * Send request, RETRY times, or until successful.
+ */
+ for (tries = 0; tries < statp->retry; tries++) {
+ for (ns = 0; ns < statp->nscount; ns++) {
+ struct sockaddr *nsap;
+ int nsaplen;
+ nsap = get_nsaddr(statp, ns);
+ nsaplen = get_salen(nsap);
+ statp->_flags &= ~RES_F_LASTMASK;
+ statp->_flags |= (ns << RES_F_LASTSHIFT);
+ same_ns:
+ if (statp->qhook) {
+ int done = 0, loops = 0;
+
+ do {
+ res_sendhookact act;
+
+ act = (*statp->qhook)(&nsap, &buf, &buflen,
+ ans, anssiz, &resplen);
+ switch (act) {
+ case res_goahead:
+ done = 1;
+ break;
+ case res_nextns:
+ res_nclose(statp);
+ goto next_ns;
+ case res_done:
+ return (resplen);
+ case res_modified:
+ /* give the hook another try */
+ if (++loops < 42) /*doug adams*/
+ break;
+ /*FALLTHROUGH*/
+ case res_error:
+ /*FALLTHROUGH*/
+ default:
+ goto fail;
+ }
+ } while (!done);
+ }
+
+ Dprint(((statp->options & RES_DEBUG) &&
+ getnameinfo(nsap, nsaplen, abuf, sizeof(abuf),
+ NULL, 0, niflags) == 0),
+ (stdout, ";; Querying server (# %d) address = %s\n",
+ ns + 1, abuf));
+
+
+ if (v_circuit) {
+ /* Use VC; at most one attempt per server. */
+ tries = statp->retry;
+ n = send_vc(statp, buf, buflen, ans, anssiz, &terrno,
+ ns);
+ if (n < 0)
+ goto fail;
+ if (n == 0)
+ goto next_ns;
+ resplen = n;
+ } else {
+ /* Use datagrams. */
+ n = send_dg(statp, buf, buflen, ans, anssiz, &terrno,
+ ns, tries, &v_circuit, &gotsomewhere);
+ if (n < 0)
+ goto fail;
+ if (n == 0)
+ goto next_ns;
+ if (v_circuit)
+ goto same_ns;
+ resplen = n;
+ }
+
+ Dprint((statp->options & RES_DEBUG) ||
+ ((statp->pfcode & RES_PRF_REPLY) &&
+ (statp->pfcode & RES_PRF_HEAD1)),
+ (stdout, ";; got answer:\n"));
+
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, "%s", ""),
+ ans, (resplen > anssiz) ? anssiz : resplen);
+
+ /*
+ * If we have temporarily opened a virtual circuit,
+ * or if we haven't been asked to keep a socket open,
+ * close the socket.
+ */
+ if ((v_circuit && (statp->options & RES_USEVC) == 0U) ||
+ (statp->options & RES_STAYOPEN) == 0U) {
+ res_nclose(statp);
+ }
+ if (statp->rhook) {
+ int done = 0, loops = 0;
+
+ do {
+ res_sendhookact act;
+
+ act = (*statp->rhook)(nsap, buf, buflen,
+ ans, anssiz, &resplen);
+ switch (act) {
+ case res_goahead:
+ case res_done:
+ done = 1;
+ break;
+ case res_nextns:
+ res_nclose(statp);
+ goto next_ns;
+ case res_modified:
+ /* give the hook another try */
+ if (++loops < 42) /*doug adams*/
+ break;
+ /*FALLTHROUGH*/
+ case res_error:
+ /*FALLTHROUGH*/
+ default:
+ goto fail;
+ }
+ } while (!done);
+
+ }
+ return (resplen);
+ next_ns: ;
+ } /*foreach ns*/
+ } /*foreach retry*/
+ res_nclose(statp);
+ if (!v_circuit) {
+ if (!gotsomewhere)
+ errno = ECONNREFUSED; /*%< no nameservers found */
+ else
+ errno = ETIMEDOUT; /*%< no answer obtained */
+ } else
+ errno = terrno;
+ return (-1);
+ fail:
+ res_nclose(statp);
+ return (-1);
+}
+
+/* Private */
+
+static int
+get_salen(sa)
+ const struct sockaddr *sa;
+{
+
+#ifdef HAVE_SA_LEN
+ /* There are people do not set sa_len. Be forgiving to them. */
+ if (sa->sa_len)
+ return (sa->sa_len);
+#endif
+
+ if (sa->sa_family == AF_INET)
+ return (sizeof(struct sockaddr_in));
+ else if (sa->sa_family == AF_INET6)
+ return (sizeof(struct sockaddr_in6));
+ else
+ return (0); /*%< unknown, die on connect */
+}
+
+/*%
+ * pick appropriate nsaddr_list for use. see res_init() for initialization.
+ */
+static struct sockaddr *
+get_nsaddr(statp, n)
+ res_state statp;
+ size_t n;
+{
+
+ if (!statp->nsaddr_list[n].sin_family && EXT(statp).ext) {
+ /*
+ * - EXT(statp).ext->nsaddrs[n] holds an address that is larger
+ * than struct sockaddr, and
+ * - user code did not update statp->nsaddr_list[n].
+ */
+ return (struct sockaddr *)(void *)&EXT(statp).ext->nsaddrs[n];
+ } else {
+ /*
+ * - user code updated statp->nsaddr_list[n], or
+ * - statp->nsaddr_list[n] has the same content as
+ * EXT(statp).ext->nsaddrs[n].
+ */
+ return (struct sockaddr *)(void *)&statp->nsaddr_list[n];
+ }
+}
+
+static int
+send_vc(res_state statp,
+ const u_char *buf, int buflen, u_char *ans, int anssiz,
+ int *terrno, int ns)
+{
+ const HEADER *hp = (const HEADER *) buf;
+ HEADER *anhp = (HEADER *) ans;
+ struct sockaddr *nsap;
+ int nsaplen;
+ int truncating, connreset, resplen, n;
+ struct iovec iov[2];
+ u_short len;
+ u_char *cp;
+ void *tmp;
+#ifdef SO_NOSIGPIPE
+ int on = 1;
+#endif
+
+ nsap = get_nsaddr(statp, ns);
+ nsaplen = get_salen(nsap);
+
+ connreset = 0;
+ same_ns:
+ truncating = 0;
+
+ /* Are we still talking to whom we want to talk to? */
+ if (statp->_vcsock >= 0 && (statp->_flags & RES_F_VC) != 0) {
+ struct sockaddr_storage peer;
+ ISC_SOCKLEN_T size = sizeof peer;
+
+ if (getpeername(statp->_vcsock,
+ (struct sockaddr *)&peer, &size) < 0 ||
+ !sock_eq((struct sockaddr *)&peer, nsap)) {
+ res_nclose(statp);
+ statp->_flags &= ~RES_F_VC;
+ }
+ }
+
+ if (statp->_vcsock < 0 || (statp->_flags & RES_F_VC) == 0) {
+ if (statp->_vcsock >= 0)
+ res_nclose(statp);
+
+ statp->_vcsock = socket(nsap->sa_family, SOCK_STREAM, 0);
+ if (statp->_vcsock > highestFD) {
+ res_nclose(statp);
+ errno = ENOTSOCK;
+ }
+ if (statp->_vcsock < 0) {
+ switch (errno) {
+ case EPROTONOSUPPORT:
+#ifdef EPFNOSUPPORT
+ case EPFNOSUPPORT:
+#endif
+ case EAFNOSUPPORT:
+ Perror(statp, stderr, "socket(vc)", errno);
+ return (0);
+ default:
+ *terrno = errno;
+ Perror(statp, stderr, "socket(vc)", errno);
+ return (-1);
+ }
+ }
+#ifdef SO_NOSIGPIPE
+ /*
+ * Disable generation of SIGPIPE when writing to a closed
+ * socket. Write should return -1 and set errno to EPIPE
+ * instead.
+ *
+ * Push on even if setsockopt(SO_NOSIGPIPE) fails.
+ */
+ (void)setsockopt(statp->_vcsock, SOL_SOCKET, SO_NOSIGPIPE, &on,
+ sizeof(on));
+#endif
+ errno = 0;
+ if (connect(statp->_vcsock, nsap, nsaplen) < 0) {
+ *terrno = errno;
+ Aerror(statp, stderr, "connect/vc", errno, nsap,
+ nsaplen);
+ res_nclose(statp);
+ return (0);
+ }
+ statp->_flags |= RES_F_VC;
+ }
+
+ /*
+ * Send length & message
+ */
+ ns_put16((u_short)buflen, (u_char*)&len);
+ iov[0] = evConsIovec(&len, INT16SZ);
+ DE_CONST(buf, tmp);
+ iov[1] = evConsIovec(tmp, buflen);
+ if (writev(statp->_vcsock, iov, 2) != (INT16SZ + buflen)) {
+ *terrno = errno;
+ Perror(statp, stderr, "write failed", errno);
+ res_nclose(statp);
+ return (0);
+ }
+ /*
+ * Receive length & response
+ */
+ read_len:
+ cp = ans;
+ len = INT16SZ;
+ while ((n = read(statp->_vcsock, (char *)cp, (int)len)) > 0) {
+ cp += n;
+ if ((len -= n) == 0)
+ break;
+ }
+ if (n <= 0) {
+ *terrno = errno;
+ Perror(statp, stderr, "read failed", errno);
+ res_nclose(statp);
+ /*
+ * A long running process might get its TCP
+ * connection reset if the remote server was
+ * restarted. Requery the server instead of
+ * trying a new one. When there is only one
+ * server, this means that a query might work
+ * instead of failing. We only allow one reset
+ * per query to prevent looping.
+ */
+ if (*terrno == ECONNRESET && !connreset) {
+ connreset = 1;
+ res_nclose(statp);
+ goto same_ns;
+ }
+ res_nclose(statp);
+ return (0);
+ }
+ resplen = ns_get16(ans);
+ if (resplen > anssiz) {
+ Dprint(statp->options & RES_DEBUG,
+ (stdout, ";; response truncated\n")
+ );
+ truncating = 1;
+ len = anssiz;
+ } else
+ len = resplen;
+ if (len < HFIXEDSZ) {
+ /*
+ * Undersized message.
+ */
+ Dprint(statp->options & RES_DEBUG,
+ (stdout, ";; undersized: %d\n", len));
+ *terrno = EMSGSIZE;
+ res_nclose(statp);
+ return (0);
+ }
+ cp = ans;
+ while (len != 0 && (n = read(statp->_vcsock, (char *)cp, (int)len)) > 0){
+ cp += n;
+ len -= n;
+ }
+ if (n <= 0) {
+ *terrno = errno;
+ Perror(statp, stderr, "read(vc)", errno);
+ res_nclose(statp);
+ return (0);
+ }
+ if (truncating) {
+ /*
+ * Flush rest of answer so connection stays in synch.
+ */
+ anhp->tc = 1;
+ len = resplen - anssiz;
+ while (len != 0) {
+ char junk[PACKETSZ];
+
+ n = read(statp->_vcsock, junk,
+ (len > sizeof junk) ? sizeof junk : len);
+ if (n > 0)
+ len -= n;
+ else
+ break;
+ }
+ }
+ /*
+ * If the calling applicating has bailed out of
+ * a previous call and failed to arrange to have
+ * the circuit closed or the server has got
+ * itself confused, then drop the packet and
+ * wait for the correct one.
+ */
+ if (hp->id != anhp->id) {
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, ";; old answer (unexpected):\n"),
+ ans, (resplen > anssiz) ? anssiz: resplen);
+ goto read_len;
+ }
+
+ /*
+ * All is well, or the error is fatal. Signal that the
+ * next nameserver ought not be tried.
+ */
+ return (resplen);
+}
+
+static int
+send_dg(res_state statp, const u_char *buf, int buflen, u_char *ans,
+ int anssiz, int *terrno, int ns, int tries, int *v_circuit,
+ int *gotsomewhere)
+{
+ const HEADER *hp = (const HEADER *) buf;
+ HEADER *anhp = (HEADER *) ans;
+ const struct sockaddr *nsap;
+ int nsaplen;
+ struct timespec now, timeout, finish;
+ struct sockaddr_storage from;
+ ISC_SOCKLEN_T fromlen;
+ int resplen, seconds, n, s;
+#ifdef USE_POLL
+ int polltimeout;
+ struct pollfd pollfd;
+#else
+ fd_set dsmask;
+#endif
+
+ nsap = get_nsaddr(statp, ns);
+ nsaplen = get_salen(nsap);
+ if (EXT(statp).nssocks[ns] == -1) {
+ EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM, 0);
+ if (EXT(statp).nssocks[ns] > highestFD) {
+ res_nclose(statp);
+ errno = ENOTSOCK;
+ }
+ if (EXT(statp).nssocks[ns] < 0) {
+ switch (errno) {
+ case EPROTONOSUPPORT:
+#ifdef EPFNOSUPPORT
+ case EPFNOSUPPORT:
+#endif
+ case EAFNOSUPPORT:
+ Perror(statp, stderr, "socket(dg)", errno);
+ return (0);
+ default:
+ *terrno = errno;
+ Perror(statp, stderr, "socket(dg)", errno);
+ return (-1);
+ }
+ }
+#ifndef CANNOT_CONNECT_DGRAM
+ /*
+ * On a 4.3BSD+ machine (client and server,
+ * actually), sending to a nameserver datagram
+ * port with no nameserver will cause an
+ * ICMP port unreachable message to be returned.
+ * If our datagram socket is "connected" to the
+ * server, we get an ECONNREFUSED error on the next
+ * socket operation, and select returns if the
+ * error message is received. We can thus detect
+ * the absence of a nameserver without timing out.
+ */
+ if (connect(EXT(statp).nssocks[ns], nsap, nsaplen) < 0) {
+ Aerror(statp, stderr, "connect(dg)", errno, nsap,
+ nsaplen);
+ res_nclose(statp);
+ return (0);
+ }
+#endif /* !CANNOT_CONNECT_DGRAM */
+ Dprint(statp->options & RES_DEBUG,
+ (stdout, ";; new DG socket\n"))
+ }
+ s = EXT(statp).nssocks[ns];
+#ifndef CANNOT_CONNECT_DGRAM
+ if (send(s, (const char*)buf, buflen, 0) != buflen) {
+ Perror(statp, stderr, "send", errno);
+ res_nclose(statp);
+ return (0);
+ }
+#else /* !CANNOT_CONNECT_DGRAM */
+ if (sendto(s, (const char*)buf, buflen, 0, nsap, nsaplen) != buflen)
+ {
+ Aerror(statp, stderr, "sendto", errno, nsap, nsaplen);
+ res_nclose(statp);
+ return (0);
+ }
+#endif /* !CANNOT_CONNECT_DGRAM */
+
+ /*
+ * Wait for reply.
+ */
+ seconds = (statp->retrans << tries);
+ if (ns > 0)
+ seconds /= statp->nscount;
+ if (seconds <= 0)
+ seconds = 1;
+ now = evNowTime();
+ timeout = evConsTime(seconds, 0);
+ finish = evAddTime(now, timeout);
+ goto nonow;
+ wait:
+ now = evNowTime();
+ nonow:
+#ifndef USE_POLL
+ FD_ZERO(&dsmask);
+ FD_SET(s, &dsmask);
+ if (evCmpTime(finish, now) > 0)
+ timeout = evSubTime(finish, now);
+ else
+ timeout = evConsTime(0, 0);
+ n = pselect(s + 1, &dsmask, NULL, NULL, &timeout, NULL);
+#else
+ timeout = evSubTime(finish, now);
+ if (timeout.tv_sec < 0)
+ timeout = evConsTime(0, 0);
+ polltimeout = 1000*timeout.tv_sec +
+ timeout.tv_nsec/1000000;
+ pollfd.fd = s;
+ pollfd.events = POLLRDNORM;
+ n = poll(&pollfd, 1, polltimeout);
+#endif /* USE_POLL */
+
+ if (n == 0) {
+ Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
+ *gotsomewhere = 1;
+ return (0);
+ }
+ if (n < 0) {
+ if (errno == EINTR)
+ goto wait;
+#ifndef USE_POLL
+ Perror(statp, stderr, "select", errno);
+#else
+ Perror(statp, stderr, "poll", errno);
+#endif /* USE_POLL */
+ res_nclose(statp);
+ return (0);
+ }
+ errno = 0;
+ fromlen = sizeof(from);
+ resplen = recvfrom(s, (char*)ans, anssiz,0,
+ (struct sockaddr *)&from, &fromlen);
+ if (resplen <= 0) {
+ Perror(statp, stderr, "recvfrom", errno);
+ res_nclose(statp);
+ return (0);
+ }
+ *gotsomewhere = 1;
+ if (resplen < HFIXEDSZ) {
+ /*
+ * Undersized message.
+ */
+ Dprint(statp->options & RES_DEBUG,
+ (stdout, ";; undersized: %d\n",
+ resplen));
+ *terrno = EMSGSIZE;
+ res_nclose(statp);
+ return (0);
+ }
+ if (hp->id != anhp->id) {
+ /*
+ * response from old query, ignore it.
+ * XXX - potential security hazard could
+ * be detected here.
+ */
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, ";; old answer:\n"),
+ ans, (resplen > anssiz) ? anssiz : resplen);
+ goto wait;
+ }
+ if (!(statp->options & RES_INSECURE1) &&
+ !res_ourserver_p(statp, (struct sockaddr *)&from)) {
+ /*
+ * response from wrong server? ignore it.
+ * XXX - potential security hazard could
+ * be detected here.
+ */
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, ";; not our server:\n"),
+ ans, (resplen > anssiz) ? anssiz : resplen);
+ goto wait;
+ }
+#ifdef RES_USE_EDNS0
+ if (anhp->rcode == FORMERR && (statp->options & RES_USE_EDNS0) != 0U) {
+ /*
+ * Do not retry if the server do not understand EDNS0.
+ * The case has to be captured here, as FORMERR packet do not
+ * carry query section, hence res_queriesmatch() returns 0.
+ */
+ DprintQ(statp->options & RES_DEBUG,
+ (stdout, "server rejected query with EDNS0:\n"),
+ ans, (resplen > anssiz) ? anssiz : resplen);
+ /* record the error */
+ statp->_flags |= RES_F_EDNS0ERR;
+ res_nclose(statp);
+ return (0);
+ }
+#endif
+ if (!(statp->options & RES_INSECURE2) &&
+ !res_queriesmatch(buf, buf + buflen,
+ ans, ans + anssiz)) {
+ /*
+ * response contains wrong query? ignore it.
+ * XXX - potential security hazard could
+ * be detected here.
+ */
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, ";; wrong query name:\n"),
+ ans, (resplen > anssiz) ? anssiz : resplen);
+ goto wait;
+ }
+ if (anhp->rcode == SERVFAIL ||
+ anhp->rcode == NOTIMP ||
+ anhp->rcode == REFUSED) {
+ DprintQ(statp->options & RES_DEBUG,
+ (stdout, "server rejected query:\n"),
+ ans, (resplen > anssiz) ? anssiz : resplen);
+ res_nclose(statp);
+ /* don't retry if called from dig */
+ if (!statp->pfcode)
+ return (0);
+ }
+ if (!(statp->options & RES_IGNTC) && anhp->tc) {
+ /*
+ * To get the rest of answer,
+ * use TCP with same server.
+ */
+ Dprint(statp->options & RES_DEBUG,
+ (stdout, ";; truncated answer\n"));
+ *v_circuit = 1;
+ res_nclose(statp);
+ return (1);
+ }
+ /*
+ * All is well, or the error is fatal. Signal that the
+ * next nameserver ought not be tried.
+ */
+ return (resplen);
+}
+
+static void
+Aerror(const res_state statp, FILE *file, const char *string, int error,
+ const struct sockaddr *address, int alen)
+{
+ int save = errno;
+ char hbuf[NI_MAXHOST];
+ char sbuf[NI_MAXSERV];
+
+ alen = alen;
+
+ if ((statp->options & RES_DEBUG) != 0U) {
+ if (getnameinfo(address, alen, hbuf, sizeof(hbuf),
+ sbuf, sizeof(sbuf), niflags)) {
+ strncpy(hbuf, "?", sizeof(hbuf) - 1);
+ hbuf[sizeof(hbuf) - 1] = '\0';
+ strncpy(sbuf, "?", sizeof(sbuf) - 1);
+ sbuf[sizeof(sbuf) - 1] = '\0';
+ }
+ fprintf(file, "res_send: %s ([%s].%s): %s\n",
+ string, hbuf, sbuf, strerror(error));
+ }
+ errno = save;
+}
+
+static void
+Perror(const res_state statp, FILE *file, const char *string, int error) {
+ int save = errno;
+
+ if ((statp->options & RES_DEBUG) != 0U)
+ fprintf(file, "res_send: %s: %s\n",
+ string, strerror(error));
+ errno = save;
+}
+
+static int
+sock_eq(struct sockaddr *a, struct sockaddr *b) {
+ struct sockaddr_in *a4, *b4;
+ struct sockaddr_in6 *a6, *b6;
+
+ if (a->sa_family != b->sa_family)
+ return 0;
+ switch (a->sa_family) {
+ case AF_INET:
+ a4 = (struct sockaddr_in *)a;
+ b4 = (struct sockaddr_in *)b;
+ return a4->sin_port == b4->sin_port &&
+ a4->sin_addr.s_addr == b4->sin_addr.s_addr;
+ case AF_INET6:
+ a6 = (struct sockaddr_in6 *)a;
+ b6 = (struct sockaddr_in6 *)b;
+ return a6->sin6_port == b6->sin6_port &&
+#ifdef HAVE_SIN6_SCOPE_ID
+ a6->sin6_scope_id == b6->sin6_scope_id &&
+#endif
+ IN6_ARE_ADDR_EQUAL(&a6->sin6_addr, &b6->sin6_addr);
+ default:
+ return 0;
+ }
+}
+
+#if defined(NEED_PSELECT) && !defined(USE_POLL)
+/* XXX needs to move to the porting library. */
+static int
+pselect(int nfds, void *rfds, void *wfds, void *efds,
+ struct timespec *tsp, const sigset_t *sigmask)
+{
+ struct timeval tv, *tvp;
+ sigset_t sigs;
+ int n;
+
+ if (tsp) {
+ tvp = &tv;
+ tv = evTimeVal(*tsp);
+ } else
+ tvp = NULL;
+ if (sigmask)
+ sigprocmask(SIG_SETMASK, sigmask, &sigs);
+ n = select(nfds, rfds, wfds, efds, tvp);
+ if (sigmask)
+ sigprocmask(SIG_SETMASK, &sigs, NULL);
+ if (tsp)
+ *tsp = evTimeSpec(tv);
+ return (n);
+}
+#endif
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_sendsigned.c b/usr/src/lib/libresolv2_joy/common/resolv/res_sendsigned.c
new file mode 100644
index 0000000000..5ebc1a70eb
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_sendsigned.c
@@ -0,0 +1,170 @@
+#include "port_before.h"
+#include "fd_setsize.h"
+
+#include <sys/types.h>
+#include <sys/param.h>
+
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <arpa/inet.h>
+
+#include <isc/dst.h>
+
+#include <errno.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "port_after.h"
+
+#define DEBUG
+#include "res_debug.h"
+
+
+/*% res_nsendsigned */
+int
+res_nsendsigned(res_state statp, const u_char *msg, int msglen,
+ ns_tsig_key *key, u_char *answer, int anslen)
+{
+ res_state nstatp;
+ DST_KEY *dstkey;
+ int usingTCP = 0;
+ u_char *newmsg;
+ int newmsglen, bufsize, siglen;
+ u_char sig[64];
+ HEADER *hp;
+ time_t tsig_time;
+ int ret;
+ int len;
+
+ dst_init();
+
+ nstatp = (res_state) malloc(sizeof(*statp));
+ if (nstatp == NULL) {
+ errno = ENOMEM;
+ return (-1);
+ }
+ memcpy(nstatp, statp, sizeof(*statp));
+
+ bufsize = msglen + 1024;
+ newmsg = (u_char *) malloc(bufsize);
+ if (newmsg == NULL) {
+ free(nstatp);
+ errno = ENOMEM;
+ return (-1);
+ }
+ memcpy(newmsg, msg, msglen);
+ newmsglen = msglen;
+
+ if (ns_samename(key->alg, NS_TSIG_ALG_HMAC_MD5) != 1)
+ dstkey = NULL;
+ else
+ dstkey = dst_buffer_to_key(key->name, KEY_HMAC_MD5,
+ NS_KEY_TYPE_AUTH_ONLY,
+ NS_KEY_PROT_ANY,
+ key->data, key->len);
+ if (dstkey == NULL) {
+ errno = EINVAL;
+ free(nstatp);
+ free(newmsg);
+ return (-1);
+ }
+
+ nstatp->nscount = 1;
+ siglen = sizeof(sig);
+ ret = ns_sign(newmsg, &newmsglen, bufsize, NOERROR, dstkey, NULL, 0,
+ sig, &siglen, 0);
+ if (ret < 0) {
+ free (nstatp);
+ free (newmsg);
+ dst_free_key(dstkey);
+ if (ret == NS_TSIG_ERROR_NO_SPACE)
+ errno = EMSGSIZE;
+ else if (ret == -1)
+ errno = EINVAL;
+ return (ret);
+ }
+
+ if (newmsglen > PACKETSZ || nstatp->options & RES_USEVC)
+ usingTCP = 1;
+ if (usingTCP == 0)
+ nstatp->options |= RES_IGNTC;
+ else
+ nstatp->options |= RES_USEVC;
+ /*
+ * Stop res_send printing the answer.
+ */
+ nstatp->options &= ~RES_DEBUG;
+ nstatp->pfcode &= ~RES_PRF_REPLY;
+
+retry:
+
+ len = res_nsend(nstatp, newmsg, newmsglen, answer, anslen);
+ if (len < 0) {
+ free (nstatp);
+ free (newmsg);
+ dst_free_key(dstkey);
+ return (len);
+ }
+
+ ret = ns_verify(answer, &len, dstkey, sig, siglen,
+ NULL, NULL, &tsig_time, nstatp->options & RES_KEEPTSIG);
+ if (ret != 0) {
+ Dprint((statp->options & RES_DEBUG) ||
+ ((statp->pfcode & RES_PRF_REPLY) &&
+ (statp->pfcode & RES_PRF_HEAD1)),
+ (stdout, ";; got answer:\n"));
+
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, "%s", ""),
+ answer, (anslen > len) ? len : anslen);
+
+ if (ret > 0) {
+ Dprint(statp->pfcode & RES_PRF_REPLY,
+ (stdout, ";; server rejected TSIG (%s)\n",
+ p_rcode(ret)));
+ } else {
+ Dprint(statp->pfcode & RES_PRF_REPLY,
+ (stdout, ";; TSIG invalid (%s)\n",
+ p_rcode(-ret)));
+ }
+
+ free (nstatp);
+ free (newmsg);
+ dst_free_key(dstkey);
+ if (ret == -1)
+ errno = EINVAL;
+ else
+ errno = ENOTTY;
+ return (-1);
+ }
+
+ hp = (HEADER *) answer;
+ if (hp->tc && !usingTCP && (statp->options & RES_IGNTC) == 0U) {
+ nstatp->options &= ~RES_IGNTC;
+ usingTCP = 1;
+ goto retry;
+ }
+ Dprint((statp->options & RES_DEBUG) ||
+ ((statp->pfcode & RES_PRF_REPLY) &&
+ (statp->pfcode & RES_PRF_HEAD1)),
+ (stdout, ";; got answer:\n"));
+
+ DprintQ((statp->options & RES_DEBUG) ||
+ (statp->pfcode & RES_PRF_REPLY),
+ (stdout, "%s", ""),
+ answer, (anslen > len) ? len : anslen);
+
+ Dprint(statp->pfcode & RES_PRF_REPLY, (stdout, ";; TSIG ok\n"));
+
+ free (nstatp);
+ free (newmsg);
+ dst_free_key(dstkey);
+ return (len);
+}
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/common/resolv/res_update.c b/usr/src/lib/libresolv2_joy/common/resolv/res_update.c
new file mode 100644
index 0000000000..df24aee3bd
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/resolv/res_update.c
@@ -0,0 +1,213 @@
+#if !defined(lint) && !defined(SABER)
+static const char rcsid[] = "$Id: res_update.c,v 1.13 2005/04/27 04:56:43 sra Exp $";
+#endif /* not lint */
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file
+ * \brief
+ * Based on the Dynamic DNS reference implementation by Viraj Bais
+ * &lt;viraj_bais@ccm.fm.intel.com>
+ */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <netdb.h>
+#include <res_update.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <isc/list.h>
+#include <resolv_joy.h>
+
+#include "port_after.h"
+#include "res_private.h"
+
+/*%
+ * Separate a linked list of records into groups so that all records
+ * in a group will belong to a single zone on the nameserver.
+ * Create a dynamic update packet for each zone and send it to the
+ * nameservers for that zone, and await answer.
+ * Abort if error occurs in updating any zone.
+ * Return the number of zones updated on success, < 0 on error.
+ *
+ * On error, caller must deal with the unsynchronized zones
+ * eg. an A record might have been successfully added to the forward
+ * zone but the corresponding PTR record would be missing if error
+ * was encountered while updating the reverse zone.
+ */
+
+struct zonegrp {
+ char z_origin[MAXDNAME];
+ ns_class z_class;
+ union res_sockaddr_union z_nsaddrs[MAXNS];
+ int z_nscount;
+ int z_flags;
+ LIST(ns_updrec) z_rrlist;
+ LINK(struct zonegrp) z_link;
+};
+
+#define ZG_F_ZONESECTADDED 0x0001
+
+/* Forward. */
+
+static void res_dprintf(const char *, ...) ISC_FORMAT_PRINTF(1, 2);
+
+/* Macros. */
+
+#define DPRINTF(x) do {\
+ int save_errno = errno; \
+ if ((statp->options & RES_DEBUG) != 0U) res_dprintf x; \
+ errno = save_errno; \
+ } while (0)
+
+/* Public. */
+
+int
+res_nupdate(res_state statp, ns_updrec *rrecp_in, ns_tsig_key *key) {
+ ns_updrec *rrecp;
+ u_char answer[PACKETSZ];
+ u_char *packet;
+ struct zonegrp *zptr, tgrp;
+ LIST(struct zonegrp) zgrps;
+ int nzones = 0, nscount = 0, n;
+ union res_sockaddr_union nsaddrs[MAXNS];
+
+ packet = malloc(NS_MAXMSG);
+ if (packet == NULL) {
+ DPRINTF(("malloc failed"));
+ return (0);
+ }
+ /* Thread all of the updates onto a list of groups. */
+ INIT_LIST(zgrps);
+ memset(&tgrp, 0, sizeof (tgrp));
+ for (rrecp = rrecp_in; rrecp;
+ rrecp = LINKED(rrecp, r_link) ? NEXT(rrecp, r_link) : NULL) {
+ int nscnt;
+ /* Find the origin for it if there is one. */
+ tgrp.z_class = rrecp->r_class;
+ nscnt = res_findzonecut2(statp, rrecp->r_dname, tgrp.z_class,
+ RES_EXHAUSTIVE, tgrp.z_origin,
+ sizeof tgrp.z_origin,
+ tgrp.z_nsaddrs, MAXNS);
+ if (nscnt <= 0) {
+ DPRINTF(("res_findzonecut failed (%d)", nscnt));
+ goto done;
+ }
+ tgrp.z_nscount = nscnt;
+ /* Find the group for it if there is one. */
+ for (zptr = HEAD(zgrps); zptr != NULL; zptr = NEXT(zptr, z_link))
+ if (ns_samename(tgrp.z_origin, zptr->z_origin) == 1 &&
+ tgrp.z_class == zptr->z_class)
+ break;
+ /* Make a group for it if there isn't one. */
+ if (zptr == NULL) {
+ zptr = malloc(sizeof *zptr);
+ if (zptr == NULL) {
+ DPRINTF(("malloc failed"));
+ goto done;
+ }
+ *zptr = tgrp;
+ zptr->z_flags = 0;
+ INIT_LINK(zptr, z_link);
+ INIT_LIST(zptr->z_rrlist);
+ APPEND(zgrps, zptr, z_link);
+ }
+ /* Thread this rrecp onto the right group. */
+ APPEND(zptr->z_rrlist, rrecp, r_glink);
+ }
+
+ for (zptr = HEAD(zgrps); zptr != NULL; zptr = NEXT(zptr, z_link)) {
+ /* Construct zone section and prepend it. */
+ rrecp = res_mkupdrec(ns_s_zn, zptr->z_origin,
+ zptr->z_class, ns_t_soa, 0);
+ if (rrecp == NULL) {
+ DPRINTF(("res_mkupdrec failed"));
+ goto done;
+ }
+ PREPEND(zptr->z_rrlist, rrecp, r_glink);
+ zptr->z_flags |= ZG_F_ZONESECTADDED;
+
+ /* Marshall the update message. */
+ n = res_nmkupdate(statp, HEAD(zptr->z_rrlist),
+ packet, NS_MAXMSG);
+ DPRINTF(("res_mkupdate -> %d", n));
+ if (n < 0)
+ goto done;
+
+ /* Temporarily replace the resolver's nameserver set. */
+ nscount = res_getservers(statp, nsaddrs, MAXNS);
+ res_setservers(statp, zptr->z_nsaddrs, zptr->z_nscount);
+
+ /* Send the update and remember the result. */
+ if (key != NULL)
+ n = res_nsendsigned(statp, packet, n, key,
+ answer, sizeof answer);
+ else
+ n = res_nsend(statp, packet, n, answer, sizeof answer);
+ if (n < 0) {
+ DPRINTF(("res_nsend: send error, n=%d (%s)\n",
+ n, strerror(errno)));
+ goto done;
+ }
+ if (((HEADER *)answer)->rcode == NOERROR)
+ nzones++;
+
+ /* Restore resolver's nameserver set. */
+ res_setservers(statp, nsaddrs, nscount);
+ nscount = 0;
+ }
+ done:
+ while (!EMPTY(zgrps)) {
+ zptr = HEAD(zgrps);
+ if ((zptr->z_flags & ZG_F_ZONESECTADDED) != 0)
+ res_freeupdrec(HEAD(zptr->z_rrlist));
+ UNLINK(zgrps, zptr, z_link);
+ free(zptr);
+ }
+ if (nscount != 0)
+ res_setservers(statp, nsaddrs, nscount);
+
+ free(packet);
+ return (nzones);
+}
+
+/* Private. */
+
+static void
+res_dprintf(const char *fmt, ...) {
+ va_list ap;
+
+ va_start(ap, fmt);
+ fputs(";; res_nupdate: ", stderr);
+ vfprintf(stderr, fmt, ap);
+ fputc('\n', stderr);
+ va_end(ap);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/sunw/sunw_mtctxres.c b/usr/src/lib/libresolv2_joy/common/sunw/sunw_mtctxres.c
new file mode 100644
index 0000000000..cc2a485ede
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/sunw/sunw_mtctxres.c
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <port_before.h>
+#include <thread.h>
+#include <errno.h>
+#include <netdb.h>
+#include <malloc.h>
+#include <string.h>
+#include <resolv_mt.h>
+#include <irs.h>
+#include <port_after.h>
+
+#pragma redefine_extname __h_errno __joy_h_errno
+
+/*
+ * much of the original version of sunw_mtxtxres.c was incorporated into
+ * ISC libbind as resolv/mtctxres.c. The following bits have not yet made
+ * it into ISC libbind.
+ */
+
+/*
+ * There used to be a private, MT-safe resolver interface that used TSD
+ * to store per-thread _res, h_errno, etc. We continue to provide the
+ * access functions __res_get_res() and __res_get_h_errno() so that binaries
+ * that used the private interface will continue to work.
+ */
+
+#ifdef _res
+#undef _res
+#endif
+
+extern struct __res_state *__res_state(void);
+
+struct __res_state *
+__res_get_res(void) {
+ return (__res_state());
+}
+
+
+#ifdef h_errno
+#undef h_errno
+#endif
+
+extern int *__h_errno(void);
+
+int *
+__res_get_h_errno(void) {
+ return (__h_errno());
+}
+
+
+#ifdef SUNW_HOSTS_FALLBACK
+
+/*
+ * When the name service switch calls libresolv, it doesn't want fallback
+ * to /etc/hosts, so we provide a method to turn it off.
+ */
+
+void
+__joy_res_set_no_hosts_fallback(void) {
+ ___mtctxres()->no_hosts_fallback_private = 1;
+}
+
+void
+__joy_res_unset_no_hosts_fallback(void) {
+ ___mtctxres()->no_hosts_fallback_private = 0;
+}
+
+int
+__res_no_hosts_fallback(void) {
+ return (___mtctxres()->no_hosts_fallback_private);
+}
+
+#endif /* SUNW_HOSTS_FALLBACK */
+
+#ifdef SUNW_OVERRIDE_RETRY
+
+/*
+ * The NS switch wants to be able to override the number of retries.
+ */
+
+int
+__joy_res_override_retry(int retry) {
+ ___mtctxres()->retry_private = retry;
+ /*
+ * This function doesn't really need a return value; saving the
+ * old retry setting, and restoring it, is handled by __res_retry()
+ * and __res_retry_reset() below. However, the nss_dns library
+ * must have a private version of this function to be used when
+ * running with an old libresolv. That private nss_dns function
+ * needs a return value, and a function pointer is used to select
+ * the right function at runtime. Thus, __res_override_retry
+ * must have a function prototype consistent with the private
+ * nss_dns function, i.e., one that returns an int.
+ *
+ * Given that we do have a return value, that value must be zero.
+ * That's because retry_private == 0 is used to indicate that
+ * no override retry value is in effect, and the way we expect
+ * nss_dns to call us is:
+ *
+ * int oldretry = __res_override_retry(N);
+ * <whatever>
+ * (void)__res_override_retry(old_retry);
+ */
+ return (0);
+}
+
+int
+__res_retry(int retry) {
+ mtctxres_t *mt = ___mtctxres();
+
+ mt->retry_save = retry;
+ return ((mt->retry_private != 0) ? mt->retry_private : retry);
+}
+
+int
+__res_retry_reset(void) {
+ mtctxres_t *mt = ___mtctxres();
+
+ return (mt->retry_save);
+}
+
+#endif /* SUNW_OVERRIDE_RETRY */
diff --git a/usr/src/lib/libresolv2_joy/common/sunw/sunw_updrec.c b/usr/src/lib/libresolv2_joy/common/sunw/sunw_updrec.c
new file mode 100644
index 0000000000..3b0ffc49df
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/sunw/sunw_updrec.c
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * As of BIND 8.2.2, ISC (a) removed res_mkupdate(), res_update(), and
+ * res_mkupdrec() from what they consider the supported interface. The
+ * functions still exist, but their calling interface has changed, since
+ * the ns_updrec structure has changed.
+ *
+ * It seems probable that res_mkupdate() etc. will return, though possibly
+ * with other changes, in some future BIND release. In order to avoid
+ * going to PSARC twice (once to remove the functions, and then again to
+ * add them back), we retain the old interface as a wrapper around the
+ * new one.
+ */
+
+#include <port_before.h>
+
+#include <malloc.h>
+#include <strings.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+/* get the Solaris ns_updrec before any renaming happens */
+#include <arpa/nameser.h>
+
+/* get the __ISC_ns_updrec */
+#include <res_update.h>
+
+#include <port_after.h>
+
+/* un-rename ns_updrec and res_* functions so we can wrap them */
+#undef ns_updrec
+#undef res_mkupdate
+#undef res_update
+#undef res_mkupdrec
+#undef res_freeupdrec
+#undef res_nmkupdate
+#undef res_nupdate
+
+void res_freeupdrec(ns_updrec *);
+
+static int
+old2new(ns_updrec *old, __ISC_ns_updrec *new) {
+
+ if (old->r_dname != 0) {
+ if ((new->r_dname = strdup(old->r_dname)) == 0)
+ return (-1);
+ } else {
+ new->r_dname = 0;
+ }
+
+ new->r_glink.prev =
+ new->r_glink.next =
+ new->r_link.prev =
+ new->r_link.next = 0;
+
+ new->r_section = old->r_section;
+ new->r_class = old->r_class;
+ new->r_type = old->r_type;
+ new->r_ttl = old->r_ttl;
+ new->r_data = old->r_data;
+ new->r_size = old->r_size;
+ new->r_opcode = old->r_opcode;
+ new->r_dp = old->r_dp;
+ new->r_deldp = old->r_deldp;
+ new->r_zone = old->r_zone;
+
+ return (0);
+}
+
+
+static int
+new2old(__ISC_ns_updrec *new, ns_updrec *old) {
+ /* XXX r_prev and r_next unchanged */
+ if (new->r_dname != 0) {
+ if ((old->r_dname = strdup(new->r_dname)) == 0)
+ return (-1);
+ } else {
+ old->r_dname = 0;
+ }
+ old->r_section = new->r_section;
+ old->r_class = new->r_class;
+ old->r_type = new->r_type;
+ old->r_ttl = new->r_ttl;
+ old->r_data = new->r_data;
+ old->r_size = new->r_size;
+ old->r_opcode = new->r_opcode;
+ old->r_grpnext = 0; /* XXX */
+ old->r_dp = new->r_dp;
+ old->r_deldp = new->r_deldp;
+ old->r_zone = new->r_zone;
+
+ return (0);
+}
+
+
+static void
+delete_list(__ISC_ns_updrec *list) {
+
+ __ISC_ns_updrec *next;
+
+ for (; list != 0; list = next) {
+ next = list->r_link.next;
+ __ISC_res_freeupdrec(list);
+ }
+}
+
+
+static __ISC_ns_updrec *
+copy_list(ns_updrec *old, int do_glink) {
+
+ __ISC_ns_updrec *list = 0, *r, *p;
+
+ if (old == 0)
+ return (0);
+
+ for (p = 0; old != 0; old = old->r_next, p = r) {
+ if ((r = calloc(1, sizeof (*r))) == 0 ||
+ old2new(old, r) != 0) {
+ free(r);
+ delete_list(list);
+ return (0);
+ }
+ r->r_link.prev = p;
+ r->r_link.next = 0;
+ /* res_update and res_nupdate want r_glink set up like this */
+ if (do_glink) {
+ r->r_glink.prev = p;
+ r->r_glink.next = 0;
+ } else {
+ r->r_glink.prev = (void *)-1;
+ r->r_glink.next = (void *)-1;
+ }
+ if (p != 0) {
+ p->r_link.next = r;
+ if (do_glink) {
+ p->r_glink.next = r;
+ }
+ } else {
+ list = r;
+ }
+ }
+ return (list);
+}
+
+
+int
+res_mkupdate(ns_updrec *rrecp_in, uchar_t *buf, int length) {
+
+ __ISC_ns_updrec *r;
+ int ret;
+
+ if ((r = copy_list(rrecp_in, 1)) == 0)
+ return (-1);
+
+ ret = __ISC_res_mkupdate(r, buf, length);
+
+ delete_list(r);
+
+ return (ret);
+}
+
+int
+res_nmkupdate(res_state statp, ns_updrec *rrecp_in, uchar_t *buf, int length) {
+
+ __ISC_ns_updrec *r;
+ int ret;
+
+ if ((r = copy_list(rrecp_in, 1)) == 0)
+ return (-1);
+
+ ret = __ISC_res_nmkupdate(statp, r, buf, length);
+
+ delete_list(r);
+
+ return (ret);
+}
+
+
+int
+res_update(ns_updrec *rrecp_in) {
+
+ __ISC_ns_updrec *r;
+ int ret;
+
+ if ((r = copy_list(rrecp_in, 0)) == 0)
+ return (-1);
+
+ ret = __ISC_res_update(r);
+
+ delete_list(r);
+
+ return (ret);
+}
+
+int
+res_nupdate(res_state statp, ns_updrec *rrecp_in, ns_tsig_key *key) {
+
+ __ISC_ns_updrec *r;
+ int ret;
+
+ if ((r = copy_list(rrecp_in, 0)) == 0)
+ return (-1);
+
+ ret = __ISC_res_nupdate(statp, r, key);
+
+ delete_list(r);
+
+ return (ret);
+}
+
+
+
+ns_updrec *
+res_mkupdrec(int section, const char *dname, uint_t class, uint_t type,
+ uint_t ttl) {
+
+ __ISC_ns_updrec *n;
+ ns_updrec *o;
+
+ n = __ISC_res_mkupdrec(section, dname, class, type, ttl);
+ if (n == 0)
+ return (0);
+
+ if ((o = calloc(1, sizeof (*o))) != 0) {
+ if (new2old(n, o) != 0) {
+ res_freeupdrec(o);
+ o = 0;
+ }
+ }
+
+ __ISC_res_freeupdrec(n);
+
+ return (o);
+}
+
+
+void
+res_freeupdrec(ns_updrec *rrecp) {
+ if (rrecp == 0)
+ return;
+ /* Note: freeing r_dp is the caller's responsibility. */
+ if (rrecp->r_dname != NULL)
+ free(rrecp->r_dname);
+ free(rrecp);
+}
diff --git a/usr/src/lib/libresolv2_joy/common/sunw/sunw_wrappers.c b/usr/src/lib/libresolv2_joy/common/sunw/sunw_wrappers.c
new file mode 100644
index 0000000000..55bbe07024
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/common/sunw/sunw_wrappers.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <port_before.h>
+#include <resolv_joy.h>
+#include <arpa/inet.h>
+#include <port_after.h>
+
+#undef p_option
+/* extern const char * isc_p_option(); */
+const char *p_option(uint_t option) {
+ return (isc_p_option((ulong_t)option));
+}
+#pragma weak __p_option = p_option
+
+#undef p_secstodate
+/* extern char * isc_p_secstodate (); */
+char *p_secstodate(uint_t secs) {
+ return (isc_p_secstodate((ulong_t)secs));
+}
+#pragma weak __p_secstodate = p_secstodate
diff --git a/usr/src/lib/libresolv2_joy/i386/Makefile b/usr/src/lib/libresolv2_joy/i386/Makefile
new file mode 100644
index 0000000000..a333224278
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/i386/Makefile
@@ -0,0 +1,30 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libresolv2_joy/include/Makefile b/usr/src/lib/libresolv2_joy/include/Makefile
new file mode 100644
index 0000000000..8bff3c3188
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/Makefile
@@ -0,0 +1,60 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../../../Makefile.master
+
+HDRS= os_version.h port_ipv6.h
+TMPHDRS= new_os_version.h new_port_ipv6.h
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+
+.KEEP_STATE:
+
+all lint: $(HDRS)
+
+install: all
+
+clean:
+ $(RM) $(HDRS) $(TMPHDRS)
+
+clobber: clean
+
+# os_version.h and port_ipv6.h should be rebuilt when you change OS
+# revision. Since that's not easily expressed as a dependency, we
+# rebuild them every time.
+
+os_version.h: make_os_version FRC
+ ./make_os_version
+
+port_ipv6.h: probe_ipv6 FRC
+ CC="$(CC)" ./probe_ipv6
+
+FRC:
diff --git a/usr/src/lib/libresolv2_joy/include/arpa/port_inet.h b/usr/src/lib/libresolv2_joy/include/arpa/port_inet.h
new file mode 100644
index 0000000000..5eb1787f56
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/arpa/port_inet.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ *
+ * All rights reserved.
+ */
+
+#ifndef _ARPA_PORT_INET_H
+#define _ARPA_PORT_INET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * these are libresolv2 functions that were made local in previous versions
+ * we rename them res_* because they conflict with libnsl or libsocket
+ */
+
+#define inet_lnaof res_inet_lnaof /* libsocket */
+ulong_t inet_lnaof(struct in_addr in);
+
+#define inet_makeaddr res_inet_makeaddr /* libsocket */
+struct in_addr inet_makeaddr(ulong_t net, ulong_t host);
+
+#define inet_netof res_inet_netof /* libnsl */
+ulong_t inet_netof(struct in_addr in);
+
+#define inet_network res_inet_network /* libsocket */
+ulong_t inet_network(register const char *cp);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#endif /* _ARPA_PORT_INET_H */
diff --git a/usr/src/lib/libresolv2_joy/include/arpa/port_nameser.h b/usr/src/lib/libresolv2_joy/include/arpa/port_nameser.h
new file mode 100644
index 0000000000..b40ea0d163
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/arpa/port_nameser.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _ARPA_PORT_NAMESER_H
+#define _ARPA_PORT_NAMESER_H
+
+/*
+ * ISC changed the ns_updrec structure. However, it's a public interface
+ * in Solaris, so we rename it here and wrap in sunw_updrec.c
+ */
+#define ns_updrec __ISC_ns_updrec
+
+
+/*
+ * Due to the above, the following functions need to be renamed and
+ * wrapped in sunw_updrec.c.
+ *
+ * For BIND 8.2.2, ISC removed the dynamic update functions, and the
+ * definition of the ns_updrec structure, from the public include files
+ * (<resolv.h>, <arpa/nameser.h>. However, res_update(), res_mkupdate(),
+ * and res_mkupdrec() are in the public libresolv interface in Solaris,
+ * so we can't easily remove them. Thus, ISC's new versions of res_mkupdate()
+ * etc. can't be exposed under their original names.
+ *
+ * res_nmkupdate() and res_nupdate are new. We could either change them
+ * to accept the <arpa/nameser.h> ns_updrec, or leave them unchanged and
+ * undocumented. Since ISC may change ns_updrec again, we pick the latter
+ * solution for now.
+ */
+#define res_mkupdate __ISC_res_mkupdate
+#define res_update __ISC_res_update
+#define res_mkupdrec __ISC_res_mkupdrec
+#define res_freeupdrec __ISC_res_freeupdrec
+#define res_nmkupdate __ISC_res_nmkupdate
+#define res_nupdate __ISC_res_nupdate
+
+
+#endif /* _ARPA_PORT_NAMESER_H */
diff --git a/usr/src/lib/libresolv2_joy/include/conf/sunoptions.h b/usr/src/lib/libresolv2_joy/include/conf/sunoptions.h
new file mode 100644
index 0000000000..b75ff9d878
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/conf/sunoptions.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SUNOPTIONS_H
+#define _SUNOPTIONS_H
+
+#define USELOOPBACK /* Resolver library defaults to 127.0.0.1 */
+
+/* Additions for Solaris 2 */
+
+#define SUNW_INITCHKIF /* Check if any non-loopback interface is up */
+#define SUNW_CONFCHECK /* Abort quickly if no /etc/resolv.conf or */
+ /* local named */
+#define SUNW_HOSTS_FALLBACK /* Configurable /etc/hosts fallback */
+#define SUNW_HNOK_UNDERSCORE /* Allow underscore in hostnames (libresolv) */
+#define SUNW_MT_RESOLVER /* MT hot extensions (libresolv) */
+#define SUNW_SETHERRNO /* ISC does not set h_errno in gethostbyname */
+#define SUNW_OVERRIDE_RETRY /* Allow NS switch to override res->retry */
+#define SUNW_LIBMD5 /* Use md5(3EXT) instead of internal implementation */
+
+/* If compiling an MT warm libresolv, we also need reentrancy */
+#if defined(SUNW_MT_RESOLVER) && !defined(_REENTRANT)
+#define _REENTRANT
+#endif
+
+/* End additions for Solaris 2 */
+
+#endif /* _SUNOPTIONS_H */
diff --git a/usr/src/lib/libresolv2_joy/include/config.h b/usr/src/lib/libresolv2_joy/include/config.h
new file mode 100644
index 0000000000..35fb115a0f
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/config.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/* config.h. Generated from config.h.in by configure. */
+/* #undef _SOCKADDR_LEN */
+#define HAVE_FCNTL_H 1
+/* #undef HAVE_PATHS_H */
+#define HAVE_INTTYPES_H 1
+#define HAVE_STROPTS_H 1
+/* #undef HAVE_SYS_TIMERS_H */
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_MEMORY_H 1
+/* #undef SYS_CDEFS_H */
+#define _POSIX_PTHREAD_SEMANTICS 1
+#define POSIX_GETPWUID_R 1
+#define POSIX_GETPWNAM_R 1
+#define POSIX_GETGRGID_R 1
+#define POSIX_GETGRNAM_R 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCHR 1
+/* #undef SPRINTF_CHAR */
+/* #undef VSPRINTF_CHAR */
+#define USE_SYSERROR_LIST 1
+/* #undef NEED_STRTOUL */
+/* #undef NEED_SUN4PROTOS */
+/* #undef REENABLE_SEND */
+
+#define NEED_SETGROUPENT 1
+#define NEED_GETGROUPLIST 1
+
+/* define if prototype for getgrnam_r() is required */
+/* #undef NEED_GETGRNAM_R */
+/* #undef NEED_GETGRGID_R */
+/* #undef NEED_GETGRENT_R */
+#define NEED_SETGRENT_R 1
+#define NEED_ENDGRENT_R 1
+
+#define NEED_INNETGR_R 1
+/* #undef NEED_SETNETGRENT_R */
+#define NEED_ENDNETGRENT_R 1
+
+/* #undef NEED_GETPWNAM_R */
+/* #undef NEED_GETPWUID_R */
+#define NEED_SETPWENT_R 1
+#define NEED_SETPASSENT_R 1
+#define NEED_SETPWENT_R 1
+/* #undef NEED_GETPWENT_R */
+#define NEED_ENDPWENT_R 1
+
+#define NEED_SETPASSENT 1
+
+/* #undef HAS_PW_CLASS */
+
+/* #undef ssize_t */
+/* #undef uintptr_t */
+
+/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
+/* #undef SHUTUP_SPUTAUX */
+#ifdef SHUTUP_SPUTAUX
+struct __sFILE;
+extern __inline int __sputaux(int _c, struct __sFILE *_p);
+#endif
+#define BROKEN_IN6ADDR_INIT_MACROS 1
+#define HAVE_STRLCAT 1
+/* Shut up warnings about missing braces */
+/* #undef SHUTUP_MUTEX_INITIALIZER */
+#ifdef SHUTUP_MUTEX_INITIALIZER
+#define LIBBIND_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
+#else
+#define LIBBIND_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#endif
+
diff --git a/usr/src/lib/libresolv2_joy/include/err.h b/usr/src/lib/libresolv2_joy/include/err.h
new file mode 100644
index 0000000000..45992ea336
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/err.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2001 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)err.h 8.1 (Berkeley) 6/2/93
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifndef _ERR_H_
+#define _ERR_H_
+
+#include <sys/cdefs.h>
+#include <stdarg.h>
+
+__BEGIN_DECLS
+__dead void err __P((int, const char *, ...)) __attribute__((__volatile));
+__dead void verr __P((int, const char *, va_list))
+ __attribute__((__volatile));
+__dead void errx __P((int, const char *, ...)) __attribute__((__volatile));
+__dead void verrx __P((int, const char *, va_list))
+ __attribute__((__volatile));
+void warn __P((const char *, ...));
+void vwarn __P((const char *, va_list));
+void warnx __P((const char *, ...));
+void vwarnx __P((const char *, va_list));
+__END_DECLS
+
+#endif /* !_ERR_H_ */
diff --git a/usr/src/lib/libresolv2_joy/include/fd_setsize.h b/usr/src/lib/libresolv2_joy/include/fd_setsize.h
new file mode 100644
index 0000000000..0e21049742
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/fd_setsize.h
@@ -0,0 +1,10 @@
+#ifndef _FD_SETSIZE_H
+#define _FD_SETSIZE_H
+
+/*%
+ * If you need a bigger FD_SETSIZE, this is NOT the place to set it.
+ * This file is a fallback for BIND ports which don't specify their own.
+ */
+
+#endif /* _FD_SETSIZE_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/hesiod.h b/usr/src/lib/libresolv2_joy/include/hesiod.h
new file mode 100644
index 0000000000..d64c0c5e80
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/hesiod.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*! \file
+ * \brief
+ * This file is primarily maintained by <tytso@mit.edu> and <ghudson@mit.edu>.
+ */
+
+/*
+ * $Id: hesiod.h,v 1.4 2005/04/27 04:56:14 sra Exp $
+ */
+
+#ifndef _HESIOD_H_INCLUDED
+#define _HESIOD_H_INCLUDED
+
+int hesiod_init __P((void **));
+void hesiod_end __P((void *));
+char * hesiod_to_bind __P((void *, const char *, const char *));
+char ** hesiod_resolve __P((void *, const char *, const char *));
+void hesiod_free_list __P((void *, char **));
+struct __res_state * __hesiod_res_get __P((void *));
+void __hesiod_res_set __P((void *, struct __res_state *,
+ void (*)(void *)));
+
+#endif /*_HESIOD_H_INCLUDED*/
diff --git a/usr/src/lib/libresolv2_joy/include/irp.h b/usr/src/lib/libresolv2_joy/include/irp.h
new file mode 100644
index 0000000000..1290bd068f
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/irp.h
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: irp.h,v 1.4 2005/04/27 04:56:15 sra Exp $
+ */
+
+#ifndef _IRP_H_INCLUDED
+#define _IRP_H_INCLUDED
+
+/*! \file */
+
+#define IRPD_TIMEOUT 30 /*%< seconds */
+#define IRPD_MAXSESS 50 /*%< number of simultaneous sessions. */
+#define IRPD_PORT 6660 /*%< 10 times the number of the beast. */
+#define IRPD_PATH "/var/run/irpd" /*%< af_unix socket path */
+
+/* If sets the environment variable IRPDSERVER to an IP address
+ (e.g. "192.5.5.1"), then that's the host the client expects irpd to be
+ running on. */
+#define IRPD_HOST_ENV "IRPDSERVER"
+
+/* Protocol response codes. */
+#define IRPD_WELCOME_CODE 200
+#define IRPD_NOT_WELCOME_CODE 500
+
+#define IRPD_GETHOST_ERROR 510
+#define IRPD_GETHOST_NONE 210
+#define IRPD_GETHOST_OK 211
+#define IRPD_GETHOST_SETOK 212
+
+#define IRPD_GETNET_ERROR 520
+#define IRPD_GETNET_NONE 220
+#define IRPD_GETNET_OK 221
+#define IRPD_GETNET_SETOK 222
+
+#define IRPD_GETUSER_ERROR 530
+#define IRPD_GETUSER_NONE 230
+#define IRPD_GETUSER_OK 231
+#define IRPD_GETUSER_SETOK 232
+
+#define IRPD_GETGROUP_ERROR 540
+#define IRPD_GETGROUP_NONE 240
+#define IRPD_GETGROUP_OK 241
+#define IRPD_GETGROUP_SETOK 242
+
+#define IRPD_GETSERVICE_ERROR 550
+#define IRPD_GETSERVICE_NONE 250
+#define IRPD_GETSERVICE_OK 251
+#define IRPD_GETSERVICE_SETOK 252
+
+#define IRPD_GETPROTO_ERROR 560
+#define IRPD_GETPROTO_NONE 260
+#define IRPD_GETPROTO_OK 261
+#define IRPD_GETPROTO_SETOK 262
+
+#define IRPD_GETNETGR_ERROR 570
+#define IRPD_GETNETGR_NONE 270
+#define IRPD_GETNETGR_OK 271
+#define IRPD_GETNETGR_NOMORE 272
+#define IRPD_GETNETGR_MATCHES 273
+#define IRPD_GETNETGR_NOMATCH 274
+#define IRPD_GETNETGR_SETOK 275
+#define IRPD_GETNETGR_SETERR 276
+
+#define irs_irp_read_body __irs_irp_read_body
+#define irs_irp_read_response __irs_irp_read_response
+#define irs_irp_disconnect __irs_irp_disconnect
+#define irs_irp_connect __irs_irp_connect
+#define irs_irp_connection_setup __irs_irp_connection_setup
+#define irs_irp_send_command __irs_irp_send_command
+
+struct irp_p;
+
+char *irs_irp_read_body(struct irp_p *, size_t *);
+int irs_irp_read_response(struct irp_p *, char *, size_t);
+void irs_irp_disconnect(struct irp_p *);
+int irs_irp_connect(struct irp_p *);
+int irs_irp_is_connected(struct irp_p *);
+int irs_irp_connection_setup(struct irp_p *, int *);
+#ifdef __GNUC__
+int irs_irp_send_command(struct irp_p *, const char *, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
+#else
+int irs_irp_send_command(struct irp_p *, const char *, ...);
+#endif
+int irs_irp_get_full_response(struct irp_p *, int *, char *, size_t,
+ char **, size_t *);
+int irs_irp_read_line(struct irp_p *, char *, int);
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/irs.h b/usr/src/lib/libresolv2_joy/include/irs.h
new file mode 100644
index 0000000000..386e3cb3f6
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/irs.h
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: irs.h,v 1.5 2005/04/27 04:56:15 sra Exp $
+ */
+
+#ifndef _IRS_H_INCLUDED
+#define _IRS_H_INCLUDED
+
+/*! \file */
+
+#include <sys/types.h>
+
+#include <arpa/nameser.h>
+
+#include <grp.h>
+#include <netdb.h>
+#include <resolv_joy.h>
+#include <pwd.h>
+
+/*%
+ * This is the group map class.
+ */
+struct irs_gr {
+ void * private;
+ void (*close) __P((struct irs_gr *));
+ struct group * (*next) __P((struct irs_gr *));
+ struct group * (*byname) __P((struct irs_gr *, const char *));
+ struct group * (*bygid) __P((struct irs_gr *, gid_t));
+ int (*list) __P((struct irs_gr *, const char *,
+ gid_t, gid_t *, int *));
+ void (*rewind) __P((struct irs_gr *));
+ void (*minimize) __P((struct irs_gr *));
+ struct __res_state * (*res_get) __P((struct irs_gr *));
+ void (*res_set) __P((struct irs_gr *, res_state,
+ void (*)(void *)));
+};
+
+/*%
+ * This is the password map class.
+ */
+struct irs_pw {
+ void * private;
+ void (*close) __P((struct irs_pw *));
+ struct passwd * (*next) __P((struct irs_pw *));
+ struct passwd * (*byname) __P((struct irs_pw *, const char *));
+ struct passwd * (*byuid) __P((struct irs_pw *, uid_t));
+ void (*rewind) __P((struct irs_pw *));
+ void (*minimize) __P((struct irs_pw *));
+ struct __res_state * (*res_get) __P((struct irs_pw *));
+ void (*res_set) __P((struct irs_pw *, res_state,
+ void (*)(void *)));
+};
+
+/*%
+ * This is the service map class.
+ */
+struct irs_sv {
+ void * private;
+ void (*close) __P((struct irs_sv *));
+ struct servent *(*byname) __P((struct irs_sv *,
+ const char *, const char *));
+ struct servent *(*byport) __P((struct irs_sv *, int, const char *));
+ struct servent *(*next) __P((struct irs_sv *));
+ void (*rewind) __P((struct irs_sv *));
+ void (*minimize) __P((struct irs_sv *));
+ struct __res_state * (*res_get) __P((struct irs_sv *));
+ void (*res_set) __P((struct irs_sv *, res_state,
+ void (*)(void *)));
+};
+
+/*%
+ * This is the protocols map class.
+ */
+struct irs_pr {
+ void * private;
+ void (*close) __P((struct irs_pr *));
+ struct protoent *(*byname) __P((struct irs_pr *, const char *));
+ struct protoent *(*bynumber) __P((struct irs_pr *, int));
+ struct protoent *(*next) __P((struct irs_pr *));
+ void (*rewind) __P((struct irs_pr *));
+ void (*minimize) __P((struct irs_pr *));
+ struct __res_state * (*res_get) __P((struct irs_pr *));
+ void (*res_set) __P((struct irs_pr *, res_state,
+ void (*)(void *)));
+};
+
+/*%
+ * This is the hosts map class.
+ */
+struct irs_ho {
+ void * private;
+ void (*close) __P((struct irs_ho *));
+ struct hostent *(*byname) __P((struct irs_ho *, const char *));
+ struct hostent *(*byname2) __P((struct irs_ho *, const char *, int));
+ struct hostent *(*byaddr) __P((struct irs_ho *,
+ const void *, int, int));
+ struct hostent *(*next) __P((struct irs_ho *));
+ void (*rewind) __P((struct irs_ho *));
+ void (*minimize) __P((struct irs_ho *));
+ struct __res_state * (*res_get) __P((struct irs_ho *));
+ void (*res_set) __P((struct irs_ho *, res_state,
+ void (*)(void *)));
+ struct addrinfo *(*addrinfo) __P((struct irs_ho *, const char *,
+ const struct addrinfo *));
+};
+
+/*%
+ * This is the networks map class.
+ */
+struct irs_nw {
+ void * private;
+ void (*close) __P((struct irs_nw *));
+ struct nwent * (*byname) __P((struct irs_nw *, const char *, int));
+ struct nwent * (*byaddr) __P((struct irs_nw *, void *, int, int));
+ struct nwent * (*next) __P((struct irs_nw *));
+ void (*rewind) __P((struct irs_nw *));
+ void (*minimize) __P((struct irs_nw *));
+ struct __res_state * (*res_get) __P((struct irs_nw *));
+ void (*res_set) __P((struct irs_nw *, res_state,
+ void (*)(void *)));
+};
+
+/*%
+ * This is the netgroups map class.
+ */
+struct irs_ng {
+ void * private;
+ void (*close) __P((struct irs_ng *));
+ int (*next) __P((struct irs_ng *, const char **,
+ const char **, const char **));
+ int (*test) __P((struct irs_ng *, const char *,
+ const char *, const char *,
+ const char *));
+ void (*rewind) __P((struct irs_ng *, const char *));
+ void (*minimize) __P((struct irs_ng *));
+};
+
+/*%
+ * This is the generic map class, which copies the front of all others.
+ */
+struct irs_map {
+ void * private;
+ void (*close) __P((void *));
+};
+
+/*%
+ * This is the accessor class. It contains pointers to all of the
+ * initializers for the map classes for a particular accessor.
+ */
+struct irs_acc {
+ void * private;
+ void (*close) __P((struct irs_acc *));
+ struct irs_gr * (*gr_map) __P((struct irs_acc *));
+ struct irs_pw * (*pw_map) __P((struct irs_acc *));
+ struct irs_sv * (*sv_map) __P((struct irs_acc *));
+ struct irs_pr * (*pr_map) __P((struct irs_acc *));
+ struct irs_ho * (*ho_map) __P((struct irs_acc *));
+ struct irs_nw * (*nw_map) __P((struct irs_acc *));
+ struct irs_ng * (*ng_map) __P((struct irs_acc *));
+ struct __res_state * (*res_get) __P((struct irs_acc *));
+ void (*res_set) __P((struct irs_acc *, res_state,
+ void (*)(void *)));
+};
+
+/*%
+ * This is because the official definition of "struct netent" has no
+ * concept of CIDR even though it allows variant address families (on
+ * output but not input). The compatibility stubs convert the structs
+ * below into "struct netent"'s.
+ */
+struct nwent {
+ char *n_name; /*%< official name of net */
+ char **n_aliases; /*%< alias list */
+ int n_addrtype; /*%< net address type */
+ void *n_addr; /*%< network address */
+ int n_length; /*%< address length, in bits */
+};
+
+/*%
+ * Hide external function names from POSIX.
+ */
+#define irs_gen_acc __irs_gen_acc
+#define irs_lcl_acc __irs_lcl_acc
+#define irs_dns_acc __irs_dns_acc
+#define irs_nis_acc __irs_nis_acc
+#define irs_irp_acc __irs_irp_acc
+#define irs_destroy __irs_destroy
+#define irs_dns_gr __irs_dns_gr
+#define irs_dns_ho __irs_dns_ho
+#define irs_dns_nw __irs_dns_nw
+#define irs_dns_pr __irs_dns_pr
+#define irs_dns_pw __irs_dns_pw
+#define irs_dns_sv __irs_dns_sv
+#define irs_gen_gr __irs_gen_gr
+#define irs_gen_ho __irs_gen_ho
+#define irs_gen_ng __irs_gen_ng
+#define irs_gen_nw __irs_gen_nw
+#define irs_gen_pr __irs_gen_pr
+#define irs_gen_pw __irs_gen_pw
+#define irs_gen_sv __irs_gen_sv
+#define irs_irp_get_full_response __irs_irp_get_full_response
+#define irs_irp_gr __irs_irp_gr
+#define irs_irp_ho __irs_irp_ho
+#define irs_irp_is_connected __irs_irp_is_connected
+#define irs_irp_ng __irs_irp_ng
+#define irs_irp_nw __irs_irp_nw
+#define irs_irp_pr __irs_irp_pr
+#define irs_irp_pw __irs_irp_pw
+#define irs_irp_read_line __irs_irp_read_line
+#define irs_irp_sv __irs_irp_sv
+#define irs_lcl_gr __irs_lcl_gr
+#define irs_lcl_ho __irs_lcl_ho
+#define irs_lcl_ng __irs_lcl_ng
+#define irs_lcl_nw __irs_lcl_nw
+#define irs_lcl_pr __irs_lcl_pr
+#define irs_lcl_pw __irs_lcl_pw
+#define irs_lcl_sv __irs_lcl_sv
+#define irs_nis_gr __irs_nis_gr
+#define irs_nis_ho __irs_nis_ho
+#define irs_nis_ng __irs_nis_ng
+#define irs_nis_nw __irs_nis_nw
+#define irs_nis_pr __irs_nis_pr
+#define irs_nis_pw __irs_nis_pw
+#define irs_nis_sv __irs_nis_sv
+#define net_data_create __net_data_create
+#define net_data_destroy __net_data_destroy
+#define net_data_minimize __net_data_minimize
+
+/*%
+ * Externs.
+ */
+extern struct irs_acc * irs_gen_acc __P((const char *, const char *));
+extern struct irs_acc * irs_lcl_acc __P((const char *));
+extern struct irs_acc * irs_dns_acc __P((const char *));
+extern struct irs_acc * irs_nis_acc __P((const char *));
+extern struct irs_acc * irs_irp_acc __P((const char *));
+
+extern void irs_destroy __P((void));
+
+/*%
+ * These forward declarations are for the semi-private functions in
+ * the get*.c files. Each of these funcs implements the real get*
+ * functionality and the standard versions are just wrappers that
+ * call these. Apart from the wrappers, only irpd is expected to
+ * call these directly, hence these decls are put here and not in
+ * the /usr/include replacements.
+ */
+
+struct net_data; /*%< forward */
+/*
+ * net_data_create gets a singleton net_data object. net_data_init
+ * creates as many net_data objects as times it is called. Clients using
+ * the default interface will use net_data_create by default. Servers will
+ * probably want net_data_init (one call per client)
+ */
+struct net_data *net_data_create __P((const char *));
+struct net_data *net_data_init __P((const char *));
+void net_data_destroy __P((void *));
+
+extern struct group *getgrent_p __P((struct net_data *));
+extern struct group *getgrnam_p __P((const char *, struct net_data *));
+extern struct group *getgrgid_p __P((gid_t, struct net_data *));
+extern int setgroupent_p __P((int, struct net_data *));
+extern void endgrent_p __P((struct net_data *));
+extern int getgrouplist_p __P((const char *, gid_t, gid_t *, int *,
+ struct net_data *));
+
+#ifdef SETGRENT_VOID
+extern void setgrent_p __P((struct net_data *));
+#else
+extern int setgrent_p __P((struct net_data *));
+#endif
+
+extern struct hostent *gethostbyname_p __P((const char *,
+ struct net_data *));
+extern struct hostent *gethostbyname2_p __P((const char *, int,
+ struct net_data *));
+extern struct hostent *gethostbyaddr_p __P((const char *, int, int,
+ struct net_data *));
+extern struct hostent *gethostent_p __P((struct net_data *));
+extern void sethostent_p __P((int, struct net_data *));
+extern void endhostent_p __P((struct net_data *));
+extern struct hostent *getipnodebyname_p __P((const char *, int, int, int *,
+ struct net_data *));
+extern struct hostent *getipnodebyaddr_p __P((const void *, size_t,
+ int, int *, struct net_data *));
+
+extern struct netent *getnetent_p __P((struct net_data *));
+extern struct netent *getnetbyname_p __P((const char *, struct net_data *));
+extern struct netent *getnetbyaddr_p __P((unsigned long, int,
+ struct net_data *));
+extern void setnetent_p __P((int, struct net_data *));
+extern void endnetent_p __P((struct net_data *));
+
+extern void setnetgrent_p __P((const char *, struct net_data *));
+extern void endnetgrent_p __P((struct net_data *));
+extern int innetgr_p __P((const char *, const char *, const char *,
+ const char *, struct net_data *));
+extern int getnetgrent_p __P((const char **, const char **,
+ const char **, struct net_data *));
+
+extern struct protoent *getprotoent_p __P((struct net_data *));
+extern struct protoent *getprotobyname_p __P((const char *,
+ struct net_data *));
+extern struct protoent *getprotobynumber_p __P((int, struct net_data *));
+extern void setprotoent_p __P((int, struct net_data *));
+extern void endprotoent_p __P((struct net_data *));
+
+
+extern struct passwd *getpwent_p __P((struct net_data *));
+extern struct passwd *getpwnam_p __P((const char *, struct net_data *));
+extern struct passwd *getpwuid_p __P((uid_t, struct net_data *));
+extern int setpassent_p __P((int, struct net_data *));
+extern void endpwent_p __P((struct net_data *));
+
+#ifdef SETPWENT_VOID
+extern void setpwent_p __P((struct net_data *));
+#else
+extern int setpwent_p __P((struct net_data *));
+#endif
+
+extern struct servent *getservent_p __P((struct net_data *));
+extern struct servent *getservbyname_p __P((const char *, const char *,
+ struct net_data *));
+extern struct servent *getservbyport_p __P((int, const char *,
+ struct net_data *));
+extern void setservent_p __P((int, struct net_data *));
+extern void endservent_p __P((struct net_data *));
+
+#endif /*_IRS_H_INCLUDED*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/assertions.h b/usr/src/lib/libresolv2_joy/include/isc/assertions.h
new file mode 100644
index 0000000000..68925e73b3
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/assertions.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: assertions.h,v 1.5 2008/11/14 02:36:51 marka Exp $
+ */
+
+#ifndef ASSERTIONS_H
+#define ASSERTIONS_H 1
+
+typedef enum {
+ assert_require, assert_ensure, assert_insist, assert_invariant
+} assertion_type;
+
+typedef void (*assertion_failure_callback)(const char *, int, assertion_type,
+ const char *, int);
+
+/* coverity[+kill] */
+extern assertion_failure_callback __assertion_failed;
+void set_assertion_failure_callback(assertion_failure_callback f);
+const char *assertion_type_to_text(assertion_type type);
+
+#if defined(CHECK_ALL) || defined(__COVERITY__)
+#define CHECK_REQUIRE 1
+#define CHECK_ENSURE 1
+#define CHECK_INSIST 1
+#define CHECK_INVARIANT 1
+#endif
+
+#if defined(CHECK_NONE) && !defined(__COVERITY__)
+#define CHECK_REQUIRE 0
+#define CHECK_ENSURE 0
+#define CHECK_INSIST 0
+#define CHECK_INVARIANT 0
+#endif
+
+#ifndef CHECK_REQUIRE
+#define CHECK_REQUIRE 1
+#endif
+
+#ifndef CHECK_ENSURE
+#define CHECK_ENSURE 1
+#endif
+
+#ifndef CHECK_INSIST
+#define CHECK_INSIST 1
+#endif
+
+#ifndef CHECK_INVARIANT
+#define CHECK_INVARIANT 1
+#endif
+
+#if CHECK_REQUIRE != 0
+#define REQUIRE(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_require, \
+ #cond, 0), 0)))
+#define REQUIRE_ERR(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_require, \
+ #cond, 1), 0)))
+#else
+#define REQUIRE(cond) ((void) (cond))
+#define REQUIRE_ERR(cond) ((void) (cond))
+#endif /* CHECK_REQUIRE */
+
+#if CHECK_ENSURE != 0
+#define ENSURE(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_ensure, \
+ #cond, 0), 0)))
+#define ENSURE_ERR(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_ensure, \
+ #cond, 1), 0)))
+#else
+#define ENSURE(cond) ((void) (cond))
+#define ENSURE_ERR(cond) ((void) (cond))
+#endif /* CHECK_ENSURE */
+
+#if CHECK_INSIST != 0
+#define INSIST(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_insist, \
+ #cond, 0), 0)))
+#define INSIST_ERR(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_insist, \
+ #cond, 1), 0)))
+#else
+#define INSIST(cond) ((void) (cond))
+#define INSIST_ERR(cond) ((void) (cond))
+#endif /* CHECK_INSIST */
+
+#if CHECK_INVARIANT != 0
+#define INVARIANT(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_invariant, \
+ #cond, 0), 0)))
+#define INVARIANT_ERR(cond) \
+ ((void) ((cond) || \
+ ((__assertion_failed)(__FILE__, __LINE__, assert_invariant, \
+ #cond, 1), 0)))
+#else
+#define INVARIANT(cond) ((void) (cond))
+#define INVARIANT_ERR(cond) ((void) (cond))
+#endif /* CHECK_INVARIANT */
+#endif /* ASSERTIONS_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/ctl.h b/usr/src/lib/libresolv2_joy/include/isc/ctl.h
new file mode 100644
index 0000000000..e2ba20201d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/ctl.h
@@ -0,0 +1,112 @@
+#ifndef ISC_CTL_H
+#define ISC_CTL_H
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1998,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: ctl.h,v 1.5 2005/04/27 04:56:17 sra Exp $
+ */
+
+/*! \file */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <isc/eventlib.h>
+
+/* Macros. */
+
+#define CTL_MORE 0x0001 /*%< More will be / should be sent. */
+#define CTL_EXIT 0x0002 /*%< Close connection after this. */
+#define CTL_DATA 0x0004 /*%< Go into / this is DATA mode. */
+/* Types. */
+
+struct ctl_cctx;
+struct ctl_sctx;
+struct ctl_sess;
+struct ctl_verb;
+
+enum ctl_severity { ctl_debug, ctl_warning, ctl_error };
+
+typedef void (*ctl_logfunc)(enum ctl_severity, const char *, ...);
+
+typedef void (*ctl_verbfunc)(struct ctl_sctx *, struct ctl_sess *,
+ const struct ctl_verb *, const char *,
+ u_int, const void *, void *);
+
+typedef void (*ctl_srvrdone)(struct ctl_sctx *, struct ctl_sess *, void *);
+
+typedef void (*ctl_clntdone)(struct ctl_cctx *, void *, const char *, u_int);
+
+struct ctl_verb {
+ const char * name;
+ ctl_verbfunc func;
+ const char * help;
+};
+
+/* General symbols. */
+
+#define ctl_logger __ctl_logger
+
+#ifdef __GNUC__
+void ctl_logger(enum ctl_severity, const char *, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
+#else
+void ctl_logger(enum ctl_severity, const char *, ...);
+#endif
+
+/* Client symbols. */
+
+#define ctl_client __ctl_client
+#define ctl_endclient __ctl_endclient
+#define ctl_command __ctl_command
+
+struct ctl_cctx * ctl_client(evContext, const struct sockaddr *, size_t,
+ const struct sockaddr *, size_t,
+ ctl_clntdone, void *,
+ u_int, ctl_logfunc);
+void ctl_endclient(struct ctl_cctx *);
+int ctl_command(struct ctl_cctx *, const char *, size_t,
+ ctl_clntdone, void *);
+
+/* Server symbols. */
+
+#define ctl_server __ctl_server
+#define ctl_endserver __ctl_endserver
+#define ctl_response __ctl_response
+#define ctl_sendhelp __ctl_sendhelp
+#define ctl_getcsctx __ctl_getcsctx
+#define ctl_setcsctx __ctl_setcsctx
+
+struct ctl_sctx * ctl_server(evContext, const struct sockaddr *, size_t,
+ const struct ctl_verb *,
+ u_int, u_int,
+ u_int, int, int,
+ ctl_logfunc, void *);
+void ctl_endserver(struct ctl_sctx *);
+void ctl_response(struct ctl_sess *, u_int,
+ const char *, u_int, const void *,
+ ctl_srvrdone, void *,
+ const char *, size_t);
+void ctl_sendhelp(struct ctl_sess *, u_int);
+void * ctl_getcsctx(struct ctl_sess *);
+void * ctl_setcsctx(struct ctl_sess *, void *);
+
+#endif /*ISC_CTL_H*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/dst.h b/usr/src/lib/libresolv2_joy/include/isc/dst.h
new file mode 100644
index 0000000000..90a9e67468
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/dst.h
@@ -0,0 +1,168 @@
+#ifndef DST_H
+#define DST_H
+
+#ifndef HAS_DST_KEY
+typedef struct dst_key {
+ char *dk_key_name; /*%< name of the key */
+ int dk_key_size; /*%< this is the size of the key in bits */
+ int dk_proto; /*%< what protocols this key can be used for */
+ int dk_alg; /*%< algorithm number from key record */
+ u_int32_t dk_flags; /*%< and the flags of the public key */
+ u_int16_t dk_id; /*%< identifier of the key */
+} DST_KEY;
+#endif /* HAS_DST_KEY */
+/*
+ * do not taint namespace
+ */
+#define dst_bsafe_init __dst_bsafe_init
+#define dst_buffer_to_key __dst_buffer_to_key
+#define dst_check_algorithm __dst_check_algorithm
+#define dst_compare_keys __dst_compare_keys
+#define dst_cylink_init __dst_cylink_init
+#define dst_dnskey_to_key __dst_dnskey_to_key
+#define dst_eay_dss_init __dst_eay_dss_init
+#define dst_free_key __dst_free_key
+#define dst_generate_key __dst_generate_key
+#define dst_hmac_md5_init __dst_hmac_md5_init
+#define dst_init __dst_init
+#define dst_key_to_buffer __dst_key_to_buffer
+#define dst_key_to_dnskey __dst_key_to_dnskey
+#define dst_read_key __dst_read_key
+#define dst_rsaref_init __dst_rsaref_init
+#define dst_s_build_filename __dst_s_build_filename
+#define dst_s_calculate_bits __dst_s_calculate_bits
+#define dst_s_conv_bignum_b64_to_u8 __dst_s_conv_bignum_b64_to_u8
+#define dst_s_conv_bignum_u8_to_b64 __dst_s_conv_bignum_u8_to_b64
+#define dst_s_dns_key_id __dst_s_dns_key_id
+#define dst_s_dump __dst_s_dump
+#define dst_s_filename_length __dst_s_filename_length
+#define dst_s_fopen __dst_s_fopen
+#define dst_s_get_int16 __dst_s_get_int16
+#define dst_s_get_int32 __dst_s_get_int32
+#define dst_s_id_calc __dst_s_id_calc
+#define dst_s_put_int16 __dst_s_put_int16
+#define dst_s_put_int32 __dst_s_put_int32
+#define dst_s_quick_random __dst_s_quick_random
+#define dst_s_quick_random_set __dst_s_quick_random_set
+#define dst_s_random __dst_s_random
+#define dst_s_semi_random __dst_s_semi_random
+#define dst_s_verify_str __dst_s_verify_str
+#define dst_sig_size __dst_sig_size
+#define dst_sign_data __dst_sign_data
+#define dst_verify_data __dst_verify_data
+#define dst_write_key __dst_write_key
+
+/*
+ * DST Crypto API defintions
+ */
+void dst_init(void);
+int dst_check_algorithm(const int);
+
+
+int dst_sign_data(const int, /*!< specifies INIT/UPDATE/FINAL/ALL */
+ DST_KEY *, /*!< the key to use */
+ void **, /*!< pointer to state structure */
+ const u_char *, /*!< data to be signed */
+ const int, /*!< length of input data */
+ u_char *, /*!< buffer to write signature to */
+ const int); /*!< size of output buffer */
+int dst_verify_data(const int, /*!< specifies INIT/UPDATE/FINAL/ALL */
+ DST_KEY *, /*!< the key to use */
+ void **, /*!< pointer to state structure */
+ const u_char *, /*!< data to be verified */
+ const int, /*!< length of input data */
+ const u_char *, /*!< buffer containing signature */
+ const int); /*!< length of signature */
+DST_KEY *dst_read_key(const char *, /*!< name of key */
+ const u_int16_t, /*!< key tag identifier */
+ const int, /*!< key algorithm */
+ const int); /*!< Private/PublicKey wanted */
+int dst_write_key(const DST_KEY *, /*!< key to write out */
+ const int); /*!< Public/Private */
+DST_KEY *dst_dnskey_to_key(const char *, /*!< KEY record name */
+ const u_char *, /*!< KEY RDATA */
+ const int); /*!< size of input buffer */
+int dst_key_to_dnskey(const DST_KEY *, /*!< key to translate */
+ u_char *, /*!< output buffer */
+ const int); /*!< size of out_storage */
+DST_KEY *dst_buffer_to_key(const char *, /*!< name of the key */
+ const int, /*!< algorithm */
+ const int, /*!< dns flags */
+ const int, /*!< dns protocol */
+ const u_char *, /*!< key in dns wire fmt */
+ const int); /*!< size of key */
+int dst_key_to_buffer(DST_KEY *, u_char *, int);
+
+DST_KEY *dst_generate_key(const char *, /*!< name of new key */
+ const int, /*!< key algorithm to generate */
+ const int, /*!< size of new key */
+ const int, /*!< alg dependent parameter */
+ const int, /*!< key DNS flags */
+ const int); /*!< key DNS protocol */
+DST_KEY *dst_free_key(DST_KEY *);
+int dst_compare_keys(const DST_KEY *, const DST_KEY *);
+
+int dst_sig_size(DST_KEY *);
+
+
+/* support for dns key tags/ids */
+u_int16_t dst_s_dns_key_id(const u_char *, const int);
+u_int16_t dst_s_id_calc(const u_char *, const int);
+
+/* Used by callers as well as by the library. */
+#define RAW_KEY_SIZE 8192 /*%< large enough to store any key */
+/* DST_API control flags */
+/* These are used used in functions dst_sign_data and dst_verify_data */
+#define SIG_MODE_INIT 1 /*%< initialize digest */
+#define SIG_MODE_UPDATE 2 /*%< add data to digest */
+#define SIG_MODE_FINAL 4 /*%< generate/verify signature */
+#define SIG_MODE_ALL (SIG_MODE_INIT|SIG_MODE_UPDATE|SIG_MODE_FINAL)
+
+/* Flags for dst_read_private_key() */
+#define DST_FORCE_READ 0x1000000
+#define DST_CAN_SIGN 0x010F
+#define DST_NO_AUTHEN 0x8000
+#define DST_EXTEND_FLAG 0x1000
+#define DST_STANDARD 0
+#define DST_PRIVATE 0x2000000
+#define DST_PUBLIC 0x4000000
+#define DST_RAND_SEMI 1
+#define DST_RAND_STD 2
+#define DST_RAND_KEY 3
+#define DST_RAND_DSS 4
+
+
+/* DST algorithm codes */
+#define KEY_RSA 1
+#define KEY_DH 2
+#define KEY_DSA 3
+#define KEY_PRIVATE 254
+#define KEY_EXPAND 255
+#define KEY_HMAC_MD5 157
+#define KEY_HMAC_SHA1 158
+#define UNKNOWN_KEYALG 0
+#define DST_MAX_ALGS KEY_HMAC_SHA1
+
+/* DST constants to locations in KEY record changes in new KEY record */
+#define DST_FLAGS_SIZE 2
+#define DST_KEY_PROT 2
+#define DST_KEY_ALG 3
+#define DST_EXT_FLAG 4
+#define DST_KEY_START 4
+
+#ifndef SIGN_F_NOKEY
+#define SIGN_F_NOKEY 0xC000
+#endif
+
+/* error codes from dst routines */
+#define SIGN_INIT_FAILURE (-23)
+#define SIGN_UPDATE_FAILURE (-24)
+#define SIGN_FINAL_FAILURE (-25)
+#define VERIFY_INIT_FAILURE (-26)
+#define VERIFY_UPDATE_FAILURE (-27)
+#define VERIFY_FINAL_FAILURE (-28)
+#define MISSING_KEY_OR_SIGNATURE (-30)
+#define UNSUPPORTED_KEYALG (-31)
+
+#endif /* DST_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/eventlib.h b/usr/src/lib/libresolv2_joy/include/isc/eventlib.h
new file mode 100644
index 0000000000..a4cfdf9092
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/eventlib.h
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* eventlib.h - exported interfaces for eventlib
+ * vix 09sep95 [initial]
+ *
+ * $Id: eventlib.h,v 1.7 2008/11/14 02:36:51 marka Exp $
+ */
+
+#ifndef _EVENTLIB_H
+#define _EVENTLIB_H
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/time.h>
+#include <stdio.h>
+
+#include <isc/platform.h>
+
+#ifndef __P
+# define __EVENTLIB_P_DEFINED
+# ifdef __STDC__
+# define __P(x) x
+# else
+# define __P(x) ()
+# endif
+#endif
+
+/* In the absence of branded types... */
+typedef struct { void *opaque; } evConnID;
+typedef struct { void *opaque; } evFileID;
+typedef struct { void *opaque; } evStreamID;
+typedef struct { void *opaque; } evTimerID;
+typedef struct { void *opaque; } evWaitID;
+typedef struct { void *opaque; } evContext;
+typedef struct { void *opaque; } evEvent;
+
+#define evInitID(id) ((id)->opaque = NULL)
+#define evTestID(id) ((id).opaque != NULL)
+
+typedef void (*evConnFunc)__P((evContext, void *, int, const void *, int,
+ const void *, int));
+typedef void (*evFileFunc)__P((evContext, void *, int, int));
+typedef void (*evStreamFunc)__P((evContext, void *, int, int));
+typedef void (*evTimerFunc)__P((evContext, void *,
+ struct timespec, struct timespec));
+typedef void (*evWaitFunc)__P((evContext, void *, const void *));
+
+typedef struct { unsigned char mask[256/8]; } evByteMask;
+#define EV_BYTEMASK_BYTE(b) ((b) / 8)
+#define EV_BYTEMASK_MASK(b) (1 << ((b) % 8))
+#define EV_BYTEMASK_SET(bm, b) \
+ ((bm).mask[EV_BYTEMASK_BYTE(b)] |= EV_BYTEMASK_MASK(b))
+#define EV_BYTEMASK_CLR(bm, b) \
+ ((bm).mask[EV_BYTEMASK_BYTE(b)] &= ~EV_BYTEMASK_MASK(b))
+#define EV_BYTEMASK_TST(bm, b) \
+ ((bm).mask[EV_BYTEMASK_BYTE(b)] & EV_BYTEMASK_MASK(b))
+
+#define EV_POLL 1
+#define EV_WAIT 2
+#define EV_NULL 4
+
+#define EV_READ 1
+#define EV_WRITE 2
+#define EV_EXCEPT 4
+
+#define EV_WASNONBLOCKING 8 /* Internal library use. */
+
+/* eventlib.c */
+#define evCreate __evCreate
+#define evSetDebug __evSetDebug
+#define evDestroy __evDestroy
+#define evGetNext __evGetNext
+#define evDispatch __evDispatch
+#define evDrop __evDrop
+#define evMainLoop __evMainLoop
+#define evHighestFD __evHighestFD
+#define evGetOption __evGetOption
+#define evSetOption __evSetOption
+
+int evCreate __P((evContext *));
+void evSetDebug __P((evContext, int, FILE *));
+int evDestroy __P((evContext));
+int evGetNext __P((evContext, evEvent *, int));
+int evDispatch __P((evContext, evEvent));
+void evDrop __P((evContext, evEvent));
+int evMainLoop __P((evContext));
+int evHighestFD __P((evContext));
+int evGetOption __P((evContext *, const char *, int *));
+int evSetOption __P((evContext *, const char *, int));
+
+/* ev_connects.c */
+#define evListen __evListen
+#define evConnect __evConnect
+#define evCancelConn __evCancelConn
+#define evHold __evHold
+#define evUnhold __evUnhold
+#define evTryAccept __evTryAccept
+
+int evListen __P((evContext, int, int, evConnFunc, void *, evConnID *));
+int evConnect __P((evContext, int, const void *, int,
+ evConnFunc, void *, evConnID *));
+int evCancelConn __P((evContext, evConnID));
+int evHold __P((evContext, evConnID));
+int evUnhold __P((evContext, evConnID));
+int evTryAccept __P((evContext, evConnID, int *));
+
+/* ev_files.c */
+#define evSelectFD __evSelectFD
+#define evDeselectFD __evDeselectFD
+
+int evSelectFD __P((evContext, int, int, evFileFunc, void *, evFileID *));
+int evDeselectFD __P((evContext, evFileID));
+
+/* ev_streams.c */
+#define evConsIovec __evConsIovec
+#define evWrite __evWrite
+#define evRead __evRead
+#define evTimeRW __evTimeRW
+#define evUntimeRW __evUntimeRW
+#define evCancelRW __evCancelRW
+
+struct iovec evConsIovec __P((void *, size_t));
+int evWrite __P((evContext, int, const struct iovec *, int,
+ evStreamFunc func, void *, evStreamID *));
+int evRead __P((evContext, int, const struct iovec *, int,
+ evStreamFunc func, void *, evStreamID *));
+int evTimeRW __P((evContext, evStreamID, evTimerID timer));
+int evUntimeRW __P((evContext, evStreamID));
+int evCancelRW __P((evContext, evStreamID));
+
+/* ev_timers.c */
+#define evConsTime __evConsTime
+#define evAddTime __evAddTime
+#define evSubTime __evSubTime
+#define evCmpTime __evCmpTime
+#define evTimeSpec __evTimeSpec
+#define evTimeVal __evTimeVal
+
+#define evNowTime __evNowTime
+#define evUTCTime __evUTCTime
+#define evLastEventTime __evLastEventTime
+#define evSetTimer __evSetTimer
+#define evClearTimer __evClearTimer
+#define evConfigTimer __evConfigTimer
+#define evResetTimer __evResetTimer
+#define evSetIdleTimer __evSetIdleTimer
+#define evClearIdleTimer __evClearIdleTimer
+#define evResetIdleTimer __evResetIdleTimer
+#define evTouchIdleTimer __evTouchIdleTimer
+
+struct timespec evConsTime __P((time_t sec, long nsec));
+struct timespec evAddTime __P((struct timespec, struct timespec));
+struct timespec evSubTime __P((struct timespec, struct timespec));
+struct timespec evNowTime __P((void));
+struct timespec evUTCTime __P((void));
+struct timespec evLastEventTime __P((evContext));
+struct timespec evTimeSpec __P((struct timeval));
+struct timeval evTimeVal __P((struct timespec));
+int evCmpTime __P((struct timespec, struct timespec));
+int evSetTimer __P((evContext, evTimerFunc, void *, struct timespec,
+ struct timespec, evTimerID *));
+int evClearTimer __P((evContext, evTimerID));
+int evConfigTimer __P((evContext, evTimerID, const char *param,
+ int value));
+int evResetTimer __P((evContext, evTimerID, evTimerFunc, void *,
+ struct timespec, struct timespec));
+int evSetIdleTimer __P((evContext, evTimerFunc, void *, struct timespec,
+ evTimerID *));
+int evClearIdleTimer __P((evContext, evTimerID));
+int evResetIdleTimer __P((evContext, evTimerID, evTimerFunc, void *,
+ struct timespec));
+int evTouchIdleTimer __P((evContext, evTimerID));
+
+/* ev_waits.c */
+#define evWaitFor __evWaitFor
+#define evDo __evDo
+#define evUnwait __evUnwait
+#define evDefer __evDefer
+
+int evWaitFor __P((evContext, const void *, evWaitFunc, void *, evWaitID *));
+int evDo __P((evContext, const void *));
+int evUnwait __P((evContext, evWaitID));
+int evDefer __P((evContext, evWaitFunc, void *));
+
+#ifdef __EVENTLIB_P_DEFINED
+# undef __P
+#endif
+
+#endif /*_EVENTLIB_H*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/heap.h b/usr/src/lib/libresolv2_joy/include/isc/heap.h
new file mode 100644
index 0000000000..384d507cf5
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/heap.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1997,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+typedef int (*heap_higher_priority_func)(void *, void *);
+typedef void (*heap_index_func)(void *, int);
+typedef void (*heap_for_each_func)(void *, void *);
+
+typedef struct heap_context {
+ int array_size;
+ int array_size_increment;
+ int heap_size;
+ void **heap;
+ heap_higher_priority_func higher_priority;
+ heap_index_func index;
+} *heap_context;
+
+#define heap_new __heap_new
+#define heap_free __heap_free
+#define heap_insert __heap_insert
+#define heap_delete __heap_delete
+#define heap_increased __heap_increased
+#define heap_decreased __heap_decreased
+#define heap_element __heap_element
+#define heap_for_each __heap_for_each
+
+heap_context heap_new(heap_higher_priority_func, heap_index_func, int);
+int heap_free(heap_context);
+int heap_insert(heap_context, void *);
+int heap_delete(heap_context, int);
+int heap_increased(heap_context, int);
+int heap_decreased(heap_context, int);
+void * heap_element(heap_context, int);
+int heap_for_each(heap_context, heap_for_each_func, void *);
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/irpmarshall.h b/usr/src/lib/libresolv2_joy/include/isc/irpmarshall.h
new file mode 100644
index 0000000000..244b3e3460
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/irpmarshall.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: irpmarshall.h,v 1.4 2005/04/27 04:56:17 sra Exp $
+ */
+
+#ifndef _IRPMARSHALL_H_INCLUDED
+#define _IRPMARSHALL_H_INCLUDED
+
+/* Hide function names */
+#define irp_marshall_gr __irp_marshall_gr
+#define irp_marshall_ho __irp_marshall_ho
+#define irp_marshall_ne __irp_marshall_ne
+#define irp_marshall_ng __irp_marshall_ng
+#define irp_marshall_nw __irp_marshall_nw
+#define irp_marshall_pr __irp_marshall_pr
+#define irp_marshall_pw __irp_marshall_pw
+#define irp_marshall_sv __irp_marshall_sv
+#define irp_unmarshall_gr __irp_unmarshall_gr
+#define irp_unmarshall_ho __irp_unmarshall_ho
+#define irp_unmarshall_ne __irp_unmarshall_ne
+#define irp_unmarshall_ng __irp_unmarshall_ng
+#define irp_unmarshall_nw __irp_unmarshall_nw
+#define irp_unmarshall_pr __irp_unmarshall_pr
+#define irp_unmarshall_pw __irp_unmarshall_pw
+#define irp_unmarshall_sv __irp_unmarshall_sv
+
+#define MAXPADDRSIZE (sizeof "255.255.255.255" + 1)
+#define ADDR_T_STR(x) (x == AF_INET ? "AF_INET" :\
+ (x == AF_INET6 ? "AF_INET6" : "UNKNOWN"))
+
+/* See comment below on usage */
+int irp_marshall_pw(const struct passwd *, char **, size_t *);
+int irp_unmarshall_pw(struct passwd *, char *);
+int irp_marshall_gr(const struct group *, char **, size_t *);
+int irp_unmarshall_gr(struct group *, char *);
+int irp_marshall_sv(const struct servent *, char **, size_t *);
+int irp_unmarshall_sv(struct servent *, char *);
+int irp_marshall_pr(struct protoent *, char **, size_t *);
+int irp_unmarshall_pr(struct protoent *, char *);
+int irp_marshall_ho(struct hostent *, char **, size_t *);
+int irp_unmarshall_ho(struct hostent *, char *);
+int irp_marshall_ng(const char *, const char *, const char *,
+ char **, size_t *);
+int irp_unmarshall_ng(const char **, const char **, const char **, char *);
+int irp_marshall_nw(struct nwent *, char **, size_t *);
+int irp_unmarshall_nw(struct nwent *, char *);
+int irp_marshall_ne(struct netent *, char **, size_t *);
+int irp_unmarshall_ne(struct netent *, char *);
+
+/*! \file
+ * \brief
+ * Functions to marshall and unmarshall various system data structures. We
+ * use a printable ascii format that is as close to various system config
+ * files as reasonable (e.g. /etc/passwd format).
+ *
+ * We are not forgiving with unmarhsalling misformatted buffers. In
+ * particular whitespace in fields is not ignored. So a formatted password
+ * entry "brister :1364:100:...." will yield a username of "brister "
+ *
+ * We potentially do a lot of mallocs to fill fields that are of type
+ * (char **) like a hostent h_addr field. Building (for example) the
+ * h_addr field and its associated addresses all in one buffer is
+ * certainly possible, but not done here.
+ *
+ * The following description is true for all the marshalling functions:
+ *
+ * int irp_marshall_XX(struct yyyy *XX, char **buffer, size_t *len);
+ *
+ * The argument XX (of type struct passwd for example) is marshalled in the
+ * buffer pointed at by *BUFFER, which is of length *LEN. Returns 0
+ * on success and -1 on failure. Failure will occur if *LEN is
+ * smaller than needed.
+ *
+ * If BUFFER is NULL, then *LEN is set to the size of the buffer
+ * needed to marshall the data and no marshalling is actually done.
+ *
+ * If *BUFFER is NULL, then a buffer large enough will be allocated
+ * with memget() and the size allocated will be stored in *LEN. An extra 2
+ * bytes will be allocated for the client to append CRLF if wanted. The
+ * value of *LEN will include these two bytes.
+ *
+ * All the marshalling functions produce a buffer with the fields
+ * separated by colons (except for the hostent marshalling, which uses '@'
+ * to separate fields). Fields that have multiple subfields (like the
+ * gr_mem field in struct group) have their subparts separated by
+ * commas.
+ *
+ * int irp_unmarshall_XX(struct YYYYY *XX, char *buffer);
+ *
+ * The unmashalling functions break apart the buffer and store the
+ * values in the struct pointed to by XX. All pointer values inside
+ * XX are allocated with malloc. All arrays of pointers have a NULL
+ * as the last element.
+ */
+
+#endif
diff --git a/usr/src/lib/libresolv2_joy/include/isc/list.h b/usr/src/lib/libresolv2_joy/include/isc/list.h
new file mode 100644
index 0000000000..5fe9031141
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/list.h
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1997,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef LIST_H
+#define LIST_H 1
+#include <isc/assertions.h>
+
+#define LIST(type) struct { type *head, *tail; }
+#define INIT_LIST(list) \
+ do { (list).head = NULL; (list).tail = NULL; } while (0)
+
+#define LINK(type) struct { type *prev, *next; }
+#define INIT_LINK_TYPE(elt, link, type) \
+ do { \
+ (elt)->link.prev = (type *)(-1); \
+ (elt)->link.next = (type *)(-1); \
+ } while (0)
+#define INIT_LINK(elt, link) \
+ INIT_LINK_TYPE(elt, link, void)
+#define LINKED(elt, link) ((void *)((elt)->link.prev) != (void *)(-1) && \
+ (void *)((elt)->link.next) != (void *)(-1))
+
+#define HEAD(list) ((list).head)
+#define TAIL(list) ((list).tail)
+#define EMPTY(list) ((list).head == NULL)
+
+#define PREPEND(list, elt, link) \
+ do { \
+ INSIST(!LINKED(elt, link));\
+ if ((list).head != NULL) \
+ (list).head->link.prev = (elt); \
+ else \
+ (list).tail = (elt); \
+ (elt)->link.prev = NULL; \
+ (elt)->link.next = (list).head; \
+ (list).head = (elt); \
+ } while (0)
+
+#define APPEND(list, elt, link) \
+ do { \
+ INSIST(!LINKED(elt, link));\
+ if ((list).tail != NULL) \
+ (list).tail->link.next = (elt); \
+ else \
+ (list).head = (elt); \
+ (elt)->link.prev = (list).tail; \
+ (elt)->link.next = NULL; \
+ (list).tail = (elt); \
+ } while (0)
+
+#define UNLINK_TYPE(list, elt, link, type) \
+ do { \
+ INSIST(LINKED(elt, link));\
+ if ((elt)->link.next != NULL) \
+ (elt)->link.next->link.prev = (elt)->link.prev; \
+ else { \
+ INSIST((list).tail == (elt)); \
+ (list).tail = (elt)->link.prev; \
+ } \
+ if ((elt)->link.prev != NULL) \
+ (elt)->link.prev->link.next = (elt)->link.next; \
+ else { \
+ INSIST((list).head == (elt)); \
+ (list).head = (elt)->link.next; \
+ } \
+ INIT_LINK_TYPE(elt, link, type); \
+ } while (0)
+#define UNLINK(list, elt, link) \
+ UNLINK_TYPE(list, elt, link, void)
+
+#define PREV(elt, link) ((elt)->link.prev)
+#define NEXT(elt, link) ((elt)->link.next)
+
+#define INSERT_BEFORE(list, before, elt, link) \
+ do { \
+ INSIST(!LINKED(elt, link));\
+ if ((before)->link.prev == NULL) \
+ PREPEND(list, elt, link); \
+ else { \
+ (elt)->link.prev = (before)->link.prev; \
+ (before)->link.prev = (elt); \
+ (elt)->link.prev->link.next = (elt); \
+ (elt)->link.next = (before); \
+ } \
+ } while (0)
+
+#define INSERT_AFTER(list, after, elt, link) \
+ do { \
+ INSIST(!LINKED(elt, link));\
+ if ((after)->link.next == NULL) \
+ APPEND(list, elt, link); \
+ else { \
+ (elt)->link.next = (after)->link.next; \
+ (after)->link.next = (elt); \
+ (elt)->link.next->link.prev = (elt); \
+ (elt)->link.prev = (after); \
+ } \
+ } while (0)
+
+#define ENQUEUE(list, elt, link) APPEND(list, elt, link)
+#define DEQUEUE(list, elt, link) UNLINK(list, elt, link)
+
+#endif /* LIST_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/logging.h b/usr/src/lib/libresolv2_joy/include/isc/logging.h
new file mode 100644
index 0000000000..c539443ff8
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/logging.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef LOGGING_H
+#define LOGGING_H
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+
+#define log_critical (-5)
+#define log_error (-4)
+#define log_warning (-3)
+#define log_notice (-2)
+#define log_info (-1)
+#define log_debug(level) (level)
+
+typedef enum { log_syslog, log_file, log_null } log_channel_type;
+
+#define LOG_MAX_VERSIONS 99
+
+#define LOG_CLOSE_STREAM 0x0001
+#define LOG_TIMESTAMP 0x0002
+#define LOG_TRUNCATE 0x0004
+#define LOG_USE_CONTEXT_LEVEL 0x0008
+#define LOG_PRINT_LEVEL 0x0010
+#define LOG_REQUIRE_DEBUG 0x0020
+#define LOG_CHANNEL_BROKEN 0x0040
+#define LOG_PRINT_CATEGORY 0x0080
+#define LOG_CHANNEL_OFF 0x0100
+
+typedef struct log_context *log_context;
+typedef struct log_channel *log_channel;
+
+#define LOG_OPTION_DEBUG 0x01
+#define LOG_OPTION_LEVEL 0x02
+
+#define log_open_stream __log_open_stream
+#define log_close_stream __log_close_stream
+#define log_get_stream __log_get_stream
+#define log_get_filename __log_get_filename
+#define log_check_channel __log_check_channel
+#define log_check __log_check
+#define log_vwrite __log_vwrite
+#define log_write __log_write
+#define log_new_context __log_new_context
+#define log_free_context __log_free_context
+#define log_add_channel __log_add_channel
+#define log_remove_channel __log_remove_channel
+#define log_option __log_option
+#define log_category_is_active __log_category_is_active
+#define log_new_syslog_channel __log_new_syslog_channel
+#define log_new_file_channel __log_new_file_channel
+#define log_set_file_owner __log_set_file_owner
+#define log_new_null_channel __log_new_null_channel
+#define log_inc_references __log_inc_references
+#define log_dec_references __log_dec_references
+#define log_get_channel_type __log_get_channel_type
+#define log_free_channel __log_free_channel
+#define log_close_debug_channels __log_close_debug_channels
+
+FILE * log_open_stream(log_channel);
+int log_close_stream(log_channel);
+FILE * log_get_stream(log_channel);
+char * log_get_filename(log_channel);
+int log_check_channel(log_context, int, log_channel);
+int log_check(log_context, int, int);
+#ifdef __GNUC__
+void log_vwrite(log_context, int, int, const char *,
+ va_list args)
+ __attribute__((__format__(__printf__, 4, 0)));
+void log_write(log_context, int, int, const char *, ...)
+ __attribute__((__format__(__printf__, 4, 5)));
+#else
+void log_vwrite(log_context, int, int, const char *,
+ va_list args);
+void log_write(log_context, int, int, const char *, ...);
+#endif
+int log_new_context(int, char **, log_context *);
+void log_free_context(log_context);
+int log_add_channel(log_context, int, log_channel);
+int log_remove_channel(log_context, int, log_channel);
+int log_option(log_context, int, int);
+int log_category_is_active(log_context, int);
+log_channel log_new_syslog_channel(unsigned int, int, int);
+log_channel log_new_file_channel(unsigned int, int, const char *,
+ FILE *, unsigned int,
+ unsigned long);
+int log_set_file_owner(log_channel, uid_t, gid_t);
+log_channel log_new_null_channel(void);
+int log_inc_references(log_channel);
+int log_dec_references(log_channel);
+log_channel_type log_get_channel_type(log_channel);
+int log_free_channel(log_channel);
+void log_close_debug_channels(log_context);
+
+#endif /* !LOGGING_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/memcluster.h b/usr/src/lib/libresolv2_joy/include/isc/memcluster.h
new file mode 100644
index 0000000000..0923deb5e7
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/memcluster.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1997,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef MEMCLUSTER_H
+#define MEMCLUSTER_H
+
+#include <stdio.h>
+
+#define meminit __meminit
+#ifdef MEMCLUSTER_DEBUG
+#define memget(s) __memget_debug(s, __FILE__, __LINE__)
+#define memput(p, s) __memput_debug(p, s, __FILE__, __LINE__)
+#else /*MEMCLUSTER_DEBUG*/
+#ifdef MEMCLUSTER_RECORD
+#define memget(s) __memget_record(s, __FILE__, __LINE__)
+#define memput(p, s) __memput_record(p, s, __FILE__, __LINE__)
+#else /*MEMCLUSTER_RECORD*/
+#define memget __memget
+#define memput __memput
+#endif /*MEMCLUSTER_RECORD*/
+#endif /*MEMCLUSTER_DEBUG*/
+#define memstats __memstats
+#define memactive __memactive
+
+int meminit(size_t, size_t);
+void * __memget(size_t);
+void __memput(void *, size_t);
+void * __memget_debug(size_t, const char *, int);
+void __memput_debug(void *, size_t, const char *, int);
+void * __memget_record(size_t, const char *, int);
+void __memput_record(void *, size_t, const char *, int);
+void memstats(FILE *);
+int memactive(void);
+
+#endif /* MEMCLUSTER_H */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/misc.h b/usr/src/lib/libresolv2_joy/include/isc/misc.h
new file mode 100644
index 0000000000..b54f4ee6ed
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/misc.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1995-2001, 2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: misc.h,v 1.7 2008/11/14 02:36:51 marka Exp $
+ */
+
+#ifndef _ISC_MISC_H
+#define _ISC_MISC_H
+
+/*! \file */
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#define bitncmp __bitncmp
+/*#define isc_movefile __isc_movefile */
+
+extern int bitncmp(const void *, const void *, int);
+extern int isc_movefile(const char *, const char *);
+
+extern int isc_gethexstring(unsigned char *, size_t, int, FILE *,
+ int *);
+extern void isc_puthexstring(FILE *, const unsigned char *, size_t,
+ size_t, size_t, const char *);
+extern void isc_tohex(const unsigned char *, size_t, char *);
+
+#endif /*_ISC_MISC_H*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/isc/platform.h b/usr/src/lib/libresolv2_joy/include/isc/platform.h
new file mode 100644
index 0000000000..2fc59b61a8
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/platform.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: platform.h.in,v 1.3 2008/01/23 02:15:56 tbox Exp $ */
+
+/*! \file */
+
+#ifndef ISC_PLATFORM_H
+#define ISC_PLATFORM_H
+
+/*
+ * Define if the OS does not define struct timespec.
+ */
+#undef ISC_PLATFORM_NEEDTIMESPEC
+#ifdef ISC_PLATFORM_NEEDTIMESPEC
+#include <time.h> /* For time_t */
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+
+#endif
diff --git a/usr/src/lib/libresolv2_joy/include/isc/tree.h b/usr/src/lib/libresolv2_joy/include/isc/tree.h
new file mode 100644
index 0000000000..96feaca68d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/isc/tree.h
@@ -0,0 +1,59 @@
+/* tree.h - declare structures used by tree library
+ *
+ * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes]
+ * vix 27jun86 [broken out of tree.c]
+ *
+ * $Id: tree.h,v 1.3 2005/04/27 04:56:18 sra Exp $
+ */
+
+
+#ifndef _TREE_H_INCLUDED
+#define _TREE_H_INCLUDED
+
+
+#ifndef __P
+# if defined(__STDC__) || defined(__GNUC__)
+# define __P(x) x
+# else
+# define __P(x) ()
+# endif
+#endif
+
+/*%
+ * tree_t is our package-specific anonymous pointer.
+ */
+#if defined(__STDC__) || defined(__GNUC__)
+typedef void *tree_t;
+#else
+typedef char *tree_t;
+#endif
+
+/*%
+ * Do not taint namespace
+ */
+#define tree_add __tree_add
+#define tree_delete __tree_delete
+#define tree_init __tree_init
+#define tree_mung __tree_mung
+#define tree_srch __tree_srch
+#define tree_trav __tree_trav
+
+
+typedef struct tree_s {
+ tree_t data;
+ struct tree_s *left, *right;
+ short bal;
+ }
+ tree;
+
+
+void tree_init __P((tree **));
+tree_t tree_srch __P((tree **, int (*)(), tree_t));
+tree_t tree_add __P((tree **, int (*)(), tree_t, void (*)()));
+int tree_delete __P((tree **, int (*)(), tree_t, void (*)()));
+int tree_trav __P((tree **, int (*)()));
+void tree_mung __P((tree **, void (*)()));
+
+
+#endif /* _TREE_H_INCLUDED */
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/make_os_version b/usr/src/lib/libresolv2_joy/include/make_os_version
new file mode 100755
index 0000000000..3654490fee
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/make_os_version
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Copyright (c) 1999 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+UNAME_R=`/usr/bin/uname -r`
+
+OS_MAJOR=`echo $UNAME_R | /usr/bin/sed -e 's/^\([^.]*\).*/\1/'`
+OS_MINOR=`echo $UNAME_R | /usr/bin/sed -e 's/^[^.]*\.\([^.]*\).*/\1/'`
+OS_VERSION=`echo $UNAME_R | tr '.' '_'`
+
+cat <<EOF > new_os_version.h
+#ifndef OS_VERSION_H
+#define OS_VERSION_H
+
+#define SUNOS_$OS_VERSION
+#define OS_MAJOR $OS_MAJOR
+#define OS_MINOR $OS_MINOR
+
+#endif
+EOF
+
+if [ -f os_version.h ]; then
+ if /usr/bin/cmp -s new_os_version.h os_version.h; then
+ /usr/bin/rm -f new_os_version.h
+ else
+ /usr/bin/rm -f os_version.h
+ /usr/bin/mv new_os_version.h os_version.h
+ fi
+else
+ /usr/bin/mv new_os_version.h os_version.h
+fi
diff --git a/usr/src/lib/libresolv2_joy/include/make_os_version.sh b/usr/src/lib/libresolv2_joy/include/make_os_version.sh
new file mode 100644
index 0000000000..3654490fee
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/make_os_version.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Copyright (c) 1999 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+UNAME_R=`/usr/bin/uname -r`
+
+OS_MAJOR=`echo $UNAME_R | /usr/bin/sed -e 's/^\([^.]*\).*/\1/'`
+OS_MINOR=`echo $UNAME_R | /usr/bin/sed -e 's/^[^.]*\.\([^.]*\).*/\1/'`
+OS_VERSION=`echo $UNAME_R | tr '.' '_'`
+
+cat <<EOF > new_os_version.h
+#ifndef OS_VERSION_H
+#define OS_VERSION_H
+
+#define SUNOS_$OS_VERSION
+#define OS_MAJOR $OS_MAJOR
+#define OS_MINOR $OS_MINOR
+
+#endif
+EOF
+
+if [ -f os_version.h ]; then
+ if /usr/bin/cmp -s new_os_version.h os_version.h; then
+ /usr/bin/rm -f new_os_version.h
+ else
+ /usr/bin/rm -f os_version.h
+ /usr/bin/mv new_os_version.h os_version.h
+ fi
+else
+ /usr/bin/mv new_os_version.h os_version.h
+fi
diff --git a/usr/src/lib/libresolv2_joy/include/port_after.h b/usr/src/lib/libresolv2_joy/include/port_after.h
new file mode 100644
index 0000000000..c3abf4b334
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/port_after.h
@@ -0,0 +1,539 @@
+/*
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/*
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001-2003 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: port_after.h.in,v 1.60 2008/02/28 05:34:17 marka Exp $ */
+
+#ifndef port_after_h
+#define port_after_h
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#if (!defined(BSD)) || (BSD < 199306)
+#include <sys/bitypes.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif /* HAVE_SYS_SELECT_H */
+
+#ifdef REENABLE_SEND
+#undef send
+#endif
+
+#undef NEED_PSELECT
+#undef HAVE_SA_LEN
+#undef HAVE_MINIMUM_IFREQ
+#define NEED_DAEMON 1
+#undef NEED_STRSEP
+#undef NEED_STRERROR
+#ifdef NEED_STRERROR
+const char *isc_strerror(int);
+#define strerror isc_strerror
+#endif
+/* HAS_INET6_STRUCTS and HAVE_SIN6_SCOPE_ID are defined by port_ipv6.h
+ * #define HAS_INET6_STRUCTS 1
+ * #define HAVE_SIN6_SCOPE_ID 1
+ */
+#include <port_ipv6.h>
+
+#undef NEED_IN6ADDR_ANY
+#undef HAS_IN_ADDR6
+#define HAVE_SOCKADDR_STORAGE 1
+#undef NEED_GETTIMEOFDAY
+#define HAVE_STRNDUP
+#undef USE_FIONBIO_IOCTL
+#undef INNETGR_ARGS
+
+#undef USE_IFNAMELINKID
+#define PORT_NONBLOCK O_NONBLOCK
+
+#ifndef _POSIX_PATH_MAX
+#define _POSIX_PATH_MAX 255
+#endif
+#ifndef PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+/*
+ * We need to know the IPv6 address family number even on IPv4-only systems.
+ * Note that this is NOT a protocol constant, and that if the system has its
+ * own AF_INET6, different from ours below, all of BIND's libraries and
+ * executables will need to be recompiled after the system <sys/socket.h>
+ * has had this type added. The type number below is correct on most BSD-
+ * derived systems for which AF_INET6 is defined.
+ */
+#ifndef AF_INET6
+#define AF_INET6 24
+#endif
+
+#ifndef PF_INET6
+#define PF_INET6 AF_INET6
+#endif
+
+#ifdef HAS_IN_ADDR6
+/* Map to pre-RFC structure. */
+#define in6_addr in_addr6
+#endif
+
+#ifndef HAS_INET6_STRUCTS
+/* Replace with structure from later rev of O/S if known. */
+struct in6_addr {
+ u_int8_t s6_addr[16];
+};
+
+#define IN6ADDR_ANY_INIT \
+ {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}
+
+#define IN6ADDR_LOOPBACK_INIT \
+ {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}
+
+/* Replace with structure from later rev of O/S if known. */
+struct sockaddr_in6 {
+#ifdef HAVE_SA_LEN
+ u_int8_t sin6_len; /* length of this struct */
+ u_int8_t sin6_family; /* AF_INET6 */
+#else
+ u_int16_t sin6_family; /* AF_INET6 */
+#endif
+ u_int16_t sin6_port; /* transport layer port # */
+ u_int32_t sin6_flowinfo; /* IPv6 flow information */
+ struct in6_addr sin6_addr; /* IPv6 address */
+ u_int32_t sin6_scope_id; /* set of interfaces for a scope */
+};
+#endif /* HAS_INET6_STRUCTS */
+
+#ifdef BROKEN_IN6ADDR_INIT_MACROS
+#undef IN6ADDR_ANY_INIT
+#undef IN6ADDR_LOOPBACK_INIT
+#endif
+
+#ifdef _AIX
+#ifndef IN6ADDR_ANY_INIT
+#define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0 }}}
+#endif
+#ifndef IN6ADDR_LOOPBACK_INIT
+#if BYTE_ORDER == BIG_ENDIAN
+#define IN6ADDR_LOOPBACK_INIT {{{ 0, 0, 0, 1 }}}
+#else
+#define IN6ADDR_LOOPBACK_INIT {{{0, 0, 0, 0x01000000}}}
+#endif
+#endif
+#endif
+
+#ifndef IN6ADDR_ANY_INIT
+#ifdef s6_addr
+#define IN6ADDR_ANY_INIT \
+ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
+#else
+#define IN6ADDR_ANY_INIT \
+ {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}
+#endif
+
+#endif
+#ifndef IN6ADDR_LOOPBACK_INIT
+#ifdef s6_addr
+#define IN6ADDR_LOOPBACK_INIT \
+ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
+#else
+#define IN6ADDR_LOOPBACK_INIT \
+ {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}
+#endif
+#endif
+
+#ifndef HAVE_SOCKADDR_STORAGE
+#define __SS_MAXSIZE 128
+#define __SS_ALLIGSIZE (sizeof (long))
+
+struct sockaddr_storage {
+#ifdef HAVE_SA_LEN
+ u_int8_t ss_len; /* address length */
+ u_int8_t ss_family; /* address family */
+ char __ss_pad1[__SS_ALLIGSIZE - 2 * sizeof(u_int8_t)];
+ long __ss_align;
+ char __ss_pad2[__SS_MAXSIZE - 2 * __SS_ALLIGSIZE];
+#else
+ u_int16_t ss_family; /* address family */
+ char __ss_pad1[__SS_ALLIGSIZE - sizeof(u_int16_t)];
+ long __ss_align;
+ char __ss_pad2[__SS_MAXSIZE - 2 * __SS_ALLIGSIZE];
+#endif
+};
+#endif
+
+
+#if !defined(HAS_INET6_STRUCTS) || defined(NEED_IN6ADDR_ANY)
+#define in6addr_any isc_in6addr_any
+extern const struct in6_addr in6addr_any;
+#endif
+
+/*
+ * IN6_ARE_ADDR_EQUAL, IN6_IS_ADDR_UNSPECIFIED, IN6_IS_ADDR_V4COMPAT and
+ * IN6_IS_ADDR_V4MAPPED are broken in glibc 2.1.
+ */
+#ifdef __GLIBC__
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
+#undef IN6_ARE_ADDR_EQUAL
+#undef IN6_IS_ADDR_UNSPECIFIED
+#undef IN6_IS_ADDR_V4COMPAT
+#undef IN6_IS_ADDR_V4MAPPED
+#endif
+#endif
+
+#ifndef IN6_ARE_ADDR_EQUAL
+#define IN6_ARE_ADDR_EQUAL(a,b) \
+ (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
+#endif
+
+#ifndef IN6_IS_ADDR_UNSPECIFIED
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
+ IN6_ARE_ADDR_EQUAL(a, &in6addr_any)
+#endif
+
+#ifndef IN6_IS_ADDR_LOOPBACK
+extern const struct in6_addr isc_in6addr_loopback;
+#define IN6_IS_ADDR_LOOPBACK(a) \
+ IN6_ARE_ADDR_EQUAL(a, &isc_in6addr_loopback)
+#endif
+
+#ifndef IN6_IS_ADDR_V4MAPPED
+#define IN6_IS_ADDR_V4MAPPED(a) \
+ ((a)->s6_addr[0] == 0x00 && (a)->s6_addr[1] == 0x00 && \
+ (a)->s6_addr[2] == 0x00 && (a)->s6_addr[3] == 0x00 && \
+ (a)->s6_addr[4] == 0x00 && (a)->s6_addr[5] == 0x00 && \
+ (a)->s6_addr[6] == 0x00 && (a)->s6_addr[9] == 0x00 && \
+ (a)->s6_addr[8] == 0x00 && (a)->s6_addr[9] == 0x00 && \
+ (a)->s6_addr[10] == 0xff && (a)->s6_addr[11] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_SITELOCAL
+#define IN6_IS_ADDR_SITELOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
+#endif
+
+#ifndef IN6_IS_ADDR_LINKLOCAL
+#define IN6_IS_ADDR_LINKLOCAL(a) \
+ (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
+#endif
+
+#ifndef IN6_IS_ADDR_MULTICAST
+#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
+#endif
+
+#ifndef __IPV6_ADDR_MC_SCOPE
+#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
+#endif
+
+#ifndef __IPV6_ADDR_SCOPE_SITELOCAL
+#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
+#endif
+#ifndef __IPV6_ADDR_SCOPE_ORGLOCAL
+#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08
+#endif
+
+#ifndef IN6_IS_ADDR_MC_SITELOCAL
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) && \
+ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
+#endif
+
+#ifndef IN6_IS_ADDR_MC_ORGLOCAL
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+ (IN6_IS_ADDR_MULTICAST(a) && \
+ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
+#endif
+
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xffffffff
+#endif
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
+#ifndef INET6_ADDRSTRLEN
+/* sizeof("aaaa:bbbb:cccc:dddd:eeee:ffff:123.123.123.123") */
+#define INET6_ADDRSTRLEN 46
+#endif
+
+#ifndef MIN
+#define MIN(x,y) (((x) <= (y)) ? (x) : (y))
+#endif
+
+#ifndef MAX
+#define MAX(x,y) (((x) >= (y)) ? (x) : (y))
+#endif
+
+#ifdef NEED_DAEMON
+int daemon(int nochdir, int noclose);
+#endif
+
+#ifdef NEED_STRSEP
+char * strsep(char **stringp, const char *delim);
+#endif
+
+#ifndef ALIGN
+#define ALIGN(p) (((uintptr_t)(p) + (sizeof(long) - 1)) & ~(sizeof(long) - 1))
+#endif
+
+#ifdef NEED_SETGROUPENT
+int setgroupent(int stayopen);
+#endif
+
+#ifdef NEED_GETGROUPLIST
+int getgrouplist(GETGROUPLIST_ARGS);
+#endif
+
+#ifdef POSIX_GETGRNAM_R
+int
+__posix_getgrnam_r(const char *, struct group *, char *, int, struct group **);
+#endif
+
+#ifdef NEED_GETGRNAM_R
+int
+getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+#endif
+
+#ifdef POSIX_GETGRGID_R
+int
+__posix_getgrgid_r(gid_t, struct group *, char *, int, struct group **) ;
+#endif
+
+#ifdef NEED_GETGRGID_R
+int
+getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
+#endif
+
+#ifdef NEED_GETGRENT_R
+GROUP_R_RETURN getgrent_r(struct group *gptr, GROUP_R_ARGS);
+#endif
+
+#ifdef NEED_SETGRENT_R
+GROUP_R_SET_RETURN setgrent_r(GROUP_R_ENT_ARGS);
+#endif
+
+#ifdef NEED_ENDGRENT_R
+GROUP_R_END_RETURN endgrent_r(GROUP_R_ENT_ARGS);
+#endif
+
+#if defined(NEED_INNETGR_R) && defined(NGR_R_RETURN)
+NGR_R_RETURN
+innetgr_r(const char *, const char *, const char *, const char *);
+#endif
+
+#ifdef NEED_SETNETGRENT_R
+#ifdef NGR_R_SET_ARGS
+NGR_R_SET_RETURN setnetgrent_r(NGR_R_SET_CONST char *netgroup, NGR_R_SET_ARGS);
+#else
+NGR_R_SET_RETURN setnetgrent_r(NGR_R_SET_CONST char *netgroup);
+#endif
+#endif
+
+#ifdef NEED_ENDNETGRENT_R
+#ifdef NGR_R_END_ARGS
+NGR_R_END_RETURN endnetgrent_r(NGR_R_END_ARGS);
+#else
+NGR_R_END_RETURN endnetgrent_r(void);
+#endif
+#endif
+
+#ifdef POSIX_GETPWNAM_R
+int
+__posix_getpwnam_r(const char *login, struct passwd *pwptr,
+ char *buf, size_t buflen, struct passwd **result);
+#endif
+
+#ifdef NEED_GETPWNAM_R
+int
+getpwnam_r(const char *login, struct passwd *pwptr,
+ char *buf, size_t buflen, struct passwd **result);
+#endif
+
+#ifdef POSIX_GETPWUID_R
+int
+__posix_getpwuid_r(uid_t uid, struct passwd *pwptr,
+ char *buf, int buflen, struct passwd **result);
+#endif
+
+#ifdef NEED_GETPWUID_R
+int
+getpwuid_r(uid_t uid, struct passwd *pwptr,
+ char *buf, size_t buflen, struct passwd **result);
+#endif
+
+#ifdef NEED_SETPWENT_R
+#ifdef PASS_R_ENT_ARGS
+PASS_R_SET_RETURN setpwent_r(PASS_R_ENT_ARGS);
+#else
+PASS_R_SET_RETURN setpwent_r(void);
+#endif
+
+#endif
+
+#ifdef NEED_SETPASSENT_R
+#ifdef PASS_R_ENT_ARGS
+PASS_R_SET_RETURN setpassent_r(int stayopen, PASS_R_ENT_ARGS);
+#else
+PASS_R_SET_RETURN setpassent_r(int stayopen);
+#endif
+#endif
+
+#ifdef NEED_GETPWENT_R
+PASS_R_RETURN getpwent_r(struct passwd *pwptr, PASS_R_ARGS);
+#endif
+
+#ifdef NEED_ENDPWENT_R
+void endpwent_r(void);
+#endif
+
+#ifdef NEED_SETPASSENT
+int setpassent(int stayopen);
+#endif
+
+#define gettimeofday isc__gettimeofday
+#ifdef NEED_GETTIMEOFDAY
+int isc__gettimeofday(struct timeval *tvp, struct _TIMEZONE *tzp);
+#else
+int isc__gettimeofday(struct timeval *tp, struct timezone *tzp);
+#endif
+
+int getnetgrent(NGR_R_CONST char **machinep, NGR_R_CONST char **userp,
+ NGR_R_CONST char **domainp);
+
+#ifdef NGR_R_ARGS
+int getnetgrent_r(NGR_R_CONST char **machinep, NGR_R_CONST char **userp,
+ NGR_R_CONST char **domainp, NGR_R_ARGS);
+#endif
+
+/* setnetgrent and endnetgrent are defined in sunw_port_after.h
+#ifdef SETNETGRENT_ARGS
+void setnetgrent(SETNETGRENT_ARGS);
+#else
+void setnetgrent(const char *netgroup);
+#endif
+
+void endnetgrent(void);
+*/
+
+#ifdef INNETGR_ARGS
+int innetgr(INNETGR_ARGS);
+#else
+int innetgr(const char *netgroup, const char *machine,
+ const char *user, const char *domain);
+#endif
+
+#ifdef NGR_R_SET_ARGS
+NGR_R_SET_RETURN
+setnetgrent_r(NGR_R_SET_CONST char *netgroup, NGR_R_SET_ARGS);
+#else
+NGR_R_SET_RETURN
+setnetgrent_r(NGR_R_SET_CONST char *netgroup);
+#endif
+
+#ifdef NEED_STRTOUL
+unsigned long strtoul(const char *, char **, int);
+#endif
+
+#ifdef NEED_SUN4PROTOS
+#include <stdarg.h>
+#ifndef __SIZE_TYPE__
+#define __SIZE_TYPE__ int
+#endif
+struct sockaddr;
+struct iovec;
+struct timeval;
+struct timezone;
+int fprintf(FILE *, const char *, ...);
+int getsockname(int, struct sockaddr *, int *);
+int getpeername(int, struct sockaddr *, int *);
+int socket(int, int, int);
+int connect(int, const struct sockaddr *, int);
+int writev(int, struct iovec *, int);
+int readv(int, struct iovec *, int);
+int send(int, const char *, int, int);
+void bzero(char *, int);
+int recvfrom(int, char *, int, int, struct sockaddr *, int *);
+int syslog(int, const char *, ... );
+int printf(const char *, ...);
+__SIZE_TYPE__ fread(void *, __SIZE_TYPE__, __SIZE_TYPE__, FILE *);
+__SIZE_TYPE__ fwrite(const void *, __SIZE_TYPE__, __SIZE_TYPE__, FILE *);
+int fclose(FILE *);
+int ungetc(int, FILE *);
+int scanf(const char *, ...);
+int sscanf(const char *, const char *, ... );
+int tolower(int);
+int toupper(int);
+int strcasecmp(const char *, const char *);
+int strncasecmp(const char *, const char *, int);
+int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+#ifdef gettimeofday
+#undef gettimeofday
+int gettimeofday(struct timeval *, struct timezone *);
+#define gettimeofday isc__gettimeofday
+#else
+int gettimeofday(struct timeval *, struct timezone *);
+#endif
+long strtol(const char*, char **, int);
+int fseek(FILE *, long, int);
+int setsockopt(int, int, int, const char *, int);
+int bind(int, const struct sockaddr *, int);
+void bcopy(char *, char *, int);
+int fputc(char, FILE *);
+int listen(int, int);
+int accept(int, struct sockaddr *, int *);
+int getsockopt(int, int, int, char *, int *);
+int vfprintf(FILE *, const char *, va_list);
+int fflush(FILE *);
+int fgetc(FILE *);
+int fputs(const char *, FILE *);
+int fchown(int, int, int);
+void setbuf(FILE *, char *);
+int gethostname(char *, int);
+int rename(const char *, const char *);
+time_t time(time_t *);
+int fscanf(FILE *, const char *, ...);
+int sscanf(const char *, const char *, ...);
+int ioctl(int, int, caddr_t);
+void perror(const char *);
+
+#if !defined(__USE_FIXED_PROTOTYPES__) && !defined(__cplusplus) && !defined(__STRICT_ANSI__)
+/*
+ * 'gcc -ansi' changes the prototype for vsprintf().
+ * Use this prototype when 'gcc -ansi' is not in effect.
+ */
+char *vsprintf(char *, const char *, va_list);
+#endif
+#endif
+
+/* Solaris-specific changes */
+#include "sunw_port_after.h"
+
+#endif /* port_after_h */
diff --git a/usr/src/lib/libresolv2_joy/include/port_before.h b/usr/src/lib/libresolv2_joy/include/port_before.h
new file mode 100644
index 0000000000..2801139223
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/port_before.h
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (C) 2005-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: port_before.h.in,v 1.31 2008/02/28 05:36:10 marka Exp $ */
+
+#ifndef port_before_h
+#define port_before_h
+/* Solaris-specific changes */
+#include "sunw_port_before.h"
+#include <config.h>
+
+#ifdef NEED_SUN4PROTOS
+#define _PARAMS(x) x
+#endif
+
+struct group; /* silence warning */
+struct passwd; /* silence warning */
+struct timeval; /* silence warning */
+struct timezone; /* silence warning */
+
+#ifdef HAVE_SYS_TIMERS_H
+#include <sys/timers.h>
+#endif
+#include <limits.h>
+
+#ifdef ISC_PLATFORM_NEEDTIMESPEC
+#include <time.h> /* For time_t */
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+#endif
+#ifndef HAVE_MEMMOVE
+#define memmove(a,b,c) bcopy(b,a,c)
+#endif
+
+#undef WANT_IRS_GR
+#undef WANT_IRS_NIS
+#undef WANT_IRS_PW
+
+#define BSD_COMP 1
+#define USE_POLL 1
+#define HAVE_MD5 1
+#define SOLARIS2 1
+
+/* DO_PTHREADS is conditionally defined in sunw_port_before.h
+ * #define DO_PTHREADS 1 */
+#define GETGROUPLIST_ARGS const char *name, gid_t basegid, gid_t *groups, int *ngroups
+#define GETNETBYADDR_ADDR_T long
+#define SETPWENT_VOID 1
+#define SETGRENT_VOID 1
+
+#define NET_R_ARGS char *buf, int buflen
+#define NET_R_BAD NULL
+#define NET_R_COPY buf, buflen
+#define NET_R_COPY_ARGS NET_R_ARGS
+#define NET_R_END_RESULT(x) /*empty*/
+#define NET_R_END_RETURN void
+#undef NET_R_ENT_ARGS /*empty*/
+#define NET_R_OK nptr
+#define NET_R_RETURN struct netent *
+#undef NET_R_SET_RESULT /*empty*/
+#undef NET_R_SETANSWER
+#define NET_R_SET_RETURN void
+#undef NETENT_DATA
+
+#define GROUP_R_RETURN struct group *
+#define GROUP_R_SET_RETURN void
+#undef GROUP_R_SET_RESULT /*empty*/
+#define GROUP_R_END_RETURN void
+#define GROUP_R_END_RESULT(x) /*empty*/
+#define GROUP_R_ARGS char *buf, int buflen
+#define GROUP_R_ENT_ARGS void
+#define GROUP_R_OK gptr
+#define GROUP_R_BAD NULL
+
+#define HOST_R_ARGS char *buf, int buflen, int *h_errnop
+#define HOST_R_BAD NULL
+#define HOST_R_COPY buf, buflen
+#define HOST_R_COPY_ARGS char *buf, int buflen
+#define HOST_R_END_RESULT(x) /*empty*/
+#define HOST_R_END_RETURN void
+#undef HOST_R_ENT_ARGS /*empty*/
+#define HOST_R_ERRNO *h_errnop = h_errno
+#define HOST_R_OK hptr
+#define HOST_R_RETURN struct hostent *
+#undef HOST_R_SETANSWER
+#undef HOST_R_SET_RESULT
+#define HOST_R_SET_RETURN void
+#undef HOSTENT_DATA
+
+#define NGR_R_ARGS char *buf, int buflen
+#define NGR_R_BAD (0)
+#define NGR_R_COPY buf, buflen
+#define NGR_R_COPY_ARGS NGR_R_ARGS
+#define NGR_R_CONST
+#define NGR_R_END_RESULT(x) /*empty*/
+#define NGR_R_END_RETURN void
+#undef NGR_R_END_ARGS /*empty*/
+#define NGR_R_OK 1
+#define NGR_R_RETURN int
+#define NGR_R_SET_CONST const
+#undef NGR_R_SET_RESULT /*empty*/
+#define NGR_R_SET_RETURN void
+#undef NGR_R_SET_ARGS
+
+
+#if !defined(NGR_R_SET_ARGS) && defined(NGR_R_END_ARGS)
+#define NGR_R_SET_ARGS NGR_R_END_ARGS
+#endif
+
+#define PROTO_R_ARGS char *buf, int buflen
+#define PROTO_R_BAD NULL
+#define PROTO_R_COPY buf, buflen
+#define PROTO_R_COPY_ARGS PROTO_R_ARGS
+#define PROTO_R_END_RESULT(x) /*empty*/
+#define PROTO_R_END_RETURN void
+#undef PROTO_R_ENT_ARGS /*empty*/
+#undef PROTO_R_ENT_UNUSED
+#define PROTO_R_OK pptr
+#undef PROTO_R_SETANSWER
+#define PROTO_R_RETURN struct protoent *
+#undef PROTO_R_SET_RESULT
+#define PROTO_R_SET_RETURN void
+#undef PROTOENT_DATA
+
+#define PASS_R_ARGS char *buf, int buflen
+#define PASS_R_BAD NULL
+#define PASS_R_COPY buf, buflen
+#define PASS_R_COPY_ARGS PASS_R_ARGS
+#define PASS_R_END_RESULT(x) /*empty*/
+#define PASS_R_END_RETURN void
+#undef PASS_R_ENT_ARGS
+#define PASS_R_OK pwptr
+#define PASS_R_RETURN struct passwd *
+#undef PASS_R_SET_RESULT /*empty*/
+#define PASS_R_SET_RETURN void
+
+#define SERV_R_ARGS char *buf, int buflen
+#define SERV_R_BAD NULL
+#define SERV_R_COPY buf, buflen
+#define SERV_R_COPY_ARGS SERV_R_ARGS
+#define SERV_R_END_RESULT(x) /*empty*/
+#define SERV_R_END_RETURN void
+#undef SERV_R_ENT_ARGS /*empty*/
+#undef SERV_R_ENT_UNUSED /*empty*/
+#define SERV_R_OK sptr
+#undef SERV_R_SETANSWER
+#define SERV_R_RETURN struct servent *
+#undef SERV_R_SET_RESULT
+#define SERV_R_SET_RETURN void
+
+
+
+#define DE_CONST(konst, var) \
+ do { \
+ union { const void *k; void *v; } _u; \
+ _u.k = konst; \
+ var = _u.v; \
+ } while (0)
+
+#define UNUSED(x) (x) = (x)
+
+#undef NEED_SOLARIS_BITTYPES
+#define ISC_SOCKLEN_T int
+
+#ifdef __GNUC__
+#define ISC_FORMAT_PRINTF(fmt, args) \
+ __attribute__((__format__(__printf__, fmt, args)))
+#else
+#define ISC_FORMAT_PRINTF(fmt, args)
+#endif
+
+/* Pull in host order macros when _XOPEN_SOURCE_EXTENDED is defined. */
+#if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
+#include <sys/byteorder.h>
+#endif
+
+#endif
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/port_netdb.h b/usr/src/lib/libresolv2_joy/include/port_netdb.h
new file mode 100644
index 0000000000..a308cc7efa
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/port_netdb.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+#ifndef _PORT_NETDB_H
+#define _PORT_NETDB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* AI_NUMERICSERV is not a valid flag for getaddrinfo */
+#define AI_MASK 0x0038 /* mask of valid flags */
+
+/* EAI_OVERFLOW was removed from ISC */
+#define EAI_BADHINTS 12
+
+/*
+ * these are libresolv2 functions that were renamed in previous versions to
+ * res_* because they conflict with libnsl or libsocket
+ */
+
+#define endhostent joy_res_endhostent /* libnsl */
+void endhostent __P((void));
+#define endnetent res_endnetent /* libsocket */
+void endnetent __P((void));
+#define freeaddrinfo res_freeaddrinfo /* libsocket */
+void freeaddrinfo __P((struct addrinfo *));
+#define freehostent res_freehostent /* libsocket and libnsl */
+void freehostent __P((struct hostent *));
+#define getaddrinfo res_getaddrinfo /* libsocket */
+int getaddrinfo __P((const char *, const char *,
+ const struct addrinfo *, struct addrinfo **));
+#define gethostbyaddr joy_res_gethostbyaddr /* libnsl */
+struct hostent *gethostbyaddr __P((const char *, int, int));
+#define gethostbyname joy_res_gethostbyname /* libnsl */
+struct hostent *gethostbyname __P((const char *));
+#define gethostbyname2 joy_res_gethostbyname2 /* lib/nsswitch/dns */
+struct hostent *gethostbyname2 __P((const char *, int));
+#define gethostent res_gethostent /* libnsl */
+struct hostent *gethostent __P((void));
+#define getipnodebyaddr res_getipnodebyaddr /* libnsl and libsocket */
+struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *));
+#define getipnodebyname res_getipnodebyname /* libnsl and libsocket */
+struct hostent *getipnodebyname __P((const char *, int, int, int *));
+
+#define getnetbyaddr res_getnetbyaddr /* libsocket */
+struct netent *getnetbyaddr __P((unsigned long, int));
+#define getnetbyname res_getnetbyname /* libsocket */
+struct netent *getnetbyname __P((const char *));
+#define getnetent res_getnetent /* libsocket */
+struct netent *getnetent __P((void));
+#define sethostent joy_res_sethostent /* libnsl */
+void sethostent __P((int));
+#define setnetent res_setnetent /* libsocket */
+void setnetent __P((int));
+
+/*
+ * these are other irs functions now included in libresolv.so.2. We rename the
+ * ones that overlap with libsocket or libnsl
+ */
+
+/* endprotoent is in libsocket.so.1 */
+#define endprotoent res_endprotoent
+void endprotoent __P((void));
+
+/* endservent is in libsocket.so.1 */
+#define endservent res_endservent
+void endservent __P((void));
+
+/* note: the next two symbols are variables, not functions */
+
+/* gai_errlist is in libsocket.so.1 */
+#define gai_errlist res_gai_errlist
+
+/* gai_nerr is in libsocket.so.1 */
+#define gai_nerr res_gai_nerr
+
+/* gai_strerror is in libsocket.so.1 */
+#define gai_strerror res_gai_strerror
+const char *gai_strerror __P((int ecode));
+
+/* gethostbyaddr_r is in libnsl.so.1 */
+#define gethostbyaddr_r res_gethostbyaddr_r
+struct hostent *gethostbyaddr_r __P((const char *addr, int len, int type,
+ struct hostent *hptr, char *buf,
+ int buflen, int *h_errnop));
+
+/* gethostbyname_r is in libnsl.so.1 */
+#define gethostbyname_r res_gethostbyname_r
+struct hostent *gethostbyname_r __P((const char *name, struct hostent *hptr,
+ char *buf, int buflen, int *h_errnop));
+
+/* gethostent_r is in libnsl.so.1 */
+#define gethostent_r res_gethostent_r
+struct hostent *gethostent_r __P((struct hostent *hptr, char *buf, int buflen,
+ int *h_errnop));
+
+/* getnameinfo is in libsocket.so.1 */
+#define getnameinfo res_getnameinfo
+int getnameinfo __P((const struct sockaddr *, size_t, char *,
+ size_t, char *, size_t, int));
+
+/* getnetbyaddr_r is in libsocket.so.1 */
+#define getnetbyaddr_r res_getnetbyaddr_r
+struct netent *getnetbyaddr_r __P((long, int, struct netent *, char *, int));
+
+/* getnetbyname_r is in libsocket.so.1 */
+#define getnetbyname_r res_getnetbyname_r
+struct netent *getnetbyname_r __P((const char *, struct netent *, char *, int));
+
+/* getnetent_r is in libsocket.so.1 */
+#define getnetent_r res_getnetent_r
+struct netent *getnetent_r __P((struct netent *, char *, int));
+
+/* getprotobyname is in libsocket.so.1 */
+#define getprotobyname res_getprotobyname
+struct protoent *getprotobyname __P((const char *));
+
+/* getprotobyname_r is in libsocket.so.1 */
+#define getprotobyname_r res_getprotobyname_r
+struct protoent *getprotobyname_r __P((const char *, struct protoent *,
+ char *, int));
+
+/* getprotobynumber is in libsocket.so.1 */
+#define getprotobynumber res_getprotobynumber
+struct protoent *getprotobynumber __P((int));
+
+/* getprotobynumber_r is in libsocket.so.1 */
+#define getprotobynumber_r res_getprotobynumber_r
+struct protoent *getprotobynumber_r __P((int,
+ struct protoent *, char *, int));
+
+/* getprotoent is in libsocket.so.1 */
+#define getprotoent res_getprotoent
+struct protoent *getprotoent __P((void));
+
+/* getprotoent_r is in libsocket.so.1 */
+#define getprotoent_r res_getprotoent_r
+struct protoent *getprotoent_r __P((struct protoent *, char *, int));
+
+/* getservbyname is in libsocket.so.1 and libnsl.so.1 */
+#define getservbyname res_getservbyname
+struct servent *getservbyname __P((const char *, const char *));
+
+/* getservbyname_r is in libsocket.so.1 and libnsl.so.1 */
+#define getservbyname_r res_getservbyname_r
+struct servent *getservbyname_r __P((const char *name, const char *,
+ struct servent *, char *, int));
+
+/* getservbyport is in libsocket.so.1 and libnsl.so.1 */
+#define getservbyport res_getservbyport
+struct servent *getservbyport __P((int, const char *));
+
+/* getservbyport_r is in libsocket.so.1 and libnsl.so.1 */
+#define getservbyport_r res_getservbyport_r
+struct servent *getservbyport_r __P((int port, const char *,
+ struct servent *, char *, int));
+
+/* getservent is in libsocket.so.1 */
+#define getservent res_getservent
+struct servent *getservent __P((void));
+
+/* getservent_r is in libsocket.so.1 */
+#define getservent_r res_getservent_r
+struct servent *getservent_r __P((struct servent *, char *, int));
+
+/* innetgr is in libsocket.so.1 */
+#define innetgr res_innetgr
+int innetgr __P((const char *, const char *, const char *, const char *));
+
+/* setprotoent is in libsocket.so.1 */
+#define setprotoent res_setprotoent
+void setprotoent __P((int));
+
+/* setservent is in libsocket.so.1 */
+#define setservent res_setservent
+void setservent __P((int));
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PORT_NETDB_H */
diff --git a/usr/src/lib/libresolv2_joy/include/port_resolv.h b/usr/src/lib/libresolv2_joy/include/port_resolv.h
new file mode 100644
index 0000000000..cd1a97d40c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/port_resolv.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _PORT_RESOLV_H
+#define _PORT_RESOLV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RES_NSID has the same value as RES_NO_NIBBLE, which has been deleted */
+#define RES_NSID 0x00040000 /* request name server ID */
+
+/* RES_DEFAULT has a new value in libbind-6.0 */
+#undef RES_DEFAULT
+#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | \
+ RES_DNSRCH | RES_NO_NIBBLE2)
+
+#ifndef __ultrix__
+u_int16_t _getshort __P((const uchar_t *));
+u_int32_t _getlong __P((const uchar_t *));
+#endif
+
+/* rename functions so they can be wrapped (see sunw/sunw_wrappers.c */
+#define p_option isc_p_option
+const char *p_option(ulong_t option);
+#define p_secstodate isc_p_secstodate
+char *p_secstodate(ulong_t secs);
+
+/* prevent namespace pollution */
+#define res_protocolnumber __res_protocolnumber
+#define res_servicenumber __res_servicenumber
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PORT_RESOLV_H */
diff --git a/usr/src/lib/libresolv2_joy/include/probe_ipv6 b/usr/src/lib/libresolv2_joy/include/probe_ipv6
new file mode 100755
index 0000000000..371ac96c55
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/probe_ipv6
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+# Copyright 2003 by Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+set -e
+PATH=/bin:/usr/bin:$PATH; export PATH
+trap "rm -f tmp$$[abc].[oc]" 0
+target=port_ipv6
+new=new_${target}.h
+old=${target}.h
+
+cat > tmp$$a.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct sockaddr_in6 xx;
+EOF
+
+cat > tmp$$b.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct in6_addr xx;
+EOF
+
+cat > tmp$$c.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct sockaddr_in6 xx;
+main() { xx.sin6_scope_id = 0; }
+EOF
+
+cat > ${new} <<EOF
+
+/* This file is automatically generated. Do Not Edit. */
+
+#ifndef ${target}_h
+#define ${target}_h
+
+EOF
+
+if ${CC} -c tmp$$a.c > /dev/null 2>&1
+then
+ echo "#define HAS_INET6_STRUCTS" >> ${new}
+ if ${CC} -c tmp$$b.c > /dev/null 2>&1
+ then
+ :
+ else
+ echo "#define in6_addr in_addr6" >> ${new}
+ fi
+ if ${CC} -c tmp$$c.c > /dev/null 2>&1
+ then
+ echo "#define HAVE_SIN6_SCOPE_ID" >> ${new}
+ else
+ echo "#undef HAVE_SIN6_SCOPE_ID" >> ${new}
+ fi
+else
+ echo "#undef HAS_INET6_STRUCTS" >> ${new}
+fi
+echo >> ${new}
+echo "#endif" >> ${new}
+if [ -f ${old} ]; then
+ if cmp -s ${new} ${old} ; then
+ rm -f ${new}
+ else
+ rm -f ${old}
+ mv ${new} ${old}
+ fi
+else
+ mv ${new} ${old}
+fi
+exit 0
diff --git a/usr/src/lib/libresolv2_joy/include/probe_ipv6.sh b/usr/src/lib/libresolv2_joy/include/probe_ipv6.sh
new file mode 100644
index 0000000000..371ac96c55
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/probe_ipv6.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+# Copyright 2003 by Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+set -e
+PATH=/bin:/usr/bin:$PATH; export PATH
+trap "rm -f tmp$$[abc].[oc]" 0
+target=port_ipv6
+new=new_${target}.h
+old=${target}.h
+
+cat > tmp$$a.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct sockaddr_in6 xx;
+EOF
+
+cat > tmp$$b.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct in6_addr xx;
+EOF
+
+cat > tmp$$c.c <<EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+struct sockaddr_in6 xx;
+main() { xx.sin6_scope_id = 0; }
+EOF
+
+cat > ${new} <<EOF
+
+/* This file is automatically generated. Do Not Edit. */
+
+#ifndef ${target}_h
+#define ${target}_h
+
+EOF
+
+if ${CC} -c tmp$$a.c > /dev/null 2>&1
+then
+ echo "#define HAS_INET6_STRUCTS" >> ${new}
+ if ${CC} -c tmp$$b.c > /dev/null 2>&1
+ then
+ :
+ else
+ echo "#define in6_addr in_addr6" >> ${new}
+ fi
+ if ${CC} -c tmp$$c.c > /dev/null 2>&1
+ then
+ echo "#define HAVE_SIN6_SCOPE_ID" >> ${new}
+ else
+ echo "#undef HAVE_SIN6_SCOPE_ID" >> ${new}
+ fi
+else
+ echo "#undef HAS_INET6_STRUCTS" >> ${new}
+fi
+echo >> ${new}
+echo "#endif" >> ${new}
+if [ -f ${old} ]; then
+ if cmp -s ${new} ${old} ; then
+ rm -f ${new}
+ else
+ rm -f ${old}
+ mv ${new} ${old}
+ fi
+else
+ mv ${new} ${old}
+fi
+exit 0
diff --git a/usr/src/lib/libresolv2_joy/include/res_update.h b/usr/src/lib/libresolv2_joy/include/res_update.h
new file mode 100644
index 0000000000..0c6967db56
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/res_update.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1999 by Internet Software Consortium, Inc.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * $Id: res_update.h,v 1.3 2005/04/27 04:56:15 sra Exp $
+ */
+
+#ifndef __RES_UPDATE_H
+#define __RES_UPDATE_H
+
+/*! \file */
+
+#include <sys/types.h>
+#include <arpa/nameser.h>
+#include <isc/list.h>
+#include <resolv_joy.h>
+
+#ifndef ORIGINAL_ISC_CODE
+/* definition of u_int32_t needed on Solaris */
+#include <sys/bitypes.h>
+/* need to rename ns_updrec before we define it here */
+#include "arpa/port_nameser.h"
+#endif /* ORIGINAL_ISC_CODE */
+
+
+/*%
+ * This RR-like structure is particular to UPDATE.
+ */
+struct ns_updrec {
+ LINK(struct ns_updrec) r_link, r_glink;
+ ns_sect r_section; /*%< ZONE/PREREQUISITE/UPDATE */
+ char * r_dname; /*%< owner of the RR */
+ ns_class r_class; /*%< class number */
+ ns_type r_type; /*%< type number */
+ u_int32_t r_ttl; /*%< time to live */
+ u_char * r_data; /*%< rdata fields as text string */
+ u_int r_size; /*%< size of r_data field */
+ int r_opcode; /*%< type of operation */
+ /* following fields for private use by the resolver/server routines */
+ struct databuf *r_dp; /*%< databuf to process */
+ struct databuf *r_deldp; /*%< databuf's deleted/overwritten */
+ u_int r_zone; /*%< zone number on server */
+};
+typedef struct ns_updrec ns_updrec;
+typedef LIST(ns_updrec) ns_updque;
+
+#ifdef ORIGINAL_ISC_CODE
+#define res_mkupdate __res_mkupdate
+#define res_update __res_update
+#define res_mkupdrec __res_mkupdrec
+#define res_freeupdrec __res_freeupdrec
+#define res_nmkupdate __res_nmkupdate
+#define res_nupdate __res_nupdate
+#else
+/* these are renamed in "port_nameser.h" */
+#endif /* ORIGINAL_ISC_CODE */
+
+
+int res_mkupdate __P((ns_updrec *, u_char *, int));
+int res_update __P((ns_updrec *));
+ns_updrec * res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
+void res_freeupdrec __P((ns_updrec *));
+int res_nmkupdate __P((res_state, ns_updrec *, u_char *, int));
+int res_nupdate __P((res_state, ns_updrec *, ns_tsig_key *));
+
+#endif /*__RES_UPDATE_H*/
+
+/*! \file */
diff --git a/usr/src/lib/libresolv2_joy/include/resolv_mt.h b/usr/src/lib/libresolv2_joy/include/resolv_mt.h
new file mode 100644
index 0000000000..500d4d764c
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/resolv_mt.h
@@ -0,0 +1,47 @@
+#ifndef _RESOLV_MT_H
+#define _RESOLV_MT_H
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv_joy.h>
+
+/* Access functions for the libresolv private interface */
+
+int __res_enable_mt(void);
+int __res_disable_mt(void);
+
+/* Per-thread context */
+
+typedef struct {
+int no_hosts_fallback_private;
+int retry_save;
+int retry_private;
+char inet_nsap_ntoa_tmpbuf[255*3];
+char sym_ntos_unname[20];
+char sym_ntop_unname[20];
+char p_option_nbuf[40];
+char p_time_nbuf[40];
+char precsize_ntoa_retbuf[sizeof "90000000.00"];
+char loc_ntoa_tmpbuf[sizeof
+"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
+char p_secstodate_output[15];
+} mtctxres_t;
+
+/* Thread-specific data (TSD) */
+
+mtctxres_t *___mtctxres(void);
+#define mtctxres (___mtctxres())
+
+/* Various static data that should be TSD */
+
+#define sym_ntos_unname (mtctxres->sym_ntos_unname)
+#define sym_ntop_unname (mtctxres->sym_ntop_unname)
+#define inet_nsap_ntoa_tmpbuf (mtctxres->inet_nsap_ntoa_tmpbuf)
+#define p_option_nbuf (mtctxres->p_option_nbuf)
+#define p_time_nbuf (mtctxres->p_time_nbuf)
+#define precsize_ntoa_retbuf (mtctxres->precsize_ntoa_retbuf)
+#define loc_ntoa_tmpbuf (mtctxres->loc_ntoa_tmpbuf)
+#define p_secstodate_output (mtctxres->p_secstodate_output)
+
+#endif /* _RESOLV_MT_H */
diff --git a/usr/src/lib/libresolv2_joy/include/sunw_port_after.h b/usr/src/lib/libresolv2_joy/include/sunw_port_after.h
new file mode 100644
index 0000000000..bff64a74c1
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/sunw_port_after.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SUNW_PORT_AFTER_H
+#define _SUNW_PORT_AFTER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * rename setnetgrent and endnetgrent which were formerly in a separate irs
+ * shared library. These functions should come from libc.so
+ */
+#define setnetgrent res_setnetgrent
+#ifdef SETNETGRENT_ARGS
+void setnetgrent(SETNETGRENT_ARGS);
+#else
+void setnetgrent(const char *netgroup);
+#endif
+
+#define endnetgrent res_endnetgrent
+void endnetgrent(void);
+
+
+/*
+ * include ports for the public header files. ISC's versions are quite different
+ * from those currently in OpenSolaris.
+ */
+
+#ifdef _RESOLV_JOY_H
+#include <port_resolv.h>
+#endif /* _RESOLV_JOY_H */
+
+#ifdef _NETDB_H
+#include <port_netdb.h>
+#endif /* _NETDB_H */
+
+#ifdef _ARPA_INET_H
+#include <arpa/port_inet.h>
+#endif /* _ARPA_INET_H */
+
+#ifdef _ARPA_NAMESER_H
+#include <arpa/port_nameser.h>
+#endif /* _ARPA_NAMESER_H */
+
+
+#ifdef _ARPA_NAMESER_COMPAT_H
+/* no changes */
+#endif /* _ARPA_NAMESER_COMPAT_H */
+
+/* version-specific defines */
+#include <os_version.h>
+
+/*
+ * Prior to 2.6, Solaris needs a prototype for gethostname().
+ */
+#if (OS_MAJOR == 5 && OS_MINOR < 6)
+extern int gethostname(char *, size_t);
+#endif
+/*
+ * gethostid() was not available until 2.5
+ * setsockopt(SO_REUSEADDR) fails on unix domain sockets before 2.5
+ * use ioctl(FIONBIO) rather than fcntl() calls to set/clear non-blocking i/o.
+ */
+#if (OS_MAJOR == 5 && OS_MINOR < 5)
+#define GET_HOST_ID_MISSING
+#define NO_UNIX_REUSEADDR
+#define USE_FIONBIO_IOCTL
+#endif
+
+#if (OS_MAJOR == 5 && OS_MINOR < 11)
+#define NEED_STRSEP
+extern char *strsep(char **, const char *);
+#endif
+
+
+/*
+ * Solaris 2.5 and later have getrlimit(), setrlimit() and getrusage().
+ */
+#if (OS_MAJOR > 5 || (OS_MAJOR == 5 && OS_MINOR >= 5))
+#include <sys/resource.h>
+#define HAVE_GETRUSAGE
+#define RLIMIT_TYPE rlim_t
+#define RLIMIT_FILE_INFINITY
+#endif
+
+/* the default syslog facility of named/lwresd. */
+#ifndef ISC_FACILITY
+#define ISC_FACILITY LOG_DAEMON
+#endif
+
+
+/*
+ * Solaris 8 has if_nametoindex().
+ */
+#if (OS_MAJOR > 5 || (OS_MAJOR == 5 && OS_MINOR >= 8))
+#define USE_IFNAMELINKID
+#endif
+
+#undef ALIGN
+#if (OS_MAJOR == 5 && OS_MINOR > 8)
+#define ALIGN(x) (((uintptr_t)(x) + (sizeof (char *) - 1UL)) & \
+ ~(sizeof (char *) - 1UL))
+#else
+#define ALIGN(x) (((unsigned long)(x) + (sizeof (char *) - 1UL)) & \
+ ~(sizeof (char *) - 1UL))
+#endif
+
+#if (OS_MAJOR == 5 && OS_MINOR < 5)
+#ifndef USE_FIONBIO_IOCTL
+#define USE_FIONBIO_IOCTL 1
+#endif
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SUNW_PORT_AFTER_H */
diff --git a/usr/src/lib/libresolv2_joy/include/sunw_port_before.h b/usr/src/lib/libresolv2_joy/include/sunw_port_before.h
new file mode 100644
index 0000000000..776e311fcc
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/sunw_port_before.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SUNW_PORT_BEFORE_H
+#define _SUNW_PORT_BEFORE_H
+
+#ifdef SUNW_OPTIONS
+#include <conf/sunoptions.h>
+#endif
+
+/* version-specific defines */
+#include <os_version.h>
+#if (OS_MAJOR == 5 && OS_MINOR < 6)
+#ifndef SOLARIS_BITTYPES
+#define NEED_SOLARIS_BITTYPES 1
+#endif
+#endif
+
+#if (OS_MAJOR == 5 && OS_MINOR < 5)
+#undef HAS_PTHREADS
+#else
+#define HAS_PTHREADS
+#endif
+
+#if defined(HAS_PTHREADS) && defined(_REENTRANT)
+#define DO_PTHREADS
+#endif
+
+/*
+ * need these if we are using public versions of nameser.h, resolv.h, and
+ * inet.h
+ */
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+#include <sys/bitypes.h>
+#else
+#include <sys/types.h>
+#endif
+#include <sys/cdefs.h>
+
+#endif /* _SUNW_PORT_BEFORE_H */
diff --git a/usr/src/lib/libresolv2_joy/include/sys/bitypes.h b/usr/src/lib/libresolv2_joy/include/sys/bitypes.h
new file mode 100644
index 0000000000..54fb42bad7
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/sys/bitypes.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2004, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1998, 1999, 2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id: bitypes.h,v 1.7 2008/11/14 02:54:35 tbox Exp $ */
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+
+ /*
+ * Basic integral types. Omit the typedef if
+ * not possible for a machine/compiler combination.
+ */
+
+#ifdef NEED_SOLARIS_BITTYPES
+ typedef /*signed*/ char int8_t;
+ typedef short int16_t;
+ typedef int int32_t;
+#endif
+ typedef unsigned char u_int8_t;
+ typedef unsigned short u_int16_t;
+ typedef unsigned int u_int32_t;
+
+#endif /* __BIT_TYPES_DEFINED__ */
diff --git a/usr/src/lib/libresolv2_joy/include/sys/cdefs.h b/usr/src/lib/libresolv2_joy/include/sys/cdefs.h
new file mode 100644
index 0000000000..67aac00cc7
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/include/sys/cdefs.h
@@ -0,0 +1,144 @@
+/*
+ * ++Copyright++ 1991, 1993
+ * -
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
+ */
+
+/*
+ * @(#)cdefs.h 8.1 (Berkeley) 6/2/93
+ * $Id: cdefs.h,v 1.2 2004/07/19 05:54:07 marka Exp $
+ */
+
+#ifndef _CDEFS_H_
+#define _CDEFS_H_
+
+#if defined(__cplusplus)
+#define __BEGIN_DECLS extern "C" {
+#define __END_DECLS };
+#else
+#define __BEGIN_DECLS
+#define __END_DECLS
+#endif
+
+/*
+ * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
+ * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
+ * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
+ * in between its arguments. __CONCAT can also concatenate double-quoted
+ * strings produced by the __STRING macro, but this only works with ANSI C.
+ */
+#if defined(__STDC__) || defined(__cplusplus)
+#define __P(protos) protos /* full-blown ANSI C */
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+#define __const const /* define reserved names to standard */
+#define __signed signed
+#define __volatile volatile
+#if defined(__cplusplus)
+#define __inline inline /* convert to C++ keyword */
+#else
+#ifndef __GNUC__
+#define __inline /* delete GCC keyword */
+#endif /* !__GNUC__ */
+#endif /* !__cplusplus */
+
+#else /* !(__STDC__ || __cplusplus) */
+#define __P(protos) () /* traditional C preprocessor */
+#define __CONCAT(x,y) x/**/y
+#define __STRING(x) "x"
+
+#ifndef __GNUC__
+#define __const /* delete pseudo-ANSI C keywords */
+#define __inline
+#define __signed
+#define __volatile
+/*
+ * In non-ANSI C environments, new programs will want ANSI-only C keywords
+ * deleted from the program and old programs will want them left alone.
+ * When using a compiler other than gcc, programs using the ANSI C keywords
+ * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
+ * When using "gcc -traditional", we assume that this is the intent; if
+ * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
+ */
+#ifndef NO_ANSI_KEYWORDS
+#define const /* delete ANSI C keywords */
+#define inline
+#define signed
+#define volatile
+#endif
+#endif /* !__GNUC__ */
+#endif /* !(__STDC__ || __cplusplus) */
+
+/*
+ * GCC1 and some versions of GCC2 declare dead (non-returning) and
+ * pure (no side effects) functions using "volatile" and "const";
+ * unfortunately, these then cause warnings under "-ansi -pedantic".
+ * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
+ * these work for GNU C++ (modulo a slight glitch in the C++ grammar
+ * in the distribution version of 2.5.5).
+ */
+#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define __dead __volatile
+#define __pure __const
+#endif
+#endif
+
+/* Delete pseudo-keywords wherever they are not available or needed. */
+#ifndef __dead
+#define __dead
+#define __pure
+#endif
+
+#endif /* !_CDEFS_H_ */
diff --git a/usr/src/lib/libresolv2_joy/sparc/Makefile b/usr/src/lib/libresolv2_joy/sparc/Makefile
new file mode 100644
index 0000000000..a333224278
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/sparc/Makefile
@@ -0,0 +1,30 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libresolv2_joy/sparcv9/Makefile b/usr/src/lib/libresolv2_joy/sparcv9/Makefile
new file mode 100644
index 0000000000..ceed393e0d
--- /dev/null
+++ b/usr/src/lib/libresolv2_joy/sparcv9/Makefile
@@ -0,0 +1,38 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+# With the adition of BIND 8.3.3, the symbol table for 64 bit went over
+# the limit for Kpic, so we've added -KPIC here, for just the 64 bit
+# library. This avoids compiling the 32-bit library with PIC unnecessarily.
+
+sparcv9_C_PICFLAGS = -K PIC
+sparcv9_CC_PICFLAGS = -KPIC
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/librestart/common/librestart.c b/usr/src/lib/librestart/common/librestart.c
index 54fcafd6ce..671cdf99ea 100644
--- a/usr/src/lib/librestart/common/librestart.c
+++ b/usr/src/lib/librestart/common/librestart.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <libintl.h>
@@ -3857,6 +3857,55 @@ out:
return (ret);
}
+/*
+ * If the instance's dump-on-restart property exists, remove it and return true,
+ * otherwise return false.
+ */
+int
+restarter_inst_dump(scf_instance_t *inst)
+{
+ scf_handle_t *h;
+ scf_propertygroup_t *pg;
+ scf_property_t *prop;
+ scf_value_t *val;
+ int ret = 0;
+
+ h = scf_instance_handle(inst);
+ pg = scf_pg_create(h);
+ prop = scf_property_create(h);
+ val = scf_value_create(h);
+ if (pg == NULL || prop == NULL || val == NULL)
+ goto out;
+
+ if (scf_instance_get_pg(inst, SCF_PG_RESTARTER_ACTIONS, pg) !=
+ SCF_SUCCESS) {
+ if (scf_error() == SCF_ERROR_CONNECTION_BROKEN)
+ uu_die(rcbroken);
+ goto out;
+ }
+
+ if (scf_pg_get_property(pg, SCF_PROPERTY_DODUMP, prop) != SCF_SUCCESS) {
+ if (scf_error() == SCF_ERROR_CONNECTION_BROKEN)
+ uu_die(rcbroken);
+ goto out;
+ }
+
+ ret = 1;
+
+ if (scf_instance_delete_prop(inst, SCF_PG_RESTARTER_ACTIONS,
+ SCF_PROPERTY_DODUMP) != SCF_SUCCESS) {
+ if (scf_error() == SCF_ERROR_CONNECTION_BROKEN)
+ uu_die(rcbroken);
+ goto out;
+ }
+
+out:
+ scf_value_destroy(val);
+ scf_property_destroy(prop);
+ scf_pg_destroy(pg);
+ return (ret);
+}
+
static int
restarter_inst_set_astring_prop(scf_instance_t *inst, const char *pgname,
const char *pgtype, uint32_t pgflags, const char *pname, const char *str)
diff --git a/usr/src/lib/librestart/common/librestart.h b/usr/src/lib/librestart/common/librestart.h
index 92f00decfa..f5c247b7f1 100644
--- a/usr/src/lib/librestart/common/librestart.h
+++ b/usr/src/lib/librestart/common/librestart.h
@@ -332,6 +332,9 @@ int restarter_inst_ractions_from_tty(scf_instance_t *);
/* Delete instance's restarter/auxiliary_fmri property */
int restarter_inst_reset_aux_fmri(scf_instance_t *);
+/* Get boolean value from instance's restarter_actions/do_dump */
+int restarter_inst_dump(scf_instance_t *);
+
/*
* Set instance's restarter/auxiliary_fmri, value come from
* restarter_actions/auxliary_fmri
diff --git a/usr/src/lib/librestart/common/mapfile-vers b/usr/src/lib/librestart/common/mapfile-vers
index 181dbe8304..5c7c2b6391 100644
--- a/usr/src/lib/librestart/common/mapfile-vers
+++ b/usr/src/lib/librestart/common/mapfile-vers
@@ -68,6 +68,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
restarter_inst_ractions_from_tty;
restarter_inst_reset_ractions_aux_fmri;
restarter_inst_reset_aux_fmri;
+ restarter_inst_dump;
restarter_inst_set_aux_fmri;
restarter_mc_error_destroy;
restarter_get_str_short;
diff --git a/usr/src/lib/libscf/common/error.c b/usr/src/lib/libscf/common/error.c
index 70b62f9686..43aff95a3b 100644
--- a/usr/src/lib/libscf/common/error.c
+++ b/usr/src/lib/libscf/common/error.c
@@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
#include "libscf_impl.h"
@@ -196,6 +197,10 @@ scf_get_msg(scf_msg_t msg)
return (dgettext(TEXT_DOMAIN,
"Operation not supported for legacy service '%s'\n"));
+ case SCF_MSG_PATTERN_MULTIPARTIAL:
+ return (dgettext(TEXT_DOMAIN,
+ "Partial FMRI matches multiple instances\n"));
+
default:
abort();
/* NOTREACHED */
diff --git a/usr/src/lib/libscf/common/libscf_impl.h b/usr/src/lib/libscf/common/libscf_impl.h
index 01fc49f9ae..84f733db06 100644
--- a/usr/src/lib/libscf/common/libscf_impl.h
+++ b/usr/src/lib/libscf/common/libscf_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBSCF_IMPL_H
@@ -52,7 +53,8 @@ typedef enum {
SCF_MSG_PATTERN_NOENTITY,
SCF_MSG_PATTERN_MULTIMATCH,
SCF_MSG_PATTERN_POSSIBLE,
- SCF_MSG_PATTERN_LEGACY
+ SCF_MSG_PATTERN_LEGACY,
+ SCF_MSG_PATTERN_MULTIPARTIAL
} scf_msg_t;
scf_type_t scf_true_base_type(scf_type_t);
diff --git a/usr/src/lib/libscf/common/lowlevel.c b/usr/src/lib/libscf/common/lowlevel.c
index 3bf4d31372..2c6a3d3c84 100644
--- a/usr/src/lib/libscf/common/lowlevel.c
+++ b/usr/src/lib/libscf/common/lowlevel.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -6287,6 +6287,8 @@ scf_walk_fmri(scf_handle_t *h, int argc, char **argv, int flags,
ssize_t max_name_length;
char *pgname = NULL;
scf_walkinfo_t info;
+ boolean_t partial_fmri = B_FALSE;
+ boolean_t wildcard_fmri = B_FALSE;
#ifndef NDEBUG
if (flags & SCF_WALK_EXPLICIT)
@@ -6494,6 +6496,7 @@ scf_walk_fmri(scf_handle_t *h, int argc, char **argv, int flags,
goto error;
}
pattern[i].sp_type = PATTERN_EXACT;
+ partial_fmri = B_TRUE; /* we just iterated all instances */
continue;
@@ -6518,6 +6521,7 @@ badfmri:
* Prepend svc:/ to patterns which don't begin with * or
* svc: or lrc:.
*/
+ wildcard_fmri = B_TRUE;
pattern[i].sp_type = PATTERN_GLOB;
if (argv[i][0] == '*' ||
(strlen(argv[i]) >= 4 && argv[i][3] == ':'))
@@ -6530,6 +6534,7 @@ badfmri:
argv[i]);
}
} else {
+ partial_fmri = B_TRUE;
pattern[i].sp_type = PATTERN_PARTIAL;
pattern[i].sp_arg = strdup(argv[i]);
}
@@ -6818,6 +6823,26 @@ nolegacy:
}
}
+ if (flags & SCF_WALK_UNIPARTIAL && info.count > 1) {
+ /*
+ * If the SCF_WALK_UNIPARTIAL flag was passed in and we have
+ * more than one fmri, then this is an error if we matched
+ * because of a partial fmri parameter, unless we also matched
+ * more than one fmri because of wildcards in the parameters.
+ * That is, the presence of wildcards indicates that it is ok
+ * to match more than one fmri in this case.
+ * For example, a parameter of 'foo' that matches more than
+ * one fmri is an error, but parameters of 'foo *bar*' that
+ * matches more than one is fine.
+ */
+ if (partial_fmri && !wildcard_fmri) {
+ errfunc(scf_get_msg(SCF_MSG_PATTERN_MULTIPARTIAL));
+ if (err != NULL)
+ *err = UU_EXIT_FATAL;
+ goto error;
+ }
+ }
+
/*
* Clear 'sk_seen' for all keys.
*/
diff --git a/usr/src/lib/libscf/inc/libscf.h b/usr/src/lib/libscf/inc/libscf.h
index 8e68b4dfcc..1940308f92 100644
--- a/usr/src/lib/libscf/inc/libscf.h
+++ b/usr/src/lib/libscf/inc/libscf.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBSCF_H
@@ -295,6 +296,7 @@ typedef struct scf_tmpl_error scf_tmpl_error_t;
#define SCF_PROPERTY_COREFILE_PATTERN ((const char *)"corefile_pattern")
#define SCF_PROPERTY_DEGRADED ((const char *)"degraded")
#define SCF_PROPERTY_DEGRADE_IMMEDIATE ((const char *)"degrade_immediate")
+#define SCF_PROPERTY_DODUMP ((const char *)"do_dump")
#define SCF_PROPERTY_DURATION ((const char *)"duration")
#define SCF_PROPERTY_ENABLED ((const char *)"enabled")
#define SCF_PROPERTY_DEATHROW ((const char *)"deathrow")
@@ -831,8 +833,13 @@ int smf_notify_del_params(const char *, const char *, int32_t);
/*
* SMF exit status definitions
+ *
+ * The SMF_EXIT_NODAEMON exit status should be used when a method does not
+ * need to run any persistent process. This indicates success, abandons the
+ * contract, and allows dependencies to be met.
*/
#define SMF_EXIT_OK 0
+#define SMF_EXIT_NODAEMON 94
#define SMF_EXIT_ERR_FATAL 95
#define SMF_EXIT_ERR_CONFIG 96
#define SMF_EXIT_MON_DEGRADE 97
diff --git a/usr/src/lib/libscf/inc/libscf_priv.h b/usr/src/lib/libscf/inc/libscf_priv.h
index ac51cfe453..3e05042e0c 100644
--- a/usr/src/lib/libscf/inc/libscf_priv.h
+++ b/usr/src/lib/libscf/inc/libscf_priv.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBSCF_PRIV_H
@@ -267,6 +268,11 @@ int scf_set_count_property(scf_transaction_t *, char *, uint64_t, boolean_t);
* else return instances. Must be used in
* conjunction with SCF_WALK_SERVICE.
*
+ * SCF_WALK_UNIPARTIAL Can be combined with SCF_WALK_MULTIPLE
+ * so that an error is returned if a partial
+ * fmri matches multiple instances, unless
+ * a wildcard match is also used.
+ *
* If no arguments are given, then all instances in the service graph are
* walked.
*
@@ -284,6 +290,7 @@ int scf_set_count_property(scf_transaction_t *, char *, uint64_t, boolean_t);
#define SCF_WALK_PROPERTY 0x08
#define SCF_WALK_NOINSTANCE 0x10
#define SCF_WALK_EXPLICIT 0x20
+#define SCF_WALK_UNIPARTIAL 0x40
/*
* The default locations of the repository dbs
diff --git a/usr/src/lib/libshare/nfs/libshare_nfs.c b/usr/src/lib/libshare/nfs/libshare_nfs.c
index 90cb9624e7..3b8fddd327 100644
--- a/usr/src/lib/libshare/nfs/libshare_nfs.c
+++ b/usr/src/lib/libshare/nfs/libshare_nfs.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
@@ -2663,9 +2664,16 @@ nfs_init()
ret = initprotofromsmf();
if (ret != SA_OK) {
- (void) printf(dgettext(TEXT_DOMAIN,
- "NFS plugin problem with SMF repository: %s\n"),
- sa_errorstr(ret));
+ /*
+ * This is a workaround. See the comment in
+ * cmd/fs.d/nfs/lib/smfcfg.c for an explanation.
+ */
+ if (getzoneid() == GLOBAL_ZONEID ||
+ ret != SCF_ERROR_NOT_FOUND) {
+ (void) printf(dgettext(TEXT_DOMAIN,
+ "NFS plugin problem with SMF repository: %s\n"),
+ sa_errorstr(ret));
+ }
ret = SA_OK;
}
add_defaults();
diff --git a/usr/src/lib/libshell/Makefile b/usr/src/lib/libshell/Makefile
index b584728d5f..1cce2316f0 100644
--- a/usr/src/lib/libshell/Makefile
+++ b/usr/src/lib/libshell/Makefile
@@ -64,6 +64,5 @@ $(SUBDIRS): FRC
FRC:
include Makefile.demo
-include Makefile.doc
include ../Makefile.targ
diff --git a/usr/src/lib/libshell/Makefile.doc b/usr/src/lib/libshell/Makefile.doc
deleted file mode 100644
index c822b0bf5c..0000000000
--- a/usr/src/lib/libshell/Makefile.doc
+++ /dev/null
@@ -1,93 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-ROOTDOCDIRBASE= $(ROOT)/usr/share/doc/ksh
-
-DOCFILES= \
- RELEASE \
- README \
- TYPES \
- DESIGN \
- COMPATIBILITY \
- OBSOLETE \
- shell_styleguide.docbook \
- shell_styleguide.html \
- images/tag_bourne.png \
- images/tag_i18n.png \
- images/tag_ksh88.png \
- images/tag_ksh93.png \
- images/tag_ksh.png \
- images/tag_l10n.png \
- images/tag_perf.png \
- images/callouts/1.png \
- images/callouts/2.png \
- images/callouts/3.png \
- images/callouts/4.png \
- images/callouts/5.png \
- images/callouts/6.png \
- images/callouts/7.png \
- images/callouts/8.png \
- images/callouts/9.png \
- images/callouts/10.png
-
-# Documentation rules
-$(ROOTDOCDIRBASE)/%: common/%
- $(INS.file)
-
-$(ROOTDOCDIRBASE)/%: misc/%
- $(INS.file)
-
-ROOTDOCDIRS= \
- $(ROOTDOCDIRBASE) .WAIT \
- $(ROOTDOCDIRBASE)/images .WAIT \
- $(ROOTDOCDIRBASE)/images/callouts
-
-$(ROOTDOCDIRBASE)/%.html: misc/%.docbook
- /usr/bin/xsltproc \
- --nonet \
- --stringparam generate.section.toc.level 0 \
- --stringparam toc.max.depth 3 \
- --stringparam toc.section.depth 12 \
- --xinclude \
- -o "$(@F)" \
- $(DOCBOOK_XSL_ROOT)/html/docbook.xsl \
- "$<" >xsltproc.log 2>&1
- $(INS) -s -m $(FILEMODE) -f "$(@D)" "$(@F)"
- $(RM) "$(@F)"
-
-CLOBBERFILES += xsltproc.log
-
-# Generic documentation rules
-DOCFILESRCDIR= common
-ROOTDOCFILES= $(DOCFILES:%=$(ROOTDOCDIRBASE)/%)
-$(ROOTDOCDIRS) := OWNER = root
-$(ROOTDOCDIRS) := GROUP = bin
-$(ROOTDOCDIRS) := DIRMODE = 755
-
-$(ROOTDOCDIRS):
- $(INS.dir)
-
-install: $(ROOTDOCDIRS) .WAIT $(ROOTDOCFILES)
diff --git a/usr/src/lib/libshell/common/COMPATIBILITY b/usr/src/lib/libshell/common/COMPATIBILITY
deleted file mode 100644
index d4d645a99a..0000000000
--- a/usr/src/lib/libshell/common/COMPATIBILITY
+++ /dev/null
@@ -1,134 +0,0 @@
-
- KSH-93 VS. KSH-88
-
-
-The following is a list of known incompatibilities between ksh-93 and ksh-88.
-I have not include cases that are clearly bugs in ksh-88. I also have
-omitted features that are completely upward compatible.
-
-1. Functions, defined with name() with ksh-93 are compatible with
- the POSIX standard, not with ksh-88. No local variables are
- permitted, and there is no separate scope. Functions defined
- with the function name syntax, maintain compatibility.
- This also affects function traces.
-
-2. ! is now a reserved word. As a result, any command by that
- name will no longer work with ksh-93.
-
-3. The -x attribute of alias and typeset -f is no longer
- effective and the ENV file is only read for interactive
- shells. You need to use FPATH to make function definitions
- visible to scripts.
-
-4. A built-in command named command has been added which is
- always found before the PATH search. Any script which uses
- this name as the name of a command (or function) will not
- be compatible.
-
-5. The output format for some built-ins has changed. In particular
- the output format for set, typeset and alias now have single
- quotes around values that have special characters. The output
- for trap without arguments has a format that can be used as input.
-
-6. With ksh-88, a dollar sign ($') followed by a single quote was
- interpreted literally. Now it is an ANSI-C string. You
- must quote the dollar sign to get the previous behavior.
- Also, a $ in front of a " indicates that the string needs
- to be translated for locales other than C or POSIX. The $
- is ignored in the C and POSIX locale.
-
-7. With ksh-88, tilde expansion did not take place inside ${...}.
- with ksh-93, ${foo-~} will cause tilde expansion if foo is
- not set. You need to escape the ~ for the previous behavior.
-
-8. Some changes in the tokenizing rules where made that might
- cause some scripts with previously ambiguous use of quoting
- to produce syntax errors.
-
-9. Programs that rely on specific exit values for the shell,
- (rather than 0 or non-zero) may not be compatible. The
- exit status for many shell failures has been changed.
-
-10. Built-ins in ksh-88 were always executed before looking for
- the command in the PATH variable. This is no longer true.
- Thus, with ksh-93, if you have the current directory first
- in your PATH, and you have a program named test in your
- directory, it will be executed when you type test; the
- built-in version will be run at the point /bin is found
- in your PATH.
-
-11. Some undocumented combinations of argument passing to ksh
- builtins no longer works since ksh-93 is getopts conforming
- with respect to its built-ins. For example, typeset -8i
- previously would work as a synonym for typeset -i8.
-
-12. Command substitution and arithmetic expansion are now performed
- on PS1, PS3, and ENV when they are expanded. Thus, ` and $(
- as part of the value of these variables must be preceded by a \
- to preserve their previous behavior.
-
-13. The ERRNO variable has been dropped.
-
-14. If the file name following a redirection symbol contain pattern
- characters they will only be expanded for interactive shells.
-
-15. The arguments to a dot script will be restored when it completes.
-
-16. The list of tracked aliases is not displayed with alias unless
- the -t option is specified.
-
-17. The POSIX standard requires that test "$arg" have exit status
- of 0, if and only if $arg is null. However, since this breaks
- programs that use test -t, ksh93 treats an explicit test -t
- as if the user had entered test -t 1.
-
-18. The ^T directive of emacs mode has been changed to work the
- way it does in gnu-emacs.
-
-19. ksh-88 allowed unbalanced parenthes within ${name op val} whereas
- ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(}
- which works with both versions.
-
-20. kill -l in ksh-93 lists only the signal names, not their numerical
- values.
-
-21. Local variables defined by typeset are statically scoped in
- ksh93. In ksh88 they were dynamically scoped although this
- behavior was never documented.
-
-22. The value of the variable given to getopts is set to ? when
- the end-of-options is reached to conform to the POSIX standard.
-
-23. Since the POSIX standard requires that octal constants be
- recongnized, doing arithmetic on typeset -Z variables can
- yield different results that with ksh88. Most of these
- differences were eliminated in ksh93o.
-
-24. Starting after ksh93l, If you run ksh name, where name does
- not contain a /, the current directory will be searched
- before doing a path search on name as required by the POSIX
- shell standard.
-
-25. In ksh93, cd - will output the directory that it changes
- to on standard output as required by X/Open. With ksh88,
- this only happened for interactive shells.
-
-26. As an undocumented feature of ksh-88, a leading 0 to an
- assignment of an integer variable caused that variable
- to be treated as unsigned. This behavior was removed
- starting in ksh93p.
-
-27. The getopts builtin in ksh93 requires that optstring contain
- a leading + to allow options to begin with a +.
-
-28. In emacs/gmacs mode, control-v will not display the version when
- the stty lnext character is set to control-v or is unset.
- The sequence escape control-v will display the shell version.
-
-29. In ksh88, DEBUG traps were executed. after each command. In ksh93
- DEBUG traps are exeucted before each command.
-
-30. In ksh88, a redirection to a file name given by an empty string was
- ignored. In ksh93, this is an error.
-I am interested in expanding this list so please let me know if you
-uncover any others.
diff --git a/usr/src/lib/libshell/common/DESIGN b/usr/src/lib/libshell/common/DESIGN
deleted file mode 100644
index c11c0aff1e..0000000000
--- a/usr/src/lib/libshell/common/DESIGN
+++ /dev/null
@@ -1,170 +0,0 @@
-Here is an overview of the source code organization for ksh93.
-
-Directory layout:
-
- The directory include contains header files for ksh93.
- The files nval.h and shell.h are intended to be public
- headers and can be used to add runtime builtin command.
- The remainder are private.
-
- The directory data contains readonly data files for ksh93.
- The man pages for built-ins are in builtins.c rather
- than included as statics with the implementations in the
- bltins directory because some systems don't make static const
- data readonly and we want these to be shared by all running
- shells.
-
- The directory edit contains the code for command line
- editing and history.
-
- The fun directory contains some shell function such as
- pushd, popd, and dirs.
-
- The directory features contains files that are used to generate
- header files in the FEATURE directory. Most of these files
- are in a format that is processed by iffe.
-
- The directory bltins contains code for most of the built-in
- commands. Additional built-in commands are part of libcmd.
-
- The directory sh contains most of the code for ksh93.
-
- The directory tests contains a number of regression tests.
- In most cases, when a bug gets fixed, a test is added to
- one of these files. The regression tests can be run by
- going to this directory and running
- SHELL=shell_path shell_path shtests
- where shell_path is an absolute pathname for the shell to
- be tested.
-
- The top level directory contains the nmake Makefile, a README,
- and several documentation files. The RELEASE file contains
- the list of bug fixes and new features since the original
- ksh93 release. The file COMPATIBILITY is a list of all
- known incompatibilities with ksh88.
-
- The bash_pre_rc.sh is a startup script used when emulating
- bash if the shell is compiled with SHOPT_BASH and the shell
- is invoked as bash. The bash emulation is not complete.
-
-Include directory:
- 1. argnod.h contains the type definitions for command
- nodes, io nodes, argument nodes, and for positional
- parameters.a It defines the prototypes for
- all the positional parameters functions.
- 2. builtins.h contains prototypes for builtins as well
- as symbolic constants that refer to the name-pairs
- that are associated with some of the built-ins.
- It also contains prototypes for many of the strings.
- 3. defs.h is the catch all for all definitions that
- don't fit elsewhere and it includes several other
- headers. It defines a strucuture that contains ksh
- global data, sh, and a structure that contains per
- function data, sh.st.
- 4. edit.h contains definitions that are common to both
- vi and emacs edit modes.
- 5. env.h contains interfaces for creating and modifying
- environment variables.
- 6. fault.h contains prototypes for signal related
- functions and trap and fault handling.
- 7. fcin.h contains macro and function definitions for
- reading from a file or string.
- 8. history.h contains macros and functions definitions
- related to history file processing.
- 9. jobs.h contains the definitions relating to job
- processing and control.
- 10. lexstates.h contains the states associated with
- lexical processing.
- 11. name.h contains the internal definitions related
- to name-value pair processing.
- 12. national.h contains a few I18N definitions, mostly
- obsolete.
- 13. nval.h is the public interface to the name-value
- pair library that is documented with nval.3.
- 14. path.h contains the interface for pathname processing
- and pathname searching.
- 15. shell.h is the public interface for shell functions
- that are documented int shell.3.
- 16. shlex.h contains the lexical token definitions and
- interfaces for lexical analysis.
- 17. shnodes.h contains the definition of the structures
- for each of the parse nodes and flags for the attributes.
- 18. shtable.h contains some interfaces and functions for
- table lookup.
- 19. streval.h contains the interface to the arithmetic
- functions.
- 20. terminal.h is a header file that includes the appropriate
- terminal include.
- 21. test.h contains the definitions for the test and [[...]]
- commands.
- 22. timeout.h contains the define constant for the maximum
- shell timeout.
- 23. ulimit.h includes the appropriate resource header.
- 24. variables.h contains symbolic constants for the built-in
- shell variables.
-
-sh directory:
- 1. args.c contains functions for parsing shell options
- and for processing positional parameters.
- 2. arith.c contains callback functions for the streval.c
- library and the interface to shell arithmetic.
- 3. array.c contains the code for indexed and associative
- arrays.
- 4. bash.h contains code used when compiling with SHOPT_BASH
- to add bash specific features such as shopt.
- 5. defs.c contains the data definitions for global symbols.
- 6. deparse.c contains code to generate shell script from
- a parse tree.
- 7. env.c contains code to add and delete environment variables
- to an environment list.
- 8. expand.c contains code for file name expansion and
- file name generation.
- 9. fault.c contains code for signal processing, trap
- handling and termination.
- 10. fcin.c contains code for reading and writing a character
- at a time from a file or string.
- 11. init.c contains initialization code and callbacks
- for get and set functions for built-in variables.
- 12. io.o contains code for redirections and managing file
- descriptors and file streams.
- 13. jobs.c contains the code for job management.
- 14. lex.c contains the code for the lexical analyzer.
- 15. macro.c contains code for the $ macro expansions, including
- here-documents.
- 16. main.c contains the calls to initialization, profile
- processing and the main evaluation loop as well as
- mail processing.
- 17. name.c contains the name-value pair routines that are
- built on the hash library in libast.
- 18. nvdisc.c contains code related to name-value pair disciplines.
- 19. nvtree.c contains code for compound variables and for
- walking the namespace.
- 20. nvtype.c contains most of the code related to types that
- are created with typeset -T.
- 21. parse.c contains the code for the shell parser.
- 22. path.c contains the code for pathname lookup and
- some path functions. It also contains the code
- that executes commands and scripts.
- 23. pmain.c is just a calls sh_main() so that all of the
- rest of the shell can be in a shared library.
- 24. shcomp.c contains the main program to the shell
- compiler. This program parses a script and creates
- a file that the shell can read containing the parse tree.
- 25. streval.c is an C arithmetic evaluator.
- 26. string.c contains some string related functions.
- 27. subshell.c contains the code to save and restore
- environments so that subshells can run without creating
- a new process.
- 28. suid_exec.c contains the program from running execute
- only and/or setuid/setgid scripts.
- 29. tdump.c contains the code to dump a parse tree into
- a file.
- 30. timers.c contains code for multiple event timeouts.
- 31. trestore contians the code for restoring the parse
- tree from the file created by tdump.
- 32. userinit.c contains a dummy userinit() function.
- This is now obsolete with the new version of sh_main().
- 33. waitevent.c contains the sh_waitnotify function so
- that builtins can handle processing events when the
- shell is waiting for input or for process completion.
- 34. xec.c is the main shell executuion loop.
diff --git a/usr/src/lib/libshell/common/OBSOLETE b/usr/src/lib/libshell/common/OBSOLETE
deleted file mode 100644
index c29cb8bb63..0000000000
--- a/usr/src/lib/libshell/common/OBSOLETE
+++ /dev/null
@@ -1,152 +0,0 @@
-.sp 3
-.tl ''Ksh Features That Are Obsolete in Ksh93''
-.sp 2
-.AL 1
-.LI
-Using a pair of grave accents \^\fB\(ga\fR ... \fB\(ga\fR\^
-for command substition. Use \fB$(\fR ... \fB)\fR instead.
-.LI
-.B FCEDIT
-is an obsolete name for
-the default editor name for the
-.B hist
-command.
-.B FCEDIT
-is not used when
-.B HISTEDIT
-is set. Use
-.B HISTEDIT
-instead.
-.LI
-The newtest (\fB[[\fR ... \fB]]\fR) operator
-\fB\-a\fP \fIfile\fP
-is obsolete. Use
-\fB\-e\fP instead.
-.LI
-The newtest (\fB[[\fR ... \fB]]\fR) operator
-.BR = ,
-as used in
-\fIstring\fP \fB=\fP \fIpattern\fP
-is obsolete. Use
-\fB==\fP instead.
-.LI
-The following obsolete arithmetic comparisons are also permitted:
-.in +5
-.VL 20
-.LI "\fIexp1\fP \fB\-eq\fP \fIexp2\fP"
-True, if
-.I exp1
-is equal to
-.IR exp2 .
-.LI "\fIexp1\fP \fB\-ne\fP \fIexp2\fP"
-True, if
-.I exp1
-is not equal to
-.IR exp2 .
-.LI "\fIexp1\fP \fB\-lt\fP \fIexp2\fP"
-True, if
-.I exp1
-is less than
-.IR exp2 .
-.LI "\fIexp1\fP \fB\-gt\fP \fIexp2\fP"
-True, if
-.I exp1
-is greater than
-.IR exp2 .
-.LI "\fIexp1\fP \fB\-le\fP \fIexp2\fP"
-True, if
-.I exp1
-is less than or equal to
-.IR exp2 .
-.LI "\fIexp1\fP \fB\-ge\fP \fIexp2\fP"
-True, if
-.I exp1
-is greater than or equal to
-.IR exp2 .
-.LE \" End .VL
-.in -5
-.LI
-Using test -t or [ -t ] without specifying the file unit number.
-.LI
-The
-.B \-k
-option to the \fBset\fR builtin is obsolete. It causes
-.I all\^
-variable assignment arguments are placed in the environment,
-even if they occur after the command name.
-The following
-first prints
-.B "a=b c"
-and then
-.BR c :
-There is no alternative.
-.LI
-The obsolete
-.B \-xf
-option of the
-.B typeset
-command allows a function to be exported
-to scripts that are executed without a separate
-invocation of the shell.
-Functions that need to be defined across separate
-invocations of the shell should
-be placed in a directory and the
-.B FPATH
-variable should contains the name of this directory.
-They may also
-be specified in the
-.B ENV
-file with the
-.B \-xf
-option of
-.BR typeset .
-.LI
-The shell environment variable
-.B FCEDIT
-is obsolete. Use
-.B HISTEDIT
-instead.
-.LI
-In the
-.B \-s
-option
-(to \fBfc\fR or \fBhist\fR command???)
-(
-and in obsolete versions, the editor name
-.B \-
-)
-is used to skip the editing phase and
-to re-execute the command.
-.LI
-The
-.B \-t
-option to \fBalias\fR builtin is is obsolete. It
-is used to set and list tracked aliases.
-There is no replacement.
-.LI
-The shell command line option
-.B \-t
-is obsolete. This option cause the shell to exit after reading
-and executing one command. The is no replacement (although ending
-\&"command" with the exit builtin should have the same effect).
-.LI
-As an obsolete feature of the "set" builtin,
-if the first
-.I arg\^
-is
-.B \-
-then the
-.B \-x
-and
-.B \-v
-options are turned off and the next
-.I arg
-is treated as the first argument.
-Using
-.B \+
-rather than
-.B \-
-causes these options to be turned off.
-These options can also be used upon invocation of the shell.
-.LE
-
diff --git a/usr/src/lib/libshell/common/README b/usr/src/lib/libshell/common/README
deleted file mode 100644
index 1feeec8a90..0000000000
--- a/usr/src/lib/libshell/common/README
+++ /dev/null
@@ -1,232 +0,0 @@
-This directory, and its subdirectories contain the source code
-for ksh-93; the language described in the second addition of
-the book, "The KornShell Command and Programming Language," by
-Morris Bolsky and David Korn which is published by Prentice Hall.
-ksh-93 has been compiled and run on several machines with several
-operating systems. The end of this file contains a partial list of
-operating systems and machines that ksh-93 has been known to run on.
-
-The layout of files for ksh-93 has changed somewhat since ksh-88,
-the last major release. Most of the source code for ksh remains in
-the sh directory. However, the shell editing and history routines
-are in the edit sub-directory. The code for shell built-ins is
-in the bltins directory. The data directory contains read-only
-data tables and messages that are used by the shell. The include
-files remain in the include directory and the shlib directory
-is gone. The features directory replaces the older install
-directory. The method for generating systems specific feature
-information has changed substantially.
-
-The Makefile file contains several compilation options that can be set
-before compiling ksh. Options are of the form SHOPT_option and become
-#define inside the code. These options are set to their recommended
-value and some of these may disappear as options in future releases.
-A value of 0, or no value represents off, 1 represents on.
-Note that == is needed, not =, because these are nmake state variables
-and changing their value will cause all modules that could be affected
-by this change to be recompiled.
-The options have the following defaults and meanings:
- ACCT off Shell accounting.
- ACCTFILE off Enable per user accounting info.
- AUDIT off For auditing specific users
- AUDITFILE "/etc/ksh_audit"
- APPEND on Allows var+=val string and array append.
- BASH off Bash compatibility mode. It is not fully implemented
- and is experimental.
- BRACEPAT on C-shell type abc{d,e}f style file generation
- CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The
- SH_CMDLIB_DIR nmake state variable can be used to
- specify a directory.
- CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value
- of "/opt/ast/bin" for SH_CMDLIB_DIR.
- COMPOUND_ARRAY
- on Allows all components of compound variables except the
- first to be any string by enclosing in [...]. It also
- allows components other than the last to be arrays.
- This is experimental and only partially complete.
- CRNL off <cr><nl> treated as <nl> in shell grammar.
- DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
- ECHOPRINT off Make echo equivalent to print.
- ESH on Compile with emacs command line editing. The original
- emacs line editor code was provided by Mike Veach at IH.
- FILESCAN on Experimental option that allows fast reading of files
- using while < file;do ...; done and allowing fields in
- each line to be accessed as positional parameters.
- FS_3D off For use with 3-D file system. Enabled automatically for
- sytems with dynamic linking.
- KIA off Allow generation of shell cross reference database with -I.
- MULTIBYTE on Multibyte character handling. Requires mblen() and
- mbctowc().
- NAMESPACE on Allows namespaces. This is experimental, incomplete
- and undocumented.
- OLDTERMIO off Use either termios or termio at runtime.
- OO on Experimental object oriented extension. This option
- should disappear soon.
- OPTIMIZE on Optimize loop invariants for with for and while loops.
- P_SUID off If set, all real uids, greater than or equal to this
- value will require the -p flag to run suid/sgid scripts.
- PFSH off Compile with support for profile shell.
- RAWONLY off Turn on if the vi line mode doesn't work right unless
- you do a set -o viraw.
- SEVENBIT off Strip the eigth bit from characters.
- SPAWN off Use spawn as combined fork/exec. May improve speed on
- some systems.
- STATS on Add .sh.stats compound variable.
- SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script.
- TIMEOUT off Set this to the number of seconds for timing out and
- exiting the shell when you don't enter a command. If
- non-zero, TMOUT can not be set larger than this value.
- TYPEDEF on Enable typeset type definitions.
- VSH on Compile with vi command line editing. The original vi
- line editor code was provided by Pat Sullivan at CB.
-
-The following compile options are set automatically by the feature testing:
- DEVFD Set when /dev/fd is a directory that names open files.
- SHELLMAGIC
- Set on systems that recognize script beginning with #! specially.
- VPIX Set on systems the have /usr/bin/vpix program for running MS-DOS.
-
-
-In most instances, you will generate ksh from a higher level directory
-which also generates libcmd and libast libraries on which ksh depends.
-However, it is possible to generate ksh, with by running make -f ksh.mk
-in this directory. The ksh.mk file was generated from the nmake Makefile.
-If you do not have make or nmake, but do have a Version 7 UNIX compatible
-shell, then you can run the script mamexec < Mamfile to build ksh.
-If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk.
-In either case, ksh relies on libraries libast and libcmd which must be
-built first. The binary for ksh becomes the file named ./ksh which can
-be copied to where ever you install it.
-
-If you use old make or the Mamfile, and you system has dynamic shared
-libraries, then you should define the variables mam_cc_static and
-mam_cc_dynanamic as the compiler options that request static linking
-and dynamic linking respectively. This will decrease the number of
-shared libraries that ksh need and cut startup time substantially.
-
-The makefile should also generate shcomp, a program that will precompile
-a script. ksh93 is able to recognize files in this format and process
-them as scripts. You can use shcomp to send out scripts when you
-don't want to give away the original script source.
-
-It is advisable that you put the line PWD=$HOME;export PWD into the
-/etc/profile file to reduce initialization time for ksh.
-
-To be able to run setuid/setgid shell scripts, or scripts without read
-permission, the SUID_EXEC compile option must be on, and ksh must be installed
-in the /bin directory, the /usr/bin directory, the /usr/lbin directory,
-or the /usr/local/bin directory and the name must end in sh. The program
-suid_exec must be installed in the /etc directory, must be owned by root,
-and must be a suid program. If you must install ksh in some other directory
-and want to be able to run setuid/setgid and execute only scripts, then
-you will have to change the source code file sh/suid_exec.c explicitly.
-If you do not have ksh in one of these secure locations, /bin/sh will
-be invoked with the -p options and will fail when you execute a setuid/setgid
-and/or execute only script. Note, that ksh does not read the .profile
-or $ENV file when it the real and effective user/group id's are not
-equal.
-
-The tests sub-directory contains a number of regression tests for ksh.
-To run all these tests with the shell you just built, go to the tests
-directory and run the command
- SHELL=$dir/ksh $dir/ksh shtests
-where dir is the directory of the ksh you want to test.
-
-The file PROMO.mm is an advertisement that extolls the virtues of ksh.
-The file sh.1 contains the troff (man) description of this Shell.
-The file nval.3 contains the troff (man) description of the name-value
-pair library that is needed for writing built-ins that need to
-access shell variables.
-
-The file sh.memo contains a draft troff (mm) memo describing ksh. The
-file RELEASE88 contains the changes made for ksh88. The file RELEASE93
-contains the changes made in this release since ksh-88. The file
-RELEASE contains bug fixes made in this release since ksh-88. The file
-COMPATIBILITY contains a list of incompatibilities with ksh-88. The
-file bltins.mm is a draft troff (mm) memo describing how to write
-built-in commands that can be loaded at run time.
-
-Most of the work for internationalization has been done with ksh93.
-The file ksh.msg is a generated file that contains error messages
-that need to be translated. In addition, the function translate()
-in sh/init.c has to be completed to interface with the dictionary
-lookup. The translate function takes two argument, the string
-that is to be translated and a type which is
- 0 when a library string needs translation.
- 1 when one of the error messages in ksh.msg needs translation.
- 2 when a string in a script needs translation. You use a $ in front
- of a double quoted string in a script to indicate that it
- needs translation. The -D option for ksh builds the dictionary.
-The translate routine needs to return the translated message.
-For dictionaries that need to use a numeric key, it should be
-possible to use the strhash() function to generate numbers to
-go along with each of the messages and to use this number both
-when generating the dictionary and when converting strings.
-If you encounter error messages of type 1 that are not be translated via
-this translate() function send mail to the address below.
-
-Please report any problems or suggestions to:
-
-dgk@research.att.com
-
-
-ksh93 has been compiled and alpha tested on the following. An asterisk
-signifies that ksh has been installed as /bin/sh on this machine.
-
-* Sun OS 4.1.[123] on sparc.
- Sun OS 4.1.1 on sun.
- Solaris 2.[1-9] on sparc.
- Solaris 2.[4-8] on X86.
- HP/UX 8 on HP-9000/730.
- HP/UX 9 on HP-9000/730.
- HP/UX 10 on HP-9000/857.
- HP/UX 11 on pa-risc.
- System V Release 3 on Counterpoint C19
- System V Release 4 on AT&T Intel 486.
- System V Release 4 on NCR 4850 Intel 486.
- IRIX Release 4.0.? System V on SGI-MIPS.
- IRIX Release 5.1 System V on SGI-MIPS.
- IRIX Release 6.[1-5] System V on SGI-MIPS.
- System V Release 3.2 on 3B2.
- UTS 5.2.6 on Amdahl 3090,5990,580.
- System V Release 3.2 on i386.
- SMP_DC.OSx olivetti dcosx MIServer-S 2/128.
- SMP_DC.OSx Pyramid dcosx MIServer-S 2/160 r3000.
- 4.3BSD on Vax 8650.
- AIX release 2 on RS6000.
- AIX 3.2 on RS6000.
- Linux 1.X on Intel
- Linux 2.X on Intel
- Linux 2.X on Alpha
- Linux 2.X on Alpha
- Linux 2.X on OS/390
- Linux 2.X on sparc
- Linux 2.4 on intel itanium 64
- Linux Slackware on sparc64
-* Linux ARM on i-PAQ
- OSF1 on DEC alpha.
- OSF4 on DEC alpha.
- UMIPS 4.52 on mips.
- BSD-i [2-4] on X86.
- OpenBSD on X86
- NetBSD on X86
- FreeBSD on X86
- NeXT on Intel X86.
- NeXT on HP.
-* Windows NT using UWIN on X86
-* Windows NT using UWIN on alpha
- Windows NT using Cygwin on X86
- Windows NT with NutCracker libraries.
- Windows NT with Portage libraries.
- Windows 3.1 using custom C library.
- OpenEdition on MVS
- Darwin OS X on PPC
- MVS on OS 390
- SCO Openserver 3.2 on X86
- Unixware 7 on X86
-
-Good luck!!
-
-David Korn
-dgk@research.att.com
-
diff --git a/usr/src/lib/libshell/common/RELEASE b/usr/src/lib/libshell/common/RELEASE
deleted file mode 100644
index b8fc92511a..0000000000
--- a/usr/src/lib/libshell/common/RELEASE
+++ /dev/null
@@ -1,2204 +0,0 @@
-10-03-05 --- Release ksh93t+ ---
-10-03-05 A varibale unset memory leak has been fixed and tests/leaks.sh
- has been added to verify the fix.
-10-03-04 Documentation, comment, and disgnostic spelling typos corrected.
-10-02-14 Fix sh_getenv() initialization to cooperate with the 3d fs.
-10-02-12 A bug in which the get discipline function was not invoked for
- associative array subscripts for unset array elements has been fixed.
-10-02-12 A bug which could occur if the last line of a script was an eval
- that executed multiple commands has been fixed.
-10-02-02 A buffer overflow in read and another in binary type base64
- encoding were fixed.
-10-01-20 A bug in the evaluation of arithmetic expression in which the
- subscript was evaluated twice for $((foo[x++]++)) has been fixed.
-10-01-19 A workaround for a double-free of a trap in both a subshell and its
- parent has been added.
-10-01-18 A bug in type handling of typeset -H has been fixed.
-10-01-15 The "adding empty subscript" warning now only emitted with -x set.
-10-01-01 A bug in the parser in which '$((case i in i):;esac);:))' was not
- parsed correctly was fixed.
-10-01-01 A bug in the parser in which '$(( 2 , 3.6 ))' dumped core for locales
- with radix char , and thousands separator . has been fixed.
-09-12-28 A bug in the handling of SIGCLD on systems that generated SIGCLD
- while blocked waiting for process to complete has been fixed.
-09-12-24 ast setlocale() reworked to differentiate env var changes from user
- override.
-09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals
- < SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed.
-09-12-18 A bug where [[ -v var ]] was incorrect for some variables (including
- LC_* vars) has been fixed.
-09-12-15 A bug that produced a syntax error when a multibyte character
- straddled a buffer boundary has been fixed.
-09-12-11 A bug where the subscript of an unset variable was not evaluated has
- been fixed.
-09-12-09 A bug where shcomp dumped core on certain syntax errors has been fixed.
-09-12-07 A bug where a parent shell environment var reset in a subshell removed
- the value in subsequent children of the parent shell has been fixed.
-09-12-04 A bug in which in some cases a trap in a function executed in
- a subshell could trigger twice has been fixed.
-09-12-03 A bug in which SHLVL exported with some attributes could cause
- the shell to abort at startup has been fixed.
-09-12-02 A bug with pipefail in which the shell could hang waiting for the
- writer to complete before the last reader command has been fixed.
-09-11-30 A bug in which a trap could be inherited by the first element of
- a pipeline when the command had more than 63 arguments that did
- not contain any macro expansions has been fixed.
-09-11-19 When read from a terminal was called from with a while or foo loop,
- and an edit mode was on, a backspace or erase no longer will
- overwrite the prompt.
-09-11-17 Change .paths parse to handle BUILTIN_LIB=foo BUILTIN_LIB=foo-1.2.
-09-11-17 Inside a function, typeset foo.bar will bind foo to global variable
- foo if local variable foo does not exist, instead of creating a
- local variable.
-09-11-17 "read -n1" from the terminal has been fixed to read exactly one character.
-09-11-11 Job control now works for subshell commands, (...).
-09-11-11 If set -e is on for an interactive shell errors in special builtins
- now cause the shell to exit.
-09-11-11 A bug in which an interrupt handler processed during the read builtin
- when IFS did not contain a new line has been fixed.
-09-11-09 A bug in which a variable that has been unset in a subshell and then
- exported from that subshell does not show up in the environment
- has been fixed.
-09-11-02 ``,2'' is now a valid numeric constant for locales with
- decimal_point=','.
-09-11-02 A bug where "return" in .profile did not restore the shell state
- has been fixed.
-09-10-31 A bug that corrupted saved exit status when pids wrapped around has
- been fixed.
-09-10-26 A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last.
-09-10-16 A bug where notification to libast that the environment has changed
- has been fixed.
-09-10-12 A bug in which a function loaded in a subshell could leave side
- effects in the parent shell has been fixed.
-09-10-12 A bug in converting a printf %d operand to a number when the operand
- contains multiple subscripts for the same variable has been fixed.
-09-10-09 A bug in the handling of the escape character \ in directory prefixes
- in command completion has been fixed.
-09-10-09 $PATH processing has been changed to delay dir stat() and .paths
- lookup until the directory is needed in the path search.
-09-09-28 Call the ast setlocale() intercept on unset too.
-09-09-24 A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert
- LC_CTYPE etc. to the LANG value has been fixed.
-09-09-17 A bug in which unsetting SVLVL could cause a script invoked by
- name without #! to core dump has been fixed.
-09-09-16 A bug in which a pipeline in a here-document could hang when the
- pipefail option was on has been fixed.
-09-09-09 A bug in the processing of line joining in here documents which
- occurred when a buffer began with <escape><new-line> has been fixed.
-09-09-09 A leading ; with commands in a brace group or parenthesis group
- no longer causes an error. It now is used for the "showme" option.
-09-09-09 A bug in which a subshell containing a background process could
- block until the background process completed has been fixed.
-09-09-04 A bug in handing ${var[sub]}, where var is a nameref has been fixed.
-09-09-03 A bug which caused an index array to have the wrong number of elements
- when it was converted from a compound variable by adding an another
- element has been fixed.
-09-09-03 Specifying export for a compound variable now generates an error.
-09-09-02 $"..." localizations strings are no longer recognized inside `...`.
-09-09-01 A bug in the for loop optimizer in the handling of type static
- variables has been fixed.
-09-09-01 An error message is not displayed when * and @ are used as subscripts.
-09-09-01 Several bugs in the processing for types that included an associative
- array of another type has been fixed.
-09-09-01 A bug in the tracing of [[ a < b ]] and [[ a > b ]] has been fixed.
-09-08-26 The .sh.file variable was not being set for a script that was run
- by name and didn't start with #! and this has been fixed.
-09-08-25 A bug in which a function called to deeply from command substitution
- did not display an error message has been fixed.
-09-08-24 When processing profiles, ksh93 now violates the POSIX standard and
- treats &> as a redirection operator similar to bash.
-09-08-23 A bug in the handling of the trap on SIGPIPE that could lead to a
- memory fault has been fixed.
-09-08-21 A bug in the handling of the comma operator in arithmetic expressions
- that could cause a core dump on some systems has been fixed.
-09-08-20 A bug in which a compound variable containing an array of a type
- that doesn't have any elements now expands correctly.
-09-08-19 A bug which disabled function tracing inside a function after
- a call to another function has been fixed.
-09-08-19 A bug in which initializing a compound variable instance to another
- compound variable by name has been fixed.
-09-08-18 A bug in which compound variable instances could be lost after
- an instance that invoked a type method discipline has been fixed.
-09-08-18 A bug in which a discipline function for a type applied to an
- array instance when invoked in a function ignored the subscript
- has been fixed.
-09-08-18 A scoping error with variables in arithmetic expression with
- type variables when reference with a name reference has been fixed.
-09-08-10 Several memory leaks were fixed primarily related to subshells.
-09-08-06 A bug in which setting the trap on CHLD to ignore could cause
- a script to hang has been fixed.
-09-07-08 A bug in the processing of name reference assignments when it
- contained pattern expansions with quoting has been fixed.
-09-06-22 The default width for typeset -X has been changed so that there
- should be no loss of precision when converting to a string.
-09-06-19 A bug in the printing of array elements for binary variables with
- printf %B has been fixed.
-09-06-19 A bug which caused a core dump with trap DEBUG set with an array
- assignment with no elements has been fixed.
-09-06-19 A bug with read with typeset -b -Z<num> has been fixed.
-09-06-19 Two bugs related to read -b for array variables has been fixed.
-09-06-19 A bug with typeset for compound variables containing arrays of
- compound variables has been fixed.
-09-06-18 A bug in appending a compound variable to a an indexed array of
- compound variables has been fixed.
-09-06-18 A bug which occurs when appending a compound variable to an indexed
- array element has been fixed.
-09-06-18 Setting VISUAL to a value other than one ending in vi or emacs will
- no longer unset the edit mode.
-09-06-17 A bug in typeset -m when moving a local compound variable to a
- global compound variable via a name reference has been fixed.
-09-06-17 A bug in appending to nodes of an array of compound variables when
- addressing them via nameref has been fixed.
-09-06-17 A bug in typeset -p var, when var is an array of compound variables
- in which the output only contained on array element has been fixed.
-09-06-17 The prefix expansion ${!y.@} now works when y is a name
- reference to an element of an array.
-09-06-16 Traps on signals that are ignored when the shell is invoked
- no longer display. Previously they were ignored as required but
- would be listed with trap -p.
-09-06-12 A bug in vi edit mode in which hitting the up arrow key at the
- end of a line longer than 40 characters which caused a core dump
- has been fixed.
-09-06-11 A bug in which "eval non-builtin &" would create two processes,
- one for the & and another for non-builtin has been fixed.
-09-06-08 When var is an identifier and is unset, ${var} no longer tries to
- run command substitution on the command var.
-09-06-08 Process substitution arguments of the form <(command) can now be
- used following the < redirection operator to redirect from command.
-09-05-13 A bug in which redirections of the form 2>&1 1>&5 inside command
- substitution could cause the command substitution to hang has been
- fixed.
-09-05-12 To conform with POSIX, the -u option only checks for unset variables
- and subscript elements rather than checking for all parameters.
-09-05-12 A bug which could cause a core dump when a variable whose name
- begins with a . was referenced as part of a name reference inside
- a function has been fixed.
-09-05-01 A bug that caused a core dump when SIGWINCH was received and
- both vi and emacs mode were off has been fixed.
-09-04-22 Default alias compound='typeset -C' added.
-09-04-15 A bug that caused ${...;} to hang for large files has been fixed.
-09-04-08 A change was made in the -n option which printed out an incorrect
- warning with <>.
-09-04-07 The emacs edit command M-_ and M_. and the vi command _ was fixed
- to handle the case there there is no history file.
-09-04-05 A bug in handling new-lines with read -n has been fixed.
-09-04-05 The ENV variable defaults the the file named by $HOME/.kshrc rather
- then to the string $HOME/.kshrc.
-09-03-31 A bug in which a nested command substitution with redirections could
- leave a file descriptor open has been fixed.
-09-03-24 ksh now only uses the value of the _ variable on startup if it can
- verify that it was set by the invoking process rather than being
- inherited by some other ancestor.
-09-03-24 When ksh is invoked without -p and ruid!=euid, and the shell is
- compiled without SHOPT_P_UID or ruid<SHOPT_P_UID, the shell now
- enables the -p option. The previous version instead set the
- euid to the ruid as it does for set +p.
-09-03-24 When SHOPT_P_UID is defined at compile time and the shell is started
- without -p and ruid!=euid and ruid>=SHOPT_P_UID then euid is set
- to ruid. A bug that did the wrong test (ruid<SHOPT_P_UID) was fixed.
-09-03-17 The sleep(1) builtin now accept and ISO 8601 PnYnMnDTnHnMnS
- duration or date(1) compatible date/time operand.
-09-03-10 If a variable that was left or right justified or zero-filled was
- changed with a typeset statement that was left or right justified
- or zero-filled, then the original justification no longer affects
- the result.
-09-03-10 A bug in the handling of traps when the last command in a script
- is a subshell grouping command has been fixed.
-09-03-03 A bug in which an expansion of the form ${!prefix@} could generate
- an exception after the return from a function has been fixed.
-09-02-02 A bug in restricted mode in which the value of ENV could be
- changed from within a function has been fixed.
-09-02-02 A bug in which an erroneous message indicating that a process
- terminated with a coredump has been fixed.
-09-02-02 The exit status when exit was called without an argument from
- a signal handler was incorrect and has been fixed.
-09-02-02 A bug in which a function autoloaded in a subshell could cause
- a core dump when the subshell completed has been fixed.
-09-02-02 A bug in which 2>&1 inside a command substitution wasn't working
- correctly has been fixed.
-09-02-02 A bug in the call stack of arithmetic function with 2 args
- returning int has been fixed.
-09-01-30 A bug in which 'eval print \$0' inside a function was giving the
- wrong value for $0 has been fixed.
-09-01-28 A bug in which a command substitution could return an exit status
- of 127 when the pipefail option is enabled has been fixed.
-09-01-26 ksh93 now generates an error message if you attempt to create
- a global name reference to a local variable.
-09-01-26 The [[ -v var ]] operator was modified to test for array elements.
-09-01-23 The redirection operator <>; was added. It is similar to <>
- except that if the command it is applied to succeeds, the file
- is truncated to the offset at the command completion.
-09-01-23 The default file descriptor for <> was changed to 1.
-09-01-20 A bug in which the exit status specified in an exit trap was
- not used when a process terminated with a signal has been fixed.
-09-01-19 A bug in which a signal whose default action is to terminate
- a process could be ignored when the process is running a sub-shell
- has been fixed.
-09-01-19 A bug in which sending SIGWINCH to a process that reads from a pipe
- could cause a memory fault has been fixed.
-09-01-16 The -R unary operator was added to [[...]] and test to check whether
- a variable is a name reference.
-09-01-16 The -v unary operator was added to [[...]] and test to check whether
- a variable is set.
-09-01-14 The unset built-in was modified to return 0 exit status when
- unsetting a variable that was unset to conform with the POSIX
- standard.
-09-01-14 The unset built-in was modified to continue to unset variables
- after encountering a variable that it could not unset to
- conform to the POSIX standard.
-09-01-14 The parameter expansion ${x+value} no longer expands the value of
- the variable x when determining whether x is set or not.
-09-01-13 A bug in which background jobs and pipelines that were not waited
- for could, in rare instances, cause the shell to go into an infinite
- loop or fail has been fixed.
-09-01-06 A bug in indexed arrays of compound variables in which referencing
- non-existent sub-variable in an arithmetic expression could cause
- the sub-variable to be created has been fixed.
-09-01-05 A bug in which the \ character did not escape extended regular
- expression pattern characters has been fixed.
-08-12-24 A bug in which killing the last element of a pipe did not cause
- a write to the pipe to generate a SIGPIPE has been fixed.
-08-12-19 A bug which could cause command substitution to hang when the
- last element of a pipeline in a command substitution was a built-in
- and the output was more that PIPE_BUFF.
-08-12-18 A bug which occurs when a here documented marker embedded in a
- command substitution occurs on a buffer boundary has been fixed.
-08-12-17 A bug in the output of typeset -p for variables that had attributes
- but did not have a value has been fixed.
-08-12-16 A bug in which a name reference to a name reference variable that
- references an array element has been fixed.
-08-12-16 A bug in which a variable given both the -A and -C attribute along
- with an initial assignment didn't work correctly has been fixed.
-08-12-10 The [[ -t fd ]] test was fixed to handle fd>9.
-08-12-10 A bug where function stack misalignment could cause a bus error
- has been fixed.
-08-12-09 Command completion was changed to use \ to quote special characters
- instead of quoting the argument in single quotes.
-08-12-07 A bug in typeset -m which occurred when the target node was an
- associative array element has been fixed.
-08-12-07 A timing bug on some systems (for example darwin), that could
- cause the last process of a pipeline entered interactively to fail
- with an "Exec format error" has been fixed.
-08-12-04 SHOPT_BGX enables background job extensions. Noted by "J" in
- the version string when enabled. (1) JOBMAX=n limits the number
- of concurrent & jobs to n; the n+1 & job will block until a
- running background job completes. (2) SIGCHLD traps are queued
- so that each completing background job gets its own trap; $! is
- set to the job pid and $? is set to the job exit status at the
- beginning of the trap. (3) sleep -s added to sleep until the time
- expires or until a signal is delivered.
-08-12-04 The sign of floating point zero is preserved across arithmetic
- function calls.
-08-12-04 A bug that caused print(1) to produce garbled stdout/stderr
- output has been fixed.
-08-12-04 A bug in which printf "%d\n" "'<euro>'" did not output the
- numerical value of the EURO symbol, 8354, has been fixed.
-08-11-24 /dev/fd* and /dev/std* redirections are first attempted with
- open() to preserve seek semantics; failing that the corresponding
- file descriptors are dup()'d.
-08-11-20 A bug which could cause a core dump if a function compiled with
- shcomp was found has been fixed.
-08-11-20 A bug in which jobs were not cleared from the jobs table for
- interactive shells when the pipefail option is on has been fixed.
-08-11-11 A bug in which a field that was unset in a type definition and later
- set for an instance could appear twice when displaying the variable
- has been fixed.
-08-11-11 A bug in which running a simple command & inside a function would
- not return the correct process id has been fixed.
-08=11-10 A bug in which the exit status of a command could be lost if the pid
- was that of the most recent command substitution that had completed
- has been fixed.
-08-11-10 The maximum depth for subshells has been increased from 256 to 65536.
-08-11-06 A bug which could cause a core dump when the _ reference variable was
- used as an embedded type with a compound assignment has been fixed.
-
-08-10-31 --- Release ksh93t ---
-08-10-31 Variable scoping/initialization bugs that could dump core were fixed.
-08-10-24 The lexer now accepts all RE characters for patterns prefixed
- with a ksh ~(...) option expression.
-08-10-24 For ${var/pat/sub} \0 in sub expands to the text matched by pat.
-08-10-18 A bug in array scoping that could dump core has been fixed.
-08-10-10 read -n and -N fixed to count characters in multibyte locales.
-08-10-10 A bug that mishandled _.array[] type references has been fixed.
-08-10-09 ${.sh.version} now contains a concatenation of the following (after
- 'Version') denoting compile time features:
- A SHOPT_AUDIT
- B SHOPT_BASH
- L SHOPT_ACCT
- M SHOPT_MULTIBYTE
-08-10-09 A bug that caused subshell command substitution with redirection
- to hang has been fixed.
-08-10-08 Output errors, other than to stderr, now result in a diagnostic.
-08-10-08 ksh93 now supports types that contain arrays of other types as
- members. Earlier versions core dumped in this case.
-08-10-05 A bug which caused the shell to emit a syntax error for an arithmetic
- statement of the form (( var.name[sub] = value)) has been fixed.
-08-10-01 A bug that caused subshell command substitution to hang has
- been fixed.
-08-09-29 When the -p export option of typeset is used with other options,
- only those variables matching the specified options are displayed.
-08-09-29 When the shell reads the environment and finds variables that are
- not valid shell assignments, it now passes these on to subsequent
- commands rather than deleting them.
-08-09-29 A bug in the display of compound variables containing an indexed
- array of compound variables has been fixed.
-08-09-29 A bug in the display of compound variables containing an associative
- array with a subscript containing a . in the name has been fixed.
-08-09-26 A core dump in the subshell environment restore has been fixed.
-08-09-24 $(...) has been fixed to properly set the exit status in $?.
-08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last
- of multiple trailing newlines.
-08-09-23 The -p option to typeset when used with other attributes, restricts
- the output to variables with the specified attributes.
-08-09-22 A bug that sometimes lost the exit status of a job has been fixed.
-08-09-21 A bug that retained trailing command substitution newlines in
- cases where the command caused the shell to fork has been fixed.
-08-09-19 type, whence -v, and command -v were fixed to comply with POSIX
- by writing 'not found' diagnostics to the standard error.
-08-09-18 test and [...] were fixed to comply with POSIX in the case
- of test '(' binop ')' where binop is a valid binary test operator.
-08-09-16 If a method discipline named create is specified when defining a
- type, this function will be called when an instance is created.
-08-09-15 The variable _ is now set as a reference to the compound variable
- when defining a compound variable or a type.
-08-09-10 The shell now prints an error message when the type name specified
- for an indexed array subscript is not an enumeration type.
-08-09-10 A bug in which a subshell that spawned a background process could
- loose output that was produced after the foreground completed
- has been fixed.
-08-09-10 A timing bug on some systems that could cause coprocesses started by a
- subshell to not clean up and prevent other coprocesses has been fixed.
-08-09-09 The typeset -m option is now able to rename array elements from
- the same array.
-08-09-09 The exit status of 2 from the DEBUG trap causes the next command
- to be skipped. An exit value of 255 from a DEBUG trap called from
- a function causes the function to return.
-08-09-08 A bug in which a coprocess created in a subshell that did not
- complete when the subshell terminated could prevent a coprocess
- from being created in the parent shell has been fixed.
-08-09-05 An assignment of the form name1=name2 where name1 and name2
- are both compound variables causes name1 to get a copy of name2.
- name1+=name2 causes name2 sub-variables to be appended to name1.
-08-09-05 A bug in which unsetting a compound variable did not unset all
- the sub-variables has been fixed.
-08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has
- been fixed.
-06-08-26 The SHLVL variable which is an environment variable used by bash
- and zsh that gets incremented when the shell starts.
-08-08-25 For an indexed array, a negative subscript now refers to offsets
- from the end so that -1 refers to the last element.
-08-08-24 An alignment error for shorts on 64 bit architectures has been fixed.
-08-08-22 If oldvar is a compound variable, typeset -C newvar=oldvar creates
- newvar as a copy of oldvar.
-08-08-19 The ALRM signal no longer cause the sleep builtin to terminate.
-08-08-13 When used in an arithmetic expression, the .sh.version variable
- now produces a number that will be increasing for each release.
-08-08-11 A bug in which type instantiation with a compound assignment in
- a dot script in which the type is defined has been fixed.
-08-08-07 The -m option has been added to typeset to move or rename a
- variable. Not documented yet.
-08-08-06 A bug in read when used in a loop when a prompt was specified
- when reading from a terminal has been fixed.
-08-08-01 A bug with the pipefail option in which a nested pipeline could
- cause an asynchronous command to block has been fixed.
-08-08-01 A for loop optimizer bug that treats .sh.lineno as an invariant
- has been fixed.
-08-07-30 A bug in which expanding compound variable that had a get discipline
- from with a here document could cause a syntax error has been fixed.
-08-07-18 A bug in which a nameref caused a local variable to be created
- rather than binding to an existing variable in the global scope
- has been fixed.
-08-07-17 A bug which occurred when a nameref was created from within a
- function that was part of a pipeline has been fixed.
-08-07-14 The compile option SHOPT_STATS was added. With this option the
- compound variable .sh.stats keeps usage statistics that could help
- with performance tuning.
-08-07-10 The output of set now always uses a single line for each variable.
- For array variables, the complete set of values is now displayed.
-08-07-09 The typeset -C option can be used with arrays to indicate that
- each element should default to a compound variable.
-08-07-08 The %B format now outputs compound variables and arrays. The
- alternate flag # can be used to cause output into a single line.
-08-07-03 When the window change signal, WINCH, is received, the current
- edit line is redrawn in place.
-08-07-01 A bug in the handling of shared variables when inside an embedded
- type has been fixed.
-08-06-29 A bug in multiline edit mode which occurred when the prompt length
- was three characters or less has been fixed.
-08-06-23 A bug in which the SIGCLD was not be triggered when background
- jobs completed has been fixed.
-08-06-23 KSH_VERSION added as a name reference to .sh.version.
-08-06-20 type now outputs 'special builtin' for special builtins.
-08-06-19 A couple of bugs in multi-dimensional arrays have been fixed.
-08-06-19 A bug in which a syntax error in a dot script could generated
- a syntax error in the next subsequent command has been fixed.
-08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions
- on some architectures.
-08-06-16 A bug in which printf "%B" could generate an exception when the
- specified variable was not set has been fixed.
-08-06-16 When typeset -p is followed by variable names, it now displays
- the attributes names and values for the specific names.
-08-06-14 A bug that could effect the drawing of the screen from multiline
- emacs or gmacs mode when walking up the history file has been fixed.
-08-06-13 A bug in which a compound variable defined in a subshell could
- have side effects into the parent shell has been fixed.
-08-06-13 A number of bugs related to using .sh.level to set the stack from
- for DEBUG traps have been fixed.
-08-06-13 The .sh.lineno variable has been added. When .sh.level is changed
- inside a DEBUG trap, the .sh.lineno contains the calling line number
- for the specified stack frame.
-08-06-13 The .sh.level variable has been documented and now works.
-08-06-11 The -C option has been added to read for reading compound command
- definitions from a file.
-08-06-11 The . command is now permitted inside a compound command definition.
- The dot script can contain declaration commands and dot commands.
-08-06-09 Add -C option to typeset so that typeset -C foo, is equivalent
- to foo=().
-08-06-09 Added -n warning message for typeset option orderings that are valid
- with ksh88 but not valid with ksh93, for example Lx5.
-08-06-09 A bug in which the return value for an assignment command containing
- a command substitution with that failed was zero when the assignment
- contained redirections has been fixed.
-08-06-09 A bug in the quoting of $ inside a ERE pattern ~(E)(pattern)
- has been fixed.
-08-06-06 A bug when processing `` command substitution with the character
- sequence \$' has been fixed.
-08-06-02 When defining a type, the typeset -r attribute causes this field
- to be required to be specified for each instance of the type and
- does not allow a default value.
-08-06-02 Several bugs in which compound variables were modified by
- subshells have been fixed.
-08-05-22 The ceil function has been added to the math functions.
-08-05-21 A bug in which a name reference defined in a function and passed
- as an argument to another function could cause an incorrect binding.
-08-05-21 A bug in freeing compound variables that are local to functions
- has been fixed.
-08-05-19 The array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]}
- to expand to the value (or subscripts) for array between sub1 and
- sub2 inclusive. For associative arrays, the range is based on
- location in the POSIX locale. The .. must be explicit and cannot
- result from an expansion.
-08-05-15 The trap on SIGCLD is no longer triggered by the completion of
- the foreground job as with ksh88.
-08-05-14 A bug in the implementation of the editing feature added on
- 07-09-19 in emacs mode has been fixed.
-08-05-12 A bug in processing the test built-in with parenthesis has been
- fixed.
-08-05-12 The unset built-in now returns non-zero when deleting an array
- subscript that is not set.
-08-05-08 Changing the value of HISTFILE or HISTSIZE will cause the old
- history file to be close and reopened with the new name or size.
-08-05-08 When FPATH is changed functions that were found via a path search
- will be searched for again.
-08-05-08 A parser bug in which reserved words and labels were recognized
- inside compound indexed array assignment after a new-line has
- been fixed.
-08-05-07 A bug in getopts when handling numerical option arguments has
- been fixed.
-08-05-07 The typeset -S option was added for variables outside type
- definitions to provide a storage class similar to C static
- inside a function defined with function name. When outside
- type definitions and outside a function, the -S option cause
- the specified variable so be unset before the assignment and
- before the remaining attributes are supplied.
-08-05-07 A bug that affected the cursor movement in multiline mode when
- a character was deleted from near the beginning of the any
- line other than the first.
-08-05-01 In multiline edit mode, the refresh operation will now clear
- the remaining portion of the last line.
-08-05-01 A bug in computing prompt widths for the edit modes for prompts
- with multibyte characters has been fixed.
-08-05-01 A bug in the multiline edit mode which could cause the current
- line to be displayed incorrectly when moving backwards from third
- or higher line to the previous line has been fixed.
-08-05-01 A bug in which options set in functions declared with the function
- name syntax were carried across into functions invoked by these
- functions has been fixed.
-08-04-30 A bug which could cause a coprocess to hang when the read end
- is a builtin command has been fixed.
-08-04-30 The emacs and vi editors have been modified to handle window
- change commands as soon as they happen rather than waiting for
- the next command.
-08-04-28 A bug in which ${!x} did not expand to x when x was unset has been
- fixed.
-08-04-27 A bug in which the assignment x=(typeset -a foo=([0]=abc)) created
- x.foo as an associative array has been fixed.
-08-04-25 A bug in which $# did not report correctly when there were more
- than 32K positional parameters has been fixed.
-08-04-04 Choose the name _ as the sub-variable that holds type or instance
- specific data used by discipline functions.
-08-03-27 A bug in which the terminal group was not given back to the parent
- shell when the last part of a pipeline was handled by the parent shell
- and the other parts of the pipeline complete has been fixed.
- The symptom was that the pipeline became uninterruptable.
-08-03-25 A bug in restricted mode introduced in ksh93s that caused scripts
- that did not use #! to executed in restricted mode has been fixed.
-08-03-25 A bug in which the pipefail option did not work for a pipeline
- within a pipeline has been fixed.
-08-03-24 A bug in which OPTIND was not set correctly in subshells has
- been fixed.
-08-03-24 A bug which could cause a memory exception when a compound variable
- containing an indexed array with only element 0 defined was expanded.
-08-03-20 A bug in which ${!var[sub].*} was treated as an error has been fixed.
-08-03-20 Associative array assignments of the form ([name]=value ...)
- now allow ; as well as space tab and new line to separate elements.
-08-03-18 A buffering problem in which standard error was sometimes
- not flushed before sleep has been fixed.
-08-03-17 A bug in which a signal sent to $$ while in a subshell would be
- sent to the subshell rather than the parent has been fixed.
-08-03-17 --default option added to set(1) to handle set +o POSIX semantics.
- set --state added as a long name alias for set +o.
-08-03-14 A bug in which using monitor mode from within a script could
- cause the terminal group to change has been fixed.
-08-03-10 The new ${...} command substitution will treat the trailing }
- as a reserved word even if it is not at the beginning of a command,
- for example, ${ date }.
-08-03-10 If the name of the ENV begins with /./ or ././ then the
- /etc/ksh.kshrc file will not be executed on systems that support
- this interactive initialization file.
-08-03-07 A bug in which ksh -i did not run the ENV file has been fixed.
-08-03-07 A bug in which ulimit did not always produce the same output as
- ulimit -fS has been fixed.
-08-03-04 A bug in multiline mode in emacs and vi mode which could cause the
- cursor to be on the wrong line when interrupt was hit has been fixed.
-08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became
- optional for ${a[i]} inside [[...]] was restored in the case
- where the argument can be a pattern.
-08-03-03 A bug in which creating a name reference to an associative array
- instance would fail when the subscript contained characters [ or
- ] has been fixed.
-08-02-29 The redirection operator >; has been added which for non-special
- files, generates the output in a temporary file and writes the
- specified file only of the command has completed successfully.
-08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*)
- has bee fixed.
-08-02-07 A bug in which test \( ! -e \) produced an error has been fixed.
-08-02-14 The typeset -a option can now optionally be followed by the name
- of an enumeration type which allows subscripts to be enumerations.
-08-02-14 The enum builtin which creates enumeration types has been added.
-08-02-12 The backoff logic when there are no more processes has been fixed.
-08-02-07 The -X option has been added to typeset. The -X option creates
- a double precision number that gets displayed using the C99 %a
- format. It can be used along with -l for long double.
-08-01-31 The -T option to typeset has been added for creating typed
- variables. Also the -h and -S options have been added to
- typeset that are only applicable when defining a type.
-08-01-31 The prefix expansion operator @ has been added. ${@name}
- expands to the type of name or yields the attributes.
-07-11-15 A bug in the macro expander for multibyte characters in which
- part of the character contains a file pattern byte has been fixed.
-07-10-03 A bug in which : was not allowed as part of an alias name has been
- fixed.
-07-09-26 A bug in which appending a compound variable to a compound variable
- or to an index array didn't work has been fixed.
-07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually
- cursor up, when the cursor is at the end of the line will fetch
- the most recent line starting with the current line.
-07-09-18 The value of ${!var} was correct when var was a reference to an
- array instance.
-07-09-18 The value of ${!var[sub]} was not expanding to var[sub] and this
- was fixed. It also fixed ${name} where name is a name reference
- to var[sub].
-07-09-18 It is now legal to create a name reference without an initialization.
- It will be bound to a variable on the first assignment.
-07-08-30 A discipline function can be invoked as ${x.foo} and is equivalent
- to ${ x.foo;} and can be invoked as x.foo inside ((...)).
-07-07-09 A bug in which typeset -a did not list indexed arrays has been
- fixed.
-07-07-03 The command substitution ${ command;} has been added. It behaves
- like $(command) except that command is executed in the current
- shell environment. The ${ must be followed by a blank or an
- operator.
-
-08-04-17 --- Release ksh93s+ ---
-08-04-17 A bug in which umask was not being restored correctly after a
- subshell has been fixed.
-08-04-15 A bug in which sending a STOP signal to a job control shell started
- from within a shell function caused cause the invoking shell to
- terminate has been fixed.
-08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop
- has been fixed.
-08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed.
-08-03-06 A bug with ksh -P on systems that support the the profile shell,
- in which it would exit after running a non-builtin has been fixed.
-08-01-31 A bug in which command substitution inside ((...)) could cause
- syntax errors or lead to core dumps has been fixed.
-08-01-17 A bug in which discipline functions could be deleted when invoked
- from a subshell has been fixed.
-08-01-17 A bug in which a command substitution consisting only of
- assignments was treated as a noop has been fixed.
-08-01-17 A bug in which discipline functions invoked from withing a
- compound assignment could fail has been fixed.
-08-01-16 Incomplete arithmetic assignments, for example ((x += )), now
- generate an error message.
-08-01-16 A bug in which a set discipline defined for a variable before
- an array assignment could cause a core dump has been fixed.
-08-01-03 A bug in on some systems in which exit status 0 is incorrectly
- returned by a process that catches the SIGCONT signal is stopped
- and then continued.
-07-12-13 A race condition in which a program that has been stopped and then
- continued could loose the exit status has been fixed.
-07-12-12 Code to check for file system out of space write errors for all
- writes has been added.
-07-12-11 A bug in the macro expander for multibyte characters in which
- part of the character contains a file pattern byte has been fixed.
-07-12-06 A bug in the emacs edit mode when multiline was set that output
- a backspace before the newline to the screen has been fixed.
-07-12-04 A bug in which using <n>TAB after a variable name listing expansion
- in the edit modes would cause the $ to disappear has been fixed.
-07-11-28 A bug in which setting IFS to readonly could cause a subsequent
- command substitution to fail has been fixed.
-07-11-27 A work around for a gcc 4.* C99 "feature" that could cause a job
- control shell to go into an infinite loop by adding the volatile
- attribute to some auto vars in functions that call setjmp().
-07-11-27 A bug in which the shell could read ahead on a pipe causing the
- standard input to be incorrectly positioned has been fixed.
-07-11-27 A bug in which compound variable UTF-8 multibyte values were not
- expanded or traced properly has been fixed.
-07-11-21 A bug where an unbalanced '[' in a command argument was not treated
- properly has been fixed.
-07-11-15 A bug in which compatibility mode (no long option names) getopts(1)
- incorrectly set the value of OPTARG for flag options has been fixed.
-07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand
- has been fixed.
-07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility.
-07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands
- has been fixed.
-07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the
- signs of { -NaN -Inf -0.0 } have been fixed.
-07-11-15 The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range
- of signals, determined at runtime, are now supported.
-07-11-15 A bug in which creating an index array with only subscript 0 created
- only a simple variable has been fixed.
-07-11-14 A bug in which appending to an indexed array using the form
- name+=([sub]=value) could cause the array to become an associative
- array has been fixed.
-07-11-14 A bug in which typeset without arguments could coredump if a
- variable is declared as in indexed array and has no elements has
- been fixed.
-07-11-14 A bug in which creating a local SECONDS variable with typeset in
- a function could corrupt memory has been fixed.
-07-11-14 A bug which could cause a core dump when a script invoked by name
- from a function used compound variables has been fixed.
-07-11-05 A bug in which printf %d "'AB" did not diagnose unconverted characters
- has been fixed.
-07-11-05 printf %g "'A" support added for all floating point formats.
-07-11-01 A bug in which typeset -f fun did not display the function definition
- when invoked in a subshell has been fixed.
-07-10-29 The sleep builtin was fixed so that all floating point constants
- are valid operands.
-07-10-10 A bug in which the locale was not being restored after
- LANG=value command has been fixed.
-07-09-20 A bug in which a nameref to a compound variable that was local
- to the calling function would not expand correctly when displaying
- is value has been fixed.
-07-09-19 A bug which cause cause a core dump if .sh.edchar returned
- 80 characters or more from a keyboard trap has been fixed.
-07-09-14 A bug in which could cause a core dump when more than 8 file
- descriptors were in use has been fixed.
-07-09-10 A bug in which creating a name reference to an instance of
- an array when the array name is itself a reference has been fixed.
-07-09-10 The file completion code has been modified so that after an = in
- any word, each : will be considered a path delimiter.
-07-09-06 A bug in which subprocess cleanup could corrupt the malloc() heap
- has been fixed.
-07-08-26 A bug in which a name reference to an associative array instance
- could cause the subscript to be evaluated as an arithmetic expression
- has been fixed.
-07-08-22 A bug in which the value of an array instance was of a compound
- variable was not expanded correctly has been fixed.
-07-08-14 A bug which could cause a core dump when a compound assignment was
- made to a compound variable element with a typeset -a attribute
- has been fixed.
-07-08-08 A bug in which a trap ignored in a subshell caused it to be
- ignored by the parent has been fixed.
-07-08-07 A bug in which the set command would generated erroneous output
- for a variable with the -RZ attribute if the variable name had been
- passed to a function has been fixed.
-07-08-02 A bug in which read x[1] could core dump has been fixed.
-07-08-02 A second bug in which after read x[sub] into an associative array
- of an element that hasn't been assigned could lead to a core dump
- has been fixed.
-07-07-31 A bug in which a pipeline that completed correctly could have
- an exit status of 127 when pipefail was enabled has been fixed.
-07-07-09 The SHOPT_AUDIT compile option has been added for keyboard logging.
-07-06-25 In vi insert mode, ksh no longer emits a backspace character
- before the carriage return when the newline is entered.
-07-06-25 A bug in which pipefail would cause a command to return 0
- when the pipeline was the last command and the failure happened
- on a component other than the last has been fixed.
-07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep
- contained a left parenthesis in single quotes has been fixed.
-07-06-18 The braces for a subscripted variable with ${var[sub]} are now
- optional when inside [[...]], ((...)) or as a subscript.
-07-05-28 A bug in brace expansion in which single and double quotes did
- not treat the comma as a literal character has been fixed.
-07-05-24 The -p option of whence now disables -v.
-07-05-23 Several bug fixes in compound variables and arrays of arrays
- have been made.
-07-05-15 A bug in which the %B format of printf was affected by the
- locale has been fixed.
-07-05-14 A bug in which \ was not removed in the replacement pattern with
- ${var/pattern/rep} when it was not followed by \ or a digit has
- been fixed.
-07-05-10 A bug in which ksh -R file core dumped if no script was specified
- has been fixed. it not displays an error message.
-07-05-07 Added additional Solaris signals to signal table.
-07-04-30 A bug in which a pipeline with command substitution inside a
- function could cause a pipeline that invokes this function to
- hang when the pipefail option is on has been fixed.
-07-04-30 Added -q to whence.
-07-04-18 A small memory leak with each redirection of a non-builtin has
- been fixed.
-07-03-08 A bug in which set +o output command line options has been fixed.
-07-03-08 A bug in which an error in read (for example, an invalid variable
- name), could leave the terminal in raw mode has been fixed.
-07-03-06 A bug in which read could core dump when specified with an array
- variable with a subscript that is an arithmetic expression has
- been fixed.
-07-03-06 Several serious bugs with the restricted shell were reported and
- fixed.
-07-03-02 If a job is stopped, and subsequently restarted with a CONT
- signal and exits normally, ksh93 was incorrectly exiting with
- the exit status of the stop signal number.
-07-02-26 M-^L added to emacs mode to clear the screen.
-07-02-26 A bug in which setting a variable readonly in a subshell would
- cause an unset error when the subshell completed has been fixed.
-07-02-19 The format with printf uses the new = flag to center the output.
-07-02-19 A bug in which ksh93 did not allow multibyte characters in
- identifier names has been fixed.
-07-02-19 A bug introduced in ksh93 that causes global compound variable
- definitions inside functions to exit with "no parent" has been fixed.
-07-02-19 A bug in which using compound commands in process redirection
- arguments would give syntax errors <(...) and >(...) has been fixed.
-07-01-29 A bug which caused the shell to core dump which can occur when a
- built-in exits without closing files that it opens has been fixed.
-07-01-26 A bug in which ~(E) in patterns containing \ that are not inside ()
- has been fixed.
-
-06-12-29 --- Release ksh93s ---
-06-12-29 A bug in which the value of IFS could be changed after a command
- substitution has been fixed.
-06-12-22 /dev/(tcp|udp|sctp)/HOST/SEVRICE now handles IPv6 addresses on
- systems that provide getaddrinfo(3).
-06-12-19 A -v option was added to read. With this option the value of
- the first variable name argument will become the default value
- when read from a terminal device.
-06-11-20 A bug in which "${foo[@]:1}}" expands a null argument (instead of
- no argument), when foo[0] is not empty has been fixed.
-06-11-16 The discipline functions have been modified to allow each subscript
- to act independently. Currently the discipline function will not
- be called when called from a discipline function of the same variable.
-06-11-14 A bug which could cause a core dump if a file descriptor for
- an internal file was closed from with a subshell has been fixed.
-06-10-30 The redirections <# pattern, and <## pattern have been added.
- Both seek forward to the beginning of the next line that contains
- the pattern. The <## form copies the skipped portion to standard
- output.
-06-10-26 On systems that support stream control transport, the virtual file
- name /dev/sctp/host/port can now be used to establish connections.
-06-10-26 The printf modifier # when used with d produces units in thousands
- with a single letter suffix added. The modifier # when used with
- the i specification provides units of 1024 with a two letter suffix.
-06-10-24 The value of $! is now set to the process id of a job put
- into the background with the bg command as required by POSIX.
-06-10-23 A bug in which the value of $! was affected by a background
- job started from a subshell has been fixed.
-06-10-23 A bug in ${var:offset:len} in multibyte locales has been fixed.
-06-10-15 The remaining math functions from C99 were added for any system
- that supports them.
-06-10-13 The klockwork.com software detected a few coding errors that
- have been fixed.
-06-10-12 A bug when skipping over `...` with ${x:=`...`} when x is set
- has been fixed.
-06-10-11 A bug in process floating constants produced by the %a format
- of printf has been fixed.
-06-10-06 A bug in which IFS was not being restored correctly in some
- cases after a subshell has been fixed.
-06-10-06 A bug in which pipefail was not detecting some failures in
- pipelines with 3 or more states has been fixed.
-06-10-03 A bug in the processing of >(...) with builtins which could
- cause the builtin to hang has been fixed.
-06-10-03 A bug in the for loop optimizer which causes >(...) process
- substitution to be ignored has been fixed.
-06-09-17 The -a option was added to typeset for indexed arrays. This
- is only needed when using the ([subscript]=value ...) form.
-06-09-06 The showme option was added. Each simple command not beginning
- with a redirection and not occurring with in the while, until, if,
- select condition can be preceded by a semi-colon which will
- be ignored when showme is off. When showme is on, any command
- preceded by a colon will be traced but not executed.
-06-08-16 As a new feature, a leading ~(N) on a pattern has no effect
- except when used for file expansion. In this case if not
- matches are found, the pattern is replaced by nothing rather
- than itself.
-06-08-11 A bug in the expansion of ${.sh.match[i]:${#.shmatch[i]}} has
- been fixed.
-06-08-10 The read builtin options -n and -N have been modified to treat
- the size as characters rather than bytes unless storing into a
- binary (typeset -B) variable.
-06-07-27 When the here document operator << is followed directly by a #
- rather than a -, the first line of the here-document determines
- how much whitespace is removed for each line.
-06-07-26 A bug in the C-shell history (enabled with set -H) in which the
- history event !$ was not processed has been fixed.
-06-07-21 A bug on some systems in which assigning PATH on a command line
- would not take effect has been fixed.
-06-07-20 Add ksh93 and rksh93 as allowable names for ksh binaries.
-06-07-20 Removed the SHOPT_OO compilation option which was only partially
- implemented.
-06-07-20 The ability to use egrep, grep, and fgrep expressions within
- shell patterns has been documented.
-06-07-17 A bug with arithmetic command expressions for locales in which
- the comma is a thousands separator has been fixed.
-06-07-13 The default HISTSIZE was increased from 128 to 512.
-06-07-13 A multibyte problem with locales that use shift codes has been fixed.
-06-06-23 A number of bug fixes for command, file, and variable completion
- have been mode.
-06-06-20 Floating point division by zero now yields the constant Inf or -Inf
- and floating functions with invalid arguments yield NaN.
-06-06-20 The floating point constants Inf and NaN can be used in arithmetic
- expressions.
-06-06-20 The functions isinf(), isnan(), tanhl() have been added for
- arithmetic expressions.
-06-06-13 Internal change to use ordering for variables instead of hashing
- to speed up prefix matching.
-06-06-13 A window between fork/exec in which a signal could get lost
- and cause a program to hang has been eliminated
-06-06-13 A bug in edit completion with quoted strings has been fixed.
-06-06-07 The restricted options can now be enabled by set as well as on
- the command line. Once set, it can not be disabled.
-06-06-04 Modified built-in binding so that for systems for which /bin
- and /usr/bin are the same, a builtin bound to /bin will get
- selected when either /bin or /usr/bin is scanned.
-06-06-04 Added literal-next character processing for emacs/gmacs mode.
- This change is not compatible with earlier versions of ksh93
- and ksh88 when the stty lnext is control-v. The sequence
- escape-control-v will display the shell version.
-06-05-31 Modified emacs and vi mode so that entering a TAB after a partial
- TAB completion, generates a listing of possible completions.
- After the second TAB, a number followed by a TAB will perform
- the completion with the corresponding item.
-06-05-19 Modified arithmetic so that conversions to strings default to
- the maximum number of precision digits.
-06-05-16 Bug fixes for multibyte locales.
-06-05-10 The =~ operator was added to [[...]] and [[ string ~= ERE ]]
- is equivalent to [[ string == ~(E)ERE ]].
-06-04-25 A bug in the vi edit mode which could cause the shell to core dump
- when switching from emacs mode.
-06-04-17 A bug in which using LANG or LC_ in assignment lists with builtins
- did not restore the localed correctly has been fixed.
-06-04-04 A bug in which discipline functions could not be added to variables
- whose names started with .sh has been fixed.
-06-03-28 The -s option to typeset was added to modify -i to indicate short
- integers.
-06-03-28 A bug in which variables assignment lists before functions
- defined with function name were not passed on the functions
- invoked by this function has been fixed.
-06-03-28 A bug in which name references defined within a function defined
- with function name could not be used with compound variables has
- been fixed.
-06-03-27 A bug in which read <&p (print >&p) would cause the coprocess input
- (output) pipe to close before reading from (after writing to)
- it has been fixed.
-06-02-28 A bug in which stopping a job created with the hist builtin command
- would create a job that could not be restarted has been fixed.
-
-06-01-24 --- Release ksh93r ---
-06-01-24 A bug in which running commands with standard output closed would
- not work as expected has been fixed.
-06-01-23 A bug in which print -u<n> could fail when file descriptor <n> was
- open for writing has been fixed.
-06-01-19 The ?: arithmetic operator fixed to work when the operation after
- the colon was an assignment.
-05-12-24 A bug which could lead to a core dump when elements of a compound
- variable were array elements, i.e. foo=(bar=(1 2)), has been fixed.
-05-12-13 An arithmetic bug in which x+=y+=z was not working has been fixed.
-05-12-13 An arithmetic bug in which x||y was returning x when x was non-zero
- rather than 1 has been fixed.
-05-12-07 The aliases for integer and float have been changed to use attributes
- -li and -lE to handle long long and long double types.
-05-12-07 The histexpand (-H) option has been added which allows C-shell
- style history expansions using the history character !.
-05-12-07 The multiline option was added which changes that way the edit
- modes handle lines longer than the window width. Instead of
- horizontal scrolling, multiple lines on the screen are used.
-05-12-05 The whence builtin now returns an absolute pathname when the
- command is found in the current directory.
-05-11-29 A bug which caused ksh -c '[[ ! ((' to core dump rather than
- report a syntax error has been fixed.
-05-11-29 A bug when reading fixed length records into typeset -b variables
- which caused a zero byte to terminate the value has been fixed.
-05-11-22 The ability to seek to an offset within a file has been added
- with the new I/O redirection operators, <# and >#. Currently,
- these redirection operators must be followed by ((expr))
- but in a future release, it should be able to used to seek forward
- to the specified shell pattern. In addition $(n<#) expands to the
- current byte offset for file descriptor n.
-05-11-22 The .sh.match array variable is now set after each [[ ... ]]
- pattern match. Previously it was only set for substring matches.
-05-10-17 A bug in which the library path variable could be prefixed
- with a directory when a .path file was not encountered in
- the directory of the executable has been fixed.
-05-09-15 A for/while loop optimizer bug in which $OPTIND was not
- correctly expanded has been fixed.
-05-09-05 A bug in which a history command that invoked a history
- command could go into an infinite loop has been fixed.
-05-08-31 In the case that IFS contains to adjacent new-lines so that
- new-line is not treated as a space delimiter, only a single
- new-line is deleted at the end of a command substitution.
-05-08-19 When a tilde substitution expands to the / directory and is
- followed by a /, it is replaced by the empty string.
-05-08-16 A bug in which n<&m did not synchronize m has been fixed.
-05-08-16 A bug in which process substitution ( <() and >() ) was not
- working within for and while loops has been fixed.
-05-07-24 A bug in which the pattern ~(E)(foo|bar) was treated as a syntax
- error has been fixed.
-05-07-24 A bug in completion with <n>=, where n was the one of the
- previous selection choices has been fixed.
-05-07-21 A bug with multibyte input when no edit mode was specified which
- caused the input line to shift left/right has been fixed.
-05-06-24 A race condition which could cause the exit status to get lost
- on some fast systems has been fixed.
-05-06-21 A bug in which nested patterns of the form {m,n}(pat) would cause
- syntax errors has been fixed.
-05-06-21 A bug in the macro expander has been fixed which could cause a
- syntax error for an expansion of the form ${x-$(...)} when
- x is set and the command substitution contained certain strings.
-05-06-08 On systems for which echo does not do System V style \ expansions,
- the -e option was added to enable these expansion.
-05-06-08 A bug in which ${var op pattern} to not work when inside an
- arithmetic expression has been fixed.
-05-05-23 An extension to shell patterns that allows matching of nested
- groups while skipping over quoted strings has been added.
-05-05-18 A bug in which the line number for errors was not correct for
- functions loaded from FPATH has been fixed.
-05-04-18 A bug in which the exit status $? is not set when a trap triggered
- by the [[...]] command is executed has been fixed.
-05-04-08 Redirection operators can be directly preceded with {varname}
- with no intervening space, where varname is a variable name which
- allows the shell to select a file descriptor > 10 and store it
- into varname.
-05-04-08 SHOPT_CMDLIB_BLTIN=1 now includes <cmdlist.h> generated table.
-05-04-07 [[ -o ?option ]] is true if "option" is a supported option.
-05-04-05 A bug in handling file completion with spaces in the names
- has been fixed.
-05-03-25 The SIGWINCH signal is caught by default to keeps the LINES and
- COLUMNS variables in sync with the actual window size.
-05-03-25 Building ksh with SHOPT_REMOTE=1 causes ksh to set --rc if stdin is
- a socket (presumably part of a remote shell invocation.)
-05-03-25 Building ksh with SHOPT_SYSRC=1 causes interactive ksh to source
- /etc/ksh.kshrc (if it exists) before sourcing the $ENV file.
-05-03-25 {first..last[..incr][%fmt]} sequences added to brace expansions
- when braceexpand is enabled.
-05-03-03 A bug where a SIGCHLD interrupt could cause a fifo open to fail has
- been fixed.
-05-02-25 A bug in which a builtin command run in the background could
- keep a file descriptor open which could cause a foreground
- process to hang has been fixed.
-05-02-24 A bug where builtin library commands (e.g., date and TZ) failed to
- detect environment variable changes has been fixed.
-05-02-22 The read builtin and word splitting are now consistent with respect
- to IFS -- both treat IFS as field delimiters.
-05-02-22 The read builtin no longer strips off trailing delimiters that
- are not space characters when there are fewer variables than fields.
-05-02-17 A builtin bug on systems where dlsym(libcmd) returns link-time
- bindings has been fixed.
-05-02-12 A bug in which the lib_init() function for .paths BUILTIN_LIB
- libraries was not called has been fixed.
-05-02-06 A bug on some systems in which moving the write end of a co-process
- to a numbered file descriptor could cause it to close has been fixed.
-05-02-06 A bug in the vi-edit mode in which the character under the cursor
- was not deleted in some cases with the d% directive has been fixed.
-05-02-06 A bug where external builtin stdout/stderr redirection corrupted
- stdout has been fixed.
-05-02-04 A bug where times formatting assumed CLK_TCK==60 has been fixed.
-
-05-01-11 --- Release ksh93q ---
-05-01-11 A bug in the integral divide by zero check has been fixed.
-05-01-11 The -l option has been added to read /etc/profile and
- $HOME/.profile, if they exist, before the first command.
-05-01-11 An argument parsing bug that caused `kill -s x -- n' to fail has
- been fixed.
-05-01-11 The .paths file, introduced in ksh93m, which can appear in
- any directory in PATH, now allows a line of the form 'BUILTIN_LIB=.'
- When a command is searched for this directory, and the full path
- matches the path of the built-in version of the command (listed
- by the 'builtin' command) then the built-in version of the command
- is used. When ksh is built with SHOPT_CMDLIB_DIR=1 then all libcmd
- functions become builtins with the '/opt/ast/bin/' directory prefix.
-05-01-10 A bug in which a nameref to a compound name caused a core dump has
- been fixed.
-05-01-09 A bug in which some SIGCHLD interrupts (from child processes exiting)
- caused a fatal print/echo error diagnostic has been fixed.
-04-12-24 A bug in which some SIGCHLD interrupts (from child processes exiting)
- corrupted the internal process/job list, sometimes causing the shell
- to hang, has been fixed.
-04-12-01 A bug in which typeset -Fn truncated less than n digits for large
- numbers has been fixed.
-04-11-25 A bug in which standard error could be closed after a redirection
- to /dev/stderr has been fixed.
-04-11-17 A bug in which an expansion of the form ${array[@]:3} could expand
- to ${array[0]} when ${array[3]} was not set has been fixed.
-04-10-22 The -E or -orc command line option reads ${ENV-$HOME/.kshrc} file.
-04-10-22 `-o foo' equivalent to `+o nofoo', `-o nobar' equivalent to `+o bar'.
- `--foo' equivalent to `-o foo', `--nofoo' equivalent to `+o foo'
-04-10-05 The .paths file, introduced in ksh93m, which can appear in
- any directory in PATH, now allows a line of the form
- 'BUILTIN_LIB=libname'. When a command is searched for this directory,
- the shared library named by libname will first be searched for a
- built-in version of the command.
-04-09-03 <<< here documents now handle quotes in the word token correctly.
-04-08-08 The maximum size for read -n and and read -N was increased from
- 4095 to 32M.
-04-08-04 printf %q was modified so that if an no operand was supplied, no
- no output would be generated rather than a quoted empty string.
-04-08-01 The -n and -N options of the read builtin has been modified
- when reading variables with the binary attribute so that the
- data is stored directly rather than through assignment.
-04-08-01 The shcomp command has been modified to process alias commands
- under some conditions.
-04-07-31 The .sh.match variable added in ksh93l, now works like other
- indexed arrays.
-04-07-08 A loop optimizer bug which occurs when typeset is used in
- a for or while loop inside a function has been fixed.
-04-06-24 The number of subexpressions in a pattern was increased to 64
- from the current number of 20.
-04-06-17 The -t option to read was modified to allow seconds to be
- specified as any arithmetic expression rather than just
- an integral number of seconds, for example even -t 'sin(.5)'
- is now valid.
-04-06-16 Two small memory leak problems were fixed.
-04-06-15 A bug in ${var/pattern/"string"} which occurred when string
- contained pattern matching characters has been fixed.
-04-05-08 printf $'%d\n' produced an erroneous error message and has
- been fixed.
-04-05-24 A bug in which an associative array without any elements could
- cause a core dump when a script with an associative array with
- the same name was declared in a script invoked by name has
- been fixed.
-04-05-11 A bug in which an exec statement could close the script that
- is being processed in a script that is run by name causing
- a failure has been fixed.
-04-04-28 If the first character of assignment to an integer variable was 0,
- the variable had been treated as unsigned. This behavior was
- undocumented and has been removed.
-04-04-05 A bug in which the positioning of standard input could be incorrect
- after reading from standard input from a subshell has been fixed.
-04-03-30 A bug in the for loop optimizer which in rare cases could cause
- memory corruption has been fixed.
-04-03-29 The preset alias source='command .' has been added.
-04-03-29 A bug introduced in ksh93p on some systems in which invoked by
- name with #! on the first line would not get the signals handling
- initialized correctly has been fixed.
-04-03-29 A bug introduced in ksh93p in which a HUP signal received by
- a shell that is a session group leader was not passed down to
- its children has been fixed.
-
-04-02-28 --- Release ksh93p ---
-04-02-28 The ability to apply an append discipline to any variable has
- been added.
-04-02-14 A bug in which the exportall option (set -a) would cause incorrect
- results for arrays has been fixed.
-04-02-02 A bug in which an exported array would pass more than
- the first element to a script invoked by name has been fixed.
-04-02-02 A bug on some systems in which name=value pairs preceding a script
- invoked by name was not getting passed to the script has been fixed.
-04-01-20 A bug in which an unset discipline function could cause a core
- dump on some systems has been fixed.
-04-01-12 A bug in which a continue or break called outside a loop from
- inside a function defined with name() syntax could affect
- the invoking function has been fixed.
-04-01-08 If a command name begins with ~, only filename completion will be
- attempted rather than pathname completion using the builtin editors.
-04-01-08 A bug in the vi edit mode in which the wrong repeat count on
- multiple word replacements with the . directive has been fixed.
-04-01-06 Backspace characters are now handled correctly in prompt strings.
-04-01-06 The getopts builtin has been modified to accept numerical
- arguments of size long long on systems that support this.
-04-01-06 A bug in which unsetting all elements of an associative array
- would cause it to be treated as an indexed array has been fixed.
-03-12-15 A bug in which a quoted string ending with an unescaped $ would
- delete the ending $ in certain cases has been fixed.
-03-12-05 A bug in which the shell could hang when set -x tracing a command
- when an invalid multibyte character is encountered has been fixed.
-03-12-05 On some systems, if the KEYBD trap is set, then commands that use
- the meta key were not processed until return was hit. This
- has been fixed.
-03-12-05 A problem which occurred when the login shell was not a group
- leader that could cause it to fail has been fixed.
-03-12-05 A problem in which a shell could core dump after receiving a signal
- that should cause it to terminate while it was in the process
- of acquiring more space has been fixed.
-03-12-05 If ENV is not specified, the shell will default to $HOME/.kshrc
- for interactive shells.
-03-11-21 A bug introduced in ksh93o in which the DEBUG trap could get
- disabled after it triggered has been fixed.
-03-11-04 A bug in which using arithmetic prefix operators ++ or -- on a
- non-lvalue could cause a core dump has been fixed.
-03-11-04 A bug in which leading zeros were stripped from variable
- expansions within arithmetic computation to avoid being treated
- as octal constants when they should not have, has been fixed.
-03-10-08 A bug introduced in ksh93o in which a large here document inside
- a function definition could get corrupted has been fixed.
-03-09-22 A bug in which the .get discipline function was not being
- called when a string variable was implicitly referenced from
- within a numerical expression has been fixed.
-03-09-22 A bug in which a script without a leading #! could get executed
- by /bin/sh rather than the current shell on some systems has
- been fixed.
-03-09-12 To improve conformance with ksh88, leading zeros will be ignored
- when getting the numerical value of a string variable so that
- they will not be treated as octal constants.
-03-09-03 The builtin kill command now processes obsolete invocations
- such as kill -1 -pid.
-03-09-02 The restriction on modifying FPATH in a restricted shell (sh -r)
- has been documented.
-03-09-02 The restricted shell (sh -r) has been modified to disallow
- executing command -p.
-03-08-07 A bug in which the KEYBD trap was not being invoked when
- characters with the 8th bit set has been fixed.
-03-08-02 A parser bug introduced in ksh93o which caused the character
- after () in a Posix function definition to be skipped
- when reading from standard input has been fixed.
-03-08-01 A bug in which "${foo#pattern}(x)" treated (x) as if it were
- part of the pattern has been fixed.
-03-08-01 The command -x option has been modified so that any trailing
- arguments that do expand to a single word will be included
- on each invocation, so that commands like command -x mv * dir
- work as expected.
-
-03-07-20 --- Release ksh93o+ ---
-03-07-20 A bug in which could cause memory corruption when a posix
- function invoked another one has been fixed.
-03-07-15 A bug in which a file descriptor>2 could be closed before
- executing a script has been fixed.
-03-07-15 A parsing error for <() and >() process substitutions inside
- command substitution has been fixed.
-03-07-15 A parsing error for patterns of the form {...}(...) when
- used inside ${...} has been fixed.
-03-07-15 An error in which expanding an indexed array inside a compound
- variable could cause a core dump has been fixed.
-03-07-15 A bug in which on rare occasions a job completion interrupt
- could cause to core dump has been fixed.
-03-06-26 A bug in which process substitution embedded within command
- substitution would generate a syntax error has been fixed.
-03-96-23 A bug in which ${@:offset:len} could core dump when there
- were no arguments has been fixed.
-03-96-23 A bug in which ${X[@]:offset:len} could core dump when X
- was unset has been fixed.
-03-06-22 The -x option was added to the command builtin. If this
- option is on, and the number of arguments would exceed ARG_MAX,
- the command will be invoked multiple times with a subset of
- the arguments. For example, with alias grep='command -x grep,
- any number of arguments can be specified.
-03-06-14 A bug in which could cause a core dump on some systems with
- vi and emacs editors with the MULTIBYTE option has been fixed.
-03-06-06 A bug in which the shell could core dump when a script was
- run from its directory, and the script name a symlink to a file
- beginning with .., has been fixed.
-03-06-05 A bug in which the shell could core dump when a child process
- that it is unaware of terminates while it is calling malloc()
- has been fixed.
-03-06-02 An option named globstar (set -G) has been added. When enabled,
- during pathname expansion, any component that consists only of ** is
- matches all files and any number of directory levels.
-03-05-30 A bug in which the PATH search could give incorrect results when
- run from directory foo and PATH contained .:foo:xxx has been fixed.
-03-05-29 Some changes were made to the code that displays the prompt in edit
- mode to better handle escape sequences in the prompt.
-03-05-27 I added = to the list of characters that mark the beginning of
- a word for edit completion so that filenames in assignments
- can be completed.
-03-05-20 A bug in which read -N could hang on some systems when reading
- from a terminal or a pipe has been fixed.
-03-05-19 A bug in which the output of uname from a command substitution
- would go to the standard output of the invoking command when
- uname was invoked with a non-standard option has been fixed.
-03-05-19 A job control bug which would cause the shell to exit because
- it hadn't take back the terminal has been fixed. The bug
- could occur when running a function that contained a pipeline
- whose last element was a function.
-03-05-19 A job control timing bug introduced in ksh93o on some systems
- which could cause a pipeline to hang if the first component
- completed quickly has been fixed.
-03-05-13 The read builtin has been modified so that the builtin editors
- will not overwrite output from a previous incomplete line.
-03-05-13 A bug in which the name of an identifier could have the string
- .sh. prefixed to it after expanding a variable whose name begins
- with .sh. has been fixed.
-03-05-13 A bug in the expansion of $var for compound variables in which
- some elements would not be output when the name was a prefix
- of another name in the compound variable has been fixed.
-03-05-08 The last item in the ksh93o release on 03-01-02 has been
- altered slightly to preserve the leading 0's when the
- preceding character is a digit. Thus, with typeset -LZ3 x=10,
- $(( 1$x)) will be 1010 whereas $(( $x) will be 10.
-03-04-25 A bug in which if x is a name reference, then nameref y=x.foo
- did not follow x has been fixed.
-
-03-03-18 --- Release ksh93o ---
-03-03-18 A -N unary operator was added to test and [[...]] which returns
- true if the file exists and the file has been modified since it
- was last read.
-03-03-18 The TIMEFORMAT variable was added to control the format for
- the time compound command. The formatting description is
- described in the man page.
-03-03-06 A -N n option was added to read which causes exactly n bytes
- to be read unlike -n n which causes at most n bytes to be read.
-03-03-03 Three new shell variables were added. The variable .sh.file
- stores the full pathname of the file that the current command
- was found in. The variable .sh.fun names the current function
- that is running. The variable .sh.subshell contains the depth
- of the current subshell or command substitution.
-03-03-03 When the DEBUG trap is executed, the current command line after
- expansions is placed in the variable .sh.command. The trap
- is also now triggered before each iteration of a for, select,
- and case command and before each assignment and redirection.
-03-02-28 Function definitions are no longer stored in the history file so
- that set -o nolog no longer has any meaning.
-03-02-28 All function definitions can be displayed with typeset -f not
- just those stored in the history file. In addition, typeset +f
- displays the function name followed by a comment containing the
- line number and the path name for the file that defined this function.
-03-02-28 A bug in which the value of $LINENO was not correct when executing
- command contained inside mult-line command substitutions has been
- fixed.
-03-02-19 Since some existing ksh88 scripts use the undocumented and
- unintended ability to insert a : in front of the % and # parameter
- expansion operators, ksh93 was modified to accept :% as equivalent
- to % and :# as equivalent to # with ${name op word}.
-03-02-14 A bug which could cause a core dump when reading from standard
- error when standard error was a pty has been fixed.
-03-02-14 The shell arithmetic was modified to use long double on systems
- that provide this data type.
-03-02-09 A bug in which a function located in the first directory in FPATH
- would not be found when the last component of PATH was . and the
- current directory was one of the directories in PATH has been fixed.
-03-02-07 The trap and kill builtin commands now accept a leading SIG prefix
- on the signal names as documented.
-03-02-05 A bug in the expansion of ${var/$pattern}, when pattern contained
- \[ has been fixed.
-03-02-05 A bug in which .sh.match[n], n>0, was not being set for substring
- matches with % and %% has been fixed.
-03-01-15 A bug in which getopts did not work for numerical arguments specified
- as n#var in the getopts string has been fixed.
-03-01-09 A bug in which using ${.sh.match} multiple times could lead to
- a memory exception has been fixed.
-03-01-06 A bug in the expansion of ${var/pattern/$string} in the case that
- $string contains \digit has been fixed.
-03-01-02 A -P option was added for systems such as Solaris 8 that support
- profile shell.
-03-01-02 For backward compatibility with ksh88, arithmetic expansion
- with ((...)) and let has been modified so that if x is a zero-filled
- variable, $x will not be treated as an octal constant.
-
-02-12-05 --- Release ksh93n+ ---
-02-11-30 A bug that can show up in evaluating arithmetic statements that
- are in an autoloaded function when the function is autoload from
- another function has been fixed.
-02-11-30 An optimization bug in which an expansion of the form ${!name.@},
- which occurred inside a for or a while loop, when name is a name
- reference, has been fixed.
-02-11-18 A bug in which modifying array variables in a subshell could leave
- side effects in the parent shell environment has been fixed.
-02-11-18 A memory leak when unsetting an associative array has been fixed.
-02-11-14 The code to display compound objects was rewritten to make
- it easier for runtime extensions to reuse this code.
-02-11-14 A change was made to allow runtime builtins to be notified when
- a signal is received so that cleanup can be performed.
-02-10-31 User applications can now trap the ALRM signal. Previously,
- the ALRM signal was used internally and could not be used
- by applications.
-02-10-31 A bug in which signals received while reading from a coprocess
- for which traps were set was not handled correctly has been fixed.
-02-10-31 A bug in which a file opened with exec inside a subshell could
- be closed before the subshell completed has been fixed.
-02-10-21 A bug in which setting PATH or FPATH inside a function might not
- take effect has been fixed.
-02-10-21 A bug which could cause a core dump when a local SECONDS variable
- is defined in a function has been fixed.
-02-10-15 A bug in which the associate array name operator ${!array[@]}
- could return the same name multiple times has been fixed.
-02-10-15 A bug in which the zero'th element of an associative array was
- not getting set when an assignment was made without a subscript
- specified has been fixed.
-
-02-09-30 --- Release ksh93n ---
-02-09-30 The maximum indexed array size was increased to 16Megs.
-02-09-30 A bug which could cause a core dump when changing attributes
- of associative array has been fixed.
-02-09-30 A bug in which exporting an array variable would not export the
- 0-th element has been fixed.
-02-09-30 A bug in which an array assignment of the form a=($a ...) would unset
- 'a' before the right hand side was evaluated has been fixed.
-02-09-27 A bug in which the error message for ${var?message} when var was
- null or unset did not contain the variable name var has been fixed.
-02-09-27 A bug in which closing file descriptors 0 through 2 could
- cause a subsequent here document to fail has been fixed.
-02-09-14 A bug in whence which occurs when the specified name contained
- a / has been fixed.
-02-09-14 A bug in the parser for strings of the form name$((expr))=value
- has been fixed.
-02-09-14 A for loop optimization bug in which the number of elements in
- an array was treated as an invariant has been fixed.
-02-09-09 A bug in which redirection or closing of a file descriptor between
- 3 and 9 could cause a subsequent here document to fail has been
- fixed.
-02-09-09 A bug in which a background job was not removed from the job list
- when a subshell completed has been fixed, for example (prog&).
-02-09-03 A bug in which an assignment of the form name=(integer x=3)
- could be interpretted as an array assignment rather than a
- compound variable assignment has been fixed.
-02-08-19 A command completion bug which occurred on file systems that
- are case insensitive has been fixed.
-02-08-19 A bug which could lead to an exception on some systems (for
- example FREEBSD) which occurred when setting PATH has been fixed.
-02-08-11 A bug in arithmetic rounding in which a value input as a decimal
- string would output as a rounded version of the string has
- been fixed.
-02-08-11 A bug in which the last character could be deleted from shell
- traces and from whence when called from a multibyte locale
- has been fixed.
-02-08-01 A bug which could cause a core dump to occur when a shell script
- is executed while a coprocess is running that has closed the
- output pipe has been fixed.
-02-08-01 A bug in which command completion in multibyte mode could
- corrupt memory for long command lines has been fixed.
-
-02-06-17 --- Release ksh93n- ---
-02-06-17 A bug in which user defined macros could cause a core dump in
- with MULTIBYTE mode has been fixed.
-02-06-17 A bug in which printf format specifiers of the form %2$s were causing
- a core dump has been fixed.
-02-06-17 A bug in which setting stty to noecho mode did not prevent the
- echoing of characters by ksh when emacs or viraw mode
- was enabled has been fixed.
-02-06-17 A bug in which background job completion could cause the sleep
- builtin to terminate prematurely has been fixed.
-02-06-17 A bug in which the shell could core dump if getopts was called
- when the OPTIND variable contained a negative value has been fixed.
-02-06-10 The edit mode prompt has been modified to handle escape sequences.
-02-06-10 A bug which occurred for interactive shells in which the builtin
- cat command was used in command substitution on a file whose
- size was larger than PIPE_BUF has been fixed.
-02-06-10 A bug in which the trap on ERR was not being processed when
- set inside a function has been fixed.
-02-06-07 A bug in which function definitions could cause the history count
- to be decremented by one (and even become negative) has been fixed.
-02-06-05 A bug in read in which share mode could be enabled has been fixed.
-02-05-28 A bug which could occur when the last command of a script was
- a case statement and the action selected ended in ;& instead of ;;
- has been fixed.
-02-05-23 A bug with unary + introduced in ksh93k has been fixed.
-02-05-07 A bug in substitutions of the form ${var/pattern/string} in which
- a backslash was inserted in the replacement string when it contained
- a special pattern character has been fixed.
-02-05-01 A bug in the emacs edit mode which occurred in versions compiled
- for multibyte character sets which occurred when a repeated search
- was requested after a long line had been returned for the previous
- search has been fixed.
-02-04-02 vi and emacs edit modes were modified so that tab completion is
- disabled when invoked from the read built-in.
-
-02-03-26 --- Release ksh93m+ ---
-02-03-26 A bug in which \ was not handled correctly when used in file
- expansion has been fixed.
-02-02-18 A bug in which lines beginning with a # were deleted from here
- documents when the here-document delimiter was followed by
- a comment has been fixed.
-02-12-06 An optimization bug in which ${!x[@]) was treated as invariant in
- a for loop has been fixed.
-02-02-06 A bug in which the ERR trap is not cleared for a script invoked
- by name from within a function has been fixed.
-02-01-08 A bug in which a shell script executed from within a subshell
- could cause this script to have an invalid pointer leading
- to a memory fault has been fixed.
-02-01-07 Added here documents of the form <<< word (as per zsh) which
- is equivalent to << delim\nword\ndelim.
-02-01-07 A bug in which the first word of a compound assignment,
- x=(word ...), was treated as a reserved word has been fixed.
-02-01-07 A bug in the handling of \ when noglob was enabled and a
- substitution of the form ${word op pattern} occurred in the
- same word has been fixed.
-02-01-07 A compilation option, CMDLIB_BLTIN in the file OPTION, has
- been added. When this options is set, all commands implemented
- in libcmd become shell builtin commands by default.
-02-01-07 A bug in which builtin foo, where foo is already a builtin
- would result in the builtin foo getting removed has been fixed.
-02-01-07 A bug which the shell executed a command found in the current
- directory when PATH have no valid directories has been fixed.
-01-11-28 The value of $? was not being set when called with exit.
-01-11-28 If the last command was of the form (...) and a trap on EXIT or
- ERR was set, and the command inside () modified the trap, then
- the original trap wasn't executed.
-01-11-26 The value for 0 is now preceded by the base number when
- the base was not 10.
-01-11-26 The default has compilation mode has been changes so that
- viraw mode will always be on.
-
-01-10-31 --- Release ksh93m ---
-01-10-31 A for loop optimizer bug for subshells contained withing for
- loops has been fixed.
-01-10-16 typeset without arguments no longer outputs variable names
- that do not have any attributes that are set.
-01-10-16 A bug introduced in ksh93l in which assignments specified with
- the exec built-in were not being expanded properly has been
- fixed.
-01-10-11 An optimization bug in which ${!x) was treated as invariant in
- a for loop has been fixed.
-01-10-11 Unsigned integer variables in bases other than 10 are printed now
- expand in that base with the base prefix.
-01-10-10 A number of typos in the self generating man pages for shell
- built-ins have been fixed.
-01-10-04 The self generated man pages for hist and fc were not working
- correctly and have been fixed.
-01-10-03 Yet another optimizer bug in which shell patterns were
- treated as invariants has been fixed.
-01-09-27 Two bugs relating to multibyte history searches and to find
- have been fixed.
-01-09-27 A bug introduced in ksh93k in which the PATH searching was
- not restored after running a command with an assignment list
- has been fixed.
-01-09-26 A bug in which a zero filled field was treated as octal when
- converted to integer has been fixed.
-01-09-26 Yet another bug in the optimization of for loops related to
- recursive functions with break or continue statements has been fixed.
-01-09-25 The exponentiation operator ** was added to the shell arithmetic
- evaluation. It has higher precedence than * and is left
- associative.
-01-09-25 The code was modified to use the ast multibyte macros
- and functions for handing multibyte locales.
-01-09-25 The expansion ${parameter:offset:length} now handles negative
- offsets which cause offsets to be measured from the end.
-01-09-25 Some spelling errors in the documentation were corrected.
-01-09-24 The /dev/tcp/host/port and /dev/udp/host/port now allow
- the ports to be specified by service name.
-01-09-24 The change staring with ksh93g in which the the appropriate
- library path variable is prepended with a corresponding library
- directory has been modified. With the new method, only the
- library path defined in the file named .paths in the directory
- where the executable is found will be modified. See the
- man page for more details.
-01-09-23 The .fpath file (see ksh93h) is no longer looked for in each
- directory on the path to locate function directories. The
- file named .paths is used instead.
-01-09-23 A bug in which IFS was not being restored after being changed in
- a subshell has been fixed.
-01-09-16 With the vi and emacs edit modes, after a list of command
- or functions is generated with = or M-= respectively,
- any element from the list can be pasted on the command line
- by preceding the = or M-= with a numeric parameter specifying
- the position on the list.
-01-09-16 A bug in ksh93l caused command completion not to find aliases
- and functions. Command listing from the edit mode was presented
- in reverse order. This has been fixed.
-01-09-13 Another bug in the optimization of for loops related to subshells
- when traps were set has been fixed.
-01-09-07 A change in ksh93l caused brace expansion to stop working
- and this has been fixed.
-01-09-04 A bug introduced in ksh93k in which an arithmetic statement
- within a function that used name references did not follow the
- reference has been fixed.
-01-09-04 A bug introduced in ksh93l in which export -p did not prefix
- each export with the word export has been fixed.
-01-08-29 A bug in multibyte input which occurred when a partial multibyte
- character was received has been fixed.
-01-08-29 A bug introduced in ksh93l which could cause a core dump
- when an assignment list containing PATH is specified inside
- command substitution has been fixed.
-01-08-09 Another bug in the optimization of for loops in ksh93l caused
- errors in recursive functions using local variables that
- contained for loops has been fixed.
-01-07-27 A bug in which IFS would be unset after a command substitution
- inside a here document has been fixed.
-01-07-26 To conform to the POSIX standard, if you invoked ksh name,
- and name does not contain a /, it will first try to run
- one in the current directory whether it is executable or not
- before doing a path search for an executable script. Earlier
- versions first checked for an executable script using the
- PATH variable.
-01-07-23 A bug in which unset -f invoked in a subshell could unset a
- function defined in the parent has been fixed.
-01-07-16 A bug in the optimization of for loops in ksh93l caused
- name references to be treated as invariants has been fixed.
-01-07-09 A bug in which a discipline function applied to a local variable
- could cause a shell exception has been fixed. Discipline
- functions can only be specified for global variables.
-
-01-06-18 --- Release ksh93l ---
-01-06-18 A bug in assigning integers larger than can be represented as
- long integers to floating point variables has been fixed.
-01-06-18 A bug in the handling of unsigned integers (typeset -ui) has
- been fixed.
-01-06-04 The evaluation of the PS1 prompt no longer effects the value
- of the $? variable.
-01-06-01 A small memory leak from subshells has been fixed.
-01-05-22 A bug in which attributes for variables that did not have
- values would be lost after a subshell has been fixed.
-01-05-22 The %R format has been added to convert a shell pattern into
- an extended regular expression.
-01-05-22 The escape sequences \e, \cX, \C[.collating-element.], and
- \x{hex} have been added to ASCII-C strings and to printf format
- strings.
-01-05-20 Patterns of the form {n}(pattern) and {m,n}(pattern) are now
- recognized. The first form matches exactly n of pattern whereas,
- the second form matches from m to n instances of pattern.
-01-05-20 The shell allows *-(pattern), +-(pattern), ?-(pattern),
- {m,n}-(pattern}, and @-(pattern) to cause the minimal
- match of pattern to be selected whenever possible rather
- than the maximal (greedy) match.
-01-05-20 The character class [:word:] has been added to patterns.
- The word class is the union of [:alnum:] and the character _.
-01-05-20 Inside (...) pattern groups, the \ character is now treated
- specially even when in an enclosing character class. The
- sequences, \w, \d, \s are equivalent to the character classes
- word, digit, and space respectively. The sequences \W, \D,
- and \S are their complement sets.
-01-05-20 The shell now recognizes pattern groups of the form
- ~(options:pattern) where options or :pattern can be omitted.
- Options use the letters + and - to enable and disable options
- respectively. The option letters g (greedy), i (ignore case)
- are used to cause maximal matching and to cause case
- insensitive matching respectively. If :pattern is also
- specified, these options are only in effect while this
- pattern is being processed. Otherwise, these options remain
- in effect until the end of the pattern group that they are contained
- in or until another ~(...) is encountered. These pattern groups
- are not counted with respect to group numbering.
-01-05-14 When edit completion, expansion, or listing occurs in the
- middle of a quoted string, the leading quote is ignored when
- performing the completion, expansion, or listing.
-01-05-14 A small memory leak from subshells has been fixed.
-01-05-10 A bug in which open files were not restored after a subshell
- that had used exec to replace a file has been fixed.
-01-05-10 Redirection to a null file name now generates an error message.
-01-05-09 The shell now rejects some invalid parameter substitutions that
- were previously processed in undefined ways.
-01-05-09 A bug in which the output of select was not flushed before the
- read when input did not come from the terminal has been fixed.
-01-05-08 A bug in which job ids would not be freed for interactive shells
- when subshells ran built-ins in the background has been fixed.
-01-05-08 The FPATH variable now requires an explicit . to cause the
- current directory to be treated as a function directory.
-01-05-08 A bug in read -n when echo mode was disabled has been fixed.
-01-05-07 A bug in which function definitions could be listed as part
- of the history has been fixed.
-01-04-30 This release uses a new and often much faster pattern matcher than
- earlier releases.
-01-04-30 An optimizer now eliminates invariant parameter expansions from
- for while and until loops.
-01-04-30 The variable .sh.match is set after each pattern match (# % or /)
- in a variable substitution. The variable .sh.match is an
- indexed array with element 0 being the complete match.
- The array is only valid until the next subsequent pattern
- match or until the value of the variable changes which ever
- comes first.
-01-04-30 A self generating man page has been added to shcomp. Also,
- shcomp now stops compiling when it finds an exit or exec
- command and copies the remainder so that it can be used
- for standard input.
-01-04-30 The shcomp command was modified so that it can work in an
- EBCIDIC environment and that binary scripts are portable
- across environments.
-01-04-30 A bug in the handling of a trailing : in PATH has been fixed.
-01-04-30 A bug in which the builtin version of a command would get invoked
- even though the full pathname for the command was specified
- has been fixed.
-01-04-30 A bug in which read would loose the last character when
- reading the last line of a file that did not contain a new-line
- character has been fixed.
-01-04-23 A bug on some systems in which in vi mode the end of file
- character and end of line character could be swapped has
- been fixed.
-01-04-23 A bug on some systems in which invoking a shell script that
- did not have execute permission could set the exit value to
- 127 rather than 126 has been fixed.
-01-04-20 A bug in which read -n from a pipe would block if fewer than
- n characters was received has been fixed.
-01-04-09 A bug in which invalid patterns, for example, ) by itself,
- was not treated as a string has been fixed so that if i=')',
- then [[ $i == $i ]] is true.
-01-04-09 The shell arithmetic now interprets C character constants.
-01-04-09 A bug in which a non-zero return from a function defined
- with the function reserved word did not trigger the ERR
- trap or exit with set -e has been fixed.
-01-04-02 A bug on some systems, in which characters above 127 were
- not displayed correctly in vi or emacs edit mode has been fixed.
-01-04-02 A bug on some systems, introduced in the 'k' point release, in
- which the erase character in viraw mode was moving the cursor
- to the left without erasing the character has been fixed.
-01-04-02 On some systems the wcwith() function was returning a wrong
- value for characters and caused characters to be displayed
- incorrectly from the shell edit modes. A work around for
- this problem has been added.
-01-03-26 A bug in which valid scripts could produce syntax errors
- when run with locales that considered characters such as "'"
- to be space characters has been fixed.
-01-03-20 A bug in which an syntax error in an arithmetic expression
- entered interactively could cause the shell to go into
- an infinite loop outputting the error message has been fixed.
-01-03-10 ksh93 accepts -l as a synonym for -L in test on systems for
- which /bin/test -l tests for symbolic links.
-01-03-10 A bug in parsing scripts in which { and } are used in place of
- in and esac in case statements embedded in compound commands
- has been fixed. Use of { and } for in and esac is obsolete.
-01-03-06 A bug in which an argument of the form foo=bar was not
- being passed correctly to a traced function whose name
- was foo has been fixed.
-01-03-02 Using $(trap -p name) did not print the name of the current
- trap setting for trap name.
-01-02-26 Exported floating point variables gave incorrect results
- when passing them to ksh88. This has been fixed.
-01-02-25 A race condition in which a coprocess which completed too quickly
- would not allow subsequent coprocesses to start has been fixed.
-01-02-25 The 'g' format specifier is now handled by printf. It had
- inadvertently been omitted.
-01-02-20 The + was not being displayed during an execution trace
- with the += assignment operator.
-01-02-19 The error message which occurs when the interpreter name
- defined on the #! line does not exist is more informative.
-01-02-19 A bug in which $0 would not be set correctly when a
- script with #! was invoked by full pathname from the
- directory of the script has been fixed.
-01-02-19 A shell script did not always pick up tty mode changes
- made by external commands such as stty which could
- effect the behavior of read.
-01-02-19 The -u, -g, and -k unary tests did not give the correct
- results when used with negation and this has been fixed.
-
-01-02-05 --- Release ksh93k+ ---
-01-02-05 The sequence \<newline> inside $'...' was not incrementing
- the line count and this has been fixed.
-01-02-05 Modified expansion of "${@-}" so that if no arguments are set
- it results in null string rather than nothing.
-01-02-02 memory leak problem with local variables in functions fixed.
-01-01-25 allow arithmetic expressions with float%int and treat them
- as ((int)float)%int rather than as an error.
-01-01-19 read -n1 was not working and has been fixed.
-01-01-17 ksh now handles the case in which a here document in command
- substitution $() is terminated by the trailing ). Previously,
- a new-line was needed at the end of the delimiter word.
-01-01-02 A bug in which a KEYBD trap would cause a multi-line token
- to be processed incorrectly has been fixed.
-00-12-10 Arithmetic integer constants can now have L and U suffices.
-00-12-10 A bug in the processing of arithmetic expressions with compound
- variables when the -n option is on has been fixed.
-00-12-08 A bug in M-f and M-b from emacs mode has been fixed. This
- bug only occurs when ksh93 is compiled without MULTIBYTE enabled.
-00-11-29 A bug in which jobs -p would yield 0 for background
- jobs run in a script has been fixed.
-00-11-21 A bug in integer arrays in which the number of elements is
- incorrect when the ++ operator is applied to a non-existing
- element has been fixed. For example, integer x; ((x[3]++)).
-00-11-20 A timing bug in which the shell could reset the terminal
- group to the wrong value in the case that the a new process
- changes the terminal group during startup has been fixed.
-
-00-10-27 --- Release ksh93k ---
-00-10-27 Using tab for completion now works only when applied
- after a non-blank character at the end of the current line.
- In other case a tab is inserted.
-00-10-27 A bug in the emacs edit mode for ^X^E has been fixed.
- The ^X^E sequence is supposed to invoke the full editor
- on the current command.
-00-10-18 A bug in which expansions of the form ${var//pattern/string}
- did not work correctly when pattern was '/' or "/" has
- been fixed.
-00-10-18 The output format for indexed arrays in compound variables
- has been modified so that it can be used as input.
-00-10-18 Assignments with name references (typeset -n) will now
- implicitly unreference an existing name reference.
-00-10-17 A bug the += append operator when a single array element
- is appended to a variable that is not an array has been fixed.
-00-10-16 A bug in which the SIGCONT signal was being sent to
- each process will kill -0 or kill -n 0 has been fixed.
-00-10-12 The arithmetic evaluation portion has been rewritten to
- perform a number of optimizations.
-00-10-10 A bug in which name prefix matching ${!name.*} was not
- checking name to see if it was a name reference has been fixed.
-00-09-26 A bug in the multibyte version in which the width of for
- non-printing characters was not correct has been fixed.
-00-09-12 Made changes to get multibyte editing work on UWIN for windows
-00-09-12 A bug in which multibyte characters would be displayed incorrectly
- has been fixed.
-00-08-08 Removed build dependency on iswprint() and iswalph().
-00-07-20 In some cases the read builtin would read more than a single
- line from a pipe on standard input and therefore leave the seek
- position in the wrong location.
-00-07-05 If the directory / is on the path, a / will not be inserted
- between the directory and the file name during path searching
- to avoid searching // for systems that treat this specially.
-00-06-26 A bug in which on rare occasions wait could return before all
- jobs have completed has been fixed.
-00-06-21 A bug in which backspace did not work correctly during the
- R replace directive in vi-mode has been fixed.
-00-06-12 Added variable name completion/expansion/listing to the set of
- completions. Variable name completions begin with $ or "$ followed
- by a letter.
-00-05-09 --- Release ksh93j ---
-00-05-09 Modified command substitution to avoid using /tmp files when
- run on read-only file systems.
-00-04-17 Modified printf to handle '%..Xc' and '%..Xs' options where X
- is not an alpha character. Previous versions core dumped with this.
-00-04-10 Changes to multibyte editing code were made to use standard
- ISO C functions rather than methods devised before the standard.
-00-04-09 Add %H options to printf to output strings with <"'&\t> properly
- converted for use in HTML and XML documents.
-00-04-07 Modified getopts builtin to handle \f...\f in usage string
- by invoking specified function.
-00-04-04 Added self generating man pages for bg, fc, fg, disown, jobs,
- hist, let, ., and ulimit.
-00-03-30 The append operator += has been added and can be used
- for all assignments, strings, arrays, and compound variables.
-00-03-30 Code was modified in several places to support automatic
- generation of C locale dictionaries.
-00-03-28 A bug in which the set and trap commands invoked with --name
- type arguments would terminate the invoking script has
- been fixed.
-00-03-27 A bug in which the library path variable was not updated
- correctly on some systems as described in the 'g' point
- release has been fixed.
-00-03-07 printf now returns a non-zero exit status when one of
- its arguments cannot be converted to the given type.
-00-03-05 The return value and error message for a command that
- was found on the path but was not executable was set
- incorrectly.
-00-03-05 A prototype for ioctl() was removed from the vi edit mode.
-
-00-01-28 --- Release ksh93i ---
-00-01-28 Most of the built-in commands and ksh itself are now
- self documenting. Running command --man will produce
- screen output. Running command --html produces the
- man page in html format.
-00-01-28 The getopts builtin can process command description
- strings to produce man pages.
-00-01-28 A bug in which a script could terminate when getopts
- encountered an error when invoked inside a function
- has been fixed.
-00-01-28 When a symbolic link was specified as the name of
- the script to invoke by name, the value of $0 was
- set to the real file name rather than the link name
- in some cases and this has been fixed.
-00-01-28 A bug in which the precision given as an argument
- to printf was not working has been fixed.
-
-99-03-31 --- Release ksh93h ---
-99-03-31 The PATH search algorithm has been modified to look
- for a file named .fpath in each bin directory and if
- found, to search for functions in this directory if
- it cannot find the command in that directory.
-99-03-31 When performing pathname expansion, the shell checks
- to see whether each directory it reads is case sensitive
- or not, and performs the matching accordingly.
-99-03-31 The %T format for printing formatted date/time.
-99-03-31 The emacs and vi modes now handle arrow keys when
- they use standard ANSI escape sequences.
-99-03-31 The TAB key can be used for completion in emacs and viraw mode.
-99-03-31 A bug in setting .sh.editchar during the KEYBD trap
- for the MULTIBYTE option was fixed in release ksh93h.
-99-03-31 A bug in shcomp for compilation of unary operators with [[...]]
- has been fixed.
-99-03-31 A bug in which the value of $? was changed when executing
- a keyboard trap has been fixed.
-99-03-31 The handling of SIGCHLD has been changed so that the
- trap is not triggered while executing trap commands
- to avoid recursive trap calls.
-99-03-31 A bug in which a local variable in a function declared readonly
- would generated an error when the function went out of
- scope has been fixed.
-99-03-31 A bug in which \<new_line> entered from the keyboard
- with the KEYBD trap enabled has been fixed.
-99-03-31 The error message for a misplaced ((, for example print ((3),
- was often garbled and has been fixed.
-99-03-31 A bug in the KEYBD trap in which escape sequences of the form
- <ESC>[#~ were not being handled as a unit has been fixed.
-99-03-31 A bug in which ksh would consider expressions like [[ (a) ]]
- as syntax errors has been fixed.
-99-03-31 A function defined as foo() without a function body
- was not reported as a syntax error.
-99-03-31 A bug in which ksh could run out of file descriptors when
- a stream was repeatedly opened with exec and read from
- has been fixed.
-
-98-04-30 --- Release ksh93g ---
-98-04-30 The pipefail option has been added. With pipefail
- enabled, a pipeline will not complete until all
- commands are complete, and the return value will
- be that of the last command to fail, or zero if
- all complete successfully.
-98-04-30 The name-value pair library uses the cdt library rather
- than the hash library. This change should be transparent
- to applications.
-98-04-30 On the U/WIN version for Window 95 and Windows NT,
- when a directory beginning with a letter followed by
- a colon is given to cd, it is assumed to be an absolute
- directory
-98-04-30 When an executable is found on a given path,
- the appropriate library path variable is prepended
- with a corresponding library directory.
-98-04-30 A bug in which a name reference could be created to
- itself and later cause the shell to get into an infinite
- loop has been fixed.
-98-04-30 A bug in shcomp relating to compound variables was fixed.
-98-04-30 A bug introduced in ksh93e in which leading 0's in -Z
- fields caused the value to be treated as octal for arithmetic
- evaluation has been fixed.
-98-04-30 A bug when a name reference with a shorter name than
- the variable it references was the subject of a compound
- assignment has been fixed.
-98-04-30 A bug which in which assignment to array variables in
- a subshell could effect the parent shell has been
- fixed.
-98-04-30 read name?prompt was putting a 0 byte at the end of the
- prompt on standard error.
-98-04-30 A bug in [[ string1 > string2 ]] when ksh was run with -x
- has been fixed.
-98-04-30 A bug in which the escape character was not processed
- correctly inside {...} when brace expansion is enabled
- has been fixed, for example {\$foo}.
-98-04-30 A bug in line continuation in here-documents has been
- fixed.
-98-04-30 The default base when not specified with typeset -i is
- 10 in accordance with the documentation. Previously,
- the value was determined by the first assignment.
-98-04-30 A parsing bug in which a # preceded alphanumeric
- characters inside a command substitution caused
- a syntax error to be reported has been fixed.
-98-04-30 A bug in which a decimal constant represented as 10#ddd
- where ddd was more than five digits generated a syntax
- error has been fixed.
-98-04-30 A bug in here document expansion in which ${...} expansions
- were split across buffer boundaries has been fixed.
-98-04-30 The sh_fun() function now takes third argument which
- is an argument list for the invoked discipline function
- or built-in.
-98-04-30 A callback function can be installed which will give
- notification of file duplications and file closes.
-98-04-30 When ksh is compiled on systems that do not use fork()
- current option settings where not propagated to sub-shells.
-
-97-06-30 --- Release ksh93f ---
-97-06-30 Hostnames in addition to host addresses can be given in
- /dev/tcp/host/port virtual file names.
-97-06-30 File name completion and expansion now quotes special
- characters in file names from both emacs and vi edit modes.
-97-06-30 An empty for list behave like a for list with null expansions.
- It produces a warning message with sh -n.
-97-06-30 The code has been modified to work with EBCDIC as well as ASCII.
-97-06-30 A bug which would cause the secondary prompt to be
- displayed when a user entered a literal carriage
- return has been fixed.
-97-06-30 A bug which caused ksh read -s name to core dump was
- fixed.
-97-06-30 A bug with the expansion of \} and \] inside double
- quoted strings that also contained variable expansions
- has been fixed
-97-06-30 Changes in the ksh93e point release caused autoload
- functions invoked from within command substitution
- to fail. This has been fixed.
-97-06-30 A bug in the processing of here-documents that could
- prevent variable substitution to occur after $(...) command
- substitution for long here documents has been fixed.
-97-06-30 A bug caused by a race condition that could cause SIGTERM
- to be ignored by a child process has been fixed.
-97-06-30 A bug which prevented the startup of a coprocess immediately
- after killing a running coprocess has been fixed.
-97-06-30 ulimit foobar, where foobar is not an arithmetic
- expression, now gives an error message as it did with ksh88
- instead of setting the file size limit to 0.
-97-06-30 A bug which could cause an interactive shell to terminate when
- the last process of a pipeline was a POSIX function was fixed.
-97-06-30 A bug which could cause command substitution of a shell script
- to core dump has been fixed.
-97-06-30 A security hole was fixed in suid_exec.
-97-06-30 Arithmetic functions such as pow() that take more than
- one argument, did not work if arguments other than the
- first contained parenthesized sub-expression.
-97-06-30 The error message from a script containing an incomplete
- arithmetic expression has been corrected.
-97-06-30 A bug which caused a core dump on some machines when
- the value of a name reference contained a positional
- parameter and the name reference was not defined inside
- a function has been fixed.
-97-06-30 Arithmetic expressions now correctly handle hexadecimal
- constants.
-97-06-30 A bug in which integer variables could be expanded
- with a leading 10# when declared with typeset -i
- multiple times has been corrected.
-97-06-30 A bug in which IFS wasn't correctly restored when
- set within command substitution has been fixed.
-97-06-30 The _ character is now considered as part of a word
- with the M-f and M-b emacs directives as it was in ksh88.
-97-06-30 A bug in brace pattern expansions that caused expressions
- such as {foo\,bar,bam} to expand incorrectly have been fixed.
-
-
-96-07-31 --- Release ksh93e ---
-96-07-31 The math functions, atan2, hypot, fmod, and pow were added.
-96-07-31 When a shared library is loaded, if the function lib_init()
- is defined in the library, it is invoked the first time that
- the library is loaded with builtin -f library.
-96-07-31 The k-shell information abstraction database option, KIA,
- has been revamped.
-96-07-31 Empty command substitutions of the form $() now work.
- whence -v foo now gives the correct result after calling
- builtin -d foo.
-96-07-31 A bug in right to left arithmetic assignment for which
- the arithmetic expression (( y = x = 1.5 )) did not
- yield 1 for y when x was declared typeset -i was fixed.
-96-07-31 printf has been fixed to handle format containing \0
- and/or \0145 correctly. In addition, characters following
- %b in the format string are no longer displayed when
- the operand contains \c.
-96-07-31 A bug in printf that could cause the %E format to
- produce unnormalized results has been fixed.
-96-07-31 A bug which causes some arithmetic expressions to be
- incorrectly evaluated as integer expressions rather
- that floating point has been fixed.
-96-07-31 Functions defined inside a subshell no longer remain
- defined when the subshell completes.
-96-07-31 The error message from sh -c ';echo foo' has been
- corrected.
-96-07-31 The format for umask -S has been changed to agree
- with the specification in the POSIX standard.
-96-07-31 A bug that caused side effects in subscript evaluation
- when tracing was enabled for subscripts using ++ or --
- has been fixed.
-96-07-31 To conform to the Posix standard getopts has been changed
- so that the option char is set to ? when it returns with
- a non-zero exit status.
-96-07-31 The handling of \} inside ${name...} has been fixed so
- that the \ quotes the }.
-96-07-31 A bug that caused the read builtin to resume execution
- after processing a trap has been fixed.
-96-07-31 [[ -s file ]] has been fixed so that if file is open
- by ksh, it is flushed first.
-96-07-31 In some cases attributes and sizes for non exported
- variables weren't being reset before running a script.
-96-07-31 The value of TMOUT was affected by changes make to
- it in a subshell.
-96-07-31 The jobs command did not reflect changes make by
- sending the CONT signal to a command.
-96-07-31 The error message for ksh -o unknown was incorrect.
-96-07-31 Functions invoked as name=value name, did not use
- values from the calling scope when evaluating value.
-96-07-31 A bug in which the shell would reexecute previously
- executed code when a shell script or coprocess was
- run in the background has been fixed.
-96-07-31 A bug in which an empty here-document would leave
- a file descriptor open has been fixed.
-96-07-31 A bug in which $(set -A array ...) would leave a
- side effect has been fixed.
-96-07-31 A discipline function for a global variable defined
- within a function defined with the function keyword,
- incorrectly created a local variable of the same name
- and applied the discipline to it.
-
-95-08-28 --- Release ksh93d ---
-95-08-28 The \ character was not handled correctly in replacement
- patterns with ${x/pattern/replace}.
-95-08-28 A bug with read in which the line did not end with
- a new-line has been fixed.
-95-08-28 A bug in file name generation which sometimes
- appended a . for filenames that ended in / has
- been fixed.
-95-08-28 If a process is waited for after a status has
- been returned by a previous wait, wait now
- returns 127.
-95-08-28 A bug with hist (fc) -e which prevented a command
- to re-executed after it had been edited has been fixed.
-95-08-28 A bug which prevented quoting from removing the meaning
- of unary test operators has been fixed.
-95-08-28 A bug with typeahead and KEYBOARD traps with the
- MULTIBYTE option set has been fixed.
-95-08-28 Builtin functions can take a third argument which is
- a void*.
-95-08-28 The nv_scan() function can restrict the scope of a walk
- to the top scope.
-
-95-04-31 --- Release ksh93c ---
-95-04-31 The expansion of "$@" was incorrect when $1 was the null
- string.
-95-04-31 A bug which could incorrectly report a syntax error in
- a backquoted expression when a $ was preceded by \\
- has been fixed.
-95-04-31 A bug which prevented the shell from exiting after
- reporting an error when failing to open a script
- has been fixed.
-95-04-31 A bug that could lead to memory corruption when a
- large here document that required parameter or command
- substitution was expanded has been fixed.
-95-04-31 A bug that could cause a core dump on some systems
- after ksh detected an error when reading a function
- has been fixed.
-95-04-31 A bug which could cause a coprocess to hang when
- reading from a process that has terminated has been fixed.
-95-04-31 A bug which caused a script to terminate when set -e
- was on and the first command of and && or || list
- failed has been fixed.
-95-04-31 A bug with here documents inside $(...) when the delimiter
- word is an identifier has been fixed.
-95-04-31 A bug which caused $0 to display the wrong value when
- a script was invoked as an argument to the . command
- and the eval command has been fixed.
-95-04-31 A bug that could cause the built-in sleep to hang
- has been fixed.
-95-04-31 A bug introduces in 12/28/93b which caused the backslash
- to be removed when it was followed by digit inside double
- quotes in some instances has been fixed.
-95-04-31 A bug which could cause a core dump if ksh was invoked with
- standard input closed has been fixed.
-95-04-31 A bug which could cause a core dump if typeset -A was
- specified for an existing variable has been fixed.
-95-04-31 Variables that were unset but had attributes such as readonly
- and export were not listed with readonly, export and typeset.
-95-04-31 Several problems with signals have been fixed.
-95-04-31 A bug which prevented ulimit -t from working has been fixed.
- Also, a bug in which failed ulimits could cause a core dump
- has also been fixed.
-95-04-31 A bug in expansion of the form ${name/#pattern/string} and
- ${name/%pattern/string} has been fixed.
-95-04-31 A bug which caused read -r on a line that contained only
- blanks to get a non-null value has been fixed.
-95-04-31 A bug introduced in the 'a' point release in which
- ${x='\\'} expanded to \ when x was unset has been fixed.
-95-04-31 A bug which prevented a trap on EXIT from being executed
- when the last command in a script was a function invocation
- has been fixed.
-95-04-31 A bug which caused an interactive shell ignore input when
- standard error was redirected to a file with exec,
- and then restored with exec 2>&1 has been fixed.
-95-04-31 An interactive shell turns on monitor mode even when
- standard error has been redirected to a file.
-95-04-31 A bug which could cause standard input to be incorrectly
- positioned for the last command of a script has been fixed.
-95-04-31 A bug in the edit modes which allowed walking back in
- the history file for more than HISTSIZE commands has
- been fixed.
-95-04-31 A bug which could cause a core dump if variable TMPDIR was
- changed between two command substitutions has been fixed.
-95-04-31. A bug which prevented a trap on EXIT from being cleared
- has been fixed.
-95-04-31 A bug fixed for the v directive in vi MULTIBYTE has been
- fixed.
-95-04-31 Code to for IFS handling of multibyte characters has
- been added.
-95-04-31 The displaying of multibyte strings in export, readonly,
- typeset, and execution traces has been fixed.
-95-04-31 Variables inside functions are now statically scoped.
- The previous behavior was never documented.
-95-04-31 Variables inside functions are now statically scoped.
- The previous behavior was never documented.
-95-04-31 A few changes have been made to the name-value library
- that affect built-ins that use disciplines. The
- changes allow disciplines to be shared by variables
- and should make it possible to add new disciplines
- without recompilation.
-95-04-31 The name-value library interface has undergone significant
- change for this revision. See the new nval.3 man page.
-
-94-12-31 --- Release ksh93b ---
-94-12-31 Variables inside functions are now statically scoped.
- The previous behavior was never documented.
-94-12-31 If IFS contains two consecutive identical characters belonging
- to the [:space:] class, then this character is treated as
- a non-space delimiter so that each instance will delimit
- a field. For example, IFS=$'\t\t' will cause two consecutive
- tabs to delimit a null field.
-94-12-31 The getopts command has a -a name option that specifies a
- name that will be used for usage messages.
-94-12-31 A bug which caused unset RANDOM to dump core has been
- fixed.
-94-12-31 A bug which prevented return for terminating a profile
- or ENV file has been fixed.
-94-12-31 A bug which prevented standard input from being
- directed to /dev/null for background jobs when
- monitor mode was turned off has been fixed.
-94-12-31 Statements of the form typeset -options var[expr]=value
- did not perform substitutions on expr as expected.
-94-12-31 A bug which prevented the shell from sending a HUP
- signal to some background jobs that were not disowned
- has been fixed.
-94-12-31 A bug which allowed a script to trap signals that are
- ignored at the time that the shell was invoked by exec
- has been fixed.
-94-12-31 A bug which could cause a core dump when a discipline
- function was unset within a discipline was fixed.
-94-12-31 The typeset builtin now accepts a first argument of
- + or - for compatibility with ksh88.
-94-12-31 For compatibility with ksh88, the results of expansions
- of command arguments will treat the extended character
- match characters ()|& as ordinary characters.
-94-12-31 A bug which caused read to fail on a file that was
- open for read/write with <> when the first operation
- was print or printf has been fixed.
-94-12-31 When a job is suspended, it is put on the top of
- the job list as required by the POSIX standard.
-94-12-31 The value of OPTARG when an option that required
- an argument but didn't have one was incorrect in the
- case the the option string began with a :.
-94-12-31 A bug which caused the terminal to get into a bad
- state with some KEYBD traps in vi-mode has been fixed.
-94-12-31 A bug which caused an invalid trap to cause a script
- to terminate, rather than just return an error, has
- been fixed.
-94-12-31 Backreferencing sub-expressions in patterns and replacement
- strings now works.
-94-12-31 A bug in chmod which caused the -R option to fail has
- been fixed.
-94-12-31 More signal names have been added for Solaris
-
-94-06-30 --- Release ksh93a ---
-94-06-30 An expansion bug which causes portions of a word after
- a $((...)) expansion that contains a nested $var expansion
- to be lost has been fixed.
-94-06-30 A bug that caused a core dump when a script that did not
- have PWD set and did a cd inside command substitution
- has been fixed.
-94-06-30 A bug which caused a core dump on some machines when
- the LANG variable was assigned to has been fixed.
-94-06-30 A bug which incorrectly handled set disciplines that
- performed arithmetic evaluation when the discipline
- was called from the arithmetic evaluator has been fixed.
-94-06-30 A bug caused by an EXIT trap inside a function that
- was executed in a subshell was fixed.
-94-06-30 If foo is a function, and not a program, then command foo
- now reports that foo isn't found rather than invoking foo.
-94-06-30 The previous version incorrectly listed -A as an
- invocation option. The -A option is only for set.
-94-06-30 A bug was fixed which caused ksh to loop when execution trace
- was enabled and the PS4 prompt required command substitution.
-94-06-30 A bug which could cause the job control switch character
- to be disabled when a script that enabled monitor mode
- terminated was fixed.
-94-06-30 A bug in the macro expansion global replacement operator //,
- when the pattern began with a [ or +( has been fixed.
-94-06-30 A bug which prevented ~ expansion from occurring when
- it was terminated with a colon inside an assignment
- has been fixed.
-94-06-30 A bug in the dot command which prevented autoload functions
- from working has been fixed.
-94-06-30 A bug which caused a variable to be unset if the
- its value were expanded inside a set discipline has
- been fixed.
-94-06-30 Whence -a now longer reports that a defined function
- is undefined.
-94-06-30 A bug on some systems in which $0 would be incorrect
- in scripts invoked by name has been fixed.
-94-06-30 Here documents with an empty body now work.
-94-06-30 A bug which disabled argument passing and resetting
- of options for a script invoked by name inside a
- function has been fixed.
-94-06-30 A bug in which an EXIT trap set the caller of a function
- would be executed if a command called inside a function
- was not found has been fixed.
-94-06-30 A bug which allowed a script to trap signals that are
- ignored at the time that the shell was invoked has
- been fixed.
-94-06-30 A bug which caused 2<&1- when applied to a shell built-in
- to leave standard input closed has been fixed.
-94-06-30 A bug which caused the shell to incorrectly parse
- $() command substitutions with nested case statements
- has been fixed.
-
diff --git a/usr/src/lib/libshell/common/TYPES b/usr/src/lib/libshell/common/TYPES
deleted file mode 100644
index 6eb6f41b5e..0000000000
--- a/usr/src/lib/libshell/common/TYPES
+++ /dev/null
@@ -1,182 +0,0 @@
-
-The ability for users to define types has been added to ksh93t.
-Here is a quick summary of how types are defined and used in ksh93t.
-This is still a work in progress so some changes and additions
-are likely.
-
-A type can be defined either by a shared library or by using the new
-typeset -T option to the shell. The method for defining types via
-a shared library is not described here. However, the source file
-bltins/enum.c is an example of a builtin that creates enumeration types.
-
-By convention, typenames begin with a capitol letter and end in _t.
-To define a type, use
- typeset -T Type_t=(
- definition
- )
-where definition contains assignment commands, declaration commands,
-and function definitions. A declaration command (for example typeset,
-readonly, and export), is a built-in that differs from other builtins in
-that tilde substitution is performed on arguments after an =, assignments
-do not have to precede the command name, and field splitting and pathname
-expansion is not performed on the arguments.
-For example,
- typeset -T Pt_t=(
- float -h 'length in inches' x=1
- float -h 'width in inches' y=0
- integer -S count=0
- len()
- {
- print -r $((sqrt(_.x*_.x + _.y*_.y)))
- }
- set()
- {
- (( _.count++))
- }
- )
-
-defines a type Pt_t that has three variables x, y, and count defined as well
-as the discipline functions len and set. The variable x has an initial value
-of 1 and the variable y has an initial value of 0. The new -h option argument,
-is used for documentations purposes as described later and is ignored outside
-of a type definition.
-
-
-The variable count has the new -S attribute which means that it is shared
-between all instances of the type. The -S option to typeset is ignored
-outside of a type definition. Note the variable named _ that is used inside
-the function definition for len and set. It will be a reference to the
-instance of Pt_t that invoked the function. The functions len and set
-could also have been defined with function len and function set, but
-since there are no local variables, the len() and set() form are more
-efficient since they don't need to set up a context for local variables
-and for saving and restoring traps.
-
-If the discipline function named create is defined it will be
-invoked when creating each instance for that type. A function named
-create cannot be defined by any instance.
-
-When a type is defined, a declaration built-in command by this name
-is added to ksh. As with other shell builtins, you can get the man page
-for this newly added command by invoking Pt_t --man. The information from
-the -h options will be embedded in this man page. Any functions that
-use getopts to process arguments will be cross referenced on the generated
-man page.
-
-Since Pt_t is now a declaration command it can be used in the definition
-of other types, for example
- typeset -T Rect_t=( Pt_t ur ll)
-
-Because a type definition is a command, it can be loaded on first reference
-by putting the definition into a file that is found on FPATH.
-Thus, if this definition is in a file named Pt_t on FPATH, then
-a program can create instances of Pt_t without first including
-the definition.
-
-A type definition is readonly and cannot be unset. Unsetting non-shared
-elements of a type restores them to their default value. Unsetting a
-shared element has no effect.
-
-The Pt_t command is used to create an instance of Pt_t.
- Pt_t p1
-creates an instance named p1 with the initial value for p1.x set to 1
-and the initial value of p1.y set to 0.
- Pt_t p2=(x=3 y=4)
-creates an instance with the specified initial values. The len function
-gives the distance of the point to the origin. Thus, p1.len will output
-1 and p2.len will output 5.
-
-ksh93t also introduces a more efficient command substitution mechanism.
-Instead of $(command), the new command substitution ${ command;}
-can be used. Unlike (and ) which are always special, the { and } are
-reserved words and require the space after { and a newline or ; before }.
-Unlike $(), the ${ ;} command substitution executes the command in
-the current shell context saving the need to save and restore
-changes, therefore also allowing side effects.
-
-When trying to expand an element of a type, if the element does not exist,
-ksh will look for a discipline function with that name and treat this as if
-it were the ${ ;} command substitution. Thus, ${p1.len} is equivalent to
-${ p1.len;} and within an arithmetic expression, p1.len will be expanded
-via the new command substitution method.
-
-The type of any variable can be obtained from the new prefix
-operator @. Thus, ${@p1} will output Pt_t.
-
-By default, each instance inherits all the discipline functions defined
-by the type definition other than create. However, each instance can define
-a function by the same name that will override this definition.
-However, only discipline functions with the same name as those defined
-by the type or the standard get, set, append, and unset disciplines
-can be defined by each instance.
-
-Each instance of the type Pt_t behaves like a compound variable except
-that only the variables defined by the type can be referenced or set.
-Thus, p2.x=9 is valid, but p2.z=9 is not. Unless a set discipline function
-does otherwise, the value of $p1 will be expanded to the form of a compound
-variable that can be used for reinput into ksh.
-
-If the variables var1 and var2 are of the same type, then the assignment
- var2=var1
-will create a copy of the variable var1 into var2. This is equivalent to
- eval var2="$var1"
-but is faster since the variable does not need to get expanded or reparsed.
-
-The type Pt_t can be referenced as if it were a variable using the name
-.sh.type.Pt_t. To change the default point location for subsequent
-instances of Pt_t, you can do
- .sh.type.Pt_t=(x=5 y=12)
-so that
- Pt_t p3
- p3.len
-would be 13.
-
-Types can be defined for simple variables as well as for compound
-objects such as Pt_t. In this case, the variable named . inside
-the definition refers to the real value for the variable. For example,
-the type definition
- typeset -T Time_t=(
- integer .=0
- _='%H:%M:%S'
- get()
- {
- .sh.value=$(printf "%(${_._})T" "#$((_))" )
- }
- set()
- {
- .sh.value=$(printf "%(%#)T" "${.sh.value}")
-
- }
- )
-
-The sub-variable name _ is reserved for data used by discipline functions
-and will not be included with data written with the %B option to printf.
-In this case it is used to specify a date format.
-
-In this case
- Time_t t1 t2=now
-will define t1 as the time at the beginning of the epoch and t2
-as the current time. Unlike the previous case, $t2 will output
-the current time in the date format specified by the value t2._.
-However, the value of ${t2.} will expand the instance to a form
-that can be used as input to the shell.
-
-Finally, types can be derived from an existing type. If the first
-element in a type definition is named _, then the new type
-consists of all the elements and discipline functions from the
-type of _ extended by elements and discipline functions defined
-by new type definition. For example,
-
- typeset -T Pq_t=(
- Pt_t _
- float z=0.
- len()
- {
- print -r $((sqrt(_.x*_.x + _.y*_.y + _.z*_.z)))
- }
- )
-
-defines a new type Pq_t which is based on Pq_t and contains an additional
-field z and a different len discipline function. It is also possible
-to create a new type Pt_t based on the original Pt_t. In this case
-the original Pt_t is no longer accessible.
diff --git a/usr/src/lib/libshell/misc/images/callouts/1.png b/usr/src/lib/libshell/misc/images/callouts/1.png
deleted file mode 100644
index 608fad3596..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/1.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/10.png b/usr/src/lib/libshell/misc/images/callouts/10.png
deleted file mode 100644
index 39e55197cf..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/10.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/2.png b/usr/src/lib/libshell/misc/images/callouts/2.png
deleted file mode 100644
index 5444738841..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/2.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/3.png b/usr/src/lib/libshell/misc/images/callouts/3.png
deleted file mode 100644
index 64b87c7151..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/3.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/4.png b/usr/src/lib/libshell/misc/images/callouts/4.png
deleted file mode 100644
index c308193ac4..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/4.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/5.png b/usr/src/lib/libshell/misc/images/callouts/5.png
deleted file mode 100644
index 24799f0a43..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/5.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/6.png b/usr/src/lib/libshell/misc/images/callouts/6.png
deleted file mode 100644
index 8919a670cd..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/6.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/7.png b/usr/src/lib/libshell/misc/images/callouts/7.png
deleted file mode 100644
index e30e8a70cb..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/7.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/8.png b/usr/src/lib/libshell/misc/images/callouts/8.png
deleted file mode 100644
index 3e35c8827c..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/8.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/callouts/9.png b/usr/src/lib/libshell/misc/images/callouts/9.png
deleted file mode 100644
index ed2f14b4eb..0000000000
--- a/usr/src/lib/libshell/misc/images/callouts/9.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_bourne.png b/usr/src/lib/libshell/misc/images/tag_bourne.png
deleted file mode 100644
index f1f78e3a25..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_bourne.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_i18n.png b/usr/src/lib/libshell/misc/images/tag_i18n.png
deleted file mode 100644
index 559929df2a..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_i18n.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_ksh.png b/usr/src/lib/libshell/misc/images/tag_ksh.png
deleted file mode 100644
index b33d5a7aa1..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_ksh.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_ksh88.png b/usr/src/lib/libshell/misc/images/tag_ksh88.png
deleted file mode 100644
index d36dc0f5f5..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_ksh88.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_ksh93.png b/usr/src/lib/libshell/misc/images/tag_ksh93.png
deleted file mode 100644
index 357ee3c50a..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_ksh93.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_l10n.png b/usr/src/lib/libshell/misc/images/tag_l10n.png
deleted file mode 100644
index be89f7a163..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_l10n.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/images/tag_perf.png b/usr/src/lib/libshell/misc/images/tag_perf.png
deleted file mode 100644
index fcb2960852..0000000000
--- a/usr/src/lib/libshell/misc/images/tag_perf.png
+++ /dev/null
Binary files differ
diff --git a/usr/src/lib/libshell/misc/shell_styleguide.docbook b/usr/src/lib/libshell/misc/shell_styleguide.docbook
deleted file mode 100644
index 0376912d1f..0000000000
--- a/usr/src/lib/libshell/misc/shell_styleguide.docbook
+++ /dev/null
@@ -1,1464 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" "http://www.oasis-open.org/docbook/xml/5.0b5/dtd/docbook.dtd" [
- <!ENTITY tag_bourneonly '<inlinemediaobject><imageobject><imagedata fileref="images/tag_bourne.png"></imagedata></imageobject><textobject><phrase>[Bourne]</phrase></textobject></inlinemediaobject> '>
- <!ENTITY tag_kshonly '<inlinemediaobject><imageobject><imagedata fileref="images/tag_ksh.png"></imagedata></imageobject><textobject><phrase>[ksh]</phrase></textobject></inlinemediaobject> '>
- <!ENTITY tag_ksh88only '<inlinemediaobject><imageobject><imagedata fileref="images/tag_ksh88.png"></imagedata></imageobject><textobject><phrase>[ksh88]</phrase></textobject></inlinemediaobject> '>
- <!ENTITY tag_ksh93only '<inlinemediaobject><imageobject><imagedata fileref="images/tag_ksh93.png"></imagedata></imageobject><textobject><phrase>[ksh93]</phrase></textobject></inlinemediaobject> '>
- <!ENTITY tag_performance '<inlinemediaobject><imageobject><imagedata fileref="images/tag_perf.png"></imagedata></imageobject><textobject><phrase>[perf]</phrase></textobject></inlinemediaobject> '>
- <!ENTITY tag_i18n '<inlinemediaobject><imageobject><imagedata fileref="images/tag_i18n.png"></imagedata></imageobject><textobject><phrase>[i18n]</phrase></textobject></inlinemediaobject> '>
- <!ENTITY tag_l10n '<inlinemediaobject><imageobject><imagedata fileref="images/tag_l10n.png"></imagedata></imageobject><textobject><phrase>[l10n]</phrase></textobject></inlinemediaobject> '>
-]>
-<!--
-
- CDDL HEADER START
-
- The contents of this file are subject to the terms of the
- Common Development and Distribution License (the "License").
- You may not use this file except in compliance with the License.
-
- You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- or http://www.opensolaris.org/os/licensing.
- See the License for the specific language governing permissions
- and limitations under the License.
-
- When distributing Covered Code, include this CDDL HEADER in each
- file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- If applicable, add the following below this CDDL HEADER, with the
- fields enclosed by brackets "[]" replaced with your own identifying
- information: Portions Copyright [yyyy] [name of copyright owner]
-
- CDDL HEADER END
-
--->
-
-<!--
-
- Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- Use is subject to license terms.
-
--->
-
-<!-- tag images were created like this:
-$ (text="perf" ;
- pbmtext -nomargins -lspace 0 -builtin fixed "${text}" |
- pbmtopgm 1 1 |
- pgmtoppm 1.0,1.0,1.0-0,0,0 /dev/stdin |
- ppmtogif |
- giftopnm |
- pnmtopng >"tag_${text}.png")
--->
-
-<!-- compile with:
-xsltproc &minus;&minus;stringparam generate.section.toc.level 0 \
- &minus;&minus;stringparam toc.max.depth 3 \
- &minus;&minus;stringparam toc.section.depth 12 \
- &minus;&minus;xinclude -o opensolaris_shell_styleguide.html /usr/share/sgml/docbook/docbook-xsl-stylesheets-1.69.1/html/docbook.xsl opensolaris_shell_styleguide.docbook
--->
-
-<article
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns="http://docbook.org/ns/docbook"
- xml:lang="en">
- <!-- xmlns:xi="http://www.w3.org/2001/XInclude" -->
-
- <info>
- <title><emphasis>[DRAFT]</emphasis> Bourne/Korn Shell Coding Conventions</title>
-
- <!-- subtitle abuse -->
- <subtitle>
- This page is currently work-in-progress until it is approved by the OS/Net community. Please send any comments to
- <email>shell-discuss@opensolaris.org</email>.
- </subtitle>
-
-
- <authorgroup>
-<!--
- <author><personname>David G. Korn</personname><email>dgk@research.att.com</email></author>
- <author><personname>Roland Mainz</personname><email>roland.mainz@nrubsig.org</email></author>
- <author><personname>Mike Shapiro</personname><email>mike.shapiro@sun.com</email></author>
--->
- <author><orgname>OpenSolaris.org</orgname></author>
- </authorgroup>
- </info>
-
-<section xml:id="intro">
- <title>Intro</title>
- <para>This document describes the shell coding style used for all the SMF script changes integrated into (Open)Solaris.</para>
- <para>All new SMF shell code should conform to this coding standard, which is intended to match our existing C coding standard.</para>
- <para>When in doubt, think "what would be the C-Style equivalent ?" and "What does the POSIX (shell) standard say ?"</para>
-</section><!-- end of intro -->
-
-
-<section xml:id="rules">
- <title>Rules</title>
-
-
-
- <section xml:id="general">
- <title>General</title>
-
- <section xml:id="basic_format">
- <title>Basic Format</title>
- <para>Similar to <literal>cstyle</literal>, the basic format is that all
- lines are indented by TABs or eight spaces, and continuation lines (which
- in the shell end with "\") are indented by an equivalent number of TABs
- and then an additional four spaces, e.g.
-<programlisting>
-cp foo bar
-cp some_realllllllllllllllly_realllllllllllllly_long_path \
- to_another_really_long_path
-</programlisting>
- </para>
- <para>The encoding used for the shell scripts is either <literal>ASCII</literal>
- or <literal>UTF-8</literal>, alternative encodings are only allowed when the
- application requires this.</para>
- </section>
-
-
- <section xml:id="commenting">
- <title>Commenting</title>
- <para>Shell comments are preceded by the '<literal>#</literal>' character. Place
- single-line comments in the right-hand margin. Use an extra '<literal>#</literal>'
- above and below the comment in the case of multi-line comments:
-<programlisting>
-cp foo bar # Copy foo to bar
-
-#
-# Modify the permissions on bar. We need to set them to root/sys
-# in order to match the package prototype.
-#
-chown root bar
-chgrp sys bar
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="interpreter_magic">
- <title>Interpreter magic</title>
- <para>The proper interpreter magic for your shell script should be one of these:
-<programlisting>
-#!/bin/sh Standard Bourne shell script
-#!/bin/ksh -p Standard Korn shell 88 script. You should always write ksh
- scripts with -p so that ${ENV} (if set by the user) is not
- sourced into your script by the shell.
-#!/bin/ksh93 Standard Korn shell 93 script (-p is not needed since ${ENV} is
- only used for interactive shell sessions).
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="harden_your_script_against_unexpected_input">
- <title>Harden the script against unexpected (user) input</title>
- <para>Harden your script against unexpected (user) input, including
- command line options, filenames with blanks (or other special
- characters) in the name, or file input</para>
- </section>
-
-
- <section xml:id="use_builtin_commands">
- <title>&tag_kshonly;&tag_performance;Use builtin commands if the shell provides them</title>
- <para>
- Use builtin commands if the shell provides them. For example ksh93s+
- (ksh93, version 's+') delivered with Solaris (as defined by PSARC 2006/550)
- supports the following builtins:
- <simplelist type="inline">
- <member>basename</member>
- <member>cat</member>
- <member>chgrp</member>
- <member>chmod</member>
- <member>chown</member>
- <member>cmp</member>
- <member>comm</member>
- <member>cp</member>
- <member>cut</member>
- <member>date</member>
- <member>dirname</member>
- <member>expr</member>
- <member>fds</member>
- <member>fmt</member>
- <member>fold</member>
- <member>getconf</member>
- <member>head</member>
- <member>id</member>
- <member>join</member>
- <member>ln</member>
- <member>logname</member>
- <member>mkdir</member>
- <member>mkfifo</member>
- <member>mv</member>
- <member>paste</member>
- <member>pathchk</member>
- <member>rev</member>
- <member>rm</member>
- <member>rmdir</member>
- <member>stty</member>
- <member>tail</member>
- <member>tee</member>
- <member>tty</member>
- <member>uname</member>
- <member>uniq</member>
- <member>wc</member>
- <member>sync</member>
- </simplelist>
- Those builtins can be enabled via <literal>$ builtin name_of_builtin #</literal> in shell
- scripts (note that ksh93 builtins implement exact POSIX behaviour - some
- commands in Solaris <filename>/usr/bin/</filename> directory implement pre-POSIX behaviour.
- Add <literal>/usr/xpg6/bin/:/usr/xpg4/bin</literal> before
- <filename>/usr/bin/</filename> in <envar>${PATH}</envar> to test whether your script works with
- the XPG6/POSIX versions)
- </para>
- </section>
-
-
- <section xml:id="use_blocks_not_subshells">
- <title>&tag_performance;Use blocks and not subshells if possible</title>
- <para>Use blocks and not subshells if possible, e.g. use
- <literal>$ { print "foo" ; print "bar" ; }</literal> instead of
- <literal>$ (print "foo" ; print "bar") #</literal> - blocks are
- faster since they do not require to save the subshell context (ksh93) or
- trigger a shell child process (Bourne shell, bash, ksh88 etc.)
- </para>
- </section>
-
-
- <section xml:id="use_long_options_for_set_builtin">
- <title>&tag_kshonly; use long options for "<literal>set</literal>"</title>
- <para>use long options for "<literal>set</literal>", for example instead of <literal>$ set -x #</literal>
- use <literal>$ set -o xtrace #</literal> to make the code more readable.</para>
- </section>
-
-
- <section xml:id="use_posix_command_substitutions_syntax">
- <title>&tag_kshonly; Use <literal>$(...)</literal> instead of <literal>`...`</literal> command substitutions</title>
- <para>Use <literal>$(...)</literal> instead of <literal>`...`</literal> - <literal>`...`</literal>
- is an obsolete construct in ksh+POSIX sh scripts and <literal>$(...)</literal>.is a cleaner design,
- requires no escaping rules, allows easy nesting etc.</para>
-
- <note><title>&tag_ksh93only; <literal>${ ...;}</literal>-style command substitutions</title>
- <para>ksh93 has support for an alternative version of command substitutions with the
- syntax <literal>${ ...;}</literal> which do not run in a subshell.
- </para></note>
- </section>
-
-
- <section xml:id="put_command_substitution_result_in_quotes">
- <title>&tag_kshonly; Always put the result of a <literal>$(...)</literal> or
- <literal>$( ...;)</literal> command substitution in quotes</title>
- <para>Always put the result of <literal>$( ... )</literal> or <literal>$( ...;)</literal> in
- quotes (e.g. <literal>foo="$( ... )"</literal> or <literal>foo="$( ...;)"</literal>) unless
- there is a very good reason for not doing it</para>
- </section>
-
-
- <section xml:id="always_set_path">
- <title>Scripts should always set their <envar>PATH</envar></title>
- <para>Scripts should always set their <envar>PATH</envar> to make sure they do not use
- alternative commands by accident (unless the value of <envar>PATH</envar> is well-known
- and guaranteed to be set by the caller)</para>
- </section>
-
-
- <section xml:id="make_sure_commands_are_available">
- <title>Make sure that commands from other packages/applications are really installed on the machine</title>
- <para>Scripts should make sure that commands in optional packages are really
- there, e.g. add a "precheck" block in scipts to avoid later failure when
- doing the main job</para>
- </section>
-
-
- <section xml:id="check_usage_of_boolean_variables">
- <title>Check how boolean values are used/implemented in your application</title>
- <para>Check how boolean values are used in your application.</para>
- <para>For example:
-<programlisting>
-mybool=0
-# do something
-if [ $mybool -eq 1 ] ; then do_something_1 ; fi
-</programlisting>
-could be rewritten like this:
-<programlisting>
-mybool=false # (valid values are "true" or "false", pointing
-# to the builtin equivalents of /bin/true or /bin/false)
-# do something
-if ${mybool} ; then do_something_1 ; fi
-</programlisting>
-or
-<programlisting>
-integer mybool=0 # values are 0 or 1
-# do something
-if (( mybool==1 )) ; then do_something_1 ; fi
-</programlisting>
- </para>
- </section>
-
- <section xml:id="shell_uses_characters_not_bytes">
- <title>&tag_i18n;The shell always operates on <emphasis>characters</emphasis> not bytes</title>
- <para>Shell scripts operate on characters and <emphasis>not</emphasis> bytes.
- Some locales use multiple bytes (called "multibyte locales") to represent one character</para>
-
- <note><para>ksh93 has support for binary variables which explicitly
- operate on bytes, not characters. This is the <emphasis>only</emphasis> allowed
- exception.</para></note>
- </section>
-
-
- <section xml:id="multibyte_locale_input">
- <title>&tag_i18n;Multibyte locales and input</title>
- <para>Think about whether your application has to handle file names or
- variables in multibyte locales and make sure all commands used in your
- script can handle such characters (e.g. lots of commands in Solaris's
- <filename>/usr/bin/</filename> are <emphasis>not</emphasis> able to handle such values - either use ksh93
- builtin constructs (which are guaranteed to be multibyte-aware) or
- commands from <filename>/usr/xpg4/bin/</filename> and/or <filename>/usr/xpg6/bin</filename>)
- </para>
- </section>
-
-
- <section xml:id="use_external_filters_only_for_large_datasets">
- <title>&tag_performance;Only use external filters like <literal>grep</literal>/<literal>sed</literal>/<literal>awk</literal>/etc.
- if you want to process lots of data with them</title>
- <para>Only use external filters like <literal>grep</literal>/<literal>sed</literal>/<literal>awk</literal>/etc.
- if a significant amount of data is processed by the filter or if
- benchmarking shows that the use of builtin commands is significantly slower
- (otherwise the time and resources needed to start the filter are
- far greater then the amount of data being processed,
- creating a performance problem).</para>
- <para>For example:
-<programlisting>
-if [ "$(echo "$x" | egrep '.*foo.*')" != "" ] ; then
- do_something ;
-done
-</programlisting>
-can be re-written using ksh93 builtin constructs, saving several
-<literal>|fork()|+|exec()|</literal>'s:
-<programlisting>
-if [[ "${x}" == ~(E).*foo.* ]] ; then
- do_something ;
-done
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="use_dashdash_if_first_arg_is_variable">
- <title>If the first operand of a command is a variable, use <literal>--</literal></title>
- <para>If the first operand of a command is a variable, use <literal>--</literal>
- for any command that accepts this as end of argument to
- avoid problems if the variable expands to a value starting with <literal>-</literal>.
- </para>
- <note><para>
- At least
- <simplelist type="inline">
- <member>print</member>
- <member>/usr/bin/fgrep</member><member>/usr/xpg4/bin/fgrep</member>
- <member>/usr/bin/grep</member> <member>/usr/xpg4/bin/grep</member>
- <member>/usr/bin/egrep</member><member>/usr/xpg4/bin/egrep</member>
- </simplelist>
- support <literal>--</literal> as "end of arguments"-terminator.
- </para></note>
- </section>
-
- <section xml:id="use_export">
- <title>&tag_kshonly;&tag_performance;Use <literal>$ export FOOBAR=val #</literal> instead of
- <literal>$ FOOBAR=val ; export FOOBAR #</literal></title>
- <para>Use <literal>$ export FOOBAR=val # instead of $ FOOBAR=val ; export FOOBAR #</literal> -
- this is much faster.</para>
- </section>
-
-
- <section xml:id="use_subshell_around_set_dashdash_usage">
- <title>Use a subshell (e.g. <literal>$ ( mycmd ) #</literal>) around places which use
- <literal>set -- $(mycmd)</literal> and/or <literal>shift</literal></title>
- <para>Use a subshell (e.g. <literal>$ ( mycmd ) #</literal>) around places which use
- <literal>set -- $(mycmd)</literal> and/or <literal>shift</literal> unless the variable
- affected is either a local one or if it's guaranteed that this variable will no longer be used
- (be careful for loadable functions, e.g. ksh/ksh93's <literal>autoload</literal> !!!!)
- </para>
- </section>
-
-
- <section xml:id="be_careful_with_tabs_in_script_code">
- <title>Be careful with using TABS in script code, they are not portable
- between editors or platforms</title>
- <para>Be careful with using TABS in script code, they are not portable
- between editors or platforms.</para>
- <para>If you use ksh93 use <literal>$'\t'</literal> to include TABs in sources, not the TAB character itself.</para>
- </section>
-
-
- <section xml:id="centralise_error_exit">
- <title>If you have multiple points where your application exits with an error
- message create a central function for this purpose</title>
- <para>If you have multiple points where your application exits with an error
- message create a central function for this, e.g.
-<programlisting>
-if [ -z "$tmpdir" ] ; then
- print -u2 "mktemp failed to produce output; aborting."
- exit 1
-fi
-if [ ! -d $tmpdir ] ; then
- print -u2 "mktemp failed to create a directory; aborting."
- exit 1
-fi
-</programlisting>
-should be replaced with
-<programlisting>
-function fatal_error
-{
- print -u2 "${progname}: $*"
- exit 1
-}
-# do something (and save ARGV[0] to variable "progname")
-if [ -z "$tmpdir" ] ; then
- fatal_error "mktemp failed to produce output; aborting."
-fi
-if [ ! -d "$tmpdir" ] ; then
- fatal_error "mktemp failed to create a directory; aborting."
-fi
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="use_set_o_nounset">
- <title>&tag_kshonly; Think about using <literal>$ set -o nounset #</literal> by default</title>
- <para>Think about using <literal>$ set -o nounset #</literal> by default (or at least during the
- script's development phase) to catch errors where variables are used
- when they are not set (yet), e.g.
-<screen>
-$ <userinput>(set -o nounset ; print ${foonotset})</userinput>
-<computeroutput>/bin/ksh93: foonotset: parameter not set</computeroutput>
-</screen>
- </para>
- </section>
-
-
- <section xml:id="avoid_eval_builtin">
- <title>Avoid using <literal>eval</literal> unless absolutely necessary</title>
- <para>Avoid using <literal>eval</literal> unless absolutely necessary. Subtle things
- can happen when a string is passed back through the shell
- parser. You can use name references to avoid uses such as
- <literal>eval $name="$value"</literal>.
- </para>
- </section>
-
-
- <section xml:id="use_concatenation_operator">
- <title>&tag_ksh93only;Use the string/array concatenation operator <literal>+=</literal></title>
- <para>Use <literal>+=</literal> instead of manually adding strings/array elements, e.g.
-<programlisting>
-foo=""
-foo="${foo}a"
-foo="${foo}b"
-foo="${foo}c"
-</programlisting>
-should be replaced with
-<programlisting>
-foo=""
-foo+="a"
-foo+="b"
-foo+="c"
-</programlisting>
- </para>
- </section>
-
- <section xml:id="use_source_not_dot">
- <title>&tag_ksh93only;Use <literal>source</literal> instead of '<literal>.</literal> '(dot)
- to include other shell script fragments</title>
- <para>Use <literal>source</literal> instead of '<literal>.</literal>'
- (dot) to include other shell script fragments - the new form is much
- more readable than the tiny dot and a failure can be caught within the script.</para>
- </section>
-
-
- <section xml:id="use_builtin_localisation_support">
- <title>&tag_ksh93only;&tag_performance;&tag_l10n;Use <literal>$"..."</literal> instead of
- <literal>gettext ... "..."</literal> for strings that need to be localized for different locales</title>
- <para>Use $"..." instead of <literal>gettext ... "..."</literal> for strings that need to be
- localized for different locales. <literal>gettext</literal> will require a
- <literal>fork()+exec()</literal> and
- reads the whole catalog each time it's called, creating a huge overhead for localisation
- (and the <literal>$"..."</literal> is easier to use, e.g. you only have to put a
- <literal>$</literal> in front of the catalog and the string will be localised).
- </para>
- </section>
-
-
- <section xml:id="use_set_o_noglob">
- <title>&tag_kshonly;&tag_performance;Use <literal>set -o noglob</literal> if you do not need to expand files</title>
- <para>If you don't expect to expand files, you can do set <literal>-f</literal>
- (<literal>set -o noglob</literal>) as well. This way the need to use <literal>""</literal> is
- greatly reduced.</para>
- </section>
-
-
- <section xml:id="use_empty_ifs_to_handle_spaces">
- <title>&tag_ksh93only;Use <literal>IFS=</literal> to avoid problems with spaces in filenames</title>
- <para>Unless you want to do word splitting, put <literal>IFS=</literal>
- at the beginning of a command. This way spaces in
- file names won't be a problem. You can do
- <literal>IFS='delims' read -r</literal> line
- to override <envar>IFS</envar> just for the <literal>read</literal> command. However,
- you can't do this for the <literal>set</literal> builtin.</para>
- </section>
-
-
- <section xml:id="set_locale_when_comparing_against_localised_output">
- <title>Set the message locale if you process output of tools which may be localised</title>
- <para>Set the message locale (<envar>LC_MESSAGES</envar>) if you process output of tools which may be localised</para>
- <example><title>Set <envar>LC_MESSAGES</envar> when testing for specific outout of the <filename>/usr/bin/file</filename> utility:</title>
-<programlisting>
-# set french as default message locale
-export LC_MESSAGES=fr_FR.UTF-8
-
-...
-
-# test whether the file "/tmp" has the filetype "directory" or not
-# we set LC_MESSAGES to "C" to ensure the returned message is in english
-if [[ "$(LC_MESSAGES=C file /tmp)" = *directory ]] ; then
- print "is a directory"
-fi
-</programlisting>
- <note><para>The environment variable <envar>LC_ALL</envar> always
- overrides any other <envar>LC_*</envar> environment variables
- (and <envar>LANG</envar>, too),
- including <envar>LC_MESSAGES</envar>.
- if there is the chance that <envar>LC_ALL</envar> may be set
- replace <envar>LC_MESSAGES</envar> with <envar>LC_ALL</envar>
- in the example above.</para></note>
- </example>
- </section>
-
- <section xml:id="cleanup_after_yourself">
- <title>Cleanup after yourself.</title>
- <para>Cleanup after yourself. For example ksh/ksh93 have an <literal>EXIT</literal> trap which
- is very useful for this.
- </para>
- <note><para>
- Note that the <literal>EXIT</literal> trap is executed for a subshell and each subshell
- level can run it's own <literal>EXIT</literal> trap, for example
-<screen>
-$ <userinput>(trap "print bam" EXIT ; (trap "print snap" EXIT ; print "foo"))</userinput>
-<computeroutput>foo
-snap
-bam</computeroutput>
-</screen>
- </para></note>
- </section>
-
- <section xml:id="use_proper_exit_code">
- <title>Use a proper <literal>exit</literal> code</title>
- <para>Explicitly set the exit code of a script, otherwise the exit code
- from the last command executed will be used which may trigger problems
- if the value is unexpected.</para>
- </section>
-
-
- <section xml:id="shell_lint">
- <title>&tag_ksh93only;Use <literal>shcomp -n scriptname.sh /dev/null</literal> to check for common errors</title>
- <para>Use <literal>shcomp -n scriptname.sh /dev/null</literal> to
- check for common problems (such as insecure, depreciated or ambiguous constructs) in shell scripts.</para>
- </section>
- </section><!-- end of general -->
-
-
-
-
-
- <section xml:id="functions">
- <title>Functions</title>
-
- <section xml:id="use_functions">
- <title>Use functions to break up your code</title>
- <para>Use functions to break up your code into smaller, logical blocks.</para>
- </section>
-
- <section xml:id="do_not_reserved_keywords_for_function_names">
- <title>Do not use function names which are reserved keywords in C/C++/JAVA or the POSIX shell standard</title>
- <para>Do not use function names which are reserved keywords (or function names) in C/C++/JAVA or the POSIX shell standard
- (to avoid confusion and/or future changes/updates to the shell language).
- </para>
- </section>
-
- <section xml:id="use_ksh_style_function_syntax">
- <title>&tag_kshonly;&tag_performance;Use ksh-style <literal>function</literal></title>
- <para>It is <emphasis>highly</emphasis> recommended to use ksh style functions
- (<literal>function foo { ... }</literal>) instead
- of Bourne-style functions (<literal>foo() { ... }</literal>) if possible
- (and local variables instead of spamming the global namespace).</para>
-
- <warning><para>
- The difference between old-style Bourne functions and ksh functions is one of the major differences
- between ksh88 and ksh93 - ksh88 allowed variables to be local for Bourne-style functions while ksh93
- conforms to the POSIX standard and will use a function-local scope for variables declared in
- Bourne-style functions.</para>
- <para>Example (note that "<literal>integer</literal>" is an alias for "<literal>typeset -li</literal>"):
-<programlisting>
-# new style function with local variable
-$ ksh93 -c 'integer x=2 ; function foo { integer x=5 ; } ; print "x=$x"
-; foo ; print "x=$x" ;'
-x=2
-x=2
-# old style function with an attempt to create a local variable
-$ ksh93 -c 'integer x=2 ; foo() { integer x=5 ; } ; print "x=$x" ; foo ;
-print "x=$x" ;'
-x=2
-x=5
-</programlisting>
-
- <uri xlink:href="http://www.opensolaris.org/os/project/ksh93-integration/docs/ksh93r/general/compatibility/">usr/src/lib/libshell/common/COMPATIBILITY</uri>
- says about this issue:
-<blockquote><para>
-Functions, defined with name() with ksh-93 are compatible with
-the POSIX standard, not with ksh-88. No local variables are
-permitted, and there is no separate scope. Functions defined
-with the function name syntax, maintain compatibility.
-This also affects function traces.
-</para></blockquote>
-(this issue also affects <filename>/usr/xpg4/bin/sh</filename> in Solaris 10 because it is based on ksh88. This is a bug.).
- </para></warning>
-
- </section>
-
-
- <section xml:id="use_proper_return_code">
- <title>Use a proper <literal>return</literal> code</title>
- <para>Explicitly set the return code of a function - otherwise the exit code
- from the last command executed will be used which may trigger problems
- if the value is unexpected.</para>
- <para>The only allowed exception is if a function uses the shell's <literal>errexit</literal> mode to leave
- a function, subshell or the script if a command returns a non-zero exit code.
- </para>
- </section>
-
- <section xml:id="use_fpath_to_load_common_code">
- <title>&tag_kshonly;Use <envar>FPATH</envar> to load common functions, not <literal>source</literal></title>
- <para>
- Use the ksh <envar>FPATH</envar> (function path) feature to load functions which are shared between scripts
- and not <literal>source</literal> - this allows to load such a function on demand and not all at once.</para>
- </section>
-
- </section><!-- end of functions -->
-
-
-
-
- <section xml:id="if_for_while">
- <title><literal>if</literal>, <literal>for</literal> and <literal>while</literal></title>
-
- <section xml:id="if_for_while_format">
- <title>Format</title>
- <para>To match <literal>cstyle</literal>, the shell token equivalent to the <literal>C</literal>
- "<literal>{</literal>" should appear on the same line, separated by a
- "<literal>;</literal>", as in:
-<programlisting>
-if [ "$x" = "hello" ] ; then
- echo $x
-fi
-
-if [[ "$x" = "hello" ]] ; then
- print $x
-fi
-
-for i in 1 2 3; do
- echo $i
-done
-
-for ((i=0 ; i &lt; 3 ; i++)); do
- print $i
-done
-
-while [ $# -gt 0 ]; do
- echo $1
- shift
-done
-
-while (( $# &gt; 0 )); do
- print $1
- shift
-done
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="test_builtin">
- <title><literal>test</literal> Builtin</title>
- <para>DO NOT use the test builtin. Sorry, executive decision.</para>
- <para>In our Bourne shell, the <literal>test</literal> built-in is the same as the "["
- builtin (if you don't believe me, try "type test" or refer to <filename>usr/src/cmd/sh/msg.c</filename>).</para>
- <para>
- So please do not write:
-<programlisting>
-if test $# -gt 0 ; then
-</programlisting>
-instead use:
-<programlisting>
-if [ $# -gt 0 ] ; then
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="use_ksh_test_syntax">
- <title>&tag_kshonly;&tag_performance;Use "<literal>[[ expr ]]</literal>" instead of "<literal>[ expr ]</literal>"</title>
- <para>Use "<literal>[[ expr ]]</literal>" instead of "<literal>[ expr ]</literal>" if possible
- since it avoids going through the whole pattern expansion/etc. machinery and
- adds additional operators not available in the Bourne shell, such as short-circuit
- <literal>&amp;&amp;</literal> and <literal>||</literal>.
- </para>
- </section>
-
-
- <section xml:id="use_posix_arithmetic_expressions">
- <title>&tag_kshonly; Use "<literal>(( ... ))</literal>" for arithmetic expressions</title>
- <para>Use "<literal>(( ... ))</literal>" instead of "<literal>[ expr ]</literal>"
- or "<literal>[[ expr ]]</literal>" expressions.
- </para>
- <para>
- Example: Replace
-<programlisting>
-i=5
-# do something
-if [ $i -gt 5 ] ; then
-</programlisting>
-with
-<programlisting>
-i=5
-# do something
-if (( i &gt; 5 )) ; then
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="compare_exit_code_using_math">
- <title>&tag_kshonly;&tag_performance;Compare exit code using arithmetic expressions expressions</title>
- <para>Use POSIX arithmetic expressions to test for exit/return codes of commands and functions.
- For example turn
-<programlisting>
-if [ $? -gt 0 ] ; then
-</programlisting>
-into
-<programlisting>
-if (( $? &gt; 0 )) ; then
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="use_builtin_commands_in_loops">
- <title>&tag_bourneonly; Use builtin commands in conditions for <literal>while</literal> endless loops</title>
- <para>Make sure that your shell has a "<literal>true</literal>" builtin (like ksh93) when
- executing endless loops like <literal>$ while true ; do do_something ; done #</literal> -
- otherwise each loop cycle runs a <literal>|fork()|+|exec()|</literal>-cycle to run
- <filename>/bin/true</filename>
- </para>
- </section>
-
-
- <section xml:id="single_line_if_statements">
- <title>Single-line if-statements</title>
- <para>It is permissible to use <literal>&amp;&amp;</literal> and <literal>||</literal> to construct
- shorthand for an "<literal>if</literal>" statement in the case where the if statement has a
- single consequent line:
-<programlisting>
-[ $# -eq 0 ] &amp;&amp; exit 0
-</programlisting>
-instead of the longer:
-<programlisting>
-if [ $# -eq 0 ]; then
- exit 0
-fi
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="exit_status_and_if_for_while">
- <title>Exit Status and <literal>if</literal>/<literal>while</literal> statements</title>
- <para>Recall that "<literal>if</literal>" and "<literal>while</literal>"
- operate on the exit status of the statement
- to be executed. In the shell, zero (0) means true and non-zero means false.
- The exit status of the last command which was executed is available in the $?
- variable. When using "<literal>if</literal>" and "<literal>while</literal>",
- it is typically not necessary to use
- <literal>$?</literal> explicitly, as in:
-<programlisting>
-grep foo /etc/passwd &gt;/dev/null 2>&amp;1
-if [ $? -eq 0 ]; then
- echo "found"
-fi
-</programlisting>
-Instead, you can more concisely write:
-<programlisting>
-if grep foo /etc/passwd &gt;/dev/null 2>&amp;1; then
- echo "found"
-fi
-</programlisting>
-Or, when appropriate:
-<programlisting>
-grep foo /etc/passwd &gt;/dev/null 2>&amp;1 &amp;&amp; echo "found"
-</programlisting>
- </para>
- </section>
-
- </section><!-- end of if/for/while -->
-
-
-
-
-
-
- <section xml:id="variables">
- <title>Variable types, naming and usage</title>
-
- <section xml:id="names_should_be_lowercase">
- <title>Names of local, non-environment, non-constant variables should be lowercase</title>
- <para>Names of variables local to the current script which are not exported to the environment
- should be lowercase while variable names which are exported to the
- environment should be uppercase.</para>
- <para>The only exception are global constants (=global readonly variables,
- e.g. <literal>$ float -r M_PI=3.14159265358979323846 #</literal> (taken from &lt;math.h&gt;))
- which may be allowed to use uppercase names, too.
- </para>
-
- <warning><para>
- Uppercase variable names should be avoided because there is a good chance
- of naming collisions with either special variable names used by the shell
- (e.g. <literal>PWD</literal>, <literal>SECONDS</literal> etc.).
- </para></warning>
- </section>
-
- <section xml:id="do_not_reserved_keywords_for_variable_names">
- <title>Do not use variable names which are reserved keywords/variable names in C/C++/JAVA or the POSIX shell standard</title>
- <para>Do not use variable names which are reserved keywords in C/C++/JAVA or the POSIX shell standard
- (to avoid confusion and/or future changes/updates to the shell language).
- </para>
- <note>
- <para>The Korn Shell and the POSIX shell standard have many more
- reserved variable names than the original Bourne shell. All
- these reserved variable names are spelled uppercase.
- </para>
- </note>
- </section>
-
- <section xml:id="use_brackets_around_long_names">
- <title>Always use <literal>'{'</literal>+<literal>'}'</literal> when using variable
- names longer than one character</title>
- <para>Always use <literal>'{'</literal>+<literal>'}'</literal> when using
- variable names longer than one character unless a simple variable name is
- followed by a blank, <literal>/</literal>, <literal>;</literal>, or <literal>$</literal>
- character (to avoid problems with array,
- compound variables or accidental misinterpretation by users/shell)
-<programlisting>
-print "$foo=info"
-</programlisting>
-should be rewritten to
-<programlisting>
-print "${foo}=info"
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="quote_variables_containing_filenames_or_userinput">
- <title><emphasis>Always</emphasis> put variables into quotes when handling filenames or user input</title>
- <para><emphasis>Always</emphasis> put variables into quotes when handling filenames or user input, even if
- the values are hardcoded or the values appear to be fixed. Otherwise at
- least two things may go wrong:
- <itemizedlist>
- <listitem><para>a malicious user may be able to exploit a script's inner working to
- infect his/her own code</para></listitem>
- <listitem><para>a script may (fatally) misbehave for unexpected input (e.g. file names
- with blanks and/or special symbols which are interpreted by the shell)</para></listitem>
- </itemizedlist>
- </para>
-
- <note><para>
- As alternative a script may set <literal>IFS='' ; set -o noglob</literal> to turn off the
- interpretation of any field seperators and the pattern globbing.
- </para></note>
- </section>
-
-
-
- <section xml:id="use_typed_variables">
- <title>&tag_kshonly;&tag_performance;Use typed variables if possible.</title>
- <para>For example the following is very
- inefficient since it transforms the integer values to strings and back
- several times:
-<programlisting>
-a=0
-b=1
-c=2
-# more code
-if [ $a -lt 5 -o $b -gt c ] ; then do_something ; fi
-</programlisting>
-This could be rewritten using ksh constructs:
-<programlisting>
-integer a=0
-integer b=1
-integer c=2
-# more code
-if (( a &lt; 5 || b &gt; c )) ; then do_something ; fi
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="store_lists_in_arrays">
- <title>&tag_ksh93only; Store lists in arrays or associative arrays</title>
- <para>Store lists in arrays or associative arrays - this is usually easier
- to manage.</para>
- <para>
- For example:
-<programlisting>
-x="
-/etc/foo
-/etc/bar
-/etc/baz
-"
-echo $x
-</programlisting>
-can be replaced with
-<programlisting>
-typeset -a mylist
-mylist[0]="/etc/foo"
-mylist[1]="/etc/bar"
-mylist[2]="/etc/baz"
-print "${mylist[@]}"
-</programlisting>
-or (ksh93-style append entries to a normal (non-associative) array)
-<programlisting>
-typeset -a mylist
-mylist+=( "/etc/foo" )
-mylist+=( "/etc/bar" )
-mylist+=( "/etc/baz" )
-print "${mylist[@]}"
-</programlisting>
- </para>
- <note>
- <title>Difference between expanding arrays with mylist[@] and mylist[*] subscript operators</title>
- <para>
- Arrays may be expanded using two similar subscript operators, @ and *. These subscripts
- differ only when the variable expansion appears within double quotes. If the variable expansion
- is between double-quotes, "${mylist[*]}" expands to a single string with the value of each array
- member separated by the first character of the <envar>IFS</envar> variable, and "${mylist[@]}"
- expands each element of name to a separate string.
- </para>
- <example><title>Difference between [@] and [*] when expanding arrays</title>
-<programlisting>
-typeset -a mylist
-mylist+=( "/etc/foo" )
-mylist+=( "/etc/bar" )
-mylist+=( "/etc/baz" )
-IFS=","
-printf "mylist[*]={ 0=|%s| 1=|%s| 2=|%s| 3=|%s| }\n" "${mylist[*]}"
-printf "mylist[@]={ 0=|%s| 1=|%s| 2=|%s| 3=|%s| }\n" "${mylist[@]}"
-</programlisting>
-<para>will print:</para>
-<screen>
-<computeroutput>mylist[*]={ 0=|/etc/foo,/etc/bar,/etc/baz| 1=|| 2=|| 3=|| }
-mylist[@]={ 0=|/etc/foo| 1=|/etc/bar| 2=|/etc/baz| 3=|| }
-</computeroutput>
-</screen>
- </example>
- </note>
- </section>
-
-
- <section xml:id="use_compound_variables_or_lists_for_grouping">
- <title>&tag_ksh93only; Use compound variables or associative arrays to group similar variables together</title>
- <para>Use compound variables or associative arrays to group similar variables together.</para>
- <para>
- For example:
-<programlisting>
-box_width=56
-box_height=10
-box_depth=19
-echo "${box_width} ${box_height} ${box_depth}"
-</programlisting>
-could be rewritten to ("associative array"-style)
-<programlisting>
-typeset -A -E box=( [width]=56 [height]=10 [depth]=19 )
-print -- "${box[width]} ${box[height]} ${box[depth]}"
-</programlisting>
-or ("compound variable"-style
-<programlisting>
-box=(
- float width=56
- float height=10
- float depth=19
- )
-print -- "${box.width} ${box.height} ${box.depth}"
-</programlisting>
- </para>
- </section>
- </section><!-- end of variables -->
-
-
-
-
-
-
-
- <section xml:id="io">
- <title>I/O</title>
-
- <section xml:id="avoid_echo">
- <title>Avoid using the "<literal>echo</literal>" command for output</title>
- <para>The behaviour of "<literal>echo</literal>" is not portable
- (e.g. System V, BSD, UCB and ksh93/bash shell builtin versions all
- slightly differ in functionality) and should be avoided if possible.
- POSIX defines the "<literal>printf</literal>" command as replacement
- which provides more flexible and portable behaviour.</para>
-
- <note>
- <title>&tag_kshonly;Use "<literal>print</literal>" and not "<literal>echo</literal>" in Korn Shell scripts</title>
- <para>Korn shell scripts should prefer the "<literal>print</literal>"
- builtin which was introduced as replacement for "<literal>echo</literal>".</para>
- <caution>
- <para>Use <literal>$ print -- ${varname}" #</literal> when there is the slightest chance that the
- variable "<literal>varname</literal>" may contain symbols like "-". Or better use "<literal>printf</literal>"
- instead, for example
-<programlisting>
-integer fx
-# do something
-print $fx
-</programlisting>
-may fail if "f" contains a negative value. A better way may be to use
-<programlisting>
-integer fx
-# do something
-printf "%d\n" fx
-</programlisting>
- </para>
- </caution>
- </note>
- </section>
-
- <section xml:id="use_redirect_not_exec_to_open_files">
- <title>&tag_ksh93only;Use <literal>redirect</literal> and not <literal>exec</literal> to open files</title>
- <para>Use <literal>redirect</literal> and not <literal>exec</literal> to open files - <literal>exec</literal>
- will terminate the current function or script if an error occurs while <literal>redirect</literal>
- just returns a non-zero exit code which can be caught.</para>
-<para>Example:
-<programlisting>
-if redirect 5&lt;/etc/profile ; then
- print "file open ok"
- head &lt;&amp;5
-else
- print "could not open file"
-fi
-</programlisting>
- </para>
- </section>
-
- <section xml:id="group_identical_redirections_together">
- <title>&tag_performance;Avoid redirections per command when the output goes into the same file,
- e.g. <literal>$ echo "foo" &gt;xxx ; echo "bar" &gt;&gt;xxx ; echo "baz" &gt;&gt;xxx #</literal></title>
- <para>Each of the redirections above trigger an
- <literal>|open()|,|write()|,|close()|</literal>-sequence. It is much
- more efficient (and faster) to group the rediction into a block,
- e.g. <literal>{ echo "foo" ; echo "bar" ; echo "baz" } &gt;xxx #</literal></para>
- </section>
-
-
- <section xml:id="avoid_using_temporary_files">
- <title>&tag_performance;Avoid the creation of temporary files and store the values in variables instead</title>
- <para>Avoid the creation of temporary files and store the values in variables instead if possible</para>
- <para>
- Example:
-<programlisting>
-ls -1 &gt;xxx
-for i in $(cat xxx) ; do
- do_something ;
-done
-</programlisting>
-can be replaced with
-<programlisting>
-x="$(ls -1)"
-for i in ${x} ; do
- do_something ;
-done
-</programlisting>
- </para>
- <note><para>ksh93 supports binary variables (e.g. <literal>typeset -b varname</literal>) which can hold any value.</para></note>
- </section>
-
-
- <section xml:id="create_subdirs_for_multiple_temporary_files">
- <title>If you create more than one temporary file create an unique subdir</title>
- <para>If you create more than one temporary file create an unique subdir for
- these files and make sure the dir is writable. Make sure you cleanup
- after yourself (unless you are debugging).
- </para>
- </section>
-
-
- <section xml:id="use_dynamic_file_descriptors">
- <title>&tag_ksh93only;Use {n}&lt;file instead of fixed file descriptor numbers</title>
- <para>When opening a file use {n}&lt;file, where <envar>n</envar> is an
- integer variable rather than specifying a fixed descriptor number.</para>
- <para>This is highly recommended in functions to avoid that fixed file
- descriptor numbers interfere with the calling script.</para>
-<example><title>Open a network connection and store the file descriptor number in a variable</title>
-<programlisting>
-function cat_http
-{
- integer netfd
-
-...
-
- # open TCP channel
- redirect {netfd}&lt;&gt;"/dev/tcp/${host}/${port}"
-
- # send HTTP request
- request="GET /${path} HTTP/1.1\n"
- request+="Host: ${host}\n"
- request+="User-Agent: demo code/ksh93 (2007-08-30; $(uname -s -r -p))\n"
- request+="Connection: close\n"
- print "${request}\n" &gt;&amp;${netfd}
-
- # collect response and send it to stdout
- cat &lt;&amp;${netfd}
-
- # close connection
- exec {netfd}&lt;&amp;-
-
-...
-
-}
-</programlisting>
-</example>
- </section>
-
-
- <section xml:id="use_inline_here_documents">
- <title>&tag_ksh93only;&tag_performance;Use inline here documents
- instead of <literal>echo "$x" | command</literal></title>
- <para>Use inline here documents, for example
-<programlisting>
-command &lt;&lt;&lt; $x
-</programlisting>
- rather than
-<programlisting>
-print -r -- "$x" | command
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="use_read_r">
- <title>&tag_ksh93only;Use the <literal>-r</literal> option of <literal>read</literal> to read a line</title>
- <para>Use the <literal>-r</literal> option of <literal>read</literal> to read a line.
- You never know when a line will end in <literal>\</literal> and without a
- <literal>-r</literal> multiple
- lines can be read.</para>
- </section>
-
-
- <section xml:id="print_compound_variables_using_print_C">
- <title>&tag_ksh93only;Print compound variables using <literal>print -C varname</literal> or <literal>print -v varname</literal></title>
- <para>Print compound variables using <literal>print -C varname</literal> or
- <literal>print -v varname</literal> to make sure that non-printable characters
- are correctly encoded.</para>
-<example><title>Print compound variable with non-printable characters</title>
-<programlisting>
-compound x=(
- a=5
- b="hello"
- c=(
- d=9
- e="$(printf "1\v3")" <co xml:id="co.vertical_tab1" />
- )
-)
-print -v x
-</programlisting>
-<para>will print:</para>
-<screen>
-<computeroutput>(
- a=5
- b=hello
- c=(
- d=9
- e=$'1\0133' <co xml:id="co.vertical_tab2" />
- )
-)</computeroutput>
-</screen>
-<calloutlist>
- <callout arearefs="co.vertical_tab1 co.vertical_tab2">
- <para>vertical tab, <literal>\v</literal>, octal=<literal>\013</literal>.</para>
- </callout>
-</calloutlist>
-</example>
- </section>
-
- <section xml:id="command_name_before_redirections">
- <title>Put the command name and arguments before redirections</title>
- <para>Put the command name and arguments before redirections.
- You can legally do <literal>$ &gt; file date</literal> instead of <literal>date &gt; file</literal>
- but don't do it.</para>
- </section>
-
- <section xml:id="enable_gmacs_editor_mode_for_user_prompts">
- <title>&tag_ksh93only;Enable the <literal>gmacs</literal> editor
- mode when reading user input using the <literal>read</literal> builtin</title>
- <para>Enable the <literal>gmacs</literal>editor mode before reading user
- input using the <literal>read</literal> builtin to enable the use of
- cursor+backspace+delete keys in the edit line</para>
-<example><title>Prompt user for a string with gmacs editor mode enabled</title>
-<programlisting>
-set -o gmacs <co xml:id="co.enable_gmacs" />
-typeset inputstring="default value"
-...
-read -v<co xml:id="co.read_v" /> inputstring<co xml:id="co.readvar" />?"Please enter a string: "<co xml:id="co.prompt" />
-...
-printf "The user entered the following string: '%s'\n" "${inputstring}"
-
-...
-</programlisting>
-<calloutlist>
- <callout arearefs="co.enable_gmacs">
- <para>Enable gmacs editor mode.</para>
- </callout>
- <callout arearefs="co.read_v">
- <para>The value of the variable is displayed and used as a default value.</para>
- </callout>
- <callout arearefs="co.readvar">
- <para>Variable used to store the result.</para>
- </callout>
- <callout arearefs="co.prompt">
- <para>Prompt string which is displayed in stderr.</para>
- </callout>
-</calloutlist>
-</example>
- </section>
- </section><!-- end of I/O -->
-
-
-
-
-
-
- <section xml:id="math">
- <title>Math</title>
-
- <section xml:id="use_builtin_arithmetic_expressions">
- <title>&tag_kshonly;&tag_performance;Use builtin arithmetic expressions instead of external applications</title>
- <para>Use builtin (POSIX shell) arithmetic expressions instead of
- <filename>expr</filename>,
- <filename>bc</filename>,
- <filename>dc</filename>,
- <filename>awk</filename>,
- <filename>nawk</filename> or
- <filename>perl</filename>.
- </para>
- <note>
- <para>ksh93 supports C99-like floating-point arithmetic including special values
- such as
- <simplelist type="inline">
- <member>+Inf</member>
- <member>-Inf</member>
- <member>+NaN</member>
- <member>-NaN</member>
- </simplelist>.
- </para>
- </note>
- </section>
-
-
- <section xml:id="use_floating_point_arithmetic_expressions">
- <title>&tag_ksh93only; Use floating-point arithmetic expressions if
- calculations may trigger a division by zero or other exceptions</title>
- <para>Use floating-point arithmetic expressions if calculations may
- trigger a division by zero or other exceptions - floating point arithmetic expressions in
- ksh93 support special values such as <literal>+Inf</literal>/<literal>-Inf</literal> and
- <literal>+NaN</literal>/<literal>-NaN</literal> which can greatly simplify testing for
- error conditions, e.g. instead of a <literal>trap</literal> or explicit
- <literal>if ... then... else</literal> checks for every sub-expression
- you can check the results for such special values.
- </para>
- <para>Example:
-<screen>
-$ <userinput>ksh93 -c 'integer i=0 j=5 ; print -- "x=$((j/i)) "'</userinput>
-<computeroutput>ksh93: line 1: j/i: divide by zero</computeroutput>
-$ <userinput>ksh93 -c 'float i=0 j=-5 ; print -- "x=$((j/i)) "'</userinput>
-<computeroutput>x=-Inf</computeroutput>
-</screen>
- </para>
- </section>
-
-
- <section xml:id="use_printf_a_for_passing_float_values">
- <title>&tag_ksh93only; Use <literal>printf "%a"</literal> when passing floating-point values</title>
- <para>Use <literal>printf "%a"</literal> when passing floating-point values between scripts or
- as output of a function to avoid rounding errors when converting between
- bases.</para>
- <para>
- Example:
-<programlisting>
-function xxx
-{
- float val
-
- (( val=sin(5.) ))
- printf "%a\n" val
-}
-float out
-(( out=$(xxx) ))
-xxx
-print -- $out
-</programlisting>
-This will print:
-<programlisting>
--0.9589242747
--0x1.eaf81f5e09933226af13e5563bc6p-01
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="put_constants_into_readonly_variables">
- <title>&tag_kshonly;&tag_performance;Put constant values into readonly variables</title>
- <para>Put constant values into readonly variables</para>
- <para>For example:
-<programlisting>
-float -r M_PI=3.14159265358979323846
-</programlisting>
-or
-<programlisting>
-float M_PI=3.14159265358979323846
-readonly M_PI
-</programlisting>
- </para>
- </section>
-
-
- <section xml:id="avoid_unnecessary_string_number_conversions">
- <title>&tag_kshonly;&tag_performance;Avoid string to number
- (and/or number to string) conversions in arithmetic expressions
- expressions</title>
- <para>Avoid string to number and/or number to string conversions in
- arithmetic expressions expressions to avoid performance degradation
- and rounding errors.</para>
- <example><title>(( x=$x*2 )) vs. (( x=x*2 ))</title>
-<programlisting>
-float x
-...
-(( x=$x*2 ))
-</programlisting>
-<para>
-will convert the variable "x" (stored in the machine's native
-<literal>|long double|</literal> datatype) to a string value in base10 format,
-apply pattern expansion (globbing), then insert this string into the
-arithmetic expressions and parse the value which converts it into the internal |long double| datatype format again.
-This is both slow and generates rounding errors when converting the floating-point value between
-the internal base2 and the base10 representation of the string.
-</para>
-<para>
-The correct usage would be:
-</para>
-<programlisting>
-float x
-...
-(( x=x*2 ))
-</programlisting>
-<para>
-e.g. omit the '$' because it's (at least) redundant within arithmetic expressions.
-</para>
- </example>
-
-
- <example><title>x=$(( y+5.5 )) vs. (( x=y+5.5 ))</title>
-<programlisting>
-float x
-float y=7.1
-...
-x=$(( y+5.5 ))
-</programlisting>
-<para>
-will calculate the value of <literal>y+5.5</literal>, convert it to a
-base-10 string value amd assign the value to the floating-point variable
-<literal>x</literal> again which will convert the string value back to the
-internal |long double| datatype format again.
-</para>
-<para>
-The correct usage would be:
-</para>
-<programlisting>
-float x
-float y=7.1
-...
-(( x=y+5.5 ))
-</programlisting>
-<para>
-i.e. this will save the string conversions and avoid any base2--&gt;base10--&gt;base2-conversions.
-</para>
- </example>
- </section>
-
-
- <section xml:id="set_lc_numeric_when_using_floating_point">
- <title>&tag_ksh93only;Set <envar>LC_NUMERIC</envar> when using floating-point constants</title>
- <para>Set <envar>LC_NUMERIC</envar> when using floating-point constants to avoid problems with radix-point
- representations which differ from the representation used in the script, for example the <literal>de_DE.*</literal> locale
- use ',' instead of '.' as default radix point symbol.</para>
- <para>For example:
-<programlisting>
-# Make sure all math stuff runs in the "C" locale to avoid problems with alternative
-# radix point representations (e.g. ',' instead of '.' in de_DE.*-locales). This
-# needs to be set _before_ any floating-point constants are defined in this script)
-if [[ "${LC_ALL}" != "" ]] ; then
- export \
- LC_MONETARY="${LC_ALL}" \
- LC_MESSAGES="${LC_ALL}" \
- LC_COLLATE="${LC_ALL}" \
- LC_CTYPE="${LC_ALL}"
- unset LC_ALL
-fi
-export LC_NUMERIC=C
-...
-float -r M_PI=3.14159265358979323846
-</programlisting>
- </para>
-
- <note><para>The environment variable <envar>LC_ALL</envar> always overrides all other <envar>LC_*</envar> variables,
- including <envar>LC_NUMERIC</envar>. The script should always protect itself against custom <envar>LC_NUMERIC</envar> and
- <envar>LC_ALL</envar> values as shown in the example above.
- </para></note>
- </section>
-
-
-
- </section><!-- end of math -->
-
-
-
-
-
-
- <section xml:id="misc">
- <title>Misc</title>
-
- <section xml:id="debug_use_lineno_in_ps4">
- <title>Put <literal>[${LINENO}]</literal> in your <envar>PS4</envar></title>
- <para>Put <literal>[${LINENO}]</literal> in your <envar>PS4</envar> prompt so that you will get line
- numbers with you run with <literal>-x</literal>. If you are looking at performance
- issues put <literal>$SECONDS</literal> in the <envar>PS4</envar> prompt as well.</para>
- </section>
-
- </section><!-- end of misc -->
-
-
-
-
-</section><!-- end of RULES -->
-
-
-
-
-</article>
diff --git a/usr/src/lib/libsmartsshd/Makefile b/usr/src/lib/libsmartsshd/Makefile
new file mode 100644
index 0000000000..50d9545ef1
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/Makefile
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+include ../Makefile.lib
+
+SUBDIRS= $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET = all
+clean := TARGET = clean
+clobber := TARGET = clobber
+install := TARGET = install
+lint := TARGET = lint
+
+.KEEP_STATE:
+
+all clean clobber install lint: $(SUBDIRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+_msg:
+
+FRC:
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libsmartsshd/Makefile.com b/usr/src/lib/libsmartsshd/Makefile.com
new file mode 100644
index 0000000000..914aab055b
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/Makefile.com
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+LIBRARY= libsmartsshd.a
+VERS= .1
+OBJECTS= sshd-plugin.o
+
+include ../../Makefile.lib
+include ../../Makefile.rootfs
+
+SRCDIR = ../common
+SRCS = $(OBJECTS:%.o=$(SRCDIR)/%.c)
+
+CPPFLAGS += -I$(SRCDIR) -D_REENTRANT -D_FILE_OFFSET_BITS=64
+LIBS = $(DYNLIB) $(LINTLIB)
+LDLIBS += -lc -ldoor
+
+$(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC)
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+lint: lintcheck
+
+include ../../Makefile.targ
diff --git a/usr/src/lib/libsmartsshd/amd64/Makefile b/usr/src/lib/libsmartsshd/amd64/Makefile
new file mode 100644
index 0000000000..31be0ef7e6
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/amd64/Makefile
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
diff --git a/usr/src/lib/libsmartsshd/common/llib-lsmartsshd b/usr/src/lib/libsmartsshd/common/llib-lsmartsshd
new file mode 100644
index 0000000000..ace7017d41
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/common/llib-lsmartsshd
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (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
+ */
+/*LINTLIBRARY*/
+/*PROTOLIB1*/
+/*
+ *
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
diff --git a/usr/src/lib/libsmartsshd/common/mapfile-vers b/usr/src/lib/libsmartsshd/common/mapfile-vers
new file mode 100644
index 0000000000..ce5fc7a9c0
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/common/mapfile-vers
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Joyent Inc. All rights reserved.
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+$mapfile_version 2
+
+SYMBOL_VERSION SUNWprivate_1.1 {
+ global:
+ sshd_user_rsa_key_allowed;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libsmartsshd/common/sshd-plugin.c b/usr/src/lib/libsmartsshd/common/sshd-plugin.c
new file mode 100644
index 0000000000..4f0f0bc1ad
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/common/sshd-plugin.c
@@ -0,0 +1,123 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <alloca.h>
+#include <door.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pwd.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <openssl/rsa.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LOG_OOM(SZ) fprintf(stderr, "Unable to alloca %d bytes\n", SZ)
+
+static const char *DOOR = "/var/tmp/._joyent_sshd_key_is_authorized";
+static const char *REQ_FMT_STR = "%s %d %s"; /* name uid fp */
+static const int RETURN_SZ = 2;
+
+static const int MAX_ATTEMPTS = 2;
+static const int SLEEP_PERIOD = 1;
+
+static int
+sshd_allowed_in_capi(struct passwd *pw, const char *fp)
+{
+ int allowed = 0;
+ int fd = -1;
+ int blen = 0;
+ int attempts = 0;
+ char *buf = NULL;
+ door_arg_t door_args = {0};
+
+ if (pw == NULL || fp == NULL)
+ return (0);
+
+ blen = snprintf(NULL, 0, REQ_FMT_STR, pw->pw_name, pw->pw_uid, fp) + 1;
+
+ buf = (char *)alloca(blen);
+ if (buf == NULL) {
+ LOG_OOM(blen);
+ return (0);
+ }
+
+ (void) snprintf(buf, blen, REQ_FMT_STR, pw->pw_name, pw->pw_uid, fp);
+ door_args.data_ptr = buf;
+ door_args.data_size = blen;
+
+ door_args.rsize = RETURN_SZ;
+ door_args.rbuf = alloca(RETURN_SZ);
+ if (door_args.rbuf == NULL) {
+ LOG_OOM(RETURN_SZ);
+ return (0);
+ }
+ memset(door_args.rbuf, 0, RETURN_SZ);
+
+ do {
+ fd = open(DOOR, O_RDWR);
+ if (fd < 0)
+ perror("smartplugin: open (of door FD) failed");
+
+ if (door_call(fd, &door_args) < 0) {
+ perror("smartplugin: door_call failed");
+ } else {
+ allowed = atoi(door_args.rbuf);
+ munmap(door_args.rbuf, door_args.rsize);
+ return (allowed);
+ }
+ if (++attempts < MAX_ATTEMPTS)
+ sleep(SLEEP_PERIOD);
+ } while (attempts < MAX_ATTEMPTS);
+
+ return (0);
+}
+
+int
+sshd_user_rsa_key_allowed(struct passwd *pw, RSA *key, const char *fp)
+{
+ return sshd_allowed_in_capi(pw, fp);
+}
+
+int
+sshd_user_dsa_key_allowed(struct passwd *pw, DSA *key, const char *fp)
+{
+ return sshd_allowed_in_capi(pw, fp);
+}
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/usr/src/lib/libsmartsshd/i386/Makefile b/usr/src/lib/libsmartsshd/i386/Makefile
new file mode 100644
index 0000000000..2bfe8001d9
--- /dev/null
+++ b/usr/src/lib/libsmartsshd/i386/Makefile
@@ -0,0 +1,31 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libumem/amd64/umem_genasm.c b/usr/src/lib/libumem/amd64/umem_genasm.c
index 00cc18ab67..ba68cb2d37 100644
--- a/usr/src/lib/libumem/amd64/umem_genasm.c
+++ b/usr/src/lib/libumem/amd64/umem_genasm.c
@@ -69,8 +69,6 @@
#include <umem_impl.h>
#include "umem_base.h"
-#include <stdio.h>
-
const int umem_genasm_supported = 1;
static uintptr_t umem_genasm_mptr = (uintptr_t)&_malloc;
static size_t umem_genasm_msize = 576;
diff --git a/usr/src/lib/libwanboot/Makefile.com b/usr/src/lib/libwanboot/Makefile.com
index ed69ec0b8a..1e6310f9ba 100644
--- a/usr/src/lib/libwanboot/Makefile.com
+++ b/usr/src/lib/libwanboot/Makefile.com
@@ -60,7 +60,7 @@ include ../../Makefile.lib
LIBS += $(LINTLIB)
LDLIBS += -lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \
- -linetutil -lc -lcrypto -lssl
+ -linetutil -lc -lsunw_crypto -lsunw_ssl
CPPFLAGS = -I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master)
CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/lib/libzdoor/Makefile b/usr/src/lib/libzdoor/Makefile
new file mode 100644
index 0000000000..50d9545ef1
--- /dev/null
+++ b/usr/src/lib/libzdoor/Makefile
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+include ../Makefile.lib
+
+SUBDIRS= $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all := TARGET = all
+clean := TARGET = clean
+clobber := TARGET = clobber
+install := TARGET = install
+lint := TARGET = lint
+
+.KEEP_STATE:
+
+all clean clobber install lint: $(SUBDIRS)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+_msg:
+
+FRC:
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libzdoor/Makefile.com b/usr/src/lib/libzdoor/Makefile.com
new file mode 100644
index 0000000000..09bde0f1b4
--- /dev/null
+++ b/usr/src/lib/libzdoor/Makefile.com
@@ -0,0 +1,50 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+LIBRARY= libzdoor.a
+VERS= .1
+OBJECTS= zdoor.o \
+ zdoor-int.o \
+ ztree.o \
+ zerror.o
+
+include ../../Makefile.lib
+include ../../Makefile.rootfs
+
+SRCDIR = ../common
+SRCS = $(OBJECTS:%.o=$(SRCDIR)/%.c)
+
+CPPFLAGS += -I$(SRCDIR) -D_REENTRANT -D_FILE_OFFSET_BITS=64
+LIBS = $(DYNLIB) $(LINTLIB)
+LDLIBS += -lc -lzonecfg -lcontract
+
+$(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC)
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+lint: lintcheck
+
+include ../../Makefile.targ
diff --git a/usr/src/lib/libzdoor/amd64/Makefile b/usr/src/lib/libzdoor/amd64/Makefile
new file mode 100644
index 0000000000..31be0ef7e6
--- /dev/null
+++ b/usr/src/lib/libzdoor/amd64/Makefile
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
diff --git a/usr/src/lib/libzdoor/common/llib-lzdoor b/usr/src/lib/libzdoor/common/llib-lzdoor
new file mode 100644
index 0000000000..a21a904b11
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/llib-lzdoor
@@ -0,0 +1,34 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (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
+ */
+/*LINTLIBRARY*/
+/*PROTOLIB1*/
+/*
+ *
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/types.h>
+#include <zdoor.h>
diff --git a/usr/src/lib/libzdoor/common/mapfile-vers b/usr/src/lib/libzdoor/common/mapfile-vers
new file mode 100644
index 0000000000..38eba57ee2
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/mapfile-vers
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Joyent Inc. All rights reserved.
+#
+
+#
+# MAPFILE HEADER START
+#
+# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+# usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+
+$mapfile_version 2
+
+SYMBOL_VERSION SUNWprivate_1.1 {
+ global:
+ zdoor_handle_init;
+ zdoor_handle_destroy;
+ zdoor_open;
+ zdoor_close;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libzdoor/common/zdoor-int.c b/usr/src/lib/libzdoor/common/zdoor-int.c
new file mode 100644
index 0000000000..f77c1453d4
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/zdoor-int.c
@@ -0,0 +1,324 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2012 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/fork.h>
+#include <libcontract.h>
+#include <libzonecfg.h>
+#include <sys/contract/process.h>
+#include <sys/ctfs.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "zdoor-int.h"
+#include "zerror.h"
+
+#define ZDOOR_FMT_STR "/var/tmp/.%s"
+
+
+static int
+init_template(void)
+{
+ int fd = 0;
+ int err = 0;
+
+ fd = open64(CTFS_ROOT "/process/template", O_RDWR);
+ if (fd == -1)
+ return (-1);
+
+ err |= ct_tmpl_set_critical(fd, 0);
+ err |= ct_tmpl_set_informative(fd, 0);
+ err |= ct_pr_tmpl_set_fatal(fd, CT_PR_EV_HWERR);
+ err |= ct_pr_tmpl_set_param(fd, CT_PR_PGRPONLY | CT_PR_REGENT);
+ if (err || ct_tmpl_activate(fd)) {
+ (void) close(fd);
+ return (-1);
+ }
+
+ return (fd);
+}
+
+static int
+contract_latest(ctid_t *id)
+{
+ int cfd = 0;
+ int r = 0;
+ ct_stathdl_t st = {0};
+ ctid_t result = {0};
+
+ if ((cfd = open64(CTFS_ROOT "/process/latest", O_RDONLY)) == -1)
+ return (errno);
+ if ((r = ct_status_read(cfd, CTD_COMMON, &st)) != 0) {
+ (void) close(cfd);
+ return (r);
+ }
+
+ result = ct_status_get_id(st);
+ ct_status_free(st);
+ (void) close(cfd);
+
+ *id = result;
+ return (0);
+}
+
+static int
+close_on_exec(int fd)
+{
+ int flags = fcntl(fd, F_GETFD, 0);
+ if ((flags != -1) && (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) != -1))
+ return (0);
+ return (-1);
+}
+
+static int
+contract_open(ctid_t ctid, const char *type, const char *file, int oflag)
+{
+ char path[PATH_MAX];
+ int n = 0;
+ int fd = 0;
+
+ if (type == NULL)
+ type = "all";
+
+ n = snprintf(path, PATH_MAX, CTFS_ROOT "/%s/%ld/%s", type, ctid, file);
+ if (n >= sizeof (path)) {
+ errno = ENAMETOOLONG;
+ return (-1);
+ }
+
+ fd = open64(path, oflag);
+ if (fd != -1) {
+ if (close_on_exec(fd) == -1) {
+ int err = errno;
+ (void) close(fd);
+ errno = err;
+ return (-1);
+ }
+ }
+ return (fd);
+}
+
+static int
+contract_abandon_id(ctid_t ctid)
+{
+ int fd = 0;
+ int err = 0;
+
+ fd = contract_open(ctid, "all", "ctl", O_WRONLY);
+ if (fd == -1)
+ return (errno);
+
+ err = ct_ctl_abandon(fd);
+ (void) close(fd);
+
+ return (err);
+}
+
+/*
+ * zdoor_fattach(zone,service,door,detach_only) is heavily borrowed from
+ * zonestatd. Basically this forks, zone_enter's the targeted zone,
+ * fattaches to /var/tmp/.<service> with the door you've opened.
+ * detach_only gets passed in on door_stop to fdetach in the targeted zone.
+ * Note that this code really does require all the contract calls, which are
+ * all the static functions preceding this (have a look at zone_enter; without
+ * that code zone_enter will kick back EINVAL).
+ */
+int
+zdoor_fattach(zoneid_t zoneid, const char *service, int door, int detach_only)
+{
+ int fd = 0;
+ int len = 0;
+ int pid = 0;
+ int stat = 0;
+ int tmpl_fd = 0;
+ char path[MAXPATHLEN] = {0};
+ ctid_t ct = -1;
+
+ if (zoneid < 0) {
+ zdoor_debug("zdoor_fattach: zoneid < 0");
+ return (ZDOOR_ARGS_ERROR);
+ }
+
+ if (service == NULL) {
+ zdoor_debug("zdoor_fattach: NULL service");
+ return (ZDOOR_ARGS_ERROR);
+ }
+
+ if ((tmpl_fd = init_template()) < 0) {
+ zdoor_warn("zdoor_fattach: init contract for %d:%s failed",
+ zoneid, service);
+ return (ZDOOR_ERROR);
+ }
+
+ len = snprintf(NULL, 0, ZDOOR_FMT_STR, service) + 1;
+ if (len > MAXPATHLEN)
+ return (ZDOOR_ARGS_ERROR);
+ (void) snprintf(path, len, ZDOOR_FMT_STR, service);
+
+ zdoor_info("zdoor_fattach: ensuring %s", path);
+
+ pid = fork();
+ if (pid < 0) {
+ (void) ct_tmpl_clear(tmpl_fd);
+ zdoor_error("zdoor_fattach: unable to fork for zone_enter: %s",
+ strerror(errno));
+ return (ZDOOR_OK);
+ }
+
+ if (pid == 0) {
+ zdoor_debug("zdoor_fattach(CHILD): starting");
+ (void) ct_tmpl_clear(tmpl_fd);
+ (void) close(tmpl_fd);
+ if (zone_enter(zoneid) != 0) {
+ zdoor_debug("zdoor_fattach(CHILD): zone_enter fail %s",
+ strerror(errno));
+ if (errno == EINVAL) {
+ _exit(0);
+ }
+ _exit(1);
+ }
+ (void) fdetach(path);
+ (void) unlink(path);
+ if (detach_only) {
+ zdoor_debug("zdoor_fattach(CHILD): detach only, done");
+ _exit(0);
+ }
+ fd = open(path, O_CREAT|O_RDWR, 0644);
+ if (fd < 0) {
+ zdoor_debug("zdoor_fattach(CHILD): open failed: %s",
+ strerror(errno));
+ _exit(2);
+ }
+ if (fattach(door, path) != 0) {
+ zdoor_debug("zdoor_fattach(CHILD): fattach failed: %s",
+ strerror(errno));
+ _exit(3);
+ }
+ _exit(0);
+ }
+ if (contract_latest(&ct) == -1)
+ ct = -1;
+ (void) ct_tmpl_clear(tmpl_fd);
+ (void) close(tmpl_fd);
+ (void) contract_abandon_id(ct);
+
+ zdoor_debug("zdoor_fattach: waiting for child...");
+ while (waitpid(pid, &stat, 0) != pid)
+ ;
+ if (WIFEXITED(stat) && WEXITSTATUS(stat) == 0) {
+ zdoor_debug(" child exited with success");
+ zdoor_debug("zdoor_fattach: returning ZDOOR_OK");
+ return (ZDOOR_OK);
+ }
+
+ zdoor_debug(" child exited with %d", WEXITSTATUS(stat));
+ zdoor_debug("zdoor_fattach: returning ZDOOR_ERROR");
+ return (ZDOOR_ERROR);
+}
+
+/*
+ * zdoor_zone_is_running(zone) returns 1 if the specified zone is running, or 0
+ * if it is any other state. It additionally eats any other errors it
+ * encounters and returns 0 upon encountering them.
+ */
+boolean_t
+zdoor_zone_is_running(zoneid_t zoneid)
+{
+ zone_state_t state;
+ char zone[ZONENAME_MAX];
+ if (zoneid < 0)
+ return (B_FALSE);
+
+ if (getzonenamebyid(zoneid, zone, ZONENAME_MAX) < 0)
+ return (B_FALSE);
+
+ if (!zone_get_state((char *)zone, &state) == Z_OK)
+ return (B_FALSE);
+
+ return (state == ZONE_STATE_RUNNING);
+}
+
+/*
+ * zdoor_cookie_create simply allocates and initializes
+ * memory. Returns NULL on any error.
+ */
+zdoor_cookie_t *
+zdoor_cookie_create(const char *zonename, const char *service,
+const void *biscuit)
+{
+ zdoor_cookie_t *cookie = NULL;
+
+ if (zonename == NULL || service == NULL)
+ return (NULL);
+
+ cookie = (zdoor_cookie_t *)calloc(1, sizeof (zdoor_cookie_t));
+ if (cookie == NULL) {
+ OUT_OF_MEMORY();
+ return (NULL);
+ }
+ cookie->zdc_biscuit = (void *)biscuit;
+ cookie->zdc_zonename = strdup((char *)zonename);
+ if (cookie->zdc_zonename == NULL) {
+ zdoor_cookie_free(cookie);
+ OUT_OF_MEMORY();
+ return (NULL);
+ }
+ cookie->zdc_service = strdup((char *)service);
+ if (cookie->zdc_service == NULL) {
+ zdoor_cookie_free(cookie);
+ OUT_OF_MEMORY();
+ return (NULL);
+ }
+
+ return (cookie);
+}
+
+/*
+ * zdoor_cookie_free(cookie) cleans up any memory associated with the
+ * specified cookie.
+ */
+void
+zdoor_cookie_free(zdoor_cookie_t *cookie)
+{
+ if (cookie == NULL)
+ return;
+
+ if (cookie->zdc_zonename != NULL) {
+ free(cookie->zdc_zonename);
+ cookie->zdc_zonename = NULL;
+ }
+
+ if (cookie->zdc_service != NULL) {
+ free(cookie->zdc_service);
+ cookie->zdc_service = NULL;
+ }
+
+ free(cookie);
+}
diff --git a/usr/src/lib/libzdoor/common/zdoor-int.h b/usr/src/lib/libzdoor/common/zdoor-int.h
new file mode 100644
index 0000000000..782452c426
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/zdoor-int.h
@@ -0,0 +1,64 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _ZDOOR_INT_H
+#define _ZDOOR_INT_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <pthread.h>
+#include <zdoor.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum zdoor_action_t {
+ ZDOOR_ACTION_NOOP,
+ ZDOOR_ACTION_STOP,
+ ZDOOR_ACTION_START
+} zdoor_action_t;
+
+struct zdoor_handle {
+ pthread_mutex_t zdh_lock;
+ void *zdh_zonecfg_handle;
+ void *zdh_ztree;
+};
+
+zdoor_cookie_t *zdoor_cookie_create(const char *zonename, const char *service,
+ const void *biscuit);
+
+void zdoor_cookie_free(zdoor_cookie_t *cookie);
+
+boolean_t zdoor_zone_is_running(zoneid_t zoneid);
+
+int zdoor_fattach(zoneid_t zoneid, const char *service, int door,
+ int detach_only);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZDOOR_INT_H */
diff --git a/usr/src/lib/libzdoor/common/zdoor.c b/usr/src/lib/libzdoor/common/zdoor.c
new file mode 100644
index 0000000000..f2996b4e2d
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/zdoor.c
@@ -0,0 +1,437 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <alloca.h>
+#include <door.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <libzonecfg.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <syslog.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stropts.h>
+#include <unistd.h>
+#include <zdoor.h>
+#include <zone.h>
+
+#include "zdoor-int.h"
+#include "zerror.h"
+#include "ztree.h"
+
+extern void *
+zonecfg_notify_bind(int(*func)(const char *zonename, zoneid_t zid,
+ const char *newstate, const char *oldstate,
+ hrtime_t when, void *p), void *p);
+
+extern void
+zonecfg_notify_unbind(void *handle);
+
+/*
+ * _callback(cookie, door_args...) is our private function that we tell
+ * the Solaris door API about. This function does some sanity checking on
+ * arguments and issues a callback to the owner of this door. That API
+ * will return us memory that needs to be sent back to the client on the
+ * other end of the door, but since the door_return API never gives you
+ * back control of the function, this does a simple alloca/memcpy and
+ * frees up the memory pointed to by the parent. While this really doesn't
+ * let a client do much other than pass a simple struct of primitives (or
+ * more likely more common a char *), that's the way the door API works,
+ * and so this isn't really imposing any restriction that didn't already
+ * need to be dealt with by someone. This is why the zdoor_result structure
+ * takes a char *, rather than a void * for the data pointer.
+ */
+static void
+_callback(void *cookie, char *argp, size_t arg_size, door_desc_t *dp,
+ uint_t n_desc)
+{
+ zdoor_result_t *result = NULL;
+ void *door_response = NULL;
+ int size = 0;
+ dtree_entry_t *entry = (dtree_entry_t *)cookie;
+
+ if (entry == NULL) {
+ zdoor_warn("_callback: NULL cookie? door_returning");
+ (void) door_return(NULL, 0, NULL, 0);
+ }
+
+ (void) pthread_mutex_lock(&entry->dte_parent->zte_parent->zdh_lock);
+ zdoor_debug("_callback: calling back with %p", entry->dte_cookie);
+ result = entry->dte_callback(entry->dte_cookie, argp, arg_size);
+ zdoor_debug("_callback: app callback returned %p", result);
+ (void) pthread_mutex_unlock(&entry->dte_parent->zte_parent->zdh_lock);
+
+ if (result == NULL) {
+ zdoor_debug("_callback: door_returning NULL");
+ (void) door_return(NULL, 0, NULL, 0);
+ }
+
+ if (result->zdr_data != NULL && result->zdr_size > 0) {
+ door_response = alloca(result->zdr_size);
+ if (door_response != NULL) {
+ size = result->zdr_size;
+ (void) memcpy(door_response,
+ (void *) result->zdr_data, size);
+ }
+ }
+
+ if (result->zdr_data != NULL)
+ free(result->zdr_data);
+ free(result);
+
+ zdoor_debug("_callback: door_returning %p, %d", door_response, size);
+ (void) door_return(door_response, size, NULL, 0);
+}
+
+static void
+zdoor_stop(dtree_entry_t *entry)
+{
+ zoneid_t zid = -1;
+
+ if (entry == NULL) {
+ zdoor_debug("zdoor_stop: NULL arguments");
+ return;
+ }
+
+ zdoor_debug("zdoor_stop: entry=%p, zone=%s, service=%s",
+ entry, entry->dte_parent->zte_zonename, entry->dte_service);
+
+ zid = getzoneidbyname(entry->dte_parent->zte_zonename);
+ (void) zdoor_fattach(zid, entry->dte_service, entry->dte_door, 1);
+ (void) door_revoke(entry->dte_door);
+ entry->dte_door = -1;
+
+ zdoor_debug("zdoor_stop returning");
+}
+
+/*
+ * zdoor_create is called both by the main API
+ * call zdoor_open, as well as by the zone_monitor code upon a zone restart
+ * (assuming it already has a door in it). This code assumes that the
+ * permissions were correct (e.g., the target door is not a GZ, that this
+ * program is being run out of the GZ), but does not assume that the target
+ * door file has not changed out from under us, so that is explicitly rechecked.
+ *
+ * This also assumes the parent has already locked handle.
+ */
+static int
+zdoor_create(dtree_entry_t *entry)
+{
+ int status = ZDOOR_OK;
+ zoneid_t zid = -1;
+ zdoor_handle_t handle = NULL;
+
+ if (entry == NULL) {
+ zdoor_debug("zdoor_create: NULL arguments");
+ return (ZDOOR_ARGS_ERROR);
+ }
+
+ zdoor_debug("zdoor_create: entry=%p, zone=%s, service=%s",
+ entry, entry->dte_parent->zte_zonename, entry->dte_service);
+
+ handle = entry->dte_parent->zte_parent;
+
+ zid = getzoneidbyname(entry->dte_parent->zte_zonename);
+ if (zid < 0) {
+ zdoor_info("zdoor_create: %s is a non-existient zone",
+ entry->dte_parent->zte_zonename);
+ return (ZDOOR_ERROR);
+ }
+ if (!zdoor_zone_is_running(zid)) {
+ zdoor_debug("zdoor_create: %s is not running",
+ entry->dte_parent->zte_zonename);
+ return (ZDOOR_ZONE_NOT_RUNNING);
+ }
+
+ entry->dte_door = door_create(_callback, entry, 0);
+ zdoor_info("zdoor_create: door_create returned %d", entry->dte_door);
+ if (entry->dte_door < 0) {
+ zdoor_stop(entry);
+ return (ZDOOR_ERROR);
+ }
+
+ status = zdoor_fattach(zid, entry->dte_service, entry->dte_door, 0);
+
+ zdoor_debug("zdoor_create: returning %d", status);
+ return (status);
+}
+
+
+/*
+ * door_visitor(entry) is a callback from the ztree code that checks whether
+ * or not we should be taking some action on a given door. Note that the
+ * callpath to this API is:
+ * SYSTEM ->
+ * zone_monitor ->
+ * ztree_walk ->
+ * door_visitor
+ *
+ * Which is important to note that this API assumes that all things needing
+ * locking are locked by a parent caller (which is the zone_monitor).
+ */
+static void
+zdoor_visitor(dtree_entry_t *entry)
+{
+ if (entry == NULL) {
+ zdoor_info("zdoor_visitor: entered with NULL entry");
+ return;
+ }
+
+ zdoor_debug("zdoor_visitor: entered for entry=%p, service=%s",
+ entry, entry->dte_service);
+
+ if (entry->dte_parent->zte_action == ZDOOR_ACTION_STOP) {
+ zdoor_debug(" stopping zdoor");
+ zdoor_stop(entry);
+ } else if (entry->dte_parent->zte_action == ZDOOR_ACTION_START) {
+ zdoor_debug(" starting zdoor");
+ if (zdoor_create(entry) != ZDOOR_OK) {
+ zdoor_error("door_visitor: Unable to restart zdoor\n");
+ }
+ }
+}
+
+/*
+ * zone_monitor(zonename, zid, newstate, oldstate, when, cookie) is our
+ * registered callback with libzonecfg to notify us of any changes to a
+ * given zone. This activates a walk on all doors for a zone iff the state
+ * is changing from running or into running.
+ */
+static int
+zone_monitor(const char *zonename, zoneid_t zid, const char *newstate,
+ const char *oldstate, hrtime_t when, void *p)
+{
+ zdoor_handle_t handle = (zdoor_handle_t)p;
+ ztree_entry_t *entry = NULL;
+
+ if (handle == NULL) {
+ zdoor_warn("zone_monitor: entered with NULL handle?");
+ return (-1);
+ }
+
+ zdoor_info("zone_monitor: zone=%s, zid=%d, newst=%s, oldst=%s, p=%p",
+ zonename, zid, newstate, oldstate, p);
+
+ (void) pthread_mutex_lock(&(handle->zdh_lock));
+ entry = ztree_zone_find(handle, zonename);
+ if (entry != NULL) {
+ zdoor_debug(" found entry in ztree");
+ entry->zte_action = ZDOOR_ACTION_NOOP;
+ if (strcmp("running", newstate) == 0) {
+ if (strcmp("ready", oldstate) == 0)
+ entry->zte_action = ZDOOR_ACTION_START;
+ } else if (strcmp("shutting_down", newstate) == 0) {
+ if (strcmp("running", oldstate) == 0)
+ entry->zte_action = ZDOOR_ACTION_STOP;
+ }
+ zdoor_debug(" set state to: %d", entry->zte_action);
+ if (entry->zte_action != ZDOOR_ACTION_NOOP)
+ ztree_walk_doors(handle, zonename);
+ }
+ (void) pthread_mutex_unlock(&(handle->zdh_lock));
+
+ zdoor_info("zone_monitor: returning");
+ return (0);
+}
+
+zdoor_handle_t
+zdoor_handle_init()
+{
+ zdoor_handle_t handle = NULL;
+
+ zdoor_debug("zdoor_handle_init entered");
+
+ handle = (zdoor_handle_t)calloc(1, sizeof (struct zdoor_handle));
+ if (handle == NULL) {
+ OUT_OF_MEMORY();
+ return (NULL);
+ }
+
+ (void) pthread_mutex_init(&(handle->zdh_lock), NULL);
+ handle->zdh_zonecfg_handle = zonecfg_notify_bind(zone_monitor, handle);
+ if (handle->zdh_zonecfg_handle == NULL) {
+ zdoor_error("zonecfg_notify_bind failure: %s", strerror(errno));
+ return (NULL);
+ }
+
+ zdoor_debug("zdoor_handle_init returning %p", handle);
+ return (handle);
+}
+
+void
+zdoor_handle_destroy(zdoor_handle_t handle)
+{
+ if (handle == NULL) {
+ zdoor_debug("zdoor_handle_destroy: NULL arguments");
+ return;
+ }
+
+ zdoor_debug("zdoor_handle_destroy: handle=%p", handle);
+
+ (void) pthread_mutex_lock(&(handle->zdh_lock));
+ zonecfg_notify_unbind(handle->zdh_zonecfg_handle);
+ (void) pthread_mutex_unlock(&(handle->zdh_lock));
+ (void) pthread_mutex_destroy(&(handle->zdh_lock));
+ free(handle);
+}
+
+/*
+ * zdoor_open(zone, service, biscuit, callback) is the main public facing API in
+ * libzdoor. It will open a door with the name .[service] under
+ * [zonepath]/root/var/tmp, where [zonepath] is resolved on the fly. Note this
+ * API can only be invoked from the global zone, and will not allow you to open
+ * a zdoor in the global zone.
+ */
+int
+zdoor_open(zdoor_handle_t handle, const char *zonename, const char *service,
+ void *biscuit, zdoor_callback callback)
+{
+ zdoor_cookie_t *zdoor_cookie = NULL;
+ int rc = -1;
+ int status = ZDOOR_OK;
+ zoneid_t zid = -1;
+ dtree_entry_t *entry = NULL;
+
+ if (handle == NULL || zonename == NULL ||
+ service == NULL || callback == NULL) {
+ zdoor_debug("zdoor_open: NULL arguments");
+ return (ZDOOR_ARGS_ERROR);
+ }
+ zdoor_debug("zdoor_open: entered: handle=%p, zone=%s, service=%s",
+ handle, zonename, service);
+
+ if (getzoneid() != GLOBAL_ZONEID) {
+ zdoor_warn("zdoor_open: not invoked from global zone");
+ return (ZDOOR_NOT_GLOBAL_ZONE);
+ }
+
+
+ zid = getzoneidbyname(zonename);
+ if (zid < 0) {
+ zdoor_info("zdoor_open: %s is a non-existent zone", zonename);
+ return (ZDOOR_ARGS_ERROR);
+ }
+
+ if (zid == GLOBAL_ZONEID) {
+ zdoor_warn("zdoor_open: zdoors not allowed in global zone");
+ return (ZDOOR_ZONE_FORBIDDEN);
+ }
+
+ if (!zdoor_zone_is_running(zid)) {
+ zdoor_info("zdoor_open: %s is not running", zonename);
+ return (ZDOOR_ZONE_NOT_RUNNING);
+ }
+
+ zdoor_cookie = zdoor_cookie_create(zonename, service, biscuit);
+ if (zdoor_cookie == NULL) {
+ OUT_OF_MEMORY();
+ return (ZDOOR_OUT_OF_MEMORY);
+ }
+
+ (void) pthread_mutex_lock(&(handle->zdh_lock));
+ rc = ztree_zone_add(handle, zonename, zdoor_visitor);
+ if (rc != ZTREE_SUCCESS && rc != ZTREE_ALREADY_EXISTS) {
+ zdoor_debug("zdoor_open: unable to add zone to ztree: %d", rc);
+ status = ZDOOR_ERROR;
+ goto out;
+ }
+ rc = ztree_door_add(handle, zonename, service, callback,
+ zdoor_cookie);
+ if (rc != ZTREE_SUCCESS) {
+ zdoor_debug("zdoor_open: unable to add door to ztree: %d", rc);
+ if (rc == ZTREE_ALREADY_EXISTS) {
+ zdoor_warn("service %s already has a zdoor", service);
+ }
+ status = ZDOOR_ERROR;
+ goto out;
+ }
+
+ entry = ztree_door_find(handle, zonename, service);
+ if (entry == NULL) {
+ zdoor_debug("zdoor_open: unable to find door in ztree?");
+ status = ZDOOR_ERROR;
+ goto out;
+ }
+ if (zdoor_create(entry) != ZDOOR_OK) {
+ zdoor_info("zdoor_open: zdoor_create failed.");
+ status = ZDOOR_ERROR;
+ goto out;
+ }
+out:
+ if (status != ZDOOR_OK) {
+ zdoor_debug("zdoor_open: status not ok, stopping and cleaning");
+ zdoor_stop(entry);
+ ztree_door_remove(handle, entry);
+ zdoor_cookie_free(zdoor_cookie);
+ }
+ (void) pthread_mutex_unlock(&(handle->zdh_lock));
+ zdoor_debug("zdoor_open: returning %d", status);
+ return (status);
+}
+
+/*
+ * zdoor_close(zone, service) unregisters a previously created zdoor, and
+ * returns the biscuit provided at creation time, so the caller can free it.
+ * Returns NULL on any error.
+ */
+void *
+zdoor_close(zdoor_handle_t handle, const char *zonename, const char *service)
+{
+ dtree_entry_t *entry = NULL;
+ zdoor_cookie_t *cookie = NULL;
+ void *biscuit = NULL;
+
+ if (handle == NULL || zonename == NULL || service == NULL) {
+ zdoor_debug("zdoor_close: NULL arguments");
+ return (NULL);
+ }
+
+ zdoor_debug("zdoor_close: entered handle=%p, zone=%s, service=%s",
+ handle, zonename, service);
+
+ (void) pthread_mutex_lock(&(handle->zdh_lock));
+
+ entry = ztree_door_find(handle, zonename, service);
+ if (entry != NULL) {
+ zdoor_debug("zdoor_close: found door in ztree, stopping");
+ zdoor_stop(entry);
+ cookie = ztree_door_remove(handle, entry);
+ if (cookie != NULL) {
+ biscuit = cookie->zdc_biscuit;
+ zdoor_cookie_free(cookie);
+ }
+ } else {
+ zdoor_debug("zdoor_close: didn't find door in ztree");
+ }
+
+ (void) pthread_mutex_unlock(&(handle->zdh_lock));
+
+ zdoor_debug("zdoor_close: returning %p", biscuit);
+ return (biscuit);
+}
diff --git a/usr/src/lib/libzdoor/common/zerror.c b/usr/src/lib/libzdoor/common/zerror.c
new file mode 100644
index 0000000000..5ccb449e1b
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/zerror.c
@@ -0,0 +1,117 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "zerror.h"
+
+static const char *PREFIX = "%s ZDOOR:%s:T(%d): ";
+
+static const char *DEBUG_ENV_VAR = "ZDOOR_TRACE";
+
+static boolean_t
+is_debug_enabled()
+{
+ boolean_t enabled = B_FALSE;
+ const char *_envp = getenv(DEBUG_ENV_VAR);
+ if (_envp != NULL && atoi(_envp) >= 2)
+ enabled = B_TRUE;
+
+ return (enabled);
+}
+
+static boolean_t
+is_info_enabled()
+{
+ boolean_t enabled = B_FALSE;
+ const char *_envp = getenv(DEBUG_ENV_VAR);
+ if (_envp != NULL && atoi(_envp) >= 1)
+ enabled = B_TRUE;
+
+ return (enabled);
+}
+
+void
+zdoor_debug(const char *fmt, ...)
+{
+ va_list alist;
+
+ if (!is_debug_enabled())
+ return;
+
+ va_start(alist, fmt);
+
+ (void) fprintf(stderr, PREFIX, __TIME__, "DEBUG", pthread_self());
+ (void) vfprintf(stderr, fmt, alist);
+ (void) fprintf(stderr, "\n");
+ va_end(alist);
+}
+
+void
+zdoor_info(const char *fmt, ...)
+{
+ va_list alist;
+
+ if (!is_info_enabled())
+ return;
+
+ va_start(alist, fmt);
+
+ (void) fprintf(stderr, PREFIX, __TIME__, "INFO", pthread_self());
+ (void) vfprintf(stderr, fmt, alist);
+ (void) fprintf(stderr, "\n");
+ va_end(alist);
+}
+
+void
+zdoor_warn(const char *fmt, ...)
+{
+ va_list alist;
+
+ va_start(alist, fmt);
+
+ (void) fprintf(stderr, PREFIX, __TIME__, "WARN", pthread_self());
+ (void) vfprintf(stderr, fmt, alist);
+ (void) fprintf(stderr, "\n");
+ va_end(alist);
+}
+
+void
+zdoor_error(const char *fmt, ...)
+{
+ va_list alist;
+
+ va_start(alist, fmt);
+
+ (void) fprintf(stderr, PREFIX, __TIME__, "ERROR", pthread_self());
+ (void) vfprintf(stderr, fmt, alist);
+ (void) fprintf(stderr, "\n");
+ va_end(alist);
+}
diff --git a/usr/src/lib/libzdoor/common/zerror.h b/usr/src/lib/libzdoor/common/zerror.h
new file mode 100644
index 0000000000..afc848fcea
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/zerror.h
@@ -0,0 +1,48 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _ZERROR_H
+#define _ZERROR_H
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void zdoor_debug(const char *fmt, ...);
+extern void zdoor_info(const char *fmt, ...);
+extern void zdoor_warn(const char *fmt, ...);
+extern void zdoor_error(const char *fmt, ...);
+
+#define OUT_OF_MEMORY() \
+ zdoor_error("Out of Memory at %s:%d", __FILE__, __LINE__)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZERROR_H */
diff --git a/usr/src/lib/libzdoor/common/ztree.c b/usr/src/lib/libzdoor/common/ztree.c
new file mode 100644
index 0000000000..25c67f62fb
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/ztree.c
@@ -0,0 +1,344 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <search.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "zerror.h"
+#include "ztree.h"
+
+
+/*
+ * ztree is just a helpful wrapper over a tsearch binary tree that deals with
+ * all of the libzdoor types.
+ *
+ * So what this ztree actually is is a tree of trees. The outer tree is a tree
+ * of zones, and each node holds a tree of doors.
+ */
+
+/*
+ * _ztree_compare(p1, p2) is the tsearch callback for comparing the "outer"
+ * tree (e.g., the one of zones).
+ */
+static int
+_ztree_compare(const void *p1, const void *p2)
+{
+ ztree_entry_t *z1 = (ztree_entry_t *)p1;
+ ztree_entry_t *z2 = (ztree_entry_t *)p2;
+
+ if (z1 == NULL && z2 == NULL)
+ return (0);
+ if (z1 == NULL && z2 != NULL)
+ return (-1);
+ if (z1 != NULL && z2 == NULL)
+ return (1);
+
+ return (strcmp(z1->zte_zonename, z2->zte_zonename));
+}
+
+/*
+ * _dtree_compare(p1, p2) is the tsearch callback for comparing the "inner"
+ * tree (e.g., the one of doors).
+ */
+static int
+_dtree_compare(const void *p1, const void *p2)
+{
+ dtree_entry_t *d1 = (dtree_entry_t *)p1;
+ dtree_entry_t *d2 = (dtree_entry_t *)p2;
+
+ if (d1 == NULL && d2 == NULL)
+ return (0);
+ if (d1 == NULL && d2 != NULL)
+ return (-1);
+ if (d1 != NULL && d2 == NULL)
+ return (1);
+
+ return (strcmp(d1->dte_service, d2->dte_service));
+}
+
+static void
+ztree_entry_free(ztree_entry_t *entry)
+{
+ if (entry == NULL)
+ return;
+
+ if (entry->zte_zonename != NULL)
+ free(entry->zte_zonename);
+
+ free(entry);
+}
+
+static void
+dtree_entry_free(dtree_entry_t *entry)
+{
+ if (entry == NULL)
+ return;
+
+ if (entry->dte_service)
+ free(entry->dte_service);
+
+ free(entry);
+}
+
+
+/*
+ * ztree_zone_add inserts a new zone into the tree iff
+ * there is not already an entry for that zone. This method returns one of
+ * four possible return codes, ZTREE_SUCCESS on :), ZTREE_ARGUMENT_ERROR if
+ * zone is NULL, ZTREE_ERROR if there is internal failure (e.g., OOM), and
+ * ZTREE_ALREADY_EXISTS if the zone is already in the tree.
+ */
+int
+ztree_zone_add(struct zdoor_handle *handle, const char *zonename,
+ztree_door_visitor visitor)
+{
+ ztree_entry_t *entry = NULL;
+ void *ret = NULL;
+ int status = ZTREE_SUCCESS;
+
+ if (handle == NULL || zonename == NULL)
+ return (ZTREE_ARGUMENT_ERROR);
+
+ entry = (ztree_entry_t *)calloc(1, sizeof (ztree_entry_t));
+ if (entry == NULL) {
+ OUT_OF_MEMORY();
+ return (ZTREE_ERROR);
+ }
+ entry->zte_zonename = strdup(zonename);
+ if (entry->zte_zonename == NULL) {
+ ztree_entry_free(entry);
+ OUT_OF_MEMORY();
+ return (ZTREE_ERROR);
+ }
+ entry->zte_action = ZDOOR_ACTION_NOOP;
+ entry->zte_parent = handle;
+ entry->zte_visitor = visitor;
+
+ ret = tsearch(entry, &(handle->zdh_ztree), _ztree_compare);
+ if (ret == NULL) {
+ ztree_entry_free(entry);
+ status = ZTREE_ERROR;
+ OUT_OF_MEMORY();
+ } else if ((*(ztree_entry_t **)ret) != entry) {
+ ztree_entry_free(entry);
+ status = ZTREE_ALREADY_EXISTS;
+ }
+
+ return (status);
+}
+
+
+/*
+ * ztree_zone_find returns the entry in the "outer" tree representing
+ * this zone, if it exists, NULL otherwise.
+ */
+ztree_entry_t *
+ztree_zone_find(struct zdoor_handle *handle, const char *zonename)
+{
+ ztree_entry_t key = {0};
+ void *ret = NULL;
+
+ if (handle == NULL || zonename == NULL)
+ return (NULL);
+
+ key.zte_zonename = (char *)zonename;
+ ret = tfind(&key, &(handle->zdh_ztree), _ztree_compare);
+
+ return (ret != NULL ? *(ztree_entry_t **)ret : NULL);
+}
+
+
+/*
+ * ztree_zone_remove removes an entry from the "outer" zone iff the
+ * zone exists. The cookie set by the creator is returned.
+ */
+void
+ztree_zone_remove(struct zdoor_handle *handle, ztree_entry_t *entry)
+{
+ if (handle == NULL || entry == NULL)
+ return;
+
+ tdelete(entry, &(handle->zdh_ztree), _ztree_compare);
+ ztree_entry_free(entry);
+}
+
+
+/*
+ * ztree_door_add inserts a new door into the inner tree iff
+ * there is not already an entry for that door. This method returns one of
+ * four possible return codes, ZTREE_SUCCESS on :), ZTREE_ARGUMENT_ERROR if
+ * zone is NULL, ZTREE_ERROR if there is internal failure (e.g., OOM), and
+ * ZTREE_ALREADY_EXISTS if the door is already in the tree.
+ */
+int
+ztree_door_add(struct zdoor_handle *handle, const char *zonename,
+const char *service, zdoor_callback callback, zdoor_cookie_t *cookie)
+{
+ dtree_entry_t *entry = NULL;
+ ztree_entry_t *znode = NULL;
+ void *ret = NULL;
+ int status = ZTREE_SUCCESS;
+
+ if (handle == NULL || zonename == NULL || service == NULL)
+ return (ZTREE_ARGUMENT_ERROR);
+
+ znode = ztree_zone_find(handle, zonename);
+ if (znode == NULL)
+ return (ZTREE_NOT_FOUND);
+
+ entry = (dtree_entry_t *)calloc(1, sizeof (dtree_entry_t));
+ if (entry == NULL) {
+ OUT_OF_MEMORY();
+ return (ZTREE_ERROR);
+ }
+ entry->dte_parent = znode;
+ entry->dte_callback = callback;
+ entry->dte_cookie = cookie;
+ entry->dte_service = strdup(service);
+ if (entry->dte_service == NULL) {
+ free(entry);
+ OUT_OF_MEMORY();
+ return (ZTREE_ERROR);
+ }
+
+ ret = tsearch(entry, &(znode->zte_door_tree), _dtree_compare);
+ if (ret == NULL) {
+ dtree_entry_free(entry);
+ OUT_OF_MEMORY();
+ status = ZTREE_ERROR;
+ } else if ((*(dtree_entry_t **)ret) != entry) {
+ dtree_entry_free(entry);
+ status = ZTREE_ALREADY_EXISTS;
+ } else {
+ znode->zte_num_doors++;
+ }
+
+ return (status);
+}
+
+
+/*
+ * ztree_door_find returns the entry in the "inner" tree
+ * representing this zone, if it exists, NULL otherwise.
+ */
+dtree_entry_t *
+ztree_door_find(struct zdoor_handle *handle, const char *zonename,
+const char *service)
+{
+ dtree_entry_t key = {0};
+ ztree_entry_t *znode = NULL;
+ void *ret = NULL;
+
+ if (handle == NULL || zonename == NULL || service == NULL)
+ return (NULL);
+
+ znode = ztree_zone_find(handle, zonename);
+ if (znode == NULL)
+ return (NULL);
+
+ key.dte_service = (char *)service;
+ ret = tfind(&key, &(znode->zte_door_tree), _dtree_compare);
+
+ return (ret != NULL ? *(dtree_entry_t **)ret : NULL);
+}
+
+
+/*
+ * ztree_door_remove(zone, door) removes a node from the inner tree iff
+ * both the door and zone exist. Note this frees the node as well. The
+ * cookie set by the creator is returned.
+ */
+zdoor_cookie_t *
+ztree_door_remove(struct zdoor_handle *handle, dtree_entry_t *entry)
+{
+ zdoor_cookie_t *cookie = NULL;
+ ztree_entry_t *znode = NULL;
+
+ if (handle == NULL || entry == NULL)
+ return (NULL);
+
+ znode = entry->dte_parent;
+ cookie = entry->dte_cookie;
+
+ tdelete(entry, &(znode->zte_door_tree), _dtree_compare);
+ dtree_entry_free(entry);
+
+ znode->zte_num_doors--;
+ if (znode->zte_num_doors == 0) {
+ zdoor_debug("ztree: zone %s has no doors left, removing",
+ znode->zte_zonename);
+ ztree_zone_remove(handle, znode);
+ }
+
+ return (cookie);
+}
+
+
+/*
+ * _ztree_door_visitor(nodep, which, depth) is the private function we use
+ * to wrap up tsearch's goofy API. We're really just using this to ensure
+ * zdoor doesn't get called > 1 times for a given entity in the ztree.
+ */
+static void
+_ztree_door_visitor(const void *nodep, const VISIT which, const int depth)
+{
+ dtree_entry_t *entry = *(dtree_entry_t **)nodep;
+
+ if (entry == NULL)
+ return;
+
+ switch (which) {
+ case preorder:
+ case endorder:
+ break;
+ case postorder:
+ case leaf:
+ if (entry->dte_parent->zte_visitor != NULL)
+ entry->dte_parent->zte_visitor(entry);
+ break;
+ }
+}
+
+
+/*
+ * ztree_walk_doors(zone) will proceed to visit every node in the "inner" tree
+ * for this zone, and callback the visitor that was registered on tree creation.
+ */
+void
+ztree_walk_doors(struct zdoor_handle *handle, const char *zonename)
+{
+ ztree_entry_t *znode = NULL;
+
+ if (handle == NULL || zonename == NULL)
+ return;
+
+ znode = ztree_zone_find(handle, zonename);
+ if (znode == NULL)
+ return;
+
+ twalk(znode->zte_door_tree, _ztree_door_visitor);
+}
diff --git a/usr/src/lib/libzdoor/common/ztree.h b/usr/src/lib/libzdoor/common/ztree.h
new file mode 100644
index 0000000000..b46dace287
--- /dev/null
+++ b/usr/src/lib/libzdoor/common/ztree.h
@@ -0,0 +1,88 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _ZTREE_H
+#define _ZTREE_H
+
+#include <zdoor.h>
+#include <zone.h>
+#include "zdoor-int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct dtree_entry;
+
+typedef void (*ztree_door_visitor)(struct dtree_entry *entry);
+
+typedef struct ztree_entry {
+ char *zte_zonename;
+ zdoor_action_t zte_action;
+ int zte_num_doors;
+ void *zte_door_tree;
+ ztree_door_visitor zte_visitor;
+ struct zdoor_handle *zte_parent;
+} ztree_entry_t;
+
+typedef struct dtree_entry {
+ char *dte_service;
+ int dte_door;
+ zdoor_callback dte_callback;
+ zdoor_cookie_t *dte_cookie;
+ ztree_entry_t *dte_parent;
+} dtree_entry_t;
+
+#define ZTREE_SUCCESS 0
+#define ZTREE_ERROR -1
+#define ZTREE_ARGUMENT_ERROR -2
+#define ZTREE_ALREADY_EXISTS -3
+#define ZTREE_NOT_FOUND -4
+
+extern int ztree_zone_add(struct zdoor_handle *handle,
+ const char *zonename, ztree_door_visitor visitor);
+
+extern ztree_entry_t *ztree_zone_find(struct zdoor_handle *handle,
+ const char *zonename);
+
+extern void ztree_zone_remove(struct zdoor_handle *handle,
+ ztree_entry_t *entry);
+
+extern int ztree_door_add(struct zdoor_handle *handle, const char *zonename,
+ const char *service, zdoor_callback callback, zdoor_cookie_t *cookie);
+
+extern dtree_entry_t *ztree_door_find(struct zdoor_handle *handle,
+ const char *zonename, const char *service);
+
+extern zdoor_cookie_t *ztree_door_remove(struct zdoor_handle *handle,
+ dtree_entry_t *entry);
+
+extern void ztree_walk_doors(struct zdoor_handle *handle, const char *zonename);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZTREE_H */
diff --git a/usr/src/lib/libzdoor/i386/Makefile b/usr/src/lib/libzdoor/i386/Makefile
new file mode 100644
index 0000000000..2bfe8001d9
--- /dev/null
+++ b/usr/src/lib/libzdoor/i386/Makefile
@@ -0,0 +1,31 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+
+include ../Makefile.com
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
diff --git a/usr/src/lib/libzfs/common/libzfs.h b/usr/src/lib/libzfs/common/libzfs.h
index b99569795e..62dce8f2d4 100644
--- a/usr/src/lib/libzfs/common/libzfs.h
+++ b/usr/src/lib/libzfs/common/libzfs.h
@@ -63,6 +63,7 @@ typedef enum zfs_error {
EZFS_PROPTYPE, /* property does not apply to dataset type */
EZFS_PROPNONINHERIT, /* property is not inheritable */
EZFS_PROPSPACE, /* bad quota or reservation */
+ EZFS_PROPCACHED, /* prop unavail since cachedprops flag set */
EZFS_BADTYPE, /* dataset is not of appropriate type */
EZFS_BUSY, /* pool or dataset is busy */
EZFS_EXISTS, /* pool or dataset already exists */
@@ -183,6 +184,7 @@ extern libzfs_handle_t *zpool_get_handle(zpool_handle_t *);
extern libzfs_handle_t *zfs_get_handle(zfs_handle_t *);
extern void libzfs_print_on_error(libzfs_handle_t *, boolean_t);
+extern void libzfs_set_cachedprops(libzfs_handle_t *, boolean_t);
extern void zfs_save_arguments(int argc, char **, char *, int);
extern int zpool_log_history(libzfs_handle_t *, const char *);
@@ -266,7 +268,7 @@ extern int zpool_label_disk(libzfs_handle_t *, zpool_handle_t *, char *);
*/
extern int zpool_set_prop(zpool_handle_t *, const char *, const char *);
extern int zpool_get_prop(zpool_handle_t *, zpool_prop_t, char *,
- size_t proplen, zprop_source_t *);
+ size_t proplen, zprop_source_t *, boolean_t);
extern uint64_t zpool_get_prop_int(zpool_handle_t *, zpool_prop_t,
zprop_source_t *);
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index 9acb7acd32..26e5adc02c 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved.
* Copyright (c) 2013 Martin Matuska. All rights reserved.
@@ -328,6 +329,10 @@ get_stats_ioctl(zfs_handle_t *zhp, zfs_cmd_t *zc)
{
libzfs_handle_t *hdl = zhp->zfs_hdl;
+ if (hdl->libzfs_cachedprops &&
+ libzfs_cmd_set_cachedprops(hdl, zc) != 0)
+ return (-1);
+
(void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name));
while (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, zc) != 0) {
@@ -1888,6 +1893,11 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
case ZFS_PROP_NORMALIZE:
case ZFS_PROP_UTF8ONLY:
case ZFS_PROP_CASE:
+ if (zhp->zfs_hdl->libzfs_cachedprops) {
+ return (zfs_error(zhp->zfs_hdl, EZFS_PROPCACHED,
+ "property unavailable since not cached"));
+ }
+
if (!zfs_prop_valid_for_type(prop, zhp->zfs_head_type) ||
zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
return (-1);
@@ -2128,6 +2138,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
char *str;
const char *strval;
boolean_t received = zfs_is_recvd_props_mode(zhp);
+ boolean_t printerr;
/*
* Check to see if this property applies to our object
@@ -2138,6 +2149,16 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
if (received && zfs_prop_readonly(prop))
return (-1);
+ if (zhp->zfs_hdl->libzfs_cachedprops &&
+ zfs_prop_cacheable(prop)) {
+ printerr = zhp->zfs_hdl->libzfs_printerr;
+ libzfs_print_on_error(zhp->zfs_hdl, B_FALSE);
+ (void) zfs_error(zhp->zfs_hdl, EZFS_PROPCACHED,
+ "property unavailable since not cached");
+ libzfs_print_on_error(zhp->zfs_hdl, printerr);
+ return (-1);
+ }
+
if (src)
*src = ZPROP_SRC_NONE;
@@ -2195,8 +2216,8 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
}
if ((zpool_get_prop(zhp->zpool_hdl,
- ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL)) ||
- (strcmp(root, "-") == 0))
+ ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL,
+ B_FALSE)) || (strcmp(root, "-") == 0))
root[0] = '\0';
/*
* Special case an alternate root of '/'. This will
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index ad4142da3f..9d98718dcb 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
@@ -79,6 +80,7 @@ struct libzfs_handle {
libzfs_fru_t **libzfs_fru_hash;
libzfs_fru_t *libzfs_fru_list;
char libzfs_chassis_id[256];
+ boolean_t libzfs_cachedprops;
};
#define ZFSSHARE_MISS 0x01 /* Didn't find entry in cache */
@@ -149,6 +151,7 @@ int zpool_standard_error_fmt(libzfs_handle_t *, int, const char *, ...);
int get_dependents(libzfs_handle_t *, boolean_t, const char *, char ***,
size_t *);
zfs_handle_t *make_dataset_handle_zc(libzfs_handle_t *, zfs_cmd_t *);
+int libzfs_cmd_set_cachedprops(libzfs_handle_t *, zfs_cmd_t *);
int zprop_parse_value(libzfs_handle_t *, nvpair_t *, int, zfs_type_t,
diff --git a/usr/src/lib/libzfs/common/libzfs_iter.c b/usr/src/lib/libzfs/common/libzfs_iter.c
index f8ad5014cb..19ac0b2625 100644
--- a/usr/src/lib/libzfs/common/libzfs_iter.c
+++ b/usr/src/lib/libzfs/common/libzfs_iter.c
@@ -23,6 +23,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -110,6 +111,10 @@ zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
if (zhp->zfs_type != ZFS_TYPE_FILESYSTEM)
return (0);
+ if (zhp->zfs_hdl->libzfs_cachedprops &&
+ libzfs_cmd_set_cachedprops(zhp->zfs_hdl, &zc) != 0)
+ return (-1);
+
if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
return (-1);
@@ -120,9 +125,8 @@ zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
* that the pool has since been removed.
*/
if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
- &zc)) == NULL) {
+ &zc)) == NULL)
continue;
- }
if ((ret = func(nzhp, data)) != 0) {
zcmd_free_nvlists(&zc);
@@ -147,15 +151,19 @@ zfs_iter_snapshots(zfs_handle_t *zhp, zfs_iter_f func, void *data)
zhp->zfs_type == ZFS_TYPE_BOOKMARK)
return (0);
+ if (zhp->zfs_hdl->libzfs_cachedprops &&
+ libzfs_cmd_set_cachedprops(zhp->zfs_hdl, &zc) != 0)
+ return (-1);
+
if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
return (-1);
+
while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_SNAPSHOT_LIST_NEXT,
&zc)) == 0) {
if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
- &zc)) == NULL) {
+ &zc)) == NULL)
continue;
- }
if ((ret = func(nzhp, data)) != 0) {
zcmd_free_nvlists(&zc);
diff --git a/usr/src/lib/libzfs/common/libzfs_pool.c b/usr/src/lib/libzfs/common/libzfs_pool.c
index 3fac8c3b93..c5b0787eca 100644
--- a/usr/src/lib/libzfs/common/libzfs_pool.c
+++ b/usr/src/lib/libzfs/common/libzfs_pool.c
@@ -212,7 +212,7 @@ zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
*/
int
zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
- zprop_source_t *srctype)
+ zprop_source_t *srctype, boolean_t literal)
{
uint64_t intval;
const char *strval;
@@ -272,6 +272,12 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
case PROP_TYPE_NUMBER:
intval = zpool_get_prop_int(zhp, prop, &src);
+ if (literal && prop != ZPOOL_PROP_HEALTH) {
+ (void) snprintf(buf, len, "%llu",
+ (u_longlong_t)intval);
+ break;
+ }
+
switch (prop) {
case ZPOOL_PROP_SIZE:
case ZPOOL_PROP_ALLOCATED:
@@ -311,6 +317,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
default:
(void) snprintf(buf, len, "%llu", intval);
}
+
break;
case PROP_TYPE_INDEX:
@@ -377,7 +384,7 @@ zpool_is_bootable(zpool_handle_t *zhp)
char bootfs[ZPOOL_MAXNAMELEN];
return (zpool_get_prop(zhp, ZPOOL_PROP_BOOTFS, bootfs,
- sizeof (bootfs), NULL) == 0 && strncmp(bootfs, "-",
+ sizeof (bootfs), NULL, B_FALSE) == 0 && strncmp(bootfs, "-",
sizeof (bootfs)) != 0);
}
@@ -774,7 +781,7 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
if (entry->pl_prop != ZPROP_INVAL &&
zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf),
- NULL) == 0) {
+ NULL, B_FALSE) == 0) {
if (strlen(buf) > entry->pl_width)
entry->pl_width = strlen(buf);
}
diff --git a/usr/src/lib/libzfs/common/libzfs_util.c b/usr/src/lib/libzfs/common/libzfs_util.c
index 41e25e9100..8706a6fdbb 100644
--- a/usr/src/lib/libzfs/common/libzfs_util.c
+++ b/usr/src/lib/libzfs/common/libzfs_util.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -81,6 +82,9 @@ libzfs_error_description(libzfs_handle_t *hdl)
return (dgettext(TEXT_DOMAIN, "property cannot be inherited"));
case EZFS_PROPSPACE:
return (dgettext(TEXT_DOMAIN, "invalid quota or reservation"));
+ case EZFS_PROPCACHED:
+ return (dgettext(TEXT_DOMAIN, "property unavailable since "
+ "cachedprops flag set"));
case EZFS_BADTYPE:
return (dgettext(TEXT_DOMAIN, "operation not applicable to "
"datasets of this type"));
@@ -609,6 +613,42 @@ libzfs_print_on_error(libzfs_handle_t *hdl, boolean_t printerr)
hdl->libzfs_printerr = printerr;
}
+/*
+ * Set the value of the cachedprops flag. If the cachedprops flag is set,
+ * operations which get ZFS properties will only retrieve a property if the
+ * property is cached somewhere in memory.
+ *
+ * Consumers of libzfs should take care when setting this flag, as they will
+ * prevent themselves from listing the full set of ZFS properties.
+ *
+ * ZFS properties which always require disk I/O are ZPL properties (utf8only,
+ * normalization, etc.) and the volsize and volblocksize properties for volumes.
+ */
+void
+libzfs_set_cachedprops(libzfs_handle_t *hdl, boolean_t cachedprops)
+{
+ hdl->libzfs_cachedprops = cachedprops;
+}
+
+/*
+ * Adds a src nvlist to a zfs_cmd_t which specifies that only cached (i.e., will
+ * not require a disk access) properties should be retrieved.
+ */
+int
+libzfs_cmd_set_cachedprops(libzfs_handle_t *hdl, zfs_cmd_t *zc)
+{
+ nvlist_t *nvl;
+ int ret;
+
+ if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0 ||
+ nvlist_add_boolean_value(nvl, "cachedpropsonly", B_TRUE) != 0)
+ return (no_memory(hdl));
+
+ ret = zcmd_write_src_nvlist(hdl, zc, nvl);
+ nvlist_free(nvl);
+ return (ret);
+}
+
libzfs_handle_t *
libzfs_init(void)
{
@@ -644,6 +684,8 @@ libzfs_init(void)
zpool_feature_init();
libzfs_mnttab_init(hdl);
+ hdl->libzfs_cachedprops = B_FALSE;
+
return (hdl);
}
diff --git a/usr/src/lib/libzfs/common/mapfile-vers b/usr/src/lib/libzfs/common/mapfile-vers
index 65f266996e..0e10528f9e 100644
--- a/usr/src/lib/libzfs/common/mapfile-vers
+++ b/usr/src/lib/libzfs/common/mapfile-vers
@@ -21,6 +21,7 @@
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# MAPFILE HEADER START
#
@@ -59,6 +60,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
libzfs_init;
libzfs_mnttab_cache;
libzfs_print_on_error;
+ libzfs_set_cachedprops;
spa_feature_table;
zfs_allocatable_devs;
zfs_asprintf;
@@ -103,6 +105,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zfs_path_to_zhandle;
zfs_promote;
zfs_prop_align_right;
+ zfs_prop_cacheable;
zfs_prop_column_name;
zfs_prop_default_numeric;
zfs_prop_default_string;
diff --git a/usr/src/lib/libzonecfg/common/getzoneent.c b/usr/src/lib/libzonecfg/common/getzoneent.c
index 8155f7272a..76664fcc92 100644
--- a/usr/src/lib/libzonecfg/common/getzoneent.c
+++ b/usr/src/lib/libzonecfg/common/getzoneent.c
@@ -403,14 +403,6 @@ putzoneent(struct zoneent *ze, zoneent_op_t operation)
*/
if (ze->zone_state >= 0) {
zone_state = zone_state_str(ze->zone_state);
-
- /*
- * If the caller is uninstalling this zone,
- * then wipe out the uuid. The zone's contents
- * are no longer known.
- */
- if (ze->zone_state < ZONE_STATE_INSTALLED)
- zone_uuid = "";
}
/* If a new name is supplied, use it. */
@@ -419,6 +411,12 @@ putzoneent(struct zoneent *ze, zoneent_op_t operation)
if (ze->zone_path[0] != '\0')
zone_path = ze->zone_path;
+
+ /* If new UUID provided, replace it */
+ if (!uuid_is_null(ze->zone_uuid)) {
+ uuid_unparse(ze->zone_uuid, uuidstr);
+ zone_uuid = uuidstr;
+ }
break;
case PZE_REMOVE:
diff --git a/usr/src/lib/libzonecfg/common/libzonecfg.c b/usr/src/lib/libzonecfg/common/libzonecfg.c
index 9a664b8824..71da0ffb9a 100644
--- a/usr/src/lib/libzonecfg/common/libzonecfg.c
+++ b/usr/src/lib/libzonecfg/common/libzonecfg.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
*/
#include <libsysevent.h>
@@ -77,6 +78,8 @@
#define ZONE_EVENT_PING_SUBCLASS "ping"
#define ZONE_EVENT_PING_PUBLISHER "solaris"
+#define DEBUGID_FILE "/etc/zones/did.txt"
+
/* Hard-code the DTD element/attribute/entity names just once, here. */
#define DTD_ELEM_ATTR (const xmlChar *) "attr"
#define DTD_ELEM_COMMENT (const xmlChar *) "comment"
@@ -84,6 +87,7 @@
#define DTD_ELEM_FS (const xmlChar *) "filesystem"
#define DTD_ELEM_FSOPTION (const xmlChar *) "fsoption"
#define DTD_ELEM_NET (const xmlChar *) "network"
+#define DTD_ELEM_NETATTR (const xmlChar *) "net-attr"
#define DTD_ELEM_RCTL (const xmlChar *) "rctl"
#define DTD_ELEM_RCTLVALUE (const xmlChar *) "rctl-value"
#define DTD_ELEM_ZONE (const xmlChar *) "zone"
@@ -103,10 +107,12 @@
#define DTD_ATTR_IPTYPE (const xmlChar *) "ip-type"
#define DTD_ATTR_DEFROUTER (const xmlChar *) "defrouter"
#define DTD_ATTR_DIR (const xmlChar *) "directory"
+#define DTD_ATTR_GNIC (const xmlChar *) "global-nic"
#define DTD_ATTR_LIMIT (const xmlChar *) "limit"
#define DTD_ATTR_LIMITPRIV (const xmlChar *) "limitpriv"
#define DTD_ATTR_BOOTARGS (const xmlChar *) "bootargs"
#define DTD_ATTR_SCHED (const xmlChar *) "scheduling-class"
+#define DTD_ATTR_MAC (const xmlChar *) "mac-addr"
#define DTD_ATTR_MATCH (const xmlChar *) "match"
#define DTD_ATTR_NAME (const xmlChar *) "name"
#define DTD_ATTR_PHYSICAL (const xmlChar *) "physical"
@@ -116,6 +122,7 @@
#define DTD_ATTR_SPECIAL (const xmlChar *) "special"
#define DTD_ATTR_TYPE (const xmlChar *) "type"
#define DTD_ATTR_VALUE (const xmlChar *) "value"
+#define DTD_ATTR_VLANID (const xmlChar *) "vlan-id"
#define DTD_ATTR_ZONEPATH (const xmlChar *) "zonepath"
#define DTD_ATTR_NCPU_MIN (const xmlChar *) "ncpu_min"
#define DTD_ATTR_NCPU_MAX (const xmlChar *) "ncpu_max"
@@ -128,6 +135,7 @@
#define DTD_ATTR_MODE (const xmlChar *) "mode"
#define DTD_ATTR_ACL (const xmlChar *) "acl"
#define DTD_ATTR_BRAND (const xmlChar *) "brand"
+#define DTD_ATTR_DID (const xmlChar *) "debugid"
#define DTD_ATTR_HOSTID (const xmlChar *) "hostid"
#define DTD_ATTR_USER (const xmlChar *) "user"
#define DTD_ATTR_AUTHS (const xmlChar *) "auths"
@@ -174,9 +182,12 @@ static struct alias {
{ALIAS_MAXSEMIDS, "zone.max-sem-ids", "privileged", "deny", 0},
{ALIAS_MAXLOCKEDMEM, "zone.max-locked-memory", "privileged", "deny", 0},
{ALIAS_MAXSWAP, "zone.max-swap", "privileged", "deny", 0},
+ {ALIAS_MAXPHYSMEM, "zone.max-physical-memory", "privileged", "deny",
+ 1048576},
{ALIAS_SHARES, "zone.cpu-shares", "privileged", "none", 0},
{ALIAS_CPUCAP, "zone.cpu-cap", "privileged", "deny", 0},
{ALIAS_MAXPROCS, "zone.max-processes", "privileged", "deny", 100},
+ {ALIAS_ZFSPRI, "zone.zfs-io-priority", "privileged", "none", 0},
{NULL, NULL, NULL, NULL, 0}
};
@@ -2064,6 +2075,32 @@ zonecfg_ifname_exists(sa_family_t af, char *ifname)
}
/*
+ * Turn an addr that looks like f:2:0:44:5:6C into 0f:02:00:44:05:6c
+ * We're expecting a dst of at least MAXMACADDRLEN size here.
+ */
+static void
+normalize_mac_addr(char *dst, const char *src, int len)
+{
+ char *p, *e, *sep = "";
+ long n;
+ char buf[MAXMACADDRLEN], tmp[4];
+
+ *dst = '\0';
+ (void) strlcpy(buf, src, sizeof (buf));
+ p = strtok(buf, ":");
+ while (p != NULL) {
+ n = strtol(p, &e, 16);
+ if (*e != NULL || n > 0xff)
+ return;
+ (void) snprintf(tmp, sizeof (tmp), "%s%02x", sep, n);
+ (void) strlcat(dst, tmp, len);
+
+ sep = ":";
+ p = strtok(NULL, ":");
+ }
+}
+
+/*
* Determines whether there is a net resource with the physical interface, IP
* address, and default router specified by 'tabptr' in the zone configuration
* to which 'handle' refers. 'tabptr' must have an interface, an address, a
@@ -2082,13 +2119,18 @@ zonecfg_ifname_exists(sa_family_t af, char *ifname)
int
zonecfg_lookup_nwif(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
{
- xmlNodePtr cur;
+ xmlNodePtr cur, val;
xmlNodePtr firstmatch;
int err;
char address[INET6_ADDRSTRLEN];
char physical[LIFNAMSIZ];
+ char mac[MAXMACADDRLEN];
+ char norm_mac[MAXMACADDRLEN];
+ char gnic[LIFNAMSIZ];
size_t addrspec; /* nonzero if tabptr has IP addr */
size_t physspec; /* nonzero if tabptr has interface */
+ size_t macspec; /* nonzero if tabptr has mac addr */
+ size_t gnicspec; /* nonzero if tabptr has gnic */
size_t defrouterspec; /* nonzero if tabptr has def. router */
size_t allowed_addrspec;
zone_iptype_t iptype;
@@ -2100,17 +2142,20 @@ zonecfg_lookup_nwif(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
* Determine the fields that will be searched. There must be at least
* one.
*
- * zone_nwif_address, zone_nwif_physical, and zone_nwif_defrouter are
+ * zone_nwif_address, zone_nwif_physical, zone_nwif_defrouter,
+ * zone_nwif_mac, zone_nwif_vlan_id and zone_nwif_gnic are
* arrays, so no NULL checks are necessary.
*/
addrspec = strlen(tabptr->zone_nwif_address);
physspec = strlen(tabptr->zone_nwif_physical);
+ macspec = strlen(tabptr->zone_nwif_mac);
+ gnicspec = strlen(tabptr->zone_nwif_gnic);
defrouterspec = strlen(tabptr->zone_nwif_defrouter);
allowed_addrspec = strlen(tabptr->zone_nwif_allowed_address);
if (addrspec != 0 && allowed_addrspec != 0)
return (Z_INVAL); /* can't specify both */
if (addrspec == 0 && physspec == 0 && defrouterspec == 0 &&
- allowed_addrspec == 0)
+ allowed_addrspec == 0 && macspec == 0 && gnicspec == 0)
return (Z_INSUFFICIENT_SPEC);
if ((err = operation_prep(handle)) != Z_OK)
@@ -2137,6 +2182,19 @@ zonecfg_lookup_nwif(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
physical, sizeof (physical)) != Z_OK ||
strcmp(tabptr->zone_nwif_physical, physical) != 0))
continue;
+ if (iptype == ZS_EXCLUSIVE && macspec != 0) {
+ if (fetchprop(cur, DTD_ATTR_MAC, mac, sizeof (mac)) !=
+ Z_OK)
+ continue;
+ normalize_mac_addr(norm_mac, mac, sizeof (norm_mac));
+ if (strcmp(tabptr->zone_nwif_mac, norm_mac) != 0)
+ continue;
+ }
+ if (iptype == ZS_EXCLUSIVE && gnicspec != 0 &&
+ (fetchprop(cur, DTD_ATTR_GNIC, gnic,
+ sizeof (gnic)) != Z_OK ||
+ strcmp(tabptr->zone_nwif_gnic, gnic) != 0))
+ continue;
if (iptype == ZS_SHARED && addrspec != 0 &&
(fetchprop(cur, DTD_ATTR_ADDRESS, address,
sizeof (address)) != Z_OK ||
@@ -2179,6 +2237,21 @@ zonecfg_lookup_nwif(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
return (err);
if (iptype == ZS_EXCLUSIVE &&
+ (err = fetchprop(cur, DTD_ATTR_MAC, tabptr->zone_nwif_mac,
+ sizeof (tabptr->zone_nwif_mac))) != Z_OK)
+ return (err);
+
+ if (iptype == ZS_EXCLUSIVE &&
+ (err = fetchprop(cur, DTD_ATTR_VLANID, tabptr->zone_nwif_vlan_id,
+ sizeof (tabptr->zone_nwif_vlan_id))) != Z_OK)
+ return (err);
+
+ if (iptype == ZS_EXCLUSIVE &&
+ (err = fetchprop(cur, DTD_ATTR_GNIC, tabptr->zone_nwif_gnic,
+ sizeof (tabptr->zone_nwif_gnic))) != Z_OK)
+ return (err);
+
+ if (iptype == ZS_EXCLUSIVE &&
(err = fetchprop(cur, DTD_ATTR_ALLOWED_ADDRESS,
tabptr->zone_nwif_allowed_address,
sizeof (tabptr->zone_nwif_allowed_address))) != Z_OK)
@@ -2189,13 +2262,40 @@ zonecfg_lookup_nwif(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
sizeof (tabptr->zone_nwif_defrouter))) != Z_OK)
return (err);
+ tabptr->zone_nwif_attrp = NULL;
+ for (val = cur->xmlChildrenNode; val != NULL; val = val->next) {
+ struct zone_res_attrtab *valptr;
+
+ valptr = (struct zone_res_attrtab *)malloc(
+ sizeof (struct zone_res_attrtab));
+ if (valptr == NULL)
+ return (Z_NOMEM);
+
+ valptr->zone_res_attr_name[0] =
+ valptr->zone_res_attr_value[0] = '\0';
+ if (zonecfg_add_res_attr(&(tabptr->zone_nwif_attrp), valptr)
+ != Z_OK) {
+ free(valptr);
+ break;
+ }
+
+ if ((fetchprop(val, DTD_ATTR_NAME, valptr->zone_res_attr_name,
+ sizeof (valptr->zone_res_attr_name)) != Z_OK))
+ break;
+ if ((fetchprop(val, DTD_ATTR_VALUE,
+ valptr->zone_res_attr_value,
+ sizeof (valptr->zone_res_attr_value)) != Z_OK))
+ break;
+ }
+
return (Z_OK);
}
static int
zonecfg_add_nwif_core(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
{
- xmlNodePtr newnode, cur = handle->zone_dh_cur;
+ xmlNodePtr newnode, cur = handle->zone_dh_cur, valnode;
+ struct zone_res_attrtab *valptr;
int err;
newnode = xmlNewTextChild(cur, NULL, DTD_ELEM_NET, NULL);
@@ -2211,13 +2311,40 @@ zonecfg_add_nwif_core(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
tabptr->zone_nwif_physical)) != Z_OK)
return (err);
/*
- * Do not add this property when it is not set, for backwards
- * compatibility and because it is optional.
+ * Do not add these properties when they are not set, for backwards
+ * compatibility and because they are optional.
*/
if ((strlen(tabptr->zone_nwif_defrouter) > 0) &&
((err = newprop(newnode, DTD_ATTR_DEFROUTER,
tabptr->zone_nwif_defrouter)) != Z_OK))
return (err);
+ if (strlen(tabptr->zone_nwif_mac) > 0 &&
+ (err = newprop(newnode, DTD_ATTR_MAC,
+ tabptr->zone_nwif_mac)) != Z_OK)
+ return (err);
+ if (strlen(tabptr->zone_nwif_vlan_id) > 0 &&
+ (err = newprop(newnode, DTD_ATTR_VLANID,
+ tabptr->zone_nwif_vlan_id)) != Z_OK)
+ return (err);
+ if (strlen(tabptr->zone_nwif_gnic) > 0 &&
+ (err = newprop(newnode, DTD_ATTR_GNIC,
+ tabptr->zone_nwif_gnic)) != Z_OK)
+ return (err);
+
+ for (valptr = tabptr->zone_nwif_attrp; valptr != NULL;
+ valptr = valptr->zone_res_attr_next) {
+ valnode = xmlNewTextChild(newnode, NULL, DTD_ELEM_NETATTR,
+ NULL);
+ err = newprop(valnode, DTD_ATTR_NAME,
+ valptr->zone_res_attr_name);
+ if (err != Z_OK)
+ return (err);
+ err = newprop(valnode, DTD_ATTR_VALUE,
+ valptr->zone_res_attr_value);
+ if (err != Z_OK)
+ return (err);
+ }
+
return (Z_OK);
}
@@ -2242,7 +2369,8 @@ static int
zonecfg_delete_nwif_core(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
{
xmlNodePtr cur = handle->zone_dh_cur;
- boolean_t addr_match, phys_match, allowed_addr_match;
+ boolean_t addr_match, phys_match, allowed_addr_match, mac_match,
+ gnic_match;
for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) {
if (xmlStrcmp(cur->name, DTD_ELEM_NET))
@@ -2254,8 +2382,13 @@ zonecfg_delete_nwif_core(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
tabptr->zone_nwif_allowed_address);
phys_match = match_prop(cur, DTD_ATTR_PHYSICAL,
tabptr->zone_nwif_physical);
+ mac_match = match_prop(cur, DTD_ATTR_MAC,
+ tabptr->zone_nwif_mac);
+ gnic_match = match_prop(cur, DTD_ATTR_GNIC,
+ tabptr->zone_nwif_gnic);
- if ((addr_match || allowed_addr_match) && phys_match) {
+ if ((addr_match || allowed_addr_match || mac_match ||
+ gnic_match) && phys_match) {
xmlUnlinkNode(cur);
xmlFreeNode(cur);
return (Z_OK);
@@ -2304,6 +2437,58 @@ zonecfg_modify_nwif(
return (Z_OK);
}
+void
+zonecfg_free_res_attr_list(struct zone_res_attrtab *valtab)
+{
+ if (valtab == NULL)
+ return;
+ zonecfg_free_res_attr_list(valtab->zone_res_attr_next);
+ free(valtab);
+}
+
+int
+zonecfg_add_res_attr(struct zone_res_attrtab **headptr,
+ struct zone_res_attrtab *valtabptr)
+{
+ struct zone_res_attrtab *last, *old, *new;
+
+ last = *headptr;
+ for (old = last; old != NULL; old = old->zone_res_attr_next)
+ last = old; /* walk to the end of the list */
+ new = valtabptr; /* alloc'd by caller */
+ new->zone_res_attr_next = NULL;
+ if (last == NULL)
+ *headptr = new;
+ else
+ last->zone_res_attr_next = new;
+ return (Z_OK);
+}
+
+int
+zonecfg_remove_res_attr(struct zone_res_attrtab **headptr,
+ struct zone_res_attrtab *valtabptr)
+{
+ struct zone_res_attrtab *last, *this, *next;
+
+ last = *headptr;
+ for (this = last; this != NULL; this = this->zone_res_attr_next) {
+ if (strcmp(this->zone_res_attr_name,
+ valtabptr->zone_res_attr_name) == 0 &&
+ strcmp(this->zone_res_attr_value,
+ valtabptr->zone_res_attr_value) == 0) {
+ next = this->zone_res_attr_next;
+ if (this == *headptr)
+ *headptr = next;
+ else
+ last->zone_res_attr_next = next;
+ free(this);
+ return (Z_OK);
+ } else
+ last = this;
+ }
+ return (Z_NO_PROPERTY_ID);
+}
+
/*
* Must be a comma-separated list of alpha-numeric file system names.
*/
@@ -2322,7 +2507,7 @@ zonecfg_valid_fs_allowed(const char *fsallowedp)
while (*cp != '\0') {
p = cp;
while (*p != '\0' && *p != ',') {
- if (!isalnum(*p))
+ if (!isalnum(*p) && *p != '-')
return (Z_INVALID_PROPERTY);
p++;
}
@@ -2453,7 +2638,7 @@ zonecfg_set_hostid(zone_dochandle_t handle, const char *hostidp)
int
zonecfg_lookup_dev(zone_dochandle_t handle, struct zone_devtab *tabptr)
{
- xmlNodePtr cur, firstmatch;
+ xmlNodePtr cur, val, firstmatch;
int err;
char match[MAXPATHLEN];
@@ -2498,13 +2683,40 @@ zonecfg_lookup_dev(zone_dochandle_t handle, struct zone_devtab *tabptr)
sizeof (tabptr->zone_dev_match))) != Z_OK)
return (err);
+ tabptr->zone_dev_attrp = NULL;
+ for (val = cur->xmlChildrenNode; val != NULL; val = val->next) {
+ struct zone_res_attrtab *valptr;
+
+ valptr = (struct zone_res_attrtab *)malloc(
+ sizeof (struct zone_res_attrtab));
+ if (valptr == NULL)
+ return (Z_NOMEM);
+
+ valptr->zone_res_attr_name[0] =
+ valptr->zone_res_attr_value[0] = '\0';
+ if (zonecfg_add_res_attr(&(tabptr->zone_dev_attrp), valptr)
+ != Z_OK) {
+ free(valptr);
+ break;
+ }
+
+ if ((fetchprop(val, DTD_ATTR_NAME, valptr->zone_res_attr_name,
+ sizeof (valptr->zone_res_attr_name)) != Z_OK))
+ break;
+ if ((fetchprop(val, DTD_ATTR_VALUE,
+ valptr->zone_res_attr_value,
+ sizeof (valptr->zone_res_attr_value)) != Z_OK))
+ break;
+ }
+
return (Z_OK);
}
static int
zonecfg_add_dev_core(zone_dochandle_t handle, struct zone_devtab *tabptr)
{
- xmlNodePtr newnode, cur = handle->zone_dh_cur;
+ xmlNodePtr newnode, cur = handle->zone_dh_cur, valnode;
+ struct zone_res_attrtab *valptr;
int err;
newnode = xmlNewTextChild(cur, NULL, DTD_ELEM_DEVICE, NULL);
@@ -2513,6 +2725,21 @@ zonecfg_add_dev_core(zone_dochandle_t handle, struct zone_devtab *tabptr)
tabptr->zone_dev_match)) != Z_OK)
return (err);
+ for (valptr = tabptr->zone_dev_attrp; valptr != NULL;
+ valptr = valptr->zone_res_attr_next) {
+ valnode = xmlNewTextChild(newnode, NULL, DTD_ELEM_NETATTR,
+ NULL);
+ err = newprop(valnode, DTD_ATTR_NAME,
+ valptr->zone_res_attr_name);
+ if (err != Z_OK)
+ return (err);
+ err = newprop(valnode, DTD_ATTR_VALUE,
+ valptr->zone_res_attr_value);
+ if (err != Z_OK)
+ return (err);
+ }
+
+
return (Z_OK);
}
@@ -4572,7 +4799,7 @@ get_pool_sched_class(char *poolname, char *class, int clsize)
pool_conf_t *poolconf;
pool_t *pool;
pool_elem_t *pe;
- pool_value_t *pv = pool_value_alloc();
+ pool_value_t *pv;
const char *sched_str;
if (pool_get_status(&status) != PO_SUCCESS || status != POOL_ENABLED)
@@ -4593,15 +4820,23 @@ get_pool_sched_class(char *poolname, char *class, int clsize)
return (Z_NO_POOL);
}
+ if ((pv = pool_value_alloc()) == NULL) {
+ (void) pool_conf_close(poolconf);
+ pool_conf_free(poolconf);
+ return (Z_NO_POOL);
+ }
+
pe = pool_to_elem(poolconf, pool);
if (pool_get_property(poolconf, pe, "pool.scheduler", pv) !=
POC_STRING) {
(void) pool_conf_close(poolconf);
+ pool_value_free(pv);
pool_conf_free(poolconf);
return (Z_NO_ENTRY);
}
(void) pool_value_get_string(pv, &sched_str);
(void) pool_conf_close(poolconf);
+ pool_value_free(pv);
pool_conf_free(poolconf);
if (strlcpy(class, sched_str, clsize) >= clsize)
return (Z_TOO_BIG);
@@ -4710,7 +4945,8 @@ zonecfg_setnwifent(zone_dochandle_t handle)
int
zonecfg_getnwifent(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
{
- xmlNodePtr cur;
+ xmlNodePtr cur, val;
+ struct zone_res_attrtab *valptr;
int err;
if (handle == NULL)
@@ -4746,6 +4982,24 @@ zonecfg_getnwifent(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
return (err);
}
+ if ((err = fetchprop(cur, DTD_ATTR_MAC, tabptr->zone_nwif_mac,
+ sizeof (tabptr->zone_nwif_mac))) != Z_OK) {
+ handle->zone_dh_cur = handle->zone_dh_top;
+ return (err);
+ }
+
+ if ((err = fetchprop(cur, DTD_ATTR_VLANID, tabptr->zone_nwif_vlan_id,
+ sizeof (tabptr->zone_nwif_vlan_id))) != Z_OK) {
+ handle->zone_dh_cur = handle->zone_dh_top;
+ return (err);
+ }
+
+ if ((err = fetchprop(cur, DTD_ATTR_GNIC, tabptr->zone_nwif_gnic,
+ sizeof (tabptr->zone_nwif_gnic))) != Z_OK) {
+ handle->zone_dh_cur = handle->zone_dh_top;
+ return (err);
+ }
+
if ((err = fetchprop(cur, DTD_ATTR_DEFROUTER,
tabptr->zone_nwif_defrouter,
sizeof (tabptr->zone_nwif_defrouter))) != Z_OK) {
@@ -4753,6 +5007,29 @@ zonecfg_getnwifent(zone_dochandle_t handle, struct zone_nwiftab *tabptr)
return (err);
}
+ tabptr->zone_nwif_attrp = NULL;
+ for (val = cur->xmlChildrenNode; val != NULL; val = val->next) {
+ valptr = (struct zone_res_attrtab *)malloc(
+ sizeof (struct zone_res_attrtab));
+ if (valptr == NULL)
+ return (Z_NOMEM);
+
+ valptr->zone_res_attr_name[0] =
+ valptr->zone_res_attr_value[0] = '\0';
+ if (zonecfg_add_res_attr(&(tabptr->zone_nwif_attrp), valptr)
+ != Z_OK) {
+ free(valptr);
+ break;
+ }
+
+ if (fetchprop(val, DTD_ATTR_NAME, valptr->zone_res_attr_name,
+ sizeof (valptr->zone_res_attr_name)) != Z_OK)
+ break;
+ if (fetchprop(val, DTD_ATTR_VALUE, valptr->zone_res_attr_value,
+ sizeof (valptr->zone_res_attr_value)) != Z_OK)
+ break;
+ }
+
handle->zone_dh_cur = cur->next;
return (Z_OK);
}
@@ -4772,7 +5049,7 @@ zonecfg_setdevent(zone_dochandle_t handle)
int
zonecfg_getdevent(zone_dochandle_t handle, struct zone_devtab *tabptr)
{
- xmlNodePtr cur;
+ xmlNodePtr cur, val;
int err;
if (handle == NULL)
@@ -4795,6 +5072,31 @@ zonecfg_getdevent(zone_dochandle_t handle, struct zone_devtab *tabptr)
return (err);
}
+ tabptr->zone_dev_attrp = NULL;
+ for (val = cur->xmlChildrenNode; val != NULL; val = val->next) {
+ struct zone_res_attrtab *valptr;
+
+ valptr = (struct zone_res_attrtab *)malloc(
+ sizeof (struct zone_res_attrtab));
+ if (valptr == NULL)
+ return (Z_NOMEM);
+
+ valptr->zone_res_attr_name[0] =
+ valptr->zone_res_attr_value[0] = '\0';
+ if (zonecfg_add_res_attr(&(tabptr->zone_dev_attrp), valptr)
+ != Z_OK) {
+ free(valptr);
+ break;
+ }
+
+ if ((fetchprop(val, DTD_ATTR_NAME, valptr->zone_res_attr_name,
+ sizeof (valptr->zone_res_attr_name)) != Z_OK))
+ break;
+ if ((fetchprop(val, DTD_ATTR_VALUE, valptr->zone_res_attr_value,
+ sizeof (valptr->zone_res_attr_value)) != Z_OK))
+ break;
+ }
+
handle->zone_dh_cur = cur->next;
return (Z_OK);
}
@@ -5523,6 +5825,164 @@ zone_get_brand(char *zone_name, char *brandname, size_t rp_sz)
}
/*
+ * Atomically get a new zone_did value. The currently allocated value
+ * is stored in /etc/zones/did.txt. Lock the file, read the current value,
+ * increment, save the new value and unlock the file. Return the new value
+ * or -1 if there was an error. The ID namespace is large enough that we
+ * don't worry about recycling an ID when a zone is deleted.
+ */
+static zoneid_t
+new_zone_did()
+{
+ int fd;
+ int len;
+ int val;
+ struct flock lck;
+ char buf[80];
+
+ if ((fd = open(DEBUGID_FILE, O_RDWR | O_CREAT,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) {
+ perror("new_zone_did open failed");
+ return (-1);
+ }
+
+ /* Initialize the lock. */
+ lck.l_whence = SEEK_SET;
+ lck.l_start = 0;
+ lck.l_len = 0;
+
+ /* Wait until we acquire an exclusive lock on the file. */
+ lck.l_type = F_WRLCK;
+ if (fcntl(fd, F_SETLKW, &lck) == -1) {
+ perror("new_zone_did lock failed");
+ (void) close(fd);
+ return (-1);
+ }
+
+ /* Get currently allocated value */
+ len = read(fd, buf, sizeof (buf));
+ if (len == -1) {
+ perror("new_zone_did read failed");
+ val = -1;
+ } else {
+ if (lseek(fd, 0L, SEEK_SET) == -1) {
+ perror("new_zone_did seek failed");
+ val = -1;
+ } else {
+ if (len == 0) {
+ /* Just created the file, initialize at 1 */
+ val = 1;
+ } else {
+ val = atoi(buf);
+ val++;
+ }
+
+ (void) snprintf(buf, sizeof (buf), "%d\n", val);
+ len = strlen(buf);
+
+ /* Save newly allocated value */
+ if (write(fd, buf, len) == -1) {
+ perror("new_zone_did write failed");
+ val = -1;
+ }
+ }
+ }
+
+ /* Release the file lock. */
+ lck.l_type = F_UNLCK;
+ if (fcntl(fd, F_SETLK, &lck) == -1) {
+ perror("new_zone_did unlock failed");
+ val = -1;
+ }
+
+ if (close(fd) != 0)
+ perror("new_zone_did close failed");
+
+ return (val);
+}
+
+/*
+ * Called by zoneadmd to get the zone's debug ID.
+ * If the zone doesn't already have an ID, a new one is generated and
+ * persistently saved onto the zone. Normally either zoneadm or zonecfg
+ * will assign a new ID for the zone, so zoneadmd should never have to
+ * generate one, but we also handle that here just to be paranoid.
+ */
+zoneid_t
+zone_get_did(char *zone_name)
+{
+ int res;
+ zoneid_t new_did;
+ zone_dochandle_t handle;
+ char did_str[80];
+
+ if ((handle = zonecfg_init_handle()) == NULL)
+ return (getpid());
+
+ if (zonecfg_get_handle((char *)zone_name, handle) != Z_OK)
+ return (getpid());
+
+ res = getrootattr(handle, DTD_ATTR_DID, did_str, sizeof (did_str));
+
+ /* If the zone already has an assigned debug ID, return it. */
+ if (res == Z_OK && did_str[0] != '\0') {
+ zonecfg_fini_handle(handle);
+ return (atoi(did_str));
+ }
+
+ /*
+ * The zone doesn't have an assigned debug ID yet, generate one and
+ * save it as part of the zone definition.
+ */
+ if ((new_did = new_zone_did()) == -1) {
+ /*
+ * We should really never hit this block of code.
+ * Generating a new ID failed for some reason. Use the current
+ * pid as a temporary ID so that the zone can continue to boot
+ * but we don't persistently save this temporary ID on the zone.
+ */
+ zonecfg_fini_handle(handle);
+ return (getpid());
+ }
+
+ /* Now persistently save this new ID onto the zone. */
+ (void) snprintf(did_str, sizeof (did_str), "%d", new_did);
+ (void) setrootattr(handle, DTD_ATTR_DID, did_str);
+ (void) zonecfg_save(handle);
+
+ zonecfg_fini_handle(handle);
+ return (new_did);
+}
+
+zoneid_t
+zonecfg_get_did(zone_dochandle_t handle)
+{
+ char did_str[80];
+ int err;
+ zoneid_t did;
+
+ err = getrootattr(handle, DTD_ATTR_DID, did_str, sizeof (did_str));
+ if (err == Z_OK && did_str[0] != '\0')
+ did = atoi(did_str);
+ else
+ did = -1;
+
+ return (did);
+}
+
+void
+zonecfg_set_did(zone_dochandle_t handle)
+{
+ zoneid_t new_did;
+ char did_str[80];
+
+ if ((new_did = new_zone_did()) == -1)
+ return;
+ (void) snprintf(did_str, sizeof (did_str), "%d", new_did);
+ (void) setrootattr(handle, DTD_ATTR_DID, did_str);
+}
+
+/*
* Return the appropriate root for the active /dev.
* For normal zone, the path is $ZONEPATH/root;
* for scratch zone, the dev path is $ZONEPATH/lu.
@@ -5805,6 +6265,30 @@ zonecfg_get_uuid(const char *zonename, uuid_t uuid)
}
/*
+ * Changes a zone's UUID to the given value. Returns an error if the UUID is
+ * malformed or if the zone cannot be located.
+ */
+int
+zonecfg_set_uuid(const char *zonename, const char *zonepath,
+ const char *uuid)
+{
+ int err;
+ struct zoneent ze;
+
+ bzero(&ze, sizeof (ze));
+ ze.zone_state = -1; /* Preserve existing state in index */
+ (void) strlcpy(ze.zone_name, zonename, sizeof (ze.zone_name));
+ (void) strlcpy(ze.zone_path, zonepath, sizeof (ze.zone_path));
+ if (uuid_parse((char *)uuid, ze.zone_uuid) == -1)
+ return (Z_INVALID_PROPERTY);
+
+ if ((err = putzoneent(&ze, PZE_MODIFY)) != Z_OK)
+ return (err);
+
+ return (Z_OK);
+}
+
+/*
* File-system convenience functions.
*/
boolean_t
@@ -6838,131 +7322,49 @@ zonecfg_getpsetent(zone_dochandle_t handle, struct zone_psettab *tabptr)
return (err);
}
-static int
-add_mcap(zone_dochandle_t handle, struct zone_mcaptab *tabptr)
-{
- xmlNodePtr newnode, cur = handle->zone_dh_cur;
- int err;
-
- newnode = xmlNewTextChild(cur, NULL, DTD_ELEM_MCAP, NULL);
- if ((err = newprop(newnode, DTD_ATTR_PHYSCAP, tabptr->zone_physmem_cap))
- != Z_OK)
- return (err);
-
- return (Z_OK);
-}
-
-int
-zonecfg_delete_mcap(zone_dochandle_t handle)
-{
- int err;
- xmlNodePtr cur = handle->zone_dh_cur;
-
- if ((err = operation_prep(handle)) != Z_OK)
- return (err);
-
- for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) {
- if (xmlStrcmp(cur->name, DTD_ELEM_MCAP) != 0)
- continue;
-
- xmlUnlinkNode(cur);
- xmlFreeNode(cur);
- return (Z_OK);
- }
- return (Z_NO_RESOURCE_ID);
-}
-
-int
-zonecfg_modify_mcap(zone_dochandle_t handle, struct zone_mcaptab *tabptr)
-{
- int err;
-
- if (tabptr == NULL)
- return (Z_INVAL);
-
- err = zonecfg_delete_mcap(handle);
- /* it is ok if there is no mcap entry */
- if (err != Z_OK && err != Z_NO_RESOURCE_ID)
- return (err);
-
- if ((err = add_mcap(handle, tabptr)) != Z_OK)
- return (err);
-
- return (Z_OK);
-}
-
+/*
+ * Cleanup obsolete constructs in the configuration.
+ * Return true of the config has been updated and must be commited.
+ */
int
-zonecfg_lookup_mcap(zone_dochandle_t handle, struct zone_mcaptab *tabptr)
+zonecfg_fix_obsolete(zone_dochandle_t handle)
{
+ int res = 0;
+ int add_physmem_rctl = 0;
xmlNodePtr cur;
- int err;
-
- if (tabptr == NULL)
- return (Z_INVAL);
+ char zone_physmem_cap[MAXNAMELEN];
- if ((err = operation_prep(handle)) != Z_OK)
- return (err);
+ if (operation_prep(handle) != Z_OK)
+ return (res);
+ /*
+ * If an obsolete mcap entry exists, convert it to the rctl.
+ */
cur = handle->zone_dh_cur;
for (cur = cur->xmlChildrenNode; cur != NULL; cur = cur->next) {
if (xmlStrcmp(cur->name, DTD_ELEM_MCAP) != 0)
continue;
- if ((err = fetchprop(cur, DTD_ATTR_PHYSCAP,
- tabptr->zone_physmem_cap,
- sizeof (tabptr->zone_physmem_cap))) != Z_OK) {
- handle->zone_dh_cur = handle->zone_dh_top;
- return (err);
+
+ if (fetchprop(cur, DTD_ATTR_PHYSCAP,
+ zone_physmem_cap, sizeof (zone_physmem_cap)) == Z_OK) {
+ res = 1;
+ add_physmem_rctl = 1;
}
- return (Z_OK);
+ xmlUnlinkNode(cur);
+ xmlFreeNode(cur);
+ break;
}
- return (Z_NO_ENTRY);
-}
-
-static int
-getmcapent_core(zone_dochandle_t handle, struct zone_mcaptab *tabptr)
-{
- xmlNodePtr cur;
- int err;
-
- if (handle == NULL)
- return (Z_INVAL);
-
- if ((cur = handle->zone_dh_cur) == NULL)
- return (Z_NO_ENTRY);
-
- for (; cur != NULL; cur = cur->next)
- if (xmlStrcmp(cur->name, DTD_ELEM_MCAP) == 0)
- break;
- if (cur == NULL) {
- handle->zone_dh_cur = handle->zone_dh_top;
- return (Z_NO_ENTRY);
- }
+ if (add_physmem_rctl) {
+ uint64_t cap;
+ char *endp;
- if ((err = fetchprop(cur, DTD_ATTR_PHYSCAP, tabptr->zone_physmem_cap,
- sizeof (tabptr->zone_physmem_cap))) != Z_OK) {
- handle->zone_dh_cur = handle->zone_dh_top;
- return (err);
+ cap = strtoull(zone_physmem_cap, &endp, 10);
+ (void) zonecfg_set_aliased_rctl(handle, ALIAS_MAXPHYSMEM, cap);
}
- handle->zone_dh_cur = cur->next;
- return (Z_OK);
-}
-
-int
-zonecfg_getmcapent(zone_dochandle_t handle, struct zone_mcaptab *tabptr)
-{
- int err;
-
- if ((err = zonecfg_setent(handle)) != Z_OK)
- return (err);
-
- err = getmcapent_core(handle, tabptr);
-
- (void) zonecfg_endent(handle);
-
- return (err);
+ return (res);
}
/*
diff --git a/usr/src/lib/libzonecfg/common/mapfile-vers b/usr/src/lib/libzonecfg/common/mapfile-vers
index b908a28174..7265b06a1f 100644
--- a/usr/src/lib/libzonecfg/common/mapfile-vers
+++ b/usr/src/lib/libzonecfg/common/mapfile-vers
@@ -20,6 +20,7 @@
#
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Joyent Inc. All rights reserved.
#
#
@@ -53,6 +54,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_add_fs_option;
zonecfg_add_admin;
zonecfg_add_nwif;
+ zonecfg_add_res_attr;
zonecfg_add_pkg;
zonecfg_add_pset;
zonecfg_add_rctl;
@@ -79,7 +81,6 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_delete_dev;
zonecfg_delete_ds;
zonecfg_delete_filesystem;
- zonecfg_delete_mcap;
zonecfg_delete_nwif;
zonecfg_delete_pset;
zonecfg_delete_rctl;
@@ -104,7 +105,9 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_find_mounts;
zonecfg_find_scratch;
zonecfg_fini_handle;
+ zonecfg_fix_obsolete;
zonecfg_free_fs_option_list;
+ zonecfg_free_res_attr_list;
zonecfg_free_rctl_value_list;
zonecfg_get_aliased_rctl;
zonecfg_get_attach_handle;
@@ -118,6 +121,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_get_bootargs;
zonecfg_get_brand;
zonecfg_get_dflt_sched_class;
+ zonecfg_get_did;
zonecfg_getdevent;
zonecfg_getdevperment;
zonecfg_getdsent;
@@ -127,7 +131,6 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_get_hostid;
zonecfg_get_iptype;
zonecfg_get_limitpriv;
- zonecfg_getmcapent;
zonecfg_get_name;
zonecfg_get_name_by_uuid;
zonecfg_getnwifent;
@@ -160,7 +163,6 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_lookup_dev;
zonecfg_lookup_ds;
zonecfg_lookup_filesystem;
- zonecfg_lookup_mcap;
zonecfg_lookup_nwif;
zonecfg_lookup_pset;
zonecfg_lookup_rctl;
@@ -169,7 +171,6 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_modify_dev;
zonecfg_modify_ds;
zonecfg_modify_filesystem;
- zonecfg_modify_mcap;
zonecfg_modify_nwif;
zonecfg_modify_pset;
zonecfg_modify_rctl;
@@ -183,6 +184,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_ping_zoneadmd;
zonecfg_release_lock_file;
zonecfg_remove_fs_option;
+ zonecfg_remove_res_attr;
zonecfg_remove_rctl_value;
zonecfg_remove_userauths;
zonecfg_reverse_scratch;
@@ -196,6 +198,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_set_autoboot;
zonecfg_set_bootargs;
zonecfg_set_brand;
+ zonecfg_set_did;
zonecfg_setdevent;
zonecfg_setdevperment;
zonecfg_setdsent;
@@ -211,6 +214,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_set_root;
zonecfg_set_sched;
zonecfg_set_swinv;
+ zonecfg_set_uuid;
zonecfg_set_zonepath;
zonecfg_strerror;
zonecfg_str_to_bytes;
@@ -229,6 +233,7 @@ SYMBOL_VERSION SUNWprivate_1.1 {
zonecfg_verify_save;
zonecfg_warn_poold;
zone_get_brand;
+ zone_get_did;
zone_get_devroot;
zone_get_id;
zone_get_rootpath;
diff --git a/usr/src/lib/libzonecfg/dtd/zonecfg.dtd.1 b/usr/src/lib/libzonecfg/dtd/zonecfg.dtd.1
index d94bb09c5f..3c7198efef 100644
--- a/usr/src/lib/libzonecfg/dtd/zonecfg.dtd.1
+++ b/usr/src/lib/libzonecfg/dtd/zonecfg.dtd.1
@@ -21,6 +21,7 @@
CDDL HEADER END
Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, Joyent Inc. All rights reserved.
-->
@@ -46,14 +47,21 @@
<!ATTLIST inherited-pkg-dir directory CDATA #REQUIRED>
-<!ELEMENT network EMPTY>
+<!ELEMENT net-attr EMPTY>
+<!ATTLIST net-attr name CDATA #REQUIRED
+ value CDATA #REQUIRED>
+
+<!ELEMENT network (net-attr)*>
<!ATTLIST network address CDATA ""
allowed-address CDATA ""
defrouter CDATA ""
- physical CDATA #REQUIRED>
+ global-nic CDATA ""
+ mac-addr CDATA ""
+ physical CDATA #REQUIRED
+ vlan-id CDATA "">
-<!ELEMENT device EMPTY>
+<!ELEMENT device (net-attr)*>
<!ATTLIST device match CDATA #REQUIRED>
@@ -156,6 +164,7 @@
limitpriv CDATA ""
bootargs CDATA ""
brand CDATA ""
+ debugid CDATA ""
scheduling-class CDATA ""
fs-allowed CDATA ""
version NMTOKEN #FIXED '1'>
diff --git a/usr/src/lib/libzpool/common/sys/zfs_context.h b/usr/src/lib/libzpool/common/sys/zfs_context.h
index 3aa58fb05a..b6f6304f59 100644
--- a/usr/src/lib/libzpool/common/sys/zfs_context.h
+++ b/usr/src/lib/libzpool/common/sys/zfs_context.h
@@ -22,7 +22,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_ZFS_CONTEXT_H
@@ -305,6 +305,7 @@ extern void kstat_runq_back_to_waitq(kstat_io_t *);
#define KM_SLEEP UMEM_NOFAIL
#define KM_PUSHPAGE KM_SLEEP
#define KM_NOSLEEP UMEM_DEFAULT
+#define KM_NORMALPRI 0
#define KMC_NODEBUG UMC_NODEBUG
#define KMC_NOTOUCH 0 /* not needed for userland caches */
#define kmem_alloc(_s, _f) umem_alloc(_s, _f)
diff --git a/usr/src/lib/nsswitch/dns/Makefile.com b/usr/src/lib/nsswitch/dns/Makefile.com
index 23c89c32f8..0366633c0c 100644
--- a/usr/src/lib/nsswitch/dns/Makefile.com
+++ b/usr/src/lib/nsswitch/dns/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# lib/nsswitch/dns/Makefile.com
LIBRARY = libnss_dns.a
@@ -46,5 +44,5 @@ CPPFLAGS += -DNSS_DNS_LIBRESOLV=\"libresolv.so.2\"
LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2
-LDLIBS += -lnsl
+LDLIBS += -lnsl -lresolv_joy -lsocket
DYNLIB1 = nss_dns.so$(VERS)
diff --git a/usr/src/lib/nsswitch/dns/common/dns_common.c b/usr/src/lib/nsswitch/dns/common/dns_common.c
index a9195f9f68..0195b1847c 100644
--- a/usr/src/lib/nsswitch/dns/common/dns_common.c
+++ b/usr/src/lib/nsswitch/dns/common/dns_common.c
@@ -22,22 +22,19 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
/*
* dns_common.c
*/
#include "dns_common.h"
-
-#pragma weak dn_expand
-#pragma weak res_ninit
-#pragma weak res_ndestroy
-#pragma weak res_nsearch
-#pragma weak res_nclose
-#pragma weak ns_get16
-#pragma weak ns_get32
-#pragma weak __ns_get16
-#pragma weak __ns_get32
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <ifaddrs.h>
+#include <net/if.h>
#define DNS_ALIASES 0
#define DNS_ADDRLIST 1
@@ -321,6 +318,52 @@ name_is_alias(char *aliases_ptr, char *name_ptr) {
return (NSS_NOTFOUND);
}
+
+static int
+_nss_has_interfaces(int *v4, int *v6)
+{
+ struct ifaddrs *ifp, *i;
+ struct in_addr in4;
+ struct in6_addr in6;
+ const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+
+ *v4 = *v6 = 0;
+
+ if (getifaddrs(&ifp) != 0)
+ return (-1);
+
+ for (i = ifp; i != NULL; i = i->ifa_next) {
+ if (i->ifa_flags & IFF_LOOPBACK)
+ continue;
+ if ((i->ifa_flags & IFF_UP) == 0)
+ continue;
+
+ if (i->ifa_addr->sa_family == AF_INET) {
+ if (*v4 != 0)
+ continue;
+
+ if (((struct sockaddr_in *)i->ifa_addr)->
+ sin_addr.s_addr == INADDR_ANY)
+ continue;
+ *v4 = 1;
+ }
+
+ if (i->ifa_addr->sa_family == AF_INET6) {
+ if (*v6 != 0)
+ continue;
+
+ if (memcmp(&in6addr_any,
+ &((struct sockaddr_in6 *)i->ifa_addr)->sin6_addr,
+ sizeof (struct in6_addr)) == 0)
+ continue;
+ *v6 = 1;
+ }
+ }
+
+ freeifaddrs(ifp);
+ return (0);
+}
+
/*
* nss_dns_gethost_withttl(void *buffer, size_t bufsize, int ipnode)
* nss2 get hosts/ipnodes with ttl backend DNS search engine.
@@ -331,13 +374,6 @@ name_is_alias(char *aliases_ptr, char *name_ptr) {
* Additionally in the extended results a nssuint_t ttl is placed.
* This ttl is the lessor of the ttl's extracted from the result.
*
- * ***Currently the first version of this API only performs simple
- * single res_nsearch lookups for with T_A or T_AAAA results.
- * Other searches are deferred to the generic API w/t ttls.
- *
- * This function is not a generic res_* operation. It only performs
- * a single T_A or T_AAAA lookups***
- *
* RETURNS: NSS_SUCCESS or NSS_ERROR
* If an NSS_ERROR result is returned, nscd is expected
* to resubmit the gethosts request using the old style
@@ -384,11 +420,14 @@ _nss_dns_gethost_withttl(void *buffer, size_t bufsize, int ipnode)
int af;
char *ap, *apc;
int hlen = 0, alen, iplen, len, isans;
+ int has_v4 = 0, has_v6 = 0;
+ int flags, family, pass2 = 0;
statp = &stat;
(void) memset(statp, '\0', sizeof (struct __res_state));
- if (res_ninit(statp) == -1)
+ if (res_ninit(statp) == -1) {
return (NSS_ERROR);
+ }
ap = apc = (char *)aliases;
alen = 0;
@@ -404,33 +443,139 @@ _nss_dns_gethost_withttl(void *buffer, size_t bufsize, int ipnode)
return (NSS_ERROR);
}
+ /*
+ * There may be flags set when we are handling ipnode. There are three
+ * different values for flags:
+ *
+ * o AI_V4MAPPED
+ * o AI_ALL
+ * o AI_ADDRCONFIG
+ *
+ * The first two only have a meaning when af_family is ipv6. The latter
+ * means something in both cases. These flags are documented in
+ * getipnodebyname(3SOCKET), though the combinations leave a little
+ * something to be desired. It would be great if we could actually use
+ * getipnodebyname directly here since it already knows how to handle
+ * this kind of logic; however, we're not quite so lucky. Ideally we
+ * would add such an interface to libresolv.so.2 to handle this kind of
+ * thing, but that's rather painful as well. We'll summarize what has to
+ * happen below:
+ *
+ * AI_ALL is only meaningful when AI_V4MAPPED is also specified. Both
+ * are ignored if the family is not AF_INET6
+ *
+ * family == AF_INET, flags | AI_ADDRCONFIG
+ * - lookup A records iff we have v4 plumbed
+ * family == AF_INET, !(flags | AI_ADDRCONFIG)
+ * - lookup A records
+ * family == AF_INET6, flags == 0 || flags == AI_ALL
+ * - lookup AAAA records
+ * family == AF_INET6, flags | AI_V4MAPPED
+ * - lookup AAAA, if none, lookup A
+ * family == AF_INET6, flags | AI_ADDRCONFIG
+ * - lookup AAAA records if ipv6
+ * family == AF_INET6, flags | AI_V4MAPPED && flags | AI_ALL
+ * - lookup AAAA records, lookup A records
+ * family == AF_INET6, flags | AI_V4MAPPED && flags | AI_ADDRCONFIG
+ * - lookup AAAA records if ipv6
+ * - If no AAAA && ipv4 exists, lookup A
+ * family == AF_INET6, flags | AI_V4MAPPED && flags | AI_ADDRCONFIG &&
+ * flags | AI_ALL
+ * - lookup AAAA records if ipv6
+ * - loookup A records if ipv4
+ */
if (ipnode) {
/* initially only handle the simple cases */
- if (arg.key.ipnode.flags != 0) {
- res_ndestroy(statp);
- return (NSS_ERROR);
- }
name = arg.key.ipnode.name;
- if (arg.key.ipnode.af_family == AF_INET6)
- qtype = T_AAAA;
- else
- qtype = T_A;
+ flags = arg.key.ipnode.flags;
+ family = arg.key.ipnode.af_family;
+ if (flags != 0) {
+ /*
+ * Figure out our first pass. We'll determine if we need
+ * to do a second pass afterwards once we successfully
+ * finish our first pass.
+ */
+ if ((flags & AI_ADDRCONFIG) != 0) {
+ if (_nss_has_interfaces(&has_v4, &has_v6) !=
+ 0) {
+ res_ndestroy(statp);
+ return (NSS_ERROR);
+ }
+ /* Impossible situations... */
+ if (family == AF_INET && has_v4 == 0) {
+ res_ndestroy(statp);
+ return (NSS_NOTFOUND);
+ }
+ if (family == AF_INET6 && has_v6 == 0 &&
+ !(flags & AI_V4MAPPED)) {
+ res_ndestroy(statp);
+ return (NSS_NOTFOUND);
+ }
+ if (family == AF_INET6 && has_v6)
+ qtype = T_AAAA;
+ if (family == AF_INET || (family == AF_INET6 &&
+ has_v6 == 0 && flags & AI_V4MAPPED))
+ qtype = T_A;
+ } else {
+ has_v4 = has_v6 = 1;
+ if (family == AF_INET6)
+ qtype = T_AAAA;
+ else
+ qtype = T_A;
+ }
+ } else {
+ if (family == AF_INET6)
+ qtype = T_AAAA;
+ else
+ qtype = T_A;
+ }
} else {
name = arg.key.name;
qtype = T_A;
}
+
+searchagain:
ret = res_nsearch(statp, name, C_IN, qtype, resbuf.buf, NS_MAXMSG);
if (ret == -1) {
- if (statp->res_h_errno == HOST_NOT_FOUND) {
+ /*
+ * We want to continue on unless we got NO_RECOVERY. Otherwise,
+ * HOST_NOT_FOUND, TRY_AGAIN, and NO_DATA all suggest to me that
+ * we should keep going.
+ */
+ if (statp->res_h_errno == NO_RECOVERY) {
+ /* else lookup error - handle in general code */
+ res_ndestroy(statp);
+ return (NSS_ERROR);
+ }
+
+ /*
+ * We found something on our first pass. Make sure that we do
+ * not clobber this information. This ultimately means that we
+ * were successful.
+ */
+ if (pass2 == 2)
+ goto out;
+
+ if (pass2 == 1 || flags == 0 || family == AF_INET ||
+ (family == AF_INET6 && !(flags & AI_V4MAPPED))) {
pbuf->p_herrno = HOST_NOT_FOUND;
pbuf->p_status = NSS_NOTFOUND;
pbuf->data_len = 0;
res_ndestroy(statp);
return (NSS_NOTFOUND);
}
- /* else lookup error - handle in general code */
- res_ndestroy(statp);
- return (NSS_ERROR);
+ if ((flags & AI_ADDRCONFIG) && !(flags & AI_ALL) &&
+ has_v4 == 0) {
+ pbuf->p_herrno = HOST_NOT_FOUND;
+ pbuf->p_status = NSS_NOTFOUND;
+ pbuf->data_len = 0;
+ res_ndestroy(statp);
+ return (NSS_NOTFOUND);
+ }
+ qtype = T_A;
+ flags = 0;
+ pass2 = 1;
+ goto searchagain;
}
cp = resbuf.buf;
@@ -579,6 +724,15 @@ _nss_dns_gethost_withttl(void *buffer, size_t bufsize, int ipnode)
*bptr++ = '\n';
blen++;
}
+
+ /* Depending on our flags we may need to go back another time. */
+ if (qtype == T_AAAA && family == AF_INET6 &&
+ ((flags & AI_V4MAPPED) != 0) && ((flags & AI_ALL) != 0) && has_v4) {
+ qtype = T_A;
+ pass2 = 2; /* Indicate that we found data this pass */
+ goto searchagain;
+ }
+
/* Presumably the buffer is now filled. */
len = ROUND_UP(blen, sizeof (nssuint_t));
/* still room? */
@@ -587,6 +741,7 @@ _nss_dns_gethost_withttl(void *buffer, size_t bufsize, int ipnode)
res_ndestroy(statp);
return (NSS_ERROR);
}
+out:
pbuf->ext_off = pbuf->data_off + len;
pbuf->ext_len = sizeof (nssuint_t);
pbuf->data_len = blen;
diff --git a/usr/src/lib/nsswitch/dns/common/dns_common.h b/usr/src/lib/nsswitch/dns/common/dns_common.h
index 717f56d70f..83d486cf57 100644
--- a/usr/src/lib/nsswitch/dns/common/dns_common.h
+++ b/usr/src/lib/nsswitch/dns/common/dns_common.h
@@ -31,8 +31,6 @@
#ifndef _DNS_COMMON_H
#define _DNS_COMMON_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
@@ -43,7 +41,7 @@
#include <thread.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
-#include <resolv.h>
+#include <resolv_joy.h>
#include <syslog.h>
#include <nsswitch.h>
#include <nss_common.h>
diff --git a/usr/src/lib/nsswitch/dns/common/dns_mt.c b/usr/src/lib/nsswitch/dns/common/dns_mt.c
index 128b1bde75..4af3f671c0 100644
--- a/usr/src/lib/nsswitch/dns/common/dns_mt.c
+++ b/usr/src/lib/nsswitch/dns/common/dns_mt.c
@@ -23,8 +23,9 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
/*
* dns_mt.c
@@ -49,52 +50,41 @@
static void _nss_dns_init(void);
extern struct hostent *res_gethostbyname(const char *);
-#pragma weak res_gethostbyname
-#define RES_SET_NO_HOSTS_FALLBACK "__res_set_no_hosts_fallback"
-extern void __res_set_no_hosts_fallback(void);
-#pragma weak __res_set_no_hosts_fallback
+#define RES_SET_NO_HOSTS_FALLBACK "__joy_res_set_no_hosts_fallback"
+extern void __joy_res_set_no_hosts_fallback(void);
-#define RES_UNSET_NO_HOSTS_FALLBACK "__res_unset_no_hosts_fallback"
-extern void __res_unset_no_hosts_fallback(void);
-#pragma weak __res_unset_no_hosts_fallback
+#define RES_UNSET_NO_HOSTS_FALLBACK "__joy_res_unset_no_hosts_fallback"
+extern void __joy_res_unset_no_hosts_fallback(void);
#define RES_GET_RES "__res_get_res"
extern struct __res_state *__res_get_res(void);
-#pragma weak __res_get_res
#define RES_ENABLE_MT "__res_enable_mt"
extern int __res_enable_mt(void);
-#pragma weak __res_enable_mt
#define RES_DISABLE_MT "__res_disable_mt"
extern int __res_disable_mt(void);
-#pragma weak __res_disable_mt
#define RES_GET_H_ERRNO "__res_get_h_errno"
extern int *__res_get_h_errno();
-#pragma weak __res_get_h_errno
-#define __H_ERRNO "__h_errno"
-extern int *__h_errno(void);
-#pragma weak __h_errno
+#define __H_ERRNO "__joy_h_errno"
+extern int *__joy_h_errno(void);
-#define RES_OVERRIDE_RETRY "__res_override_retry"
-extern int __res_override_retry(int);
-#pragma weak __res_override_retry
+#define RES_OVERRIDE_RETRY "__joy_res_override_retry"
+extern int __joy_res_override_retry(int);
static void __fallback_set_no_hosts(void);
-static int *__fallback_h_errno(void);
-static int __fallback_override_retry(int);
static int __is_mt_safe(void);
void (*set_no_hosts_fallback)(void) = __fallback_set_no_hosts;
void (*unset_no_hosts_fallback)(void) = __fallback_set_no_hosts;
struct __res_state *(*set_res_retry)() = 0;
-int (*enable_mt)() = 0;
-int (*disable_mt)() = 0;
-int *(*get_h_errno)(void) = 0;
-int (*override_retry)(int) = 0;
+int (*enable_mt)() = __is_mt_safe;
+int (*disable_mt)() = __is_mt_safe;
+int *(*get_h_errno)(void) = __joy_h_errno;
+int (*override_retry)(int) = __joy_res_override_retry;
/* Usually set from the Makefile */
#ifndef NSS_DNS_LIBRESOLV
@@ -106,91 +96,12 @@ extern int h_errno;
mutex_t one_lane = DEFAULTMUTEX;
+/* Because we link against libresolv_joy.so.2, this is relatively easy. */
void
_nss_dns_init(void)
{
- void *reslib, (*f_void_ptr)();
-
- /* If no libresolv library, then load one */
- if (res_gethostbyname == 0) {
- if ((reslib =
- dlopen(NSS_DNS_LIBRESOLV, RTLD_LAZY|RTLD_GLOBAL)) != 0) {
- /* Turn off /etc/hosts fall back in libresolv */
- if ((f_void_ptr = (void (*)(void))dlsym(reslib,
- RES_SET_NO_HOSTS_FALLBACK)) != 0) {
- set_no_hosts_fallback = f_void_ptr;
- }
- if ((f_void_ptr = (void (*)(void))dlsym(reslib,
- RES_SET_NO_HOSTS_FALLBACK)) != 0) {
- unset_no_hosts_fallback = f_void_ptr;
- }
- /* Set number of resolver retries */
- if ((override_retry = (int (*)(int))dlsym(reslib,
- RES_OVERRIDE_RETRY)) == 0) {
- set_res_retry =
- (struct __res_state *(*)(void))dlsym(reslib,
- RES_GET_RES);
- override_retry = __fallback_override_retry;
- }
- /*
- * Select h_errno retrieval function. A BIND 8.2.2
- * libresolv.so.2 will have __h_errno, a BIND 8.1.2
- * one will have __res_get_h_errno, and other
- * versions may have nothing at all.
- *
- * Also try to bind to the relevant MT enable/disable
- * functions which are also dependent on the version
- * of the BIND libresolv.so.2 being used.
- */
- if ((get_h_errno = (int *(*)(void))dlsym(reslib,
- __H_ERRNO)) != 0) {
- /* BIND 8.2.2 libresolv.so.2 is MT safe. */
- enable_mt = __is_mt_safe;
- disable_mt = __is_mt_safe;
- } else {
- if ((get_h_errno =
- (int *(*)(void))dlsym(reslib,
- RES_GET_H_ERRNO)) == 0) {
- get_h_errno = __fallback_h_errno;
- }
- /*
- * Pre-BIND 8.2.2 was not MT safe. Try to
- * bind the MT enable/disable functions.
- */
- if ((enable_mt = (int (*)(void))dlsym(reslib,
- RES_ENABLE_MT)) != 0 &&
- (disable_mt = (int (*)(void))dlsym(reslib,
- RES_DISABLE_MT)) == 0) {
- enable_mt = 0;
- }
- }
- }
- } else {
- /* Libresolv already loaded */
- if ((f_void_ptr = __res_set_no_hosts_fallback) != 0) {
- set_no_hosts_fallback = f_void_ptr;
- }
- if ((f_void_ptr = __res_unset_no_hosts_fallback) != 0) {
- unset_no_hosts_fallback = f_void_ptr;
- }
- if ((override_retry = __res_override_retry) == 0) {
- set_res_retry = __res_get_res;
- override_retry = __fallback_override_retry;
- }
- if ((get_h_errno = __h_errno) == 0 &&
- (get_h_errno = __res_get_h_errno) == 0) {
- get_h_errno = __fallback_h_errno;
- }
- if (get_h_errno == __h_errno) {
- enable_mt = __is_mt_safe;
- disable_mt = __is_mt_safe;
- } else {
- if ((enable_mt = __res_enable_mt) != 0 &&
- (disable_mt = __res_disable_mt) == 0) {
- enable_mt = 0;
- }
- }
- }
+ enable_mt = __is_mt_safe;
+ disable_mt = __is_mt_safe;
}
@@ -228,36 +139,6 @@ __is_mt_safe(void) {
}
-/*
- * Return pointer to the global h_errno variable
- */
-static int *
-__fallback_h_errno(void) {
- return (&h_errno);
-}
-
-
-/*
- * This function is called when the resolver library doesn't provide its
- * own function to establish an override retry. If we can get a pointer
- * to the per-thread _res (i.e., set_res_retry != 0), we set the retries
- * directly, and return the previous number of retries. Otherwise, there's
- * nothing to do.
- */
-static int
-__fallback_override_retry(int retry) {
- struct __res_state *res;
- int old_retry = 0;
-
- if (set_res_retry != 0) {
- res = set_res_retry();
- old_retry = res->retry;
- res->retry = retry;
- }
- return (old_retry);
-}
-
-
static void
__fallback_set_no_hosts(void) {
}
diff --git a/usr/src/lib/nsswitch/dns/common/gethostent.c b/usr/src/lib/nsswitch/dns/common/gethostent.c
index 648ea8ba01..d321dd24c6 100644
--- a/usr/src/lib/nsswitch/dns/common/gethostent.c
+++ b/usr/src/lib/nsswitch/dns/common/gethostent.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* gethostent.c
*
@@ -53,12 +51,6 @@ static struct hostent *_gethostbyaddr(int *h_errnop, const char *addr,
int len, int type);
struct hostent *_nss_dns_gethostbyname2(int *h_errnop, const char *name);
-#pragma weak res_gethostbyname
-#pragma weak res_gethostbyname2
-#pragma weak res_gethostbyaddr
-#pragma weak res_sethostent
-#pragma weak res_endhostent
-
nss_backend_t *_nss_dns_constr(dns_backend_op_t ops[], int n_ops);
nss_status_t __nss_dns_getbyaddr(dns_backend_ptr_t, void *);
diff --git a/usr/src/lib/nsswitch/dns/common/gethostent6.c b/usr/src/lib/nsswitch/dns/common/gethostent6.c
index ee85832073..f3efc4eae6 100644
--- a/usr/src/lib/nsswitch/dns/common/gethostent6.c
+++ b/usr/src/lib/nsswitch/dns/common/gethostent6.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* This is the DNS backend for IPv6 addresses.
* getbyname() is a local routine, but getbyaddr() actually shares the
@@ -50,8 +48,6 @@
*/
-#pragma weak res_endhostent
-
extern struct hostent *_gethostbyname(int *, const char *);
extern struct hostent *_nss_dns_gethostbyname2(int *, const char *);
diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com b/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com
index 020051c977..7345ddc892 100644
--- a/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com
+++ b/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com
@@ -73,7 +73,7 @@ TSSLIB=-L$(TSPILIBDIR)
TSSLIB64=-L$(TSPILIBDIR)/$(MACH64)
TSSINC=-I$(TSPIINCDIR)
-LDLIBS += $(TSSLIB) -L$(ADJUNCT_PROTO)/lib -lc -luuid -lmd -ltspi -lcrypto
+LDLIBS += $(TSSLIB) -L$(ADJUNCT_PROTO)/lib -lc -luuid -lmd -ltspi -lsunw_crypto
CPPFLAGS += -xCC -D_POSIX_PTHREAD_SEMANTICS $(TSSINC)
CPPFLAGS64 += $(CPPFLAGS)
C99MODE= $(C99_ENABLE)
diff --git a/usr/src/lib/print/mod_ipp/Makefile b/usr/src/lib/print/mod_ipp/Makefile
index 8d6500fb41..137e88bbf8 100644
--- a/usr/src/lib/print/mod_ipp/Makefile
+++ b/usr/src/lib/print/mod_ipp/Makefile
@@ -48,7 +48,7 @@ SRCS = $(OBJECTS:%.o = %.c)
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -I../libipp-listener/common
CPPFLAGS += -I../libipp-core/common
-CPPFLAGS += -I/usr/apache/include
+CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/apache/include
CPPFLAGS += -DEAPI
ZDEFS = $(ZNODEFS)
diff --git a/usr/src/lib/pysolaris/Makefile.com b/usr/src/lib/pysolaris/Makefile.com
index 28d68704f9..a6194a9a2a 100644
--- a/usr/src/lib/pysolaris/Makefile.com
+++ b/usr/src/lib/pysolaris/Makefile.com
@@ -44,6 +44,7 @@ C99LMODE= -Xc99=%all
LIBS = $(DYNLIB)
LDLIBS += -lc -lsec -lidmap -lpython2.6
CFLAGS += $(CCVERBOSE)
+CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/python2.6
CERRWARN += -_gcc=-Wno-unused-variable
CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/python2.6
diff --git a/usr/src/man/man1/Makefile b/usr/src/man/man1/Makefile
index 185a34c857..c87388e5f6 100644
--- a/usr/src/man/man1/Makefile
+++ b/usr/src/man/man1/Makefile
@@ -73,6 +73,7 @@ MANFILES= acctcom.1 \
clear.1 \
cmp.1 \
col.1 \
+ column.1 \
comm.1 \
command.1 \
compress.1 \
diff --git a/usr/src/man/man1/column.1 b/usr/src/man/man1/column.1
new file mode 100644
index 0000000000..38d9af86c5
--- /dev/null
+++ b/usr/src/man/man1/column.1
@@ -0,0 +1,129 @@
+.\" Copyright (c) 1989, 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)column.1 8.1 (Berkeley) 6/6/93
+.\" $FreeBSD$
+.\"
+.\" Portions Copyright (c) 2013 Joyent, Inc. All rights reserved.
+.\"
+.TH COLUMN 1 "Jan 10, 2013"
+.SH NAME
+column \- columnate lists
+.SH SYNOPSIS
+.LP
+.nf
+\fBcolumn\fR [\fB-tx\fR] [\fB-c\fR \fIcolumns\fR] [\fB-s\fR \fIsep\fR] [\fIfile\fR ... ]
+.fi
+
+.Sh DESCRIPTION
+.sp
+.LP
+The \fBcolumn\fR
+utility formats its input into multiple columns.
+Rows are filled before columns.
+Input is taken from
+\fIfile\fR
+operands, or, by default, from the standard input.
+Empty lines are ignored.
+.SH OPTIONS
+.sp
+.LP
+The options are as follows:
+.sp
+.ne 2
+.na
+\fB\fB-c\fR \fIcolumns\fR\fR
+.ad
+.RS 17n
+Output is formatted for a display \fIcolumns\fR
+wide.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-s\fR \fIsep\fR\fR
+.ad
+.RS 17n
+Specify a set of characters to be used to delimit columns for the
+\fB-t\fR option.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-t\fR\fR
+.ad
+.RS 17n
+Determine the number of columns the input contains and create a table.
+Columns are delimited with whitespace, by default, or with the characters
+supplied using the \fBs\fR
+option.
+Useful for pretty-printing displays.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-x\fR
+.ad
+.RS 17n
+Fill columns before filling rows.
+.RE
+
+.SH ENVIRONMENT
+The COLUMNS , LANG , LC_ALL
+and
+LC_CTYPE
+environment variables affect the execution of
+\fBcolumn\fR
+as described in
+\fBenviron\fR(5).
+
+.SH EXIT STATUS
+The \fBcolumn\fR utility exits 0 on success and >0 if an error occurs.
+
+.SH EXAMPLES
+.sp
+.in +2
+.nf
+(printf \&"PERM LINKS OWNER GROUP SIZE MONTH DAY \&"\ \&;\ \&\e
+printf \&"HH:MM/YEAR NAME\en\&"\ \&;\ \&\e
+ls -l \&| sed 1d) \&| column -t
+.fi
+.in -2
+.sp
+
+
+.SH SEE ALSO
+\fBls\fR(1), \fBpaste\fR(1), \fBsort\fR(1)
+
+.SH HISTORY
+The \fBcolumn\fR command appeared in 4.3BSD-Reno.
+
+.SH BUGS
+Input lines are limited to LINE_MAX bytes in length.
diff --git a/usr/src/man/man1/crontab.1 b/usr/src/man/man1/crontab.1
index c93255f406..927b5345c4 100644
--- a/usr/src/man/man1/crontab.1
+++ b/usr/src/man/man1/crontab.1
@@ -1,6 +1,7 @@
'\" te
.\" Copyright 1989 AT&T
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
@@ -10,7 +11,7 @@
.\" 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]
-.TH CRONTAB 1 "Apr 6, 2009"
+.TH CRONTAB 1 "Sep 23, 2013"
.SH NAME
crontab \- user crontab file
.SH SYNOPSIS
@@ -26,7 +27,7 @@ crontab \- user crontab file
.LP
.nf
-\fB/usr/bin/crontab\fR \fB-l\fR [\fIusername\fR]
+\fB/usr/bin/crontab\fR \fB-l\fR [\fB-g\fR] [\fIusername\fR]
.fi
.LP
@@ -46,7 +47,7 @@ crontab \- user crontab file
.LP
.nf
-\fB/usr/xpg4/bin/crontab\fR \fB-l\fR [\fIusername\fR]
+\fB/usr/xpg4/bin/crontab\fR \fB-l\fR [\fB-g\fR] [\fIusername\fR]
.fi
.LP
@@ -66,7 +67,7 @@ crontab \- user crontab file
.LP
.nf
-\fB/usr/xpg6/bin/crontab\fR \fB-l\fR [\fIusername\fR]
+\fB/usr/xpg6/bin/crontab\fR \fB-l\fR [\fB-g\fR] [\fIusername\fR]
.fi
.LP
@@ -86,6 +87,17 @@ users' crontabs.
.LP
If \fBcrontab\fR is invoked with \fIfilename\fR, this overwrites an existing
\fBcrontab\fR entry for the user that invokes it.
+.sp
+.LP
+Cron supports a merged crontab with entries coming from either the user's
+\fB/var/spool/cron/crontabs\fR file or from the user's
+\fB/etc/cron.d/crontabs\fR file. The entries in the user's
+\fB/var/spool/cron/crontabs\fR file are editable whereas those in
+\fB/etc/cron.d/crontabs\fR are system-defined entries which may not
+be customized by the user. The dual set of crontab entries is only
+of interest to system-defined users such as \fBroot\fR. Except where
+otherwise explicitly indicated, all variants of the \fBcrontab\fR command
+act only on the editable crontab files found in \fB/var/spool/cron/crontabs\fR.
.SS "\fBcrontab\fR Access Control"
.sp
.LP
@@ -343,6 +355,9 @@ file using the \fB-r\fR option.
If \fIusername\fR is specified, the specified user's \fBcrontab\fR file is
edited, rather than the current user's \fBcrontab\fR file. This can only be
done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
+.sp
+Only the entries in the user's \fB/var/spool/cron/crontabs\fR file are
+editable.
.RE
.sp
@@ -354,6 +369,22 @@ done by root or by a user with the \fBsolaris.jobs.admin\fR authorization.
Lists the \fBcrontab\fR file for the invoking user. Only root or a user with
the \fBsolaris.jobs.admin\fR authorization can specify a username following the
\fB-l\fR option to list the \fBcrontab\fR file of the specified user.
+.sp
+Entries from the user's \fB/var/spool/cron/crontabs\fR file are listed, unless
+the \fB-g\fR option is given, in which case only entries from the user's
+\fB/etc/cron.d/crontabs\fR file are listed.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-g\fR\fR
+.ad
+.RS 6n
+In conjunction with the \fB-l\fR option, lists the global \fBcrontab\fR file
+for the invoking or specified user (if authorized) instead of the editable
+\fBcrontab\fR file. This option is not valid unless the \fB-l\fR option is
+also given.
.RE
.sp
@@ -583,6 +614,17 @@ list of denied users
.sp
.ne 2
.na
+\fB\fB/etc/cron.d/crontabs\fR\fR
+.ad
+.RS 28n
+.rt
+system spool area for \fBcrontab\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fB/var/cron/log\fR\fR
.ad
.RS 28n
diff --git a/usr/src/man/man1/ld.1 b/usr/src/man/man1/ld.1
index 1e62d8203f..afc6a8d1ce 100644
--- a/usr/src/man/man1/ld.1
+++ b/usr/src/man/man1/ld.1
@@ -24,7 +24,7 @@ ld \- link-editor for object files
[\fB-z\fR combreloc | nocombreloc ] [\fB-z\fR defs | nodefs]
[\fB-z\fR direct | nodirect] [\fB-z\fR endfiltee]
[\fB-z\fR fatal-warnings | nofatal-warnings ] [\fB-z\fR finiarray=\fIfunction\fR]
-[\fB-z\fR globalaudit] [\fB-z\fR groupperm | nogroupperm]
+[\fB-z\fR globalaudit] [\fB-z\fR groupperm | nogroupperm] [\fB-z\fR help ]
[\fB-z\fR guidance[=\fIid1\fR,\fIid2\fR...] [\fB-z\fR help ]
[\fB-z\fR ignore | record] [\fB-z\fR initarray=\fIfunction\fR] [\fB-z\fR initfirst]
[\fB-z\fR interpose] [\fB-z\fR lazyload | nolazyload]
diff --git a/usr/src/man/man1/nawk.1 b/usr/src/man/man1/nawk.1
index 425db5d299..2c27e1baa0 100644
--- a/usr/src/man/man1/nawk.1
+++ b/usr/src/man/man1/nawk.1
@@ -15,6 +15,12 @@ nawk \- pattern scanning and processing language
.SH SYNOPSIS
.LP
.nf
+\fB/usr/bin/awk\fR [\fB-F\fR \fIERE\fR] [\fB-v\fR \fIassignment\fR] \fI\&'program'\fR | \fB-f\fR \fIprogfile\fR...
+ [\fIargument\fR]...
+.fi
+
+.LP
+.nf
\fB/usr/bin/nawk\fR [\fB-F\fR \fIERE\fR] [\fB-v\fR \fIassignment\fR] \fI\&'program'\fR | \fB-f\fR \fIprogfile\fR...
[\fIargument\fR]...
.fi
@@ -28,7 +34,8 @@ nawk \- pattern scanning and processing language
.SH DESCRIPTION
.sp
.LP
-The \fB/usr/bin/nawk\fR and \fB/usr/xpg4/bin/awk\fR utilities execute
+The \fB/usr/bin/awk\fR, \fB/usr/bin/nawk\fR and \fB/usr/xpg4/bin/awk\fR
+utilities execute
\fIprogram\fRs written in the \fBnawk\fR programming language, which is
specialized for textual data manipulation. A \fBnawk\fR \fIprogram\fR is a
sequence of patterns and corresponding actions. The string specifying
diff --git a/usr/src/man/man1/proc.1 b/usr/src/man/man1/proc.1
index cd20e215e3..bf0e588012 100644
--- a/usr/src/man/man1/proc.1
+++ b/usr/src/man/man1/proc.1
@@ -2,10 +2,11 @@
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" Portions Copyright 2008 Chad Mynhier
.\" Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+.\" Copyright 2013 (c) Joyent, Inc. All rights reserved.
.\" 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]
-.TH PROC 1 "Oct 23, 2012"
+.TH PROC 1 "Apr 01, 2013"
.SH NAME
proc, pflags, pcred, pldd, psig, pstack, pfiles, pwdx, pstop, prun, pwait,
ptime \- proc tools
@@ -72,7 +73,7 @@ ptime \- proc tools
.LP
.nf
-\fB/usr/bin/ptime\fR [\fB-Fm\fR] [\fB-p\fR] \fIpid\fR...
+\fB/usr/bin/ptime\fR [\fB-Fm\fR] \fB-p pidlist\fR
.fi
.LP
@@ -215,8 +216,10 @@ Time the \fIcommand\fR, like \fBtime\fR(1), but using microstate accounting for
reproducible precision. Unlike \fBtime\fR(1), children of the command are not
timed.
.sp
-If the \fB-p\fR \fIpid\fR version is used, display a snapshot of timing
-statistics for the specified \fIpid\fR.
+If the \fB-p\fR \fIpidlist\fR version is used, display a snapshot of timing
+statistics for the specified processes. The \fIpidlist\fR may either be a comma
+delineated list or a space delineated list. Space delineated lists must be
+properly quoted to assure that they are in a single argument.
.RE
.SH OPTIONS
diff --git a/usr/src/man/man1/ps.1 b/usr/src/man/man1/ps.1
index 7ff574f12b..2b0d435c44 100644
--- a/usr/src/man/man1/ps.1
+++ b/usr/src/man/man1/ps.1
@@ -38,6 +38,9 @@ displayed is controlled by the options.
Some options accept lists as arguments. Items in a list can be either separated
by commas or else enclosed in quotes and separated by commas or spaces. Values
for \fIproclist\fR and \fIgrplist\fR must be numeric.
+.sp
+.LP
+The \fBps\fR command also accepts BSD-style options. See \fBps\fR(1b).
.SH OPTIONS
.sp
.LP
@@ -1311,7 +1314,8 @@ Standard See \fBstandards\fR(5).
.sp
.LP
\fBkill\fR(1), \fBlgrpinfo\fR(1), \fBnice\fR(1), \fBpagesize\fR(1),
-\fBpmap\fR(1), \fBpriocntl\fR(1), \fBwho\fR(1), \fBgetty\fR(1M), \fBproc\fR(4),
+\fBpmap\fR(1), \fBpriocntl\fR(1), \fBps\fR(1b), \fBwho\fR(1), \fBgetty\fR(1M),
+\fBproc\fR(4),
\fBttysrch\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
\fBresource_controls\fR(5), \fBstandards\fR(5), \fBzones\fR(5)
.SH NOTES
diff --git a/usr/src/man/man1/sed.1 b/usr/src/man/man1/sed.1
index ded1c15fa3..9ec2b67dd9 100644
--- a/usr/src/man/man1/sed.1
+++ b/usr/src/man/man1/sed.1
@@ -1,8 +1,6 @@
.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
-.\" Copyright 2011 Nexenta Systems, Inc. All rights reserved.
-.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
@@ -30,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.TH SED 1 "Nov 2, 2011"
+.TH SED 1 "May 24, 2009"
.SH NAME
\fBsed\fP
\- stream editor
@@ -45,7 +43,8 @@
[\fB\-Ealnr\fP]
[\fB\-e\fP \fIcommand\fP]
[\fB\-f\fP \fIcommand_file\fP]
-[\fB\-I\fP[\fIextension\fP] | \fB\-i\fP[\fIextension\fP]]
+[\fB\-I\fP \fIextension\fP]
+[\fB\-i\fP \fIextension\fP]
[\fIfile ...\fP]
.SH DESCRIPTION
The
@@ -98,11 +97,16 @@ Append the editing commands found in the file
to the list of commands.
The editing commands should each be listed on a separate line.
.TP
-\fB\-I\fP[\fIextension\fP]
-Edit files in-place, saving backups if \fIextension\fP was specified.
-It is not recommended to omit saving backups when in-place editing files,
-as you risk corruption or partial content in situations where disk
-space is exhausted, etc.
+\fB\-I\fP \fIextension\fP
+Edit files in-place, saving backups with the specified
+\fIextension\fP.
+If a zero-length
+\fIextension\fP
+is given, no backup will be saved.
+It is not recommended to give a zero-length
+\fIextension\fP
+when in-place editing files, as you risk corruption or partial content
+in situations where disk space is exhausted, etc.
Note that in-place editing with
\fB\-I\fP
@@ -120,7 +124,7 @@ where using
\fB\-i\fP
is desired.
.TP
-\fB\-i\fP[\fIextension\fP]
+\fB\-i\fP \fIextension\fP
Edit files in-place similarly to
\fB\-I\fP,
but treat each file independently from other files.
diff --git a/usr/src/man/man1m/Makefile b/usr/src/man/man1m/Makefile
index 9510504781..b3b9bdc02c 100644
--- a/usr/src/man/man1m/Makefile
+++ b/usr/src/man/man1m/Makefile
@@ -13,9 +13,10 @@
# Copyright 2011, Richard Lowe
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
#
-include $(SRC)//Makefile.master
+include $(SRC)//Makefile.master
MANSECT= 1m
diff --git a/usr/src/man/man1m/dladm.1m b/usr/src/man/man1m/dladm.1m
index bf20443ad8..cc4ba921db 100644
--- a/usr/src/man/man1m/dladm.1m
+++ b/usr/src/man/man1m/dladm.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
.\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
.\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
@@ -15,7 +16,7 @@ dladm \- administer data links
.LP
.nf
\fBdladm show-link\fR [\fB-P\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [[\fB-p\fR] \fB-o\fR \fIfield\fR[,...]] [\fIlink\fR]
-\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] \fIlink\fR \fInew-link\fR
+\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIlink\fR \fInew-link\fR
.fi
.LP
@@ -98,9 +99,11 @@ dladm \- administer data links
.LP
.nf
-\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIlink\fR
-\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR \fIprop\fR[,...]] \fIlink\fR
-\fBdladm show-linkprop\fR [\fB-P\fR] [[\fB-c\fR] \fB-o\fR \fIfield\fR[,...]] [\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]
+\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...]
+ \fIlink\fR
+\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] [\fB-p\fR \fIprop\fR[,...]] \fIlink\fR
+\fBdladm show-linkprop\fR [\fB-P\fR] [\fB-z\fR \fIzonename\fR] [[\fB-c\fR] \fB-o\fR \fIfield\fR[,...]]
+ [\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]
.fi
.LP
@@ -115,9 +118,9 @@ dladm \- administer data links
\fBdladm create-vnic\fR [\fB-t\fR] \fB-l\fR \fIlink\fR [\fB-R\fR \fIroot-dir\fR] [\fB-m\fR \fIvalue\fR | auto |
{factory \fB-n\fR \fIslot-identifier\fR]} | {random [\fB-r\fR \fIprefix\fR]}]
[\fB-v\fR \fIvlan-id\fR] [\fB-p\fR \fIprop\fR=\fIvalue\fR[,...]] \fIvnic-link\fR
-\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fIvnic-link\fR
+\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIvnic-link\fR
\fBdladm show-vnic\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]]
- [\fB-l\fR \fIlink\fR] [\fIvnic-link\fR]
+ [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIvnic-link\fR]
.fi
.LP
@@ -570,8 +573,7 @@ will be displayed only once.
.sp
.ne 2
.na
-\fB\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] \fIlink\fR
-\fInew-link\fR\fR
+\fB\fBdladm rename-link\fR [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIlink\fR \fInew-link\fR\fR
.ad
.sp .6
.RS 4n
@@ -589,6 +591,17 @@ examples of how this subcommand is used.
See "Options," above.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+A link assigned to a zone can only be renamed while the zone is in the ready state.
+.RE
+
.RE
.sp
@@ -3135,8 +3148,7 @@ Extended output is displayed for \fBPTYPE\fR values of \fBcurrent\fR,
.sp
.ne 2
.na
-\fB\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-p\fR
-\fIprop\fR=\fIvalue\fR[,...] \fIlink\fR\fR
+\fB\fBdladm set-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIlink\fR\fR
.ad
.sp .6
.RS 4n
@@ -3168,6 +3180,17 @@ See "Options," above.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonenme\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fB-p\fR \fIprop\fR=\fIvalue\fR[,...], \fB--prop\fR
\fIprop\fR=\fIvalue\fR[,...]\fR
.ad
@@ -3187,8 +3210,7 @@ same value.
.sp
.ne 2
.na
-\fB\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-p\fR
-\fIprop\fR,...] \fIlink\fR\fR
+\fB\fBdladm reset-linkprop\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] [\fB-p\fR \fIprop\fR,...] \fIlink\fR\fR
.ad
.sp .6
.RS 4n
@@ -3220,6 +3242,17 @@ See "Options," above.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonenme\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fB-p\fR \fIprop, ...\fR, \fB--prop\fR=\fIprop, ...\fR\fR
.ad
.sp .6
@@ -3234,8 +3267,7 @@ the same value.
.sp
.ne 2
.na
-\fB\fBdladm show-linkprop\fR [\fB-P\fR] [[\fB-c\fR] \fB-o\fR
-\fIfield\fR[,...]][\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]\fR
+\fB\fBdladm show-linkprop\fR [\fB-P\fR] [\fB-z\fR \fIzonename\fR] [[\fB-c\fR] \fB-o\fR \fIfield\fR[,...]][\fB-p\fR \fIprop\fR[,...]] [\fIlink\fR]\fR
.ad
.sp .6
.RS 4n
@@ -3353,6 +3385,17 @@ Display persistent link property information
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonenme\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fB-p\fR \fIprop, ...\fR, \fB--prop\fR=\fIprop, ...\fR\fR
.ad
.sp .6
@@ -3670,8 +3713,7 @@ A comma-separated list of properties to set to the specified values.
.sp
.ne 2
.na
-\fB\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR]
-\fIvnic-link\fR\fR
+\fB\fBdladm delete-vnic\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fIvnic-link\fR\fR
.ad
.sp .6
.RS 4n
@@ -3697,13 +3739,23 @@ next reboot.
See "Options," above.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIzonenme\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
.RE
.sp
.ne 2
.na
-\fB\fBdladm show-vnic\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
-[\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIvnic-link\fR]\fR
+\fB\fBdladm show-vnic\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIvnic-link\fR]\fR
.ad
.sp .6
.RS 4n
@@ -3846,6 +3898,17 @@ will be displayed only once.
Display information for all VNICs on the named link.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIzonenme\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
.RE
.sp
@@ -4369,6 +4432,20 @@ The following general link properties are supported:
.sp
.ne 2
.na
+\fB\fBallowed-ips\fR\fR
+.ad
+.sp .6
+.RS 4n
+A comma-seperated list of IP addresses that are allowed on the interface.
+.sp
+An address in CIDR format with no host address specified is used to indicate
+that any address on that subnet is allowed (e.g. 192.168.10.0/24 means any
+address in the range 192.168.10.0 - 192.168.10.255 is allowed).
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBautopush\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man1m/flowadm.1m b/usr/src/man/man1m/flowadm.1m
index b12ce6af96..a64a703612 100644
--- a/usr/src/man/man1m/flowadm.1m
+++ b/usr/src/man/man1m/flowadm.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved
.\" 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]
@@ -11,14 +12,14 @@ services, containers, and virtual machines
.LP
.nf
\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-S\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-l\fR \fIlink\fR]
- [\fB-o\fR \fIfield\fR[,...]] [\fIflow\fR]
+ [\fB-o\fR \fIfield\fR[,...]] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]
.fi
.LP
.nf
-\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...]
- \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
-\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
+\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR \fIlink\fR
+ \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR
+\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] {\fB-l\fR \fIlink\fR | \fIflow\fR}
.fi
.LP
@@ -77,8 +78,7 @@ The following subcommands are supported:
.sp
.ne 2
.na
-\fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]]
-[\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fIflow\fR]\fR
+\fB\fBflowadm show-flow\fR [\fB-pP\fR] [\fB-s\fR [\fB-i\fR \fIinterval\fR]] [\fB-o\fR \fIfield\fR[,...]] [\fB-l\fR \fIlink\fR] [\fB-z\fR \fIzonename\fR] [\fIflow\fR]\fR
.ad
.sp .6
.RS 4n
@@ -223,14 +223,23 @@ Display information for all flows on the named link or information for the
named flow.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
.RE
.sp
.ne 2
.na
-\fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
-\fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR
-\fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
+\fB\fBflowadm add-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR \fIlink\fR \fB-a\fR \fIattr\fR=\fIvalue\fR[,...] \fB-p\fR \fIprop\fR=\fIvalue\fR[,...] \fIflow\fR\fR
.ad
.sp .6
.RS 4n
@@ -268,6 +277,17 @@ persistent creation.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fB-l\fR \fIlink\fR, \fB--link\fR=\fIlink\fR\fR
.ad
.sp .6
@@ -300,8 +320,7 @@ A comma-separated list of properties to be set to the specified values.
.sp
.ne 2
.na
-\fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] \fB-l\fR
-{\fIlink\fR | \fIflow\fR}\fR
+\fB\fBflowadm remove-flow\fR [\fB-t\fR] [\fB-R\fR \fIroot-dir\fR] [\fB-z\fR \fIzonename\fR] \fB-l\fR {\fIlink\fR | \fIflow\fR}\fR
.ad
.sp .6
.RS 4n
@@ -331,6 +350,17 @@ persistent removal.
.sp
.ne 2
.na
+\fB\fB-z\fR \fIzonename\fR
+.ad
+.sp .6
+.RS 4n
+Operate on a link that has been delegated to the specified zone.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fB-l\fR \fIlink\fR | \fIflow\fR, \fB--link\fR=\fIlink\fR | \fIflow\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man1m/ipf.1m b/usr/src/man/man1m/ipf.1m
index 69cdacf689..93267db577 100644
--- a/usr/src/man/man1m/ipf.1m
+++ b/usr/src/man/man1m/ipf.1m
@@ -2,15 +2,16 @@
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2009, Sun Microsystems Inc. All Rights Reserved.
-.TH IPF 1M "Feb 25, 2009"
+.\" Portions Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
+.TH IPF 1M "Oct 30, 2013"
.SH NAME
ipf \- alter packet filtering lists for IP packet input and output
.SH SYNOPSIS
.LP
.nf
-\fBipf\fR [\fB-6AdDEInoPRrsvVyzZ\fR] [\fB-l\fR block | pass | nomatch]
+\fBipf\fR [\fB-6AdDEGInoPRrsvVyzZ\fR] [\fB-l\fR block | pass | nomatch]
[\fB-T\fR \fIoptionlist\fR] [\fB-F\fR i | o | a | s | S] \fB-f\fR \fIfilename\fR
- [\fB-f\fR \fIfilename\fR...]
+ [\fB-f\fR \fIfilename\fR...] [\fIzonename\fR]
.fi
.SH DESCRIPTION
@@ -257,6 +258,17 @@ packet filter rule lists.
.sp
.ne 2
.na
+\fB\fB-G\fR\fR
+.ad
+.sp .6
+.RS 4n
+Make changes to the Global Zone-controlled ipfilter for the zone given as an
+argument. See the \fBZONES\fR section for more information.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-I\fR\fR
.ad
.sp .6
@@ -459,6 +471,22 @@ Zero global statistics held in the kernel for filtering only. This does not
affect fragment or state statistics.
.RE
+.SH ZONES
+.sp
+.LP
+Each non-global zone has two ipfilter instances: the in-zone ipfilter, which
+can be controlled from both the zone itself and the global zone, and the
+Global Zone-controlled (GZ-controlled) instance, which can only be controlled
+from the Global Zone. The non-global zone is not able to observe or control
+the GZ-controlled ipfilter.
+
+ipf optionally takes a zone name as an argument, which will change the
+ipfilter settings for that zone, rather than the current one. The zonename
+option is only available in the Global Zone. Using it in any other zone will
+return an error. If the \fB-G\fR option is specified with this argument, the
+Global Zone-controlled ipfilter is operated on. If \fB-G\fR is not specified,
+the in-zone ipfilter is operated on.
+
.SH FILES
.sp
.ne 2
@@ -519,7 +547,7 @@ Interface Stability Committed
.LP
\fBipfstat\fR(1M), \fBipmon\fR(1M), \fBipnat\fR(1M), \fBippool\fR(1M),
\fBsvcadm\fR(1M), \fBsvc.ipfd\fR(1M), \fBipf\fR(4), \fBipnat.conf\fR(4),
-\fBippool\fR(4), \fBattributes\fR(5), \fBipfilter\fR(5)
+\fBippool\fR(4), \fBattributes\fR(5), \fBipfilter\fR(5), \fBzones(5)\fR
.sp
.LP
\fI\fR
diff --git a/usr/src/man/man1m/ipfs.1m b/usr/src/man/man1m/ipfs.1m
index ea2f16c065..5514e96ea9 100644
--- a/usr/src/man/man1m/ipfs.1m
+++ b/usr/src/man/man1m/ipfs.1m
@@ -2,43 +2,44 @@
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
-.TH IPFS 1M "Apr 3, 2008"
+.\" Portions Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
+.TH IPFS 1M "Oct 30, 2013"
.SH NAME
ipfs \- saves and restores information for NAT and state tables
.SH SYNOPSIS
.LP
.nf
-\fBipfs\fR [\fB-nv\fR] \fB-l\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nv\fR] \fB-l\fR
.fi
.LP
.nf
-\fBipfs\fR [\fB-nv\fR] \fB-u\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nv\fR] \fB-u\fR
.fi
.LP
.nf
-\fBipfs\fR [\fB-nv\fR] [\fB-d\fR \fIdirname\fR] \fB-R\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nv\fR] [\fB-d\fR \fIdirname\fR] \fB-R\fR
.fi
.LP
.nf
-\fBipfs\fR [\fB-nv\fR] [\fB-d\fR \fIdirname\fR] \fB-W\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nv\fR] [\fB-d\fR \fIdirname\fR] \fB-W\fR
.fi
.LP
.nf
-\fBipfs\fR [\fB-nNSv\fR] [\fB-f\fR \fIfilename\fR] \fB-r\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nNSv\fR] [\fB-f\fR \fIfilename\fR] \fB-r\fR
.fi
.LP
.nf
-\fBipfs\fR [\fB-nNSv\fR] [\fB-f\fR \fIfilename\fR] \fB-w\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nNSv\fR] [\fB-f\fR \fIfilename\fR] \fB-w\fR
.fi
.LP
.nf
-\fBipfs\fR [\fB-nNSv\fR] \fB-f\fR \fIfilename\fR \fB-i\fR \fI<if1>\fR,\fI<if2>\fR
+\fBipfs\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-nNSv\fR] \fB-f\fR \fIfilename\fR \fB-i\fR \fI<if1>\fR,\fI<if2>\fR
.fi
.SH DESCRIPTION
@@ -164,6 +165,30 @@ can be changed with the \fB-d\fR option. The state tables are locked at the
beginning of this operation and unlocked once complete.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR\fR
+.ad
+.RS 6n
+Operate on the in-zone state information for the specified zone. If neither
+this option nor \fB-G\fR is specified, the current zone is used. This command
+is only available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m) for
+more information.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-G\fR \fIzonename\fR\fR
+.ad
+.RS 6n
+Operate on the global zone controlled state information for the specified
+zone. If neither this option nor \fB-z\fR is specified, the current zone is
+used. This command is only available in the Global Zone. See \fBZONES\fR in
+\fBipf\fR(1m) for more information.
+.RE
+
.SH FILES
.RS +4
.TP
@@ -214,7 +239,8 @@ Interface Stability Committed
.SH SEE ALSO
.sp
.LP
-\fBipf\fR(1M), \fBipmon\fR(1M), \fBipnat\fR(1M), \fBattributes\fR(5)
+\fBipf\fR(1M), \fBipmon\fR(1M), \fBipnat\fR(1M), \fBattributes\fR(5),
+\fBzones(5)\fR
.SH DIAGNOSTICS
.sp
.LP
diff --git a/usr/src/man/man1m/ipfstat.1m b/usr/src/man/man1m/ipfstat.1m
index 212de841a9..ba46c2c44b 100644
--- a/usr/src/man/man1m/ipfstat.1m
+++ b/usr/src/man/man1m/ipfstat.1m
@@ -2,7 +2,8 @@
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
-.TH IPFSTAT 1M "Apr 3, 2008"
+.\" Portions Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
+.TH IPFSTAT 1M "Oct 30, 2013"
.SH NAME
ipfstat \- reports on packet filter statistics and filter list
.SH SYNOPSIS
@@ -14,7 +15,7 @@ ipfstat \- reports on packet filter statistics and filter list
.LP
.nf
\fBipfstat\fR [\fB-C\fR] [\fB-D\fR \fIaddrport\fR] [\fB-P\fR \fIprotocol\fR] [\fB-S\fR \fIaddrport\fR]
- [\fB-T\fR \fIrefreshtime\fR]
+ [\fB-T\fR \fIrefreshtime\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR]
.fi
.SH DESCRIPTION
@@ -351,6 +352,30 @@ shows the process table. States can be sorted in a number of different ways.
Turn verbose mode on. Displays additional debugging information.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR\fR
+.ad
+.RS 18n
+Report the in-zone statistics for the specified zone. If neither this option
+nor \fB-G\fR is specified, the current zone is used. This command is only
+available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m) for more
+information.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-G\fR \fIzonename\fR\fR
+.ad
+.RS 18n
+Report the global zone controlled statistics for the specified zone. If
+neither this option nor \fB-z\fR is specified, the current zone is used. This
+command is only available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m)
+for more information.
+.RE
+
.SH FILES
.RS +4
.TP
@@ -396,7 +421,7 @@ Interface Stability Committed
.sp
.LP
\fBipf\fR(1M), \fBkstat\fR(1M), \fBkstat\fR(3KSTAT), \fBattributes\fR(5),
-\fBipfilter\fR(5)
+\fBipfilter\fR(5), \fBzones(5)\fR
.sp
.LP
\fI\fR
diff --git a/usr/src/man/man1m/ipmon.1m b/usr/src/man/man1m/ipmon.1m
index 2094979915..07574790b9 100644
--- a/usr/src/man/man1m/ipmon.1m
+++ b/usr/src/man/man1m/ipmon.1m
@@ -2,14 +2,15 @@
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
-.TH IPMON 1M "Apr 3, 2008"
+.\" Portions Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
+.TH IPMON 1M "Oct 30, 2013"
.SH NAME
ipmon \- monitors /dev/ipl for logged packets
.SH SYNOPSIS
.LP
.nf
\fBipmon\fR [\fB-abDFhnpstvxX\fR] [\fB-N\fR \fIdevice\fR] [ [o] [NSI]] [\fB-O\fR [NSI]]
- [\fB-P\fR \fIpidfile\fR] [\fB-S\fR \fIdevice\fR] [\fB-f\fR \fIdevice\fR] [\fIfilename\fR]
+ [\fB-P\fR \fIpidfile\fR] [\fB-S\fR \fIdevice\fR] [\fB-f\fR \fIdevice\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fIfilename\fR]
.fi
.SH DESCRIPTION
@@ -343,6 +344,32 @@ Show the packet data in hex.
Show the log header record data in hex.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR\fR
+.ad
+.sp .6
+.RS 4n
+Monitor packets the specified zone's in-zone filter. If neither this option
+nor \fB-G\fR is specified, the current zone is used. This command is only
+available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m) for more
+information.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-G\fR \fIzonename\fR\fR
+.ad
+.sp .6
+.RS 4n
+Monitor packets for the specified zone's global zone controlled filter. If
+neither this option nor \fB-z\fR is specified, the current zone is used. This
+command is only available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m)
+for more information.
+.RE
+
.SH FILES
.RS +4
.TP
@@ -382,7 +409,7 @@ Interface Stability Committed
.sp
.LP
\fBipf\fR(1M), \fBipfstat\fR(1M), \fBipnat\fR(1M), \fBattributes\fR(5),
-\fBipfilter\fR(5)
+\fBipfilter\fR(5), \fBzones(5)\fR
.sp
.LP
\fI\fR
diff --git a/usr/src/man/man1m/ipnat.1m b/usr/src/man/man1m/ipnat.1m
index 6e36a50e26..ed382fa7a9 100644
--- a/usr/src/man/man1m/ipnat.1m
+++ b/usr/src/man/man1m/ipnat.1m
@@ -2,13 +2,14 @@
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
-.TH IPNAT 1M "Apr 3, 2008"
+.\" Portions Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
+.TH IPNAT 1M "Oct 30, 2013"
.SH NAME
ipnat \- user interface to the NAT subsystem
.SH SYNOPSIS
.LP
.nf
-\fBipnat\fR [\fB-CdFhlnRrsv\fR] \fB-f\fR \fIfilename\fR
+\fBipnat\fR [\fB-CdFhlnRrsv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] \fB-f\fR \fIfilename\fR
.fi
.SH DESCRIPTION
@@ -140,6 +141,30 @@ Turn verbose mode on. Displays information relating to rule processing and
active rules/table entries.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR\fR
+.ad
+.RS 15n
+Operate on the in-zone IP NAT for the specified zone. If neither this option
+nor \fB-G\fR is specified, the current zone is used. This command is only
+available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m) for more
+information.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-G\fR \fIzonename\fR\fR
+.ad
+.RS 15n
+Operate on the global zone controlled IP NAT for the specified zone. If
+neither this option nor \fB-z\fR is specified, the current zone is used. This
+command is only available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m)
+for more information.
+.RE
+
.SH FILES
.sp
.ne 2
@@ -200,4 +225,5 @@ Interface Stability Committed
.SH SEE ALSO
.sp
.LP
-\fBipf\fR(1M), \fBipfstat\fR(1M), \fBipnat\fR(4), \fBattributes\fR(5)
+\fBipf\fR(1M), \fBipfstat\fR(1M), \fBipnat\fR(4), \fBattributes\fR(5),
+\fBzones(5)\fR
diff --git a/usr/src/man/man1m/ippool.1m b/usr/src/man/man1m/ippool.1m
index 38e7cc19e6..c7cae2029e 100644
--- a/usr/src/man/man1m/ippool.1m
+++ b/usr/src/man/man1m/ippool.1m
@@ -2,56 +2,57 @@
.\" To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
.\" location.
.\" Portions Copyright (c) 2008, Sun Microsystems Inc. All Rights Reserved.
-.TH IPPOOL 1M "Apr 3, 2008"
+.\" Portions Copyright (c) 2012, Joyent, Inc. All Rights Reserved.
+.TH IPPOOL 1M "Nov 26, 2012"
.SH NAME
ippool \- user interface to the IP Filter pools
.SH SYNOPSIS
.LP
.nf
-\fBippool\fR \fB-a\fR [\fB-dnv\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] \fB-i\fR \fIipaddr\fR
+\fBippool\fR \fB-a\fR [\fB-dnv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] \fB-i\fR \fIipaddr\fR
[/\fInetmask\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-A\fR [\fB-dnv\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] [\fB-S\fR \fIseed\fR]
+\fBippool\fR \fB-A\fR [\fB-dnv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] [\fB-S\fR \fIseed\fR]
[\fB-t\fR \fItype\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-f\fR \fIfile\fR [\fB-dnuv\fR]
+\fBippool\fR \fB-f\fR \fIfile\fR [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-dnuv\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-F\fR [\fB-dv\fR] [\fB-o\fR \fIrole\fR] [\fB-t\fR \fItype\fR]
+\fBippool\fR \fB-F\fR [\fB-dv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-o\fR \fIrole\fR] [\fB-t\fR \fItype\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-h\fR [\fB-dv\fR] [\fB-m\fR \fIpoolname\fR] [\fB-t\fR \fItype\fR]
+\fBippool\fR \fB-h\fR [\fB-dv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-m\fR \fIpoolname\fR] [\fB-t\fR \fItype\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-l\fR [\fB-dv\fR] [\fB-m\fR \fIpoolname\fR] [\fB-t\fR \fItype\fR]
+\fBippool\fR \fB-l\fR [\fB-dv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-m\fR \fIpoolname\fR] [\fB-t\fR \fItype\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-r\fR [\fB-dnv\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] \fB-i\fR \fIipaddr\fR
+\fBippool\fR \fB-r\fR [\fB-dnv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] \fB-i\fR \fIipaddr\fR
[/\fInetmask\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-R\fR [\fB-dnv\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] [\fB-t\fR \fItype\fR]
+\fBippool\fR \fB-R\fR [\fB-dnv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-m\fR \fIpoolname\fR] [\fB-o\fR \fIrole\fR] [\fB-t\fR \fItype\fR]
.fi
.LP
.nf
-\fBippool\fR \fB-s\fR [\fB-dtv\fR] [\fB-M\fR \fIcore\fR] [\fB-N\fR \fInamelist\fR]
+\fBippool\fR \fB-s\fR [\fB-dtv\fR] [\fB-G\fR | \fB-z\fR \fIzonename\fR] [\fB-M\fR \fIcore\fR] [\fB-N\fR \fInamelist\fR]
.fi
.SH DESCRIPTION
@@ -111,6 +112,30 @@ would alter the currently running kernel.
Turn verbose mode on.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-z\fR \fIzonename\fR\fR
+.ad
+.RS 6n
+Manage the specified zone's in-zone IP pools. If neither this option nor
+\fB-G\fR is specified, the current zone is used. This command is only
+available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m) for more
+information.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fB-G\fR \fIzonename\fR\fR
+.ad
+.RS 6n
+Manage the specified zone's global zone controlled IP pools. If neither this
+option nor \fB-z\fR is specified, the current zone is used. This command is
+only available in the Global Zone. See \fBZONES\fR in \fBipf\fR(1m) for more
+information.
+.RE
+
.SS "Instance-Specific Options"
.sp
.LP
@@ -328,4 +353,5 @@ Interface Stability Committed
.SH SEE ALSO
.sp
.LP
-\fBipf\fR(1M), \fBipfstat\fR(1M), \fBippool\fR(4), \fBattributes\fR(5)
+\fBipf\fR(1M), \fBipfstat\fR(1M), \fBippool\fR(4), \fBattributes\fR(5),
+\fBzones(5)\fR
diff --git a/usr/src/man/man1m/lofiadm.1m b/usr/src/man/man1m/lofiadm.1m
index eb7a2c0616..e1ea5d0055 100644
--- a/usr/src/man/man1m/lofiadm.1m
+++ b/usr/src/man/man1m/lofiadm.1m
@@ -77,9 +77,11 @@ association, or print information about the current associations.
Encryption and compression options are mutually exclusive on the command line.
Further, an encrypted file cannot be compressed later, nor can a compressed
file be encrypted later.
+
+In the global zone, \fBlofiadm\fR can be used on both the global
+zone devices and all devices owned by other non-global zones on the system.
.sp
.LP
-The \fBlofi\fR driver is not available and will not work inside a zone.
.SH OPTIONS
.sp
.LP
@@ -251,6 +253,10 @@ restrictions apply (such as restricted root access over \fBNFS\fR). The file is
held open until the association is removed. It is not actually accessed until
the block device is used, so it will never be written to if the block device is
only opened read-only.
+
+Note that the filename may appear as "?" if it is not possible to resolve the
+path in the current context (for example, if it's an NFS path in a non-global
+zone).
.RE
.sp
diff --git a/usr/src/man/man1m/mount_tmpfs.1m b/usr/src/man/man1m/mount_tmpfs.1m
index a4f38d3b1f..3520a3f31b 100644
--- a/usr/src/man/man1m/mount_tmpfs.1m
+++ b/usr/src/man/man1m/mount_tmpfs.1m
@@ -1,9 +1,10 @@
'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved
.\" 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]
-.TH MOUNT_TMPFS 1M "Nov 24, 2003"
+.TH MOUNT_TMPFS 1M "Dec 2, 2011"
.SH NAME
mount_tmpfs \- mount tmpfs file systems
.SH SYNOPSIS
@@ -45,6 +46,17 @@ available:
.sp
.ne 2
.na
+\fB\fBremount\fR\fR
+.ad
+.sp .6
+.RS 19n
+Remounts a file system with a new size. A size not explicitly
+set with \fBremount\fR reverts to no limit.
+.RE
+
+.sp
+.ne 2
+.na
\fBsize=\fIsz\fR\fR
.ad
.RS 19n
diff --git a/usr/src/man/man1m/prstat.1m b/usr/src/man/man1m/prstat.1m
index d86e653971..b26ef5ceb3 100644
--- a/usr/src/man/man1m/prstat.1m
+++ b/usr/src/man/man1m/prstat.1m
@@ -1,19 +1,20 @@
'\" te
.\" Copyright (c) 2013 Gary Mills
.\" Copyright (c) 2006, 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
.\" 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]
-.TH PRSTAT 1M "Apr 15, 2013"
+.TH PRSTAT 1M "Jun 5, 2013"
.SH NAME
prstat \- report active process statistics
.SH SYNOPSIS
.LP
.nf
-\fBprstat\fR [\fB-acHJLmRrtTvWZ\fR] [\fB-d\fR u | d] [\fB-C\fR \fIpsrsetlist\fR] [\fB-h\fR \fIlgrplist\fR]
+\fBprstat\fR [\fB-acHJLmRrtTvVWZ\fR] [\fB-d\fR u | d] [\fB-C\fR \fIpsrsetlist\fR] [\fB-h\fR \fIlgrplist\fR]
[\fB-j\fR \fIprojlist\fR] [\fB-k\fR \fItasklist\fR] [\fB-n\fR \fIntop\fR[,\fInbottom\fR]]
[\fB-p\fR \fIpidlist\fR] [\fB-P\fR \fIcpulist\fR] [\fB-s\fR \fIkey\fR | \fB-S\fR \fIkey\fR ]
- [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR]
+ [\fB-u\fR \fIeuidlist\fR] [\fB-U\fR \fIuidlist\fR] [\fB-z\fR \fIzoneidlist\fR] [\fB-Z\fR]
[\fIinterval\fR [\fIcount\fR]]
.fi
@@ -177,10 +178,10 @@ waiting for user locks and waiting for \fBCPU\fR (latency time).
.RS 4n
Restrict number of output lines. The \fIntop\fR argument determines how many
lines of process or \fBlwp\fR statistics are reported, and the \fInbottom\fR
-argument determines how many lines of user, task, or projects statistics are
-reported if the \fB-a\fR, \fB-t\fR, \fB-T\fR, or \fB-J\fR options are
-specified. By default, \fBprstat\fR displays as many lines of output that fit
-in a window or terminal. When you specify the \fB-c\fR option or direct the
+argument determines how many lines of user, task, project or zone statistics
+are reported if the \fB-a\fR, \fB-t\fR, \fB-T\fR, \fB-J\fR or \fB-Z\fR options
+are specified. By default, \fBprstat\fR displays as many lines of output that
+fit in a window or terminal. When you specify the \fB-c\fR option or direct the
output to a file, the default values for \fBntop\fR and \fBnbottom\fR are
\fB15\fR and \fB5\fR.
.RE
@@ -368,6 +369,18 @@ with the \fB-\fR sign.
.sp
.ne 2
.na
+\fB\fB-V\fR\fR
+.ad
+.sp .6
+.RS 4n
+Report accurate aggregated SWAP and RSS values when used with the \fB-J\fR,
+\fB-t\fR, \fB-T\fR or \fB-Z\fR options. This uses an accurate, but more expensive,
+calculation to determine the aggregated values for the specified grouping.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-W\fR\fR
.ad
.sp .6
@@ -450,9 +463,11 @@ devices, in kilobytes (\fBK\fR), megabytes (\fBM\fR), or gigabytes (\fBG\fR).
.RS 4n
The resident set size of the process (\fBRSS\fR), in kilobytes (\fBK\fR),
megabytes (\fBM\fR), or gigabytes (\fBG\fR). The RSS value is an estimate
-provided by \fBproc\fR(4) that might underestimate the actual resident set
-size. Users who want to get more accurate usage information for capacity
-planning should use the \fB-x\fR option to \fBpmap\fR(1) instead.
+provided by \fBproc\fR(4) that might underestimate the actual
+per-process resident set size and usually overestimates the aggregated
+resident set size. Users who want to get more accurate usage information for
+capacity planning should use either the \fB-V\fR option or, for per-process
+results, the \fB-x\fR option to \fBpmap\fR(1) instead.
.RE
.sp
diff --git a/usr/src/man/man1m/prtconf.1m b/usr/src/man/man1m/prtconf.1m
index d8ad9e72ba..ff62a01992 100644
--- a/usr/src/man/man1m/prtconf.1m
+++ b/usr/src/man/man1m/prtconf.1m
@@ -10,7 +10,7 @@ prtconf \- print system configuration
.SH SYNOPSIS
.LP
.nf
-\fB/usr/sbin/prtconf\fR [\fB-V\fR] | [\fB-F\fR] | [\fB-x\fR] | [\fB-bpv\fR] | [\fB-acdDPv\fR]
+\fB/usr/sbin/prtconf\fR [\fB-V\fR] | [\fB-F\fR] | [\fB-m\fr] | [\fB-x\fR] | [\fB-bpv\fR] | [\fB-acdDPv\fR]
[\fIdev_path\fR]
.fi
@@ -100,6 +100,16 @@ console frame buffer on a SUNW,Ultra-30 is \fBffb\fR, the command returns:
.sp
.ne 2
.na
+\fB\fB-m\fR\fR
+.ad
+.RS 6n
+Displays the amount system memory in megabytes.
+This flag must be used by itself.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-p\fR\fR
.ad
.RS 6n
diff --git a/usr/src/man/man1m/psrset.1m b/usr/src/man/man1m/psrset.1m
index 0212e6fa07..519d2c1e5c 100644
--- a/usr/src/man/man1m/psrset.1m
+++ b/usr/src/man/man1m/psrset.1m
@@ -1,9 +1,10 @@
'\" te
+.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" 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]
-.TH PSRSET 1M "Feb 25, 2008"
+.TH PSRSET 1M "Mar 11, 2013"
.SH NAME
psrset \- creation and management of processor sets
.SH SYNOPSIS
@@ -19,6 +20,11 @@ psrset \- creation and management of processor sets
.LP
.nf
+\fBpsrset\fR \fB-b\fR \fB-z\fR \fIzone name\fR \fIprocessor_set_id\fR
+.fi
+
+.LP
+.nf
\fBpsrset\fR \fB-c\fR [\fB-F\fR] [\fIprocessor_id\fR]...
.fi
@@ -110,11 +116,12 @@ privilege.
.sp
.ne 2
.na
-\fB\fB-b\fR\fR
+\fB\fB-b\fR [\fB-z\fr \fIzonename\fR]\fR
.ad
.RS 6n
Bind all or a subset of the \fBLWP\fRs of the specified processes to the
-specified processor set.
+specified processor set. If \fB-z\fR is specified, all processes and threads
+inside the specified zone are bound to the processor set.
.sp
LWPs bound to a processor set are restricted to run only on the processors in
that set. Processes can only be bound to non-empty processor sets, that is,
diff --git a/usr/src/man/man1m/reboot.1m b/usr/src/man/man1m/reboot.1m
index 1ff92b6f33..8eadedf18d 100644
--- a/usr/src/man/man1m/reboot.1m
+++ b/usr/src/man/man1m/reboot.1m
@@ -144,8 +144,7 @@ This option is currently available only on x86 systems. The \fB-p\fR and
.ad
.sp .6
.RS 4n
-Quick. Reboot quickly and ungracefully, without shutting down running processes
-first.
+Quick. Reboot quickly without halting running zones first.
.RE
.SH OPERANDS
diff --git a/usr/src/man/man1m/svc.startd.1m b/usr/src/man/man1m/svc.startd.1m
index 7c80c35e23..103c6b5fec 100644
--- a/usr/src/man/man1m/svc.startd.1m
+++ b/usr/src/man/man1m/svc.startd.1m
@@ -4,7 +4,7 @@
.\" 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]
-.TH SVC.STARTD 1M "Mar 18, 2011"
+.TH SVC.STARTD 1M "Aug 23, 2012"
.SH NAME
svc.startd \- Service Management Facility master restarter
.SH SYNOPSIS
@@ -372,10 +372,13 @@ properties listed below in the \fBstartd\fR property group.
.RS 4n
The \fBcritical_failure_count\fR and \fBcritical_failure_period\fR properties
together specify the maximum number of service failures allowed in a given
-time interval before \fBsvc.startd\fR transitions the service to maintenance.
+number of seconds before \fBsvc.startd\fR transitions the service to
+maintenance.
If the number of failures exceeds \fBcritical_failure_count\fR in any period of
\fBcritical_failure_period\fR seconds, \fBsvc.startd\fR will transition the
-service to maintenance.
+service to maintenance. The \fBcritical_failure_count\fR value is limited
+to the range 1-10 and defaults to 10. The \fBcritical_failure_period\fR
+defaults to 600 seconds.
.RE
.sp
diff --git a/usr/src/man/man1m/svcadm.1m b/usr/src/man/man1m/svcadm.1m
index ca66d739a4..1d647304b2 100644
--- a/usr/src/man/man1m/svcadm.1m
+++ b/usr/src/man/man1m/svcadm.1m
@@ -9,33 +9,38 @@ svcadm \- manipulate service instances
.SH SYNOPSIS
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-v\fR] [\fB-z\fR \fIzone\fR] enable [\fB-rst\fR] {\fIFMRI\fR | \fIpattern\fR}...
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] enable [\fB-rst\fR]
+ [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-v\fR] [\fB-z\fR \fIzone\fR] disable [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable [\fB-s\fR]
+ [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-v\fR] [\fB-z\fR \fIzone\fR] restart {\fIFMRI\fR | \fIpattern\fR}...
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] restart [\fB-d\fR]
+ [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-v\fR] [\fB-z\fR \fIzone\fR] refresh {\fIFMRI\fR | \fIpattern\fR}...
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] refresh
+ [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-v\fR] [\fB-z\fR \fIzone\fR] clear {\fIFMRI\fR | \fIpattern\fR}...
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] clear
+ [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
.nf
-\fB/usr/sbin/svcadm\fR [\fB-v\fR] [\fB-z\fR \fIzone\fR] mark [\fB-It\fR] \fIinstance_state\fR
- {\fIFMRI\fR | \fIpattern\fR}...
+\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] mark [\fB-It] \fIinstance_state\fR
+ [{\fIFMRI\fR | \fIpattern\fR}...]
.fi
.LP
@@ -57,6 +62,17 @@ The following options are supported:
.sp
.ne 2
.na
+\fB-S\fR \fIstate\fR
+.ad
+.RS 20n
+For the subcommands which normally operate on explicit \fIFMRI\fRs or an
+\fIFMRI\fR pattern, the \fB-S\fR option can be used to select all \fIFMRI\fRs
+in the given state.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-v\fR\fR
.ad
.RS 20n
@@ -66,6 +82,16 @@ Print actions verbosely to standard output.
.sp
.ne 2
.na
+\fB-Z\fR
+.ad
+.RS 20n
+Administer services in all zones. This option is only applicable
+from the global zone, see \fBzones\fR(5).
+.RE
+
+.sp
+.ne 2
+.na
\fB-z\fR \fIzone\fR
.ad
.RS 20n
@@ -84,8 +110,10 @@ service instance.
For subcommands taking one or more operands, if the operand specifies a service
(instead of a service instance), and that service has only a single instance,
\fBsvcadm\fR operates on that instance. If an abbreviated \fIFMRI\fR (a fault
-management resource identifier) or pattern matches more than one service, a
-warning message is displayed and that operand is ignored. See \fBsmf\fR(5).
+management resource identifier) matches more than one service or instance, a
+warning message is displayed and that operand is ignored.
+If a pattern matches more than one service or instance, the subcommand is
+applied to all matches. See \fBsmf\fR(5).
.sp
.LP
In the case that the service has more than one instance, \fBsvcadm\fR return a
@@ -144,7 +172,7 @@ persistent across reboot.
.sp
.ne 2
.na
-\fB\fBrestart\fR {\fIFMRI\fR | \fIpattern\fR}. . .\fR
+\fB\fBrestart\fR [\fB-d\fR] {\fIFMRI\fR | \fIpattern\fR}. . .\fR
.ad
.sp .6
.RS 4n
@@ -154,6 +182,10 @@ group of the service instance (see \fBsmf_security\fR(5)).
.sp
This subcommand can restart only those services that are in the online or
degraded states, as those states are defined in \fBsmf\fR(5).
+.sp
+If the \fB-d\fR option is specified, the restarter sends a \fBSIGABRT\fR to all
+members of the contract, which should cause a core dump, before restarting
+the service.
.RE
.sp
diff --git a/usr/src/man/man1m/svccfg.1m b/usr/src/man/man1m/svccfg.1m
index 972967267b..c2e2cf28cd 100644
--- a/usr/src/man/man1m/svccfg.1m
+++ b/usr/src/man/man1m/svccfg.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright 2012, Joyent, Inc. All Rights Reserved
.\" 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]
@@ -261,9 +262,11 @@ Without the \fB-a\fR option, property groups containing protected information
\fB-a\fR option is specified, all values will be archived. An error results if
there are insufficient privileges to read these values.
.sp
-Note that \fBexport\fR requires a service FMRI. If you specify an instance
-(including an abbreviation, such as \fBapache2\fR or \fBsendmail\fR, that
-specifies an instance), the command fails.
+Note that \fBexport\fR requires a service FMRI. To ease the use of arguments
+cut and pasted from other command output, if you specify a complete
+instance FMRI, the entire corresponding service including all instances
+is exported and a warning is issued. If you specify an abbreviation, such as
+\fBapache2\fR or \fBsendmail\fR, that specifies an instance, the command fails.
.RE
.sp
diff --git a/usr/src/man/man1m/tunefs.1m b/usr/src/man/man1m/tunefs.1m
index 7f522f43fa..0b849f2dd7 100644
--- a/usr/src/man/man1m/tunefs.1m
+++ b/usr/src/man/man1m/tunefs.1m
@@ -3,7 +3,7 @@
.\" 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]
-.TH TUNEFS 1M "Dec 5, 2003"
+.TH TUNEFS 1M "Sep 19, 2013"
.SH NAME
tunefs \- tune an existing UFS file system
.SH SYNOPSIS
@@ -120,3 +120,9 @@ encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
.sp
.LP
\fBmkfs_ufs\fR(1M), \fBnewfs\fR(1M), \fBattributes\fR(5), \fBlargefile\fR(5)
+
+.\" Take this out and a Unix Demon will dog your steps from now until
+.\" the time_t's wrap around.
+.SH BUGS
+.sp
+You can tune a file system, but you can't tune a fish.
diff --git a/usr/src/man/man1m/zfs.1m b/usr/src/man/man1m/zfs.1m
index 23958f984b..ff3f53ef01 100644
--- a/usr/src/man/man1m/zfs.1m
+++ b/usr/src/man/man1m/zfs.1m
@@ -111,7 +111,7 @@ zfs \- configures ZFS file systems
.LP
.nf
-\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...]
+\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hpc\fR][\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]...]
[\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fBall\fR | \fIproperty\fR[,\fIproperty\fR]...
\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR...
.fi
@@ -2290,6 +2290,17 @@ A comma-separated list of types to display, where \fItype\fR is one of
For example, specifying \fB-t snapshot\fR displays only snapshots.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.sp .6
+.RS 4n
+Display numbers in parseable (exact) values.
+.RE
+
.RE
.sp
@@ -2313,7 +2324,7 @@ Properties" section.
.sp
.ne 2
.na
-\fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR
+\fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hpc\fR] [\fB-o\fR
\fIfield\fR[,\fIfield\fR]... [\fB-t\fR \fItype\fR[,\fItype\fR]...] [\fB-s\fR \fIsource\fR[,\fIsource\fR]... \fBall\fR |
\fIproperty\fR[,\fIproperty\fR]... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR...\fR
.ad
@@ -2408,6 +2419,19 @@ is all sources.
Display numbers in parsable (exact) values.
.RE
+.sp
+.ne 2
+.na
+\fB\fB-c\fR\fR
+.ad
+.sp .6
+.RS 4n
+Only display properties which can be retrieved without issuing any I/O requests,
+i.e. properties which are already cached. Most properties are cached except for
+create-time properties (normalization, utf8only, casesensitivity) as well as a
+volume's size and block size.
+.RE
+
.RE
.sp
@@ -2836,7 +2860,7 @@ See \fBzpool-features\fR(5) for details on ZFS feature flags and the
.sp
.ne 2
.na
-\fBzfs send\fR [\fB-DnPpRv\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
+\fBzfs send\fR [\fB-DnPpRrv\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
.ad
.sp .6
.RS 4n
@@ -2912,6 +2936,18 @@ will be much better if the filesystem uses a dedup-capable checksum (eg.
.sp
.ne 2
.na
+\fB\fB-r\fR\fR
+.ad
+.sp .6
+.RS 4n
+Recursively send all descendant snapshots. This is similar to the \fB-R\fR
+flag, but information about deleted and renamed datasets is not included, and
+property information is only included if the \fB-p\fR flag is specified.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fB-p\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man1m/zoneadm.1m b/usr/src/man/man1m/zoneadm.1m
index 13612b3ed1..00a4013a90 100644
--- a/usr/src/man/man1m/zoneadm.1m
+++ b/usr/src/man/man1m/zoneadm.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2011 Joyent, Inc. All Rights Reserved.
.\" 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]
@@ -131,12 +132,14 @@ Use the following command to attach a zone:
.sp
.ne 2
.na
-\fB\fBboot\fR [\fB--\fR \fIboot_options\fR]\fR
+\fB\fBboot\fR [\fB-X\fR] [\fB--\fR \fIboot_options\fR]\fR
.ad
.sp .6
.RS 4n
Boot (or activate) the specified zones.
.sp
+The \fI-X\fR option enables debug for the zone's brand while booting.
+.sp
The following \fIboot_options\fR are supported:
.sp
.ne 2
@@ -251,13 +254,15 @@ The source zone must be halted before this subcommand can be used.
.sp
.ne 2
.na
-\fB\fBhalt\fR\fR
+\fB\fBhalt [\fB-X\fR]\fR\fR
.ad
.sp .6
.RS 4n
Halt the specified zones. \fBhalt\fR bypasses running the shutdown scripts
inside the zone. It also removes run time resources of the zone.
.sp
+The \fI-X\fR option enables debug for the zone's brand while halting.
+.sp
Use:
.sp
.in +2
@@ -417,23 +422,27 @@ and normal restrictions for \fIzonepath\fR apply.
.sp
.ne 2
.na
-\fB\fBready\fR\fR
+\fB\fBready [\fB-X\fR]\fR\fR
.ad
.sp .6
.RS 4n
Prepares a zone for running applications but does not start any user processes
in the zone.
+.sp
+The \fI-X\fR option enables debug for the zone's brand while readying.
.RE
.sp
.ne 2
.na
-\fB\fBreboot\fR\fR
+\fB\fBreboot [\fB-X\fR]\fR\fR
.ad
.sp .6
.RS 4n
Restart the zones. This is equivalent to a \fBhalt\fR \fBboot\fR sequence. This
subcommand fails if the specified zones are not active.
+.sp
+The \fI-X\fR option enables debug for the zone's brand while rebooting.
.RE
.sp
diff --git a/usr/src/man/man1m/zonecfg.1m b/usr/src/man/man1m/zonecfg.1m
index 97cc6bbf57..0bf370d747 100644
--- a/usr/src/man/man1m/zonecfg.1m
+++ b/usr/src/man/man1m/zonecfg.1m
@@ -1,25 +1,26 @@
'\" te
.\" Copyright (c) 2004, 2009 Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2013 Joyent, Inc. All Rights Reserved.
.\" 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]
-.TH ZONECFG 1M "Aug 24, 2012"
+.TH ZONECFG 1M "Oct 4, 2013"
.SH NAME
zonecfg \- set up zone configuration
.SH SYNOPSIS
.LP
.nf
-\fBzonecfg\fR \fB-z\fR \fIzonename\fR
+\fBzonecfg\fR {\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR}
.fi
.LP
.nf
-\fBzonecfg\fR \fB-z\fR \fIzonename\fR \fIsubcommand\fR
+\fBzonecfg\fR {\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR} \fIsubcommand\fR
.fi
.LP
.nf
-\fBzonecfg\fR \fB-z\fR \fIzonename\fR \fB-f\fR \fIcommand_file\fR
+\fBzonecfg\fR {\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR} \fB-f\fR \fIcommand_file\fR
.fi
.LP
@@ -42,7 +43,8 @@ The following synopsis of the \fBzonecfg\fR command is for interactive usage:
.sp
.in +2
.nf
-zonecfg \fB-z\fR \fIzonename subcommand\fR
+{\fB-z\fR \fIzonename\fR | \fB-u\fR \fIuuid\fR}
+zonecfg {\fB-z\fR \fIzonename | \fB-u\fR \fIuuid} subcommand\fR
.fi
.in -2
.sp
@@ -164,6 +166,7 @@ Network interface.
Resource control.
.RE
+.RE
.SS "Properties"
.sp
.LP
@@ -326,6 +329,27 @@ The following properties are supported:
.sp
.ne 2
.na
+\fB(global)\fR
+.ad
+.sp .6
+.RS 4n
+\fBfs-allowed\fR
+.RE
+
+.sp
+.ne 2
+.na
+\fB(global)\fR
+.ad
+.sp .6
+.RS 4n
+\fBzfs-io-priority\fR
+.RE
+
+.sp
+.ne 2
+.mk
+.na
\fB\fBfs\fR\fR
.ad
.sp .6
@@ -340,7 +364,7 @@ The following properties are supported:
.ad
.sp .6
.RS 4n
-\fBaddress\fR, \fBphysical\fR, \fBdefrouter\fR
+\fBaddress\fR, \fBallowed-address\fR, \fBdefrouter\fR, \fBglobal-nic\fR, \fBmac-addr\fR, \fBphysical\fR, \fBproperty\fR, \fBvlan-id\fR
.RE
.sp
@@ -603,7 +627,17 @@ Values needed to determine how, where, and so forth to mount file systems. See
.sp
.ne 2
.na
-\fB\fBnet\fR: address, physical, defrouter\fR
+\fB\fBinherit-pkg-dir\fR: dir\fR
+.ad
+.sp .6
+.RS 4n
+The directory path.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBnet\fR: address, allowed-address, defrouter, global-nic, mac-addr, physical, property, vlan-id\fR
.ad
.sp .6
.RS 4n
@@ -642,6 +676,10 @@ zone. However, if the interface is not used by the global zone, it should be
configured \fBdown\fR in the global zone, and the default router for the
interface should be specified here.
.sp
+The global-nic is used for exclusive stack zones which will use a VNIC on-demand. When the zone boots, a VNIC named using the physical property will be created on the global NIC. If provided, the mac-addr and vlan-id will be set on this VNIC.
+.sp
+The \fBproperty\fR setting is a resource which can be used to set arbitrary name/value pairs on the network. These name/value pairs are made available to the zone's brand, which can use them as needed to set up the network interface.
+.sp
For an exclusive-IP zone, the physical property must be set and the address and
default router properties cannot be set.
.RE
@@ -850,6 +888,39 @@ control and is related to the \fBzone.cpu-cap\fR resource control. See
.RE
.sp
+.ne 2
+.mk
+.na
+\fBglobal: \fBfs-allowed\fR\fR
+.ad
+.sp .6
+.RS 4n
+A comma-separated list of additional filesystems that may be mounted within
+the zone; for example "ufs,pcfs". By default, only hsfs(7fs) and network
+filesystems can be mounted. If the first entry in the list is "-" then
+that disables all of the default filesystems. If any filesystems are listed
+after "-" then only those filesystems can be mounted.
+
+This property does not apply to filesystems mounted into the zone via "add fs"
+or "add dataset".
+
+WARNING: allowing filesystem mounts other than the default may allow the zone
+administrator to compromise the system with a malicious filesystem image, and
+is not supported.
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+\fBglobal: \fBzfs-io-priority\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specifies a priority for this zone's ZFS I/O. The priority is used by the ZFS I/O scheduler as in input to determine how to schedule I/O across zones. By default all zones have a priority of 1. The value can be increased for zones whose I/O is more critical. This property is the preferred way to set the \fBzone.zfs-io-priority\fR rctl.
+.RE
+
+.sp
.LP
The following table summarizes resources, property-names, and types:
.sp
@@ -872,13 +943,22 @@ resource property-name type
(global) max-shm-ids simple
(global) max-shm-memory simple
(global) scheduling-class simple
+(global) zfs-io-priority simple
fs dir simple
special simple
raw simple
type simple
options list of simple
net address simple
+ allowed-address simple
+ defrouter simple
+ global-nic simple
+ mac-addr simple
physical simple
+ property list of complex
+ name simple
+ value simple
+ vlan-id simple
device match simple
rctl name simple
value list of complex
@@ -1091,6 +1171,17 @@ name \fBglobal\fR and all names beginning with \fBSUNW\fR are reserved and
cannot be used.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-u\fR \fIuuid\fR\fR
+.ad
+.sp .6
+.RS 4n
+Specify the uuid of a zone instead of the Zone name.
+.RE
+
.SH SUBCOMMANDS
.sp
.LP
@@ -1181,8 +1272,7 @@ correct to be committed, this operation automatically does a verify.
.sp
.ne 2
.na
-\fB\fBcreate [\fR\fB-F\fR\fB] [\fR \fB-a\fR \fIpath\fR |\fB-b\fR \fB|\fR
-\fB-t\fR \fItemplate\fR\fB]\fR\fR
+\fB\fBcreate [\fR\fB-F\fR\fB] [\fR \fB-a\fR \fIpath\fR |\fB-b\fR \fB|\fR \fB-t\fR \fItemplate\fR\fB] [\fR\fB-X\fR\fB]\fR\fR
.ad
.sp .6
.RS 4n
@@ -1204,6 +1294,8 @@ configured, it should be installed using the "\fBzoneadm attach\fR" command
.sp
Use the \fB-b\fR option to create a blank configuration. Without arguments,
\fBcreate\fR applies the Sun default settings.
+.sp
+Use the \fB-X\fR option to facilitate creating a zone whose XML definition already exists on the host. The zone will be atomically added to the zone index file.
.RE
.sp
@@ -1280,18 +1372,21 @@ which is currently being added or modified.
.sp
.ne 2
.na
-\fB\fBremove\fR \fIresource-type\fR\fB{\fR\fIproperty-name\fR\fB=\fR\fIproperty
--value\fR\fB}\fR(global scope)\fR
+\fB\fBremove\fR [\fR\fB-F\fR\fB] \fIresource-type\fR\fB [\fR\fIproperty-name\fR\fB=\fR\fIproperty-value\fR\fB]* \fR(global scope)\fR
+.br
+\fB\fBremove\fR \fR\fIproperty-name\fR\fB \fR\fIproperty-value\fR\fB \fR(resource scope)\fR
.ad
.sp .6
.RS 4n
In the global scope, removes the specified resource. The \fB[]\fR syntax means
-0 or more of whatever is inside the square braces. If you want only to remove a
+0 or more property name-value pairs. If you want to only remove a
single instance of the resource, you must specify enough property name-value
pairs for the resource to be uniquely identified. If no property name-value
pairs are specified, all instances will be removed. If there is more than one
-pair is specified, a confirmation is required, unless you use the \fB-F\fR
-option.
+pair specified, a confirmation is required, unless you use the \fB-F\fR
+option. Likewise, the \fB-F\fR option can be used to remove a resource that
+does not exist (that is, no error will occur). In the resource scope, remove
+the specified name-value pair.
.RE
.sp
diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m
index 0da5282c9d..ac5fca0f69 100644
--- a/usr/src/man/man1m/zpool.1m
+++ b/usr/src/man/man1m/zpool.1m
@@ -1,5 +1,6 @@
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2013, Joyent, Inc. All Rights Reserved.
.\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved.
.\" Copyright (c) 2012 by Delphix. All rights reserved.
.\" The contents of this file are subject to the terms of the Common Development
@@ -61,7 +62,7 @@ zpool \- configures ZFS storage pools
.LP
.nf
-\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
+\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
.fi
.LP
@@ -93,7 +94,7 @@ zpool \- configures ZFS storage pools
.LP
.nf
-\fBzpool list\fR [\fB-Hv\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
+\fBzpool list\fR [\fB-Hvp\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
.fi
.LP
@@ -1124,7 +1125,7 @@ is currently being used. This may lead to potential data corruption.
.sp
.ne 2
.na
-\fB\fBzpool get\fR "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
+\fB\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
.ad
.sp .6
.RS 4n
@@ -1144,10 +1145,21 @@ the following fields:
See the "Properties" section for more information on the available pool
properties.
+
+.sp
+.ne 2
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 6n
+Display numbers in parseable (exact) values.
+.RE
+
.RE
.sp
.ne 2
+.mk
.na
\fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
.ad
@@ -1463,7 +1475,7 @@ the pool, in addition to the pool-wide statistics.
.sp
.ne 2
.na
-\fB\fBzpool list\fR [\fB-Hv\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
+\fB\fBzpool list\fR [\fB-Hvp\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR
.ad
.sp .6
.RS 4n
@@ -1500,6 +1512,17 @@ Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within
the pool, in addition to the pool-wise statistics.
.RE
+.sp
+.ne 2
+.mk
+.na
+\fB\fB-p\fR\fR
+.ad
+.RS 12n
+.rt
+Display numbers in parseable (exact) values.
+.RE
+
.RE
.sp
diff --git a/usr/src/man/man3xnet/Makefile b/usr/src/man/man3xnet/Makefile
index 81cd96cba3..cc231f60c4 100644
--- a/usr/src/man/man3xnet/Makefile
+++ b/usr/src/man/man3xnet/Makefile
@@ -62,6 +62,7 @@ MANLINKS= getaddrinfo.3xnet \
getservbyname.3xnet \
getservbyport.3xnet \
getservent.3xnet \
+ htonll.3xnet \
htons.3xnet \
if_freenameindex.3xnet \
if_indextoname.3xnet \
@@ -73,6 +74,7 @@ MANLINKS= getaddrinfo.3xnet \
inet_ntoa.3xnet \
inet_pton.3xnet \
ntohl.3xnet \
+ ntohll.3xnet \
ntohs.3xnet \
sethostent.3xnet \
setnetent.3xnet \
@@ -97,6 +99,7 @@ getservbyname.3xnet := LINKSRC = endservent.3xnet
getservbyport.3xnet := LINKSRC = endservent.3xnet
getservent.3xnet := LINKSRC = endservent.3xnet
+htonll.3xnet := LINKSRC = htonl.3xnet
htons.3xnet := LINKSRC = htonl.3xnet
if_freenameindex.3xnet := LINKSRC = if_nametoindex.3xnet
@@ -112,6 +115,7 @@ inet_ntoa.3xnet := LINKSRC = inet_addr.3xnet
inet_pton.3xnet := LINKSRC = inet_ntop.3xnet
ntohl.3xnet := LINKSRC = htonl.3xnet
+ntohll.3xnet := LINKSRC = htonl.3xnet
ntohs.3xnet := LINKSRC = htonl.3xnet
sethostent.3xnet := LINKSRC = endhostent.3xnet
diff --git a/usr/src/man/man3xnet/htonl.3xnet b/usr/src/man/man3xnet/htonl.3xnet
index aa8470a28e..dda4586eb7 100644
--- a/usr/src/man/man3xnet/htonl.3xnet
+++ b/usr/src/man/man3xnet/htonl.3xnet
@@ -7,7 +7,8 @@
.\" 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]
-.TH HTONL 3XNET "Jun 10, 2002"
+.\" Portions Copyright (c) 2012 Joyent, Inc. All rights reserved.
+.TH HTONL 3XNET "Jan 03, 2013"
.SH NAME
htonl, htons, ntohl, ntohs \- convert values between host and network byte
order
@@ -22,6 +23,11 @@ order
.LP
.nf
+\fBuint64_t\fR \fBhtonll\fR(\fBuint64_t\fR \fIhostlonglong\fR);
+.fi
+
+.LP
+.nf
\fBuint16_t\fR \fBhtons\fR(\fBuint16_t\fR \fIhostshort\fR);
.fi
@@ -32,18 +38,23 @@ order
.LP
.nf
+\fBuint64_t\fR \fBntohll\fR(\fBuint64_t\fR \fInetlonglong\fR);
+.fi
+
+.LP
+.nf
\fBuint16_t\fR \fBntohs\fR(\fBuint16_t\fR \fI netshort\fR);
.fi
.SH DESCRIPTION
.sp
.LP
-These functions convert 16-bit and 32-bit quantities between network byte order
-and host byte order.
+These functions convert 16-bit, 32-bit, and 64-bit quantities between network
+byte order and host byte order.
.sp
.LP
-The \fBuint32_t\fR and \fBuint16_t\fR types are made available by inclusion
-of \fB<inttypes.h>\fR\&.
+The \fBuint32_t\fR, \fBuint16_t\fR, and \fBuint64_t\fR types are made available
+by inclusion of \fB<inttypes.h>\fR\&.
.SH USAGE
.sp
.LP
@@ -56,12 +67,12 @@ value of their argument.
.SH RETURN VALUES
.sp
.LP
-The \fBhtonl()\fR and \fBhtons()\fR functions return the argument value
-converted from host to network byte order.
+The \fBhtonl()\fR, \fBhtonll()\fR, and \fBhtons()\fR functions return the
+argument value converted from host to network byte order.
.sp
.LP
-The \fBntohl()\fR and \fBntohs()\fR functions return the argument value
-converted from network to host byte order.
+The \fBntohl()\fR, \fBntohll()\fR, and \fBntohs()\fR functions return the
+argument value converted from network to host byte order.
.SH ERRORS
.sp
.LP
diff --git a/usr/src/man/man5/privileges.5 b/usr/src/man/man5/privileges.5
index 6cbf5277fb..7fc9c00f45 100644
--- a/usr/src/man/man5/privileges.5
+++ b/usr/src/man/man5/privileges.5
@@ -4,7 +4,7 @@
.\" 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]
-.TH PRIVILEGES 5 "May 29, 2009"
+.TH PRIVILEGES 5 "March 7, 2012"
.SH NAME
privileges \- process privilege model
.SH DESCRIPTION
@@ -284,6 +284,16 @@ Allow a process to perform privileged mappings through a graphics device.
.sp
.ne 2
.na
+\fB\fBPRIV_HYPRLOFS_CONTROL\fR\fR
+.ad
+.sp .6
+.RS 4n
+Allow a process to perform hyprlofs name space management.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBPRIV_IPC_DAC_READ\fR\fR
.ad
.sp .6
diff --git a/usr/src/man/man5/resource_controls.5 b/usr/src/man/man5/resource_controls.5
index 745d777624..35a78aae6e 100644
--- a/usr/src/man/man5/resource_controls.5
+++ b/usr/src/man/man5/resource_controls.5
@@ -1,16 +1,18 @@
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (c) 2012, Joyent, Inc. All Rights Reserved.
.\" 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]
.TH RESOURCE_CONTROLS 5 "Jul 19, 2013"
.SH NAME
-resource_controls \- resource controls available through project database
+resource_controls \- resource controls available through projects and zones
.SH DESCRIPTION
.sp
.LP
-The resource controls facility is configured through the project database. See
-\fBproject\fR(4). You can set and modify resource controls through the
+For projects the resource controls facility is configured through the project
+database. See \fBproject\fR(4). For zones, resource controls are configured
+through \fBzonecfg\fR(1M). You can set and modify resource controls through the
following utilities:
.RS +4
.TP
@@ -36,6 +38,12 @@ following utilities:
.el o
\fBrctladm\fR(1M)
.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+\fBzonecfg\fR(1M)
+.RE
.sp
.LP
In a program, you use \fBsetrctl\fR(2) to set resource control values.
@@ -283,6 +291,19 @@ Maximum allowable number of event ports, expressed as an integer.
.sp
.ne 2
.na
+\fB\fBproject.max-processes\fR\fR
+.ad
+.sp .6
+.RS 4n
+Maximum number of processes that can be active in a project. This rctl is
+similar to \fBproject.max-lwps\fR, except that zombie processes are included.
+This rctl prevents process-slot exhaustion which can occur due to an excessive
+number of zombies. Expressed as an integer.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBproject.max-sem-ids\fR\fR
.ad
.sp .6
@@ -371,6 +392,33 @@ The following zone-wide resource controls are available:
.sp
.ne 2
.na
+\fB\fBzone.cpu-baseline\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a baseline amount of CPU time that a zone can use before it is considered
+to be bursting. The unit used is the percentage of a single CPU that is being
+used by all user threads in a zone. The value should be less than the
+\fBzone.cpu-cap\fR rctl value and is expressed as an integer.
+This resource control does not support the \fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBzone.cpu-burst-time\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets the number of seconds that a zone can exceed the \fBzone.cpu-baseline\fR
+rctl value before being cpu-capped down to the \fBzone.cpu-baseline\fR.
+A value of 0 means that \fBzone.cpu-baseline\fR can be exceeded indefinitely.
+This resource control does not support the \fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBzone.cpu-cap\fR\fR
.ad
.sp .6
@@ -389,7 +437,7 @@ not support the \fBsyslog\fR action.
.ad
.sp .6
.RS 4n
-Sets a limit on the number of fair share scheduler (FSS) CPU shares for a zone.
+Sets a value on the number of fair share scheduler (FSS) CPU shares for a zone.
CPU shares are first allocated to the zone, and then further subdivided among
projects within the zone as specified in the \fBproject.cpu-shares\fR entries.
Expressed as an integer. This resource control does not support the
@@ -409,14 +457,25 @@ Total amount of physical locked memory available to a zone.
.sp
.ne 2
.na
+\fB\fBzone.max-lofi\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a limit on the number of \fBLOFI\fR(7D) devices that can be created in a
+zone. Expressed as an integer. This resource control does not support the
+\fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBzone.max-lwps\fR\fR
.ad
.sp .6
.RS 4n
-Enhances resource isolation by preventing too many LWPs in one zone from
-affecting other zones. A zone's total LWPs can be further subdivided among
-projects within the zone within the zone by using \fBproject.max-lwps\fR
-entries. Expressed as an integer.
+Sets a limit on how many LWPs can be active in a zone. A zone's total LWPs
+can be further subdivided among projects within the zone within the zone by
+using \fBproject.max-lwps\fR entries. Expressed as an integer.
.RE
.sp
@@ -433,6 +492,33 @@ integer.
.sp
.ne 2
.na
+\fB\fBzone.max-physical-memory\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a limit on the amount of physical memory (RSS) that can be used by a zone
+before resident pages start being forcibly paged out. The unit used is bytes.
+Expressed as an integer. This resource control does not support the
+\fBsyslog\fR action.
+.RE
+
+.sp
+.ne 2
+.na
+\fB\fBzone.max-processes\fR\fR
+.ad
+.sp .6
+.RS 4n
+Maximum number of processes that can be active in a zone. This rctl is
+similar to \fBzone.max-lwps\fR, except that zombie processes are included.
+This rctl prevents process-slot exhaustion which can occur due to an excessive
+number of zombies. This rctl can be further subdivided among projects within
+the zone using \fBproject.max-processes\fR. Expressed as an integer.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBzone.max-sem-ids\fR\fR
.ad
.sp .6
@@ -474,6 +560,18 @@ mappings and \fBtmpfs\fR mounts for this zone.
.RE
.sp
+.ne 2
+.na
+\fB\fBzone.zfs-io-priority\fR\fR
+.ad
+.sp .6
+.RS 4n
+Sets a value for the \fBzfs\fR(1M) I/O priority for a zone. This is used as
+one of the inputs to determine if a zone's I/O should be throttled. Expressed
+as an integer. This resource control does not support the \fBsyslog\fR action.
+.RE
+
+.sp
.LP
See \fBzones\fR(5).
.SS "Units Used in Resource Controls"
diff --git a/usr/src/man/man7d/lofi.7d b/usr/src/man/man7d/lofi.7d
index 72b2d9781b..81fffc6354 100644
--- a/usr/src/man/man7d/lofi.7d
+++ b/usr/src/man/man7d/lofi.7d
@@ -136,7 +136,3 @@ through the \fBlofi\fR file driver.
.LP
For compatibility purposes, a raw device is also exported with the block
device. (For example, \fBnewfs\fR(1M)).
-.sp
-.LP
-The \fBlofi\fR driver isn't available in a zone and will not work inside a
-zone.
diff --git a/usr/src/man/man7fs/Makefile b/usr/src/man/man7fs/Makefile
index a288c94893..f940a4da13 100644
--- a/usr/src/man/man7fs/Makefile
+++ b/usr/src/man/man7fs/Makefile
@@ -12,6 +12,7 @@
#
# Copyright 2011, Richard Lowe
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2012 Joyent, Inc. All rights reserved.
#
include $(SRC)/Makefile.master
@@ -24,7 +25,9 @@ MANFILES= ctfs.7fs \
devfs.7fs \
fd.7fs \
hsfs.7fs \
+ hyprlofs.7fs \
lofs.7fs \
+ lxproc.7fs \
objfs.7fs \
pcfs.7fs \
sharefs.7fs \
diff --git a/usr/src/man/man7fs/hyprlofs.7fs b/usr/src/man/man7fs/hyprlofs.7fs
new file mode 100644
index 0000000000..8655791193
--- /dev/null
+++ b/usr/src/man/man7fs/hyprlofs.7fs
@@ -0,0 +1,62 @@
+'\" te
+.\" Copyright (c) 2012, Joyent, Inc.
+.\" 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]
+.TH HYPRLOFS 7FS "March 7, 2012"
+.SH NAME
+hyprlofs \- fast name space virtual file system
+.SH SYNOPSIS
+.LP
+.nf
+#include <sys/fs/hyprlofs.h>
+
+\fB\fR\fBmount\fR (\fB\fR\fIspecial\fR, \fB\fR\fIdirectory\fR, \fB\fR\fIMS_DATA\fR, \fB\fR\fI"hyprlofs"\fR, \fB\fR\fINULL\fR, \fB\fR\fI0\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBhyprlofs\fR is a hybrid file system combining features from
+\fBtmpfs(7FS)\fR and \fBlofs(7FS)\fR.
+As with \fBlofs\fR, the \fBhyprlofs\fR file system allows new, virtual file
+systems to be created which provide access to existing files using alternate
+pathnames. In addition, the files themselves may have alternate names and
+paths within the mount.
+Unlike \fBlofs\fR, files cannot be created and backing files cannot be removed.
+The name space is completely managed through ioctls on the mount.
+Entries in the name space are not mounts and thus, they will not appear in the
+mnttab. The file system is designed to provide a very fast name space to the
+backing files. The name space can be modified very quickly through the ioctl
+interface.
+.sp
+.LP
+\fBhyprlofs\fR file systems can be mounted with the command:
+.sp
+.in +2
+.nf
+\fBmount \fR\fB-F\fR\fB hyprlofs swap \fR\fIdirectory\fR
+.fi
+.in -2
+
+.sp
+.LP
+The name space used by \fBhyprlofs\fR exists only in-memory so it will consume
+a small amount of the system's virtual memory. The files themselves are backed
+by the original file as with \fBlofs\fR.
+
+.SH SEE ALSO
+.sp
+.LP
+\fBdf\fR(1M), \fBmount\fR(1M), \fBswap\fR(1M),
+\fBmount\fR(2), \fBumount\fR(2)
+.sp
+.LP
+\fISystem Administration Guide: Basic Administration\fR
+.SH DIAGNOSTICS
+.sp
+.LP
+\fBdf\fR(1M) output is of limited accuracy since
+the space available to \fBhyprlofs\fR is dependent on the swap
+space demands of the entire system and the files in the name space are not
+included.
diff --git a/usr/src/man/man7fs/lxproc.7fs b/usr/src/man/man7fs/lxproc.7fs
new file mode 100644
index 0000000000..fe8a0d6d35
--- /dev/null
+++ b/usr/src/man/man7fs/lxproc.7fs
@@ -0,0 +1,115 @@
+'\" te
+.\" Copyright (c) 2012, Joyent, Inc.
+.\" 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]
+.TH LXPROC 7FS "April 25, 2012"
+.SH NAME
+lxproc \- a loosely Linux-compatible /proc
+.SH SYNOPSIS
+.LP
+.nf
+\fB\fR\fBmount\fR (\fB\fR\fI"lxproc"\fR, \fB\fR\fIdirectory\fR, \fB\fR\fIMS_DATA\fR, \fB\fR\fI"lxproc"\fR, \fB\fR\fINULL\fR, \fB\fR\fI0\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+\fBlxproc\fR is an implementation of the \fB/proc\fR filesystem that
+loosely matches the Linux semantics of providing human-readable text files
+that correspond to elements of the system.
+As with both \fBproc\fR(4) and Linux \fB/proc\fR, \fBlxproc\fR makes available
+a directory for every process, with each directory containing a number
+of files; like Linux \fB/proc\fR but unlike \fBproc\fR(4), \fBlxproc\fR also
+makes available a number of files related to system-wide information.
+To ascertain the meaning and structure of the files provided via
+\fBlxproc\fR, users should consult the Linux documentation.
+.sp
+.LP
+The \fBlxproc\fR compatibility layer is
+provided only as a best-effort for simple Linux \fB/proc\fR readers; it
+is not intended to exactly mimic Linux semantics and nor does it attempt to
+somehow fool a consumer into believing that it is operating within a Linux
+environment. As such, \fBlxproc\fR should only be used by Linux-specific
+programs that are willing to trade precision in understanding the
+system in return for Linux compatibility. To programmatically understand
+the system precisely and in terms of its native constructs,
+one should not use \fBlxproc\fR, but rather \fBproc\fR(4) or
+\fBkstat\fR(3KSTAT).
+To understand
+a process or group of processes from either a shell script or the command line,
+one should not use \fBlxproc\fR, but rather \fBproc\fR(4)-based tools like
+\fBprstat\fR(1M),
+\fBpfiles\fR(1),
+\fBpargs\fR(1),
+\fBpmap\fR(1),
+\fBptree\fR(1),
+\fBplimit\fR(1),
+\fBpflags\fR(1),
+\fBpcred\fR(1),
+\fBpstack\fR(1),
+\fBpldd\fR(1),
+\fBpsig\fR(1),
+or
+\fBpwdx\fR(1).
+To understand system-wide constructs from either a shell script or the
+command line, one should not use \fBlxproc\fR, but rather
+\fBkstat\fR(3KSTAT)-based tools like
+\fBkstat\fR(1M),
+\fBmpstat\fR(1M),
+\fBiostat\fR(1M),
+\fBnetstat\fR(1M) or
+\fBpsrinfo\fR(1M).
+.sp
+.LP
+Like \fB/proc\fR, \fBlxproc\fR can be mounted on any mount point, but the
+preferred mount point is \fB/system/lxproc\fR; if a zone brand elects to
+mount it by default, this will (or should) generally be the mount point.
+.sp
+.LP
+\fBlxproc\fR can be mounted with the command:
+.sp
+.in +2
+.nf
+\fBmount \fR\fB-F\fR\fB lxproc lxproc \fR\fIdirectory\fR
+.fi
+.in -2
+
+.SH SEE ALSO
+.sp
+.LP
+\fBdf\fR(1M),
+\fBiostat\fR(1M),
+\fBkstat\fR(1M),
+\fBmpstat\fR(1M),
+\fBmount\fR(1M),
+\fBnetstat\fR(1M),
+\fBpargs\fR(1),
+\fBpcred\fR(1),
+\fBpfiles\fR(1),
+\fBpflags\fR(1),
+\fBpldd\fR(1),
+\fBplimit\fR(1),
+\fBpmap\fR(1),
+\fBprstat\fR(1M),
+\fBpsig\fR(1),
+\fBpsrinfo\fR(1M),
+\fBpstack\fR(1),
+\fBptree\fR(1),
+\fBpwdx\fR(1),
+\fBmount\fR(2), \fBumount\fR(2), \fBkstat\fR(3KSTAT), \fBproc\fR(4),
+\fBkstat\fR(9S)
+
+.SH NOTES
+.sp
+.LP
+When choosing between offering
+Linux compatibility and telling the truth, \fBlxproc\fR emphatically picks
+the truth. A particular glaring example of this is the Linux notion of
+"tasks" (that is, threads), which -- due to historical misadventures on
+Linux -- allocate their identifiers from the process identifier space.
+(That is, each thread has in effect a pid.) Some Linux \fB/proc\fR readers
+have come to depend on this attribute, and become confused when threads
+appear with proper identifiers, so \fBlxproc\fR simply opts for the pre-2.6
+behavior, and does not present the tasks directory at all.
+
diff --git a/usr/src/man/man9e/detach.9e b/usr/src/man/man9e/detach.9e
index b5e1ec78b8..d003dbba1e 100644
--- a/usr/src/man/man9e/detach.9e
+++ b/usr/src/man/man9e/detach.9e
@@ -14,7 +14,7 @@ detach \- detach or suspend a device
-\fBint prefix\fR \fBdetach\fR(\fBdev_info_t\fR \fIdip\fR, \fBddi_detach_cmd_t\fR \fIcmd\fR);
+\fBint prefix\fR \fBdetach\fR(\fBdev_info_t\fR *\fIdip\fR, \fBddi_detach_cmd_t\fR \fIcmd\fR);
.fi
.SH INTERFACE LEVEL
diff --git a/usr/src/man/man9f/kmem_cache_create.9f b/usr/src/man/man9f/kmem_cache_create.9f
index 95b6fd6525..3fa34c3253 100644
--- a/usr/src/man/man9f/kmem_cache_create.9f
+++ b/usr/src/man/man9f/kmem_cache_create.9f
@@ -336,7 +336,7 @@ requirement is that the client must free the object (using
this, so programming errors will lead to hard-to-find bugs.
.sp
.LP
-A driver should call \fBkmem_cache_create()\fR at the time of \fB_fini\fR(9E)
+A driver should call \fBkmem_cache_create()\fR at the time of \fB_init\fR(9E)
or \fBattach\fR(9E), and call the corresponding \fBkmem_cache_destroy()\fR at
the time of \fB_fini\fR(9E) or \fBdetach\fR(9E).
.sp
diff --git a/usr/src/pkg/manifests/SUNWcs.mf b/usr/src/pkg/manifests/SUNWcs.mf
index 983615a9d9..6b57ab5856 100644
--- a/usr/src/pkg/manifests/SUNWcs.mf
+++ b/usr/src/pkg/manifests/SUNWcs.mf
@@ -238,9 +238,6 @@ $(i386_ONLY)dir path=usr/sbin/$(ARCH32)
dir path=usr/sbin/$(ARCH64)
dir path=usr/share
dir path=usr/share/doc group=other
-dir path=usr/share/doc/ksh
-dir path=usr/share/doc/ksh/images
-dir path=usr/share/doc/ksh/images/callouts
dir path=usr/share/lib
dir path=usr/share/lib/mailx
dir path=usr/share/lib/pub
@@ -1422,31 +1419,6 @@ file path=usr/sbin/volcopy mode=0555
file path=usr/sbin/wall group=tty mode=2555
file path=usr/sbin/zdump mode=0555
file path=usr/sbin/zic mode=0555
-file path=usr/share/doc/ksh/COMPATIBILITY
-file path=usr/share/doc/ksh/DESIGN
-file path=usr/share/doc/ksh/OBSOLETE
-file path=usr/share/doc/ksh/README
-file path=usr/share/doc/ksh/RELEASE
-file path=usr/share/doc/ksh/TYPES
-file path=usr/share/doc/ksh/images/callouts/1.png
-file path=usr/share/doc/ksh/images/callouts/10.png
-file path=usr/share/doc/ksh/images/callouts/2.png
-file path=usr/share/doc/ksh/images/callouts/3.png
-file path=usr/share/doc/ksh/images/callouts/4.png
-file path=usr/share/doc/ksh/images/callouts/5.png
-file path=usr/share/doc/ksh/images/callouts/6.png
-file path=usr/share/doc/ksh/images/callouts/7.png
-file path=usr/share/doc/ksh/images/callouts/8.png
-file path=usr/share/doc/ksh/images/callouts/9.png
-file path=usr/share/doc/ksh/images/tag_bourne.png
-file path=usr/share/doc/ksh/images/tag_i18n.png
-file path=usr/share/doc/ksh/images/tag_ksh.png
-file path=usr/share/doc/ksh/images/tag_ksh88.png
-file path=usr/share/doc/ksh/images/tag_ksh93.png
-file path=usr/share/doc/ksh/images/tag_l10n.png
-file path=usr/share/doc/ksh/images/tag_perf.png
-file path=usr/share/doc/ksh/shell_styleguide.docbook
-file path=usr/share/doc/ksh/shell_styleguide.html
file path=usr/share/lib/mailx/mailx.help
file path=usr/share/lib/mailx/mailx.help.~
file path=usr/share/lib/tabset/3101
diff --git a/usr/src/pkg/manifests/developer-build-onbld.mf b/usr/src/pkg/manifests/developer-build-onbld.mf
index bf01650e0f..5459ca92ad 100644
--- a/usr/src/pkg/manifests/developer-build-onbld.mf
+++ b/usr/src/pkg/manifests/developer-build-onbld.mf
@@ -23,6 +23,7 @@
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2010, Richard Lowe
# Copyright 2012, Piotr Jasiukajtis
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
#
set name=pkg.fmri value=pkg:/developer/build/onbld@$(PKGVERS)
@@ -171,6 +172,8 @@ file path=opt/onbld/lib/python2.6/onbld/Checks/__init__.py mode=0444
file path=opt/onbld/lib/python2.6/onbld/Checks/__init__.pyc mode=0444
file path=opt/onbld/lib/python2.6/onbld/Scm/Backup.py mode=0444
file path=opt/onbld/lib/python2.6/onbld/Scm/Backup.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/Ignore.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/Ignore.pyc mode=0444
file path=opt/onbld/lib/python2.6/onbld/Scm/Version.py mode=0444
file path=opt/onbld/lib/python2.6/onbld/Scm/Version.pyc mode=0444
file path=opt/onbld/lib/python2.6/onbld/Scm/WorkSpace.py mode=0444
diff --git a/usr/src/pkg/manifests/driver-network-bge.mf b/usr/src/pkg/manifests/driver-network-bge.mf
index 74b2555119..ddf657b4b4 100644
--- a/usr/src/pkg/manifests/driver-network-bge.mf
+++ b/usr/src/pkg/manifests/driver-network-bge.mf
@@ -24,6 +24,9 @@
#
#
+# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+#
+
# The default for payload-bearing actions in this package is to appear in the
# global zone only. See the include file for greater detail, as well as
# information about overriding the defaults.
@@ -57,9 +60,11 @@ $(i386_ONLY)driver name=bge clone_perms="bge 0666 root sys" \
alias=pci14e4,1649 \
alias=pci14e4,1653 \
alias=pci14e4,1654 \
+ alias=pci14e4,1657 \
alias=pci14e4,1659 \
alias=pci14e4,165d \
alias=pci14e4,165e \
+ alias=pci14e4,165f \
alias=pci14e4,1668 \
alias=pci14e4,1669 \
alias=pci14e4,166a \
@@ -79,9 +84,11 @@ $(i386_ONLY)driver name=bge clone_perms="bge 0666 root sys" \
alias=pci14e4,16c7 \
alias=pciex14e4,1655 \
alias=pciex14e4,1656 \
+ alias=pciex14e4,1657 \
alias=pciex14e4,165a \
alias=pciex14e4,165b \
alias=pciex14e4,165c \
+ alias=pciex14e4,165f \
alias=pciex14e4,1673 \
alias=pciex14e4,1674 \
alias=pciex14e4,1677 \
@@ -90,7 +97,13 @@ $(i386_ONLY)driver name=bge clone_perms="bge 0666 root sys" \
alias=pciex14e4,1680 \
alias=pciex14e4,1681 \
alias=pciex14e4,1684 \
+ alias=pciex14e4,1688 \
+ alias=pciex14e4,1689 \
+ alias=pciex14e4,1690 \
+ alias=pciex14e4,1691 \
alias=pciex14e4,1692 \
+ alias=pciex14e4,1694 \
+ alias=pciex14e4,1698 \
alias=pciex14e4,169d \
alias=pciex14e4,16fd \
alias=pciex14e4,1713
diff --git a/usr/src/pkg/manifests/service-file-system-smb.mf b/usr/src/pkg/manifests/service-file-system-smb.mf
index 2ddf448a86..cd3a4ed1a8 100644
--- a/usr/src/pkg/manifests/service-file-system-smb.mf
+++ b/usr/src/pkg/manifests/service-file-system-smb.mf
@@ -22,6 +22,7 @@
#
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
#
set name=pkg.fmri value=pkg:/service/file-system/smb@$(PKGVERS)
diff --git a/usr/src/pkg/manifests/system-zones-brand-joyent.mf b/usr/src/pkg/manifests/system-zones-brand-joyent.mf
new file mode 100644
index 0000000000..33452cdcd7
--- /dev/null
+++ b/usr/src/pkg/manifests/system-zones-brand-joyent.mf
@@ -0,0 +1,54 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+set name=pkg.fmri value=pkg:/system/zones/brand/joyent@$(PKGVERS)
+set name=pkg.description value="Support for the 'joyent' Brand"
+set name=pkg.summary value="Joyent Containers: joyent brand support"
+set name=info.classification \
+ value=org.opensolaris.category.2008:System/Virtualization
+set name=variant.arch value=$(ARCH)
+dir path=etc group=sys
+dir path=etc/zones group=sys
+dir path=lib variant.opensolaris.zone=global
+dir path=lib/svc variant.opensolaris.zone=global
+dir path=lib/svc/manifest group=sys variant.opensolaris.zone=global
+dir path=lib/svc/manifest/system group=sys variant.opensolaris.zone=global
+dir path=lib/svc/method variant.opensolaris.zone=global
+dir path=usr group=sys
+dir path=usr/lib
+dir path=usr/lib/brand
+dir path=usr/lib/brand/joyent group=sys
+file path=etc/zones/Joyent.xml mode=0444
+file path=lib/svc/manifest/system/joyinit.xml group=sys mode=0444 \
+ variant.opensolaris.zone=global
+file path=lib/svc/method/svc-joyinit mode=0555 variant.opensolaris.zone=global
+file path=usr/lib/brand/joyent/config.xml mode=0444
+file path=usr/lib/brand/joyent/jinstall mode=0755
+file path=usr/lib/brand/joyent/juninstall mode=0755
+file path=usr/lib/brand/joyent/pinstall mode=0755
+file path=usr/lib/brand/joyent/platform.xml mode=0444
+file path=usr/lib/brand/joyent/prestate mode=0755
+license lic_CDDL license=lic_CDDL
diff --git a/usr/src/prototypes/prototype.Makefile b/usr/src/prototypes/prototype.Makefile
index b12c91d527..1f7f594507 100644
--- a/usr/src/prototypes/prototype.Makefile
+++ b/usr/src/prototypes/prototype.Makefile
@@ -10,6 +10,6 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
diff --git a/usr/src/prototypes/prototype.c b/usr/src/prototypes/prototype.c
index 816c5475b9..2234c37070 100644
--- a/usr/src/prototypes/prototype.c
+++ b/usr/src/prototypes/prototype.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2012 <contributor>. All rights reserved.
+ * Copyright 2014 <contributor>. All rights reserved.
*/
/*
diff --git a/usr/src/prototypes/prototype.csh b/usr/src/prototypes/prototype.csh
index 38f17e0a09..0d1fa1e22f 100644
--- a/usr/src/prototypes/prototype.csh
+++ b/usr/src/prototypes/prototype.csh
@@ -12,6 +12,6 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
diff --git a/usr/src/prototypes/prototype.h b/usr/src/prototypes/prototype.h
index 4082ec8eae..2d6f691687 100644
--- a/usr/src/prototypes/prototype.h
+++ b/usr/src/prototypes/prototype.h
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2012 <contributor>. All rights reserved.
+ * Copyright 2014 <contributor>. All rights reserved.
*/
#ifndef _PROTOTYPE_H
diff --git a/usr/src/prototypes/prototype.java b/usr/src/prototypes/prototype.java
index b9ffa24112..b937946e02 100644
--- a/usr/src/prototypes/prototype.java
+++ b/usr/src/prototypes/prototype.java
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2012 <contributor>. All rights reserved.
+ * Copyright 2014 <contributor>. All rights reserved.
*/
/*
diff --git a/usr/src/prototypes/prototype.ksh b/usr/src/prototypes/prototype.ksh
index 44c20c48c9..84a311c1df 100644
--- a/usr/src/prototypes/prototype.ksh
+++ b/usr/src/prototypes/prototype.ksh
@@ -12,6 +12,6 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
diff --git a/usr/src/prototypes/prototype.man b/usr/src/prototypes/prototype.man
index 4c07f19993..a0b4f9e7df 100644
--- a/usr/src/prototypes/prototype.man
+++ b/usr/src/prototypes/prototype.man
@@ -9,5 +9,5 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2012 <contributor>. All rights reserved.
+.\" Copyright 2014 <contributor>. All rights reserved.
.\"
diff --git a/usr/src/prototypes/prototype.mapfile-vers b/usr/src/prototypes/prototype.mapfile-vers
index 780ef6c1ef..9f403ffa99 100644
--- a/usr/src/prototypes/prototype.mapfile-vers
+++ b/usr/src/prototypes/prototype.mapfile-vers
@@ -10,7 +10,7 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
#
diff --git a/usr/src/prototypes/prototype.pl b/usr/src/prototypes/prototype.pl
index 53cb464b27..6a2de393f5 100644
--- a/usr/src/prototypes/prototype.pl
+++ b/usr/src/prototypes/prototype.pl
@@ -11,7 +11,7 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
#
diff --git a/usr/src/prototypes/prototype.py b/usr/src/prototypes/prototype.py
index 484eb8c9ba..bec68d22de 100644
--- a/usr/src/prototypes/prototype.py
+++ b/usr/src/prototypes/prototype.py
@@ -11,7 +11,7 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
#
diff --git a/usr/src/prototypes/prototype.s b/usr/src/prototypes/prototype.s
index 5a48f83716..933cec4670 100644
--- a/usr/src/prototypes/prototype.s
+++ b/usr/src/prototypes/prototype.s
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2012 <contributor>. All rights reserved.
+ * Copyright 2014 <contributor>. All rights reserved.
*/
.file "prototype.s"
diff --git a/usr/src/prototypes/prototype.sh b/usr/src/prototypes/prototype.sh
index 9216640337..753e54f151 100644
--- a/usr/src/prototypes/prototype.sh
+++ b/usr/src/prototypes/prototype.sh
@@ -12,6 +12,6 @@
#
#
-# Copyright 2012 <contributor>. All rights reserved.
+# Copyright 2014 <contributor>. All rights reserved.
#
diff --git a/usr/src/psm/stand/bootblks/ufs/i386/mboot.S b/usr/src/psm/stand/bootblks/ufs/i386/mboot.S
index 48afbae207..756a643482 100644
--- a/usr/src/psm/stand/bootblks/ufs/i386/mboot.S
+++ b/usr/src/psm/stand/bootblks/ufs/i386/mboot.S
@@ -23,6 +23,7 @@
* Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
* Use is subject to license terms.
*/
diff --git a/usr/src/stand/lib/fs/hsfs/hsfsops.c b/usr/src/stand/lib/fs/hsfs/hsfsops.c
index 0119d3fe99..21f8c37081 100644
--- a/usr/src/stand/lib/fs/hsfs/hsfsops.c
+++ b/usr/src/stand/lib/fs/hsfs/hsfsops.c
@@ -1026,6 +1026,7 @@ boot_hsfs_getdents(int fd, struct dirent *dep, unsigned size)
* alignment.
*/
n = strlen(hdp->hs_ufs_dir.d_name);
+
n = roundup((sizeof (struct dirent) + ((n > SLOP) ? n : 0)),
sizeof (off_t));
diff --git a/usr/src/stand/lib/wanboot/Makefile b/usr/src/stand/lib/wanboot/Makefile
index 0d060d2921..d906c6a15c 100644
--- a/usr/src/stand/lib/wanboot/Makefile
+++ b/usr/src/stand/lib/wanboot/Makefile
@@ -32,7 +32,7 @@ include ../Makefile.com
CMNDIR = $(CMNNETDIR)/wanboot
SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(CMNOBJS:%.o=$(CMNDIR)/%.c)
-LDLIBS += -lcrypto -lsock -linet -lssl -lnvpair
+LDLIBS += -lsunw_crypto -lsock -linet -lsunw_ssl -lnvpair
CPPFLAGS += -I$(CMNNETDIR)/dhcp -I$(TOPDIR)/common/net/wanboot/crypt \
-I../inet $(DHCPCPPFLAGS) $(SOCKCPPFLAGS)
diff --git a/usr/src/tools/README.tools b/usr/src/tools/README.tools
index 6cb51f028a..323d6c679c 100644
--- a/usr/src/tools/README.tools
+++ b/usr/src/tools/README.tools
@@ -192,6 +192,9 @@ findunref
sort > ~/unref-sparc.out
$ comm -12 ~/unref-i386.out ~/unref-sparc.out > ~/unref.out
+git-active
+ helper used by webrev to generate file lists for Git workspaces.
+
hdrchk
checks headers for compliance with OS/Net standards (form, includes,
C++ guards).
diff --git a/usr/src/tools/cscope-fast/Makefile b/usr/src/tools/cscope-fast/Makefile
index 6a2270bbed..0237a6e9e9 100644
--- a/usr/src/tools/cscope-fast/Makefile
+++ b/usr/src/tools/cscope-fast/Makefile
@@ -34,6 +34,7 @@ OBJS= main.o dir.o crossref.o scanner.o lookup.o command.o display.o \
vpaccess.o vpfopen.o vpinit.o vpopen.o vpstat.o
SRCS= $(OBJS:%.o=%.c)
CLEANFILES += $(OBJS)
+CLOBBERFILES += scanner.c
TMPDIR= /tmp
include ../Makefile.tools
diff --git a/usr/src/tools/ctf/common/ctf_headers.h b/usr/src/tools/ctf/common/ctf_headers.h
index b00b8fd9a6..268ae79077 100644
--- a/usr/src/tools/ctf/common/ctf_headers.h
+++ b/usr/src/tools/ctf/common/ctf_headers.h
@@ -27,8 +27,6 @@
#ifndef _CTF_HEADERS_H
#define _CTF_HEADERS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Because the ON tools are executed on the system where they are built,
* the tools need to include the headers installed on the build system,
@@ -69,4 +67,15 @@
#include <uts/common/sys/ctf_api.h>
#include <lib/libctf/common/libctf.h>
+/*
+ * XXX: This is hack to deal with GCC 4.x removing __builtin_stdarg_start
+ *
+ * We need to build on systems that don't have the fixed va_impl.h on the
+ * system, to achieve that, we stub it out here and in all similar places to
+ * give us a leg up.
+ */
+#if __GNUC__ >= 4
+#define __builtin_stdarg_start(list, name) __builtin_va_start(list, name)
+#endif
+
#endif /* _CTF_HEADERS_H */
diff --git a/usr/src/tools/ctf/common/utils.h b/usr/src/tools/ctf/common/utils.h
index 9b07361a53..4ae2dd0917 100644
--- a/usr/src/tools/ctf/common/utils.h
+++ b/usr/src/tools/ctf/common/utils.h
@@ -27,9 +27,8 @@
#ifndef _UTILS_H
#define _UTILS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdarg.h>
+#include <ctf_headers.h>
#ifdef __cplusplus
extern "C" {
diff --git a/usr/src/tools/ctf/cvt/ctftools.h b/usr/src/tools/ctf/cvt/ctftools.h
index 991f3bc921..f586236ccf 100644
--- a/usr/src/tools/ctf/cvt/ctftools.h
+++ b/usr/src/tools/ctf/cvt/ctftools.h
@@ -26,8 +26,6 @@
#ifndef _CTFTOOLS_H
#define _CTFTOOLS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Functions and data structures used in the manipulation of stabs and CTF data
*/
@@ -43,6 +41,17 @@
extern "C" {
#endif
+/*
+ * XXX: This is hack to deal with GCC 4.x removing __builtin_stdarg_start
+ *
+ * We need to build on systems that don't have the fixed va_impl.h on the
+ * system, to achieve that, we stub it out here and in all similar places to
+ * give us a leg up.
+ */
+#if __GNUC__ >= 4
+#define __builtin_stdarg_start(list, name) __builtin_va_start(list, name)
+#endif
+
#include "list.h"
#include "hash.h"
diff --git a/usr/src/tools/findunref/exception_list.git b/usr/src/tools/findunref/exception_list.git
new file mode 100644
index 0000000000..d14dbd22f0
--- /dev/null
+++ b/usr/src/tools/findunref/exception_list.git
@@ -0,0 +1,39 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Cyril Plisko. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Git-specific exception list
+#
+# See README.exception_lists for details
+#
+
+#
+# Without nested repositories, this list could be empty, because ON
+# checks for unref relative to usr, and the git files are all in the
+# root of the repository.
+#
+
+*/.git
diff --git a/usr/src/tools/findunref/exception_list.unknown b/usr/src/tools/findunref/exception_list.unknown
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/usr/src/tools/findunref/exception_list.unknown
diff --git a/usr/src/tools/onbld/Checks/Cddl.py b/usr/src/tools/onbld/Checks/Cddl.py
index 1f5f99f953..0f4d995e89 100644
--- a/usr/src/tools/onbld/Checks/Cddl.py
+++ b/usr/src/tools/onbld/Checks/Cddl.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
CDDL = '''
CDDL HEADER START
diff --git a/usr/src/tools/onbld/Checks/CmtBlk.py b/usr/src/tools/onbld/Checks/CmtBlk.py
index 2f3d29fa79..ddf5caec48 100644
--- a/usr/src/tools/onbld/Checks/CmtBlk.py
+++ b/usr/src/tools/onbld/Checks/CmtBlk.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
diff --git a/usr/src/tools/onbld/Checks/Comments.py b/usr/src/tools/onbld/Checks/Comments.py
index daf6aa47d9..6304e59818 100644
--- a/usr/src/tools/onbld/Checks/Comments.py
+++ b/usr/src/tools/onbld/Checks/Comments.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/Copyright.py b/usr/src/tools/onbld/Checks/Copyright.py
index 81a80058aa..8071b7f435 100644
--- a/usr/src/tools/onbld/Checks/Copyright.py
+++ b/usr/src/tools/onbld/Checks/Copyright.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/DbLookups.py b/usr/src/tools/onbld/Checks/DbLookups.py
index 11fd4185be..15f889e8d2 100644
--- a/usr/src/tools/onbld/Checks/DbLookups.py
+++ b/usr/src/tools/onbld/Checks/DbLookups.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/HdrChk.py b/usr/src/tools/onbld/Checks/HdrChk.py
index c2697dcaf2..8f7b946d12 100644
--- a/usr/src/tools/onbld/Checks/HdrChk.py
+++ b/usr/src/tools/onbld/Checks/HdrChk.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/Keywords.py b/usr/src/tools/onbld/Checks/Keywords.py
index 5c374c3abb..ac3555be32 100644
--- a/usr/src/tools/onbld/Checks/Keywords.py
+++ b/usr/src/tools/onbld/Checks/Keywords.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
@@ -24,8 +24,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# Mercurial (lack of) keyword checks
diff --git a/usr/src/tools/onbld/Checks/Mapfile.py b/usr/src/tools/onbld/Checks/Mapfile.py
index 2a8cb74aed..d4fa70d141 100644
--- a/usr/src/tools/onbld/Checks/Mapfile.py
+++ b/usr/src/tools/onbld/Checks/Mapfile.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/__init__.py b/usr/src/tools/onbld/Checks/__init__.py
index 4bb5f3e262..b7ecf0e881 100644
--- a/usr/src/tools/onbld/Checks/__init__.py
+++ b/usr/src/tools/onbld/Checks/__init__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Scm/Ignore.py b/usr/src/tools/onbld/Scm/Ignore.py
new file mode 100644
index 0000000000..048b46ba6f
--- /dev/null
+++ b/usr/src/tools/onbld/Scm/Ignore.py
@@ -0,0 +1,91 @@
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE
+#
+# Copyright (c) 2013, Joyent Inc. All rights reserved.
+#
+
+'''
+Process our ignore/exception_list file format.
+
+The format is broadly similar, if not identical, to .gitignore and .hgignore
+files.
+'''
+
+import re
+import fnmatch
+
+RE_SYNTAX = re.compile(r'^syntax:\s*(.*)\s*$')
+
+#
+# It is important that this module not rely on Mercurial
+#
+
+def _read_ignore_file(ignorefile):
+ '''Read an ignore file and return an array of regular expressions
+ to match ignored paths.'''
+
+ syntax = 'regex'
+ ignore_list = []
+ lc = 0
+
+ with open(ignorefile, 'r') as f:
+ for l in f:
+ lc += 1
+ # Remove comments and blank lines
+ l = l.split('#', 2)[0].strip()
+ if l == '':
+ continue
+ # Process "syntax:" lines
+ m = RE_SYNTAX.match(l)
+ if m:
+ syntax = m.group(1)
+ continue
+ # All other lines are considered patterns
+ if (syntax == 'glob'):
+ ignore_list.append(re.compile('.*' + fnmatch.translate(l)))
+ elif (syntax == 'regex'):
+ ignore_list.append(re.compile(l))
+ else:
+ raise Exception('%s:%d: syntax "%s" is not supported' %
+ (ignorefile, lc, syntax))
+
+ return ignore_list
+
+def ignore(root, ignorefiles):
+ # If we aren't provided any ignore files, we'll never ignore
+ # any paths:
+ if (len(ignorefiles) < 1):
+ return lambda x: False
+
+ ignore_list = []
+ for ignorefile in ignorefiles:
+ ignore_list.extend(_read_ignore_file(ignorefile))
+
+ # If the ignore files contained no patterns, we'll never ignore
+ # any paths:
+ if (len(ignore_list) < 1):
+ return lambda x: False
+
+ def _ignore_func(path):
+ for regex in ignore_list:
+ if (regex.match(path)):
+ return True
+ return False
+
+ return _ignore_func
diff --git a/usr/src/tools/onbld/Scm/Makefile b/usr/src/tools/onbld/Scm/Makefile
index a31f7e5c87..26a3a4ccfc 100644
--- a/usr/src/tools/onbld/Scm/Makefile
+++ b/usr/src/tools/onbld/Scm/Makefile
@@ -21,6 +21,7 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, Joyent Inc. All rights reserved.
#
include $(SRC)/Makefile.master
@@ -29,6 +30,7 @@ include ../../Makefile.tools
PYSRCS = \
__init__.py \
Backup.py \
+ Ignore.py \
Version.py \
WorkSpace.py
diff --git a/usr/src/tools/onbld/Scm/__init__.py b/usr/src/tools/onbld/Scm/__init__.py
index f45ecbc95f..8934eb3942 100644
--- a/usr/src/tools/onbld/Scm/__init__.py
+++ b/usr/src/tools/onbld/Scm/__init__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
@@ -24,5 +24,3 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
diff --git a/usr/src/tools/onbld/hgext/__init__.py b/usr/src/tools/onbld/hgext/__init__.py
index f45ecbc95f..8934eb3942 100644
--- a/usr/src/tools/onbld/hgext/__init__.py
+++ b/usr/src/tools/onbld/hgext/__init__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
@@ -24,5 +24,3 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
diff --git a/usr/src/tools/onbld/hgext/cdm.py b/usr/src/tools/onbld/hgext/cdm.py
index 0ce41d4dad..a04317fff9 100644
--- a/usr/src/tools/onbld/hgext/cdm.py
+++ b/usr/src/tools/onbld/hgext/cdm.py
@@ -16,6 +16,7 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2008, 2011 Richard Lowe
+# Copyright (c) 2013, Joyent Inc. All rights reserved.
#
'''OpenSolaris extensions to Mercurial
@@ -92,6 +93,7 @@ sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "..", "..",
sys.path.insert(2, os.path.join(os.path.dirname(__file__), "..", ".."))
from onbld.Scm import Version
+from onbld.Scm import Ignore
from mercurial import util
try:
@@ -99,7 +101,7 @@ try:
except Version.VersionMismatch, badversion:
raise util.Abort("Version Mismatch:\n %s\n" % badversion)
-from mercurial import cmdutil, ignore, node, patch
+from mercurial import cmdutil, node, patch
from onbld.Scm.WorkSpace import WorkSpace, WorkList
from onbld.Scm.Backup import CdmBackup
@@ -167,7 +169,7 @@ def not_check(repo, cmd):
ignorefiles.append(f)
if ignorefiles:
- ign = ignore.ignore(repo.root, ignorefiles, repo.ui.warn)
+ ign = Ignore.ignore(repo.root, ignorefiles)
return canonified_check(ign)
else:
return util.never
diff --git a/usr/src/tools/scripts/cddlchk.py b/usr/src/tools/scripts/cddlchk.py
index 816d2f33a7..ad6a6e6f56 100644
--- a/usr/src/tools/scripts/cddlchk.py
+++ b/usr/src/tools/scripts/cddlchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/copyrightchk.py b/usr/src/tools/scripts/copyrightchk.py
index 210ef1b46c..f778947bfc 100644
--- a/usr/src/tools/scripts/copyrightchk.py
+++ b/usr/src/tools/scripts/copyrightchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py
index 656e22f6b4..82a63df70a 100644
--- a/usr/src/tools/scripts/git-pbchk.py
+++ b/usr/src/tools/scripts/git-pbchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
@@ -17,6 +17,7 @@
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2008, 2012 Richard Lowe
+# Copyright (c) 2013, Joyent Inc. All rights reserved.
#
import getopt
@@ -28,10 +29,6 @@ import tempfile
from cStringIO import StringIO
-# This is necessary because, in a fit of pique, we used hg-format ignore lists
-# for NOT files.
-from mercurial import ignore
-
#
# Adjust the load path based on our location and the version of python into
# which it is being loaded. This assumes the normal onbld directory
@@ -47,6 +44,7 @@ sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
#
sys.path.insert(2, os.path.join(os.path.dirname(__file__), ".."))
+from onbld.Scm import Ignore
from onbld.Checks import Comments, Copyright, CStyle, HdrChk
from onbld.Checks import JStyle, Keywords, Mapfile
@@ -177,10 +175,7 @@ def not_check(root, cmd):
ignorefiles = filter(os.path.exists,
[os.path.join(root, ".git", "%s.NOT" % cmd),
os.path.join(root, "exception_lists", cmd)])
- if len(ignorefiles) > 0:
- return ignore.ignore(root, ignorefiles, sys.stderr.write)
- else:
- return lambda x: False
+ return Ignore.ignore(root, ignorefiles)
def gen_files(root, parent, paths, exclude):
diff --git a/usr/src/tools/scripts/hdrchk.py b/usr/src/tools/scripts/hdrchk.py
index 84acbc8616..aa62f7b090 100644
--- a/usr/src/tools/scripts/hdrchk.py
+++ b/usr/src/tools/scripts/hdrchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/hg-active.py b/usr/src/tools/scripts/hg-active.py
index 88394e98e5..23f6c7cd98 100644
--- a/usr/src/tools/scripts/hg-active.py
+++ b/usr/src/tools/scripts/hg-active.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
diff --git a/usr/src/tools/scripts/mapfilechk.py b/usr/src/tools/scripts/mapfilechk.py
index 9cf2000c7a..ed90d8b426 100644
--- a/usr/src/tools/scripts/mapfilechk.py
+++ b/usr/src/tools/scripts/mapfilechk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/nightly.sh b/usr/src/tools/scripts/nightly.sh
index 664c05ffa5..87c038452e 100644
--- a/usr/src/tools/scripts/nightly.sh
+++ b/usr/src/tools/scripts/nightly.sh
@@ -25,6 +25,7 @@
# Copyright 2008, 2010, Richard Lowe
# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
# Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
+# Copyright 2013 (c) Joyent, Inc. All rights reserved.
#
# Based on the nightly script from the integration folks,
# Mostly modified and owned by mike_s.
@@ -413,6 +414,9 @@ function build {
rm -rf $PKGARCHIVE >> "$LOGFILE" 2>&1
mkdir -p $PKGARCHIVE >> "$LOGFILE" 2>&1
+ /bin/time $MAKE -e stage-licenses 2>&1 | \
+ tee -a $SRC/$d/${INSTALLOG}.out >> $LOGFILE
+
for d in pkg pkgdefs; do
if [ ! -f "$SRC/$d/Makefile" ]; then
continue
@@ -1172,38 +1176,16 @@ elif [[ ! -x "$MAKE" ]]; then
fi
# get the dmake version string alone
DMAKE_VERSION=$( $MAKE -v )
-DMAKE_VERSION=${DMAKE_VERSION#*: }
-# focus in on just the dotted version number alone
-DMAKE_MAJOR=$( echo $DMAKE_VERSION | \
- sed -e 's/.*\<\([^.]*\.[^ ]*\).*$/\1/' )
-# extract the second (or final) integer
-DMAKE_MINOR=${DMAKE_MAJOR#*.}
-DMAKE_MINOR=${DMAKE_MINOR%%.*}
-# extract the first integer
-DMAKE_MAJOR=${DMAKE_MAJOR%%.*}
-CHECK_DMAKE=${CHECK_DMAKE:-y}
-# x86 was built on the 12th, sparc on the 13th.
-if [ "$CHECK_DMAKE" = "y" -a \
- "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/12" -a \
- "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/13" -a \( \
- "$DMAKE_MAJOR" -lt 7 -o \
- "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
- if [ -z "$DMAKE_VERSION" ]; then
- echo "$MAKE is missing."
- exit 1
- fi
- echo `whence $MAKE`" version is:"
- echo " ${DMAKE_VERSION}"
+# Admittedly not the best check, but better than the old one.
+if ! echo $DMAKE_VERSION | grep -q rm; then
cat <<EOF
-
-This version may not be safe for use. Either set TEAMWARE to a better
-path or (if you really want to use this version of dmake anyway), add
-the following to your environment to disable this check:
-
- CHECK_DMAKE=n
+The version of dmake you are using ($DMAKE_VERSION) is not the current open
+source version for building illumos. Please ensure that you are building
+illumos-joyent with the latest version of dmake in illumos-extra.
EOF
exit 1
fi
+
export PATH
export MAKE
diff --git a/usr/src/tools/scripts/validate_pkg.py b/usr/src/tools/scripts/validate_pkg.py
index 2ac1e009d0..5bf8bd84f2 100644
--- a/usr/src/tools/scripts/validate_pkg.py
+++ b/usr/src/tools/scripts/validate_pkg.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/webrev.sh b/usr/src/tools/scripts/webrev.sh
index 7df8aa8b52..e3c1631c1b 100644
--- a/usr/src/tools/scripts/webrev.sh
+++ b/usr/src/tools/scripts/webrev.sh
@@ -3057,7 +3057,12 @@ done
#
# Output directory.
#
-WDIR=${WDIR:-$CWS/webrev}
+if [[ $SCM_MODE == "git" ]]; then
+ ws_top_dir=$(dirname $CWS)
+ WDIR=${WDIR:-$ws_top_dir/webrev}
+else
+ WDIR=${WDIR:-$CWS/webrev}
+fi
#
# Name of the webrev, derived from the workspace name or output directory;
@@ -3685,6 +3690,7 @@ do
if [[ $SCM_MODE == "teamware" ||
$SCM_MODE == "mercurial" ||
+ $SCM_MODE == "git" ||
$SCM_MODE == "unknown" ]]; then
# Include warnings for important file mode situations:
diff --git a/usr/src/tools/scripts/wsdiff.py b/usr/src/tools/scripts/wsdiff.py
index 27458f43fc..4ae79e889f 100644
--- a/usr/src/tools/scripts/wsdiff.py
+++ b/usr/src/tools/scripts/wsdiff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/ucbhead/Makefile b/usr/src/ucbhead/Makefile
new file mode 100644
index 0000000000..ef9fc7f2fe
--- /dev/null
+++ b/usr/src/ucbhead/Makefile
@@ -0,0 +1,68 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 1989-2003 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ucbhead/Makefile
+#
+# include global definitions
+include ../Makefile.master
+
+LN= ln
+
+HDRS= curses.h dbm.h setjmp.h sgtty.h signal.h stdio.h strings.h unistd.h
+
+SYSHDRS= \
+dir.h fcntl.h file.h ioctl.h \
+param.h resource.h rusage.h signal.h \
+sysmacros.h ttychars.h types.h vfs.h \
+wait.h
+
+ROOTHDRS= $(HDRS:%=$(ROOT)/usr/ucbinclude/%) \
+ $(SYSHDRS:%=$(ROOT)/usr/ucbinclude/sys/%)
+
+DIRS= sys
+ROOTDIRS= $(ROOT)/usr/ucbinclude $(DIRS:%=$(ROOT)/usr/ucbinclude/%)
+
+FCNTLH= $(ROOT)/usr/ucbinclude/fcntl.h
+SYSFCNTLH= $(ROOT)/usr/ucbinclude/sys/fcntl.h
+
+INS.FCNTLH= $(RM) $@; $(SYMLINK) sys/fcntl.h $@
+
+# install rules
+$(ROOT)/usr/ucbinclude/sys/%: sys/%
+ $(INS.file)
+
+$(ROOT)/usr/ucbinclude/%: %
+ $(INS.file)
+
+.KEEP_STATE:
+
+install_h: $(ROOTDIRS) $(ROOTHDRS) $(FCNTLH)
+
+$(FCNTLH): $(SYSFCNTLH)
+ $(INS.FCNTLH)
+
+$(ROOTDIRS):
+ $(INS.dir)
+
diff --git a/usr/src/ucbhead/sys/file.h b/usr/src/ucbhead/sys/file.h
index 10863380dd..152141fcd7 100644
--- a/usr/src/ucbhead/sys/file.h
+++ b/usr/src/ucbhead/sys/file.h
@@ -77,6 +77,10 @@ typedef struct file
#include <sys/fcntl.h>
#endif
+#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
+int flock(int, int);
+#endif
+
/* flags - see also fcntl.h */
#ifndef FOPEN
diff --git a/usr/src/uts/Makefile.uts b/usr/src/uts/Makefile.uts
index ae53983d07..33de8780bd 100644
--- a/usr/src/uts/Makefile.uts
+++ b/usr/src/uts/Makefile.uts
@@ -213,6 +213,7 @@ AS_CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \
# Override the default, the kernel is squeaky clean
CERRWARN = -errtags=yes -errwarn=%all
+$(__GNUC4)CERRWARN += -_gcc=-Wno-address
CERRWARN += -_gcc=-Wno-missing-braces
CERRWARN += -_gcc=-Wno-sign-compare
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files
index 8bfdd21877..9c19ebf1a5 100644
--- a/usr/src/uts/common/Makefile.files
+++ b/usr/src/uts/common/Makefile.files
@@ -21,6 +21,7 @@
#
# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
# Copyright (c) 2013 by Delphix. All rights reserved.
# Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
@@ -1146,8 +1147,13 @@ PIPE_OBJS += pipe.o
HSFS_OBJS += hsfs_node.o hsfs_subr.o hsfs_vfsops.o hsfs_vnops.o \
hsfs_susp.o hsfs_rrip.o hsfs_susp_subr.o
+HYPRLOFS_OBJS += hyprlofs_dir.o hyprlofs_subr.o \
+ hyprlofs_vnops.o hyprlofs_vfsops.o
+
LOFS_OBJS += lofs_subr.o lofs_vfsops.o lofs_vnops.o
+LXPROC_OBJS += lxpr_subr.o lxpr_vfsops.o lxpr_vnops.o
+
NAMEFS_OBJS += namevfs.o namevno.o
NFS_OBJS += nfs_client.o nfs_common.o nfs_dump.o \
@@ -1393,6 +1399,7 @@ ZFS_COMMON_OBJS += \
zfs_fuid.o \
zfs_sa.o \
zfs_znode.o \
+ zfs_zone.o \
zil.o \
zio.o \
zio_checksum.o \
@@ -2037,6 +2044,11 @@ MEGA_SAS_OBJS = megaraid_sas.o
MR_SAS_OBJS = ld_pd_map.o mr_sas.o mr_sas_tbolt.o mr_sas_list.o
#
+# DR_SAS module
+#
+DR_SAS_OBJS = dr_sas.o
+
+#
# CPQARY3 module
#
CPQARY3_OBJS = cpqary3.o cpqary3_noe.o cpqary3_talk2ctlr.o \
diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules
index 407bf4e26c..465f1c8e72 100644
--- a/usr/src/uts/common/Makefile.rules
+++ b/usr/src/uts/common/Makefile.rules
@@ -21,6 +21,10 @@
#
# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# Copyright (c) 2012 Joyent, Inc. All rights reserved.
# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
# Copyright 2013 Garrett D'Amore <garrett@damore.org>
#
@@ -103,6 +107,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/brand/sn1/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/common/brand/sngl/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/brand/solaris10/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -243,10 +251,18 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/fs/hsfs/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/common/fs/hyprlofs/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/fs/lofs/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/common/fs/lxproc/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/fs/mntfs/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -726,6 +742,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/drm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/dr_sas/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/efe/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -1622,6 +1642,9 @@ $(LINTS_DIR)/%.ln: $(COMMONBASE)/ucode/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/brand/sn1/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/brand/sngl/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/brand/solaris10/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
@@ -1751,9 +1774,15 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/common/fs/fifofs/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/fs/hsfs/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/fs/hyprlofs/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/fs/lofs/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/fs/lxproc/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/fs/mntfs/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
@@ -2075,6 +2104,9 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/dmfe/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/drm/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/dr_sas/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/efe/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
diff --git a/usr/src/uts/common/brand/sngl/sngl_brand.c b/usr/src/uts/common/brand/sngl/sngl_brand.c
new file mode 100644
index 0000000000..23e23286ea
--- /dev/null
+++ b/usr/src/uts/common/brand/sngl/sngl_brand.c
@@ -0,0 +1,250 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/errno.h>
+#include <sys/exec.h>
+#include <sys/file.h>
+#include <sys/kmem.h>
+#include <sys/modctl.h>
+#include <sys/model.h>
+#include <sys/proc.h>
+#include <sys/syscall.h>
+#include <sys/systm.h>
+#include <sys/thread.h>
+#include <sys/cmn_err.h>
+#include <sys/archsystm.h>
+#include <sys/pathname.h>
+#include <sys/sunddi.h>
+
+#include <sys/machbrand.h>
+#include <sys/brand.h>
+#include "sngl_brand.h"
+
+char *sngl_emulation_table = NULL;
+
+void sngl_init_brand_data(zone_t *);
+void sngl_free_brand_data(zone_t *);
+void sngl_setbrand(proc_t *);
+int sngl_getattr(zone_t *, int, void *, size_t *);
+int sngl_setattr(zone_t *, int, void *, size_t);
+int sngl_brandsys(int, int64_t *, uintptr_t, uintptr_t, uintptr_t,
+ uintptr_t, uintptr_t, uintptr_t);
+void sngl_copy_procdata(proc_t *, proc_t *);
+void sngl_proc_exit(struct proc *, klwp_t *);
+void sngl_exec();
+int sngl_initlwp(klwp_t *);
+void sngl_forklwp(klwp_t *, klwp_t *);
+void sngl_freelwp(klwp_t *);
+void sngl_lwpexit(klwp_t *);
+int sngl_elfexec(vnode_t *, execa_t *, uarg_t *, intpdata_t *, int,
+ long *, int, caddr_t, cred_t *, int);
+
+/* SNGL brand */
+struct brand_ops sngl_brops = {
+ sngl_init_brand_data,
+ sngl_free_brand_data,
+ sngl_brandsys,
+ sngl_setbrand,
+ sngl_getattr,
+ sngl_setattr,
+ sngl_copy_procdata,
+ sngl_proc_exit,
+ sngl_exec,
+ lwp_setrval,
+ sngl_initlwp,
+ sngl_forklwp,
+ sngl_freelwp,
+ sngl_lwpexit,
+ sngl_elfexec,
+ NULL,
+ NULL,
+ NSIG,
+};
+
+#ifdef __amd64
+
+struct brand_mach_ops sngl_mops = {
+ sngl_brand_sysenter_callback,
+ sngl_brand_int91_callback,
+ sngl_brand_syscall_callback,
+ sngl_brand_syscall32_callback
+};
+
+#else /* ! __amd64 */
+
+struct brand_mach_ops sngl_mops = {
+ sngl_brand_sysenter_callback,
+ NULL,
+ sngl_brand_syscall_callback,
+ NULL
+};
+#endif /* __amd64 */
+
+struct brand sngl_brand = {
+ BRAND_VER_1,
+ "sngl",
+ &sngl_brops,
+ &sngl_mops
+};
+
+static struct modlbrand modlbrand = {
+ &mod_brandops, /* type of module */
+ "SNGL Brand", /* description of module */
+ &sngl_brand /* driver ops */
+};
+
+static struct modlinkage modlinkage = {
+ MODREV_1, (void *)&modlbrand, NULL
+};
+
+void
+sngl_setbrand(proc_t *p)
+{
+ brand_solaris_setbrand(p, &sngl_brand);
+}
+
+/*ARGSUSED*/
+int
+sngl_getattr(zone_t *zone, int attr, void *buf, size_t *bufsize)
+{
+ return (EINVAL);
+}
+
+/*ARGSUSED*/
+int
+sngl_setattr(zone_t *zone, int attr, void *buf, size_t bufsize)
+{
+ return (EINVAL);
+}
+
+/*ARGSUSED*/
+int
+sngl_brandsys(int cmd, int64_t *rval, uintptr_t arg1, uintptr_t arg2,
+ uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, uintptr_t arg6)
+{
+ int res;
+
+ *rval = 0;
+ res = brand_solaris_cmd(cmd, arg1, arg2, arg3, &sngl_brand, SNGL_VERSION);
+ if (res >= 0)
+ return (res);
+
+ return (EINVAL);
+}
+
+void
+sngl_copy_procdata(proc_t *child, proc_t *parent)
+{
+ brand_solaris_copy_procdata(child, parent, &sngl_brand);
+}
+
+void
+sngl_proc_exit(struct proc *p, klwp_t *l)
+{
+ brand_solaris_proc_exit(p, l, &sngl_brand);
+}
+
+void
+sngl_exec()
+{
+ brand_solaris_exec(&sngl_brand);
+}
+
+int
+sngl_initlwp(klwp_t *l)
+{
+ return (brand_solaris_initlwp(l, &sngl_brand));
+}
+
+void
+sngl_forklwp(klwp_t *p, klwp_t *c)
+{
+ brand_solaris_forklwp(p, c, &sngl_brand);
+}
+
+void
+sngl_freelwp(klwp_t *l)
+{
+ brand_solaris_freelwp(l, &sngl_brand);
+}
+
+void
+sngl_lwpexit(klwp_t *l)
+{
+ brand_solaris_lwpexit(l, &sngl_brand);
+}
+
+void
+sngl_free_brand_data(zone_t *zone)
+{
+}
+
+void
+sngl_init_brand_data(zone_t *zone)
+{
+}
+
+int
+sngl_elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
+ int level, long *execsz, int setid, caddr_t exec_file, cred_t *cred,
+ int brand_action)
+{
+ return (brand_solaris_elfexec(vp, uap, args, idatap, level, execsz,
+ setid, exec_file, cred, brand_action, &sngl_brand, SNGL_BRANDNAME,
+ SNGL_LIB, SNGL_LIB32, SNGL_LINKER, SNGL_LINKER32));
+}
+
+int
+_init(void)
+{
+ int err;
+
+ /*
+ * Set up the table to interpose on open.
+ */
+ sngl_emulation_table = kmem_zalloc(NSYSCALL, KM_SLEEP);
+ sngl_emulation_table[SYS_open] = 1; /* 5 */
+
+ err = mod_install(&modlinkage);
+ if (err) {
+ cmn_err(CE_WARN, "Couldn't install brand module");
+ kmem_free(sngl_emulation_table, NSYSCALL);
+ }
+
+ return (err);
+}
+
+int
+_info(struct modinfo *modinfop)
+{
+ return (mod_info(&modlinkage, modinfop));
+}
+
+int
+_fini(void)
+{
+ return (brand_solaris_fini(&sngl_emulation_table, &modlinkage,
+ &sngl_brand));
+}
diff --git a/usr/src/uts/common/brand/sngl/sngl_brand.h b/usr/src/uts/common/brand/sngl/sngl_brand.h
new file mode 100644
index 0000000000..22bcb7aa9e
--- /dev/null
+++ b/usr/src/uts/common/brand/sngl/sngl_brand.h
@@ -0,0 +1,72 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#ifndef _SNGL_BRAND_H
+#define _SNGL_BRAND_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/brand.h>
+
+#define SNGL_BRANDNAME "sngl"
+
+#define SNGL_VERSION 1
+
+#define SNGL_LIB_NAME "sngl_brand.so.1"
+#define SNGL_LINKER_NAME "ld.so.1"
+
+#define SNGL_LIB32 "/system/usr/lib/" SNGL_LIB_NAME
+#define SNGL_LINKER32 "/lib/" SNGL_LINKER_NAME
+
+#define SNGL_LIB64 "/system/usr/lib/64/" SNGL_LIB_NAME
+#define SNGL_LINKER64 "/lib/64/" SNGL_LINKER_NAME
+
+#if defined(_LP64)
+#define SNGL_LIB SNGL_LIB64
+#define SNGL_LINKER SNGL_LINKER64
+#else /* !_LP64 */
+#define SNGL_LIB SNGL_LIB32
+#define SNGL_LINKER SNGL_LINKER32
+#endif /* !_LP64 */
+
+#if defined(_KERNEL)
+
+void sngl_brand_syscall_callback(void);
+void sngl_brand_sysenter_callback(void);
+
+#if defined(__amd64)
+void sngl_brand_syscall32_callback(void);
+void sngl_brand_int91_callback(void);
+#endif /* __amd64 */
+
+#endif /* _KERNEL */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SNGL_BRAND_H */
diff --git a/usr/src/uts/common/conf/param.c b/usr/src/uts/common/conf/param.c
index 505aceadac..7a7b9a208b 100644
--- a/usr/src/uts/common/conf/param.c
+++ b/usr/src/uts/common/conf/param.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
*/
@@ -557,8 +558,8 @@ char *isa_list = architecture;
static pgcnt_t original_physmem = 0;
#define MIN_DEFAULT_MAXUSERS 8u
-#define MAX_DEFAULT_MAXUSERS 2048u
-#define MAX_MAXUSERS 4096u
+#define MAX_DEFAULT_MAXUSERS 10000u
+#define MAX_MAXUSERS 20000u
void
param_preset(void)
@@ -570,7 +571,7 @@ void
param_calc(int platform_max_nprocs)
{
/*
- * Default to about one "user" per megabyte, taking into
+ * Default to about one "user" per 8MB, taking into
* account both physical and virtual constraints.
* Note: 2^20 is a meg; shifting right by (20 - PAGESHIFT)
* converts pages to megs without integer overflow.
@@ -584,8 +585,9 @@ param_calc(int platform_max_nprocs)
if (maxusers == 0) {
pgcnt_t physmegs = physmem >> (20 - PAGESHIFT);
pgcnt_t virtmegs = vmem_size(heap_arena, VMEM_FREE) >> 20;
- maxusers = MIN(MAX(MIN(physmegs, virtmegs),
- MIN_DEFAULT_MAXUSERS), MAX_DEFAULT_MAXUSERS);
+ maxusers = MIN(physmegs, virtmegs) >> 3; /* divide by 8 */
+ maxusers = MAX(maxusers, MIN_DEFAULT_MAXUSERS);
+ maxusers = MIN(maxusers, MAX_DEFAULT_MAXUSERS);
}
if (maxusers > MAX_MAXUSERS) {
maxusers = MAX_MAXUSERS;
diff --git a/usr/src/uts/common/crypto/api/kcf_random.c b/usr/src/uts/common/crypto/api/kcf_random.c
index fc77b8d78b..7766d8ba7a 100644
--- a/usr/src/uts/common/crypto/api/kcf_random.c
+++ b/usr/src/uts/common/crypto/api/kcf_random.c
@@ -69,6 +69,7 @@
#include <sys/cpuvar.h>
#include <sys/taskq.h>
#include <rng/fips_random.h>
+#include <sys/strlog.h>
#define RNDPOOLSIZE 1024 /* Pool size in bytes */
#define MINEXTRACTBYTES 20
@@ -932,7 +933,8 @@ rnd_handler(void *arg)
int len = 0;
if (!rng_prov_found && rng_ok_to_log) {
- cmn_err(CE_WARN, "No randomness provider enabled for "
+ (void) strlog(0, 0, 0, SL_NOTE,
+ "No randomness provider enabled for "
"/dev/random. Use cryptoadm(1M) to enable a provider.");
rng_ok_to_log = B_FALSE;
}
diff --git a/usr/src/uts/common/crypto/core/kcf_sched.c b/usr/src/uts/common/crypto/core/kcf_sched.c
index f461fe048c..8b2760b237 100644
--- a/usr/src/uts/common/crypto/core/kcf_sched.c
+++ b/usr/src/uts/common/crypto/core/kcf_sched.c
@@ -1027,9 +1027,9 @@ kcfpool_svc(void *arg)
case 0:
case -1:
/*
- * Woke up with no work to do. Check
- * if this thread should exit. We keep
- * at least kcf_minthreads.
+ * Woke up with no work to do. Check if we
+ * should lwp_exit() (which won't return). We
+ * keep at least kcf_minthreads.
*/
if (kcfpool->kp_threads > kcf_minthreads) {
KCF_ATOMIC_DECR(kcfpool->kp_threads);
diff --git a/usr/src/uts/common/disp/cmt.c b/usr/src/uts/common/disp/cmt.c
index 7e46509fce..ec80ae5a87 100644
--- a/usr/src/uts/common/disp/cmt.c
+++ b/usr/src/uts/common/disp/cmt.c
@@ -201,13 +201,15 @@ pg_cmt_cpu_startup(cpu_t *cp)
/*
* Return non-zero if thread can migrate between "from" and "to"
- * without a performance penalty
+ * without a performance penalty. This is true only if we share a core on
+ * virtually any CPU; sharing the last-level cache is insufficient to make
+ * migration possible without penalty.
*/
int
pg_cmt_can_migrate(cpu_t *from, cpu_t *to)
{
- if (from->cpu_physid->cpu_cacheid ==
- to->cpu_physid->cpu_cacheid)
+ if (from->cpu_physid->cpu_coreid ==
+ to->cpu_physid->cpu_coreid)
return (1);
return (0);
}
diff --git a/usr/src/uts/common/disp/cpucaps.c b/usr/src/uts/common/disp/cpucaps.c
index 46f53faab6..2a4365ff73 100644
--- a/usr/src/uts/common/disp/cpucaps.c
+++ b/usr/src/uts/common/disp/cpucaps.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
#include <sys/disp.h>
@@ -74,6 +75,32 @@
* Putting threads on wait queues in random places while running in the
* kernel might lead to all kinds of locking problems.
*
+ * Bursting
+ * ========
+ *
+ * CPU bursting occurs when the CPU usage is over the baseline but under the
+ * cap. The baseline CPU (zone.cpu-baseline) is set in a multi-tenant
+ * environment so that we know how much CPU is allocated for a tenant under
+ * normal utilization. We can then track how much time a zone is spending
+ * over the "normal" CPU utilization expected for that zone using the
+ * "above_base_sec" kstat. This kstat is cumulative.
+ *
+ * If the zone has a burst limit (zone.cpu-burst-time) then the zone can
+ * burst for that period of time (in seconds) before the effective cap is
+ * lowered to the baseline. Once the effective cap is lowered, the zone
+ * will run at the baseline for the burst limit before the effective cap is
+ * raised again to the full value. This will allow the zone to burst again.
+ * We can watch this behavior using the kstats. The "effective" kstat shows
+ * which cap is being used, the baseline value or the burst value. The
+ * "burst_limit_sec" shows the value of the zone.cpu-burst-time rctl and the
+ * "bursting_sec" kstat shows how many seconds the zone has currently been
+ * bursting. When the CPU load is continuously greater than the baseline,
+ * bursting_sec will increase, up to the burst_limit_sec value, then the
+ * effective kstat will drop to the baseline and the bursting_sec value will
+ * decrease until it hits 0, at which time the effective kstat will return to
+ * the full burst value and the bursting_sec value will begin to increase
+ * again.
+ *
* Accounting
* ==========
*
@@ -203,18 +230,28 @@ static void caps_update();
*/
struct cap_kstat {
kstat_named_t cap_value;
+ kstat_named_t cap_baseline;
+ kstat_named_t cap_effective;
+ kstat_named_t cap_burst_limit;
+ kstat_named_t cap_bursting;
kstat_named_t cap_usage;
kstat_named_t cap_nwait;
kstat_named_t cap_below;
kstat_named_t cap_above;
+ kstat_named_t cap_above_base;
kstat_named_t cap_maxusage;
kstat_named_t cap_zonename;
} cap_kstat = {
{ "value", KSTAT_DATA_UINT64 },
+ { "baseline", KSTAT_DATA_UINT64 },
+ { "effective", KSTAT_DATA_UINT64 },
+ { "burst_limit_sec", KSTAT_DATA_UINT64 },
+ { "bursting_sec", KSTAT_DATA_UINT64 },
{ "usage", KSTAT_DATA_UINT64 },
{ "nwait", KSTAT_DATA_UINT64 },
{ "below_sec", KSTAT_DATA_UINT64 },
{ "above_sec", KSTAT_DATA_UINT64 },
+ { "above_base_sec", KSTAT_DATA_UINT64 },
{ "maxusage", KSTAT_DATA_UINT64 },
{ "zonename", KSTAT_DATA_STRING },
};
@@ -311,7 +348,7 @@ cap_enable(list_t *l, cpucap_t *cap, hrtime_t value)
cap->cap_below = cap->cap_above = 0;
cap->cap_maxusage = 0;
cap->cap_usage = 0;
- cap->cap_value = value;
+ cap->cap_value = cap->cap_chk_value = value;
waitq_unblock(&cap->cap_waitq);
if (CPUCAPS_OFF()) {
cpucaps_enabled = B_TRUE;
@@ -340,19 +377,21 @@ cap_disable(list_t *l, cpucap_t *cap)
ASSERT(CAP_ENABLED(cap));
waitq_block(&cap->cap_waitq);
+
+ /* do this first to avoid race with cap_kstat_update */
+ if (cap->cap_kstat != NULL) {
+ kstat_delete(cap->cap_kstat);
+ cap->cap_kstat = NULL;
+ }
+
list_remove(l, cap);
if (list_is_empty(&capped_projects) && list_is_empty(&capped_zones)) {
cpucaps_enabled = B_FALSE;
cpucaps_clock_callout = NULL;
}
- cap->cap_value = 0;
+ cap->cap_value = cap->cap_chk_value = 0;
cap->cap_project = NULL;
cap->cap_zone = NULL;
- if (cap->cap_kstat != NULL) {
- kstat_delete(cap->cap_kstat);
- cap->cap_kstat = NULL;
- }
-
}
/*
@@ -487,6 +526,8 @@ cap_walk(list_t *l, void (*cb)(cpucap_t *, int64_t))
* The waitq_isempty check is performed without the waitq lock. If a new thread
* is placed on the waitq right after the check, it will be picked up during the
* next invocation of cap_poke_waitq().
+ *
+ * Called once per tick for zones.
*/
/* ARGSUSED */
static void
@@ -494,15 +535,92 @@ cap_poke_waitq(cpucap_t *cap, int64_t gen)
{
ASSERT(MUTEX_HELD(&caps_lock));
- if (cap->cap_usage >= cap->cap_value) {
+ if (cap->cap_base != 0) {
+ /*
+ * Because of the way usage is calculated and decayed, its
+ * possible for the zone to be slightly over its cap, but we
+ * don't want to count that after we have reduced the effective
+ * cap to the baseline. That way the zone will be able to
+ * burst again after the burst_limit has expired.
+ */
+ if (cap->cap_usage > cap->cap_base &&
+ cap->cap_chk_value == cap->cap_value) {
+ cap->cap_above_base++;
+
+ /*
+ * If bursting is limited and we've been bursting
+ * longer than we're supposed to, then set the
+ * effective cap to the baseline.
+ */
+ if (cap->cap_burst_limit != 0) {
+ cap->cap_bursting++;
+ if (cap->cap_bursting >= cap->cap_burst_limit)
+ cap->cap_chk_value = cap->cap_base;
+ }
+ } else if (cap->cap_bursting > 0) {
+ /*
+ * We're not bursting now, but we were, decay the
+ * bursting timer.
+ */
+ cap->cap_bursting--;
+ /*
+ * Reset the effective cap once we decay to 0 so we
+ * can burst again.
+ */
+ if (cap->cap_bursting == 0 &&
+ cap->cap_chk_value != cap->cap_value)
+ cap->cap_chk_value = cap->cap_value;
+ }
+ }
+
+ if (cap->cap_usage >= cap->cap_chk_value) {
cap->cap_above++;
} else {
waitq_t *wq = &cap->cap_waitq;
cap->cap_below++;
- if (!waitq_isempty(wq))
- waitq_runone(wq);
+ if (!waitq_isempty(wq)) {
+ int i, ndequeue, p;
+
+ /*
+ * Since this function is only called once per tick,
+ * we can hit a situation where we have artificially
+ * limited the project/zone below its cap. This would
+ * happen if we have multiple threads queued up but
+ * only dequeued one thread/tick. To avoid this we
+ * dequeue multiple threads, calculated based on the
+ * usage percentage of the cap. It is possible that we
+ * could dequeue too many threads and some of them
+ * might be put back on the wait queue quickly, but
+ * since we know that threads are on the wait queue
+ * because we're capping, we know that there is unused
+ * CPU cycles anyway, so this extra work would not
+ * hurt. Also, the ndequeue number is only an upper
+ * bound and we might dequeue less, depending on how
+ * many threads are actually in the wait queue. The
+ * ndequeue values are empirically derived and could be
+ * adjusted or calculated in another way if necessary.
+ */
+ p = (int)((100 * cap->cap_usage) / cap->cap_chk_value);
+ if (p >= 98)
+ ndequeue = 10;
+ else if (p >= 95)
+ ndequeue = 20;
+ else if (p >= 90)
+ ndequeue = 40;
+ else if (p >= 85)
+ ndequeue = 80;
+ else
+ ndequeue = 160;
+
+ for (i = 0; i < ndequeue; i++) {
+ waitq_runone(wq);
+ if (waitq_isempty(wq))
+ break;
+ }
+ DTRACE_PROBE2(cpucaps__pokeq, int, p, int, i);
+ }
}
}
@@ -629,14 +747,14 @@ cap_project_zone_modify_walker(kproject_t *kpj, void *arg)
* Remove all projects in this zone without caps
* from the capped_projects list.
*/
- if (project_cap->cap_value == MAX_USAGE) {
+ if (project_cap->cap_chk_value == MAX_USAGE) {
cap_project_disable(kpj);
}
} else if (CAP_DISABLED(project_cap)) {
/*
* Add the project to capped_projects list.
*/
- ASSERT(project_cap->cap_value == 0);
+ ASSERT(project_cap->cap_chk_value == 0);
cap_project_enable(kpj, MAX_USAGE);
}
mutex_exit(&caps_lock);
@@ -746,7 +864,7 @@ cpucaps_zone_set(zone_t *zone, rctl_qty_t cap_val)
/*
* No state transitions, just change the value
*/
- cap->cap_value = value;
+ cap->cap_value = cap->cap_chk_value = value;
}
ASSERT(MUTEX_HELD(&caps_lock));
@@ -757,6 +875,108 @@ cpucaps_zone_set(zone_t *zone, rctl_qty_t cap_val)
}
/*
+ * Set zone's base cpu value to base_val
+ */
+int
+cpucaps_zone_set_base(zone_t *zone, rctl_qty_t base_val)
+{
+ cpucap_t *cap = NULL;
+ hrtime_t value;
+
+ ASSERT(base_val <= MAXCAP);
+ if (base_val > MAXCAP)
+ base_val = MAXCAP;
+
+ if (CPUCAPS_OFF() || !ZONE_IS_CAPPED(zone))
+ return (0);
+
+ if (zone->zone_cpucap == NULL)
+ cap = cap_alloc();
+
+ mutex_enter(&caps_lock);
+
+ if (cpucaps_busy) {
+ mutex_exit(&caps_lock);
+ return (EBUSY);
+ }
+
+ /*
+ * Double-check whether zone->zone_cpucap is NULL, now with caps_lock
+ * held. If it is still NULL, assign a newly allocated cpucap to it.
+ */
+ if (zone->zone_cpucap == NULL) {
+ zone->zone_cpucap = cap;
+ } else if (cap != NULL) {
+ cap_free(cap);
+ }
+
+ cap = zone->zone_cpucap;
+
+ value = base_val * cap_tick_cost;
+ if (value < 0 || value > cap->cap_value)
+ value = 0;
+
+ cap->cap_base = value;
+
+ mutex_exit(&caps_lock);
+
+ return (0);
+}
+
+/*
+ * Set zone's maximum burst time in seconds. A burst time of 0 means that
+ * the zone can run over its baseline indefinitely.
+ */
+int
+cpucaps_zone_set_burst_time(zone_t *zone, rctl_qty_t base_val)
+{
+ cpucap_t *cap = NULL;
+ hrtime_t value;
+
+ ASSERT(base_val <= INT_MAX);
+ /* Treat the default as 0 - no limit */
+ if (base_val == INT_MAX)
+ base_val = 0;
+ if (base_val > INT_MAX)
+ base_val = INT_MAX;
+
+ if (CPUCAPS_OFF() || !ZONE_IS_CAPPED(zone))
+ return (0);
+
+ if (zone->zone_cpucap == NULL)
+ cap = cap_alloc();
+
+ mutex_enter(&caps_lock);
+
+ if (cpucaps_busy) {
+ mutex_exit(&caps_lock);
+ return (EBUSY);
+ }
+
+ /*
+ * Double-check whether zone->zone_cpucap is NULL, now with caps_lock
+ * held. If it is still NULL, assign a newly allocated cpucap to it.
+ */
+ if (zone->zone_cpucap == NULL) {
+ zone->zone_cpucap = cap;
+ } else if (cap != NULL) {
+ cap_free(cap);
+ }
+
+ cap = zone->zone_cpucap;
+
+ value = SEC_TO_TICK(base_val);
+ if (value < 0)
+ value = 0;
+
+ cap->cap_burst_limit = value;
+
+ mutex_exit(&caps_lock);
+
+ return (0);
+}
+
+/*
* The project is going away so disable its cap.
*/
void
@@ -902,7 +1122,7 @@ cpucaps_project_set(kproject_t *kpj, rctl_qty_t cap_val)
if (CAP_DISABLED(cap))
cap_project_enable(kpj, value);
else
- cap->cap_value = value;
+ cap->cap_value = cap->cap_chk_value = value;
} else if (CAP_ENABLED(cap)) {
/*
* User requested to drop a cap on the project. If it is part of
@@ -910,7 +1130,7 @@ cpucaps_project_set(kproject_t *kpj, rctl_qty_t cap_val)
* otherwise disable the cap.
*/
if (ZONE_IS_CAPPED(kpj->kpj_zone)) {
- cap->cap_value = MAX_USAGE;
+ cap->cap_value = cap->cap_chk_value = MAX_USAGE;
} else {
cap_project_disable(kpj);
}
@@ -948,6 +1168,26 @@ cpucaps_zone_get(zone_t *zone)
}
/*
+ * Get current zone baseline.
+ */
+rctl_qty_t
+cpucaps_zone_get_base(zone_t *zone)
+{
+ return (zone->zone_cpucap != NULL ?
+ (rctl_qty_t)(zone->zone_cpucap->cap_base / cap_tick_cost) : 0);
+}
+
+/*
+ * Get current zone maximum burst time.
+ */
+rctl_qty_t
+cpucaps_zone_get_burst_time(zone_t *zone)
+{
+ return (zone->zone_cpucap != NULL ?
+ (rctl_qty_t)(TICK_TO_SEC(zone->zone_cpucap->cap_burst_limit)) : 0);
+}
+
+/*
* Charge project of thread t the time thread t spent on CPU since previously
* adjusted.
*
@@ -1045,7 +1285,7 @@ cpucaps_charge(kthread_id_t t, caps_sc_t *csc, cpucaps_charge_t charge_type)
project_cap = kpj->kpj_cpucap;
- if (project_cap->cap_usage >= project_cap->cap_value) {
+ if (project_cap->cap_usage >= project_cap->cap_chk_value) {
t->t_schedflag |= TS_PROJWAITQ;
rc = B_TRUE;
} else if (t->t_schedflag & TS_PROJWAITQ) {
@@ -1059,7 +1299,7 @@ cpucaps_charge(kthread_id_t t, caps_sc_t *csc, cpucaps_charge_t charge_type)
} else {
cpucap_t *zone_cap = zone->zone_cpucap;
- if (zone_cap->cap_usage >= zone_cap->cap_value) {
+ if (zone_cap->cap_usage >= zone_cap->cap_chk_value) {
t->t_schedflag |= TS_ZONEWAITQ;
rc = B_TRUE;
} else if (t->t_schedflag & TS_ZONEWAITQ) {
@@ -1119,6 +1359,7 @@ cpucaps_enforce(kthread_t *t)
/*
* Convert internal cap statistics into values exported by cap kstat.
+ * Note that the kstat is held throughout this function but caps_lock is not.
*/
static int
cap_kstat_update(kstat_t *ksp, int rw)
@@ -1133,6 +1374,12 @@ cap_kstat_update(kstat_t *ksp, int rw)
capsp->cap_value.value.ui64 =
ROUND_SCALE(cap->cap_value, cap_tick_cost);
+ capsp->cap_baseline.value.ui64 =
+ ROUND_SCALE(cap->cap_base, cap_tick_cost);
+ capsp->cap_effective.value.ui64 =
+ ROUND_SCALE(cap->cap_chk_value, cap_tick_cost);
+ capsp->cap_burst_limit.value.ui64 =
+ ROUND_SCALE(cap->cap_burst_limit, tick_sec);
capsp->cap_usage.value.ui64 =
ROUND_SCALE(cap->cap_usage, cap_tick_cost);
capsp->cap_maxusage.value.ui64 =
@@ -1140,6 +1387,10 @@ cap_kstat_update(kstat_t *ksp, int rw)
capsp->cap_nwait.value.ui64 = cap->cap_waitq.wq_count;
capsp->cap_below.value.ui64 = ROUND_SCALE(cap->cap_below, tick_sec);
capsp->cap_above.value.ui64 = ROUND_SCALE(cap->cap_above, tick_sec);
+ capsp->cap_above_base.value.ui64 =
+ ROUND_SCALE(cap->cap_above_base, tick_sec);
+ capsp->cap_bursting.value.ui64 =
+ ROUND_SCALE(cap->cap_bursting, tick_sec);
kstat_named_setstr(&capsp->cap_zonename, zonename);
return (0);
diff --git a/usr/src/uts/common/disp/disp.c b/usr/src/uts/common/disp/disp.c
index be92ba108b..eb489067b7 100644
--- a/usr/src/uts/common/disp/disp.c
+++ b/usr/src/uts/common/disp/disp.c
@@ -23,6 +23,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -105,7 +109,7 @@ static void cpu_resched(cpu_t *cp, pri_t tpri);
/*
* If this is set, only interrupt threads will cause kernel preemptions.
* This is done by changing the value of kpreemptpri. kpreemptpri
- * will either be the max sysclass pri + 1 or the min interrupt pri.
+ * will either be the max sysclass pri or the min interrupt pri.
*/
int only_intr_kpreempt;
@@ -252,7 +256,23 @@ dispinit(void)
maxglobpri = cl_maxglobpri;
}
}
- kpreemptpri = (pri_t)v.v_maxsyspri + 1;
+
+ /*
+ * Historically, kpreemptpri was set to v_maxsyspri + 1 -- which is
+ * to say, maxclsyspri + 1. However, over time, the system has used
+ * more and more asynchronous kernel threads, with an increasing number
+ * of these doing work on direct behalf of higher-level software (e.g.,
+ * network processing). This has led to potential priority inversions:
+ * threads doing low-priority lengthy kernel work can effectively
+ * delay kernel-level processing of higher-priority data. To minimize
+ * such inversions, we set kpreemptpri to be v_maxsyspri; anything in
+ * the kernel that runs at maxclsyspri will therefore induce kernel
+ * preemption, and this priority should be used if/when an asynchronous
+ * thread (or, as is often the case, task queue) is performing a task
+ * on behalf of higher-level software (or any task that is otherwise
+ * latency-sensitve).
+ */
+ kpreemptpri = (pri_t)v.v_maxsyspri;
if (kpqpri == KPQPRI)
kpqpri = kpreemptpri;
@@ -2258,7 +2278,7 @@ disp_getbest(disp_t *dp)
* placed earlier.
*/
if (tcp == NULL ||
- pri >= minclsyspri ||
+ (pri >= minclsyspri && tp->t_procp == &p0) ||
tp->t_cpu != tcp)
break;
diff --git a/usr/src/uts/common/disp/fss.c b/usr/src/uts/common/disp/fss.c
index b7f992c300..250df0bec7 100644
--- a/usr/src/uts/common/disp/fss.c
+++ b/usr/src/uts/common/disp/fss.c
@@ -55,6 +55,179 @@
#include <sys/cpucaps.h>
/*
+ * The fair share scheduling class ensures that collections of processes
+ * (zones and projects) each get their configured share of CPU. This is in
+ * contrast to the TS class which considers individual processes.
+ *
+ * The FSS cpu-share is set on zones using the zone.cpu-shares rctl and on
+ * projects using the project.cpu-shares rctl. By default the value is 1
+ * and it can range from 0 - 64k. A value of 0 means that processes in the
+ * collection will only get CPU resources when there are no other processes
+ * that need CPU. The cpu-share is used as one of the inputs to calculate a
+ * thread's "user-mode" priority (umdpri) for the scheduler. The umdpri falls
+ * in the range 0-59. FSS calculates other, internal, priorities which are not
+ * visible outside of the FSS class.
+ *
+ * The FSS class should approximate TS behavior when there are excess CPU
+ * resources. When there is a backlog of runnable processes, then the share
+ * is used as input into the runnable process's priority calculation, where
+ * the final umdpri is used by the scheduler to determine when the process runs.
+ *
+ * Projects in a zone compete with each other for CPU time, receiving CPU
+ * allocation within a zone proportional to the project's share; at a higher
+ * level zones compete with each other, receiving allocation in a pset
+ * proportional to the zone's share.
+ *
+ * The FSS priority calculation consists of several parts.
+ *
+ * 1) Once per second the fss_update function runs. The first thing it does is
+ * call fss_decay_usage. This function does three things.
+ *
+ * a) fss_decay_usage first decays the maxfsspri value for the pset. This
+ * value is used in the per-process priority calculation described in step
+ * (2b). The maxfsspri is decayed using the following formula:
+ *
+ * maxfsspri * fss_nice_decay[NZERO])
+ * maxfsspri = ------------------------------------
+ * FSS_DECAY_BASE
+ *
+ *
+ * - NZERO is the default process priority (i.e. 20)
+ *
+ * The fss_nice_decay array is a fixed set of values used to adjust the
+ * decay rate of processes based on their nice value. Entries in this
+ * array are initialized in fss_init using the following formula:
+ *
+ * (FSS_DECAY_MAX - FSS_DECAY_MIN) * i
+ * FSS_DECAY_MIN + -------------------------------------
+ * FSS_NICE_RANGE - 1
+ *
+ * - FSS_DECAY_MIN is 82 = approximates 65% (82/128)
+ * - FSS_DECAY_MAX is 108 = approximates 85% (108/128)
+ * - FSS_NICE_RANGE is 40 (range is 0 - 39)
+ *
+ * b) The second thing fss_decay_usage does is update each project's "usage"
+ * for the last second and then recalculates the project's "share usage".
+ *
+ * The usage value is the recent CPU usage for all of the threads in the
+ * project. It is decayed and updated this way:
+ *
+ * (usage * FSS_DECAY_USG)
+ * usage = ------------------------- + ticks;
+ * FSS_DECAY_BASE
+ *
+ * - FSS_DECAY_BASE is 128 - used instead of 100 so we can shift vs divide
+ * - FSS_DECAY_USG is 96 - approximates 75% (96/128)
+ * - ticks is updated whenever a process in this project is running
+ * when the scheduler's tick processing fires. This is not a simple
+ * counter, the values are based on the entries in the fss_nice_tick
+ * array (see section 3 below). ticks is then reset to 0 so it can track
+ * the next seconds worth of nice-adjusted time for the project.
+ *
+ * c) The third thing fss_decay_usage does is update each project's "share
+ * usage" (shusage). This is the normalized usage value for the project and
+ * is calculated this way:
+ *
+ * pset_shares^2 zone_int_shares^2
+ * usage * ------------- * ------------------
+ * kpj_shares^2 zone_ext_shares^2
+ *
+ * - usage - see (1b) for more details
+ * - pset_shares is the total of all *active* zone shares in the pset (by
+ * default there is only one pset)
+ * - kpj_shares is the individual project's share (project.cpu-shares rctl)
+ * - zone_int_shares is the sum of shares of all active projects within the
+ * zone (the zone-internal total)
+ * - zone_ext_shares is the share value for the zone (zone.cpu-shares rctl)
+ *
+ * The shusage is used in step (2b) to calculate the thread's new internal
+ * priority. A larger shusage value leads to a lower priority.
+ *
+ * 2) The fss_update function then calls fss_update_list to update the priority
+ * of all threads. This does two things.
+ *
+ * a) First the thread's internal priority is decayed using the following
+ * formula:
+ *
+ * fsspri * fss_nice_decay[nice_value])
+ * fsspri = ------------------------------------
+ * FSS_DECAY_BASE
+ *
+ * - FSS_DECAY_BASE is 128 as described above
+ *
+ * b) Second, if the thread is runnable (TS_RUN or TS_WAIT) calls fss_newpri
+ * to update the user-mode priority (umdpri) of the runnable thread.
+ * Threads that are running (TS_ONPROC) or waiting for an event (TS_SLEEP)
+ * are not updated at this time. The updated user-mode priority can cause
+ * threads to change their position in the run queue.
+ *
+ * The process's new internal fsspri is calculated using the following
+ * formula. All runnable threads in the project will use the same shusage
+ * and nrunnable values in their calculation.
+ *
+ * fsspri += shusage * nrunnable * ticks
+ *
+ * - shusage is the project's share usage, calculated in (1c)
+ * - nrunnable is the number of runnable threads in the project
+ * - ticks is the number of ticks this thread ran since the last fss_newpri
+ * invocation.
+ *
+ * Finally the process's new user-mode priority is calculated using the
+ * following formula:
+ *
+ * (fsspri * umdprirange)
+ * umdpri = maxumdpri - ------------------------
+ * maxfsspri
+ *
+ * - maxumdpri is MINCLSYSPRI - 1 (i.e. 59)
+ * - umdprirange is maxumdpri - 1 (i.e. 58)
+ * - maxfsspri is the largest fsspri seen so far, as we're iterating all
+ * runnable processes
+ *
+ * Thus, a higher internal priority (fsspri) leads to a lower user-mode
+ * priority which means the thread runs less. The fsspri is higher when
+ * the project's normalized share usage is higher, when the project has
+ * more runnable threads, or when the thread has accumulated more run-time.
+ *
+ * This code has various checks to ensure the resulting umdpri is in the
+ * range 1-59. See fss_newpri for more details.
+ *
+ * To reiterate, the above processing is performed once per second to recompute
+ * the runnable thread user-mode priorities.
+ *
+ * 3) The final major component in the priority calculation is the tick
+ * processing which occurs on a thread that is running when the clock
+ * calls fss_tick.
+ *
+ * A thread can run continuously in user-land (compute-bound) for the
+ * fss_quantum (see "dispadmin -c FSS -g" for the configurable properties).
+ * The fss_quantum defaults to 11 (i.e. 11 ticks).
+ *
+ * Once the quantum has been consumed, the thread will call fss_newpri to
+ * recompute its umdpri priority, as described above in (2b). Threads that
+ * were T_ONPROC at the one second interval when runnable thread priorities
+ * were recalculated will have their umdpri priority recalculated when their
+ * quanta expires.
+ *
+ * To ensure that runnable threads within a project see the expected
+ * round-robin behavior, there is a special case in fss_newpri for a thread
+ * that has run for its quanta within the one second update interval. See
+ * the handling for the quanta_up parameter within fss_newpri.
+ *
+ * Also of interest, the fss_tick code increments the project's tick value
+ * using the fss_nice_tick array entry for the thread's nice value. The idea
+ * behind the fss_nice_tick array is that the cost of a tick is lower at
+ * positive nice values (so that it doesn't increase the project's usage
+ * as much as normal) with a 50% drop at the maximum level and a 50%
+ * increase at the minimum level. See (1b). The fss_nice_tick array is
+ * initialized in fss_init using the following formula:
+ *
+ * FSS_TICK_COST * (((3 * FSS_NICE_RANGE) / 2) - i)
+ * --------------------------------------------------
+ * FSS_NICE_RANGE
+ *
+ * - FSS_TICK_COST is 1000, the tick cost for threads with nice level 0
+ *
* FSS Data Structures:
*
* fsszone
@@ -73,7 +246,6 @@
* ----- ----- -----
* fssproj
*
- *
* That is, fsspsets contain a list of fsszone's that are currently active in
* the pset, and a list of fssproj's, corresponding to projects with runnable
* threads on the pset. fssproj's in turn point to the fsszone which they
@@ -82,12 +254,6 @@
* An fssproj_t is removed when there are no threads in it.
*
* An fsszone_t is removed when there are no projects with threads in it.
- *
- * Projects in a zone compete with each other for cpu time, receiving cpu
- * allocation within a zone proportional to fssproj->fssp_shares
- * (project.cpu-shares); at a higher level zones compete with each other,
- * receiving allocation in a pset proportional to fsszone->fssz_shares
- * (zone.cpu-shares). See fss_decay_usage() for the precise formula.
*/
static pri_t fss_init(id_t, int, classfuncs_t **);
@@ -187,7 +353,7 @@ static time_t fss_minrun = 2; /* t_pri becomes 59 within 2 secs */
static time_t fss_minslp = 2; /* min time on sleep queue for hardswap */
static int fss_quantum = 11;
-static void fss_newpri(fssproc_t *);
+static void fss_newpri(fssproc_t *, boolean_t);
static void fss_update(void *);
static int fss_update_list(int);
static void fss_change_priority(kthread_t *, fssproc_t *);
@@ -719,17 +885,55 @@ fss_init(id_t cid, int clparmsz, classfuncs_t **clfuncspp)
}
/*
- * Calculate the new cpupri based on the usage, the number of shares and
- * the number of active threads. Reset the tick counter for this thread.
+ * Calculate the new fss_umdpri based on the usage, the normalized share usage
+ * and the number of active threads. Reset the tick counter for this thread.
+ *
+ * When calculating the new priority using the standard formula we can hit
+ * a scenario where we don't have good round-robin behavior. This would be
+ * most commonly seen when there is a zone with lots of runnable threads.
+ * In the bad scenario we will see the following behavior when using the
+ * standard formula and these conditions:
+ *
+ * - there are multiple runnable threads in the zone (project)
+ * - the fssps_maxfsspri is a very large value
+ * - (we also know all of these threads will use the project's
+ * fssp_shusage)
+ *
+ * Under these conditions, a thread with a low fss_fsspri value is chosen
+ * to run and the thread gets a high fss_umdpri. This thread can run for
+ * its full quanta (fss_timeleft) at which time fss_newpri is called to
+ * calculate the thread's new priority.
+ *
+ * In this case, because the newly calculated fsspri value is much smaller
+ * (orders of magnitude) than the fssps_maxfsspri value, if we used the
+ * standard formula the thread will still get a high fss_umdpri value and
+ * will run again for another quanta, even though there are other runnable
+ * threads in the project.
+ *
+ * For a thread that is runnable for a long time, the thread can continue
+ * to run for many quanta (totaling many seconds) before the thread's fsspri
+ * exceeds the fssps_maxfsspri and the thread's fss_umdpri is reset back
+ * down to 1. This behavior also keeps the fssps_maxfsspr at a high value,
+ * so that the next runnable thread might repeat this cycle.
+ *
+ * This leads to the case where we don't have round-robin behavior at quanta
+ * granularity, but instead, runnable threads within the project only run
+ * at several second intervals.
+ *
+ * To prevent this scenario from occuring, when a thread has consumed its
+ * quanta and there are multiple runnable threads in the project, we
+ * immediately cause the thread to hit fssps_maxfsspri so that it gets
+ * reset back to 1 and another runnable thread in the project can run.
*/
static void
-fss_newpri(fssproc_t *fssproc)
+fss_newpri(fssproc_t *fssproc, boolean_t quanta_up)
{
kthread_t *tp;
fssproj_t *fssproj;
fsspset_t *fsspset;
fsszone_t *fsszone;
fsspri_t fsspri, maxfsspri;
+ uint32_t n_runnable;
pri_t invpri;
uint32_t ticks;
@@ -752,25 +956,43 @@ fss_newpri(fssproc_t *fssproc)
fsspset = FSSPROJ2FSSPSET(fssproj);
disp_lock_enter_high(&fsspset->fssps_displock);
+ ticks = fssproc->fss_ticks;
+ fssproc->fss_ticks = 0;
+
if (fssproj->fssp_shares == 0 || fsszone->fssz_rshares == 0) {
/*
* Special case: threads with no shares.
*/
fssproc->fss_umdpri = fss_minglobpri;
- fssproc->fss_ticks = 0;
disp_lock_exit_high(&fsspset->fssps_displock);
return;
}
- /*
- * fsspri += shusage * nrunnable * ticks
- */
- ticks = fssproc->fss_ticks;
- fssproc->fss_ticks = 0;
- fsspri = fssproc->fss_fsspri;
- fsspri += fssproj->fssp_shusage * fssproj->fssp_runnable * ticks;
+ maxfsspri = fsspset->fssps_maxfsspri;
+ n_runnable = fssproj->fssp_runnable;
+
+ if (quanta_up && n_runnable > 1) {
+ fsspri = maxfsspri;
+ } else {
+ /*
+ * fsspri += fssp_shusage * nrunnable * ticks
+ * If all three values are non-0, this typically calculates to
+ * a large number (sometimes > 1M, sometimes > 100B) due to
+ * fssp_shusage which can be > 1T.
+ */
+ fsspri = fssproc->fss_fsspri;
+ fsspri += fssproj->fssp_shusage * n_runnable * ticks;
+ }
+
fssproc->fss_fsspri = fsspri;
+ /*
+ * fss_maxumdpri is normally 59, since FSS priorities are 0-59.
+ * If the previous calculation resulted in 0 (e.g. was 0 and added 0
+ * because ticks == 0), then instead of 0, we use the largest priority,
+ * which is still small in comparison to the large numbers we typically
+ * see.
+ */
if (fsspri < fss_maxumdpri)
fsspri = fss_maxumdpri; /* so that maxfsspri is != 0 */
@@ -784,12 +1006,16 @@ fss_newpri(fssproc_t *fssproc)
* If this thread's fsspri is greater than the previous largest
* fsspri, then record it as the new high and priority for this
* thread will be one (the lowest priority assigned to a thread
- * that has non-zero shares).
+ * that has non-zero shares). Because of this check, maxfsspri can
+ * change as this function is called via the
+ * fss_update -> fss_update_list -> fss_newpri code path to update
+ * all runnable threads. See the code in fss_update for how we
+ * mitigate this issue.
+ *
* Note that this formula cannot produce out of bounds priority
- * values; if it is changed, additional checks may need to be
+ * values (0-59); if it is changed, additional checks may need to be
* added.
*/
- maxfsspri = fsspset->fssps_maxfsspri;
if (fsspri >= maxfsspri) {
fsspset->fssps_maxfsspri = fsspri;
disp_lock_exit_high(&fsspset->fssps_displock);
@@ -802,8 +1028,9 @@ fss_newpri(fssproc_t *fssproc)
}
/*
- * Decays usages of all running projects and resets their tick counters.
- * Called once per second from fss_update() after updating priorities.
+ * Decays usages of all running projects, resets their tick counters and
+ * calcluates the projects normalized share usage. Called once per second from
+ * fss_update().
*/
static void
fss_decay_usage()
@@ -815,6 +1042,7 @@ fss_decay_usage()
fsszone_t *fsszone;
fsspri_t maxfsspri;
int psetid;
+ struct zone *zp;
mutex_enter(&fsspsets_lock);
/*
@@ -825,6 +1053,8 @@ fss_decay_usage()
fsspset = &fsspsets[psetid];
mutex_enter(&fsspset->fssps_lock);
+ fsspset->fssps_gen++;
+
if (fsspset->fssps_cpupart == NULL ||
(fssproj = fsspset->fssps_list) == NULL) {
mutex_exit(&fsspset->fssps_lock);
@@ -837,6 +1067,8 @@ fss_decay_usage()
*/
disp_lock_enter(&fsspset->fssps_displock);
+ pset_shares = fsspset->fssps_shares;
+
maxfsspri = (fsspset->fssps_maxfsspri *
fss_nice_decay[NZERO]) / FSS_DECAY_BASE;
if (maxfsspri < fss_maxumdpri)
@@ -844,16 +1076,31 @@ fss_decay_usage()
fsspset->fssps_maxfsspri = maxfsspri;
do {
+ fsszone = fssproj->fssp_fsszone;
+ zp = fsszone->fssz_zone;
+
/*
- * Decay usage for each project running on
- * this cpu partition.
+ * Reset zone's FSS stats if they are from a
+ * previous cycle.
+ */
+ if (fsspset->fssps_gen != zp->zone_fss_gen) {
+ zp->zone_fss_gen = fsspset->fssps_gen;
+ zp->zone_run_ticks = 0;
+ }
+
+ /*
+ * Decay project usage, then add in this cycle's
+ * nice tick value.
*/
fssproj->fssp_usage =
(fssproj->fssp_usage * FSS_DECAY_USG) /
- FSS_DECAY_BASE + fssproj->fssp_ticks;
+ FSS_DECAY_BASE +
+ fssproj->fssp_ticks;
+
fssproj->fssp_ticks = 0;
+ zp->zone_run_ticks += fssproj->fssp_tick_cnt;
+ fssproj->fssp_tick_cnt = 0;
- fsszone = fssproj->fssp_fsszone;
/*
* Readjust the project's number of shares if it has
* changed since we checked it last time.
@@ -872,18 +1119,55 @@ fss_decay_usage()
* Readjust the zone's number of shares if it
* has changed since we checked it last time.
*/
- zone_ext_shares = fsszone->fssz_zone->zone_shares;
+ zone_ext_shares = zp->zone_shares;
if (fsszone->fssz_rshares != zone_ext_shares) {
if (fsszone->fssz_runnable != 0) {
fsspset->fssps_shares -=
fsszone->fssz_rshares;
fsspset->fssps_shares +=
zone_ext_shares;
+ pset_shares = fsspset->fssps_shares;
}
fsszone->fssz_rshares = zone_ext_shares;
}
zone_int_shares = fsszone->fssz_shares;
- pset_shares = fsspset->fssps_shares;
+
+ /*
+ * If anything is runnable in the project, track the
+ * overall project share percent for monitoring useage.
+ */
+ if (fssproj->fssp_runnable > 0) {
+ uint32_t zone_shr_pct;
+ uint32_t int_shr_pct;
+
+ /*
+ * Times 1000 to get tenths of a percent
+ *
+ * zone_ext_shares
+ * zone_shr_pct = ---------------
+ * pset_shares
+ *
+ * kpj_shares
+ * int_shr_pct = ---------------
+ * zone_int_shares
+ */
+ if (pset_shares == 0 || zone_int_shares == 0) {
+ fssproj->fssp_shr_pct = 0;
+ } else {
+ zone_shr_pct =
+ (zone_ext_shares * 1000) /
+ pset_shares;
+ int_shr_pct = (kpj_shares * 1000) /
+ zone_int_shares;
+ fssproj->fssp_shr_pct =
+ (zone_shr_pct * int_shr_pct) /
+ 1000;
+ }
+ } else {
+ DTRACE_PROBE1(fss__prj__norun, fssproj_t *,
+ fssproj);
+ }
+
/*
* Calculate fssp_shusage value to be used
* for fsspri increments for the next second.
@@ -891,10 +1175,22 @@ fss_decay_usage()
if (kpj_shares == 0 || zone_ext_shares == 0) {
fssproj->fssp_shusage = 0;
} else if (FSSPROJ2KPROJ(fssproj) == proj0p) {
+ uint32_t zone_shr_pct;
+
/*
* Project 0 in the global zone has 50%
- * of its zone.
+ * of its zone. See calculation above for
+ * the zone's share percent.
*/
+ if (pset_shares == 0)
+ zone_shr_pct = 1000;
+ else
+ zone_shr_pct =
+ (zone_ext_shares * 1000) /
+ pset_shares;
+
+ fssproj->fssp_shr_pct = zone_shr_pct / 2;
+
fssproj->fssp_shusage = (fssproj->fssp_usage *
zone_int_shares * zone_int_shares) /
(zone_ext_shares * zone_ext_shares);
@@ -926,6 +1222,10 @@ fss_decay_usage()
* pset_shares^2
* shusage = usage * ----------------------
* zone_ext_shares^2
+ *
+ * shusage is one input to calculating fss_pri
+ * in fss_newpri(). Larger values tend toward
+ * lower priorities for processes in the proj.
*/
fssproj->fssp_shusage = fssproj->fssp_usage *
pset_shares * zone_int_shares;
@@ -997,6 +1297,10 @@ fss_change_priority(kthread_t *t, fssproc_t *fssproc)
* thread pointer. Each list has its own lock. This avoids blocking all
* fss_enterclass, fss_fork, and fss_exitclass operations while fss_update runs.
* fss_update traverses each list in turn.
+ *
+ * Each time we're run (once/second) we may start at the next list and iterate
+ * through all of the lists. By starting with a different list, we mitigate any
+ * effects we would see updating the fssps_maxfsspri value in fss_newpri.
*/
static void
fss_update(void *arg)
@@ -1022,7 +1326,7 @@ fss_update(void *arg)
do {
/*
* If this is the first list after the current marker to have
- * threads with priorities updates, advance the marker to this
+ * threads with priority updates, advance the marker to this
* list for the next time fss_update runs.
*/
if (fss_update_list(i) &&
@@ -1051,6 +1355,7 @@ fss_update_list(int i)
fssproc_t *fssproc;
fssproj_t *fssproj;
fsspri_t fsspri;
+ pri_t fss_umdpri;
kthread_t *t;
int updated = 0;
@@ -1074,6 +1379,7 @@ fss_update_list(int i)
fssproj = FSSPROC2FSSPROJ(fssproc);
if (fssproj == NULL)
goto next;
+
if (fssproj->fssp_shares != 0) {
/*
* Decay fsspri value.
@@ -1092,16 +1398,21 @@ fss_update_list(int i)
*/
t->t_trapret = 1;
aston(t);
+ if (t->t_state == TS_ONPROC)
+ DTRACE_PROBE1(fss__onproc, fssproc_t *,
+ fssproc);
goto next;
}
- fss_newpri(fssproc);
+ fss_newpri(fssproc, B_FALSE);
updated = 1;
+ fss_umdpri = fssproc->fss_umdpri;
+
/*
* Only dequeue the thread if it needs to be moved; otherwise
* it should just round-robin here.
*/
- if (t->t_pri != fssproc->fss_umdpri)
+ if (t->t_pri != fss_umdpri)
fss_change_priority(t, fssproc);
next:
thread_unlock(t);
@@ -1625,7 +1936,7 @@ fss_forkret(kthread_t *t, kthread_t *ct)
thread_lock(t);
fssproc = FSSPROC(t);
- fss_newpri(fssproc);
+ fss_newpri(fssproc, B_FALSE);
fssproc->fss_timeleft = fss_quantum;
t->t_pri = fssproc->fss_umdpri;
ASSERT(t->t_pri >= 0 && t->t_pri <= fss_maxglobpri);
@@ -1726,7 +2037,7 @@ fss_parmsset(kthread_t *t, void *parmsp, id_t reqpcid, cred_t *reqpcredp)
fssproc->fss_uprilim = reqfssuprilim;
fssproc->fss_upri = reqfssupri;
fssproc->fss_nice = nice;
- fss_newpri(fssproc);
+ fss_newpri(fssproc, B_FALSE);
if ((fssproc->fss_flags & FSSKPRI) != 0) {
thread_unlock(t);
@@ -2181,6 +2492,7 @@ fss_tick(kthread_t *t)
fsspset_t *fsspset = FSSPROJ2FSSPSET(fssproj);
disp_lock_enter_high(&fsspset->fssps_displock);
fssproj->fssp_ticks += fss_nice_tick[fssproc->fss_nice];
+ fssproj->fssp_tick_cnt++;
fssproc->fss_ticks++;
disp_lock_exit_high(&fsspset->fssps_displock);
}
@@ -2224,7 +2536,7 @@ fss_tick(kthread_t *t)
}
fssproc->fss_flags &= ~FSSRESTORE;
- fss_newpri(fssproc);
+ fss_newpri(fssproc, B_TRUE);
new_pri = fssproc->fss_umdpri;
ASSERT(new_pri >= 0 && new_pri <= fss_maxglobpri);
@@ -2263,7 +2575,7 @@ fss_tick(kthread_t *t)
* queue so that it gets charged for the CPU time from its
* quantum even before that quantum expires.
*/
- fss_newpri(fssproc);
+ fss_newpri(fssproc, B_FALSE);
if (t->t_pri != fssproc->fss_umdpri)
fss_change_priority(t, fssproc);
diff --git a/usr/src/uts/common/disp/thread.c b/usr/src/uts/common/disp/thread.c
index 8998b6ea51..331ca417e2 100644
--- a/usr/src/uts/common/disp/thread.c
+++ b/usr/src/uts/common/disp/thread.c
@@ -1050,6 +1050,8 @@ installctx(
ctx->free_op = free;
ctx->arg = arg;
ctx->next = t->t_ctx;
+ ctx->save_ts = 0;
+ ctx->restore_ts = 0;
t->t_ctx = ctx;
}
@@ -1124,9 +1126,12 @@ savectx(kthread_t *t)
struct ctxop *ctx;
ASSERT(t == curthread);
- for (ctx = t->t_ctx; ctx != 0; ctx = ctx->next)
- if (ctx->save_op != NULL)
+ for (ctx = t->t_ctx; ctx != 0; ctx = ctx->next) {
+ if (ctx->save_op != NULL) {
+ ctx->save_ts = gethrtime_unscaled();
(ctx->save_op)(ctx->arg);
+ }
+ }
}
void
@@ -1135,9 +1140,12 @@ restorectx(kthread_t *t)
struct ctxop *ctx;
ASSERT(t == curthread);
- for (ctx = t->t_ctx; ctx != 0; ctx = ctx->next)
- if (ctx->restore_op != NULL)
+ for (ctx = t->t_ctx; ctx != 0; ctx = ctx->next) {
+ if (ctx->restore_op != NULL) {
+ ctx->restore_ts = gethrtime_unscaled();
(ctx->restore_op)(ctx->arg);
+ }
+ }
}
void
diff --git a/usr/src/uts/common/dtrace/dtrace.c b/usr/src/uts/common/dtrace/dtrace.c
index c3b3311e0b..941700cd5d 100644
--- a/usr/src/uts/common/dtrace/dtrace.c
+++ b/usr/src/uts/common/dtrace/dtrace.c
@@ -92,6 +92,7 @@
#include <sys/zone.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include "strtolctype.h"
/*
* DTrace Tunable Variables
@@ -116,7 +117,7 @@
int dtrace_destructive_disallow = 0;
dtrace_optval_t dtrace_nonroot_maxsize = (16 * 1024 * 1024);
size_t dtrace_difo_maxsize = (256 * 1024);
-dtrace_optval_t dtrace_dof_maxsize = (256 * 1024);
+dtrace_optval_t dtrace_dof_maxsize = (8 * 1024 * 1024);
size_t dtrace_global_maxsize = (16 * 1024);
size_t dtrace_actions_max = (16 * 1024);
size_t dtrace_retain_max = 1024;
@@ -171,6 +172,7 @@ static dtrace_provider_t *dtrace_provider; /* provider list */
static dtrace_meta_t *dtrace_meta_pid; /* user-land meta provider */
static int dtrace_opens; /* number of opens */
static int dtrace_helpers; /* number of helpers */
+static int dtrace_getf; /* number of unpriv getf()s */
static void *dtrace_softstate; /* softstate pointer */
static dtrace_hash_t *dtrace_bymod; /* probes hashed by module */
static dtrace_hash_t *dtrace_byfunc; /* probes hashed by function */
@@ -267,17 +269,22 @@ dtrace_id_t dtrace_probeid_error; /* special ERROR probe */
/*
* DTrace Helper Tracing Variables
+ *
+ * These variables should be set dynamically to enable helper tracing. The
+ * only variables that should be set are dtrace_helptrace_enable (which should
+ * be set to a non-zero value to allocate helper tracing buffers on the next
+ * open of /dev/dtrace) and dtrace_helptrace_disable (which should be set to a
+ * non-zero value to deallocate helper tracing buffers on the next close of
+ * /dev/dtrace). When (and only when) helper tracing is disabled, the
+ * buffer size may also be set via dtrace_helptrace_bufsize.
*/
-uint32_t dtrace_helptrace_next = 0;
-uint32_t dtrace_helptrace_nlocals;
-char *dtrace_helptrace_buffer;
-int dtrace_helptrace_bufsize = 512 * 1024;
-
-#ifdef DEBUG
-int dtrace_helptrace_enabled = 1;
-#else
-int dtrace_helptrace_enabled = 0;
-#endif
+int dtrace_helptrace_enable = 0;
+int dtrace_helptrace_disable = 0;
+int dtrace_helptrace_bufsize = 16 * 1024 * 1024;
+uint32_t dtrace_helptrace_nlocals;
+static dtrace_helptrace_t *dtrace_helptrace_buffer;
+static uint32_t dtrace_helptrace_next = 0;
+static int dtrace_helptrace_wrapped = 0;
/*
* DTrace Error Hashing
@@ -373,8 +380,8 @@ static kmutex_t dtrace_errlock;
* disallow all negative sizes. Ranges of size 0 are allowed.
*/
#define DTRACE_INRANGE(testaddr, testsz, baseaddr, basesz) \
- ((testaddr) - (baseaddr) < (basesz) && \
- (testaddr) + (testsz) - (baseaddr) <= (basesz) && \
+ ((testaddr) - (uintptr_t)(baseaddr) < (basesz) && \
+ (testaddr) + (testsz) - (uintptr_t)(baseaddr) <= (basesz) && \
(testaddr) + (testsz) >= (testaddr))
/*
@@ -475,6 +482,8 @@ static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t,
dtrace_optval_t);
static int dtrace_ecb_create_enable(dtrace_probe_t *, void *);
static void dtrace_helper_provider_destroy(dtrace_helper_provider_t *);
+static int dtrace_priv_proc(dtrace_state_t *, dtrace_mstate_t *);
+static void dtrace_getf_barrier(void);
/*
* DTrace Probe Context Functions
@@ -619,7 +628,7 @@ dtrace_canstore(uint64_t addr, size_t sz, dtrace_mstate_t *mstate,
* up both thread-local variables and any global dynamically-allocated
* variables.
*/
- if (DTRACE_INRANGE(addr, sz, (uintptr_t)vstate->dtvs_dynvars.dtds_base,
+ if (DTRACE_INRANGE(addr, sz, vstate->dtvs_dynvars.dtds_base,
vstate->dtvs_dynvars.dtds_size)) {
dtrace_dstate_t *dstate = &vstate->dtvs_dynvars;
uintptr_t base = (uintptr_t)dstate->dtds_base +
@@ -686,6 +695,7 @@ dtrace_canload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate,
dtrace_vstate_t *vstate)
{
volatile uintptr_t *illval = &cpu_core[CPU->cpu_id].cpuc_dtrace_illval;
+ file_t *fp;
/*
* If we hold the privilege to read from kernel memory, then
@@ -703,10 +713,99 @@ dtrace_canload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate,
/*
* We're allowed to read from our own string table.
*/
- if (DTRACE_INRANGE(addr, sz, (uintptr_t)mstate->dtms_difo->dtdo_strtab,
+ if (DTRACE_INRANGE(addr, sz, mstate->dtms_difo->dtdo_strtab,
mstate->dtms_difo->dtdo_strlen))
return (1);
+ if (vstate->dtvs_state != NULL &&
+ dtrace_priv_proc(vstate->dtvs_state, mstate)) {
+ proc_t *p;
+
+ /*
+ * When we have privileges to the current process, there are
+ * several context-related kernel structures that are safe to
+ * read, even absent the privilege to read from kernel memory.
+ * These reads are safe because these structures contain only
+ * state that (1) we're permitted to read, (2) is harmless or
+ * (3) contains pointers to additional kernel state that we're
+ * not permitted to read (and as such, do not present an
+ * opportunity for privilege escalation). Finally (and
+ * critically), because of the nature of their relation with
+ * the current thread context, the memory associated with these
+ * structures cannot change over the duration of probe context,
+ * and it is therefore impossible for this memory to be
+ * deallocated and reallocated as something else while it's
+ * being operated upon.
+ */
+ if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t)))
+ return (1);
+
+ if ((p = curthread->t_procp) != NULL && DTRACE_INRANGE(addr,
+ sz, curthread->t_procp, sizeof (proc_t))) {
+ return (1);
+ }
+
+ if (curthread->t_cred != NULL && DTRACE_INRANGE(addr, sz,
+ curthread->t_cred, sizeof (cred_t))) {
+ return (1);
+ }
+
+ if (p != NULL && p->p_pidp != NULL && DTRACE_INRANGE(addr, sz,
+ &(p->p_pidp->pid_id), sizeof (pid_t))) {
+ return (1);
+ }
+
+ if (curthread->t_cpu != NULL && DTRACE_INRANGE(addr, sz,
+ curthread->t_cpu, offsetof(cpu_t, cpu_pause_thread))) {
+ return (1);
+ }
+ }
+
+ if ((fp = mstate->dtms_getf) != NULL) {
+ uintptr_t psz = sizeof (void *);
+ vnode_t *vp;
+ vnodeops_t *op;
+
+ /*
+ * When getf() returns a file_t, the enabling is implicitly
+ * granted the (transient) right to read the returned file_t
+ * as well as the v_path and v_op->vnop_name of the underlying
+ * vnode. These accesses are allowed after a successful
+ * getf() because the members that they refer to cannot change
+ * once set -- and the barrier logic in the kernel's closef()
+ * path assures that the file_t and its referenced vode_t
+ * cannot themselves be stale (that is, it impossible for
+ * either dtms_getf itself or its f_vnode member to reference
+ * freed memory).
+ */
+ if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t)))
+ return (1);
+
+ if ((vp = fp->f_vnode) != NULL) {
+ if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz))
+ return (1);
+
+ if (vp->v_path != NULL && DTRACE_INRANGE(addr, sz,
+ vp->v_path, strlen(vp->v_path) + 1)) {
+ return (1);
+ }
+
+ if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz))
+ return (1);
+
+ if ((op = vp->v_op) != NULL &&
+ DTRACE_INRANGE(addr, sz, &op->vnop_name, psz)) {
+ return (1);
+ }
+
+ if (op != NULL && op->vnop_name != NULL &&
+ DTRACE_INRANGE(addr, sz, op->vnop_name,
+ strlen(op->vnop_name) + 1)) {
+ return (1);
+ }
+ }
+ }
+
DTRACE_CPUFLAG_SET(CPU_DTRACE_KPRIV);
*illval = addr;
return (0);
@@ -746,7 +845,7 @@ static int
dtrace_vcanload(void *src, dtrace_diftype_t *type, dtrace_mstate_t *mstate,
dtrace_vstate_t *vstate)
{
- size_t sz;
+ size_t sz, strsize;
ASSERT(type->dtdt_flags & DIF_TF_BYREF);
/*
@@ -756,16 +855,81 @@ dtrace_vcanload(void *src, dtrace_diftype_t *type, dtrace_mstate_t *mstate,
if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0)
return (1);
- if (type->dtdt_kind == DIF_TYPE_STRING)
- sz = dtrace_strlen(src,
- vstate->dtvs_state->dts_options[DTRACEOPT_STRSIZE]) + 1;
- else
+ if (type->dtdt_kind == DIF_TYPE_STRING) {
+ dtrace_state_t *state = vstate->dtvs_state;
+
+ if (state != NULL) {
+ strsize = state->dts_options[DTRACEOPT_STRSIZE];
+ } else {
+ /*
+ * In helper context, we have a NULL state; fall back
+ * to using the system-wide default for the string size
+ * in this case.
+ */
+ strsize = dtrace_strsize_default;
+ }
+
+ sz = dtrace_strlen(src, strsize) + 1;
+ } else {
sz = type->dtdt_size;
+ }
return (dtrace_canload((uintptr_t)src, sz, mstate, vstate));
}
/*
+ * Convert a string to a signed integer using safe loads.
+ *
+ * NOTE: This function uses various macros from strtolctype.h to manipulate
+ * digit values, etc -- these have all been checked to ensure they make
+ * no additional function calls.
+ */
+static int64_t
+dtrace_strtoll(char *input, int base, size_t limit)
+{
+ uintptr_t pos = (uintptr_t)input;
+ int64_t val = 0;
+ int x;
+ boolean_t neg = B_FALSE;
+ char c, cc, ccc;
+ uintptr_t end = pos + limit;
+
+ /*
+ * Consume any whitespace preceding digits.
+ */
+ while ((c = dtrace_load8(pos)) == ' ' || c == '\t')
+ pos++;
+
+ /*
+ * Handle an explicit sign if one is present.
+ */
+ if (c == '-' || c == '+') {
+ if (c == '-')
+ neg = B_TRUE;
+ c = dtrace_load8(++pos);
+ }
+
+ /*
+ * Check for an explicit hexadecimal prefix ("0x" or "0X") and skip it
+ * if present.
+ */
+ if (base == 16 && c == '0' && ((cc = dtrace_load8(pos + 1)) == 'x' ||
+ cc == 'X') && isxdigit(ccc = dtrace_load8(pos + 2))) {
+ pos += 2;
+ c = ccc;
+ }
+
+ /*
+ * Read in contiguous digits until the first non-digit character.
+ */
+ for (; pos < end && c != '\0' && lisalnum(c) && (x = DIGIT(c)) < base;
+ c = dtrace_load8(++pos))
+ val = val * base + x;
+
+ return (neg ? -val : val);
+}
+
+/*
* Compare two strings using safe loads.
*/
static int
@@ -1085,8 +1249,7 @@ dtrace_priv_proc_common_zone(dtrace_state_t *state)
*/
ASSERT(s_cr != NULL);
- if ((cr = CRED()) != NULL &&
- s_cr->cr_zone == cr->cr_zone)
+ if ((cr = CRED()) != NULL && s_cr->cr_zone == cr->cr_zone)
return (1);
return (0);
@@ -1209,19 +1372,17 @@ dtrace_priv_probe(dtrace_state_t *state, dtrace_mstate_t *mstate,
mode = pops->dtps_mode(prov->dtpv_arg,
probe->dtpr_id, probe->dtpr_arg);
- ASSERT((mode & DTRACE_MODE_USER) ||
- (mode & DTRACE_MODE_KERNEL));
- ASSERT((mode & DTRACE_MODE_NOPRIV_RESTRICT) ||
- (mode & DTRACE_MODE_NOPRIV_DROP));
+ ASSERT(mode & (DTRACE_MODE_USER | DTRACE_MODE_KERNEL));
+ ASSERT(mode & (DTRACE_MODE_NOPRIV_RESTRICT |
+ DTRACE_MODE_NOPRIV_DROP));
}
/*
* If the dte_cond bits indicate that this consumer is only allowed to
- * see user-mode firings of this probe, call the provider's dtps_mode()
- * entry point to check that the probe was fired while in a user
- * context. If that's not the case, use the policy specified by the
- * provider to determine if we drop the probe or merely restrict
- * operation.
+ * see user-mode firings of this probe, check that the probe was fired
+ * while in a user context. If that's not the case, use the policy
+ * specified by the provider to determine if we drop the probe or
+ * merely restrict operation.
*/
if (ecb->dte_cond & DTRACE_COND_USERMODE) {
ASSERT(mode != DTRACE_MODE_NOPRIV_DROP);
@@ -1288,6 +1449,15 @@ dtrace_priv_probe(dtrace_state_t *state, dtrace_mstate_t *mstate,
}
}
+ /*
+ * By merits of being in this code path at all, we have limited
+ * privileges. If the provider has indicated that limited privileges
+ * are to denote restricted operation, strip off the ability to access
+ * arguments.
+ */
+ if (mode & DTRACE_MODE_LIMITEDPRIV_RESTRICT)
+ mstate->dtms_access &= ~DTRACE_ACCESS_ARGS;
+
return (1);
}
@@ -2924,7 +3094,7 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t v,
}
case DIF_VAR_CURTHREAD:
- if (!dtrace_priv_kernel(state))
+ if (!dtrace_priv_proc(state, mstate))
return (0);
return ((uint64_t)(uintptr_t)curthread);
@@ -3236,6 +3406,463 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t v,
}
}
+
+typedef enum dtrace_json_state {
+ DTRACE_JSON_REST = 1,
+ DTRACE_JSON_OBJECT,
+ DTRACE_JSON_STRING,
+ DTRACE_JSON_STRING_ESCAPE,
+ DTRACE_JSON_STRING_ESCAPE_UNICODE,
+ DTRACE_JSON_COLON,
+ DTRACE_JSON_COMMA,
+ DTRACE_JSON_VALUE,
+ DTRACE_JSON_IDENTIFIER,
+ DTRACE_JSON_NUMBER,
+ DTRACE_JSON_NUMBER_FRAC,
+ DTRACE_JSON_NUMBER_EXP,
+ DTRACE_JSON_COLLECT_OBJECT
+} dtrace_json_state_t;
+
+/*
+ * This function possesses just enough knowledge about JSON to extract a single
+ * value from a JSON string and store it in the scratch buffer. It is able
+ * to extract nested object values, and members of arrays by index.
+ *
+ * elemlist is a list of JSON keys, stored as packed NUL-terminated strings, to
+ * be looked up as we descend into the object tree. e.g.
+ *
+ * foo[0].bar.baz[32] --> "foo" NUL "0" NUL "bar" NUL "baz" NUL "32" NUL
+ * with nelems = 5.
+ *
+ * The run time of this function must be bounded above by strsize to limit the
+ * amount of work done in probe context. As such, it is implemented as a
+ * simple state machine, reading one character at a time using safe loads
+ * until we find the requested element, hit a parsing error or run off the
+ * end of the object or string.
+ *
+ * As there is no way for a subroutine to return an error without interrupting
+ * clause execution, we simply return NULL in the event of a missing key or any
+ * other error condition. Each NULL return in this function is commented with
+ * the error condition it represents -- parsing or otherwise.
+ *
+ * The set of states for the state machine closely matches the JSON
+ * specification (http://json.org/). Briefly:
+ *
+ * DTRACE_JSON_REST:
+ * Skip whitespace until we find either a top-level Object, moving
+ * to DTRACE_JSON_OBJECT; or an Array, moving to DTRACE_JSON_VALUE.
+ *
+ * DTRACE_JSON_OBJECT:
+ * Locate the next key String in an Object. Sets a flag to denote
+ * the next String as a key string and moves to DTRACE_JSON_STRING.
+ *
+ * DTRACE_JSON_COLON:
+ * Skip whitespace until we find the colon that separates key Strings
+ * from their values. Once found, move to DTRACE_JSON_VALUE.
+ *
+ * DTRACE_JSON_VALUE:
+ * Detects the type of the next value (String, Number, Identifier, Object
+ * or Array) and routes to the states that process that type. Here we also
+ * deal with the element selector list if we are requested to traverse down
+ * into the object tree.
+ *
+ * DTRACE_JSON_COMMA:
+ * Skip whitespace until we find the comma that separates key-value pairs
+ * in Objects (returning to DTRACE_JSON_OBJECT) or values in Arrays
+ * (similarly DTRACE_JSON_VALUE). All following literal value processing
+ * states return to this state at the end of their value, unless otherwise
+ * noted.
+ *
+ * DTRACE_JSON_NUMBER, DTRACE_JSON_NUMBER_FRAC, DTRACE_JSON_NUMBER_EXP:
+ * Processes a Number literal from the JSON, including any exponent
+ * component that may be present. Numbers are returned as strings, which
+ * may be passed to strtoll() if an integer is required.
+ *
+ * DTRACE_JSON_IDENTIFIER:
+ * Processes a "true", "false" or "null" literal in the JSON.
+ *
+ * DTRACE_JSON_STRING, DTRACE_JSON_STRING_ESCAPE,
+ * DTRACE_JSON_STRING_ESCAPE_UNICODE:
+ * Processes a String literal from the JSON, whether the String denotes
+ * a key, a value or part of a larger Object. Handles all escape sequences
+ * present in the specification, including four-digit unicode characters,
+ * but merely includes the escape sequence without converting it to the
+ * actual escaped character. If the String is flagged as a key, we
+ * move to DTRACE_JSON_COLON rather than DTRACE_JSON_COMMA.
+ *
+ * DTRACE_JSON_COLLECT_OBJECT:
+ * This state collects an entire Object (or Array), correctly handling
+ * embedded strings. If the full element selector list matches this nested
+ * object, we return the Object in full as a string. If not, we use this
+ * state to skip to the next value at this level and continue processing.
+ *
+ * NOTE: This function uses various macros from strtolctype.h to manipulate
+ * digit values, etc -- these have all been checked to ensure they make
+ * no additional function calls.
+ */
+static char *
+dtrace_json(uint64_t size, uintptr_t json, char *elemlist, int nelems,
+ char *dest)
+{
+ dtrace_json_state_t state = DTRACE_JSON_REST;
+ int64_t array_elem = INT64_MIN;
+ int64_t array_pos = 0;
+ uint8_t escape_unicount = 0;
+ boolean_t string_is_key = B_FALSE;
+ boolean_t collect_object = B_FALSE;
+ boolean_t found_key = B_FALSE;
+ boolean_t in_array = B_FALSE;
+ uint32_t braces = 0, brackets = 0;
+ char *elem = elemlist;
+ char *dd = dest;
+ uintptr_t cur;
+
+ for (cur = json; cur < json + size; cur++) {
+ char cc = dtrace_load8(cur);
+ if (cc == '\0')
+ return (NULL);
+
+ switch (state) {
+ case DTRACE_JSON_REST:
+ if (isspace(cc))
+ break;
+
+ if (cc == '{') {
+ state = DTRACE_JSON_OBJECT;
+ break;
+ }
+
+ if (cc == '[') {
+ in_array = B_TRUE;
+ array_pos = 0;
+ array_elem = dtrace_strtoll(elem, 10, size);
+ found_key = array_elem == 0 ? B_TRUE : B_FALSE;
+ state = DTRACE_JSON_VALUE;
+ break;
+ }
+
+ /*
+ * ERROR: expected to find a top-level object or array.
+ */
+ return (NULL);
+ case DTRACE_JSON_OBJECT:
+ if (isspace(cc))
+ break;
+
+ if (cc == '"') {
+ state = DTRACE_JSON_STRING;
+ string_is_key = B_TRUE;
+ break;
+ }
+
+ /*
+ * ERROR: either the object did not start with a key
+ * string, or we've run off the end of the object
+ * without finding the requested key.
+ */
+ return (NULL);
+ case DTRACE_JSON_STRING:
+ if (cc == '\\') {
+ *dd++ = '\\';
+ state = DTRACE_JSON_STRING_ESCAPE;
+ break;
+ }
+
+ if (cc == '"') {
+ if (collect_object) {
+ /*
+ * We don't reset the dest here, as
+ * the string is part of a larger
+ * object being collected.
+ */
+ *dd++ = cc;
+ collect_object = B_FALSE;
+ state = DTRACE_JSON_COLLECT_OBJECT;
+ break;
+ }
+ *dd = '\0';
+ dd = dest; /* reset string buffer */
+ if (string_is_key) {
+ if (dtrace_strncmp(dest, elem,
+ size) == 0)
+ found_key = B_TRUE;
+ } else if (found_key) {
+ if (nelems > 1) {
+ /*
+ * We expected an object, not
+ * this string.
+ */
+ return (NULL);
+ }
+ return (dest);
+ }
+ state = string_is_key ? DTRACE_JSON_COLON :
+ DTRACE_JSON_COMMA;
+ string_is_key = B_FALSE;
+ break;
+ }
+
+ *dd++ = cc;
+ break;
+ case DTRACE_JSON_STRING_ESCAPE:
+ *dd++ = cc;
+ if (cc == 'u') {
+ escape_unicount = 0;
+ state = DTRACE_JSON_STRING_ESCAPE_UNICODE;
+ } else {
+ state = DTRACE_JSON_STRING;
+ }
+ break;
+ case DTRACE_JSON_STRING_ESCAPE_UNICODE:
+ if (!isxdigit(cc)) {
+ /*
+ * ERROR: invalid unicode escape, expected
+ * four valid hexidecimal digits.
+ */
+ return (NULL);
+ }
+
+ *dd++ = cc;
+ if (++escape_unicount == 4)
+ state = DTRACE_JSON_STRING;
+ break;
+ case DTRACE_JSON_COLON:
+ if (isspace(cc))
+ break;
+
+ if (cc == ':') {
+ state = DTRACE_JSON_VALUE;
+ break;
+ }
+
+ /*
+ * ERROR: expected a colon.
+ */
+ return (NULL);
+ case DTRACE_JSON_COMMA:
+ if (isspace(cc))
+ break;
+
+ if (cc == ',') {
+ if (in_array) {
+ state = DTRACE_JSON_VALUE;
+ if (++array_pos == array_elem)
+ found_key = B_TRUE;
+ } else {
+ state = DTRACE_JSON_OBJECT;
+ }
+ break;
+ }
+
+ /*
+ * ERROR: either we hit an unexpected character, or
+ * we reached the end of the object or array without
+ * finding the requested key.
+ */
+ return (NULL);
+ case DTRACE_JSON_IDENTIFIER:
+ if (islower(cc)) {
+ *dd++ = cc;
+ break;
+ }
+
+ *dd = '\0';
+ dd = dest; /* reset string buffer */
+
+ if (dtrace_strncmp(dest, "true", 5) == 0 ||
+ dtrace_strncmp(dest, "false", 6) == 0 ||
+ dtrace_strncmp(dest, "null", 5) == 0) {
+ if (found_key) {
+ if (nelems > 1) {
+ /*
+ * ERROR: We expected an object,
+ * not this identifier.
+ */
+ return (NULL);
+ }
+ return (dest);
+ } else {
+ cur--;
+ state = DTRACE_JSON_COMMA;
+ break;
+ }
+ }
+
+ /*
+ * ERROR: we did not recognise the identifier as one
+ * of those in the JSON specification.
+ */
+ return (NULL);
+ case DTRACE_JSON_NUMBER:
+ if (cc == '.') {
+ *dd++ = cc;
+ state = DTRACE_JSON_NUMBER_FRAC;
+ break;
+ }
+
+ if (cc == 'x' || cc == 'X') {
+ /*
+ * ERROR: specification explicitly excludes
+ * hexidecimal or octal numbers.
+ */
+ return (NULL);
+ }
+
+ /* FALLTHRU */
+ case DTRACE_JSON_NUMBER_FRAC:
+ if (cc == 'e' || cc == 'E') {
+ *dd++ = cc;
+ state = DTRACE_JSON_NUMBER_EXP;
+ break;
+ }
+
+ if (cc == '+' || cc == '-') {
+ /*
+ * ERROR: expect sign as part of exponent only.
+ */
+ return (NULL);
+ }
+ /* FALLTHRU */
+ case DTRACE_JSON_NUMBER_EXP:
+ if (isdigit(cc) || cc == '+' || cc == '-') {
+ *dd++ = cc;
+ break;
+ }
+
+ *dd = '\0';
+ dd = dest; /* reset string buffer */
+ if (found_key) {
+ if (nelems > 1) {
+ /*
+ * ERROR: We expected an object, not
+ * this number.
+ */
+ return (NULL);
+ }
+ return (dest);
+ }
+
+ cur--;
+ state = DTRACE_JSON_COMMA;
+ break;
+ case DTRACE_JSON_VALUE:
+ if (isspace(cc))
+ break;
+
+ if (cc == '{' || cc == '[') {
+ if (nelems > 1 && found_key) {
+ in_array = cc == '[' ? B_TRUE : B_FALSE;
+ /*
+ * If our element selector directs us
+ * to descend into this nested object,
+ * then move to the next selector
+ * element in the list and restart the
+ * state machine.
+ */
+ while (*elem != '\0')
+ elem++;
+ elem++; /* skip the inter-element NUL */
+ nelems--;
+ dd = dest;
+ if (in_array) {
+ state = DTRACE_JSON_VALUE;
+ array_pos = 0;
+ array_elem = dtrace_strtoll(
+ elem, 10, size);
+ found_key = array_elem == 0 ?
+ B_TRUE : B_FALSE;
+ } else {
+ found_key = B_FALSE;
+ state = DTRACE_JSON_OBJECT;
+ }
+ break;
+ }
+
+ /*
+ * Otherwise, we wish to either skip this
+ * nested object or return it in full.
+ */
+ if (cc == '[')
+ brackets = 1;
+ else
+ braces = 1;
+ *dd++ = cc;
+ state = DTRACE_JSON_COLLECT_OBJECT;
+ break;
+ }
+
+ if (cc == '"') {
+ state = DTRACE_JSON_STRING;
+ break;
+ }
+
+ if (islower(cc)) {
+ /*
+ * Here we deal with true, false and null.
+ */
+ *dd++ = cc;
+ state = DTRACE_JSON_IDENTIFIER;
+ break;
+ }
+
+ if (cc == '-' || isdigit(cc)) {
+ *dd++ = cc;
+ state = DTRACE_JSON_NUMBER;
+ break;
+ }
+
+ /*
+ * ERROR: unexpected character at start of value.
+ */
+ return (NULL);
+ case DTRACE_JSON_COLLECT_OBJECT:
+ if (cc == '\0')
+ /*
+ * ERROR: unexpected end of input.
+ */
+ return (NULL);
+
+ *dd++ = cc;
+ if (cc == '"') {
+ collect_object = B_TRUE;
+ state = DTRACE_JSON_STRING;
+ break;
+ }
+
+ if (cc == ']') {
+ if (brackets-- == 0) {
+ /*
+ * ERROR: unbalanced brackets.
+ */
+ return (NULL);
+ }
+ } else if (cc == '}') {
+ if (braces-- == 0) {
+ /*
+ * ERROR: unbalanced braces.
+ */
+ return (NULL);
+ }
+ } else if (cc == '{') {
+ braces++;
+ } else if (cc == '[') {
+ brackets++;
+ }
+
+ if (brackets == 0 && braces == 0) {
+ if (found_key) {
+ *dd = '\0';
+ return (dest);
+ }
+ dd = dest; /* reset string buffer */
+ state = DTRACE_JSON_COMMA;
+ }
+ break;
+ }
+ }
+ return (NULL);
+}
+
/*
* Emulate the execution of DTrace ID subroutines invoked by the call opcode.
* Notice that we don't bother validating the proper number of arguments or
@@ -3936,6 +4563,65 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uint64_t *regs,
break;
}
+ case DIF_SUBR_JSON: {
+ uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
+ uintptr_t json = tupregs[0].dttk_value;
+ size_t jsonlen = dtrace_strlen((char *)json, size);
+ uintptr_t elem = tupregs[1].dttk_value;
+ size_t elemlen = dtrace_strlen((char *)elem, size);
+
+ char *dest = (char *)mstate->dtms_scratch_ptr;
+ char *elemlist = (char *)mstate->dtms_scratch_ptr + jsonlen + 1;
+ char *ee = elemlist;
+ int nelems = 1;
+ uintptr_t cur;
+
+ if (!dtrace_canload(json, jsonlen + 1, mstate, vstate) ||
+ !dtrace_canload(elem, elemlen + 1, mstate, vstate)) {
+ regs[rd] = NULL;
+ break;
+ }
+
+ if (!DTRACE_INSCRATCH(mstate, jsonlen + 1 + elemlen + 1)) {
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH);
+ regs[rd] = NULL;
+ break;
+ }
+
+ /*
+ * Read the element selector and split it up into a packed list
+ * of strings.
+ */
+ for (cur = elem; cur < elem + elemlen; cur++) {
+ char cc = dtrace_load8(cur);
+
+ if (cur == elem && cc == '[') {
+ /*
+ * If the first element selector key is
+ * actually an array index then ignore the
+ * bracket.
+ */
+ continue;
+ }
+
+ if (cc == ']')
+ continue;
+
+ if (cc == '.' || cc == '[') {
+ nelems++;
+ cc = '\0';
+ }
+
+ *ee++ = cc;
+ }
+ *ee++ = '\0';
+
+ if ((regs[rd] = (uintptr_t)dtrace_json(size, json, elemlist,
+ nelems, dest)) != NULL)
+ mstate->dtms_scratch_ptr += jsonlen + 1;
+ break;
+ }
+
case DIF_SUBR_TOUPPER:
case DIF_SUBR_TOLOWER: {
uintptr_t s = tupregs[0].dttk_value;
@@ -4243,6 +4929,28 @@ case DIF_SUBR_GETMAJOR:
break;
}
+ case DIF_SUBR_STRTOLL: {
+ uintptr_t s = tupregs[0].dttk_value;
+ uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
+ int base = 10;
+
+ if (nargs > 1) {
+ if ((base = tupregs[1].dttk_value) <= 1 ||
+ base > ('z' - 'a' + 1) + ('9' - '0' + 1)) {
+ *flags |= CPU_DTRACE_ILLOP;
+ break;
+ }
+ }
+
+ if (!dtrace_strcanload(s, size, mstate, vstate)) {
+ regs[rd] = INT64_MIN;
+ break;
+ }
+
+ regs[rd] = dtrace_strtoll((char *)s, base, size);
+ break;
+ }
+
case DIF_SUBR_LLTOSTR: {
int64_t i = (int64_t)tupregs[0].dttk_value;
uint64_t val, digit;
@@ -4452,11 +5160,35 @@ case DIF_SUBR_GETMAJOR:
break;
}
+ case DIF_SUBR_GETF: {
+ uintptr_t fd = tupregs[0].dttk_value;
+ uf_info_t *finfo = &curthread->t_procp->p_user.u_finfo;
+ file_t *fp;
+
+ if (!dtrace_priv_proc(state, mstate)) {
+ regs[rd] = NULL;
+ break;
+ }
+
+ /*
+ * This is safe because fi_nfiles only increases, and the
+ * fi_list array is not freed when the array size doubles.
+ * (See the comment in flist_grow() for details on the
+ * management of the u_finfo structure.)
+ */
+ fp = fd < finfo->fi_nfiles ? finfo->fi_list[fd].uf_file : NULL;
+
+ mstate->dtms_getf = fp;
+ regs[rd] = (uintptr_t)fp;
+ break;
+ }
+
case DIF_SUBR_CLEANPATH: {
char *dest = (char *)mstate->dtms_scratch_ptr, c;
uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
uintptr_t src = tupregs[0].dttk_value;
int i = 0, j = 0;
+ zone_t *z;
if (!dtrace_strcanload(src, size, mstate, vstate)) {
regs[rd] = NULL;
@@ -4555,6 +5287,23 @@ next:
} while (c != '\0');
dest[j] = '\0';
+
+ if (mstate->dtms_getf != NULL &&
+ !(mstate->dtms_access & DTRACE_ACCESS_KERNEL) &&
+ (z = state->dts_cred.dcr_cred->cr_zone) != kcred->cr_zone) {
+ /*
+ * If we've done a getf() as a part of this ECB and we
+ * don't have kernel access (and we're not in the global
+ * zone), check if the path we cleaned up begins with
+ * the zone's root path, and trim it off if so. Note
+ * that this is an output cleanliness issue, not a
+ * security issue: knowing one's zone root path does
+ * not enable privilege escalation.
+ */
+ if (strstr(dest, z->zone_rootpath) == dest)
+ dest += strlen(z->zone_rootpath) - 1;
+ }
+
regs[rd] = (uintptr_t)dest;
mstate->dtms_scratch_ptr += size;
break;
@@ -4939,102 +5688,95 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate,
pc = DIF_INSTR_LABEL(instr);
break;
case DIF_OP_RLDSB:
- if (!dtrace_canstore(regs[r1], 1, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 1, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDSB:
regs[rd] = (int8_t)dtrace_load8(regs[r1]);
break;
case DIF_OP_RLDSH:
- if (!dtrace_canstore(regs[r1], 2, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 2, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDSH:
regs[rd] = (int16_t)dtrace_load16(regs[r1]);
break;
case DIF_OP_RLDSW:
- if (!dtrace_canstore(regs[r1], 4, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 4, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDSW:
regs[rd] = (int32_t)dtrace_load32(regs[r1]);
break;
case DIF_OP_RLDUB:
- if (!dtrace_canstore(regs[r1], 1, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 1, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDUB:
regs[rd] = dtrace_load8(regs[r1]);
break;
case DIF_OP_RLDUH:
- if (!dtrace_canstore(regs[r1], 2, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 2, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDUH:
regs[rd] = dtrace_load16(regs[r1]);
break;
case DIF_OP_RLDUW:
- if (!dtrace_canstore(regs[r1], 4, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 4, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDUW:
regs[rd] = dtrace_load32(regs[r1]);
break;
case DIF_OP_RLDX:
- if (!dtrace_canstore(regs[r1], 8, mstate, vstate)) {
- *flags |= CPU_DTRACE_KPRIV;
- *illval = regs[r1];
+ if (!dtrace_canload(regs[r1], 8, mstate, vstate))
break;
- }
/*FALLTHROUGH*/
case DIF_OP_LDX:
regs[rd] = dtrace_load64(regs[r1]);
break;
case DIF_OP_ULDSB:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = (int8_t)
dtrace_fuword8((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_ULDSH:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = (int16_t)
dtrace_fuword16((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_ULDSW:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] = (int32_t)
dtrace_fuword32((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_ULDUB:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] =
dtrace_fuword8((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_ULDUH:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] =
dtrace_fuword16((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_ULDUW:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] =
dtrace_fuword32((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_ULDX:
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
regs[rd] =
dtrace_fuword64((void *)(uintptr_t)regs[r1]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
break;
case DIF_OP_RET:
rval = regs[rd];
@@ -5842,6 +6584,63 @@ out:
mstate->dtms_scratch_ptr = old;
}
+static void
+dtrace_store_by_ref(dtrace_difo_t *dp, caddr_t tomax, size_t size,
+ size_t *valoffsp, uint64_t *valp, uint64_t end, int intuple, int dtkind)
+{
+ volatile uint16_t *flags;
+ uint64_t val = *valp;
+ size_t valoffs = *valoffsp;
+
+ flags = (volatile uint16_t *)&cpu_core[CPU->cpu_id].cpuc_dtrace_flags;
+ ASSERT(dtkind == DIF_TF_BYREF || dtkind == DIF_TF_BYUREF);
+
+ /*
+ * If this is a string, we're going to only load until we find the zero
+ * byte -- after which we'll store zero bytes.
+ */
+ if (dp->dtdo_rtype.dtdt_kind == DIF_TYPE_STRING) {
+ char c = '\0' + 1;
+ size_t s;
+
+ for (s = 0; s < size; s++) {
+ if (c != '\0' && dtkind == DIF_TF_BYREF) {
+ c = dtrace_load8(val++);
+ } else if (c != '\0' && dtkind == DIF_TF_BYUREF) {
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+ c = dtrace_fuword8((void *)(uintptr_t)val++);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
+ if (*flags & CPU_DTRACE_FAULT)
+ break;
+ }
+
+ DTRACE_STORE(uint8_t, tomax, valoffs++, c);
+
+ if (c == '\0' && intuple)
+ break;
+ }
+ } else {
+ uint8_t c;
+ while (valoffs < end) {
+ if (dtkind == DIF_TF_BYREF) {
+ c = dtrace_load8(val++);
+ } else if (dtkind == DIF_TF_BYUREF) {
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+ c = dtrace_fuword8((void *)(uintptr_t)val++);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
+ if (*flags & CPU_DTRACE_FAULT)
+ break;
+ }
+
+ DTRACE_STORE(uint8_t, tomax,
+ valoffs++, c);
+ }
+ }
+
+ *valp = val;
+ *valoffsp = valoffs;
+}
+
/*
* If you're looking for the epicenter of DTrace, you just found it. This
* is the function called by the provider to fire a probe -- from which all
@@ -5942,6 +6741,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
mstate.dtms_present = DTRACE_MSTATE_ARGS | DTRACE_MSTATE_PROBE;
mstate.dtms_access = DTRACE_ACCESS_ARGS | DTRACE_ACCESS_PROC;
+ mstate.dtms_getf = NULL;
+
*flags &= ~CPU_DTRACE_ERROR;
if (prov == dtrace_provider) {
@@ -6331,7 +7132,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
ASSERT(0);
}
- if (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF) {
+ if (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF ||
+ dp->dtdo_rtype.dtdt_flags & DIF_TF_BYUREF) {
uintptr_t end = valoffs + size;
if (tracememsize != 0 &&
@@ -6340,40 +7142,15 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
tracememsize = 0;
}
- if (!dtrace_vcanload((void *)(uintptr_t)val,
+ if (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF &&
+ !dtrace_vcanload((void *)(uintptr_t)val,
&dp->dtdo_rtype, &mstate, vstate))
continue;
- /*
- * If this is a string, we're going to only
- * load until we find the zero byte -- after
- * which we'll store zero bytes.
- */
- if (dp->dtdo_rtype.dtdt_kind ==
- DIF_TYPE_STRING) {
- char c = '\0' + 1;
- int intuple = act->dta_intuple;
- size_t s;
-
- for (s = 0; s < size; s++) {
- if (c != '\0')
- c = dtrace_load8(val++);
-
- DTRACE_STORE(uint8_t, tomax,
- valoffs++, c);
-
- if (c == '\0' && intuple)
- break;
- }
-
- continue;
- }
-
- while (valoffs < end) {
- DTRACE_STORE(uint8_t, tomax, valoffs++,
- dtrace_load8(val++));
- }
-
+ dtrace_store_by_ref(dp, tomax, size, &valoffs,
+ &val, end, act->dta_intuple,
+ dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF ?
+ DIF_TF_BYREF: DIF_TF_BYUREF);
continue;
}
@@ -6741,7 +7518,7 @@ dtrace_cred2priv(cred_t *cr, uint32_t *privp, uid_t *uidp, zoneid_t *zoneidp)
priv = DTRACE_PRIV_ALL;
} else {
*uidp = crgetuid(cr);
- *zoneidp = crgetzoneid(cr);
+ *zoneidp = crgetzonedid(cr);
priv = 0;
if (PRIV_POLICY_ONLY(cr, PRIV_DTRACE_KERNEL, B_FALSE))
@@ -7237,7 +8014,7 @@ dtrace_register(const char *name, const dtrace_pattr_t *pap, uint32_t priv,
provider->dtpv_priv.dtpp_flags = priv;
if (cr != NULL) {
provider->dtpv_priv.dtpp_uid = crgetuid(cr);
- provider->dtpv_priv.dtpp_zoneid = crgetzoneid(cr);
+ provider->dtpv_priv.dtpp_zoneid = crgetzonedid(cr);
}
provider->dtpv_pops = *pops;
@@ -7848,6 +8625,7 @@ dtrace_probe_enable(const dtrace_probedesc_t *desc, dtrace_enabling_t *enab)
uint32_t priv;
uid_t uid;
zoneid_t zoneid;
+ dtrace_state_t *state = enab->dten_vstate->dtvs_state;
ASSERT(MUTEX_HELD(&dtrace_lock));
dtrace_ecb_create_cache = NULL;
@@ -7862,8 +8640,22 @@ dtrace_probe_enable(const dtrace_probedesc_t *desc, dtrace_enabling_t *enab)
}
dtrace_probekey(desc, &pkey);
- dtrace_cred2priv(enab->dten_vstate->dtvs_state->dts_cred.dcr_cred,
- &priv, &uid, &zoneid);
+ dtrace_cred2priv(state->dts_cred.dcr_cred, &priv, &uid, &zoneid);
+
+ if ((priv & DTRACE_PRIV_ZONEOWNER) &&
+ state->dts_options[DTRACEOPT_ZONE] != DTRACEOPT_UNSET) {
+ /*
+ * If we have the privilege of instrumenting all zones but we
+ * have been told to instrument but one, we will spoof this up
+ * depriving ourselves of DTRACE_PRIV_ZONEOWNER for purposes
+ * of dtrace_match(). (Note that DTRACEOPT_ZONE is not for
+ * security but rather for performance: it allows the global
+ * zone to instrument USDT probes in a local zone without
+ * requiring all zones to be instrumented.)
+ */
+ priv &= ~DTRACE_PRIV_ZONEOWNER;
+ zoneid = state->dts_options[DTRACEOPT_ZONE];
+ }
return (dtrace_match(&pkey, priv, uid, zoneid, dtrace_ecb_create_enable,
enab));
@@ -8448,6 +9240,20 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs,
subr == DIF_SUBR_COPYOUTSTR) {
dp->dtdo_destructive = 1;
}
+
+ if (subr == DIF_SUBR_GETF) {
+ /*
+ * If we have a getf() we need to record that
+ * in our state. Note that our state can be
+ * NULL if this is a helper -- but in that
+ * case, the call to getf() is itself illegal,
+ * and will be caught (slightly later) when
+ * the helper is validated.
+ */
+ if (vstate->dtvs_state != NULL)
+ vstate->dtvs_state->dts_getf++;
+ }
+
break;
case DIF_OP_PUSHTR:
if (type != DIF_TYPE_STRING && type != DIF_TYPE_CTF)
@@ -8477,7 +9283,7 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs,
"expected 'ret' as last DIF instruction\n");
}
- if (!(dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF)) {
+ if (!(dp->dtdo_rtype.dtdt_flags & (DIF_TF_BYREF | DIF_TF_BYUREF))) {
/*
* If we're not returning by reference, the size must be either
* 0 or the size of one of the base types.
@@ -8726,7 +9532,9 @@ dtrace_difo_validate_helper(dtrace_difo_t *dp)
subr == DIF_SUBR_INET_NTOA ||
subr == DIF_SUBR_INET_NTOA6 ||
subr == DIF_SUBR_INET_NTOP ||
+ subr == DIF_SUBR_JSON ||
subr == DIF_SUBR_LLTOSTR ||
+ subr == DIF_SUBR_STRTOLL ||
subr == DIF_SUBR_RINDEX ||
subr == DIF_SUBR_STRCHR ||
subr == DIF_SUBR_STRJOIN ||
@@ -13090,6 +13898,22 @@ dtrace_state_go(dtrace_state_t *state, processorid_t *cpu)
state->dts_activity = DTRACE_ACTIVITY_WARMUP;
+ if (state->dts_getf != 0 &&
+ !(state->dts_cred.dcr_visible & DTRACE_CRV_KERNEL)) {
+ /*
+ * We don't have kernel privs but we have at least one call
+ * to getf(); we need to bump our zone's count, and (if
+ * this is the first enabling to have an unprivileged call
+ * to getf()) we need to hook into closef().
+ */
+ state->dts_cred.dcr_cred->cr_zone->zone_dtrace_getf++;
+
+ if (dtrace_getf++ == 0) {
+ ASSERT(dtrace_closef == NULL);
+ dtrace_closef = dtrace_getf_barrier;
+ }
+ }
+
/*
* Now it's time to actually fire the BEGIN probe. We need to disable
* interrupts here both to record the CPU on which we fired the BEGIN
@@ -13206,6 +14030,24 @@ dtrace_state_stop(dtrace_state_t *state, processorid_t *cpu)
state->dts_activity = DTRACE_ACTIVITY_STOPPED;
dtrace_sync();
+ if (state->dts_getf != 0 &&
+ !(state->dts_cred.dcr_visible & DTRACE_CRV_KERNEL)) {
+ /*
+ * We don't have kernel privs but we have at least one call
+ * to getf(); we need to lower our zone's count, and (if
+ * this is the last enabling to have an unprivileged call
+ * to getf()) we need to clear the closef() hook.
+ */
+ ASSERT(state->dts_cred.dcr_cred->cr_zone->zone_dtrace_getf > 0);
+ ASSERT(dtrace_closef == dtrace_getf_barrier);
+ ASSERT(dtrace_getf > 0);
+
+ state->dts_cred.dcr_cred->cr_zone->zone_dtrace_getf--;
+
+ if (--dtrace_getf == 0)
+ dtrace_closef = NULL;
+ }
+
return (0);
}
@@ -13512,10 +14354,10 @@ dtrace_helper_trace(dtrace_helper_action_t *helper,
dtrace_mstate_t *mstate, dtrace_vstate_t *vstate, int where)
{
uint32_t size, next, nnext, i;
- dtrace_helptrace_t *ent;
+ dtrace_helptrace_t *ent, *buffer;
uint16_t flags = cpu_core[CPU->cpu_id].cpuc_dtrace_flags;
- if (!dtrace_helptrace_enabled)
+ if ((buffer = dtrace_helptrace_buffer) == NULL)
return;
ASSERT(vstate->dtvs_nlocals <= dtrace_helptrace_nlocals);
@@ -13543,10 +14385,12 @@ dtrace_helper_trace(dtrace_helper_action_t *helper,
/*
* We have our slot; fill it in.
*/
- if (nnext == size)
+ if (nnext == size) {
+ dtrace_helptrace_wrapped++;
next = 0;
+ }
- ent = (dtrace_helptrace_t *)&dtrace_helptrace_buffer[next];
+ ent = (dtrace_helptrace_t *)((uintptr_t)buffer + next);
ent->dtht_helper = helper;
ent->dtht_where = where;
ent->dtht_nlocals = vstate->dtvs_nlocals;
@@ -13580,7 +14424,7 @@ dtrace_helper(int which, dtrace_mstate_t *mstate,
dtrace_helper_action_t *helper;
dtrace_vstate_t *vstate;
dtrace_difo_t *pred;
- int i, trace = dtrace_helptrace_enabled;
+ int i, trace = dtrace_helptrace_buffer != NULL;
ASSERT(which >= 0 && which < DTRACE_NHELPER_ACTIONS);
@@ -14766,6 +15610,23 @@ dtrace_toxrange_add(uintptr_t base, uintptr_t limit)
dtrace_toxranges++;
}
+static void
+dtrace_getf_barrier()
+{
+ /*
+ * When we have unprivileged (that is, non-DTRACE_CRV_KERNEL) enablings
+ * that contain calls to getf(), this routine will be called on every
+ * closef() before either the underlying vnode is released or the
+ * file_t itself is freed. By the time we are here, it is essential
+ * that the file_t can no longer be accessed from a call to getf()
+ * in probe context -- that assures that a dtrace_sync() can be used
+ * to clear out any enablings referring to the old structures.
+ */
+ if (curthread->t_procp->p_zone->zone_dtrace_getf != 0 ||
+ kcred->cr_zone->zone_dtrace_getf != 0)
+ dtrace_sync();
+}
+
/*
* DTrace Driver Cookbook Functions
*/
@@ -14880,17 +15741,6 @@ dtrace_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
mutex_exit(&cpu_lock);
/*
- * If DTrace helper tracing is enabled, we need to allocate the
- * trace buffer and initialize the values.
- */
- if (dtrace_helptrace_enabled) {
- ASSERT(dtrace_helptrace_buffer == NULL);
- dtrace_helptrace_buffer =
- kmem_zalloc(dtrace_helptrace_bufsize, KM_SLEEP);
- dtrace_helptrace_next = 0;
- }
-
- /*
* If there are already providers, we must ask them to provide their
* probes, and then match any anonymous enabling against them. Note
* that there should be no other retained enablings at this time:
@@ -14986,6 +15836,18 @@ dtrace_open(dev_t *devp, int flag, int otyp, cred_t *cred_p)
return (EBUSY);
}
+ if (dtrace_helptrace_enable && dtrace_helptrace_buffer == NULL) {
+ /*
+ * If DTrace helper tracing is enabled, we need to allocate the
+ * trace buffer and initialize the values.
+ */
+ dtrace_helptrace_buffer =
+ kmem_zalloc(dtrace_helptrace_bufsize, KM_SLEEP);
+ dtrace_helptrace_next = 0;
+ dtrace_helptrace_wrapped = 0;
+ dtrace_helptrace_enable = 0;
+ }
+
state = dtrace_state_create(devp, cred_p);
mutex_exit(&cpu_lock);
@@ -15007,6 +15869,7 @@ dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p)
{
minor_t minor = getminor(dev);
dtrace_state_t *state;
+ dtrace_helptrace_t *buf = NULL;
if (minor == DTRACEMNRN_HELPER)
return (0);
@@ -15024,6 +15887,18 @@ dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p)
dtrace_state_destroy(state->dts_anon);
}
+ if (dtrace_helptrace_disable) {
+ /*
+ * If we have been told to disable helper tracing, set the
+ * buffer to NULL before calling into dtrace_state_destroy();
+ * we take advantage of its dtrace_sync() to know that no
+ * CPU is in probe context with enabled helper tracing
+ * after it returns.
+ */
+ buf = dtrace_helptrace_buffer;
+ dtrace_helptrace_buffer = NULL;
+ }
+
dtrace_state_destroy(state);
ASSERT(dtrace_opens > 0);
@@ -15034,6 +15909,11 @@ dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p)
if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL)
(void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE);
+ if (buf != NULL) {
+ kmem_free(buf, dtrace_helptrace_bufsize);
+ dtrace_helptrace_disable = 0;
+ }
+
mutex_exit(&dtrace_lock);
mutex_exit(&cpu_lock);
@@ -15922,12 +16802,10 @@ dtrace_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
dtrace_modload = NULL;
dtrace_modunload = NULL;
- mutex_exit(&cpu_lock);
+ ASSERT(dtrace_getf == 0);
+ ASSERT(dtrace_closef == NULL);
- if (dtrace_helptrace_enabled) {
- kmem_free(dtrace_helptrace_buffer, dtrace_helptrace_bufsize);
- dtrace_helptrace_buffer = NULL;
- }
+ mutex_exit(&cpu_lock);
kmem_free(dtrace_probes, dtrace_nprobes * sizeof (dtrace_probe_t *));
dtrace_probes = NULL;
diff --git a/usr/src/uts/common/dtrace/sdt_subr.c b/usr/src/uts/common/dtrace/sdt_subr.c
index 242185071b..157acc25fc 100644
--- a/usr/src/uts/common/dtrace/sdt_subr.c
+++ b/usr/src/uts/common/dtrace/sdt_subr.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <sys/sdt_impl.h>
@@ -97,26 +98,26 @@ static dtrace_pattr_t iscsi_attr = {
};
sdt_provider_t sdt_providers[] = {
- { "vtrace", "__vtrace_", &vtrace_attr, 0 },
- { "sysinfo", "__cpu_sysinfo_", &info_attr, 0 },
- { "vminfo", "__cpu_vminfo_", &info_attr, 0 },
- { "fpuinfo", "__fpuinfo_", &fpu_attr, 0 },
- { "sched", "__sched_", &stab_attr, 0 },
- { "proc", "__proc_", &stab_attr, 0 },
- { "io", "__io_", &stab_attr, 0 },
- { "ip", "__ip_", &stab_attr, 0 },
- { "tcp", "__tcp_", &stab_attr, 0 },
- { "udp", "__udp_", &stab_attr, 0 },
- { "mib", "__mib_", &stab_attr, 0 },
- { "fsinfo", "__fsinfo_", &fsinfo_attr, 0 },
- { "iscsi", "__iscsi_", &iscsi_attr, 0 },
- { "nfsv3", "__nfsv3_", &stab_attr, 0 },
- { "nfsv4", "__nfsv4_", &stab_attr, 0 },
- { "xpv", "__xpv_", &xpv_attr, 0 },
- { "fc", "__fc_", &fc_attr, 0 },
- { "srp", "__srp_", &fc_attr, 0 },
- { "sysevent", "__sysevent_", &stab_attr, 0 },
- { "sdt", NULL, &sdt_attr, 0 },
+ { "vtrace", "__vtrace_", &vtrace_attr },
+ { "sysinfo", "__cpu_sysinfo_", &info_attr, DTRACE_PRIV_USER },
+ { "vminfo", "__cpu_vminfo_", &info_attr, DTRACE_PRIV_USER },
+ { "fpuinfo", "__fpuinfo_", &fpu_attr },
+ { "sched", "__sched_", &stab_attr, DTRACE_PRIV_USER },
+ { "proc", "__proc_", &stab_attr, DTRACE_PRIV_USER },
+ { "io", "__io_", &stab_attr },
+ { "ip", "__ip_", &stab_attr },
+ { "tcp", "__tcp_", &stab_attr },
+ { "udp", "__udp_", &stab_attr },
+ { "mib", "__mib_", &stab_attr },
+ { "fsinfo", "__fsinfo_", &fsinfo_attr },
+ { "iscsi", "__iscsi_", &iscsi_attr },
+ { "nfsv3", "__nfsv3_", &stab_attr },
+ { "nfsv4", "__nfsv4_", &stab_attr },
+ { "xpv", "__xpv_", &xpv_attr },
+ { "fc", "__fc_", &fc_attr },
+ { "srp", "__srp_", &fc_attr },
+ { "sysevent", "__sysevent_", &stab_attr },
+ { "sdt", NULL, &sdt_attr },
{ NULL }
};
@@ -1155,6 +1156,20 @@ sdt_argdesc_t sdt_args[] = {
};
/*ARGSUSED*/
+int
+sdt_mode(void *arg, dtrace_id_t id, void *parg)
+{
+ /*
+ * We tell DTrace that we're in kernel mode, that the firing needs to
+ * be dropped for anything that doesn't have necessary privileges, and
+ * that it needs to be restricted for anything that has restricted
+ * (i.e., not all-zone) privileges.
+ */
+ return (DTRACE_MODE_KERNEL | DTRACE_MODE_NOPRIV_DROP |
+ DTRACE_MODE_LIMITEDPRIV_RESTRICT);
+}
+
+/*ARGSUSED*/
void
sdt_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc)
{
diff --git a/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c b/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c
index 8286dc11ac..dbe9aa4c07 100644
--- a/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c
+++ b/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Bayard G. Bell. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -149,7 +150,7 @@ static vfsdef_t vfw = {
"hsfs",
hsfsinit,
/* We don't suppport remounting */
- VSW_HASPROTO|VSW_STATS|VSW_CANLOFI|VSW_ZMOUNT,
+ VSW_HASPROTO|VSW_STATS|VSW_CANLOFI,
&hsfs_proto_opttbl
};
diff --git a/usr/src/uts/common/fs/hyprlofs/hyprlofs_dir.c b/usr/src/uts/common/fs/hyprlofs/hyprlofs_dir.c
new file mode 100644
index 0000000000..05ee2c6e09
--- /dev/null
+++ b/usr/src/uts/common/fs/hyprlofs/hyprlofs_dir.c
@@ -0,0 +1,640 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/sysmacros.h>
+#include <sys/systm.h>
+#include <sys/time.h>
+#include <sys/vfs.h>
+#include <sys/vnode.h>
+#include <sys/errno.h>
+#include <sys/cmn_err.h>
+#include <sys/cred.h>
+#include <sys/stat.h>
+#include <sys/policy.h>
+#include <sys/fs/hyprlofs_info.h>
+
+static int hldir_make_hlnode(hlnode_t *, hlfsmount_t *, vattr_t *, enum de_op,
+ vnode_t *, hlnode_t **, cred_t *);
+static int hldiraddentry(hlnode_t *, hlnode_t *, char *);
+
+
+#define HL_HASH_SIZE 8192 /* must be power of 2 */
+#define HL_MUTEX_SIZE 64
+
+static hldirent_t *hl_hashtable[HL_HASH_SIZE];
+static kmutex_t hl_hashmutex[HL_MUTEX_SIZE];
+
+#define HL_HASH_INDEX(a) ((a) & (HL_HASH_SIZE-1))
+#define HL_MUTEX_INDEX(a) ((a) & (HL_MUTEX_SIZE-1))
+
+#define HYPRLOFS_HASH(tp, name, hash) \
+ { \
+ char Xc, *Xcp; \
+ hash = (uint_t)(uintptr_t)(tp) >> 8; \
+ for (Xcp = (name); (Xc = *Xcp) != 0; Xcp++) \
+ hash = (hash << 4) + hash + (uint_t)Xc; \
+ }
+
+void
+hyprlofs_hash_init(void)
+{
+ int ix;
+
+ for (ix = 0; ix < HL_MUTEX_SIZE; ix++)
+ mutex_init(&hl_hashmutex[ix], NULL, MUTEX_DEFAULT, NULL);
+}
+
+static void
+hyprlofs_hash_in(hldirent_t *h)
+{
+ uint_t hash;
+ hldirent_t **prevpp;
+ kmutex_t *hmtx;
+
+ HYPRLOFS_HASH(h->hld_parent, h->hld_name, hash);
+ h->hld_hash = hash;
+ prevpp = &hl_hashtable[HL_HASH_INDEX(hash)];
+ hmtx = &hl_hashmutex[HL_MUTEX_INDEX(hash)];
+ mutex_enter(hmtx);
+ h->hld_link = *prevpp;
+ *prevpp = h;
+ mutex_exit(hmtx);
+}
+
+/* Remove hldirent *h from the hash list. */
+static void
+hyprlofs_hash_out(hldirent_t *h)
+{
+ uint_t hash;
+ hldirent_t **prevpp;
+ kmutex_t *hmtx;
+
+ hash = h->hld_hash;
+ prevpp = &hl_hashtable[HL_HASH_INDEX(hash)];
+ hmtx = &hl_hashmutex[HL_MUTEX_INDEX(hash)];
+ mutex_enter(hmtx);
+ while (*prevpp != h)
+ prevpp = &(*prevpp)->hld_link;
+ *prevpp = h->hld_link;
+ mutex_exit(hmtx);
+}
+
+static hldirent_t *
+hyprlofs_hash_lookup(char *name, hlnode_t *parent, uint_t hold,
+ hlnode_t **found)
+{
+ hldirent_t *l;
+ uint_t hash;
+ kmutex_t *hmtx;
+ hlnode_t *hnp;
+
+ HYPRLOFS_HASH(parent, name, hash);
+ hmtx = &hl_hashmutex[HL_MUTEX_INDEX(hash)];
+ mutex_enter(hmtx);
+ l = hl_hashtable[HL_HASH_INDEX(hash)];
+ while (l) {
+ if (l->hld_hash == hash && l->hld_parent == parent &&
+ strcmp(l->hld_name, name) == 0) {
+ /*
+ * Ensure that the hlnode that we put a hold on is the
+ * same one that we pass back. Thus the temp. var
+ * hnp is necessary.
+ */
+ hnp = l->hld_hlnode;
+ if (hold) {
+ ASSERT(hnp);
+ hlnode_hold(hnp);
+ }
+ if (found)
+ *found = hnp;
+ mutex_exit(hmtx);
+ return (l);
+ } else {
+ l = l->hld_link;
+ }
+ }
+ mutex_exit(hmtx);
+ return (NULL);
+}
+
+/*
+ * Search directory 'parent' for entry 'name'.
+ *
+ * The calling thread can't hold the write version of the rwlock for the
+ * directory being searched
+ *
+ * On success *foundtp points to the found hlnode with its vnode held.
+ */
+int
+hyprlofs_dirlookup(hlnode_t *parent, char *name, hlnode_t **foundtp, cred_t *cr)
+{
+ int error;
+
+ *foundtp = NULL;
+ if (parent->hln_type != VDIR)
+ return (ENOTDIR);
+
+ if ((error = hyprlofs_taccess(parent, VEXEC, cr)))
+ return (error);
+
+ if (*name == '\0') {
+ hlnode_hold(parent);
+ *foundtp = parent;
+ return (0);
+ }
+
+ /*
+ * Search the directory for the matching name. We need the lock
+ * protecting the hln_dir list so that it doesn't change out from
+ * underneath us. hyprlofs_hash_lookup() will pass back the hlnode
+ * with a hold on it.
+ */
+ if (hyprlofs_hash_lookup(name, parent, 1, foundtp) != NULL) {
+ ASSERT(*foundtp);
+ return (0);
+ }
+
+ return (ENOENT);
+}
+
+/*
+ * Enter a directory entry (either a file or subdir, depending on op) for
+ * 'name' and 'hp' into directory 'dir'
+ */
+int
+hyprlofs_direnter(
+ hlfsmount_t *hm,
+ hlnode_t *dir, /* target directory to make entry in */
+ char *name, /* name of entry */
+ enum de_op op, /* entry operation */
+ vnode_t *realvp, /* real vnode */
+ vattr_t *va,
+ hlnode_t **hpp, /* return hlnode */
+ cred_t *cr)
+{
+ hldirent_t *hdp;
+ hlnode_t *found = NULL;
+ hlnode_t *hp;
+ int error = 0;
+ char *s;
+
+ /* hln_rwlock is held to serialize direnter and dirdeletes */
+ ASSERT(RW_WRITE_HELD(&dir->hln_rwlock));
+ ASSERT(dir->hln_type == VDIR);
+
+ /* Don't allow '/' characters in pathname component */
+ for (s = name; *s; s++)
+ if (*s == '/')
+ return (EACCES);
+
+ if (name[0] == '\0')
+ panic("hyprlofs_direnter: NULL name");
+
+ /*
+ * This might be a "dangling detached directory". It could have been
+ * removed, but a reference to it kept in u_cwd. Don't bother searching
+ * it, and with any luck the user will get tired of dealing with us and
+ * cd to some absolute pathway. This is in ufs, too.
+ */
+ if (dir->hln_nlink == 0) {
+ return (ENOENT);
+ }
+
+ /* Search for the entry. Return "found" if it exists. */
+ hdp = hyprlofs_hash_lookup(name, dir, 1, &found);
+
+ if (hdp) {
+ ASSERT(found);
+ switch (op) {
+ case DE_CREATE:
+ case DE_MKDIR:
+ if (hpp) {
+ *hpp = found;
+ error = EEXIST;
+ } else {
+ hlnode_rele(found);
+ }
+ break;
+ }
+ } else {
+
+ /*
+ * The entry does not exist. Check write perms in dir to see if
+ * entry can be created.
+ */
+ if ((error = hyprlofs_taccess(dir, VWRITE, cr)))
+ return (error);
+
+ /* Make new hlnode and directory entry as required. */
+ if ((error = hldir_make_hlnode(dir, hm, va, op, realvp, &hp,
+ cr)))
+ return (error);
+
+ if ((error = hldiraddentry(dir, hp, name))) {
+ /* Unmake the inode we just made. */
+ rw_enter(&hp->hln_rwlock, RW_WRITER);
+ if ((hp->hln_type) == VDIR) {
+ ASSERT(hdp == NULL);
+ /* cleanup allocs made by hyprlofs_dirinit() */
+ hyprlofs_dirtrunc(hp);
+ }
+ mutex_enter(&hp->hln_tlock);
+ hp->hln_nlink = 0;
+ mutex_exit(&hp->hln_tlock);
+ gethrestime(&hp->hln_ctime);
+ rw_exit(&hp->hln_rwlock);
+ hlnode_rele(hp);
+ hp = NULL;
+ } else if (hpp) {
+ *hpp = hp;
+ } else {
+ hlnode_rele(hp);
+ }
+ }
+
+ return (error);
+}
+
+/*
+ * Delete entry hp of name "nm" from dir. Free dir entry space and decrement
+ * link count on hlnode(s).
+ */
+int
+hyprlofs_dirdelete(hlnode_t *dir, hlnode_t *hp, char *nm, enum dr_op op,
+ cred_t *cr)
+{
+ hldirent_t *hpdp;
+ int error;
+ size_t namelen;
+ hlnode_t *hnp;
+ timestruc_t now;
+
+ ASSERT(RW_WRITE_HELD(&dir->hln_rwlock));
+ ASSERT(RW_WRITE_HELD(&hp->hln_rwlock));
+ ASSERT(dir->hln_type == VDIR);
+
+ if (nm[0] == '\0')
+ panic("hyprlofs_dirdelete: NULL name for %p", (void *)hp);
+
+ /* return error if removing . or .. */
+ if (nm[0] == '.') {
+ if (nm[1] == '\0')
+ return (EINVAL);
+ if (nm[1] == '.' && nm[2] == '\0')
+ return (EEXIST); /* thus in ufs */
+ }
+
+ if ((error = hyprlofs_taccess(dir, VEXEC|VWRITE, cr)) != 0)
+ return (error);
+
+ if (dir->hln_dir == NULL)
+ return (ENOENT);
+
+ hpdp = hyprlofs_hash_lookup(nm, dir, 0, &hnp);
+ if (hpdp == NULL) {
+ /*
+ * If it is gone, some other thread got here first!
+ * Return error ENOENT.
+ */
+ return (ENOENT);
+ }
+
+ /*
+ * If the hlnode in the hldirent changed (shouldn't happen since we
+ * don't support rename) then original is gone, so return that status
+ * (same as UFS).
+ */
+ if (hp != hnp)
+ return (ENOENT);
+
+ hyprlofs_hash_out(hpdp);
+
+ /* Take hpdp out of the directory list. */
+ ASSERT(hpdp->hld_next != hpdp);
+ ASSERT(hpdp->hld_prev != hpdp);
+ if (hpdp->hld_prev) {
+ hpdp->hld_prev->hld_next = hpdp->hld_next;
+ }
+ if (hpdp->hld_next) {
+ hpdp->hld_next->hld_prev = hpdp->hld_prev;
+ }
+
+ /*
+ * If the roving slot pointer happens to match hpdp, point it at the
+ * previous dirent.
+ */
+ if (dir->hln_dir->hld_prev == hpdp) {
+ dir->hln_dir->hld_prev = hpdp->hld_prev;
+ }
+ ASSERT(hpdp->hld_next != hpdp);
+ ASSERT(hpdp->hld_prev != hpdp);
+
+ /* hpdp points to the correct directory entry */
+ namelen = strlen(hpdp->hld_name) + 1;
+
+ kmem_free(hpdp, sizeof (hldirent_t) + namelen);
+ dir->hln_size -= (sizeof (hldirent_t) + namelen);
+ dir->hln_dirents--;
+
+ gethrestime(&now);
+ dir->hln_mtime = now;
+ dir->hln_ctime = now;
+ hp->hln_ctime = now;
+
+ ASSERT(hp->hln_nlink > 0);
+ DECR_COUNT(&hp->hln_nlink, &hp->hln_tlock);
+ if (op == DR_RMDIR && hp->hln_type == VDIR) {
+ hyprlofs_dirtrunc(hp);
+ ASSERT(hp->hln_nlink == 0);
+ }
+ return (0);
+}
+
+/*
+ * hyprlofs_dirinit initializes a dir with '.' and '..' entries without
+ * checking perms and locking
+ */
+void
+hyprlofs_dirinit(
+ hlnode_t *parent, /* parent of directory to initialize */
+ hlnode_t *dir) /* the new directory */
+{
+ hldirent_t *dot, *dotdot;
+ timestruc_t now;
+
+ ASSERT(RW_WRITE_HELD(&parent->hln_rwlock));
+ ASSERT(dir->hln_type == VDIR);
+
+ dot = kmem_zalloc(sizeof (hldirent_t) + 2, KM_SLEEP);
+ dotdot = kmem_zalloc(sizeof (hldirent_t) + 3, KM_SLEEP);
+
+ /* Initialize the entries */
+ dot->hld_hlnode = dir;
+ dot->hld_offset = 0;
+ dot->hld_name = (char *)dot + sizeof (hldirent_t);
+ dot->hld_name[0] = '.';
+ dot->hld_parent = dir;
+ hyprlofs_hash_in(dot);
+
+ dotdot->hld_hlnode = parent;
+ dotdot->hld_offset = 1;
+ dotdot->hld_name = (char *)dotdot + sizeof (hldirent_t);
+ dotdot->hld_name[0] = '.';
+ dotdot->hld_name[1] = '.';
+ dotdot->hld_parent = dir;
+ hyprlofs_hash_in(dotdot);
+
+ /* Initialize directory entry list. */
+ dot->hld_next = dotdot;
+ dot->hld_prev = dotdot;
+ dotdot->hld_next = NULL;
+ dotdot->hld_prev = dot;
+
+ gethrestime(&now);
+ dir->hln_mtime = now;
+ dir->hln_ctime = now;
+
+ /*
+ * Since hyprlofs_dirinit is called with both dir and parent being the
+ * same for the root vnode, we need to increment this before we set
+ * hln_nlink = 2 below.
+ */
+ INCR_COUNT(&parent->hln_nlink, &parent->hln_tlock);
+ parent->hln_ctime = now;
+
+ dir->hln_dir = dot;
+ dir->hln_size = 2 * sizeof (hldirent_t) + 5; /* dot and dotdot */
+ dir->hln_dirents = 2;
+ dir->hln_nlink = 2;
+}
+
+
+/*
+ * hyprlofs_dirtrunc removes all dir entries under this dir.
+ */
+void
+hyprlofs_dirtrunc(hlnode_t *dir)
+{
+ hldirent_t *hdp;
+ hlnode_t *tp;
+ size_t namelen;
+ timestruc_t now;
+
+ ASSERT(RW_WRITE_HELD(&dir->hln_rwlock));
+ ASSERT(dir->hln_type == VDIR);
+
+ if (dir->hln_looped)
+ return;
+
+ for (hdp = dir->hln_dir; hdp; hdp = dir->hln_dir) {
+ ASSERT(hdp->hld_next != hdp);
+ ASSERT(hdp->hld_prev != hdp);
+ ASSERT(hdp->hld_hlnode);
+
+ dir->hln_dir = hdp->hld_next;
+ namelen = strlen(hdp->hld_name) + 1;
+
+ /*
+ * Adjust the link counts to account for this dir entry removal.
+ */
+ tp = hdp->hld_hlnode;
+
+ ASSERT(tp->hln_nlink > 0);
+ DECR_COUNT(&tp->hln_nlink, &tp->hln_tlock);
+
+ hyprlofs_hash_out(hdp);
+
+ kmem_free(hdp, sizeof (hldirent_t) + namelen);
+ dir->hln_size -= (sizeof (hldirent_t) + namelen);
+ dir->hln_dirents--;
+ }
+
+ gethrestime(&now);
+ dir->hln_mtime = now;
+ dir->hln_ctime = now;
+
+ ASSERT(dir->hln_dir == NULL);
+ ASSERT(dir->hln_size == 0);
+ ASSERT(dir->hln_dirents == 0);
+}
+
+static int
+hldiraddentry(
+ hlnode_t *dir, /* target directory to make entry in */
+ hlnode_t *hp, /* new hlnode */
+ char *name)
+{
+ hldirent_t *hdp, *hpdp;
+ size_t namelen, alloc_size;
+ timestruc_t now;
+
+ /*
+ * Make sure the parent dir wasn't removed from underneath the caller.
+ */
+ if (dir->hln_dir == NULL)
+ return (ENOENT);
+
+ /* Check that everything is on the same FS. */
+ if (hp->hln_vnode->v_vfsp != dir->hln_vnode->v_vfsp)
+ return (EXDEV);
+
+ /* Alloc and init dir entry */
+ namelen = strlen(name) + 1;
+ alloc_size = namelen + sizeof (hldirent_t);
+ hdp = kmem_zalloc(alloc_size, KM_NORMALPRI | KM_NOSLEEP);
+ if (hdp == NULL)
+ return (ENOSPC);
+
+ dir->hln_size += alloc_size;
+ dir->hln_dirents++;
+ hdp->hld_hlnode = hp;
+ hdp->hld_parent = dir;
+
+ /* The dir entry and its name were allocated sequentially. */
+ hdp->hld_name = (char *)hdp + sizeof (hldirent_t);
+ (void) strcpy(hdp->hld_name, name);
+
+ hyprlofs_hash_in(hdp);
+
+ /*
+ * Some utilities expect the size of a directory to remain fairly
+ * static. For example, a routine which unlinks files between calls to
+ * readdir(); the size of the dir changes from underneath it and so the
+ * real dir offset in bytes is invalid. To circumvent this problem, we
+ * initialize a dir entry with a phony offset, and use this offset to
+ * determine end of file in hyprlofs_readdir.
+ */
+ hpdp = dir->hln_dir->hld_prev;
+ /*
+ * Install at first empty "slot" in directory list.
+ */
+ while (hpdp->hld_next != NULL && (hpdp->hld_next->hld_offset -
+ hpdp->hld_offset) <= 1) {
+ ASSERT(hpdp->hld_next != hpdp);
+ ASSERT(hpdp->hld_prev != hpdp);
+ ASSERT(hpdp->hld_next->hld_offset > hpdp->hld_offset);
+ hpdp = hpdp->hld_next;
+ }
+ hdp->hld_offset = hpdp->hld_offset + 1;
+
+ /*
+ * If we're at the end of the dirent list and the offset (which is
+ * necessarily the largest offset in this dir) is more than twice the
+ * number of dirents, that means the dir is 50% holes. At this point
+ * we reset the slot pointer back to the beginning of the dir so we
+ * start using the holes. The idea is that if there are N dirents,
+ * there must also be N holes, so we can satisfy the next N creates by
+ * walking at most 2N entries; thus the average cost of a create is
+ * constant. Note that we use the first dirent's hld_prev as the roving
+ * slot pointer. This saves a word in every dirent.
+ */
+ if (hpdp->hld_next == NULL && hpdp->hld_offset > 2 * dir->hln_dirents)
+ dir->hln_dir->hld_prev = dir->hln_dir->hld_next;
+ else
+ dir->hln_dir->hld_prev = hdp;
+
+ ASSERT(hpdp->hld_next != hpdp);
+ ASSERT(hpdp->hld_prev != hpdp);
+
+ hdp->hld_next = hpdp->hld_next;
+ if (hdp->hld_next) {
+ hdp->hld_next->hld_prev = hdp;
+ }
+ hdp->hld_prev = hpdp;
+ hpdp->hld_next = hdp;
+
+ ASSERT(hdp->hld_next != hdp);
+ ASSERT(hdp->hld_prev != hdp);
+ ASSERT(hpdp->hld_next != hpdp);
+ ASSERT(hpdp->hld_prev != hpdp);
+
+ gethrestime(&now);
+ dir->hln_mtime = now;
+ dir->hln_ctime = now;
+
+ return (0);
+}
+
+static int
+hldir_make_hlnode(hlnode_t *dir, hlfsmount_t *hm, vattr_t *va, enum de_op op,
+ vnode_t *realvp, hlnode_t **newnode, cred_t *cr)
+{
+ hlnode_t *hp;
+ enum vtype type;
+
+ ASSERT(va != NULL);
+ ASSERT(op == DE_CREATE || op == DE_MKDIR);
+ if (((va->va_mask & AT_ATIME) && TIMESPEC_OVERFLOW(&va->va_atime)) ||
+ ((va->va_mask & AT_MTIME) && TIMESPEC_OVERFLOW(&va->va_mtime)))
+ return (EOVERFLOW);
+ type = va->va_type;
+ hp = kmem_zalloc(sizeof (hlnode_t), KM_SLEEP);
+ hyprlofs_node_init(hm, hp, va, cr);
+
+ hp->hln_vnode->v_rdev = hp->hln_rdev = NODEV;
+ hp->hln_vnode->v_type = type;
+ hp->hln_uid = crgetuid(cr);
+
+ /*
+ * To determine the gid of the created file:
+ * If the directory's set-gid bit is set, set the gid to the gid
+ * of the parent dir, otherwise, use the process's gid.
+ */
+ if (dir->hln_mode & VSGID)
+ hp->hln_gid = dir->hln_gid;
+ else
+ hp->hln_gid = crgetgid(cr);
+
+ /*
+ * If we're creating a dir and the parent dir has the set-GID bit set,
+ * set it on the new dir. Otherwise, if the user is neither privileged
+ * nor a member of the file's new group, clear the file's set-GID bit.
+ */
+ if (dir->hln_mode & VSGID && type == VDIR)
+ hp->hln_mode |= VSGID;
+ else {
+ if ((hp->hln_mode & VSGID) &&
+ secpolicy_vnode_setids_setgids(cr, hp->hln_gid) != 0)
+ hp->hln_mode &= ~VSGID;
+ }
+
+ if (va->va_mask & AT_ATIME)
+ hp->hln_atime = va->va_atime;
+ if (va->va_mask & AT_MTIME)
+ hp->hln_mtime = va->va_mtime;
+
+ if (op == DE_MKDIR) {
+ hyprlofs_dirinit(dir, hp);
+ hp->hln_looped = 0;
+ } else {
+ hp->hln_realvp = realvp;
+ hp->hln_size = va->va_size;
+ hp->hln_looped = 1;
+ }
+
+ *newnode = hp;
+ return (0);
+}
diff --git a/usr/src/uts/common/fs/hyprlofs/hyprlofs_subr.c b/usr/src/uts/common/fs/hyprlofs/hyprlofs_subr.c
new file mode 100644
index 0000000000..1d857309f3
--- /dev/null
+++ b/usr/src/uts/common/fs/hyprlofs/hyprlofs_subr.c
@@ -0,0 +1,127 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <sys/errno.h>
+#include <sys/param.h>
+#include <sys/t_lock.h>
+#include <sys/systm.h>
+#include <sys/sysmacros.h>
+#include <sys/debug.h>
+#include <sys/time.h>
+#include <sys/cmn_err.h>
+#include <sys/vnode.h>
+#include <sys/stat.h>
+#include <sys/mode.h>
+#include <sys/vfs.h>
+#include <sys/cred.h>
+#include <sys/kmem.h>
+#include <sys/atomic.h>
+#include <sys/policy.h>
+#include <sys/fs/hyprlofs_info.h>
+
+#define MODESHIFT 3
+
+/* Initialize a hlnode and add it to file list under mount point. */
+void
+hyprlofs_node_init(hlfsmount_t *hm, hlnode_t *h, vattr_t *vap, cred_t *cr)
+{
+ vnode_t *vp;
+ timestruc_t now;
+
+ ASSERT(vap != NULL);
+
+ rw_init(&h->hln_rwlock, NULL, RW_DEFAULT, NULL);
+ mutex_init(&h->hln_tlock, NULL, MUTEX_DEFAULT, NULL);
+ h->hln_mode = MAKEIMODE(vap->va_type, vap->va_mode);
+ h->hln_mask = 0;
+ h->hln_type = vap->va_type;
+ h->hln_nodeid = (ino64_t)(uint32_t)((uintptr_t)h >> 3);
+ h->hln_nlink = 1;
+ h->hln_size = 0;
+
+ if (cr == NULL) {
+ h->hln_uid = vap->va_uid;
+ h->hln_gid = vap->va_gid;
+ } else {
+ h->hln_uid = crgetuid(cr);
+ h->hln_gid = crgetgid(cr);
+ }
+
+ h->hln_fsid = hm->hlm_dev;
+ h->hln_rdev = vap->va_rdev;
+ h->hln_blksize = PAGESIZE;
+ h->hln_nblocks = 0;
+ gethrestime(&now);
+ h->hln_atime = now;
+ h->hln_mtime = now;
+ h->hln_ctime = now;
+ h->hln_seq = 0;
+ h->hln_dir = NULL;
+
+ h->hln_vnode = vn_alloc(KM_SLEEP);
+ vp = HLNTOV(h);
+ vn_setops(vp, hyprlofs_vnodeops);
+ vp->v_vfsp = hm->hlm_vfsp;
+ vp->v_type = vap->va_type;
+ vp->v_rdev = vap->va_rdev;
+ vp->v_data = (caddr_t)h;
+ mutex_enter(&hm->hlm_contents);
+ /*
+ * Increment the pseudo generation number for this hlnode. Since
+ * hlnodes are allocated and freed, there really is no particular
+ * generation number for a new hlnode. Just fake it by using a
+ * counter in each file system.
+ */
+ h->hln_gen = hm->hlm_gen++;
+
+ /*
+ * Add new hlnode to end of linked list of hlnodes for this hyprlofs
+ * Root dir is handled specially in hyprlofs_mount.
+ */
+ if (hm->hlm_rootnode != (hlnode_t *)NULL) {
+ h->hln_forw = NULL;
+ h->hln_back = hm->hlm_rootnode->hln_back;
+ h->hln_back->hln_forw = hm->hlm_rootnode->hln_back = h;
+ }
+ mutex_exit(&hm->hlm_contents);
+ vn_exists(vp);
+}
+
+int
+hyprlofs_taccess(void *vtp, int mode, cred_t *cr)
+{
+ hlnode_t *hp = vtp;
+ int shift = 0;
+
+ /* Check access based on owner, group and public perms in hlnode. */
+ if (crgetuid(cr) != hp->hln_uid) {
+ shift += MODESHIFT;
+ if (groupmember(hp->hln_gid, cr) == 0)
+ shift += MODESHIFT;
+ }
+
+ return (secpolicy_vnode_access2(cr, HLNTOV(hp), hp->hln_uid,
+ hp->hln_mode << shift, mode));
+}
diff --git a/usr/src/uts/common/fs/hyprlofs/hyprlofs_vfsops.c b/usr/src/uts/common/fs/hyprlofs/hyprlofs_vfsops.c
new file mode 100644
index 0000000000..c582a8cac2
--- /dev/null
+++ b/usr/src/uts/common/fs/hyprlofs/hyprlofs_vfsops.c
@@ -0,0 +1,614 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * Hyperlofs is a hybrid file system combining features of the tmpfs(7FS) and
+ * lofs(7FS) file systems. It is modeled on code from both of these file
+ * systems.
+ *
+ * The purpose is to create a high performance name space for files on which
+ * applications will compute. Given a large number of data files with various
+ * owners, we want to construct a view onto those files such that only a subset
+ * is visible to the applications and such that the view can be changed very
+ * quickly as compute progresses. Entries in the name space are not mounts and
+ * thus do not appear in the mnttab. Entries in the name space are allowed to
+ * refer to files on different backing file systems. Intermediate directories
+ * in the name space exist only in-memory, ala tmpfs. There are no leaf nodes
+ * in the name space except for entries that refer to backing files ala lofs.
+ *
+ * The name space is managed via ioctls issued on the mounted file system and
+ * is mostly read-only for the compute applications. That is, applications
+ * cannot create new files in the name space. If a file is unlinked by an
+ * application, that only removes the file from the name space, the backing
+ * file remains in place. It is possible for applications to write-through to
+ * the backing files if the file system is mounted read-write.
+ *
+ * The name space is managed via the HYPRLOFS_ADD_ENTRIES, HYPRLOFS_RM_ENTRIES,
+ * and HYPRLOFS_RM_ALL ioctls on the top-level mount.
+ *
+ * The HYPRLOFS_ADD_ENTRIES ioctl specifies path(s) to the backing file(s) and
+ * the name(s) for the file(s) in the name space. The name(s) may be path(s)
+ * which will be relative to the root of the mount and thus cannot begin with
+ * a /. If the name is a path, it does not have to correspond to any backing
+ * path. The intermediate directories will only exist in the name space. The
+ * entry(ies) will be added to the name space.
+ *
+ * The HYPRLOFS_RM_ENTRIES ioctl specifies the name(s) of the file(s) in the
+ * name space which should be removed. The name(s) may be path(s) which will
+ * be relative to the root of the mount and thus cannot begin with a /. The
+ * named entry(ies) will be removed.
+ *
+ * The HYPRLOFS_RM_ALL ioctl will remove all mappings from the name space.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/sysmacros.h>
+#include <sys/kmem.h>
+#include <sys/time.h>
+#include <sys/pathname.h>
+#include <sys/vfs.h>
+#include <sys/vfs_opreg.h>
+#include <sys/vnode.h>
+#include <sys/stat.h>
+#include <sys/uio.h>
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include <sys/cmn_err.h>
+#include <sys/cred.h>
+#include <sys/statvfs.h>
+#include <sys/mount.h>
+#include <sys/debug.h>
+#include <sys/systm.h>
+#include <sys/mntent.h>
+#include <fs/fs_subr.h>
+#include <vm/page.h>
+#include <vm/anon.h>
+#include <sys/model.h>
+#include <sys/policy.h>
+
+#include <sys/fs/swapnode.h>
+#include <sys/fs/hyprlofs_info.h>
+
+static int hyprlofsfstype;
+
+/*
+ * hyprlofs vfs operations.
+ */
+static int hyprlofsinit(int, char *);
+static int hyprlofs_mount(vfs_t *, vnode_t *, struct mounta *, cred_t *);
+static int hyprlofs_unmount(vfs_t *, int, cred_t *);
+static int hyprlofs_root(vfs_t *, vnode_t **);
+static int hyprlofs_statvfs(vfs_t *, struct statvfs64 *);
+static int hyprlofs_vget(vfs_t *, vnode_t **, struct fid *);
+
+/*
+ * Loadable module wrapper
+ */
+#include <sys/modctl.h>
+
+static mntopts_t hyprlofs_mntopts;
+
+static vfsdef_t vfw = {
+ VFSDEF_VERSION,
+ "hyprlofs",
+ hyprlofsinit,
+ VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_ZMOUNT,
+ &hyprlofs_mntopts
+};
+
+static mntopts_t hyprlofs_mntopts = {
+ 0, NULL
+};
+
+/*
+ * Module linkage information
+ */
+static struct modlfs modlfs = {
+ &mod_fsops, "filesystem for hyprlofs", &vfw
+};
+
+static struct modlinkage modlinkage = {
+ MODREV_1, &modlfs, NULL
+};
+
+int
+_init()
+{
+ return (mod_install(&modlinkage));
+}
+
+int
+_fini()
+{
+ int error;
+
+ error = mod_remove(&modlinkage);
+ if (error)
+ return (error);
+ /*
+ * Tear down the operations vectors
+ */
+ (void) vfs_freevfsops_by_type(hyprlofsfstype);
+ vn_freevnodeops(hyprlofs_vnodeops);
+ return (0);
+}
+
+int
+_info(struct modinfo *modinfop)
+{
+ return (mod_info(&modlinkage, modinfop));
+}
+
+/*
+ * The following are patchable variables limiting the amount of system
+ * resources hyprlofs can use.
+ *
+ * hyprlofs_maxkmem limits the amount of kernel kmem_alloc memory hyprlofs can
+ * use for it's data structures (e.g. hlnodes, directory entries). It is set
+ * as a percentage of physical memory which is determined when hyprlofs is
+ * first used in the system.
+ *
+ * hyprlofs_minfree is the minimum amount of swap space that hyprlofs leaves for
+ * the rest of the system. If the amount of free swap space in the system
+ * (i.e. anoninfo.ani_free) drops below hyprlofs_minfree, hyprlofs anon
+ * allocations will fail.
+ */
+size_t hyprlofs_maxkmem = 0;
+size_t hyprlofs_minfree = 0;
+size_t hyprlofs_kmemspace; /* bytes of kernel heap used by all hyprlofs */
+
+static major_t hyprlofs_major;
+static minor_t hyprlofs_minor;
+static kmutex_t hyprlofs_minor_lock;
+
+/*
+ * initialize global hyprlofs locks and hashes when loading hyprlofs module
+ */
+static int
+hyprlofsinit(int fstype, char *name)
+{
+ static const fs_operation_def_t hl_vfsops_template[] = {
+ VFSNAME_MOUNT, { .vfs_mount = hyprlofs_mount },
+ VFSNAME_UNMOUNT, { .vfs_unmount = hyprlofs_unmount },
+ VFSNAME_ROOT, { .vfs_root = hyprlofs_root },
+ VFSNAME_STATVFS, { .vfs_statvfs = hyprlofs_statvfs },
+ VFSNAME_VGET, { .vfs_vget = hyprlofs_vget },
+ NULL, NULL
+ };
+ int error;
+ extern void hyprlofs_hash_init();
+
+ hyprlofs_hash_init();
+ hyprlofsfstype = fstype;
+ ASSERT(hyprlofsfstype != 0);
+
+ error = vfs_setfsops(fstype, hl_vfsops_template, NULL);
+ if (error != 0) {
+ cmn_err(CE_WARN, "hyprlofsinit: bad vfs ops template");
+ return (error);
+ }
+
+ error = vn_make_ops(name, hyprlofs_vnodeops_template,
+ &hyprlofs_vnodeops);
+ if (error != 0) {
+ (void) vfs_freevfsops_by_type(fstype);
+ cmn_err(CE_WARN, "hyprlofsinit: bad vnode ops template");
+ return (error);
+ }
+
+ /*
+ * hyprlofs_minfree is an absolute limit of swap space which still
+ * allows other processes to execute. Set it if its not patched.
+ */
+ if (hyprlofs_minfree == 0)
+ hyprlofs_minfree = btopr(HYPRLOFSMINFREE);
+
+ if ((hyprlofs_major = getudev()) == (major_t)-1) {
+ cmn_err(CE_WARN,
+ "hyprlofsinit: Can't get unique device number.");
+ hyprlofs_major = 0;
+ }
+ mutex_init(&hyprlofs_minor_lock, NULL, MUTEX_DEFAULT, NULL);
+ return (0);
+}
+
+static int
+hyprlofs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
+{
+ hlfsmount_t *hm = NULL;
+ hlnode_t *hp;
+ struct pathname dpn;
+ int error;
+ vattr_t rattr;
+ int got_attrs;
+
+ if ((error = secpolicy_fs_mount(cr, mvp, vfsp)) != 0)
+ return (error);
+ if (secpolicy_hyprlofs_control(cr) != 0)
+ return (EPERM);
+
+ if (mvp->v_type != VDIR)
+ return (ENOTDIR);
+
+ if (uap->flags & MS_REMOUNT)
+ return (EBUSY);
+
+ mutex_enter(&mvp->v_lock);
+ if ((uap->flags & MS_OVERLAY) == 0 &&
+ (mvp->v_count != 1 || (mvp->v_flag & VROOT))) {
+ mutex_exit(&mvp->v_lock);
+ return (EBUSY);
+ }
+ mutex_exit(&mvp->v_lock);
+
+ /* Having the resource be anything but "swap" doesn't make sense. */
+ vfs_setresource(vfsp, "swap", 0);
+
+ if ((error = pn_get(uap->dir,
+ (uap->flags & MS_SYSSPACE) ? UIO_SYSSPACE : UIO_USERSPACE,
+ &dpn)) != 0)
+ goto out;
+
+ if ((hm = kmem_zalloc(sizeof (hlfsmount_t),
+ KM_NORMALPRI | KM_NOSLEEP)) == NULL) {
+ pn_free(&dpn);
+ error = ENOMEM;
+ goto out;
+ }
+
+ /* Get an available minor device number for this mount */
+ mutex_enter(&hyprlofs_minor_lock);
+ do {
+ hyprlofs_minor = (hyprlofs_minor + 1) & L_MAXMIN32;
+ hm->hlm_dev = makedevice(hyprlofs_major, hyprlofs_minor);
+ } while (vfs_devismounted(hm->hlm_dev));
+ mutex_exit(&hyprlofs_minor_lock);
+
+ /*
+ * Set but don't bother entering the mutex since hlfsmount is not on
+ * the mount list yet.
+ */
+ mutex_init(&hm->hlm_contents, NULL, MUTEX_DEFAULT, NULL);
+
+ hm->hlm_vfsp = vfsp;
+
+ vfsp->vfs_data = (caddr_t)hm;
+ vfsp->vfs_fstype = hyprlofsfstype;
+ vfsp->vfs_dev = hm->hlm_dev;
+ vfsp->vfs_bsize = PAGESIZE;
+ vfsp->vfs_flag |= VFS_NOTRUNC;
+ vfs_make_fsid(&vfsp->vfs_fsid, hm->hlm_dev, hyprlofsfstype);
+ hm->hlm_mntpath = kmem_zalloc(dpn.pn_pathlen + 1, KM_SLEEP);
+ (void) strcpy(hm->hlm_mntpath, dpn.pn_path);
+
+ /* allocate and initialize root hlnode structure */
+ bzero(&rattr, sizeof (vattr_t));
+ rattr.va_mode = (mode_t)(S_IFDIR | 0777);
+ rattr.va_type = VDIR;
+ rattr.va_rdev = 0;
+ hp = kmem_zalloc(sizeof (hlnode_t), KM_SLEEP);
+ hyprlofs_node_init(hm, hp, &rattr, cr);
+
+ /* Get the mode, uid, and gid from the underlying mount point. */
+ rattr.va_mask = AT_MODE|AT_UID|AT_GID;
+ got_attrs = VOP_GETATTR(mvp, &rattr, 0, cr, NULL);
+
+ rw_enter(&hp->hln_rwlock, RW_WRITER);
+ HLNTOV(hp)->v_flag |= VROOT;
+
+ /*
+ * If the getattr succeeded, use its results, otherwise allow the
+ * previously set defaults to prevail.
+ */
+ if (got_attrs == 0) {
+ hp->hln_mode = rattr.va_mode;
+ hp->hln_uid = rattr.va_uid;
+ hp->hln_gid = rattr.va_gid;
+ }
+
+ /*
+ * Initialize linked list of hlnodes so that the back pointer of the
+ * root hlnode always points to the last one on the list and the
+ * forward pointer of the last node is null
+ */
+ hp->hln_back = hp;
+ hp->hln_forw = NULL;
+ hp->hln_nlink = 0;
+ hm->hlm_rootnode = hp;
+
+ hyprlofs_dirinit(hp, hp);
+
+ rw_exit(&hp->hln_rwlock);
+
+ pn_free(&dpn);
+ error = 0;
+
+out:
+ return (error);
+}
+
+static int
+hyprlofs_unmount(vfs_t *vfsp, int flag, cred_t *cr)
+{
+ hlfsmount_t *hm = (hlfsmount_t *)VFSTOHLM(vfsp);
+ hlnode_t *hnp, *cancel;
+ vnode_t *vp;
+ int error;
+
+ if ((error = secpolicy_fs_unmount(cr, vfsp)) != 0)
+ return (error);
+ if (secpolicy_hyprlofs_control(cr) != 0)
+ return (EPERM);
+
+ /*
+ * forced unmount is not supported by this file system
+ * and thus, ENOTSUP, is being returned.
+ */
+ if (flag & MS_FORCE)
+ return (ENOTSUP);
+
+ mutex_enter(&hm->hlm_contents);
+
+ /*
+ * If there are no open files, only the root node should have a ref cnt.
+ * With hlm_contents held, nothing can be added or removed. There may
+ * be some dirty pages. To prevent fsflush from disrupting the unmount,
+ * put a hold on each node while scanning. If we find a previously
+ * referenced node, undo the holds we have placed and fail EBUSY.
+ */
+ hnp = hm->hlm_rootnode;
+ if (HLNTOV(hnp)->v_count > 1) {
+ mutex_exit(&hm->hlm_contents);
+ return (EBUSY);
+ }
+
+ for (hnp = hnp->hln_forw; hnp; hnp = hnp->hln_forw) {
+ if ((vp = HLNTOV(hnp))->v_count > 0) {
+ cancel = hm->hlm_rootnode->hln_forw;
+ while (cancel != hnp) {
+ vp = HLNTOV(cancel);
+ ASSERT(vp->v_count > 0);
+ VN_RELE(vp);
+ cancel = cancel->hln_forw;
+ }
+ mutex_exit(&hm->hlm_contents);
+ return (EBUSY);
+ }
+ VN_HOLD(vp);
+ }
+
+ /* We can drop the mutex now because no one can find this mount */
+ mutex_exit(&hm->hlm_contents);
+
+ /*
+ * Free all alloc'd memory associated with this FS. To do this, we go
+ * through the file list twice, once to remove all the dir entries, and
+ * then to remove all the files.
+ */
+
+ /* Remove all directory entries */
+ for (hnp = hm->hlm_rootnode; hnp; hnp = hnp->hln_forw) {
+ rw_enter(&hnp->hln_rwlock, RW_WRITER);
+ if (hnp->hln_type == VDIR)
+ hyprlofs_dirtrunc(hnp);
+ rw_exit(&hnp->hln_rwlock);
+ }
+
+ ASSERT(hm->hlm_rootnode);
+
+ /*
+ * All links are gone, v_count is keeping nodes in place. VN_RELE
+ * should make the node disappear, unless somebody is holding pages
+ * against it. Wait and retry until it disappears.
+ *
+ * We re-acquire the lock to prevent others who have a HOLD on a hlnode
+ * from blowing it away (in hyprlofs_inactive) while we're trying to
+ * get to it here. Once we have a HOLD on it we know it'll stick around.
+ */
+ mutex_enter(&hm->hlm_contents);
+
+ /* Remove all the files (except the rootnode) backwards. */
+ while ((hnp = hm->hlm_rootnode->hln_back) != hm->hlm_rootnode) {
+ mutex_exit(&hm->hlm_contents);
+ /* Note we handled the link count in pass 2 above. */
+ vp = HLNTOV(hnp);
+ VN_RELE(vp);
+ mutex_enter(&hm->hlm_contents);
+ /*
+ * It's still there after the RELE. Someone else like pageout
+ * has a hold on it so wait a bit and then try again.
+ */
+ if (hnp == hm->hlm_rootnode->hln_back) {
+ VN_HOLD(vp);
+ mutex_exit(&hm->hlm_contents);
+ delay(hz / 4);
+ mutex_enter(&hm->hlm_contents);
+ }
+ }
+ mutex_exit(&hm->hlm_contents);
+
+ VN_RELE(HLNTOV(hm->hlm_rootnode));
+
+ ASSERT(hm->hlm_mntpath);
+
+ kmem_free(hm->hlm_mntpath, strlen(hm->hlm_mntpath) + 1);
+
+ mutex_destroy(&hm->hlm_contents);
+ kmem_free(hm, sizeof (hlfsmount_t));
+
+ return (0);
+}
+
+/* Return root hlnode for given vnode */
+static int
+hyprlofs_root(vfs_t *vfsp, vnode_t **vpp)
+{
+ hlfsmount_t *hm = (hlfsmount_t *)VFSTOHLM(vfsp);
+ hlnode_t *hp = hm->hlm_rootnode;
+ vnode_t *vp;
+
+ ASSERT(hp);
+
+ vp = HLNTOV(hp);
+ VN_HOLD(vp);
+ *vpp = vp;
+ return (0);
+}
+
+static int
+hyprlofs_statvfs(vfs_t *vfsp, struct statvfs64 *sbp)
+{
+ hlfsmount_t *hm = (hlfsmount_t *)VFSTOHLM(vfsp);
+ ulong_t blocks;
+ dev32_t d32;
+ zoneid_t eff_zid;
+ struct zone *zp;
+
+ /*
+ * The FS may have been mounted by the GZ on behalf of the NGZ. In
+ * that case, the hlfsmount zone_id will be the global zone. We want
+ * to show the swap cap inside the zone in this case, even though the
+ * FS was mounted by the GZ.
+ */
+ if (curproc->p_zone->zone_id != GLOBAL_ZONEUNIQID)
+ zp = curproc->p_zone;
+ else
+ zp = hm->hlm_vfsp->vfs_zone;
+
+ if (zp == NULL)
+ eff_zid = GLOBAL_ZONEUNIQID;
+ else
+ eff_zid = zp->zone_id;
+
+ sbp->f_bsize = PAGESIZE;
+ sbp->f_frsize = PAGESIZE;
+
+ /*
+ * Find the amount of available physical and memory swap
+ */
+ mutex_enter(&anoninfo_lock);
+ ASSERT(k_anoninfo.ani_max >= k_anoninfo.ani_phys_resv);
+ blocks = (ulong_t)CURRENT_TOTAL_AVAILABLE_SWAP;
+ mutex_exit(&anoninfo_lock);
+
+ if (blocks > hyprlofs_minfree)
+ sbp->f_bfree = blocks - hyprlofs_minfree;
+ else
+ sbp->f_bfree = 0;
+
+ sbp->f_bavail = sbp->f_bfree;
+
+ /*
+ * Total number of blocks is what's available plus what's been used
+ */
+ sbp->f_blocks = (fsblkcnt64_t)(sbp->f_bfree);
+
+ if (eff_zid != GLOBAL_ZONEUNIQID &&
+ zp->zone_max_swap_ctl != UINT64_MAX) {
+ /*
+ * If the fs is used by a NGZ with a swap cap, then report the
+ * capped size.
+ */
+ rctl_qty_t cap, used;
+ pgcnt_t pgcap, pgused;
+
+ mutex_enter(&zp->zone_mem_lock);
+ cap = zp->zone_max_swap_ctl;
+ used = zp->zone_max_swap;
+ mutex_exit(&zp->zone_mem_lock);
+
+ pgcap = btop(cap);
+ pgused = btop(used);
+
+ sbp->f_bfree = MIN(pgcap - pgused, sbp->f_bfree);
+ sbp->f_bavail = sbp->f_bfree;
+ sbp->f_blocks = MIN(pgcap, sbp->f_blocks);
+ }
+
+ /*
+ * This is fairly inaccurate since it doesn't take into account the
+ * names stored in the directory entries.
+ */
+ sbp->f_ffree = sbp->f_files = ptob(availrmem) /
+ (sizeof (hlnode_t) + sizeof (hldirent_t));
+
+ sbp->f_favail = (fsfilcnt64_t)(sbp->f_ffree);
+ (void) cmpldev(&d32, vfsp->vfs_dev);
+ sbp->f_fsid = d32;
+ (void) strcpy(sbp->f_basetype, vfssw[hyprlofsfstype].vsw_name);
+ (void) strncpy(sbp->f_fstr, hm->hlm_mntpath, sizeof (sbp->f_fstr));
+ /*
+ * ensure null termination
+ */
+ sbp->f_fstr[sizeof (sbp->f_fstr) - 1] = '\0';
+ sbp->f_flag = vf_to_stf(vfsp->vfs_flag);
+ sbp->f_namemax = MAXNAMELEN - 1;
+ return (0);
+}
+
+static int
+hyprlofs_vget(vfs_t *vfsp, vnode_t **vpp, struct fid *fidp)
+{
+ hlfid_t *hfid;
+ hlfsmount_t *hm = (hlfsmount_t *)VFSTOHLM(vfsp);
+ hlnode_t *hp = NULL;
+
+ hfid = (hlfid_t *)fidp;
+ *vpp = NULL;
+
+ mutex_enter(&hm->hlm_contents);
+ for (hp = hm->hlm_rootnode; hp; hp = hp->hln_forw) {
+ mutex_enter(&hp->hln_tlock);
+ if (hp->hln_nodeid == hfid->hlfid_ino) {
+ /*
+ * If the gen numbers don't match we know the file
+ * won't be found since only one hlnode can have this
+ * number at a time.
+ */
+ if (hp->hln_gen != hfid->hlfid_gen ||
+ hp->hln_nlink == 0) {
+ mutex_exit(&hp->hln_tlock);
+ mutex_exit(&hm->hlm_contents);
+ return (0);
+ }
+ *vpp = (vnode_t *)HLNTOV(hp);
+
+ VN_HOLD(*vpp);
+
+ if ((hp->hln_mode & S_ISVTX) &&
+ !(hp->hln_mode & (S_IXUSR | S_IFDIR))) {
+ mutex_enter(&(*vpp)->v_lock);
+ (*vpp)->v_flag |= VISSWAP;
+ mutex_exit(&(*vpp)->v_lock);
+ }
+ mutex_exit(&hp->hln_tlock);
+ mutex_exit(&hm->hlm_contents);
+ return (0);
+ }
+ mutex_exit(&hp->hln_tlock);
+ }
+ mutex_exit(&hm->hlm_contents);
+ return (0);
+}
diff --git a/usr/src/uts/common/fs/hyprlofs/hyprlofs_vnops.c b/usr/src/uts/common/fs/hyprlofs/hyprlofs_vnops.c
new file mode 100644
index 0000000000..d1abec51a7
--- /dev/null
+++ b/usr/src/uts/common/fs/hyprlofs/hyprlofs_vnops.c
@@ -0,0 +1,1414 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2013 Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/t_lock.h>
+#include <sys/systm.h>
+#include <sys/sysmacros.h>
+#include <sys/user.h>
+#include <sys/time.h>
+#include <sys/vfs.h>
+#include <sys/vfs_opreg.h>
+#include <sys/vnode.h>
+#include <sys/file.h>
+#include <sys/fcntl.h>
+#include <sys/flock.h>
+#include <sys/kmem.h>
+#include <sys/errno.h>
+#include <sys/stat.h>
+#include <sys/cred.h>
+#include <sys/dirent.h>
+#include <sys/pathname.h>
+#include <sys/fs/hyprlofs.h>
+#include <sys/fs/hyprlofs_info.h>
+#include <sys/mman.h>
+#include <vm/pvn.h>
+#include <sys/cmn_err.h>
+#include <sys/buf.h>
+#include <sys/policy.h>
+#include <fs/fs_subr.h>
+#include <sys/ddi.h>
+#include <sys/sunddi.h>
+
+static int hyprlofs_add_entry(vnode_t *, char *, char *, cred_t *,
+ caller_context_t *);
+static int hyprlofs_rm_entry(vnode_t *, char *, cred_t *, caller_context_t *,
+ int);
+static int hyprlofs_rm_all(vnode_t *, cred_t *, caller_context_t *, int);
+static int hyprlofs_remove(vnode_t *, char *, cred_t *, caller_context_t *,
+ int);
+static int hyprlofs_get_all(vnode_t *, intptr_t, cred_t *, caller_context_t *,
+ int);
+
+/*
+ * This is a somewhat arbitrary upper limit on the number of entries we can
+ * pass in on a single add/rm ioctl call. This is only used to validate that
+ * the input list looks sane.
+ */
+#define MAX_IOCTL_PARAMS 100000
+
+static int
+hyprlofs_open(vnode_t **vpp, int flag, cred_t *cr, caller_context_t *ct)
+{
+ vnode_t *rvp;
+ int error;
+
+ rvp = REALVP(*vpp);
+
+ if (VTOHLN(*vpp)->hln_looped == 0)
+ return (0);
+
+ /*
+ * looped back, pass through to real vnode. Need to hold new reference
+ * to vp since VOP_OPEN() may decide to release it.
+ */
+ VN_HOLD(rvp);
+ error = VOP_OPEN(&rvp, flag, cr, ct);
+ ASSERT(rvp->v_count > 1);
+ VN_RELE(rvp);
+
+ return (error);
+}
+
+static int
+hyprlofs_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr,
+ caller_context_t *ct)
+{
+ if (VTOHLN(vp)->hln_looped == 0) {
+ cleanlocks(vp, ttoproc(curthread)->p_pid, 0);
+ cleanshares(vp, ttoproc(curthread)->p_pid);
+ return (0);
+ }
+
+ return (VOP_CLOSE(REALVP(vp), flag, count, offset, cr, ct));
+}
+
+static int
+hyprlofs_read(vnode_t *vp, struct uio *uiop, int ioflag, cred_t *cr,
+ caller_context_t *ct)
+{
+ if (vp->v_type == VDIR)
+ return (EISDIR);
+ return (VOP_READ(REALVP(vp), uiop, ioflag, cr, ct));
+}
+
+static int
+hyprlofs_write(vnode_t *vp, struct uio *uiop, int ioflag, cred_t *cr,
+ caller_context_t *ct)
+{
+ /* We don't support writing to non-regular files */
+ if (vp->v_type != VREG)
+ return (EINVAL);
+
+ if (vn_is_readonly(vp))
+ return (EROFS);
+
+ return (VOP_WRITE(REALVP(vp), uiop, ioflag, cr, ct));
+}
+
+/* ARGSUSED */
+static int
+hyprlofs_ioctl(vnode_t *vp, int cmd, intptr_t data, int flag,
+ cred_t *cr, int *rvalp, caller_context_t *ct)
+{
+ int len, cnt, error;
+ int i;
+ model_t model;
+ char path[MAXPATHLEN];
+ char nm[MAXPATHLEN];
+
+ /* We only support the hyprlofs ioctls on the root vnode */
+ if (!(vp->v_flag & VROOT))
+ return (ENOTTY);
+
+ /*
+ * Check if managing hyprlofs is allowed.
+ */
+ if (secpolicy_hyprlofs_control(cr) != 0)
+ return (EPERM);
+
+ if (cmd == HYPRLOFS_ADD_ENTRIES || cmd == HYPRLOFS_RM_ENTRIES) {
+ model = get_udatamodel();
+
+ if (model == DATAMODEL_NATIVE) {
+ hyprlofs_entries_t ebuf;
+ hyprlofs_entry_t *e;
+
+ if (copyin((void *)data, &ebuf, sizeof (ebuf)))
+ return (EFAULT);
+ cnt = ebuf.hle_len;
+ if (cnt > MAX_IOCTL_PARAMS)
+ return (EINVAL);
+ len = sizeof (hyprlofs_entry_t) * cnt;
+
+ e = kmem_alloc(len, KM_SLEEP);
+ if (copyin((void *)(ebuf.hle_entries), e, len)) {
+ kmem_free(e, len);
+ return (EFAULT);
+ }
+
+ for (i = 0; i < cnt; i++) {
+ if (e[i].hle_nlen == 0 ||
+ e[i].hle_nlen > MAXPATHLEN)
+ return (EINVAL);
+
+ if (copyin(e[i].hle_name, nm, e[i].hle_nlen)
+ != 0) {
+ kmem_free(e, len);
+ return (EFAULT);
+ }
+ nm[e[i].hle_nlen] = '\0';
+
+ if (cmd == HYPRLOFS_ADD_ENTRIES) {
+ if (e[i].hle_plen == 0 ||
+ e[i].hle_plen > MAXPATHLEN)
+ return (EINVAL);
+
+ if (copyin(e[i].hle_path, path,
+ e[i].hle_plen) != 0) {
+ kmem_free(e, len);
+ return (EFAULT);
+ }
+ path[e[i].hle_plen] = '\0';
+
+ if ((error = hyprlofs_add_entry(vp,
+ path, nm, cr, ct)) != 0) {
+ kmem_free(e, len);
+ return (error);
+ }
+ } else {
+ if ((error = hyprlofs_rm_entry(vp, nm,
+ cr, ct, flag)) != 0) {
+ kmem_free(e, len);
+ return (error);
+ }
+ }
+ }
+
+ kmem_free(e, len);
+ return (0);
+
+ } else {
+ hyprlofs_entries32_t ebuf32;
+ hyprlofs_entry32_t *e32;
+
+ if (copyin((void *)data, &ebuf32, sizeof (ebuf32)))
+ return (EFAULT);
+
+ cnt = ebuf32.hle_len;
+ if (cnt > MAX_IOCTL_PARAMS)
+ return (EINVAL);
+ len = sizeof (hyprlofs_entry32_t) * cnt;
+
+ e32 = kmem_alloc(len, KM_SLEEP);
+ if (copyin((void *)(unsigned long)(ebuf32.hle_entries),
+ e32, len)) {
+ kmem_free(e32, len);
+ return (EFAULT);
+ }
+
+ for (i = 0; i < cnt; i++) {
+ if (e32[i].hle_nlen == 0 ||
+ e32[i].hle_nlen > MAXPATHLEN)
+ return (EINVAL);
+
+ if (copyin((void *)(unsigned long)
+ e32[i].hle_name, nm,
+ e32[i].hle_nlen) != 0) {
+ kmem_free(e32, len);
+ return (EFAULT);
+ }
+ nm[e32[i].hle_nlen] = '\0';
+
+ if (cmd == HYPRLOFS_ADD_ENTRIES) {
+ if (e32[i].hle_plen == 0 ||
+ e32[i].hle_plen > MAXPATHLEN)
+ return (EINVAL);
+
+ if (copyin((void *)(unsigned long)
+ e32[i].hle_path, path,
+ e32[i].hle_plen) != 0) {
+ kmem_free(e32, len);
+ return (EFAULT);
+ }
+ path[e32[i].hle_plen] = '\0';
+
+ if ((error = hyprlofs_add_entry(vp,
+ path, nm, cr, ct)) != 0) {
+ kmem_free(e32, len);
+ return (error);
+ }
+ } else {
+ if ((error = hyprlofs_rm_entry(vp, nm,
+ cr, ct, flag)) != 0) {
+ kmem_free(e32, len);
+ return (error);
+ }
+ }
+ }
+
+ kmem_free(e32, len);
+ return (0);
+ }
+ }
+
+ if (cmd == HYPRLOFS_RM_ALL) {
+ return (hyprlofs_rm_all(vp, cr, ct, flag));
+ }
+
+ if (cmd == HYPRLOFS_GET_ENTRIES) {
+ return (hyprlofs_get_all(vp, data, cr, ct, flag));
+ }
+
+ return (ENOTTY);
+}
+
+/*ARGSUSED2*/
+static int
+hyprlofs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
+ caller_context_t *ct)
+{
+ hlnode_t *tp = (hlnode_t *)VTOHLN(vp);
+
+ mutex_enter(&tp->hln_tlock);
+ vap->va_type = vp->v_type;
+ vap->va_mode = tp->hln_mode & MODEMASK;
+ vap->va_uid = tp->hln_uid;
+ vap->va_gid = tp->hln_gid;
+ vap->va_fsid = tp->hln_fsid;
+ vap->va_nodeid = (ino64_t)tp->hln_nodeid;
+ vap->va_nlink = tp->hln_nlink;
+ vap->va_size = (u_offset_t)tp->hln_size;
+ vap->va_atime = tp->hln_atime;
+ vap->va_mtime = tp->hln_mtime;
+ vap->va_ctime = tp->hln_ctime;
+ vap->va_blksize = PAGESIZE;
+ vap->va_rdev = tp->hln_rdev;
+ vap->va_seq = tp->hln_seq;
+
+ vap->va_nblocks = (fsblkcnt64_t)btodb(ptob(btopr(vap->va_size)));
+ mutex_exit(&tp->hln_tlock);
+ return (0);
+}
+
+/*ARGSUSED4*/
+static int
+hyprlofs_setattr(vnode_t *vp, vattr_t *vap, int flags,
+ cred_t *cr, caller_context_t *ct)
+{
+ hlnode_t *tp = (hlnode_t *)VTOHLN(vp);
+ int error = 0;
+ vattr_t *get;
+ long mask;
+
+ /*
+ * Cannot set these attributes
+ */
+ if ((vap->va_mask & AT_NOSET) || (vap->va_mask & AT_XVATTR))
+ return (EINVAL);
+
+ mutex_enter(&tp->hln_tlock);
+
+ get = &tp->hln_attr;
+ /*
+ * Change file access modes. Must be owner or have sufficient
+ * privileges.
+ */
+ error = secpolicy_vnode_setattr(cr, vp, vap, get, flags,
+ hyprlofs_taccess, tp);
+
+ if (error)
+ goto out;
+
+ mask = vap->va_mask;
+
+ if (mask & AT_MODE) {
+ get->va_mode &= S_IFMT;
+ get->va_mode |= vap->va_mode & ~S_IFMT;
+ }
+
+ if (mask & AT_UID)
+ get->va_uid = vap->va_uid;
+ if (mask & AT_GID)
+ get->va_gid = vap->va_gid;
+ if (mask & AT_ATIME)
+ get->va_atime = vap->va_atime;
+ if (mask & AT_MTIME)
+ get->va_mtime = vap->va_mtime;
+
+ if (mask & (AT_UID | AT_GID | AT_MODE | AT_MTIME))
+ gethrestime(&tp->hln_ctime);
+
+out:
+ mutex_exit(&tp->hln_tlock);
+ return (error);
+}
+
+static int
+hyprlofs_access(vnode_t *vp, int mode, int flags, cred_t *cr,
+ caller_context_t *ct)
+{
+ hlnode_t *tp = (hlnode_t *)VTOHLN(vp);
+ int error;
+
+ if (mode & VWRITE) {
+ if (vp->v_type == VREG && vn_is_readonly(vp))
+ return (EROFS);
+ }
+ if (VTOHLN(vp)->hln_looped == 1)
+ return (VOP_ACCESS(REALVP(vp), mode, flags, cr, ct));
+
+ mutex_enter(&tp->hln_tlock);
+ error = hyprlofs_taccess(tp, mode, cr);
+ mutex_exit(&tp->hln_tlock);
+ return (error);
+}
+
+/* ARGSUSED3 */
+static int
+hyprlofs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct pathname *pnp,
+ int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct,
+ int *direntflags, pathname_t *realpnp)
+{
+ hlnode_t *tp = (hlnode_t *)VTOHLN(dvp);
+ hlnode_t *ntp = NULL;
+ int error;
+
+ if (VTOHLN(dvp)->hln_looped == 1)
+ return (VOP_LOOKUP(REALVP(dvp), nm, vpp, pnp, flags, rdir,
+ cr, ct, direntflags, realpnp));
+
+ if (flags & LOOKUP_XATTR)
+ return (EINVAL);
+
+ /* Null component name is a synonym for directory being searched. */
+ if (*nm == '\0') {
+ VN_HOLD(dvp);
+ *vpp = dvp;
+ return (0);
+ }
+ ASSERT(tp);
+
+ if ((error = hyprlofs_dirlookup(tp, nm, &ntp, cr)) == 0) {
+ ASSERT(ntp);
+ *vpp = HLNTOV(ntp);
+ }
+ return (error);
+}
+
+/*
+ * Create the loopback from the hyprlofs vnode to the real vnode.
+ */
+static int
+hyprlofs_loopback(vnode_t *dvp, vnode_t *rvp, char *nm, vattr_t *vap,
+ int mode, cred_t *cr, caller_context_t *ct)
+{
+ hlnode_t *parent;
+ hlfsmount_t *tm;
+ int error;
+ hlnode_t *oldtp;
+ vnode_t *vp;
+
+ parent = (hlnode_t *)VTOHLN(dvp);
+ tm = (hlfsmount_t *)VTOHLM(dvp);
+ error = 0;
+ oldtp = NULL;
+
+ if (vap->va_type == VREG && (vap->va_mode & VSVTX)) {
+ /* we don't support the sticky bit */
+ vap->va_mode &= ~VSVTX;
+ } else if (vap->va_type == VNON) {
+ return (EINVAL);
+ }
+
+ /* Null component name is a synonym for directory being searched. */
+ if (*nm == '\0') {
+ VN_HOLD(dvp);
+ oldtp = parent;
+ } else {
+ error = hyprlofs_dirlookup(parent, nm, &oldtp, cr);
+ }
+
+ if (error == 0) { /* name found */
+ ASSERT(oldtp);
+
+ rw_enter(&oldtp->hln_rwlock, RW_WRITER);
+
+ /*
+ * if create/read-only an existing directory, allow it
+ */
+ if ((oldtp->hln_type == VDIR) && (mode & VWRITE))
+ error = EISDIR;
+ else {
+ error = hyprlofs_taccess(oldtp, mode, cr);
+ }
+
+ if (error) {
+ rw_exit(&oldtp->hln_rwlock);
+ hlnode_rele(oldtp);
+ return (error);
+ }
+
+ vp = HLNTOV(oldtp);
+ rw_exit(&oldtp->hln_rwlock);
+
+ if (vp->v_type == VREG) {
+ hlnode_rele(oldtp);
+ return (EEXIST);
+ }
+
+ vnevent_create(vp, ct);
+ return (0);
+ }
+
+ if (error != ENOENT)
+ return (error);
+
+ rw_enter(&parent->hln_rwlock, RW_WRITER);
+ error = hyprlofs_direnter(tm, parent, nm, DE_CREATE, rvp, vap, NULL,
+ cr);
+ rw_exit(&parent->hln_rwlock);
+
+ return (error);
+}
+
+/*
+ * Create an in-memory directory based on the add-entry ioctl name.
+ * If the dir exists, return EEXIST but still also return node in vpp.
+ */
+static int
+hyprlofs_mkdir(vnode_t *dvp, char *nm, vattr_t *va, vnode_t **vpp, cred_t *cr)
+{
+ hlnode_t *parent = (hlnode_t *)VTOHLN(dvp);
+ hlnode_t *self = NULL;
+ hlfsmount_t *tm = (hlfsmount_t *)VTOHLM(dvp);
+ int error;
+
+ /*
+ * Might be dangling directory. Catch it here, because a ENOENT return
+ * from hyprlofs_dirlookup() is a valid return.
+ */
+ if (parent->hln_nlink == 0)
+ return (ENOENT);
+
+ error = hyprlofs_dirlookup(parent, nm, &self, cr);
+ if (error == 0) {
+ ASSERT(self);
+ hlnode_rele(self);
+ /* We can't loop in under a looped in directory */
+ if (self->hln_looped)
+ return (EACCES);
+ *vpp = HLNTOV(self);
+ return (EEXIST);
+ }
+ if (error != ENOENT)
+ return (error);
+
+ rw_enter(&parent->hln_rwlock, RW_WRITER);
+ error = hyprlofs_direnter(tm, parent, nm, DE_MKDIR, (vnode_t *)NULL,
+ va, &self, cr);
+ rw_exit(&parent->hln_rwlock);
+
+ if (error == 0 || error == EEXIST) {
+ hlnode_rele(self);
+ *vpp = HLNTOV(self);
+ }
+
+ return (error);
+}
+
+/*
+ * Loop in a file or directory into the namespace.
+ */
+static int
+hyprlofs_add_entry(vnode_t *vp, char *fspath, char *fsname,
+ cred_t *cr, caller_context_t *ct)
+{
+ int error;
+ char *p, *pnm;
+ vnode_t *realvp, *dvp;
+ vattr_t va;
+
+ /*
+ * Get vnode for the real file/dir. We'll have a hold on realvp which
+ * we won't vn_rele until hyprlofs_inactive.
+ */
+ if ((error = lookupname(fspath, UIO_SYSSPACE, FOLLOW, NULLVPP,
+ &realvp)) != 0)
+ return (error);
+
+ /* no devices allowed */
+ if (IS_DEVVP(realvp)) {
+ VN_RELE(realvp);
+ return (ENODEV);
+ }
+
+ /*
+ * realvp may be an AUTOFS node, in which case we perform a VOP_ACCESS
+ * to trigger the mount of the intended filesystem. This causes a
+ * loopback mount of the intended filesystem instead of the AUTOFS
+ * filesystem.
+ */
+ if ((error = VOP_ACCESS(realvp, 0, 0, cr, NULL)) != 0) {
+ VN_RELE(realvp);
+ return (error);
+ }
+
+ /*
+ * We're interested in the top most filesystem. This is specially
+ * important when fspath is a trigger AUTOFS node, since we're really
+ * interested in mounting the filesystem AUTOFS mounted as result of
+ * the VOP_ACCESS() call not the AUTOFS node itself.
+ */
+ if (vn_mountedvfs(realvp) != NULL) {
+ if ((error = traverse(&realvp)) != 0) {
+ VN_RELE(realvp);
+ return (error);
+ }
+ }
+
+ va.va_type = VNON;
+ /*
+ * If the target name is a path, make sure we have all of the
+ * intermediate directories, creating them if necessary.
+ */
+ dvp = vp;
+ pnm = p = fsname;
+
+ /* path cannot be absolute */
+ if (*p == '/') {
+ VN_RELE(realvp);
+ return (EINVAL);
+ }
+
+ for (p = strchr(pnm, '/'); p != NULL; p = strchr(pnm, '/')) {
+ if (va.va_type == VNON)
+ /* use the top-level dir as the template va for mkdir */
+ if ((error = VOP_GETATTR(vp, &va, 0, cr, NULL)) != 0) {
+ VN_RELE(realvp);
+ return (error);
+ }
+
+ *p = '\0';
+
+ /* Path component cannot be empty or relative */
+ if (pnm[0] == '\0' || (pnm[0] == '.' && pnm[1] == '.')) {
+ VN_RELE(realvp);
+ return (EINVAL);
+ }
+
+ if ((error = hyprlofs_mkdir(dvp, pnm, &va, &dvp, cr)) != 0 &&
+ error != EEXIST) {
+ VN_RELE(realvp);
+ return (error);
+ }
+
+ *p = '/';
+ pnm = p + 1;
+ }
+
+ /* The file name is required */
+ if (pnm[0] == '\0') {
+ VN_RELE(realvp);
+ return (EINVAL);
+ }
+
+ /* Now use the real file's va as the template va */
+ if ((error = VOP_GETATTR(realvp, &va, 0, cr, NULL)) != 0) {
+ VN_RELE(realvp);
+ return (error);
+ }
+
+ /* Make the vnode */
+ error = hyprlofs_loopback(dvp, realvp, pnm, &va, va.va_mode, cr, ct);
+ if (error != 0)
+ VN_RELE(realvp);
+ return (error);
+}
+
+/*
+ * Remove a looped in file from the namespace.
+ */
+static int
+hyprlofs_rm_entry(vnode_t *dvp, char *fsname, cred_t *cr, caller_context_t *ct,
+ int flags)
+{
+ int error;
+ char *p, *pnm;
+ hlnode_t *parent;
+ hlnode_t *fndtp;
+
+ pnm = p = fsname;
+
+ /* path cannot be absolute */
+ if (*p == '/')
+ return (EINVAL);
+
+ /*
+ * If the target name is a path, get the containing dir and simple
+ * file name.
+ */
+ parent = (hlnode_t *)VTOHLN(dvp);
+ for (p = strchr(pnm, '/'); p != NULL; p = strchr(pnm, '/')) {
+ *p = '\0';
+
+ /* Path component cannot be empty or relative */
+ if (pnm[0] == '\0' || (pnm[0] == '.' && pnm[1] == '.'))
+ return (EINVAL);
+
+ if ((error = hyprlofs_dirlookup(parent, pnm, &fndtp, cr)) != 0)
+ return (error);
+
+ dvp = HLNTOV(fndtp);
+ parent = fndtp;
+ pnm = p + 1;
+ }
+
+ /* The file name is required */
+ if (pnm[0] == '\0')
+ return (EINVAL);
+
+ /* Remove the entry from the parent dir */
+ return (hyprlofs_remove(dvp, pnm, cr, ct, flags));
+}
+
+/*
+ * Remove all looped in files from the namespace.
+ */
+static int
+hyprlofs_rm_all(vnode_t *dvp, cred_t *cr, caller_context_t *ct,
+ int flags)
+{
+ int error = 0;
+ hlnode_t *hp = (hlnode_t *)VTOHLN(dvp);
+ hldirent_t *hdp;
+
+ hlnode_hold(hp);
+
+ /*
+ * There's a window here where someone could have removed
+ * all the entries in the directory after we put a hold on the
+ * vnode but before we grabbed the rwlock. Just return.
+ */
+ if (hp->hln_dir == NULL) {
+ if (hp->hln_nlink) {
+ panic("empty directory 0x%p", (void *)hp);
+ /*NOTREACHED*/
+ }
+ goto done;
+ }
+
+ hdp = hp->hln_dir;
+ while (hdp) {
+ hlnode_t *fndhp;
+
+ if (strcmp(hdp->hld_name, ".") == 0 ||
+ strcmp(hdp->hld_name, "..") == 0) {
+ hdp = hdp->hld_next;
+ continue;
+ }
+
+ /* This holds the fndhp vnode */
+ error = hyprlofs_dirlookup(hp, hdp->hld_name, &fndhp, cr);
+ if (error != 0)
+ goto done;
+ hlnode_rele(fndhp);
+
+ if (fndhp->hln_looped == 0) {
+ /* recursively remove contents of this subdir */
+ if (fndhp->hln_type == VDIR) {
+ vnode_t *tvp = HLNTOV(fndhp);
+
+ error = hyprlofs_rm_all(tvp, cr, ct, flags);
+ if (error != 0)
+ goto done;
+ }
+ }
+
+ /* remove the entry */
+ error = hyprlofs_remove(dvp, hdp->hld_name, cr, ct, flags);
+ if (error != 0)
+ goto done;
+
+ hdp = hp->hln_dir;
+ }
+
+done:
+ hlnode_rele(hp);
+ return (error);
+}
+
+/*
+ * Get a list of all looped in files in the namespace.
+ */
+static int
+hyprlofs_get_all_entries(vnode_t *dvp, hyprlofs_curr_entry_t *hcp,
+ char *prefix, int *pcnt, int n_max,
+ cred_t *cr, caller_context_t *ct, int flags)
+{
+ int error = 0;
+ int too_big = 0;
+ int cnt;
+ int len;
+ hlnode_t *hp = (hlnode_t *)VTOHLN(dvp);
+ hldirent_t *hdp;
+ char *path;
+
+ cnt = *pcnt;
+ path = kmem_alloc(MAXPATHLEN, KM_SLEEP);
+
+ hlnode_hold(hp);
+
+ /*
+ * There's a window here where someone could have removed
+ * all the entries in the directory after we put a hold on the
+ * vnode but before we grabbed the rwlock. Just return.
+ */
+ if (hp->hln_dir == NULL) {
+ if (hp->hln_nlink) {
+ panic("empty directory 0x%p", (void *)hp);
+ /*NOTREACHED*/
+ }
+ goto done;
+ }
+
+ hdp = hp->hln_dir;
+ while (hdp) {
+ hlnode_t *fndhp;
+ vnode_t *tvp;
+
+ if (strcmp(hdp->hld_name, ".") == 0 ||
+ strcmp(hdp->hld_name, "..") == 0) {
+ hdp = hdp->hld_next;
+ continue;
+ }
+
+ /* This holds the fndhp vnode */
+ error = hyprlofs_dirlookup(hp, hdp->hld_name, &fndhp, cr);
+ if (error != 0)
+ goto done;
+ hlnode_rele(fndhp);
+
+ if (fndhp->hln_looped == 0) {
+ /* recursively get contents of this subdir */
+ VERIFY(fndhp->hln_type == VDIR);
+ tvp = HLNTOV(fndhp);
+
+ if (*prefix == '\0')
+ (void) strlcpy(path, hdp->hld_name, MAXPATHLEN);
+ else
+ (void) snprintf(path, MAXPATHLEN, "%s/%s",
+ prefix, hdp->hld_name);
+
+ error = hyprlofs_get_all_entries(tvp, hcp, path,
+ &cnt, n_max, cr, ct, flags);
+
+ if (error == E2BIG) {
+ too_big = 1;
+ error = 0;
+ }
+ if (error != 0)
+ goto done;
+ } else {
+ if (cnt < n_max) {
+ char *p;
+
+ if (*prefix == '\0')
+ (void) strlcpy(path, hdp->hld_name,
+ MAXPATHLEN);
+ else
+ (void) snprintf(path, MAXPATHLEN,
+ "%s/%s", prefix, hdp->hld_name);
+
+ len = strlen(path);
+ ASSERT(len <= MAXPATHLEN);
+ if (copyout(path, (void *)(hcp[cnt].hce_name),
+ len)) {
+ error = EFAULT;
+ goto done;
+ }
+
+ tvp = REALVP(HLNTOV(fndhp));
+ if (tvp->v_path == NULL) {
+ p = "<unknown>";
+ } else {
+ p = tvp->v_path;
+ }
+ len = strlen(p);
+ ASSERT(len <= MAXPATHLEN);
+ if (copyout(p, (void *)(hcp[cnt].hce_path),
+ len)) {
+ error = EFAULT;
+ goto done;
+ }
+ }
+
+ cnt++;
+ if (cnt > n_max)
+ too_big = 1;
+ }
+
+ hdp = hdp->hld_next;
+ }
+
+done:
+ hlnode_rele(hp);
+ kmem_free(path, MAXPATHLEN);
+
+ *pcnt = cnt;
+ if (error == 0 && too_big == 1)
+ error = E2BIG;
+
+ return (error);
+}
+
+/*
+ * Return a list of all looped in files in the namespace.
+ */
+static int
+hyprlofs_get_all(vnode_t *dvp, intptr_t data, cred_t *cr, caller_context_t *ct,
+ int flags)
+{
+ int limit, cnt, error;
+ model_t model;
+ hyprlofs_curr_entry_t *e;
+
+ model = get_udatamodel();
+
+ if (model == DATAMODEL_NATIVE) {
+ hyprlofs_curr_entries_t ebuf;
+
+ if (copyin((void *)data, &ebuf, sizeof (ebuf)))
+ return (EFAULT);
+ limit = ebuf.hce_cnt;
+ e = ebuf.hce_entries;
+ if (limit > MAX_IOCTL_PARAMS)
+ return (EINVAL);
+
+ } else {
+ hyprlofs_curr_entries32_t ebuf32;
+
+ if (copyin((void *)data, &ebuf32, sizeof (ebuf32)))
+ return (EFAULT);
+
+ limit = ebuf32.hce_cnt;
+ e = (hyprlofs_curr_entry_t *)(unsigned long)
+ (ebuf32.hce_entries);
+ if (limit > MAX_IOCTL_PARAMS)
+ return (EINVAL);
+ }
+
+ cnt = 0;
+ error = hyprlofs_get_all_entries(dvp, e, "", &cnt, limit, cr, ct,
+ flags);
+
+ if (error == 0 || error == E2BIG) {
+ if (model == DATAMODEL_NATIVE) {
+ hyprlofs_curr_entries_t ebuf;
+
+ ebuf.hce_cnt = cnt;
+ if (copyout(&ebuf, (void *)data, sizeof (ebuf)))
+ return (EFAULT);
+
+ } else {
+ hyprlofs_curr_entries32_t ebuf32;
+
+ ebuf32.hce_cnt = cnt;
+ if (copyout(&ebuf32, (void *)data, sizeof (ebuf32)))
+ return (EFAULT);
+ }
+ }
+
+ return (error);
+}
+
+/* ARGSUSED3 */
+static int
+hyprlofs_remove(vnode_t *dvp, char *nm, cred_t *cr, caller_context_t *ct,
+ int flags)
+{
+ hlnode_t *parent = (hlnode_t *)VTOHLN(dvp);
+ int error;
+ hlnode_t *hp = NULL;
+
+ /* This holds the hp vnode */
+ error = hyprlofs_dirlookup(parent, nm, &hp, cr);
+ if (error)
+ return (error);
+
+ ASSERT(hp);
+ rw_enter(&parent->hln_rwlock, RW_WRITER);
+ rw_enter(&hp->hln_rwlock, RW_WRITER);
+
+ error = hyprlofs_dirdelete(parent, hp, nm, DR_REMOVE, cr);
+
+ rw_exit(&hp->hln_rwlock);
+ rw_exit(&parent->hln_rwlock);
+ vnevent_remove(HLNTOV(hp), dvp, nm, ct);
+
+ /*
+ * We've now dropped the dir link so by rele-ing our vnode we should
+ * clean up in hyprlofs_inactive.
+ */
+ hlnode_rele(hp);
+
+ return (error);
+}
+
+/* ARGSUSED4 */
+static int
+hyprlofs_rmdir(vnode_t *dvp, char *nm, vnode_t *cdir, cred_t *cr,
+ caller_context_t *ct, int flags)
+{
+ hlnode_t *parent = (hlnode_t *)VTOHLN(dvp);
+ hlnode_t *self = NULL;
+ vnode_t *vp;
+ int error = 0;
+
+ /* Return error if removing . or .. */
+ if (strcmp(nm, ".") == 0)
+ return (EINVAL);
+ if (strcmp(nm, "..") == 0)
+ return (EEXIST); /* Should be ENOTEMPTY */
+ error = hyprlofs_dirlookup(parent, nm, &self, cr);
+ if (error)
+ return (error);
+
+ rw_enter(&parent->hln_rwlock, RW_WRITER);
+ rw_enter(&self->hln_rwlock, RW_WRITER);
+
+ vp = HLNTOV(self);
+ if (vp == dvp || vp == cdir) {
+ error = EINVAL;
+ goto done1;
+ }
+ if (self->hln_type != VDIR) {
+ error = ENOTDIR;
+ goto done1;
+ }
+
+ /*
+ * When a dir is looped in, we only remove the in-memory dir, not the
+ * backing dir.
+ */
+ if (self->hln_looped == 0) {
+ mutex_enter(&self->hln_tlock);
+ if (self->hln_nlink > 2) {
+ mutex_exit(&self->hln_tlock);
+ error = EEXIST;
+ goto done1;
+ }
+ mutex_exit(&self->hln_tlock);
+
+ if (vn_vfswlock(vp)) {
+ error = EBUSY;
+ goto done1;
+ }
+ if (vn_mountedvfs(vp) != NULL) {
+ error = EBUSY;
+ goto done;
+ }
+
+ /*
+ * Check for an empty directory, i.e. only includes entries for
+ * "." and ".."
+ */
+ if (self->hln_dirents > 2) {
+ error = EEXIST; /* SIGH should be ENOTEMPTY */
+ /*
+ * Update atime because checking hln_dirents is
+ * equivalent to reading the directory
+ */
+ gethrestime(&self->hln_atime);
+ goto done;
+ }
+
+ error = hyprlofs_dirdelete(parent, self, nm, DR_RMDIR, cr);
+ } else {
+ error = hyprlofs_dirdelete(parent, self, nm, DR_REMOVE, cr);
+ }
+
+done:
+ if (self->hln_looped == 0)
+ vn_vfsunlock(vp);
+done1:
+ rw_exit(&self->hln_rwlock);
+ rw_exit(&parent->hln_rwlock);
+ vnevent_rmdir(HLNTOV(self), dvp, nm, ct);
+
+ /*
+ * We've now dropped the dir link so by rele-ing our vnode we should
+ * clean up in hyprlofs_inactive.
+ */
+ hlnode_rele(self);
+
+ return (error);
+}
+
+static int
+hyprlofs_readdir(vnode_t *vp, struct uio *uiop, cred_t *cr, int *eofp,
+ caller_context_t *ct, int flags)
+{
+ hlnode_t *hp = (hlnode_t *)VTOHLN(vp);
+ hldirent_t *hdp;
+ int error = 0;
+ size_t namelen;
+ struct dirent64 *dp;
+ ulong_t offset;
+ ulong_t total_bytes_wanted;
+ long outcount = 0;
+ long bufsize;
+ int reclen;
+ caddr_t outbuf;
+
+ if (VTOHLN(vp)->hln_looped == 1)
+ return (VOP_READDIR(REALVP(vp), uiop, cr, eofp, ct, flags));
+
+ if (uiop->uio_loffset >= MAXOFF_T) {
+ if (eofp)
+ *eofp = 1;
+ return (0);
+ }
+ /* assuming syscall has already called hln_rwlock */
+ ASSERT(RW_READ_HELD(&hp->hln_rwlock));
+
+ if (uiop->uio_iovcnt != 1)
+ return (EINVAL);
+
+ if (vp->v_type != VDIR)
+ return (ENOTDIR);
+
+ /*
+ * There's a window here where someone could have removed
+ * all the entries in the directory after we put a hold on the
+ * vnode but before we grabbed the rwlock. Just return.
+ */
+ if (hp->hln_dir == NULL) {
+ if (hp->hln_nlink) {
+ panic("empty directory 0x%p", (void *)hp);
+ /*NOTREACHED*/
+ }
+ return (0);
+ }
+
+ /* Get space for multiple dir entries */
+ total_bytes_wanted = uiop->uio_iov->iov_len;
+ bufsize = total_bytes_wanted + sizeof (struct dirent64);
+ outbuf = kmem_alloc(bufsize, KM_SLEEP);
+
+ dp = (struct dirent64 *)((uintptr_t)outbuf);
+
+ offset = 0;
+ hdp = hp->hln_dir;
+ while (hdp) {
+ namelen = strlen(hdp->hld_name); /* no +1 needed */
+ offset = hdp->hld_offset;
+ if (offset >= uiop->uio_offset) {
+ reclen = (int)DIRENT64_RECLEN(namelen);
+ if (outcount + reclen > total_bytes_wanted) {
+ if (!outcount)
+ /* Buffer too small for any entries. */
+ error = EINVAL;
+ break;
+ }
+ ASSERT(hdp->hld_hlnode != NULL);
+
+ /* zero out uninitialized bytes */
+ (void) strncpy(dp->d_name, hdp->hld_name,
+ DIRENT64_NAMELEN(reclen));
+ dp->d_reclen = (ushort_t)reclen;
+ dp->d_ino = (ino64_t)hdp->hld_hlnode->hln_nodeid;
+ dp->d_off = (offset_t)hdp->hld_offset + 1;
+ dp = (struct dirent64 *)
+ ((uintptr_t)dp + dp->d_reclen);
+ outcount += reclen;
+ ASSERT(outcount <= bufsize);
+ }
+ hdp = hdp->hld_next;
+ }
+
+ if (!error)
+ error = uiomove(outbuf, outcount, UIO_READ, uiop);
+
+ if (!error) {
+ /*
+ * If we reached the end of the list our offset should now be
+ * just past the end.
+ */
+ if (!hdp) {
+ offset += 1;
+ if (eofp)
+ *eofp = 1;
+ } else if (eofp)
+ *eofp = 0;
+ uiop->uio_offset = offset;
+ }
+ gethrestime(&hp->hln_atime);
+ kmem_free(outbuf, bufsize);
+ return (error);
+}
+
+static int
+hyprlofs_fsync(vnode_t *vp, int syncflag, cred_t *cr, caller_context_t *ct)
+{
+ if (VTOHLN(vp)->hln_looped == 1)
+ return (VOP_FSYNC(REALVP(vp), syncflag, cr, ct));
+ return (0);
+}
+
+/* ARGSUSED */
+static void
+hyprlofs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct)
+{
+ hlnode_t *hp = (hlnode_t *)VTOHLN(vp);
+ hlfsmount_t *hm = (hlfsmount_t *)VFSTOHLM(vp->v_vfsp);
+
+ rw_enter(&hp->hln_rwlock, RW_WRITER);
+
+ mutex_enter(&hp->hln_tlock);
+ mutex_enter(&vp->v_lock);
+ ASSERT(vp->v_count >= 1);
+
+ /*
+ * If we don't have the last hold or the link count is non-zero,
+ * there's nothing to do except drop our hold.
+ */
+ if (vp->v_count > 1 || hp->hln_nlink != 0) {
+ vp->v_count--;
+ mutex_exit(&vp->v_lock);
+ mutex_exit(&hp->hln_tlock);
+ rw_exit(&hp->hln_rwlock);
+ return;
+ }
+
+ mutex_exit(&vp->v_lock);
+ mutex_exit(&hp->hln_tlock);
+
+ /* release hold on the real vnode now */
+ if (hp->hln_looped == 1 && hp->hln_realvp != NULL)
+ VN_RELE(hp->hln_realvp);
+
+ /* Here's our chance to send invalid event while we're between locks */
+ vn_invalid(HLNTOV(hp));
+
+ mutex_enter(&hm->hlm_contents);
+ if (hp->hln_forw == NULL)
+ hm->hlm_rootnode->hln_back = hp->hln_back;
+ else
+ hp->hln_forw->hln_back = hp->hln_back;
+ hp->hln_back->hln_forw = hp->hln_forw;
+ mutex_exit(&hm->hlm_contents);
+ rw_exit(&hp->hln_rwlock);
+ rw_destroy(&hp->hln_rwlock);
+ mutex_destroy(&hp->hln_tlock);
+ vn_free(HLNTOV(hp));
+ kmem_free(hp, sizeof (hlnode_t));
+}
+
+static int
+hyprlofs_fid(vnode_t *vp, struct fid *fidp, caller_context_t *ct)
+{
+ hlnode_t *hp = (hlnode_t *)VTOHLN(vp);
+ hlfid_t *hfid;
+
+ if (VTOHLN(vp)->hln_looped == 1)
+ return (VOP_FID(REALVP(vp), fidp, ct));
+
+ if (fidp->fid_len < (sizeof (hlfid_t) - sizeof (ushort_t))) {
+ fidp->fid_len = sizeof (hlfid_t) - sizeof (ushort_t);
+ return (ENOSPC);
+ }
+
+ hfid = (hlfid_t *)fidp;
+ bzero(hfid, sizeof (hlfid_t));
+ hfid->hlfid_len = (int)sizeof (hlfid_t) - sizeof (ushort_t);
+
+ hfid->hlfid_ino = hp->hln_nodeid;
+ hfid->hlfid_gen = hp->hln_gen;
+
+ return (0);
+}
+
+static int
+hyprlofs_getpage(vnode_t *vp, offset_t off, size_t len, uint_t *protp,
+ page_t *pl[], size_t plsz, struct seg *seg, caddr_t addr, enum seg_rw rw,
+ cred_t *cr, caller_context_t *ct)
+{
+ ASSERT(VTOHLN(vp)->hln_looped == 1);
+ return (VOP_GETPAGE(REALVP(vp), off, len, protp, pl, plsz, seg, addr,
+ rw, cr, ct));
+}
+
+int
+hyprlofs_putpage(vnode_t *vp, offset_t off, size_t len, int flags,
+ cred_t *cr, caller_context_t *ct)
+{
+ ASSERT(VTOHLN(vp)->hln_looped == 1);
+ return (VOP_PUTPAGE(REALVP(vp), off, len, flags, cr, ct));
+}
+
+static int
+hyprlofs_map(vnode_t *vp, offset_t off, struct as *as, caddr_t *addrp,
+ size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cr,
+ caller_context_t *ct)
+{
+ ASSERT(VTOHLN(vp)->hln_looped == 1);
+ return (VOP_MAP(REALVP(vp), off, as, addrp, len, prot, maxprot, flags,
+ cr, ct));
+}
+
+static int
+hyprlofs_addmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr,
+ size_t len, uchar_t prot, uchar_t maxprot, uint_t flags, cred_t *cr,
+ caller_context_t *ct)
+{
+ ASSERT(VTOHLN(vp)->hln_looped == 1);
+ return (VOP_ADDMAP(REALVP(vp), off, as, addr, len, prot, maxprot,
+ flags, cr, ct));
+}
+
+static int
+hyprlofs_delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr,
+ size_t len, uint_t prot, uint_t maxprot, uint_t flags, cred_t *cr,
+ caller_context_t *ct)
+{
+ ASSERT(VTOHLN(vp)->hln_looped == 1);
+ return (VOP_DELMAP(REALVP(vp), off, as, addr, len, prot, maxprot,
+ flags, cr, ct));
+}
+
+static int
+hyprlofs_space(vnode_t *vp, int cmd, struct flock64 *bfp, int flag,
+ offset_t offset, cred_t *cr, caller_context_t *ct)
+{
+ ASSERT(VTOHLN(vp)->hln_looped == 1);
+ return (VOP_SPACE(REALVP(vp), cmd, bfp, flag, offset, cr, ct));
+}
+
+static int
+hyprlofs_seek(vnode_t *vp, offset_t ooff, offset_t *noffp,
+ caller_context_t *ct)
+{
+ if (VTOHLN(vp)->hln_looped == 0)
+ return ((*noffp < 0 || *noffp > MAXOFFSET_T) ? EINVAL : 0);
+
+ return (VOP_SEEK(REALVP(vp), ooff, noffp, ct));
+}
+
+static int
+hyprlofs_rwlock(vnode_t *vp, int write_lock, caller_context_t *ct)
+{
+ hlnode_t *hp = VTOHLN(vp);
+
+ if (hp->hln_looped == 1)
+ return (VOP_RWLOCK(REALVP(vp), write_lock, ct));
+
+ if (write_lock) {
+ rw_enter(&hp->hln_rwlock, RW_WRITER);
+ } else {
+ rw_enter(&hp->hln_rwlock, RW_READER);
+ }
+ return (write_lock);
+}
+
+static void
+hyprlofs_rwunlock(vnode_t *vp, int write_lock, caller_context_t *ct)
+{
+ hlnode_t *hp = VTOHLN(vp);
+
+ if (hp->hln_looped == 1) {
+ VOP_RWUNLOCK(REALVP(vp), write_lock, ct);
+ return;
+ }
+
+ rw_exit(&hp->hln_rwlock);
+}
+
+static int
+hyprlofs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
+ caller_context_t *ct)
+{
+ int error;
+
+ if (VTOHLN(vp)->hln_looped == 1)
+ return (VOP_PATHCONF(REALVP(vp), cmd, valp, cr, ct));
+
+ switch (cmd) {
+ case _PC_XATTR_ENABLED:
+ case _PC_XATTR_EXISTS:
+ case _PC_SATTR_ENABLED:
+ case _PC_SATTR_EXISTS:
+ error = EINVAL;
+ break;
+ case _PC_TIMESTAMP_RESOLUTION:
+ /* nanosecond timestamp resolution */
+ *valp = 1L;
+ error = 0;
+ break;
+ default:
+ error = fs_pathconf(vp, cmd, valp, cr, ct);
+ }
+ return (error);
+}
+
+
+struct vnodeops *hyprlofs_vnodeops;
+
+const fs_operation_def_t hyprlofs_vnodeops_template[] = {
+ VOPNAME_OPEN, { .vop_open = hyprlofs_open },
+ VOPNAME_CLOSE, { .vop_close = hyprlofs_close },
+ VOPNAME_READ, { .vop_read = hyprlofs_read },
+ VOPNAME_WRITE, { .vop_write = hyprlofs_write },
+ VOPNAME_IOCTL, { .vop_ioctl = hyprlofs_ioctl },
+ VOPNAME_GETATTR, { .vop_getattr = hyprlofs_getattr },
+ VOPNAME_SETATTR, { .vop_setattr = hyprlofs_setattr },
+ VOPNAME_ACCESS, { .vop_access = hyprlofs_access },
+ VOPNAME_LOOKUP, { .vop_lookup = hyprlofs_lookup },
+ VOPNAME_CREATE, { .error = fs_error },
+ VOPNAME_REMOVE, { .vop_remove = hyprlofs_remove },
+ VOPNAME_LINK, { .error = fs_error },
+ VOPNAME_RENAME, { .error = fs_error },
+ VOPNAME_MKDIR, { .error = fs_error },
+ VOPNAME_RMDIR, { .vop_rmdir = hyprlofs_rmdir },
+ VOPNAME_READDIR, { .vop_readdir = hyprlofs_readdir },
+ VOPNAME_SYMLINK, { .error = fs_error },
+ VOPNAME_READLINK, { .error = fs_error },
+ VOPNAME_FSYNC, { .vop_fsync = hyprlofs_fsync },
+ VOPNAME_INACTIVE, { .vop_inactive = hyprlofs_inactive },
+ VOPNAME_FID, { .vop_fid = hyprlofs_fid },
+ VOPNAME_RWLOCK, { .vop_rwlock = hyprlofs_rwlock },
+ VOPNAME_RWUNLOCK, { .vop_rwunlock = hyprlofs_rwunlock },
+ VOPNAME_SEEK, { .vop_seek = hyprlofs_seek },
+ VOPNAME_SPACE, { .vop_space = hyprlofs_space },
+ VOPNAME_GETPAGE, { .vop_getpage = hyprlofs_getpage },
+ VOPNAME_PUTPAGE, { .vop_putpage = hyprlofs_putpage },
+ VOPNAME_MAP, { .vop_map = hyprlofs_map },
+ VOPNAME_ADDMAP, { .vop_addmap = hyprlofs_addmap },
+ VOPNAME_DELMAP, { .vop_delmap = hyprlofs_delmap },
+ VOPNAME_PATHCONF, { .vop_pathconf = hyprlofs_pathconf },
+ VOPNAME_VNEVENT, { .vop_vnevent = fs_vnevent_support },
+ NULL, NULL
+};
diff --git a/usr/src/uts/common/fs/lxproc/lxpr_subr.c b/usr/src/uts/common/fs/lxproc/lxpr_subr.c
new file mode 100644
index 0000000000..3c1405d4af
--- /dev/null
+++ b/usr/src/uts/common/fs/lxproc/lxpr_subr.c
@@ -0,0 +1,524 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/varargs.h>
+#include <sys/cpuvar.h>
+#include <sys/mman.h>
+#include <sys/vmsystm.h>
+#include <sys/prsystm.h>
+
+#include "lxproc.h"
+
+#define LXPRCACHE_NAME "lxpr_cache"
+
+static int lxpr_node_constructor(void *, void *, int);
+static void lxpr_node_destructor(void *, void *);
+
+static kmem_cache_t *lxpr_node_cache;
+
+struct lxpr_uiobuf {
+ uio_t *uiop;
+ char *buffer;
+ uint32_t buffsize;
+ char *pos;
+ size_t beg;
+ int error;
+};
+
+int lxpr_bufsize = 4000;
+
+struct lxpr_uiobuf *
+lxpr_uiobuf_new(uio_t *uiop)
+{
+ /* Allocate memory for both lxpr_uiobuf and output buffer */
+ int bufsize = lxpr_bufsize;
+ struct lxpr_uiobuf *uiobuf =
+ kmem_alloc(sizeof (struct lxpr_uiobuf) + bufsize, KM_SLEEP);
+
+ uiobuf->uiop = uiop;
+ uiobuf->buffer = (char *)&uiobuf[1];
+ uiobuf->buffsize = bufsize;
+ uiobuf->pos = uiobuf->buffer;
+ uiobuf->beg = 0;
+ uiobuf->error = 0;
+
+ return (uiobuf);
+}
+
+void
+lxpr_uiobuf_free(struct lxpr_uiobuf *uiobuf)
+{
+ ASSERT(uiobuf != NULL);
+ ASSERT(uiobuf->pos == uiobuf->buffer);
+
+ kmem_free(uiobuf, sizeof (struct lxpr_uiobuf) + uiobuf->buffsize);
+}
+
+void
+lxpr_uiobuf_seek(struct lxpr_uiobuf *uiobuf, offset_t offset)
+{
+ uiobuf->uiop->uio_offset = (off_t)offset;
+}
+
+void
+lxpr_uiobuf_seterr(struct lxpr_uiobuf *uiobuf, int err)
+{
+ ASSERT(uiobuf->error == 0);
+
+ uiobuf->error = err;
+}
+
+int
+lxpr_uiobuf_flush(struct lxpr_uiobuf *uiobuf)
+{
+ off_t off = uiobuf->uiop->uio_offset;
+ caddr_t uaddr = uiobuf->buffer;
+ size_t beg = uiobuf->beg;
+ size_t size = (uintptr_t)uiobuf->pos - (uintptr_t)uaddr;
+
+ if (uiobuf->error == 0 && uiobuf->uiop->uio_resid != 0) {
+ ASSERT(off >= beg);
+
+ if (beg + size > off && off >= 0)
+ uiobuf->error =
+ uiomove(uaddr + (off - beg), size - (off - beg),
+ UIO_READ, uiobuf->uiop);
+
+ uiobuf->beg += size;
+ }
+
+ uiobuf->pos = uaddr;
+
+ return (uiobuf->error);
+}
+
+void
+lxpr_uiobuf_write(struct lxpr_uiobuf *uiobuf, const char *buf, size_t size)
+{
+ /* While we can still carry on */
+ while (uiobuf->error == 0 && uiobuf->uiop->uio_resid != 0) {
+ uintptr_t remain = (uintptr_t)uiobuf->buffsize -
+ ((uintptr_t)uiobuf->pos - (uintptr_t)uiobuf->buffer);
+
+ /* Enough space in buffer? */
+ if (remain >= size) {
+ bcopy(buf, uiobuf->pos, size);
+ uiobuf->pos += size;
+ return;
+ }
+
+ /* Not enough space, so copy all we can and try again */
+ bcopy(buf, uiobuf->pos, remain);
+ uiobuf->pos += remain;
+ (void) lxpr_uiobuf_flush(uiobuf);
+ buf += remain;
+ size -= remain;
+ }
+}
+
+#define TYPBUFFSIZE 256
+
+void
+lxpr_uiobuf_printf(struct lxpr_uiobuf *uiobuf, const char *fmt, ...)
+{
+ va_list args;
+ char buff[TYPBUFFSIZE];
+ int len;
+ char *buffer;
+
+ /* Can we still do any output */
+ if (uiobuf->error != 0 || uiobuf->uiop->uio_resid == 0)
+ return;
+
+ va_start(args, fmt);
+
+ /* Try using stack allocated buffer */
+ len = vsnprintf(buff, TYPBUFFSIZE, fmt, args);
+ if (len < TYPBUFFSIZE) {
+ va_end(args);
+ lxpr_uiobuf_write(uiobuf, buff, len);
+ return;
+ }
+
+ /* Not enough space in pre-allocated buffer */
+ buffer = kmem_alloc(len + 1, KM_SLEEP);
+
+ /*
+ * We know we allocated the correct amount of space
+ * so no check on the return value
+ */
+ (void) vsnprintf(buffer, len+1, fmt, args);
+ lxpr_uiobuf_write(uiobuf, buffer, len);
+ va_end(args);
+ kmem_free(buffer, len+1);
+}
+
+/*
+ * lxpr_lock():
+ *
+ * Lookup process from pid and return with p_plock and P_PR_LOCK held.
+ */
+proc_t *
+lxpr_lock(pid_t pid)
+{
+ proc_t *p;
+ kmutex_t *mp;
+
+ ASSERT(!MUTEX_HELD(&pidlock));
+
+ for (;;) {
+ mutex_enter(&pidlock);
+
+ /*
+ * If the pid is 1, we really want the zone's init process
+ */
+ p = prfind((pid == 1) ?
+ curproc->p_zone->zone_proc_initpid : pid);
+
+ if (p == NULL || p->p_stat == SIDL) {
+ mutex_exit(&pidlock);
+ return (NULL);
+ }
+
+ /*
+ * p_lock is persistent, but p itself is not -- it could
+ * vanish during cv_wait(). Load p->p_lock now so we can
+ * drop it after cv_wait() without referencing p.
+ */
+ mp = &p->p_lock;
+ mutex_enter(mp);
+
+ mutex_exit(&pidlock);
+
+ if (p->p_flag & SEXITING) {
+ /*
+ * This process is exiting -- let it go.
+ */
+ mutex_exit(mp);
+ return (NULL);
+ }
+
+ if (!(p->p_proc_flag & P_PR_LOCK))
+ break;
+
+ cv_wait(&pr_pid_cv[p->p_slot], mp);
+ mutex_exit(mp);
+ }
+
+ p->p_proc_flag |= P_PR_LOCK;
+ THREAD_KPRI_REQUEST();
+ return (p);
+}
+
+/*
+ * lxpr_unlock()
+ *
+ * Unlock locked process
+ */
+void
+lxpr_unlock(proc_t *p)
+{
+ ASSERT(p->p_proc_flag & P_PR_LOCK);
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ ASSERT(!MUTEX_HELD(&pidlock));
+
+ cv_signal(&pr_pid_cv[p->p_slot]);
+ p->p_proc_flag &= ~P_PR_LOCK;
+ mutex_exit(&p->p_lock);
+ THREAD_KPRI_RELEASE();
+}
+
+void
+lxpr_initnodecache()
+{
+ lxpr_node_cache = kmem_cache_create(LXPRCACHE_NAME,
+ sizeof (lxpr_node_t), 0,
+ lxpr_node_constructor, lxpr_node_destructor, NULL, NULL, NULL, 0);
+}
+
+void
+lxpr_fininodecache()
+{
+ kmem_cache_destroy(lxpr_node_cache);
+}
+
+/* ARGSUSED */
+static int
+lxpr_node_constructor(void *buf, void *un, int kmflags)
+{
+ lxpr_node_t *lxpnp = buf;
+ vnode_t *vp;
+
+ vp = lxpnp->lxpr_vnode = vn_alloc(kmflags);
+ if (vp == NULL)
+ return (-1);
+
+ (void) vn_setops(vp, lxpr_vnodeops);
+ vp->v_data = lxpnp;
+
+ return (0);
+}
+
+/* ARGSUSED */
+static void
+lxpr_node_destructor(void *buf, void *un)
+{
+ lxpr_node_t *lxpnp = buf;
+
+ vn_free(LXPTOV(lxpnp));
+}
+
+/*
+ * Calculate an inode number
+ *
+ * This takes various bits of info and munges them
+ * to give the inode number for an lxproc node
+ */
+ino_t
+lxpr_inode(lxpr_nodetype_t type, pid_t pid, int fd)
+{
+ if (pid == 1)
+ pid = curproc->p_zone->zone_proc_initpid;
+
+ switch (type) {
+ case LXPR_PIDDIR:
+ return (pid + 1);
+ case LXPR_PROCDIR:
+ return (maxpid + 2);
+ case LXPR_PID_FD_FD:
+ return (maxpid + 2 +
+ (pid * (LXPR_FD_PERPROC + LXPR_NFILES)) +
+ LXPR_NFILES + fd);
+ default:
+ return (maxpid + 2 +
+ (pid * (LXPR_FD_PERPROC + LXPR_NFILES)) +
+ type);
+ }
+}
+
+/*
+ * Return inode number of parent (directory)
+ */
+ino_t
+lxpr_parentinode(lxpr_node_t *lxpnp)
+{
+ /*
+ * If the input node is the root then the parent inode
+ * is the mounted on inode so just return our inode number
+ */
+ if (lxpnp->lxpr_type != LXPR_PROCDIR)
+ return (VTOLXP(lxpnp->lxpr_parent)->lxpr_ino);
+ else
+ return (lxpnp->lxpr_ino);
+}
+
+/*
+ * Allocate a new lxproc node
+ *
+ * This also allocates the vnode associated with it
+ */
+lxpr_node_t *
+lxpr_getnode(vnode_t *dp, lxpr_nodetype_t type, proc_t *p, int fd)
+{
+ lxpr_node_t *lxpnp;
+ vnode_t *vp;
+ user_t *up;
+ timestruc_t now;
+
+ /*
+ * Allocate a new node. It is deallocated in vop_innactive
+ */
+ lxpnp = kmem_cache_alloc(lxpr_node_cache, KM_SLEEP);
+
+ /*
+ * Set defaults (may be overridden below)
+ */
+ gethrestime(&now);
+ lxpnp->lxpr_type = type;
+ lxpnp->lxpr_realvp = NULL;
+ lxpnp->lxpr_parent = dp;
+ VN_HOLD(dp);
+ if (p != NULL) {
+ lxpnp->lxpr_pid = ((p->p_pid ==
+ curproc->p_zone->zone_proc_initpid) ? 1 : p->p_pid);
+
+ lxpnp->lxpr_time = PTOU(p)->u_start;
+ lxpnp->lxpr_uid = crgetruid(p->p_cred);
+ lxpnp->lxpr_gid = crgetrgid(p->p_cred);
+ lxpnp->lxpr_ino = lxpr_inode(type, p->p_pid, fd);
+ } else {
+ /* Pretend files without a proc belong to sched */
+ lxpnp->lxpr_pid = 0;
+ lxpnp->lxpr_time = now;
+ lxpnp->lxpr_uid = lxpnp->lxpr_gid = 0;
+ lxpnp->lxpr_ino = lxpr_inode(type, 0, 0);
+ }
+
+ /* initialize the vnode data */
+ vp = lxpnp->lxpr_vnode;
+ vn_reinit(vp);
+ vp->v_flag = VNOCACHE|VNOMAP|VNOSWAP|VNOMOUNT;
+ vp->v_vfsp = dp->v_vfsp;
+
+ /*
+ * Do node specific stuff
+ */
+ switch (type) {
+ case LXPR_PROCDIR:
+ vp->v_flag |= VROOT;
+ vp->v_type = VDIR;
+ lxpnp->lxpr_mode = 0555; /* read-search by everyone */
+ break;
+
+ case LXPR_PID_CURDIR:
+ ASSERT(p != NULL);
+
+ /*
+ * Zombie check. p_stat is officially protected by pidlock,
+ * but we can't grab pidlock here because we already hold
+ * p_lock. Luckily if we look at the process exit code
+ * we see that p_stat only transisions from SRUN to SZOMB
+ * while p_lock is held. Aside from this, the only other
+ * p_stat transition that we need to be aware about is
+ * SIDL to SRUN, but that's not a problem since lxpr_lock()
+ * ignores nodes in the SIDL state so we'll never get a node
+ * that isn't already in the SRUN state.
+ */
+ if (p->p_stat == SZOMB) {
+ lxpnp->lxpr_realvp = NULL;
+ } else {
+ up = PTOU(p);
+ lxpnp->lxpr_realvp = up->u_cdir;
+ ASSERT(lxpnp->lxpr_realvp != NULL);
+ VN_HOLD(lxpnp->lxpr_realvp);
+ }
+ vp->v_type = VLNK;
+ lxpnp->lxpr_mode = 0777; /* anyone does anything ! */
+ break;
+
+ case LXPR_PID_ROOTDIR:
+ ASSERT(p != NULL);
+ /* Zombie check. see locking comment above */
+ if (p->p_stat == SZOMB) {
+ lxpnp->lxpr_realvp = NULL;
+ } else {
+ up = PTOU(p);
+ lxpnp->lxpr_realvp =
+ up->u_rdir != NULL ? up->u_rdir : rootdir;
+ ASSERT(lxpnp->lxpr_realvp != NULL);
+ VN_HOLD(lxpnp->lxpr_realvp);
+ }
+ vp->v_type = VLNK;
+ lxpnp->lxpr_mode = 0777; /* anyone does anything ! */
+ break;
+
+ case LXPR_PID_EXE:
+ ASSERT(p != NULL);
+ lxpnp->lxpr_realvp = p->p_exec;
+ if (lxpnp->lxpr_realvp != NULL) {
+ VN_HOLD(lxpnp->lxpr_realvp);
+ }
+ vp->v_type = VLNK;
+ lxpnp->lxpr_mode = 0777;
+ break;
+
+ case LXPR_SELF:
+ vp->v_type = VLNK;
+ lxpnp->lxpr_mode = 0777; /* anyone does anything ! */
+ break;
+
+ case LXPR_PID_FD_FD:
+ ASSERT(p != NULL);
+ /* lxpr_realvp is set after we return */
+ vp->v_type = VLNK;
+ lxpnp->lxpr_mode = 0700; /* read-write-exe owner only */
+ break;
+
+ case LXPR_PID_FDDIR:
+ ASSERT(p != NULL);
+ vp->v_type = VDIR;
+ lxpnp->lxpr_mode = 0500; /* read-search by owner only */
+ break;
+
+ case LXPR_PIDDIR:
+ ASSERT(p != NULL);
+ vp->v_type = VDIR;
+ lxpnp->lxpr_mode = 0511;
+ break;
+
+ case LXPR_NETDIR:
+ vp->v_type = VDIR;
+ lxpnp->lxpr_mode = 0555; /* read-search by all */
+ break;
+
+ case LXPR_PID_ENV:
+ case LXPR_PID_MEM:
+ ASSERT(p != NULL);
+ /*FALLTHRU*/
+ case LXPR_KCORE:
+ vp->v_type = VREG;
+ lxpnp->lxpr_mode = 0400; /* read-only by owner only */
+ break;
+
+ default:
+ vp->v_type = VREG;
+ lxpnp->lxpr_mode = 0444; /* read-only by all */
+ break;
+ }
+
+ return (lxpnp);
+}
+
+
+/*
+ * Free the storage obtained from lxpr_getnode().
+ */
+void
+lxpr_freenode(lxpr_node_t *lxpnp)
+{
+ ASSERT(lxpnp != NULL);
+ ASSERT(LXPTOV(lxpnp) != NULL);
+
+ /*
+ * delete any association with realvp
+ */
+ if (lxpnp->lxpr_realvp != NULL)
+ VN_RELE(lxpnp->lxpr_realvp);
+
+ /*
+ * delete any association with parent vp
+ */
+ if (lxpnp->lxpr_parent != NULL)
+ VN_RELE(lxpnp->lxpr_parent);
+
+ /*
+ * Release the lxprnode.
+ */
+ kmem_cache_free(lxpr_node_cache, lxpnp);
+}
diff --git a/usr/src/uts/common/fs/lxproc/lxpr_vfsops.c b/usr/src/uts/common/fs/lxproc/lxpr_vfsops.c
new file mode 100644
index 0000000000..1bb7bd3823
--- /dev/null
+++ b/usr/src/uts/common/fs/lxproc/lxpr_vfsops.c
@@ -0,0 +1,367 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/cmn_err.h>
+#include <sys/cred.h>
+#include <sys/debug.h>
+#include <sys/errno.h>
+#include <sys/proc.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <sys/sysmacros.h>
+#include <sys/systm.h>
+#include <sys/var.h>
+#include <sys/vfs.h>
+#include <sys/vfs_opreg.h>
+#include <sys/vnode.h>
+#include <sys/mode.h>
+#include <sys/signal.h>
+#include <sys/user.h>
+#include <sys/mount.h>
+#include <sys/bitmap.h>
+#include <sys/kmem.h>
+#include <sys/policy.h>
+#include <sys/modctl.h>
+#include <sys/sunddi.h>
+#include <sys/sunldi.h>
+
+#include "lxproc.h"
+
+/* Module level parameters */
+static int lxprocfstype;
+static dev_t lxprocdev;
+static kmutex_t lxpr_mount_lock;
+
+int nproc_highbit; /* highbit(v.v_nproc) */
+
+static int lxpr_mount(vfs_t *, vnode_t *, mounta_t *, cred_t *);
+static int lxpr_unmount(vfs_t *, int, cred_t *);
+static int lxpr_root(vfs_t *, vnode_t **);
+static int lxpr_statvfs(vfs_t *, statvfs64_t *);
+static int lxpr_init(int, char *);
+
+static vfsdef_t vfw = {
+ VFSDEF_VERSION,
+ "lxproc",
+ lxpr_init,
+ VSW_ZMOUNT,
+ NULL
+};
+
+/*
+ * Module linkage information for the kernel.
+ */
+extern struct mod_ops mod_fsops;
+
+static struct modlfs modlfs = {
+ &mod_fsops, "generic linux procfs", &vfw
+};
+
+static struct modlinkage modlinkage = {
+ MODREV_1, (void *)&modlfs, NULL
+};
+
+int
+_init(void)
+{
+ return (mod_install(&modlinkage));
+}
+
+int
+_info(struct modinfo *modinfop)
+{
+ return (mod_info(&modlinkage, modinfop));
+}
+
+int
+_fini(void)
+{
+ int retval;
+
+ /*
+ * attempt to unload the module
+ */
+ if ((retval = mod_remove(&modlinkage)) != 0)
+ goto done;
+
+ /*
+ * destroy lxpr_node cache
+ */
+ lxpr_fininodecache();
+
+ /*
+ * clean out the vfsops and vnodeops
+ */
+ (void) vfs_freevfsops_by_type(lxprocfstype);
+ vn_freevnodeops(lxpr_vnodeops);
+
+ mutex_destroy(&lxpr_mount_lock);
+done:
+ return (retval);
+}
+
+static int
+lxpr_init(int fstype, char *name)
+{
+ static const fs_operation_def_t lxpr_vfsops_template[] = {
+ VFSNAME_MOUNT, { .vfs_mount = lxpr_mount },
+ VFSNAME_UNMOUNT, { .vfs_unmount = lxpr_unmount },
+ VFSNAME_ROOT, { .vfs_root = lxpr_root },
+ VFSNAME_STATVFS, { .vfs_statvfs = lxpr_statvfs },
+ NULL, NULL
+ };
+ extern const fs_operation_def_t lxpr_vnodeops_template[];
+ int error;
+ major_t dev;
+
+ nproc_highbit = highbit(v.v_proc);
+ lxprocfstype = fstype;
+ ASSERT(lxprocfstype != 0);
+
+ mutex_init(&lxpr_mount_lock, NULL, MUTEX_DEFAULT, NULL);
+
+ /*
+ * Associate VFS ops vector with this fstype.
+ */
+ error = vfs_setfsops(fstype, lxpr_vfsops_template, NULL);
+ if (error != 0) {
+ cmn_err(CE_WARN, "lxpr_init: bad vfs ops template");
+ return (error);
+ }
+
+ /*
+ * Set up vnode ops vector too.
+ */
+ error = vn_make_ops(name, lxpr_vnodeops_template, &lxpr_vnodeops);
+ if (error != 0) {
+ (void) vfs_freevfsops_by_type(fstype);
+ cmn_err(CE_WARN, "lxpr_init: bad vnode ops template");
+ return (error);
+ }
+
+ /*
+ * Assign a unique "device" number (used by stat(2)).
+ */
+ if ((dev = getudev()) == (major_t)-1) {
+ cmn_err(CE_WARN, "lxpr_init: can't get unique device number");
+ dev = 0;
+ }
+
+ /*
+ * Make the pseudo device
+ */
+ lxprocdev = makedevice(dev, 0);
+
+ /*
+ * Initialize cache for lxpr_nodes
+ */
+ lxpr_initnodecache();
+
+ return (0);
+}
+
+static int
+lxpr_mount(vfs_t *vfsp, vnode_t *mvp, mounta_t *uap, cred_t *cr)
+{
+ lxpr_mnt_t *lxpr_mnt;
+ zone_t *zone = curproc->p_zone;
+ ldi_ident_t li;
+ int err;
+
+ /*
+ * must be root to mount
+ */
+ if (secpolicy_fs_mount(cr, mvp, vfsp) != 0)
+ return (EPERM);
+
+ /*
+ * mount point must be a directory
+ */
+ if (mvp->v_type != VDIR)
+ return (ENOTDIR);
+
+ if (zone == global_zone) {
+ zone_t *mntzone;
+
+ mntzone = zone_find_by_path(refstr_value(vfsp->vfs_mntpt));
+ zone_rele(mntzone);
+ if (zone != mntzone)
+ return (EBUSY);
+ }
+
+ /*
+ * Having the resource be anything but "lxproc" doesn't make sense
+ */
+ vfs_setresource(vfsp, "lxproc", 0);
+
+ lxpr_mnt = kmem_alloc(sizeof (*lxpr_mnt), KM_SLEEP);
+
+ if ((err = ldi_ident_from_mod(&modlinkage, &li)) != 0) {
+ kmem_free(lxpr_mnt, sizeof (*lxpr_mnt));
+ return (err);
+ }
+
+ lxpr_mnt->lxprm_li = li;
+
+ mutex_enter(&lxpr_mount_lock);
+
+ /*
+ * Ensure we don't allow overlaying mounts
+ */
+ mutex_enter(&mvp->v_lock);
+ if ((uap->flags & MS_OVERLAY) == 0 &&
+ (mvp->v_count > 1 || (mvp->v_flag & VROOT))) {
+ mutex_exit(&mvp->v_lock);
+ mutex_exit(&lxpr_mount_lock);
+ kmem_free(lxpr_mnt, sizeof ((*lxpr_mnt)));
+ return (EBUSY);
+ }
+ mutex_exit(&mvp->v_lock);
+
+ /*
+ * allocate the first vnode
+ */
+ zone_hold(lxpr_mnt->lxprm_zone = zone);
+
+ /* Arbitrarily set the parent vnode to the mounted over directory */
+ lxpr_mnt->lxprm_node = lxpr_getnode(mvp, LXPR_PROCDIR, NULL, 0);
+
+ /* Correctly set the fs for the root node */
+ lxpr_mnt->lxprm_node->lxpr_vnode->v_vfsp = vfsp;
+
+ vfs_make_fsid(&vfsp->vfs_fsid, lxprocdev, lxprocfstype);
+ vfsp->vfs_bsize = DEV_BSIZE;
+ vfsp->vfs_fstype = lxprocfstype;
+ vfsp->vfs_data = (caddr_t)lxpr_mnt;
+ vfsp->vfs_dev = lxprocdev;
+
+ mutex_exit(&lxpr_mount_lock);
+
+ return (0);
+}
+
+static int
+lxpr_unmount(vfs_t *vfsp, int flag, cred_t *cr)
+{
+ lxpr_mnt_t *lxpr_mnt = (lxpr_mnt_t *)vfsp->vfs_data;
+ vnode_t *vp;
+ int count;
+
+ ASSERT(lxpr_mnt != NULL);
+ vp = LXPTOV(lxpr_mnt->lxprm_node);
+
+ mutex_enter(&lxpr_mount_lock);
+
+ /*
+ * must be root to unmount
+ */
+ if (secpolicy_fs_unmount(cr, vfsp) != 0) {
+ mutex_exit(&lxpr_mount_lock);
+ return (EPERM);
+ }
+
+ /*
+ * forced unmount is not supported by this file system
+ */
+ if (flag & MS_FORCE) {
+ mutex_exit(&lxpr_mount_lock);
+ return (ENOTSUP);
+ }
+
+ /*
+ * Ensure that no vnodes are in use on this mount point.
+ */
+ mutex_enter(&vp->v_lock);
+ count = vp->v_count;
+ mutex_exit(&vp->v_lock);
+ if (count > 1) {
+ mutex_exit(&lxpr_mount_lock);
+ return (EBUSY);
+ }
+
+ /*
+ * purge the dnlc cache for vnode entries
+ * associated with this file system
+ */
+ count = dnlc_purge_vfsp(vfsp, 0);
+
+ /*
+ * free up the lxprnode
+ */
+ lxpr_freenode(lxpr_mnt->lxprm_node);
+ zone_rele(lxpr_mnt->lxprm_zone);
+ kmem_free(lxpr_mnt, sizeof (*lxpr_mnt));
+
+ mutex_exit(&lxpr_mount_lock);
+
+ return (0);
+}
+
+static int
+lxpr_root(vfs_t *vfsp, vnode_t **vpp)
+{
+ lxpr_node_t *lxpnp = ((lxpr_mnt_t *)vfsp->vfs_data)->lxprm_node;
+ vnode_t *vp = LXPTOV(lxpnp);
+
+ VN_HOLD(vp);
+ *vpp = vp;
+ return (0);
+}
+
+static int
+lxpr_statvfs(vfs_t *vfsp, statvfs64_t *sp)
+{
+ int n;
+ dev32_t d32;
+ extern uint_t nproc;
+
+ n = v.v_proc - nproc;
+
+ bzero((caddr_t)sp, sizeof (*sp));
+ sp->f_bsize = DEV_BSIZE;
+ sp->f_frsize = DEV_BSIZE;
+ sp->f_blocks = (fsblkcnt64_t)0;
+ sp->f_bfree = (fsblkcnt64_t)0;
+ sp->f_bavail = (fsblkcnt64_t)0;
+ sp->f_files = (fsfilcnt64_t)v.v_proc + 2;
+ sp->f_ffree = (fsfilcnt64_t)n;
+ sp->f_favail = (fsfilcnt64_t)n;
+ (void) cmpldev(&d32, vfsp->vfs_dev);
+ sp->f_fsid = d32;
+ /* It is guaranteed that vsw_name will fit in f_basetype */
+ (void) strcpy(sp->f_basetype, vfssw[lxprocfstype].vsw_name);
+ sp->f_flag = vf_to_stf(vfsp->vfs_flag);
+ sp->f_namemax = 64; /* quite arbitrary */
+
+ (void) strcpy(sp->f_fstr, "lxproc");
+
+ return (0);
+}
diff --git a/usr/src/uts/common/fs/lxproc/lxpr_vnops.c b/usr/src/uts/common/fs/lxproc/lxpr_vnops.c
new file mode 100644
index 0000000000..fc4de9f370
--- /dev/null
+++ b/usr/src/uts/common/fs/lxproc/lxpr_vnops.c
@@ -0,0 +1,3092 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * lxproc -- a loosely Linux-compatible /proc
+ *
+ * The aspiration here is to provide something that sufficiently approximates
+ * the Linux /proc implementation for purposes of offering some compatibility
+ * for simple Linux /proc readers (e.g., ps/top/htop). However, it is not
+ * intended to exactly mimic Linux semantics; when choosing between offering
+ * compatibility and telling the truth, we emphatically pick the truth. A
+ * particular glaring example of this is the Linux notion of "tasks" (that is,
+ * threads), which -- due to historical misadventures on Linux -- allocate their
+ * identifiers from the process identifier space. (That is, each thread has in
+ * effect a pid.) Some Linux /proc readers have come to depend on this
+ * attribute, and become confused when threads appear with proper identifiers,
+ * so we simply opt for the pre-2.6 behavior, and do not present the tasks
+ * directory at all. Similarly, when choosing between offering compatibility
+ * and remaining consistent with our broader security model, we (obviously)
+ * choose security over compatibility. In short, this is meant to be a best
+ * effort -- no more.
+ */
+
+#include <sys/cpupart.h>
+#include <sys/cpuvar.h>
+#include <sys/session.h>
+#include <sys/vmparam.h>
+#include <sys/mman.h>
+#include <vm/rm.h>
+#include <vm/seg_vn.h>
+#include <sys/sdt.h>
+#include <sys/strlog.h>
+#include <sys/stropts.h>
+#include <sys/cmn_err.h>
+#include <sys/x86_archext.h>
+#include <sys/archsystm.h>
+#include <sys/fp.h>
+#include <sys/pool_pset.h>
+#include <sys/pset.h>
+#include <sys/zone.h>
+#include <sys/pghw.h>
+#include <sys/vfs_opreg.h>
+
+/* Dependent on procfs */
+extern kthread_t *prchoose(proc_t *);
+
+#include "lxproc.h"
+
+extern pgcnt_t swapfs_minfree;
+extern time_t boot_time;
+
+/*
+ * Pointer to the vnode ops vector for this fs.
+ * This is instantiated in lxprinit() in lxpr_vfsops.c
+ */
+vnodeops_t *lxpr_vnodeops;
+
+static int lxpr_open(vnode_t **, int, cred_t *, caller_context_t *);
+static int lxpr_close(vnode_t *, int, int, offset_t, cred_t *,
+ caller_context_t *);
+static int lxpr_read(vnode_t *, uio_t *, int, cred_t *, caller_context_t *);
+static int lxpr_getattr(vnode_t *, vattr_t *, int, cred_t *,
+ caller_context_t *);
+static int lxpr_access(vnode_t *, int, int, cred_t *, caller_context_t *);
+static int lxpr_lookup(vnode_t *, char *, vnode_t **,
+ pathname_t *, int, vnode_t *, cred_t *, caller_context_t *, int *,
+ pathname_t *);
+static int lxpr_readdir(vnode_t *, uio_t *, cred_t *, int *,
+ caller_context_t *, int);
+static int lxpr_readlink(vnode_t *, uio_t *, cred_t *, caller_context_t *);
+static int lxpr_cmp(vnode_t *, vnode_t *, caller_context_t *);
+static int lxpr_realvp(vnode_t *, vnode_t **, caller_context_t *);
+static int lxpr_sync(void);
+static void lxpr_inactive(vnode_t *, cred_t *, caller_context_t *);
+
+static vnode_t *lxpr_lookup_procdir(vnode_t *, char *);
+static vnode_t *lxpr_lookup_piddir(vnode_t *, char *);
+static vnode_t *lxpr_lookup_not_a_dir(vnode_t *, char *);
+static vnode_t *lxpr_lookup_fddir(vnode_t *, char *);
+static vnode_t *lxpr_lookup_netdir(vnode_t *, char *);
+
+static int lxpr_readdir_procdir(lxpr_node_t *, uio_t *, int *);
+static int lxpr_readdir_piddir(lxpr_node_t *, uio_t *, int *);
+static int lxpr_readdir_not_a_dir(lxpr_node_t *, uio_t *, int *);
+static int lxpr_readdir_fddir(lxpr_node_t *, uio_t *, int *);
+static int lxpr_readdir_netdir(lxpr_node_t *, uio_t *, int *);
+
+static void lxpr_read_invalid(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_empty(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_cpuinfo(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_isdir(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_fd(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_kmsg(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_loadavg(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_meminfo(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_mounts(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_partitions(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_stat(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_uptime(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_version(lxpr_node_t *, lxpr_uiobuf_t *);
+
+static void lxpr_read_pid_cmdline(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_pid_maps(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_pid_stat(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_pid_statm(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_pid_status(lxpr_node_t *, lxpr_uiobuf_t *);
+
+static void lxpr_read_net_arp(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_dev(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_dev_mcast(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_igmp(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_ip_mr_cache(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_ip_mr_vif(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_mcfilter(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_netstat(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_raw(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_route(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_rpc(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_rt_cache(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_sockstat(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_snmp(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_stat(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_tcp(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_udp(lxpr_node_t *, lxpr_uiobuf_t *);
+static void lxpr_read_net_unix(lxpr_node_t *, lxpr_uiobuf_t *);
+
+/*
+ * Simple conversion
+ */
+#define btok(x) ((x) >> 10) /* bytes to kbytes */
+#define ptok(x) ((x) << (PAGESHIFT - 10)) /* pages to kbytes */
+
+/*
+ * The lxproc vnode operations vector
+ */
+const fs_operation_def_t lxpr_vnodeops_template[] = {
+ VOPNAME_OPEN, { .vop_open = lxpr_open },
+ VOPNAME_CLOSE, { .vop_close = lxpr_close },
+ VOPNAME_READ, { .vop_read = lxpr_read },
+ VOPNAME_GETATTR, { .vop_getattr = lxpr_getattr },
+ VOPNAME_ACCESS, { .vop_access = lxpr_access },
+ VOPNAME_LOOKUP, { .vop_lookup = lxpr_lookup },
+ VOPNAME_READDIR, { .vop_readdir = lxpr_readdir },
+ VOPNAME_READLINK, { .vop_readlink = lxpr_readlink },
+ VOPNAME_FSYNC, { .error = lxpr_sync },
+ VOPNAME_SEEK, { .error = lxpr_sync },
+ VOPNAME_INACTIVE, { .vop_inactive = lxpr_inactive },
+ VOPNAME_CMP, { .vop_cmp = lxpr_cmp },
+ VOPNAME_REALVP, { .vop_realvp = lxpr_realvp },
+ NULL, NULL
+};
+
+/*
+ * file contents of an lxproc directory.
+ */
+static lxpr_dirent_t lxpr_dir[] = {
+ { LXPR_CMDLINE, "cmdline" },
+ { LXPR_CPUINFO, "cpuinfo" },
+ { LXPR_DEVICES, "devices" },
+ { LXPR_DMA, "dma" },
+ { LXPR_FILESYSTEMS, "filesystems" },
+ { LXPR_INTERRUPTS, "interrupts" },
+ { LXPR_IOPORTS, "ioports" },
+ { LXPR_KCORE, "kcore" },
+ { LXPR_KMSG, "kmsg" },
+ { LXPR_LOADAVG, "loadavg" },
+ { LXPR_MEMINFO, "meminfo" },
+ { LXPR_MOUNTS, "mounts" },
+ { LXPR_NETDIR, "net" },
+ { LXPR_PARTITIONS, "partitions" },
+ { LXPR_SELF, "self" },
+ { LXPR_STAT, "stat" },
+ { LXPR_UPTIME, "uptime" },
+ { LXPR_VERSION, "version" }
+};
+
+#define PROCDIRFILES (sizeof (lxpr_dir) / sizeof (lxpr_dir[0]))
+
+/*
+ * Contents of an /lxproc/<pid> directory.
+ */
+static lxpr_dirent_t piddir[] = {
+ { LXPR_PID_CMDLINE, "cmdline" },
+ { LXPR_PID_CPU, "cpu" },
+ { LXPR_PID_CURDIR, "cwd" },
+ { LXPR_PID_ENV, "environ" },
+ { LXPR_PID_EXE, "exe" },
+ { LXPR_PID_MAPS, "maps" },
+ { LXPR_PID_MEM, "mem" },
+ { LXPR_PID_ROOTDIR, "root" },
+ { LXPR_PID_STAT, "stat" },
+ { LXPR_PID_STATM, "statm" },
+ { LXPR_PID_STATUS, "status" },
+ { LXPR_PID_FDDIR, "fd" }
+};
+
+#define PIDDIRFILES (sizeof (piddir) / sizeof (piddir[0]))
+
+/*
+ * contents of /lxproc/net directory
+ */
+static lxpr_dirent_t netdir[] = {
+ { LXPR_NET_ARP, "arp" },
+ { LXPR_NET_DEV, "dev" },
+ { LXPR_NET_DEV_MCAST, "dev_mcast" },
+ { LXPR_NET_IGMP, "igmp" },
+ { LXPR_NET_IP_MR_CACHE, "ip_mr_cache" },
+ { LXPR_NET_IP_MR_VIF, "ip_mr_vif" },
+ { LXPR_NET_MCFILTER, "mcfilter" },
+ { LXPR_NET_NETSTAT, "netstat" },
+ { LXPR_NET_RAW, "raw" },
+ { LXPR_NET_ROUTE, "route" },
+ { LXPR_NET_RPC, "rpc" },
+ { LXPR_NET_RT_CACHE, "rt_cache" },
+ { LXPR_NET_SOCKSTAT, "sockstat" },
+ { LXPR_NET_SNMP, "snmp" },
+ { LXPR_NET_STAT, "stat" },
+ { LXPR_NET_TCP, "tcp" },
+ { LXPR_NET_UDP, "udp" },
+ { LXPR_NET_UNIX, "unix" }
+};
+
+#define NETDIRFILES (sizeof (netdir) / sizeof (netdir[0]))
+
+/*
+ * These are the major signal number differences between Linux and native:
+ *
+ * ====================================
+ * | Number | Linux | Native |
+ * | ====== | ========= | ========== |
+ * | 7 | SIGBUS | SIGEMT |
+ * | 10 | SIGUSR1 | SIGBUS |
+ * | 12 | SIGUSR2 | SIGSYS |
+ * | 16 | SIGSTKFLT | SIGUSR1 |
+ * | 17 | SIGCHLD | SIGUSR2 |
+ * | 18 | SIGCONT | SIGCHLD |
+ * | 19 | SIGSTOP | SIGPWR |
+ * | 20 | SIGTSTP | SIGWINCH |
+ * | 21 | SIGTTIN | SIGURG |
+ * | 22 | SIGTTOU | SIGPOLL |
+ * | 23 | SIGURG | SIGSTOP |
+ * | 24 | SIGXCPU | SIGTSTP |
+ * | 25 | SIGXFSZ | SIGCONT |
+ * | 26 | SIGVTALARM | SIGTTIN |
+ * | 27 | SIGPROF | SIGTTOU |
+ * | 28 | SIGWINCH | SIGVTALARM |
+ * | 29 | SIGPOLL | SIGPROF |
+ * | 30 | SIGPWR | SIGXCPU |
+ * | 31 | SIGSYS | SIGXFSZ |
+ * ====================================
+ *
+ * Not every Linux signal maps to a native signal, nor does every native
+ * signal map to a Linux counterpart. However, when signals do map, the
+ * mapping is unique.
+ */
+static int
+lxpr_sigmap[NSIG] = {
+ 0,
+ LX_SIGHUP,
+ LX_SIGINT,
+ LX_SIGQUIT,
+ LX_SIGILL,
+ LX_SIGTRAP,
+ LX_SIGABRT,
+ LX_SIGSTKFLT,
+ LX_SIGFPE,
+ LX_SIGKILL,
+ LX_SIGBUS,
+ LX_SIGSEGV,
+ LX_SIGSYS,
+ LX_SIGPIPE,
+ LX_SIGALRM,
+ LX_SIGTERM,
+ LX_SIGUSR1,
+ LX_SIGUSR2,
+ LX_SIGCHLD,
+ LX_SIGPWR,
+ LX_SIGWINCH,
+ LX_SIGURG,
+ LX_SIGPOLL,
+ LX_SIGSTOP,
+ LX_SIGTSTP,
+ LX_SIGCONT,
+ LX_SIGTTIN,
+ LX_SIGTTOU,
+ LX_SIGVTALRM,
+ LX_SIGPROF,
+ LX_SIGXCPU,
+ LX_SIGXFSZ,
+ -1, /* 32: illumos SIGWAITING */
+ -1, /* 33: illumos SIGLWP */
+ -1, /* 34: illumos SIGFREEZE */
+ -1, /* 35: illumos SIGTHAW */
+ -1, /* 36: illumos SIGCANCEL */
+ -1, /* 37: illumos SIGLOST */
+ -1, /* 38: illumos SIGXRES */
+ -1, /* 39: illumos SIGJVM1 */
+ -1, /* 40: illumos SIGJVM2 */
+ LX_SIGRTMIN, /* 41: illumos _SIGRTMIN */
+ LX_SIGRTMIN + 1,
+ LX_SIGRTMIN + 2,
+ LX_SIGRTMIN + 3,
+ LX_SIGRTMIN + 4,
+ LX_SIGRTMIN + 5,
+ LX_SIGRTMIN + 6,
+ LX_SIGRTMIN + 7,
+ LX_SIGRTMIN + 8,
+ LX_SIGRTMIN + 9,
+ LX_SIGRTMIN + 10,
+ LX_SIGRTMIN + 11,
+ LX_SIGRTMIN + 12,
+ LX_SIGRTMIN + 13,
+ LX_SIGRTMIN + 14,
+ LX_SIGRTMIN + 15,
+ LX_SIGRTMIN + 16,
+ LX_SIGRTMIN + 17,
+ LX_SIGRTMIN + 18,
+ LX_SIGRTMIN + 19,
+ LX_SIGRTMIN + 20,
+ LX_SIGRTMIN + 21,
+ LX_SIGRTMIN + 22,
+ LX_SIGRTMIN + 23,
+ LX_SIGRTMIN + 24,
+ LX_SIGRTMIN + 25,
+ LX_SIGRTMIN + 26,
+ LX_SIGRTMIN + 27,
+ LX_SIGRTMIN + 28,
+ LX_SIGRTMIN + 29,
+ LX_SIGRTMIN + 30,
+ LX_SIGRTMAX,
+};
+
+/*
+ * lxpr_open(): Vnode operation for VOP_OPEN()
+ */
+static int
+lxpr_open(vnode_t **vpp, int flag, cred_t *cr, caller_context_t *ct)
+{
+ vnode_t *vp = *vpp;
+ lxpr_node_t *lxpnp = VTOLXP(vp);
+ lxpr_nodetype_t type = lxpnp->lxpr_type;
+ vnode_t *rvp;
+ int error = 0;
+
+ /*
+ * We only allow reading in this file systrem
+ */
+ if (flag & FWRITE)
+ return (EROFS);
+
+ /*
+ * If we are opening an underlying file only allow regular files
+ * reject the open for anything but a regular file.
+ * Just do it if we are opening the current or root directory.
+ */
+ if (lxpnp->lxpr_realvp != NULL) {
+ rvp = lxpnp->lxpr_realvp;
+
+ if (type == LXPR_PID_FD_FD && rvp->v_type != VREG)
+ error = EACCES;
+ else {
+ /*
+ * Need to hold rvp since VOP_OPEN() may release it.
+ */
+ VN_HOLD(rvp);
+ error = VOP_OPEN(&rvp, flag, cr, ct);
+ if (error) {
+ VN_RELE(rvp);
+ } else {
+ *vpp = rvp;
+ VN_RELE(vp);
+ }
+ }
+ }
+
+ if (type == LXPR_KMSG) {
+ ldi_ident_t li = VTOLXPM(vp)->lxprm_li;
+ struct strioctl str;
+ int rv;
+
+ /*
+ * Open the zone's console device using the layered driver
+ * interface.
+ */
+ if ((error = ldi_open_by_name("/dev/log", FREAD, cr,
+ &lxpnp->lxpr_cons_ldih, li)) != 0)
+ return (error);
+
+ /*
+ * Send an ioctl to the underlying console device, letting it
+ * know we're interested in getting console messages.
+ */
+ str.ic_cmd = I_CONSLOG;
+ str.ic_timout = 0;
+ str.ic_len = 0;
+ str.ic_dp = NULL;
+ if ((error = ldi_ioctl(lxpnp->lxpr_cons_ldih, I_STR,
+ (intptr_t)&str, FKIOCTL, cr, &rv)) != 0)
+ return (error);
+ }
+
+ return (error);
+}
+
+
+/*
+ * lxpr_close(): Vnode operation for VOP_CLOSE()
+ */
+/* ARGSUSED */
+static int
+lxpr_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr,
+ caller_context_t *ct)
+{
+ lxpr_node_t *lxpr = VTOLXP(vp);
+ lxpr_nodetype_t type = lxpr->lxpr_type;
+ int err;
+
+ /*
+ * we should never get here because the close is done on the realvp
+ * for these nodes
+ */
+ ASSERT(type != LXPR_PID_FD_FD &&
+ type != LXPR_PID_CURDIR &&
+ type != LXPR_PID_ROOTDIR &&
+ type != LXPR_PID_EXE);
+
+ if (type == LXPR_KMSG) {
+ if ((err = ldi_close(lxpr->lxpr_cons_ldih, 0, cr)) != 0)
+ return (err);
+ }
+
+ return (0);
+}
+
+static void (*lxpr_read_function[LXPR_NFILES])() = {
+ lxpr_read_isdir, /* /proc */
+ lxpr_read_isdir, /* /proc/<pid> */
+ lxpr_read_pid_cmdline, /* /proc/<pid>/cmdline */
+ lxpr_read_empty, /* /proc/<pid>/cpu */
+ lxpr_read_invalid, /* /proc/<pid>/cwd */
+ lxpr_read_empty, /* /proc/<pid>/environ */
+ lxpr_read_invalid, /* /proc/<pid>/exe */
+ lxpr_read_pid_maps, /* /proc/<pid>/maps */
+ lxpr_read_empty, /* /proc/<pid>/mem */
+ lxpr_read_invalid, /* /proc/<pid>/root */
+ lxpr_read_pid_stat, /* /proc/<pid>/stat */
+ lxpr_read_pid_statm, /* /proc/<pid>/statm */
+ lxpr_read_pid_status, /* /proc/<pid>/status */
+ lxpr_read_isdir, /* /proc/<pid>/fd */
+ lxpr_read_fd, /* /proc/<pid>/fd/nn */
+ lxpr_read_empty, /* /proc/cmdline */
+ lxpr_read_cpuinfo, /* /proc/cpuinfo */
+ lxpr_read_empty, /* /proc/devices */
+ lxpr_read_empty, /* /proc/dma */
+ lxpr_read_empty, /* /proc/filesystems */
+ lxpr_read_empty, /* /proc/interrupts */
+ lxpr_read_empty, /* /proc/ioports */
+ lxpr_read_empty, /* /proc/kcore */
+ lxpr_read_kmsg, /* /proc/kmsg */
+ lxpr_read_loadavg, /* /proc/loadavg */
+ lxpr_read_meminfo, /* /proc/meminfo */
+ lxpr_read_mounts, /* /proc/mounts */
+ lxpr_read_isdir, /* /proc/net */
+ lxpr_read_net_arp, /* /proc/net/arp */
+ lxpr_read_net_dev, /* /proc/net/dev */
+ lxpr_read_net_dev_mcast, /* /proc/net/dev_mcast */
+ lxpr_read_net_igmp, /* /proc/net/igmp */
+ lxpr_read_net_ip_mr_cache, /* /proc/net/ip_mr_cache */
+ lxpr_read_net_ip_mr_vif, /* /proc/net/ip_mr_vif */
+ lxpr_read_net_mcfilter, /* /proc/net/mcfilter */
+ lxpr_read_net_netstat, /* /proc/net/netstat */
+ lxpr_read_net_raw, /* /proc/net/raw */
+ lxpr_read_net_route, /* /proc/net/route */
+ lxpr_read_net_rpc, /* /proc/net/rpc */
+ lxpr_read_net_rt_cache, /* /proc/net/rt_cache */
+ lxpr_read_net_sockstat, /* /proc/net/sockstat */
+ lxpr_read_net_snmp, /* /proc/net/snmp */
+ lxpr_read_net_stat, /* /proc/net/stat */
+ lxpr_read_net_tcp, /* /proc/net/tcp */
+ lxpr_read_net_udp, /* /proc/net/udp */
+ lxpr_read_net_unix, /* /proc/net/unix */
+ lxpr_read_partitions, /* /proc/partitions */
+ lxpr_read_invalid, /* /proc/self */
+ lxpr_read_stat, /* /proc/stat */
+ lxpr_read_uptime, /* /proc/uptime */
+ lxpr_read_version, /* /proc/version */
+};
+
+/*
+ * Array of lookup functions, indexed by /lxproc file type.
+ */
+static vnode_t *(*lxpr_lookup_function[LXPR_NFILES])() = {
+ lxpr_lookup_procdir, /* /proc */
+ lxpr_lookup_piddir, /* /proc/<pid> */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/cmdline */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/cpu */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/cwd */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/environ */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/exe */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/maps */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/mem */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/root */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/stat */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/statm */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/status */
+ lxpr_lookup_fddir, /* /proc/<pid>/fd */
+ lxpr_lookup_not_a_dir, /* /proc/<pid>/fd/nn */
+ lxpr_lookup_not_a_dir, /* /proc/cmdline */
+ lxpr_lookup_not_a_dir, /* /proc/cpuinfo */
+ lxpr_lookup_not_a_dir, /* /proc/devices */
+ lxpr_lookup_not_a_dir, /* /proc/dma */
+ lxpr_lookup_not_a_dir, /* /proc/filesystems */
+ lxpr_lookup_not_a_dir, /* /proc/interrupts */
+ lxpr_lookup_not_a_dir, /* /proc/ioports */
+ lxpr_lookup_not_a_dir, /* /proc/kcore */
+ lxpr_lookup_not_a_dir, /* /proc/kmsg */
+ lxpr_lookup_not_a_dir, /* /proc/loadavg */
+ lxpr_lookup_not_a_dir, /* /proc/meminfo */
+ lxpr_lookup_not_a_dir, /* /proc/mounts */
+ lxpr_lookup_netdir, /* /proc/net */
+ lxpr_lookup_not_a_dir, /* /proc/net/arp */
+ lxpr_lookup_not_a_dir, /* /proc/net/dev */
+ lxpr_lookup_not_a_dir, /* /proc/net/dev_mcast */
+ lxpr_lookup_not_a_dir, /* /proc/net/igmp */
+ lxpr_lookup_not_a_dir, /* /proc/net/ip_mr_cache */
+ lxpr_lookup_not_a_dir, /* /proc/net/ip_mr_vif */
+ lxpr_lookup_not_a_dir, /* /proc/net/mcfilter */
+ lxpr_lookup_not_a_dir, /* /proc/net/netstat */
+ lxpr_lookup_not_a_dir, /* /proc/net/raw */
+ lxpr_lookup_not_a_dir, /* /proc/net/route */
+ lxpr_lookup_not_a_dir, /* /proc/net/rpc */
+ lxpr_lookup_not_a_dir, /* /proc/net/rt_cache */
+ lxpr_lookup_not_a_dir, /* /proc/net/sockstat */
+ lxpr_lookup_not_a_dir, /* /proc/net/snmp */
+ lxpr_lookup_not_a_dir, /* /proc/net/stat */
+ lxpr_lookup_not_a_dir, /* /proc/net/tcp */
+ lxpr_lookup_not_a_dir, /* /proc/net/udp */
+ lxpr_lookup_not_a_dir, /* /proc/net/unix */
+ lxpr_lookup_not_a_dir, /* /proc/partitions */
+ lxpr_lookup_not_a_dir, /* /proc/self */
+ lxpr_lookup_not_a_dir, /* /proc/stat */
+ lxpr_lookup_not_a_dir, /* /proc/uptime */
+ lxpr_lookup_not_a_dir, /* /proc/version */
+};
+
+/*
+ * Array of readdir functions, indexed by /proc file type.
+ */
+static int (*lxpr_readdir_function[LXPR_NFILES])() = {
+ lxpr_readdir_procdir, /* /proc */
+ lxpr_readdir_piddir, /* /proc/<pid> */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/cmdline */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/cpu */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/cwd */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/environ */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/exe */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/maps */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/mem */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/root */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/stat */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/statm */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/status */
+ lxpr_readdir_fddir, /* /proc/<pid>/fd */
+ lxpr_readdir_not_a_dir, /* /proc/<pid>/fd/nn */
+ lxpr_readdir_not_a_dir, /* /proc/cmdline */
+ lxpr_readdir_not_a_dir, /* /proc/cpuinfo */
+ lxpr_readdir_not_a_dir, /* /proc/devices */
+ lxpr_readdir_not_a_dir, /* /proc/dma */
+ lxpr_readdir_not_a_dir, /* /proc/filesystems */
+ lxpr_readdir_not_a_dir, /* /proc/interrupts */
+ lxpr_readdir_not_a_dir, /* /proc/ioports */
+ lxpr_readdir_not_a_dir, /* /proc/kcore */
+ lxpr_readdir_not_a_dir, /* /proc/kmsg */
+ lxpr_readdir_not_a_dir, /* /proc/loadavg */
+ lxpr_readdir_not_a_dir, /* /proc/meminfo */
+ lxpr_readdir_not_a_dir, /* /proc/mounts */
+ lxpr_readdir_netdir, /* /proc/net */
+ lxpr_readdir_not_a_dir, /* /proc/net/arp */
+ lxpr_readdir_not_a_dir, /* /proc/net/dev */
+ lxpr_readdir_not_a_dir, /* /proc/net/dev_mcast */
+ lxpr_readdir_not_a_dir, /* /proc/net/igmp */
+ lxpr_readdir_not_a_dir, /* /proc/net/ip_mr_cache */
+ lxpr_readdir_not_a_dir, /* /proc/net/ip_mr_vif */
+ lxpr_readdir_not_a_dir, /* /proc/net/mcfilter */
+ lxpr_readdir_not_a_dir, /* /proc/net/netstat */
+ lxpr_readdir_not_a_dir, /* /proc/net/raw */
+ lxpr_readdir_not_a_dir, /* /proc/net/route */
+ lxpr_readdir_not_a_dir, /* /proc/net/rpc */
+ lxpr_readdir_not_a_dir, /* /proc/net/rt_cache */
+ lxpr_readdir_not_a_dir, /* /proc/net/sockstat */
+ lxpr_readdir_not_a_dir, /* /proc/net/snmp */
+ lxpr_readdir_not_a_dir, /* /proc/net/stat */
+ lxpr_readdir_not_a_dir, /* /proc/net/tcp */
+ lxpr_readdir_not_a_dir, /* /proc/net/udp */
+ lxpr_readdir_not_a_dir, /* /proc/net/unix */
+ lxpr_readdir_not_a_dir, /* /proc/partitions */
+ lxpr_readdir_not_a_dir, /* /proc/self */
+ lxpr_readdir_not_a_dir, /* /proc/stat */
+ lxpr_readdir_not_a_dir, /* /proc/uptime */
+ lxpr_readdir_not_a_dir, /* /proc/version */
+};
+
+
+/*
+ * lxpr_read(): Vnode operation for VOP_READ()
+ *
+ * As the format of all the files that can be read in lxproc is human readable
+ * and not binary structures there do not have to be different read variants
+ * depending on whether the reading process model is 32- or 64-bit.
+ */
+/* ARGSUSED */
+static int
+lxpr_read(vnode_t *vp, uio_t *uiop, int ioflag, cred_t *cr,
+ caller_context_t *ct)
+{
+ lxpr_node_t *lxpnp = VTOLXP(vp);
+ lxpr_nodetype_t type = lxpnp->lxpr_type;
+ lxpr_uiobuf_t *uiobuf = lxpr_uiobuf_new(uiop);
+ int error;
+
+ ASSERT(type < LXPR_NFILES);
+
+ lxpr_read_function[type](lxpnp, uiobuf);
+
+ error = lxpr_uiobuf_flush(uiobuf);
+ lxpr_uiobuf_free(uiobuf);
+
+ return (error);
+}
+
+/*
+ * lxpr_read_invalid(), lxpr_read_isdir(), lxpr_read_empty()
+ *
+ * Various special case reads:
+ * - trying to read a directory
+ * - invalid file (used to mean a file that should be implemented,
+ * but isn't yet)
+ * - empty file
+ * - wait to be able to read a file that will never have anything to read
+ */
+/* ARGSUSED */
+static void
+lxpr_read_isdir(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ lxpr_uiobuf_seterr(uiobuf, EISDIR);
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_invalid(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ lxpr_uiobuf_seterr(uiobuf, EINVAL);
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_empty(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/*
+ * lxpr_read_pid_cmdline():
+ *
+ * This is not precisely compatible with Linux: the Linux cmdline returns argv
+ * with the correct separation using \0 between the arguments, but we cannot do
+ * that without copying the real argv from the correct process context. This
+ * is too difficult to attempt so we pretend that the entire cmdline is just
+ * argv[0]. This is good enough for ps and htop to display correctly, but might
+ * cause some other things not to work correctly.
+ */
+static void
+lxpr_read_pid_cmdline(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ proc_t *p;
+ char *buf;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_CMDLINE);
+
+ p = lxpr_lock(lxpnp->lxpr_pid);
+ if (p == NULL) {
+ lxpr_uiobuf_seterr(uiobuf, EINVAL);
+ return;
+ }
+
+ buf = PTOU(p)->u_argv != 0 ? PTOU(p)->u_psargs : PTOU(p)->u_comm;
+
+ lxpr_uiobuf_write(uiobuf, buf, strlen(buf) + 1);
+ lxpr_unlock(p);
+}
+
+/*
+ * lxpr_read_pid_maps(): memory map file
+ */
+static void
+lxpr_read_pid_maps(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ proc_t *p;
+ struct as *as;
+ struct seg *seg;
+ char *buf;
+ int buflen = MAXPATHLEN;
+ struct print_data {
+ caddr_t saddr;
+ caddr_t eaddr;
+ int type;
+ char prot[5];
+ uint32_t offset;
+ vnode_t *vp;
+ struct print_data *next;
+ } *print_head = NULL;
+ struct print_data **print_tail = &print_head;
+ struct print_data *pbuf;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_MAPS);
+
+ p = lxpr_lock(lxpnp->lxpr_pid);
+ if (p == NULL) {
+ lxpr_uiobuf_seterr(uiobuf, EINVAL);
+ return;
+ }
+
+ as = p->p_as;
+
+ if (as == &kas) {
+ lxpr_unlock(p);
+ return;
+ }
+
+ mutex_exit(&p->p_lock);
+
+ /* Iterate over all segments in the address space */
+ AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) {
+ vnode_t *vp;
+ uint_t protbits;
+
+ pbuf = kmem_alloc(sizeof (*pbuf), KM_SLEEP);
+
+ pbuf->saddr = seg->s_base;
+ pbuf->eaddr = seg->s_base+seg->s_size;
+ pbuf->type = SEGOP_GETTYPE(seg, seg->s_base);
+
+ /*
+ * Cheat and only use the protection bits of the first page
+ * in the segment
+ */
+ (void) strncpy(pbuf->prot, "----", sizeof (pbuf->prot));
+ (void) SEGOP_GETPROT(seg, seg->s_base, 0, &protbits);
+
+ if (protbits & PROT_READ) pbuf->prot[0] = 'r';
+ if (protbits & PROT_WRITE) pbuf->prot[1] = 'w';
+ if (protbits & PROT_EXEC) pbuf->prot[2] = 'x';
+ if (pbuf->type & MAP_SHARED) pbuf->prot[3] = 's';
+ else if (pbuf->type & MAP_PRIVATE) pbuf->prot[3] = 'p';
+
+ if (seg->s_ops == &segvn_ops &&
+ SEGOP_GETVP(seg, seg->s_base, &vp) == 0 &&
+ vp != NULL && vp->v_type == VREG) {
+ VN_HOLD(vp);
+ pbuf->vp = vp;
+ } else {
+ pbuf->vp = NULL;
+ }
+
+ pbuf->offset = (uint32_t)SEGOP_GETOFFSET(seg, pbuf->saddr);
+
+ pbuf->next = NULL;
+ *print_tail = pbuf;
+ print_tail = &pbuf->next;
+ }
+ AS_LOCK_EXIT(as, &as->a_lock);
+ mutex_enter(&p->p_lock);
+ lxpr_unlock(p);
+
+ buf = kmem_alloc(buflen, KM_SLEEP);
+
+ /* print the data we've extracted */
+ pbuf = print_head;
+ while (pbuf != NULL) {
+ struct print_data *pbuf_next;
+ vattr_t vattr;
+
+ int maj = 0;
+ int min = 0;
+ u_longlong_t inode = 0;
+
+ *buf = '\0';
+ if (pbuf->vp != NULL) {
+ vattr.va_mask = AT_FSID | AT_NODEID;
+ if (VOP_GETATTR(pbuf->vp, &vattr, 0, CRED(),
+ NULL) == 0) {
+ maj = getmajor(vattr.va_fsid);
+ min = getminor(vattr.va_fsid);
+ inode = vattr.va_nodeid;
+ }
+ (void) vnodetopath(NULL, pbuf->vp, buf, buflen, CRED());
+ VN_RELE(pbuf->vp);
+ }
+
+ if (*buf != '\0') {
+ lxpr_uiobuf_printf(uiobuf,
+ "%08x-%08x %s %08x %02d:%03d %lld %s\n",
+ pbuf->saddr, pbuf->eaddr, pbuf->prot, pbuf->offset,
+ maj, min, inode, buf);
+ } else {
+ lxpr_uiobuf_printf(uiobuf,
+ "%08x-%08x %s %08x %02d:%03d %lld\n",
+ pbuf->saddr, pbuf->eaddr, pbuf->prot, pbuf->offset,
+ maj, min, inode);
+ }
+
+ pbuf_next = pbuf->next;
+ kmem_free(pbuf, sizeof (*pbuf));
+ pbuf = pbuf_next;
+ }
+
+ kmem_free(buf, buflen);
+}
+
+/*
+ * lxpr_read_pid_statm(): memory status file
+ */
+static void
+lxpr_read_pid_statm(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ proc_t *p;
+ struct as *as;
+ size_t vsize;
+ size_t rss;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_STATM);
+
+ p = lxpr_lock(lxpnp->lxpr_pid);
+ if (p == NULL) {
+ lxpr_uiobuf_seterr(uiobuf, EINVAL);
+ return;
+ }
+
+ as = p->p_as;
+
+ mutex_exit(&p->p_lock);
+
+ AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ vsize = btopr(as->a_resvsize);
+ rss = rm_asrss(as);
+ AS_LOCK_EXIT(as, &as->a_lock);
+
+ mutex_enter(&p->p_lock);
+ lxpr_unlock(p);
+
+ lxpr_uiobuf_printf(uiobuf,
+ "%lu %lu %lu %lu %lu %lu %lu\n",
+ vsize, rss, 0l, rss, 0l, 0l, 0l);
+}
+
+/*
+ * lxpr_read_pid_status(): status file
+ */
+static void
+lxpr_read_pid_status(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ proc_t *p;
+ kthread_t *t;
+ user_t *up;
+ cred_t *cr;
+ const gid_t *groups;
+ int ngroups;
+ struct as *as;
+ char *status;
+ pid_t pid, ppid;
+ size_t vsize;
+ size_t rss;
+ k_sigset_t current, ignore, handle;
+ int i, lx_sig;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_STATUS);
+
+ p = lxpr_lock(lxpnp->lxpr_pid);
+ if (p == NULL) {
+ lxpr_uiobuf_seterr(uiobuf, EINVAL);
+ return;
+ }
+
+ pid = p->p_pid;
+
+ /*
+ * Convert pid to the Linux default of 1 if we're the zone's init
+ * process
+ */
+ if (pid == curproc->p_zone->zone_proc_initpid) {
+ pid = 1;
+ ppid = 0; /* parent pid for init is 0 */
+ } else {
+ /*
+ * Make sure not to reference parent PIDs that reside outside
+ * the zone
+ */
+ ppid = ((p->p_flag & SZONETOP)
+ ? curproc->p_zone->zone_zsched->p_pid : p->p_ppid);
+
+ /*
+ * Convert ppid to the Linux default of 1 if our parent is the
+ * zone's init process
+ */
+ if (ppid == curproc->p_zone->zone_proc_initpid)
+ ppid = 1;
+ }
+
+ t = prchoose(p);
+ if (t != NULL) {
+ switch (t->t_state) {
+ case TS_SLEEP:
+ status = "S (sleeping)";
+ break;
+ case TS_RUN:
+ case TS_ONPROC:
+ status = "R (running)";
+ break;
+ case TS_ZOMB:
+ status = "Z (zombie)";
+ break;
+ case TS_STOPPED:
+ status = "T (stopped)";
+ break;
+ default:
+ status = "! (unknown)";
+ break;
+ }
+ thread_unlock(t);
+ } else {
+ /*
+ * there is a hole in the exit code, where a proc can have
+ * no threads but it is yet to be flagged SZOMB. We will
+ * assume we are about to become a zombie
+ */
+ status = "Z (zombie)";
+ }
+
+ up = PTOU(p);
+ mutex_enter(&p->p_crlock);
+ crhold(cr = p->p_cred);
+ mutex_exit(&p->p_crlock);
+
+ lxpr_uiobuf_printf(uiobuf,
+ "Name:\t%s\n"
+ "State:\t%s\n"
+ "Tgid:\t%d\n"
+ "Pid:\t%d\n"
+ "PPid:\t%d\n"
+ "TracerPid:\t%d\n"
+ "Uid:\t%u\t%u\t%u\t%u\n"
+ "Gid:\t%u\t%u\t%u\t%u\n"
+ "FDSize:\t%d\n"
+ "Groups:\t",
+ up->u_comm,
+ status,
+ pid, /* thread group id - same as pid */
+ pid,
+ ppid,
+ 0,
+ crgetruid(cr), crgetuid(cr), crgetsuid(cr), crgetuid(cr),
+ crgetrgid(cr), crgetgid(cr), crgetsgid(cr), crgetgid(cr),
+ p->p_fno_ctl);
+
+ ngroups = crgetngroups(cr);
+ groups = crgetgroups(cr);
+ for (i = 0; i < ngroups; i++) {
+ lxpr_uiobuf_printf(uiobuf,
+ "%u ",
+ groups[i]);
+ }
+ crfree(cr);
+
+ as = p->p_as;
+ if ((p->p_stat != SZOMB) && !(p->p_flag & SSYS) && (as != &kas)) {
+ mutex_exit(&p->p_lock);
+ AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ vsize = as->a_resvsize;
+ rss = rm_asrss(as);
+ AS_LOCK_EXIT(as, &as->a_lock);
+ mutex_enter(&p->p_lock);
+
+ lxpr_uiobuf_printf(uiobuf,
+ "\n"
+ "VmSize:\t%8lu kB\n"
+ "VmLck:\t%8lu kB\n"
+ "VmRSS:\t%8lu kB\n"
+ "VmData:\t%8lu kB\n"
+ "VmStk:\t%8lu kB\n"
+ "VmExe:\t%8lu kB\n"
+ "VmLib:\t%8lu kB",
+ btok(vsize),
+ 0l,
+ ptok(rss),
+ 0l,
+ btok(p->p_stksize),
+ ptok(rss),
+ 0l);
+ }
+
+ sigemptyset(&current);
+ sigemptyset(&ignore);
+ sigemptyset(&handle);
+
+ for (i = 1; i < NSIG; i++) {
+ lx_sig = lxpr_sigmap[i];
+
+ if ((lx_sig > 0) && (lx_sig < LX_NSIG)) {
+ if (sigismember(&p->p_sig, i))
+ sigaddset(&current, lx_sig);
+
+ if (up->u_signal[i - 1] == SIG_IGN)
+ sigaddset(&ignore, lx_sig);
+ else if (up->u_signal[i - 1] != SIG_DFL)
+ sigaddset(&handle, lx_sig);
+ }
+ }
+
+ lxpr_uiobuf_printf(uiobuf,
+ "\n"
+ "SigPnd:\t%08x%08x\n"
+ "SigBlk:\t%08x%08x\n"
+ "SigIgn:\t%08x%08x\n"
+ "SigCgt:\t%08x%08x\n"
+ "CapInh:\t%016x\n"
+ "CapPrm:\t%016x\n"
+ "CapEff:\t%016x\n",
+ current.__sigbits[1], current.__sigbits[0],
+ 0, 0, /* signals blocked on per thread basis */
+ ignore.__sigbits[1], ignore.__sigbits[0],
+ handle.__sigbits[1], handle.__sigbits[0],
+ /* Can't do anything with linux capabilities */
+ 0,
+ 0,
+ 0);
+
+ lxpr_unlock(p);
+}
+
+
+/*
+ * lxpr_read_pid_stat(): pid stat file
+ */
+static void
+lxpr_read_pid_stat(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ proc_t *p;
+ kthread_t *t;
+ struct as *as;
+ char stat;
+ pid_t pid, ppid, pgpid, spid;
+ gid_t psgid;
+ dev_t psdev;
+ size_t rss, vsize;
+ int nice, pri;
+ caddr_t wchan;
+ processorid_t cpu;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_STAT);
+
+ p = lxpr_lock(lxpnp->lxpr_pid);
+ if (p == NULL) {
+ lxpr_uiobuf_seterr(uiobuf, EINVAL);
+ return;
+ }
+
+ pid = p->p_pid;
+
+ /*
+ * Set Linux defaults if we're the zone's init process
+ */
+ if (pid == curproc->p_zone->zone_proc_initpid) {
+ pid = 1; /* PID for init */
+ ppid = 0; /* parent PID for init is 0 */
+ pgpid = 0; /* process group for init is 0 */
+ psgid = (gid_t)-1; /* credential GID for init is -1 */
+ spid = 0; /* session id for init is 0 */
+ psdev = 0; /* session device for init is 0 */
+ } else {
+ /*
+ * Make sure not to reference parent PIDs that reside outside
+ * the zone
+ */
+ ppid = ((p->p_flag & SZONETOP) ?
+ curproc->p_zone->zone_zsched->p_pid : p->p_ppid);
+
+ /*
+ * Convert ppid to the Linux default of 1 if our parent is the
+ * zone's init process
+ */
+ if (ppid == curproc->p_zone->zone_proc_initpid)
+ ppid = 1;
+
+ pgpid = p->p_pgrp;
+
+ mutex_enter(&p->p_splock);
+ mutex_enter(&p->p_sessp->s_lock);
+ spid = p->p_sessp->s_sid;
+ psdev = p->p_sessp->s_dev;
+ if (p->p_sessp->s_cred)
+ psgid = crgetgid(p->p_sessp->s_cred);
+ else
+ psgid = crgetgid(p->p_cred);
+
+ mutex_exit(&p->p_sessp->s_lock);
+ mutex_exit(&p->p_splock);
+ }
+
+ t = prchoose(p);
+ if (t != NULL) {
+ switch (t->t_state) {
+ case TS_SLEEP:
+ stat = 'S'; break;
+ case TS_RUN:
+ case TS_ONPROC:
+ stat = 'R'; break;
+ case TS_ZOMB:
+ stat = 'Z'; break;
+ case TS_STOPPED:
+ stat = 'T'; break;
+ default:
+ stat = '!'; break;
+ }
+
+ if (CL_DONICE(t, NULL, 0, &nice) != 0)
+ nice = 0;
+
+ pri = t->t_pri;
+ wchan = t->t_wchan;
+ cpu = t->t_cpu->cpu_id;
+ thread_unlock(t);
+ } else {
+ /* Only zombies have no threads */
+ stat = 'Z';
+ nice = 0;
+ pri = 0;
+ wchan = 0;
+ cpu = 0;
+ }
+ as = p->p_as;
+ mutex_exit(&p->p_lock);
+ AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ vsize = as->a_resvsize;
+ rss = rm_asrss(as);
+ AS_LOCK_EXIT(as, &as->a_lock);
+ mutex_enter(&p->p_lock);
+
+ lxpr_uiobuf_printf(uiobuf,
+ "%d (%s) %c %d %d %d %d %d "
+ "%lu %lu %lu %lu %lu "
+ "%lu %lu %ld %ld "
+ "%d %d %d "
+ "%lu "
+ "%lu "
+ "%lu %ld %llu "
+ "%lu %lu %u "
+ "%lu %lu "
+ "%lu %lu %lu %lu "
+ "%lu "
+ "%lu %lu "
+ "%d "
+ "%d"
+ "\n",
+ pid, PTOU(p)->u_comm, stat, ppid, pgpid, spid, psdev, psgid,
+ 0l, 0l, 0l, 0l, 0l, /* flags, minflt, cminflt, majflt, cmajflt */
+ p->p_utime, p->p_stime, p->p_cutime, p->p_cstime,
+ pri, nice, p->p_lwpcnt,
+ 0l, /* itrealvalue (time before next SIGALRM) */
+ PTOU(p)->u_ticks,
+ vsize, rss, p->p_vmem_ctl,
+ 0l, 0l, USRSTACK, /* startcode, endcode, startstack */
+ 0l, 0l, /* kstkesp, kstkeip */
+ 0l, 0l, 0l, 0l, /* signal, blocked, sigignore, sigcatch */
+ wchan,
+ 0l, 0l, /* nswap, cnswap */
+ 0, /* exit_signal */
+ cpu);
+
+ lxpr_unlock(p);
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_arp(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_dev(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ lxpr_uiobuf_printf(uiobuf, "Inter-| Receive "
+ " | Transmit\n");
+ lxpr_uiobuf_printf(uiobuf, " face |bytes packets errs drop fifo"
+ " frame compressed multicast|bytes packets errs drop fifo"
+ " colls carrier compressed\n");
+
+ /*
+ * Data about each interface should go here, but that shouldn't be added
+ * unless there is an lxproc reader that actually makes use of it (and
+ * doesn't need anything else that we refuse to provide)...
+ */
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_dev_mcast(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_igmp(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_ip_mr_cache(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_ip_mr_vif(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_mcfilter(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_netstat(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_raw(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_route(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_rpc(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_rt_cache(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_sockstat(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_snmp(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_stat(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_tcp(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_udp(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_net_unix(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+}
+
+/*
+ * lxpr_read_kmsg(): read the contents of the kernel message queue. We
+ * translate this into the reception of console messages for this zone; each
+ * read copies out a single zone console message, or blocks until the next one
+ * is produced.
+ */
+
+#define LX_KMSG_PRI "<0>"
+
+static void
+lxpr_read_kmsg(lxpr_node_t *lxpnp, struct lxpr_uiobuf *uiobuf)
+{
+ ldi_handle_t lh = lxpnp->lxpr_cons_ldih;
+ mblk_t *mp;
+
+ if (ldi_getmsg(lh, &mp, NULL) == 0) {
+ /*
+ * lxproc doesn't like successive reads to the same file
+ * descriptor unless we do an explicit rewind each time.
+ */
+ lxpr_uiobuf_seek(uiobuf, 0);
+
+ lxpr_uiobuf_printf(uiobuf, "%s%s", LX_KMSG_PRI,
+ mp->b_cont->b_rptr);
+
+ freemsg(mp);
+ }
+}
+
+/*
+ * lxpr_read_loadavg(): read the contents of the "loadavg" file. We do just
+ * enough for uptime and other simple lxproc readers to work
+ */
+extern int nthread;
+
+static void
+lxpr_read_loadavg(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ ulong_t avenrun1;
+ ulong_t avenrun5;
+ ulong_t avenrun15;
+ ulong_t avenrun1_cs;
+ ulong_t avenrun5_cs;
+ ulong_t avenrun15_cs;
+ int loadavg[3];
+ int *loadbuf;
+ cpupart_t *cp;
+ zone_t *zone = LXPTOZ(lxpnp);
+
+ uint_t nrunnable = 0;
+ rctl_qty_t nlwps;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_LOADAVG);
+
+ mutex_enter(&cpu_lock);
+
+ /*
+ * Need to add up values over all CPU partitions. If pools are active,
+ * only report the values of the zone's partition, which by definition
+ * includes the current CPU.
+ */
+ if (pool_pset_enabled()) {
+ psetid_t psetid = zone_pset_get(curproc->p_zone);
+
+ ASSERT(curproc->p_zone != &zone0);
+ cp = CPU->cpu_part;
+
+ nrunnable = cp->cp_nrunning + cp->cp_nrunnable;
+ (void) cpupart_get_loadavg(psetid, &loadavg[0], 3);
+ loadbuf = &loadavg[0];
+ } else {
+ cp = cp_list_head;
+ do {
+ nrunnable += cp->cp_nrunning + cp->cp_nrunnable;
+ } while ((cp = cp->cp_next) != cp_list_head);
+
+ loadbuf = zone == global_zone ?
+ &avenrun[0] : zone->zone_avenrun;
+ }
+
+ /*
+ * If we're in the non-global zone, we'll report the total number of
+ * LWPs in the zone for the "nproc" parameter of /proc/loadavg,
+ * otherwise will just use nthread (which will include kernel threads,
+ * but should be good enough for lxproc).
+ */
+ nlwps = zone == global_zone ? nthread : zone->zone_nlwps;
+
+ mutex_exit(&cpu_lock);
+
+ avenrun1 = loadbuf[0] >> FSHIFT;
+ avenrun1_cs = ((loadbuf[0] & (FSCALE-1)) * 100) >> FSHIFT;
+ avenrun5 = loadbuf[1] >> FSHIFT;
+ avenrun5_cs = ((loadbuf[1] & (FSCALE-1)) * 100) >> FSHIFT;
+ avenrun15 = loadbuf[2] >> FSHIFT;
+ avenrun15_cs = ((loadbuf[2] & (FSCALE-1)) * 100) >> FSHIFT;
+
+ lxpr_uiobuf_printf(uiobuf,
+ "%ld.%02d %ld.%02d %ld.%02d %d/%d %d\n",
+ avenrun1, avenrun1_cs,
+ avenrun5, avenrun5_cs,
+ avenrun15, avenrun15_cs,
+ nrunnable, nlwps, 0);
+}
+
+/*
+ * lxpr_read_meminfo(): read the contents of the "meminfo" file.
+ */
+static void
+lxpr_read_meminfo(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ zone_t *zone = LXPTOZ(lxpnp);
+ int global = zone == global_zone;
+ long total_mem, free_mem, total_swap, used_swap;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_MEMINFO);
+
+ if (global || zone->zone_phys_mem_ctl == UINT64_MAX) {
+ total_mem = physmem * PAGESIZE;
+ free_mem = freemem * PAGESIZE;
+ } else {
+ total_mem = zone->zone_phys_mem_ctl;
+ free_mem = zone->zone_phys_mem_ctl - zone->zone_phys_mem;
+ }
+
+ if (global || zone->zone_max_swap_ctl == UINT64_MAX) {
+ total_swap = k_anoninfo.ani_max * PAGESIZE;
+ used_swap = k_anoninfo.ani_phys_resv * PAGESIZE;
+ } else {
+ mutex_enter(&zone->zone_mem_lock);
+ total_swap = zone->zone_max_swap_ctl;
+ used_swap = zone->zone_max_swap;
+ mutex_exit(&zone->zone_mem_lock);
+ }
+
+ lxpr_uiobuf_printf(uiobuf,
+ " total: used: free: shared: buffers: cached:\n"
+ "Mem: %8lu %8lu %8lu %8u %8u %8u\n"
+ "Swap: %8lu %8lu %8lu\n"
+ "MemTotal: %8lu kB\n"
+ "MemFree: %8lu kB\n"
+ "MemShared: %8u kB\n"
+ "Buffers: %8u kB\n"
+ "Cached: %8u kB\n"
+ "SwapCached:%8u kB\n"
+ "Active: %8u kB\n"
+ "Inactive: %8u kB\n"
+ "HighTotal: %8u kB\n"
+ "HighFree: %8u kB\n"
+ "LowTotal: %8u kB\n"
+ "LowFree: %8u kB\n"
+ "SwapTotal: %8lu kB\n"
+ "SwapFree: %8lu kB\n",
+ total_mem, total_mem - free_mem, free_mem, 0, 0, 0,
+ total_swap, used_swap, total_swap - used_swap,
+ btok(total_mem), /* MemTotal */
+ btok(free_mem), /* MemFree */
+ 0, /* MemShared */
+ 0, /* Buffers */
+ 0, /* Cached */
+ 0, /* SwapCached */
+ 0, /* Active */
+ 0, /* Inactive */
+ 0, /* HighTotal */
+ 0, /* HighFree */
+ btok(total_mem), /* LowTotal */
+ btok(free_mem), /* LowFree */
+ btok(total_swap), /* SwapTotal */
+ btok(total_swap - used_swap)); /* SwapFree */
+}
+
+/*
+ * lxpr_read_mounts():
+ */
+/* ARGSUSED */
+static void
+lxpr_read_mounts(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ struct vfs *vfsp;
+ struct vfs *vfslist;
+ zone_t *zone = LXPTOZ(lxpnp);
+ struct print_data {
+ refstr_t *vfs_mntpt;
+ refstr_t *vfs_resource;
+ uint_t vfs_flag;
+ int vfs_fstype;
+ struct print_data *next;
+ } *print_head = NULL;
+ struct print_data **print_tail = &print_head;
+ struct print_data *printp;
+
+ vfs_list_read_lock();
+
+ if (zone == global_zone) {
+ vfsp = vfslist = rootvfs;
+ } else {
+ vfsp = vfslist = zone->zone_vfslist;
+ /*
+ * If the zone has a root entry, it will be the first in
+ * the list. If it doesn't, we conjure one up.
+ */
+ if (vfslist == NULL || strcmp(refstr_value(vfsp->vfs_mntpt),
+ zone->zone_rootpath) != 0) {
+ struct vfs *tvfsp;
+ /*
+ * The root of the zone is not a mount point. The vfs
+ * we want to report is that of the zone's root vnode.
+ */
+ tvfsp = zone->zone_rootvp->v_vfsp;
+
+ lxpr_uiobuf_printf(uiobuf,
+ "/ / %s %s 0 0\n",
+ vfssw[tvfsp->vfs_fstype].vsw_name,
+ tvfsp->vfs_flag & VFS_RDONLY ? "ro" : "rw");
+
+ }
+ if (vfslist == NULL) {
+ vfs_list_unlock();
+ return;
+ }
+ }
+
+ /*
+ * Later on we have to do a lookupname, which can end up causing
+ * another vfs_list_read_lock() to be called. Which can lead to a
+ * deadlock. To avoid this, we extract the data we need into a local
+ * list, then we can run this list without holding vfs_list_read_lock()
+ * We keep the list in the same order as the vfs_list
+ */
+ do {
+ /* Skip mounts we shouldn't show */
+ if (vfsp->vfs_flag & VFS_NOMNTTAB) {
+ goto nextfs;
+ }
+
+ printp = kmem_alloc(sizeof (*printp), KM_SLEEP);
+ refstr_hold(vfsp->vfs_mntpt);
+ printp->vfs_mntpt = vfsp->vfs_mntpt;
+ refstr_hold(vfsp->vfs_resource);
+ printp->vfs_resource = vfsp->vfs_resource;
+ printp->vfs_flag = vfsp->vfs_flag;
+ printp->vfs_fstype = vfsp->vfs_fstype;
+ printp->next = NULL;
+
+ *print_tail = printp;
+ print_tail = &printp->next;
+
+nextfs:
+ vfsp = (zone == global_zone) ?
+ vfsp->vfs_next : vfsp->vfs_zone_next;
+
+ } while (vfsp != vfslist);
+
+ vfs_list_unlock();
+
+ /*
+ * now we can run through what we've extracted without holding
+ * vfs_list_read_lock()
+ */
+ printp = print_head;
+ while (printp != NULL) {
+ struct print_data *printp_next;
+ const char *resource;
+ char *mntpt;
+ struct vnode *vp;
+ int error;
+
+ mntpt = (char *)refstr_value(printp->vfs_mntpt);
+ resource = refstr_value(printp->vfs_resource);
+
+ if (mntpt != NULL && mntpt[0] != '\0')
+ mntpt = ZONE_PATH_TRANSLATE(mntpt, zone);
+ else
+ mntpt = "-";
+
+ error = lookupname(mntpt, UIO_SYSSPACE, FOLLOW, NULLVPP, &vp);
+
+ if (error != 0)
+ goto nextp;
+
+ if (!(vp->v_flag & VROOT)) {
+ VN_RELE(vp);
+ goto nextp;
+ }
+ VN_RELE(vp);
+
+ if (resource != NULL && resource[0] != '\0') {
+ if (resource[0] == '/') {
+ resource = ZONE_PATH_VISIBLE(resource, zone) ?
+ ZONE_PATH_TRANSLATE(resource, zone) :
+ mntpt;
+ }
+ } else {
+ resource = "-";
+ }
+
+ lxpr_uiobuf_printf(uiobuf,
+ "%s %s %s %s 0 0\n",
+ resource, mntpt, vfssw[printp->vfs_fstype].vsw_name,
+ printp->vfs_flag & VFS_RDONLY ? "ro" : "rw");
+
+nextp:
+ printp_next = printp->next;
+ refstr_rele(printp->vfs_mntpt);
+ refstr_rele(printp->vfs_resource);
+ kmem_free(printp, sizeof (*printp));
+ printp = printp_next;
+
+ }
+}
+
+/*
+ * lxpr_read_partitions():
+ *
+ * We don't support partitions in a local zone because it requires access to
+ * physical devices. But we need to fake up enough of the file to show that we
+ * have no partitions.
+ */
+/* ARGSUSED */
+static void
+lxpr_read_partitions(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ lxpr_uiobuf_printf(uiobuf,
+ "major minor #blocks name rio rmerge rsect ruse "
+ "wio wmerge wsect wuse running use aveq\n\n");
+}
+
+/*
+ * lxpr_read_version(): read the contents of the "version" file. Note that
+ * we don't lie here -- we don't pretend that we're Linux. If lxproc is to
+ * be used in a Linux-branded zone, there will need to be a mount option to
+ * indicate that Linux should be more fully mimicked.
+ */
+/* ARGSUSED */
+static void
+lxpr_read_version(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ lxpr_uiobuf_printf(uiobuf,
+ "%s version %s (%s version %d.%d.%d) "
+ "#%s SMP %s\n",
+ utsname.sysname, utsname.release,
+#if defined(__GNUC__)
+ "gcc",
+ __GNUC__,
+ __GNUC_MINOR__,
+ __GNUC_PATCHLEVEL__,
+#else
+ "Sun C",
+ __SUNPRO_C / 0x100,
+ (__SUNPRO_C & 0xff) / 0x10,
+ __SUNPRO_C & 0xf,
+#endif
+ utsname.version,
+ "00:00:00 00/00/00");
+}
+
+/*
+ * lxpr_read_stat(): read the contents of the "stat" file.
+ *
+ */
+/* ARGSUSED */
+static void
+lxpr_read_stat(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ cpu_t *cp, *cpstart;
+ int pools_enabled;
+ ulong_t idle_cum = 0;
+ ulong_t sys_cum = 0;
+ ulong_t user_cum = 0;
+ ulong_t irq_cum = 0;
+ uint_t cpu_nrunnable_cum = 0;
+ uint_t w_io_cum = 0;
+
+ ulong_t pgpgin_cum = 0;
+ ulong_t pgpgout_cum = 0;
+ ulong_t pgswapout_cum = 0;
+ ulong_t pgswapin_cum = 0;
+ ulong_t intr_cum = 0;
+ ulong_t pswitch_cum = 0;
+ ulong_t forks_cum = 0;
+ hrtime_t msnsecs[NCMSTATES];
+
+ /* temporary variable since scalehrtime modifies data in place */
+ hrtime_t tmptime;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_STAT);
+
+ mutex_enter(&cpu_lock);
+ pools_enabled = pool_pset_enabled();
+
+ /* Calculate cumulative stats */
+ cp = cpstart = CPU->cpu_part->cp_cpulist;
+ do {
+ int i;
+
+ /*
+ * Don't count CPUs that aren't even in the system
+ * or aren't up yet.
+ */
+ if ((cp->cpu_flags & CPU_EXISTS) == 0) {
+ continue;
+ }
+
+ get_cpu_mstate(cp, msnsecs);
+
+ idle_cum += NSEC_TO_TICK(msnsecs[CMS_IDLE]);
+ sys_cum += NSEC_TO_TICK(msnsecs[CMS_SYSTEM]);
+ user_cum += NSEC_TO_TICK(msnsecs[CMS_USER]);
+
+ pgpgin_cum += CPU_STATS(cp, vm.pgpgin);
+ pgpgout_cum += CPU_STATS(cp, vm.pgpgout);
+ pgswapin_cum += CPU_STATS(cp, vm.pgswapin);
+ pgswapout_cum += CPU_STATS(cp, vm.pgswapout);
+
+ cpu_nrunnable_cum += cp->cpu_disp->disp_nrunnable;
+ w_io_cum += CPU_STATS(cp, sys.iowait);
+ for (i = 0; i < NCMSTATES; i++) {
+ tmptime = cp->cpu_intracct[i];
+ scalehrtime(&tmptime);
+ irq_cum += NSEC_TO_TICK(tmptime);
+ }
+
+ for (i = 0; i < PIL_MAX; i++)
+ intr_cum += CPU_STATS(cp, sys.intr[i]);
+
+ pswitch_cum += CPU_STATS(cp, sys.pswitch);
+ forks_cum += CPU_STATS(cp, sys.sysfork);
+ forks_cum += CPU_STATS(cp, sys.sysvfork);
+
+ if (pools_enabled)
+ cp = cp->cpu_next_part;
+ else
+ cp = cp->cpu_next;
+ } while (cp != cpstart);
+
+ lxpr_uiobuf_printf(uiobuf, "cpu %ld %ld %ld %ld %ld %ld %ld\n",
+ user_cum, 0, sys_cum, idle_cum, 0, irq_cum, 0);
+
+ /* Do per processor stats */
+ do {
+ int i;
+
+ ulong_t idle_ticks;
+ ulong_t sys_ticks;
+ ulong_t user_ticks;
+ ulong_t irq_ticks = 0;
+
+ /*
+ * Don't count CPUs that aren't even in the system
+ * or aren't up yet.
+ */
+ if ((cp->cpu_flags & CPU_EXISTS) == 0) {
+ continue;
+ }
+
+ get_cpu_mstate(cp, msnsecs);
+
+ idle_ticks = NSEC_TO_TICK(msnsecs[CMS_IDLE]);
+ sys_ticks = NSEC_TO_TICK(msnsecs[CMS_SYSTEM]);
+ user_ticks = NSEC_TO_TICK(msnsecs[CMS_USER]);
+
+ for (i = 0; i < NCMSTATES; i++) {
+ tmptime = cp->cpu_intracct[i];
+ scalehrtime(&tmptime);
+ irq_ticks += NSEC_TO_TICK(tmptime);
+ }
+
+ lxpr_uiobuf_printf(uiobuf,
+ "cpu%d %ld %ld %ld %ld %ld %ld %ld\n",
+ cp->cpu_id, user_ticks, 0, sys_ticks, idle_ticks,
+ 0, irq_ticks, 0);
+
+ if (pools_enabled)
+ cp = cp->cpu_next_part;
+ else
+ cp = cp->cpu_next;
+ } while (cp != cpstart);
+
+ mutex_exit(&cpu_lock);
+
+ lxpr_uiobuf_printf(uiobuf,
+ "page %lu %lu\n"
+ "swap %lu %lu\n"
+ "intr %lu\n"
+ "ctxt %lu\n"
+ "btime %lu\n"
+ "processes %lu\n"
+ "procs_running %lu\n"
+ "procs_blocked %lu\n",
+ pgpgin_cum, pgpgout_cum,
+ pgswapin_cum, pgswapout_cum,
+ intr_cum,
+ pswitch_cum,
+ boot_time,
+ forks_cum,
+ cpu_nrunnable_cum,
+ w_io_cum);
+}
+
+/*
+ * lxpr_read_uptime(): read the contents of the "uptime" file.
+ *
+ * format is: "%.2lf, %.2lf",uptime_secs, idle_secs
+ * Use fixed point arithmetic to get 2 decimal places
+ */
+/* ARGSUSED */
+static void
+lxpr_read_uptime(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ cpu_t *cp, *cpstart;
+ int pools_enabled;
+ ulong_t idle_cum = 0;
+ ulong_t cpu_count = 0;
+ ulong_t idle_s;
+ ulong_t idle_cs;
+ ulong_t up_s;
+ ulong_t up_cs;
+ hrtime_t birthtime;
+ hrtime_t centi_sec = 10000000; /* 10^7 */
+
+ ASSERT(lxpnp->lxpr_type == LXPR_UPTIME);
+
+ /* Calculate cumulative stats */
+ mutex_enter(&cpu_lock);
+ pools_enabled = pool_pset_enabled();
+
+ cp = cpstart = CPU;
+ do {
+ /*
+ * Don't count CPUs that aren't even in the system
+ * or aren't up yet.
+ */
+ if ((cp->cpu_flags & CPU_EXISTS) == 0) {
+ continue;
+ }
+
+ idle_cum += CPU_STATS(cp, sys.cpu_ticks_idle);
+ idle_cum += CPU_STATS(cp, sys.cpu_ticks_wait);
+ cpu_count += 1;
+
+ if (pools_enabled)
+ cp = cp->cpu_next_part;
+ else
+ cp = cp->cpu_next;
+ } while (cp != cpstart);
+ mutex_exit(&cpu_lock);
+
+ /* Getting the Zone zsched process startup time */
+ birthtime = LXPTOZ(lxpnp)->zone_zsched->p_mstart;
+ up_cs = (gethrtime() - birthtime) / centi_sec;
+ up_s = up_cs / 100;
+ up_cs %= 100;
+
+ ASSERT(cpu_count > 0);
+ idle_cum /= cpu_count;
+ idle_s = idle_cum / hz;
+ idle_cs = idle_cum % hz;
+ idle_cs *= 100;
+ idle_cs /= hz;
+
+ lxpr_uiobuf_printf(uiobuf,
+ "%ld.%02d %ld.%02d\n", up_s, up_cs, idle_s, idle_cs);
+}
+
+static const char *amd_x_edx[] = {
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, "syscall",
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, "mp",
+ "nx", NULL, "mmxext", NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, "lm", "3dnowext", "3dnow"
+};
+
+static const char *amd_x_ecx[] = {
+ "lahf_lm", NULL, "svm", NULL,
+ "altmovcr8"
+};
+
+static const char *tm_x_edx[] = {
+ "recovery", "longrun", NULL, "lrti"
+};
+
+/*
+ * Intel calls no-execute "xd" in its docs, but Linux still reports it as "nx."
+ */
+static const char *intc_x_edx[] = {
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, "syscall",
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ "nx", NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, "lm", NULL, NULL
+};
+
+static const char *intc_edx[] = {
+ "fpu", "vme", "de", "pse",
+ "tsc", "msr", "pae", "mce",
+ "cx8", "apic", NULL, "sep",
+ "mtrr", "pge", "mca", "cmov",
+ "pat", "pse36", "pn", "clflush",
+ NULL, "dts", "acpi", "mmx",
+ "fxsr", "sse", "sse2", "ss",
+ "ht", "tm", "ia64", "pbe"
+};
+
+/*
+ * "sse3" on linux is called "pni" (Prescott New Instructions).
+ */
+static const char *intc_ecx[] = {
+ "pni", NULL, NULL, "monitor",
+ "ds_cpl", NULL, NULL, "est",
+ "tm2", NULL, "cid", NULL,
+ NULL, "cx16", "xtpr"
+};
+
+static void
+lxpr_read_cpuinfo(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ int i;
+ uint32_t bits;
+ cpu_t *cp, *cpstart;
+ int pools_enabled;
+ const char **fp;
+ char brandstr[CPU_IDSTRLEN];
+ struct cpuid_regs cpr;
+ int maxeax;
+ int std_ecx, std_edx, ext_ecx, ext_edx;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_CPUINFO);
+
+ mutex_enter(&cpu_lock);
+ pools_enabled = pool_pset_enabled();
+
+ cp = cpstart = CPU;
+ do {
+ /*
+ * This returns the maximum eax value for standard cpuid
+ * functions in eax.
+ */
+ cpr.cp_eax = 0;
+ (void) cpuid_insn(cp, &cpr);
+ maxeax = cpr.cp_eax;
+
+ /*
+ * Get standard x86 feature flags.
+ */
+ cpr.cp_eax = 1;
+ (void) cpuid_insn(cp, &cpr);
+ std_ecx = cpr.cp_ecx;
+ std_edx = cpr.cp_edx;
+
+ /*
+ * Now get extended feature flags.
+ */
+ cpr.cp_eax = 0x80000001;
+ (void) cpuid_insn(cp, &cpr);
+ ext_ecx = cpr.cp_ecx;
+ ext_edx = cpr.cp_edx;
+
+ (void) cpuid_getbrandstr(cp, brandstr, CPU_IDSTRLEN);
+
+ lxpr_uiobuf_printf(uiobuf,
+ "processor\t: %d\n"
+ "vendor_id\t: %s\n"
+ "cpu family\t: %d\n"
+ "model\t\t: %d\n"
+ "model name\t: %s\n"
+ "stepping\t: %d\n"
+ "cpu MHz\t\t: %u.%03u\n",
+ cp->cpu_id, cpuid_getvendorstr(cp), cpuid_getfamily(cp),
+ cpuid_getmodel(cp), brandstr, cpuid_getstep(cp),
+ (uint32_t)(cpu_freq_hz / 1000000),
+ ((uint32_t)(cpu_freq_hz / 1000)) % 1000);
+
+ lxpr_uiobuf_printf(uiobuf, "cache size\t: %u KB\n",
+ getl2cacheinfo(cp, NULL, NULL, NULL) / 1024);
+
+ if (is_x86_feature(x86_featureset, X86FSET_HTT)) {
+ /*
+ * 'siblings' is used for HT-style threads
+ */
+ lxpr_uiobuf_printf(uiobuf,
+ "physical id\t: %lu\n"
+ "siblings\t: %u\n",
+ pg_plat_hw_instance_id(cp, PGHW_CHIP),
+ cpuid_get_ncpu_per_chip(cp));
+ }
+
+ /*
+ * Since we're relatively picky about running on older hardware,
+ * we can be somewhat cavalier about the answers to these ones.
+ *
+ * In fact, given the hardware we support, we just say:
+ *
+ * fdiv_bug : no (if we're on a 64-bit kernel)
+ * hlt_bug : no
+ * f00f_bug : no
+ * coma_bug : no
+ * wp : yes (write protect in supervsr mode)
+ */
+ lxpr_uiobuf_printf(uiobuf,
+ "fdiv_bug\t: %s\n"
+ "hlt_bug \t: no\n"
+ "f00f_bug\t: no\n"
+ "coma_bug\t: no\n"
+ "fpu\t\t: %s\n"
+ "fpu_exception\t: %s\n"
+ "cpuid level\t: %d\n"
+ "flags\t\t:",
+#if defined(__i386)
+ fpu_pentium_fdivbug ? "yes" : "no",
+#else
+ "no",
+#endif /* __i386 */
+ fpu_exists ? "yes" : "no", fpu_exists ? "yes" : "no",
+ maxeax);
+
+ for (bits = std_edx, fp = intc_edx, i = 0;
+ i < sizeof (intc_edx) / sizeof (intc_edx[0]); fp++, i++)
+ if ((bits & (1 << i)) != 0 && *fp)
+ lxpr_uiobuf_printf(uiobuf, " %s", *fp);
+
+ /*
+ * name additional features where appropriate
+ */
+ switch (x86_vendor) {
+ case X86_VENDOR_Intel:
+ for (bits = ext_edx, fp = intc_x_edx, i = 0;
+ i < sizeof (intc_x_edx) / sizeof (intc_x_edx[0]);
+ fp++, i++)
+ if ((bits & (1 << i)) != 0 && *fp)
+ lxpr_uiobuf_printf(uiobuf, " %s", *fp);
+ break;
+
+ case X86_VENDOR_AMD:
+ for (bits = ext_edx, fp = amd_x_edx, i = 0;
+ i < sizeof (amd_x_edx) / sizeof (amd_x_edx[0]);
+ fp++, i++)
+ if ((bits & (1 << i)) != 0 && *fp)
+ lxpr_uiobuf_printf(uiobuf, " %s", *fp);
+
+ for (bits = ext_ecx, fp = amd_x_ecx, i = 0;
+ i < sizeof (amd_x_ecx) / sizeof (amd_x_ecx[0]);
+ fp++, i++)
+ if ((bits & (1 << i)) != 0 && *fp)
+ lxpr_uiobuf_printf(uiobuf, " %s", *fp);
+ break;
+
+ case X86_VENDOR_TM:
+ for (bits = ext_edx, fp = tm_x_edx, i = 0;
+ i < sizeof (tm_x_edx) / sizeof (tm_x_edx[0]);
+ fp++, i++)
+ if ((bits & (1 << i)) != 0 && *fp)
+ lxpr_uiobuf_printf(uiobuf, " %s", *fp);
+ break;
+ default:
+ break;
+ }
+
+ for (bits = std_ecx, fp = intc_ecx, i = 0;
+ i < sizeof (intc_ecx) / sizeof (intc_ecx[0]); fp++, i++)
+ if ((bits & (1 << i)) != 0 && *fp)
+ lxpr_uiobuf_printf(uiobuf, " %s", *fp);
+
+ lxpr_uiobuf_printf(uiobuf, "\n\n");
+
+ if (pools_enabled)
+ cp = cp->cpu_next_part;
+ else
+ cp = cp->cpu_next;
+ } while (cp != cpstart);
+
+ mutex_exit(&cpu_lock);
+}
+
+/* ARGSUSED */
+static void
+lxpr_read_fd(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf)
+{
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_FD_FD);
+ lxpr_uiobuf_seterr(uiobuf, EFAULT);
+}
+
+/*
+ * lxpr_getattr(): Vnode operation for VOP_GETATTR()
+ */
+static int
+lxpr_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
+ caller_context_t *ct)
+{
+ register lxpr_node_t *lxpnp = VTOLXP(vp);
+ lxpr_nodetype_t type = lxpnp->lxpr_type;
+ extern uint_t nproc;
+ int error;
+
+ /*
+ * Return attributes of underlying vnode if ATTR_REAL
+ *
+ * but keep fd files with the symlink permissions
+ */
+ if (lxpnp->lxpr_realvp != NULL && (flags & ATTR_REAL)) {
+ vnode_t *rvp = lxpnp->lxpr_realvp;
+
+ /*
+ * withold attribute information to owner or root
+ */
+ if ((error = VOP_ACCESS(rvp, 0, 0, cr, ct)) != 0) {
+ return (error);
+ }
+
+ /*
+ * now its attributes
+ */
+ if ((error = VOP_GETATTR(rvp, vap, flags, cr, ct)) != 0) {
+ return (error);
+ }
+
+ /*
+ * if it's a file in lx /proc/pid/fd/xx then set its
+ * mode and keep it looking like a symlink
+ */
+ if (type == LXPR_PID_FD_FD) {
+ vap->va_mode = lxpnp->lxpr_mode;
+ vap->va_type = vp->v_type;
+ vap->va_size = 0;
+ vap->va_nlink = 1;
+ }
+ return (0);
+ }
+
+ /* Default attributes, that may be overridden below */
+ bzero(vap, sizeof (*vap));
+ vap->va_atime = vap->va_mtime = vap->va_ctime = lxpnp->lxpr_time;
+ vap->va_nlink = 1;
+ vap->va_type = vp->v_type;
+ vap->va_mode = lxpnp->lxpr_mode;
+ vap->va_fsid = vp->v_vfsp->vfs_dev;
+ vap->va_blksize = DEV_BSIZE;
+ vap->va_uid = lxpnp->lxpr_uid;
+ vap->va_gid = lxpnp->lxpr_gid;
+ vap->va_nodeid = lxpnp->lxpr_ino;
+
+ switch (type) {
+ case LXPR_PROCDIR:
+ vap->va_nlink = nproc + 2 + PROCDIRFILES;
+ vap->va_size = (nproc + 2 + PROCDIRFILES) * LXPR_SDSIZE;
+ break;
+ case LXPR_PIDDIR:
+ vap->va_nlink = PIDDIRFILES;
+ vap->va_size = PIDDIRFILES * LXPR_SDSIZE;
+ break;
+ case LXPR_SELF:
+ vap->va_uid = crgetruid(curproc->p_cred);
+ vap->va_gid = crgetrgid(curproc->p_cred);
+ break;
+ default:
+ break;
+ }
+
+ vap->va_nblocks = (fsblkcnt64_t)btod(vap->va_size);
+ return (0);
+}
+
+/*
+ * lxpr_access(): Vnode operation for VOP_ACCESS()
+ */
+static int
+lxpr_access(vnode_t *vp, int mode, int flags, cred_t *cr, caller_context_t *ct)
+{
+ lxpr_node_t *lxpnp = VTOLXP(vp);
+ int shift = 0;
+ proc_t *tp;
+
+ /* lx /proc is a read only file system */
+ if (mode & VWRITE)
+ return (EROFS);
+
+ /*
+ * If this is a restricted file, check access permissions.
+ */
+ switch (lxpnp->lxpr_type) {
+ case LXPR_PIDDIR:
+ return (0);
+ case LXPR_PID_CURDIR:
+ case LXPR_PID_ENV:
+ case LXPR_PID_EXE:
+ case LXPR_PID_MAPS:
+ case LXPR_PID_MEM:
+ case LXPR_PID_ROOTDIR:
+ case LXPR_PID_FDDIR:
+ case LXPR_PID_FD_FD:
+ if ((tp = lxpr_lock(lxpnp->lxpr_pid)) == NULL)
+ return (ENOENT);
+ if (tp != curproc && secpolicy_proc_access(cr) != 0 &&
+ priv_proc_cred_perm(cr, tp, NULL, mode) != 0) {
+ lxpr_unlock(tp);
+ return (EACCES);
+ }
+ lxpr_unlock(tp);
+ default:
+ break;
+ }
+
+ if (lxpnp->lxpr_realvp != NULL) {
+ /*
+ * For these we use the underlying vnode's accessibility.
+ */
+ return (VOP_ACCESS(lxpnp->lxpr_realvp, mode, flags, cr, ct));
+ }
+
+ /* If user is root allow access regardless of permission bits */
+ if (secpolicy_proc_access(cr) == 0)
+ return (0);
+
+ /*
+ * Access check is based on only one of owner, group, public. If not
+ * owner, then check group. If not a member of the group, then check
+ * public access.
+ */
+ if (crgetuid(cr) != lxpnp->lxpr_uid) {
+ shift += 3;
+ if (!groupmember((uid_t)lxpnp->lxpr_gid, cr))
+ shift += 3;
+ }
+
+ mode &= ~(lxpnp->lxpr_mode << shift);
+
+ if (mode == 0)
+ return (0);
+
+ return (EACCES);
+}
+
+/* ARGSUSED */
+static vnode_t *
+lxpr_lookup_not_a_dir(vnode_t *dp, char *comp)
+{
+ return (NULL);
+}
+
+/*
+ * lxpr_lookup(): Vnode operation for VOP_LOOKUP()
+ */
+/* ARGSUSED */
+static int
+lxpr_lookup(vnode_t *dp, char *comp, vnode_t **vpp, pathname_t *pathp,
+ int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct,
+ int *direntflags, pathname_t *realpnp)
+{
+ lxpr_node_t *lxpnp = VTOLXP(dp);
+ lxpr_nodetype_t type = lxpnp->lxpr_type;
+ int error;
+
+ ASSERT(dp->v_type == VDIR);
+ ASSERT(type < LXPR_NFILES);
+
+ /*
+ * we should never get here because the lookup
+ * is done on the realvp for these nodes
+ */
+ ASSERT(type != LXPR_PID_FD_FD &&
+ type != LXPR_PID_CURDIR &&
+ type != LXPR_PID_ROOTDIR);
+
+ /*
+ * restrict lookup permission to owner or root
+ */
+ if ((error = lxpr_access(dp, VEXEC, 0, cr, ct)) != 0) {
+ return (error);
+ }
+
+ /*
+ * Just return the parent vnode if that's where we are trying to go.
+ */
+ if (strcmp(comp, "..") == 0) {
+ VN_HOLD(lxpnp->lxpr_parent);
+ *vpp = lxpnp->lxpr_parent;
+ return (0);
+ }
+
+ /*
+ * Special handling for directory searches. Note: null component name
+ * denotes that the current directory is being searched.
+ */
+ if ((dp->v_type == VDIR) && (*comp == '\0' || strcmp(comp, ".") == 0)) {
+ VN_HOLD(dp);
+ *vpp = dp;
+ return (0);
+ }
+
+ *vpp = (lxpr_lookup_function[type](dp, comp));
+ return ((*vpp == NULL) ? ENOENT : 0);
+}
+
+/*
+ * Do a sequential search on the given directory table
+ */
+static vnode_t *
+lxpr_lookup_common(vnode_t *dp, char *comp, proc_t *p,
+ lxpr_dirent_t *dirtab, int dirtablen)
+{
+ lxpr_node_t *lxpnp;
+ int count;
+
+ for (count = 0; count < dirtablen; count++) {
+ if (strcmp(dirtab[count].d_name, comp) == 0) {
+ lxpnp = lxpr_getnode(dp, dirtab[count].d_type, p, 0);
+ dp = LXPTOV(lxpnp);
+ ASSERT(dp != NULL);
+ return (dp);
+ }
+ }
+ return (NULL);
+}
+
+static vnode_t *
+lxpr_lookup_piddir(vnode_t *dp, char *comp)
+{
+ proc_t *p;
+
+ ASSERT(VTOLXP(dp)->lxpr_type == LXPR_PIDDIR);
+
+ p = lxpr_lock(VTOLXP(dp)->lxpr_pid);
+ if (p == NULL)
+ return (NULL);
+
+ dp = lxpr_lookup_common(dp, comp, p, piddir, PIDDIRFILES);
+
+ lxpr_unlock(p);
+
+ return (dp);
+}
+
+/*
+ * Lookup one of the process's open files.
+ */
+static vnode_t *
+lxpr_lookup_fddir(vnode_t *dp, char *comp)
+{
+ lxpr_node_t *dlxpnp = VTOLXP(dp);
+ lxpr_node_t *lxpnp;
+ vnode_t *vp = NULL;
+ proc_t *p;
+ file_t *fp;
+ uint_t fd;
+ int c;
+ uf_entry_t *ufp;
+ uf_info_t *fip;
+
+ ASSERT(dlxpnp->lxpr_type == LXPR_PID_FDDIR);
+
+ /*
+ * convert the string rendition of the filename
+ * to a file descriptor
+ */
+ fd = 0;
+ while ((c = *comp++) != '\0') {
+ int ofd;
+ if (c < '0' || c > '9')
+ return (NULL);
+
+ ofd = fd;
+ fd = 10*fd + c - '0';
+ /* integer overflow */
+ if (fd / 10 != ofd)
+ return (NULL);
+ }
+
+ /*
+ * get the proc to work with and lock it
+ */
+ p = lxpr_lock(dlxpnp->lxpr_pid);
+ if ((p == NULL))
+ return (NULL);
+
+ /*
+ * If the process is a zombie or system process
+ * it can't have any open files.
+ */
+ if ((p->p_stat == SZOMB) || (p->p_flag & SSYS) || (p->p_as == &kas)) {
+ lxpr_unlock(p);
+ return (NULL);
+ }
+
+ /*
+ * get us a fresh node/vnode
+ */
+ lxpnp = lxpr_getnode(dp, LXPR_PID_FD_FD, p, fd);
+
+ /*
+ * Drop p_lock, but keep the process P_PR_LOCK'd to prevent it from
+ * going away while we dereference into fi_list.
+ */
+ mutex_exit(&p->p_lock);
+
+ /*
+ * get open file info
+ */
+ fip = (&(p)->p_user.u_finfo);
+ mutex_enter(&fip->fi_lock);
+
+ if (fd < fip->fi_nfiles) {
+ UF_ENTER(ufp, fip, fd);
+ /*
+ * ensure the fd is still kosher.
+ * it may have gone between the readdir and
+ * the lookup
+ */
+ if (fip->fi_list[fd].uf_file == NULL) {
+ mutex_exit(&fip->fi_lock);
+ UF_EXIT(ufp);
+ mutex_enter(&p->p_lock);
+ lxpr_unlock(p);
+ lxpr_freenode(lxpnp);
+ return (NULL);
+ }
+
+ if ((fp = ufp->uf_file) != NULL)
+ vp = fp->f_vnode;
+ UF_EXIT(ufp);
+ }
+ mutex_exit(&fip->fi_lock);
+
+ if (vp == NULL) {
+ mutex_enter(&p->p_lock);
+ lxpr_unlock(p);
+ lxpr_freenode(lxpnp);
+ return (NULL);
+ } else {
+ /*
+ * Fill in the lxpr_node so future references will be able to
+ * find the underlying vnode. The vnode is held on the realvp.
+ */
+ lxpnp->lxpr_realvp = vp;
+ VN_HOLD(lxpnp->lxpr_realvp);
+ }
+
+ mutex_enter(&p->p_lock);
+ lxpr_unlock(p);
+ dp = LXPTOV(lxpnp);
+ ASSERT(dp != NULL);
+
+ return (dp);
+}
+
+static vnode_t *
+lxpr_lookup_netdir(vnode_t *dp, char *comp)
+{
+ ASSERT(VTOLXP(dp)->lxpr_type == LXPR_NETDIR);
+
+ dp = lxpr_lookup_common(dp, comp, NULL, netdir, NETDIRFILES);
+
+ return (dp);
+}
+
+static vnode_t *
+lxpr_lookup_procdir(vnode_t *dp, char *comp)
+{
+ ASSERT(VTOLXP(dp)->lxpr_type == LXPR_PROCDIR);
+
+ /*
+ * We know all the names of files & dirs in our file system structure
+ * except those that are pid names. These change as pids are created/
+ * deleted etc., so we just look for a number as the first char to see
+ * if we are we doing pid lookups.
+ *
+ * Don't need to check for "self" as it is implemented as a symlink
+ */
+ if (*comp >= '0' && *comp <= '9') {
+ pid_t pid = 0;
+ lxpr_node_t *lxpnp = NULL;
+ proc_t *p;
+ int c;
+
+ while ((c = *comp++) != '\0')
+ pid = 10 * pid + c - '0';
+
+ /*
+ * Can't continue if the process is still loading or it doesn't
+ * really exist yet (or maybe it just died!)
+ */
+ p = lxpr_lock(pid);
+ if (p == NULL)
+ return (NULL);
+
+ if (secpolicy_basic_procinfo(CRED(), p, curproc) != 0) {
+ lxpr_unlock(p);
+ return (NULL);
+ }
+
+ /*
+ * allocate and fill in a new lxpr node
+ */
+ lxpnp = lxpr_getnode(dp, LXPR_PIDDIR, p, 0);
+
+ lxpr_unlock(p);
+
+ dp = LXPTOV(lxpnp);
+ ASSERT(dp != NULL);
+
+ return (dp);
+ }
+
+ /* Lookup fixed names */
+ return (lxpr_lookup_common(dp, comp, NULL, lxpr_dir, PROCDIRFILES));
+}
+
+/*
+ * lxpr_readdir(): Vnode operation for VOP_READDIR()
+ */
+/* ARGSUSED */
+static int
+lxpr_readdir(vnode_t *dp, uio_t *uiop, cred_t *cr, int *eofp,
+ caller_context_t *ct, int flags)
+{
+ lxpr_node_t *lxpnp = VTOLXP(dp);
+ lxpr_nodetype_t type = lxpnp->lxpr_type;
+ ssize_t uresid;
+ off_t uoffset;
+ int error;
+
+ ASSERT(dp->v_type == VDIR);
+ ASSERT(type < LXPR_NFILES);
+
+ /*
+ * we should never get here because the readdir
+ * is done on the realvp for these nodes
+ */
+ ASSERT(type != LXPR_PID_FD_FD &&
+ type != LXPR_PID_CURDIR &&
+ type != LXPR_PID_ROOTDIR);
+
+ /*
+ * restrict readdir permission to owner or root
+ */
+ if ((error = lxpr_access(dp, VREAD, 0, cr, ct)) != 0)
+ return (error);
+
+ uoffset = uiop->uio_offset;
+ uresid = uiop->uio_resid;
+
+ /* can't do negative reads */
+ if (uoffset < 0 || uresid <= 0)
+ return (EINVAL);
+
+ /* can't read directory entries that don't exist! */
+ if (uoffset % LXPR_SDSIZE)
+ return (ENOENT);
+
+ return (lxpr_readdir_function[lxpnp->lxpr_type](lxpnp, uiop, eofp));
+}
+
+/* ARGSUSED */
+static int
+lxpr_readdir_not_a_dir(lxpr_node_t *lxpnp, uio_t *uiop, int *eofp)
+{
+ return (ENOTDIR);
+}
+
+/*
+ * This has the common logic for returning directory entries
+ */
+static int
+lxpr_readdir_common(lxpr_node_t *lxpnp, uio_t *uiop, int *eofp,
+ lxpr_dirent_t *dirtab, int dirtablen)
+{
+ /* bp holds one dirent64 structure */
+ longlong_t bp[DIRENT64_RECLEN(LXPNSIZ) / sizeof (longlong_t)];
+ dirent64_t *dirent = (dirent64_t *)bp;
+ ssize_t oresid; /* save a copy for testing later */
+ ssize_t uresid;
+
+ oresid = uiop->uio_resid;
+
+ /* clear out the dirent buffer */
+ bzero(bp, sizeof (bp));
+
+ /*
+ * Satisfy user request
+ */
+ while ((uresid = uiop->uio_resid) > 0) {
+ int dirindex;
+ off_t uoffset;
+ int reclen;
+ int error;
+
+ uoffset = uiop->uio_offset;
+ dirindex = (uoffset / LXPR_SDSIZE) - 2;
+
+ if (uoffset == 0) {
+
+ dirent->d_ino = lxpnp->lxpr_ino;
+ dirent->d_name[0] = '.';
+ dirent->d_name[1] = '\0';
+ reclen = DIRENT64_RECLEN(1);
+
+ } else if (uoffset == LXPR_SDSIZE) {
+
+ dirent->d_ino = lxpr_parentinode(lxpnp);
+ dirent->d_name[0] = '.';
+ dirent->d_name[1] = '.';
+ dirent->d_name[2] = '\0';
+ reclen = DIRENT64_RECLEN(2);
+
+ } else if (dirindex < dirtablen) {
+ int slen = strlen(dirtab[dirindex].d_name);
+
+ dirent->d_ino = lxpr_inode(dirtab[dirindex].d_type,
+ lxpnp->lxpr_pid, 0);
+
+ ASSERT(slen < LXPNSIZ);
+ (void) strcpy(dirent->d_name, dirtab[dirindex].d_name);
+ reclen = DIRENT64_RECLEN(slen);
+
+ } else {
+ /* Run out of table entries */
+ if (eofp) {
+ *eofp = 1;
+ }
+ return (0);
+ }
+
+ dirent->d_off = (off64_t)(uoffset + LXPR_SDSIZE);
+ dirent->d_reclen = (ushort_t)reclen;
+
+ /*
+ * if the size of the data to transfer is greater
+ * that that requested then we can't do it this transfer.
+ */
+ if (reclen > uresid) {
+ /*
+ * Error if no entries have been returned yet.
+ */
+ if (uresid == oresid) {
+ return (EINVAL);
+ }
+ break;
+ }
+
+ /*
+ * uiomove() updates both uiop->uio_resid and uiop->uio_offset
+ * by the same amount. But we want uiop->uio_offset to change
+ * in increments of LXPR_SDSIZE, which is different from the
+ * number of bytes being returned to the user. So we set
+ * uiop->uio_offset separately, ignoring what uiomove() does.
+ */
+ if ((error = uiomove((caddr_t)dirent, reclen, UIO_READ,
+ uiop)) != 0)
+ return (error);
+
+ uiop->uio_offset = uoffset + LXPR_SDSIZE;
+ }
+
+ /* Have run out of space, but could have just done last table entry */
+ if (eofp) {
+ *eofp =
+ (uiop->uio_offset >= ((dirtablen+2) * LXPR_SDSIZE)) ? 1 : 0;
+ }
+ return (0);
+}
+
+
+static int
+lxpr_readdir_procdir(lxpr_node_t *lxpnp, uio_t *uiop, int *eofp)
+{
+ /* bp holds one dirent64 structure */
+ longlong_t bp[DIRENT64_RECLEN(LXPNSIZ) / sizeof (longlong_t)];
+ dirent64_t *dirent = (dirent64_t *)bp;
+ ssize_t oresid; /* save a copy for testing later */
+ ssize_t uresid;
+ off_t uoffset;
+ zoneid_t zoneid;
+ pid_t pid;
+ int error;
+ int ceof;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PROCDIR);
+
+ oresid = uiop->uio_resid;
+ zoneid = LXPTOZ(lxpnp)->zone_id;
+
+ /*
+ * We return directory entries in the order: "." and ".." then the
+ * unique lxproc files, then the directories corresponding to the
+ * running processes. We have defined this as the ordering because
+ * it allows us to more easily keep track of where we are betwen calls
+ * to getdents(). If the number of processes changes between calls
+ * then we can't lose track of where we are in the lxproc files.
+ */
+
+ /* Do the fixed entries */
+ error = lxpr_readdir_common(lxpnp, uiop, &ceof, lxpr_dir,
+ PROCDIRFILES);
+
+ /* Finished if we got an error or if we couldn't do all the table */
+ if (error != 0 || ceof == 0)
+ return (error);
+
+ /* clear out the dirent buffer */
+ bzero(bp, sizeof (bp));
+
+ /* Do the process entries */
+ while ((uresid = uiop->uio_resid) > 0) {
+ proc_t *p;
+ int len;
+ int reclen;
+ int i;
+
+ uoffset = uiop->uio_offset;
+
+ /*
+ * Stop when entire proc table has been examined.
+ */
+ i = (uoffset / LXPR_SDSIZE) - 2 - PROCDIRFILES;
+ if (i >= v.v_proc) {
+ /* Run out of table entries */
+ if (eofp) {
+ *eofp = 1;
+ }
+ return (0);
+ }
+ mutex_enter(&pidlock);
+
+ /*
+ * Skip indices for which there is no pid_entry, PIDs for
+ * which there is no corresponding process, a PID of 0,
+ * and anything the security policy doesn't allow
+ * us to look at.
+ */
+ if ((p = pid_entry(i)) == NULL || p->p_stat == SIDL ||
+ p->p_pid == 0 ||
+ secpolicy_basic_procinfo(CRED(), p, curproc) != 0) {
+ mutex_exit(&pidlock);
+ goto next;
+ }
+ mutex_exit(&pidlock);
+
+ /*
+ * Convert pid to the Linux default of 1 if we're the zone's
+ * init process, otherwise use the value from the proc
+ * structure
+ */
+ pid = ((p->p_pid != curproc->p_zone->zone_proc_initpid) ?
+ p->p_pid : 1);
+
+ /*
+ * If this /proc was mounted in the global zone, view
+ * all procs; otherwise, only view zone member procs.
+ */
+ if (zoneid != GLOBAL_ZONEID && p->p_zone->zone_id != zoneid) {
+ goto next;
+ }
+
+ ASSERT(p->p_stat != 0);
+
+ dirent->d_ino = lxpr_inode(LXPR_PIDDIR, pid, 0);
+ len = snprintf(dirent->d_name, LXPNSIZ, "%d", pid);
+ ASSERT(len < LXPNSIZ);
+ reclen = DIRENT64_RECLEN(len);
+
+ dirent->d_off = (off64_t)(uoffset + LXPR_SDSIZE);
+ dirent->d_reclen = (ushort_t)reclen;
+
+ /*
+ * if the size of the data to transfer is greater
+ * that that requested then we can't do it this transfer.
+ */
+ if (reclen > uresid) {
+ /*
+ * Error if no entries have been returned yet.
+ */
+ if (uresid == oresid)
+ return (EINVAL);
+ break;
+ }
+
+ /*
+ * uiomove() updates both uiop->uio_resid and uiop->uio_offset
+ * by the same amount. But we want uiop->uio_offset to change
+ * in increments of LXPR_SDSIZE, which is different from the
+ * number of bytes being returned to the user. So we set
+ * uiop->uio_offset separately, in the increment of this for
+ * the loop, ignoring what uiomove() does.
+ */
+ if ((error = uiomove((caddr_t)dirent, reclen, UIO_READ,
+ uiop)) != 0)
+ return (error);
+next:
+ uiop->uio_offset = uoffset + LXPR_SDSIZE;
+ }
+
+ if (eofp != NULL) {
+ *eofp = (uiop->uio_offset >=
+ ((v.v_proc + PROCDIRFILES + 2) * LXPR_SDSIZE)) ? 1 : 0;
+ }
+
+ return (0);
+}
+
+static int
+lxpr_readdir_piddir(lxpr_node_t *lxpnp, uio_t *uiop, int *eofp)
+{
+ proc_t *p;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PIDDIR);
+
+ /* can't read its contents if it died */
+ mutex_enter(&pidlock);
+
+ p = prfind((lxpnp->lxpr_pid == 1) ?
+ curproc->p_zone->zone_proc_initpid : lxpnp->lxpr_pid);
+
+ if (p == NULL || p->p_stat == SIDL) {
+ mutex_exit(&pidlock);
+ return (ENOENT);
+ }
+ mutex_exit(&pidlock);
+
+ return (lxpr_readdir_common(lxpnp, uiop, eofp, piddir, PIDDIRFILES));
+}
+
+static int
+lxpr_readdir_netdir(lxpr_node_t *lxpnp, uio_t *uiop, int *eofp)
+{
+ ASSERT(lxpnp->lxpr_type == LXPR_NETDIR);
+ return (lxpr_readdir_common(lxpnp, uiop, eofp, netdir, NETDIRFILES));
+}
+
+static int
+lxpr_readdir_fddir(lxpr_node_t *lxpnp, uio_t *uiop, int *eofp)
+{
+ /* bp holds one dirent64 structure */
+ longlong_t bp[DIRENT64_RECLEN(LXPNSIZ) / sizeof (longlong_t)];
+ dirent64_t *dirent = (dirent64_t *)bp;
+ ssize_t oresid; /* save a copy for testing later */
+ ssize_t uresid;
+ off_t uoffset;
+ int error;
+ int ceof;
+ proc_t *p;
+ int fddirsize = -1;
+ uf_info_t *fip;
+
+ ASSERT(lxpnp->lxpr_type == LXPR_PID_FDDIR);
+
+ oresid = uiop->uio_resid;
+
+ /* can't read its contents if it died */
+ p = lxpr_lock(lxpnp->lxpr_pid);
+ if (p == NULL)
+ return (ENOENT);
+
+ if ((p->p_stat == SZOMB) || (p->p_flag & SSYS) || (p->p_as == &kas))
+ fddirsize = 0;
+
+ /*
+ * Drop p_lock, but keep the process P_PR_LOCK'd to prevent it from
+ * going away while we iterate over its fi_list.
+ */
+ mutex_exit(&p->p_lock);
+
+ /* Get open file info */
+ fip = (&(p)->p_user.u_finfo);
+ mutex_enter(&fip->fi_lock);
+
+ if (fddirsize == -1)
+ fddirsize = fip->fi_nfiles;
+
+ /* Do the fixed entries (in this case just "." & "..") */
+ error = lxpr_readdir_common(lxpnp, uiop, &ceof, 0, 0);
+
+ /* Finished if we got an error or if we couldn't do all the table */
+ if (error != 0 || ceof == 0)
+ goto out;
+
+ /* clear out the dirent buffer */
+ bzero(bp, sizeof (bp));
+
+ /*
+ * Loop until user's request is satisfied or until
+ * all file descriptors have been examined.
+ */
+ for (; (uresid = uiop->uio_resid) > 0;
+ uiop->uio_offset = uoffset + LXPR_SDSIZE) {
+ int reclen;
+ int fd;
+ int len;
+
+ uoffset = uiop->uio_offset;
+
+ /*
+ * Stop at the end of the fd list
+ */
+ fd = (uoffset / LXPR_SDSIZE) - 2;
+ if (fd >= fddirsize) {
+ if (eofp) {
+ *eofp = 1;
+ }
+ goto out;
+ }
+
+ if (fip->fi_list[fd].uf_file == NULL)
+ continue;
+
+ dirent->d_ino = lxpr_inode(LXPR_PID_FD_FD, lxpnp->lxpr_pid, fd);
+ len = snprintf(dirent->d_name, LXPNSIZ, "%d", fd);
+ ASSERT(len < LXPNSIZ);
+ reclen = DIRENT64_RECLEN(len);
+
+ dirent->d_off = (off64_t)(uoffset + LXPR_SDSIZE);
+ dirent->d_reclen = (ushort_t)reclen;
+
+ if (reclen > uresid) {
+ /*
+ * Error if no entries have been returned yet.
+ */
+ if (uresid == oresid)
+ error = EINVAL;
+ goto out;
+ }
+
+ if ((error = uiomove((caddr_t)dirent, reclen, UIO_READ,
+ uiop)) != 0)
+ goto out;
+ }
+
+ if (eofp != NULL) {
+ *eofp =
+ (uiop->uio_offset >= ((fddirsize+2) * LXPR_SDSIZE)) ? 1 : 0;
+ }
+
+out:
+ mutex_exit(&fip->fi_lock);
+ mutex_enter(&p->p_lock);
+ lxpr_unlock(p);
+ return (error);
+}
+
+
+/*
+ * lxpr_readlink(): Vnode operation for VOP_READLINK()
+ */
+/* ARGSUSED */
+static int
+lxpr_readlink(vnode_t *vp, uio_t *uiop, cred_t *cr, caller_context_t *ct)
+{
+ char bp[MAXPATHLEN + 1];
+ size_t buflen = sizeof (bp);
+ lxpr_node_t *lxpnp = VTOLXP(vp);
+ vnode_t *rvp = lxpnp->lxpr_realvp;
+ pid_t pid;
+ int error = 0;
+
+ /* must be a symbolic link file */
+ if (vp->v_type != VLNK)
+ return (EINVAL);
+
+ /* Try to produce a symlink name for anything that has a realvp */
+ if (rvp != NULL) {
+ if ((error = lxpr_access(vp, VREAD, 0, CRED(), ct)) != 0)
+ return (error);
+ if ((error = vnodetopath(NULL, rvp, bp, buflen, CRED())) != 0)
+ return (error);
+ } else {
+ switch (lxpnp->lxpr_type) {
+ case LXPR_SELF:
+ /*
+ * Convert pid to the Linux default of 1 if we're the
+ * zone's init process
+ */
+ pid = ((curproc->p_pid !=
+ curproc->p_zone->zone_proc_initpid)
+ ? curproc->p_pid : 1);
+
+ /*
+ * Don't need to check result as every possible int
+ * will fit within MAXPATHLEN bytes.
+ */
+ (void) snprintf(bp, buflen, "%d", pid);
+ break;
+ case LXPR_PID_CURDIR:
+ case LXPR_PID_ROOTDIR:
+ case LXPR_PID_EXE:
+ return (EACCES);
+ default:
+ /*
+ * Need to return error so that nothing thinks
+ * that the symlink is empty and hence "."
+ */
+ return (EINVAL);
+ }
+ }
+
+ /* copy the link data to user space */
+ return (uiomove(bp, strlen(bp), UIO_READ, uiop));
+}
+
+/*
+ * lxpr_inactive(): Vnode operation for VOP_INACTIVE()
+ * Vnode is no longer referenced, deallocate the file
+ * and all its resources.
+ */
+/* ARGSUSED */
+static void
+lxpr_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct)
+{
+ lxpr_freenode(VTOLXP(vp));
+}
+
+/*
+ * lxpr_sync(): Vnode operation for VOP_SYNC()
+ */
+static int
+lxpr_sync()
+{
+ /*
+ * Nothing to sync but this function must never fail
+ */
+ return (0);
+}
+
+/*
+ * lxpr_cmp(): Vnode operation for VOP_CMP()
+ */
+static int
+lxpr_cmp(vnode_t *vp1, vnode_t *vp2, caller_context_t *ct)
+{
+ vnode_t *rvp;
+
+ while (vn_matchops(vp1, lxpr_vnodeops) &&
+ (rvp = VTOLXP(vp1)->lxpr_realvp) != NULL) {
+ vp1 = rvp;
+ }
+
+ while (vn_matchops(vp2, lxpr_vnodeops) &&
+ (rvp = VTOLXP(vp2)->lxpr_realvp) != NULL) {
+ vp2 = rvp;
+ }
+
+ if (vn_matchops(vp1, lxpr_vnodeops) || vn_matchops(vp2, lxpr_vnodeops))
+ return (vp1 == vp2);
+
+ return (VOP_CMP(vp1, vp2, ct));
+}
+
+/*
+ * lxpr_realvp(): Vnode operation for VOP_REALVP()
+ */
+static int
+lxpr_realvp(vnode_t *vp, vnode_t **vpp, caller_context_t *ct)
+{
+ vnode_t *rvp;
+
+ if ((rvp = VTOLXP(vp)->lxpr_realvp) != NULL) {
+ vp = rvp;
+ if (VOP_REALVP(vp, &rvp, ct) == 0)
+ vp = rvp;
+ }
+
+ *vpp = vp;
+ return (0);
+}
diff --git a/usr/src/uts/common/fs/lxproc/lxproc.h b/usr/src/uts/common/fs/lxproc/lxproc.h
new file mode 100644
index 0000000000..a06bef1570
--- /dev/null
+++ b/usr/src/uts/common/fs/lxproc/lxproc.h
@@ -0,0 +1,275 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+#ifndef _LXPROC_H
+#define _LXPROC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * lxproc.h: declarations, data structures and macros for lxprocfs
+ */
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/policy.h>
+#include <sys/debug.h>
+#include <sys/dirent.h>
+#include <sys/errno.h>
+#include <sys/file.h>
+#include <sys/kmem.h>
+#include <sys/pathname.h>
+#include <sys/proc.h>
+#include <sys/systm.h>
+#include <sys/var.h>
+#include <sys/user.h>
+#include <sys/t_lock.h>
+#include <sys/sysmacros.h>
+#include <sys/cred.h>
+#include <sys/priv.h>
+#include <sys/vnode.h>
+#include <sys/vfs.h>
+#include <sys/statvfs.h>
+#include <sys/cmn_err.h>
+#include <sys/zone.h>
+#include <sys/uio.h>
+#include <sys/utsname.h>
+#include <sys/dnlc.h>
+#include <sys/atomic.h>
+#include <sys/sunddi.h>
+#include <sys/sunldi.h>
+#include <vm/as.h>
+#include <vm/anon.h>
+
+#define LX_SIGHUP 1
+#define LX_SIGINT 2
+#define LX_SIGQUIT 3
+#define LX_SIGILL 4
+#define LX_SIGTRAP 5
+#define LX_SIGABRT 6
+#define LX_SIGIOT 6
+#define LX_SIGBUS 7
+#define LX_SIGFPE 8
+#define LX_SIGKILL 9
+#define LX_SIGUSR1 10
+#define LX_SIGSEGV 11
+#define LX_SIGUSR2 12
+#define LX_SIGPIPE 13
+#define LX_SIGALRM 14
+#define LX_SIGTERM 15
+#define LX_SIGSTKFLT 16
+#define LX_SIGCHLD 17
+#define LX_SIGCONT 18
+#define LX_SIGSTOP 19
+#define LX_SIGTSTP 20
+#define LX_SIGTTIN 21
+#define LX_SIGTTOU 22
+#define LX_SIGURG 23
+#define LX_SIGXCPU 24
+#define LX_SIGXFSZ 25
+#define LX_SIGVTALRM 26
+#define LX_SIGPROF 27
+#define LX_SIGWINCH 28
+#define LX_SIGIO 29
+#define LX_SIGPOLL LX_SIGIO
+#define LX_SIGPWR 30
+#define LX_SIGSYS 31
+#define LX_SIGUNUSED 31
+
+#define LX_NSIG_WORDS 2
+#define LX_NBPW 32
+#define LX_NSIG ((LX_NBPW * LX_NSIG_WORDS) + 1)
+
+#define LX_SIGRTMIN 32
+#define LX_SIGRTMAX LX_NSIG - 1
+
+/*
+ * Convert a vnode into an lxpr_mnt_t
+ */
+#define VTOLXPM(vp) ((lxpr_mnt_t *)(vp)->v_vfsp->vfs_data)
+
+/*
+ * convert a vnode into an lxpr_node
+ */
+#define VTOLXP(vp) ((lxpr_node_t *)(vp)->v_data)
+
+/*
+ * convert a lxprnode into a vnode
+ */
+#define LXPTOV(lxpnp) ((lxpnp)->lxpr_vnode)
+
+/*
+ * convert a lxpr_node into zone for fs
+ */
+#define LXPTOZ(lxpnp) \
+ (((lxpr_mnt_t *)(lxpnp)->lxpr_vnode->v_vfsp->vfs_data)->lxprm_zone)
+
+#define LXPNSIZ 256 /* max size of lx /proc file name entries */
+
+/*
+ * Pretend that a directory entry takes 16 bytes
+ */
+#define LXPR_SDSIZE 16
+
+/*
+ * Node/file types for lx /proc files
+ * (directories and files contained therein).
+ */
+typedef enum lxpr_nodetype {
+ LXPR_PROCDIR, /* /proc */
+ LXPR_PIDDIR, /* /proc/<pid> */
+ LXPR_PID_CMDLINE, /* /proc/<pid>/cmdline */
+ LXPR_PID_CPU, /* /proc/<pid>/cpu */
+ LXPR_PID_CURDIR, /* /proc/<pid>/cwd */
+ LXPR_PID_ENV, /* /proc/<pid>/environ */
+ LXPR_PID_EXE, /* /proc/<pid>/exe */
+ LXPR_PID_MAPS, /* /proc/<pid>/maps */
+ LXPR_PID_MEM, /* /proc/<pid>/mem */
+ LXPR_PID_ROOTDIR, /* /proc/<pid>/root */
+ LXPR_PID_STAT, /* /proc/<pid>/stat */
+ LXPR_PID_STATM, /* /proc/<pid>/statm */
+ LXPR_PID_STATUS, /* /proc/<pid>/status */
+ LXPR_PID_FDDIR, /* /proc/<pid>/fd */
+ LXPR_PID_FD_FD, /* /proc/<pid>/fd/nn */
+ LXPR_CMDLINE, /* /proc/cmdline */
+ LXPR_CPUINFO, /* /proc/cpuinfo */
+ LXPR_DEVICES, /* /proc/devices */
+ LXPR_DMA, /* /proc/dma */
+ LXPR_FILESYSTEMS, /* /proc/filesystems */
+ LXPR_INTERRUPTS, /* /proc/interrupts */
+ LXPR_IOPORTS, /* /proc/ioports */
+ LXPR_KCORE, /* /proc/kcore */
+ LXPR_KMSG, /* /proc/kmsg */
+ LXPR_LOADAVG, /* /proc/loadavg */
+ LXPR_MEMINFO, /* /proc/meminfo */
+ LXPR_MOUNTS, /* /proc/mounts */
+ LXPR_NETDIR, /* /proc/net */
+ LXPR_NET_ARP, /* /proc/net/arp */
+ LXPR_NET_DEV, /* /proc/net/dev */
+ LXPR_NET_DEV_MCAST, /* /proc/net/dev_mcast */
+ LXPR_NET_IGMP, /* /proc/net/igmp */
+ LXPR_NET_IP_MR_CACHE, /* /proc/net/ip_mr_cache */
+ LXPR_NET_IP_MR_VIF, /* /proc/net/ip_mr_vif */
+ LXPR_NET_MCFILTER, /* /proc/net/mcfilter */
+ LXPR_NET_NETSTAT, /* /proc/net/netstat */
+ LXPR_NET_RAW, /* /proc/net/raw */
+ LXPR_NET_ROUTE, /* /proc/net/route */
+ LXPR_NET_RPC, /* /proc/net/rpc */
+ LXPR_NET_RT_CACHE, /* /proc/net/rt_cache */
+ LXPR_NET_SOCKSTAT, /* /proc/net/sockstat */
+ LXPR_NET_SNMP, /* /proc/net/snmp */
+ LXPR_NET_STAT, /* /proc/net/stat */
+ LXPR_NET_TCP, /* /proc/net/tcp */
+ LXPR_NET_UDP, /* /proc/net/udp */
+ LXPR_NET_UNIX, /* /proc/net/unix */
+ LXPR_PARTITIONS, /* /proc/partitions */
+ LXPR_SELF, /* /proc/self */
+ LXPR_STAT, /* /proc/stat */
+ LXPR_UPTIME, /* /proc/uptime */
+ LXPR_VERSION, /* /proc/version */
+ LXPR_NFILES /* number of lx /proc file types */
+} lxpr_nodetype_t;
+
+/*
+ * Number of fds allowed for in the inode number calculation
+ * per process (if a process has more fds then inode numbers
+ * may be duplicated)
+ */
+#define LXPR_FD_PERPROC 2000
+
+/*
+ * external dirent characteristics
+ */
+#define LXPRMAXNAMELEN 14
+typedef struct {
+ lxpr_nodetype_t d_type;
+ char d_name[LXPRMAXNAMELEN];
+} lxpr_dirent_t;
+
+/*
+ * This is the lxprocfs private data object
+ * which is attached to v_data in the vnode structure
+ */
+typedef struct lxpr_node {
+ lxpr_nodetype_t lxpr_type; /* type of this node */
+ vnode_t *lxpr_vnode; /* vnode for the node */
+ vnode_t *lxpr_parent; /* parent directory */
+ vnode_t *lxpr_realvp; /* real vnode, file in dirs */
+ timestruc_t lxpr_time; /* creation etc time for file */
+ mode_t lxpr_mode; /* file mode bits */
+ uid_t lxpr_uid; /* file owner */
+ gid_t lxpr_gid; /* file group owner */
+ pid_t lxpr_pid; /* pid of proc referred to */
+ ino_t lxpr_ino; /* node id */
+ ldi_handle_t lxpr_cons_ldih; /* ldi handle for console device */
+} lxpr_node_t;
+
+struct zone; /* forward declaration */
+
+/*
+ * This is the lxprocfs private data object
+ * which is attached to vfs_data in the vfs structure
+ */
+typedef struct lxpr_mnt {
+ lxpr_node_t *lxprm_node; /* node at root of proc mount */
+ struct zone *lxprm_zone; /* zone for this mount */
+ ldi_ident_t lxprm_li; /* ident for ldi */
+} lxpr_mnt_t;
+
+extern vnodeops_t *lxpr_vnodeops;
+extern int nproc_highbit; /* highbit(v.v_nproc) */
+
+typedef struct mounta mounta_t;
+
+extern void lxpr_initnodecache();
+extern void lxpr_fininodecache();
+extern void lxpr_initrootnode(lxpr_node_t **, vfs_t *);
+extern ino_t lxpr_inode(lxpr_nodetype_t, pid_t, int);
+extern ino_t lxpr_parentinode(lxpr_node_t *);
+extern lxpr_node_t *lxpr_getnode(vnode_t *, lxpr_nodetype_t, proc_t *, int);
+extern void lxpr_freenode(lxpr_node_t *);
+
+typedef struct lxpr_uiobuf lxpr_uiobuf_t;
+extern lxpr_uiobuf_t *lxpr_uiobuf_new(uio_t *);
+extern void lxpr_uiobuf_free(lxpr_uiobuf_t *);
+extern int lxpr_uiobuf_flush(lxpr_uiobuf_t *);
+extern void lxpr_uiobuf_seek(lxpr_uiobuf_t *, offset_t);
+extern void lxpr_uiobuf_write(lxpr_uiobuf_t *, const char *, size_t);
+extern void lxpr_uiobuf_printf(lxpr_uiobuf_t *, const char *, ...);
+extern void lxpr_uiobuf_seterr(lxpr_uiobuf_t *, int);
+
+proc_t *lxpr_lock(pid_t);
+void lxpr_unlock(proc_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LXPROC_H */
diff --git a/usr/src/uts/common/fs/nfs/nfs3_vfsops.c b/usr/src/uts/common/fs/nfs/nfs3_vfsops.c
index 207a708771..2176dcb9de 100644
--- a/usr/src/uts/common/fs/nfs/nfs3_vfsops.c
+++ b/usr/src/uts/common/fs/nfs/nfs3_vfsops.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/uts/common/fs/nfs/nfs4_common.c b/usr/src/uts/common/fs/nfs/nfs4_common.c
index 03c9dbcbaa..11c6984f95 100644
--- a/usr/src/uts/common/fs/nfs/nfs4_common.c
+++ b/usr/src/uts/common/fs/nfs/nfs4_common.c
@@ -22,6 +22,7 @@
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*
* Copyright 2011, 2012 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -50,7 +51,7 @@ static vfsdef_t vfw4 = {
VFSDEF_VERSION,
"nfs4",
nfs4init,
- VSW_CANREMOUNT|VSW_NOTZONESAFE|VSW_STATS|VSW_ZMOUNT,
+ VSW_CANREMOUNT|VSW_NOTZONESAFE|VSW_STATS,
NULL
};
diff --git a/usr/src/uts/common/fs/nfs/nfs4_vfsops.c b/usr/src/uts/common/fs/nfs/nfs4_vfsops.c
index 1752a28542..2350454d9c 100644
--- a/usr/src/uts/common/fs/nfs/nfs4_vfsops.c
+++ b/usr/src/uts/common/fs/nfs/nfs4_vfsops.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/*
diff --git a/usr/src/uts/common/fs/nfs/nfs_common.c b/usr/src/uts/common/fs/nfs/nfs_common.c
index 16a467e64c..6a3cb3d695 100644
--- a/usr/src/uts/common/fs/nfs/nfs_common.c
+++ b/usr/src/uts/common/fs/nfs/nfs_common.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Bayard G. Bell. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -123,7 +124,7 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
"nfsdyn",
nfsdyninit,
- VSW_ZMOUNT,
+ 0,
NULL
};
@@ -140,7 +141,7 @@ static vfsdef_t vfw2 = {
VFSDEF_VERSION,
"nfs",
nfsinit,
- VSW_CANREMOUNT|VSW_NOTZONESAFE|VSW_STATS|VSW_ZMOUNT,
+ VSW_CANREMOUNT|VSW_NOTZONESAFE|VSW_STATS,
NULL
};
@@ -157,7 +158,7 @@ static vfsdef_t vfw3 = {
VFSDEF_VERSION,
"nfs3",
nfs3init,
- VSW_CANREMOUNT|VSW_NOTZONESAFE|VSW_STATS|VSW_ZMOUNT,
+ VSW_CANREMOUNT|VSW_NOTZONESAFE|VSW_STATS,
NULL
};
diff --git a/usr/src/uts/common/fs/nfs/nfs_server.c b/usr/src/uts/common/fs/nfs/nfs_server.c
index 51e3ad8c23..e8f24c0c2d 100644
--- a/usr/src/uts/common/fs/nfs/nfs_server.c
+++ b/usr/src/uts/common/fs/nfs/nfs_server.c
@@ -22,6 +22,8 @@
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Bayard G. Bell. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012 Joyent, Inc. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -2522,6 +2524,9 @@ nfs_srvinit(void)
{
int error;
+ if (getzoneid() != GLOBAL_ZONEID)
+ return (EACCES);
+
error = nfs_exportinit();
if (error != 0)
return (error);
diff --git a/usr/src/uts/common/fs/nfs/nfs_vfsops.c b/usr/src/uts/common/fs/nfs/nfs_vfsops.c
index 57b21778b4..ffd5380a86 100644
--- a/usr/src/uts/common/fs/nfs/nfs_vfsops.c
+++ b/usr/src/uts/common/fs/nfs/nfs_vfsops.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*
* Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
* All rights reserved.
diff --git a/usr/src/uts/common/fs/proc/prcontrol.c b/usr/src/uts/common/fs/proc/prcontrol.c
index a73a64a4a4..a5679a8afb 100644
--- a/usr/src/uts/common/fs/proc/prcontrol.c
+++ b/usr/src/uts/common/fs/proc/prcontrol.c
@@ -2276,9 +2276,17 @@ pr_szoneid(proc_t *p, zoneid_t zoneid, cred_t *cr)
return (EPERM);
if (zoneid != GLOBAL_ZONEID && zoneid != p->p_zone->zone_id)
return (EINVAL);
- if ((zptr = zone_find_by_id(zoneid)) == NULL)
- return (EINVAL);
+ /*
+ * We cannot hold p_lock when we call zone_find_by_id since that can
+ * lead to a deadlock. zone_find_by_id() takes zonehash_lock.
+ * zone_enter() can hold the zonehash_lock and needs p_lock when it
+ * calls task_join.
+ */
mutex_exit(&p->p_lock);
+ if ((zptr = zone_find_by_id(zoneid)) == NULL) {
+ mutex_enter(&p->p_lock);
+ return (EINVAL);
+ }
mutex_enter(&p->p_crlock);
oldcred = p->p_cred;
crhold(oldcred);
diff --git a/usr/src/uts/common/fs/proc/prdata.h b/usr/src/uts/common/fs/proc/prdata.h
index 8ea516bf82..d3898ca9ea 100644
--- a/usr/src/uts/common/fs/proc/prdata.h
+++ b/usr/src/uts/common/fs/proc/prdata.h
@@ -23,6 +23,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
diff --git a/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_vfsops.c b/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_vfsops.c
index 86c8111b72..6473b52690 100644
--- a/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_vfsops.c
+++ b/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_vfsops.c
@@ -34,6 +34,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/systm.h>
@@ -115,7 +116,7 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
(char *)fs_type_name,
smbfsinit, /* init routine */
- VSW_HASPROTO|VSW_NOTZONESAFE|VSW_ZMOUNT, /* flags */
+ VSW_HASPROTO|VSW_NOTZONESAFE, /* flags */
&smbfs_mntopts /* mount options table prototype */
};
diff --git a/usr/src/uts/common/fs/swapfs/swap_subr.c b/usr/src/uts/common/fs/swapfs/swap_subr.c
index 74c4302da9..a4d983665b 100644
--- a/usr/src/uts/common/fs/swapfs/swap_subr.c
+++ b/usr/src/uts/common/fs/swapfs/swap_subr.c
@@ -110,9 +110,11 @@ swapfs_recalc(pgcnt_t pgs)
* memory that can be used as swap space should do so by
* setting swapfs_desfree at boot time, not swapfs_minfree.
* However, swapfs_minfree is tunable by install as a
- * workaround for bugid 1147463.
+ * workaround for bugid 1147463. Note swapfs_minfree is set
+ * to 1/8th of memory, but clamped at the limit of 256 MB.
*/
- new_swapfs_minfree = MAX(btopr(2 * 1024 * 1024), pgs >> 3);
+ new_swapfs_minfree = MIN(MAX(btopr(2 * 1024 * 1024), pgs >> 3),
+ btopr(256 * 1024 * 1024));
}
/*
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_dir.c b/usr/src/uts/common/fs/tmpfs/tmp_dir.c
index f6621c8097..387cc6ae54 100644
--- a/usr/src/uts/common/fs/tmpfs/tmp_dir.c
+++ b/usr/src/uts/common/fs/tmpfs/tmp_dir.c
@@ -516,7 +516,7 @@ tdirdelete(
*/
namelen = strlen(tpdp->td_name) + 1;
- tmp_memfree(tpdp, sizeof (struct tdirent) + namelen);
+ kmem_free(tpdp, sizeof (struct tdirent) + namelen);
dir->tn_size -= (sizeof (struct tdirent) + namelen);
dir->tn_dirents--;
@@ -549,8 +549,8 @@ tdirinit(
ASSERT(RW_WRITE_HELD(&parent->tn_rwlock));
ASSERT(dir->tn_type == VDIR);
- dot = tmp_memalloc(sizeof (struct tdirent) + 2, TMP_MUSTHAVE);
- dotdot = tmp_memalloc(sizeof (struct tdirent) + 3, TMP_MUSTHAVE);
+ dot = kmem_zalloc(sizeof (struct tdirent) + 2, KM_SLEEP);
+ dotdot = kmem_zalloc(sizeof (struct tdirent) + 3, KM_SLEEP);
/*
* Initialize the entries
@@ -650,7 +650,7 @@ tdirtrunc(struct tmpnode *dir)
tmpfs_hash_out(tdp);
- tmp_memfree(tdp, sizeof (struct tdirent) + namelen);
+ kmem_free(tdp, sizeof (struct tdirent) + namelen);
dir->tn_size -= (sizeof (struct tdirent) + namelen);
dir->tn_dirents--;
}
@@ -925,7 +925,7 @@ tdiraddentry(
*/
namelen = strlen(name) + 1;
alloc_size = namelen + sizeof (struct tdirent);
- tdp = tmp_memalloc(alloc_size, 0);
+ tdp = kmem_zalloc(alloc_size, KM_NOSLEEP | KM_NORMALPRI);
if (tdp == NULL)
return (ENOSPC);
@@ -1025,7 +1025,7 @@ tdirmaketnode(
((va->va_mask & AT_MTIME) && TIMESPEC_OVERFLOW(&va->va_mtime)))
return (EOVERFLOW);
type = va->va_type;
- tp = tmp_memalloc(sizeof (struct tmpnode), TMP_MUSTHAVE);
+ tp = kmem_zalloc(sizeof (struct tmpnode), KM_SLEEP);
tmpnode_init(tm, tp, va, cred);
/* setup normal file/dir's extended attribute directory */
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_subr.c b/usr/src/uts/common/fs/tmpfs/tmp_subr.c
index 2e59d28d80..bc768466cb 100644
--- a/usr/src/uts/common/fs/tmpfs/tmp_subr.c
+++ b/usr/src/uts/common/fs/tmpfs/tmp_subr.c
@@ -89,40 +89,6 @@ tmp_sticky_remove_access(struct tmpnode *dir, struct tmpnode *entry,
}
/*
- * Allocate zeroed memory if tmpfs_maxkmem has not been exceeded
- * or the 'musthave' flag is set. 'musthave' allocations should
- * always be subordinate to normal allocations so that tmpfs_maxkmem
- * can't be exceeded by more than a few KB. Example: when creating
- * a new directory, the tmpnode is a normal allocation; if that
- * succeeds, the dirents for "." and ".." are 'musthave' allocations.
- */
-void *
-tmp_memalloc(size_t size, int musthave)
-{
- static time_t last_warning;
- time_t now;
-
- if (atomic_add_long_nv(&tmp_kmemspace, size) < tmpfs_maxkmem ||
- musthave)
- return (kmem_zalloc(size, KM_SLEEP));
-
- atomic_add_long(&tmp_kmemspace, -size);
- now = gethrestime_sec();
- if (last_warning != now) {
- last_warning = now;
- cmn_err(CE_WARN, "tmp_memalloc: tmpfs over memory limit");
- }
- return (NULL);
-}
-
-void
-tmp_memfree(void *cp, size_t size)
-{
- kmem_free(cp, size);
- atomic_add_long(&tmp_kmemspace, -size);
-}
-
-/*
* Convert a string containing a number (number of bytes) to a pgcnt_t,
* containing the corresponding number of pages. On 32-bit kernels, the
* maximum value encoded in 'str' is PAGESIZE * ULONG_MAX, while the value
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c b/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c
index f8a36a528f..91d953f88a 100644
--- a/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c
+++ b/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -55,6 +56,15 @@
static int tmpfsfstype;
/*
+ * tmpfs_mountcount is used to prevent module unloads while there is still
+ * state from a former mount hanging around. With forced umount support, the
+ * filesystem module must not be allowed to go away before the last
+ * VFS_FREEVFS() call has been made. Since this is just an atomic counter,
+ * there's no need for locking.
+ */
+static uint32_t tmpfs_mountcount;
+
+/*
* tmpfs vfs operations.
*/
static int tmpfsinit(int, char *);
@@ -64,6 +74,7 @@ static int tmp_unmount(struct vfs *, int, struct cred *);
static int tmp_root(struct vfs *, struct vnode **);
static int tmp_statvfs(struct vfs *, struct statvfs64 *);
static int tmp_vget(struct vfs *, struct vnode **, struct fid *);
+static void tmp_freevfs(vfs_t *vfsp);
/*
* Loadable module wrapper
@@ -76,7 +87,7 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
"tmpfs",
tmpfsinit,
- VSW_HASPROTO|VSW_STATS|VSW_ZMOUNT,
+ VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_ZMOUNT,
&tmpfs_proto_opttbl
};
@@ -121,6 +132,14 @@ _fini()
{
int error;
+ /*
+ * If a forceably unmounted instance is still hanging around, we cannot
+ * allow the module to be unloaded because that would cause panics once
+ * the VFS framework decides it's time to call into VFS_FREEVFS().
+ */
+ if (tmpfs_mountcount)
+ return (EBUSY);
+
error = mod_remove(&modlinkage);
if (error)
return (error);
@@ -139,14 +158,6 @@ _info(struct modinfo *modinfop)
}
/*
- * The following are patchable variables limiting the amount of system
- * resources tmpfs can use.
- *
- * tmpfs_maxkmem limits the amount of kernel kmem_alloc memory
- * tmpfs can use for it's data structures (e.g. tmpnodes, directory entries)
- * It is not determined by setting a hard limit but rather as a percentage of
- * physical memory which is determined when tmpfs is first used in the system.
- *
* tmpfs_minfree is the minimum amount of swap space that tmpfs leaves for
* the rest of the system. In other words, if the amount of free swap space
* in the system (i.e. anoninfo.ani_free) drops below tmpfs_minfree, tmpfs
@@ -155,9 +166,7 @@ _info(struct modinfo *modinfop)
* There is also a per mount limit on the amount of swap space
* (tmount.tm_anonmax) settable via a mount option.
*/
-size_t tmpfs_maxkmem = 0;
size_t tmpfs_minfree = 0;
-size_t tmp_kmemspace; /* bytes of kernel heap used by all tmpfs */
static major_t tmpfs_major;
static minor_t tmpfs_minor;
@@ -176,6 +185,7 @@ tmpfsinit(int fstype, char *name)
VFSNAME_ROOT, { .vfs_root = tmp_root },
VFSNAME_STATVFS, { .vfs_statvfs = tmp_statvfs },
VFSNAME_VGET, { .vfs_vget = tmp_vget },
+ VFSNAME_FREEVFS, { .vfs_freevfs = tmp_freevfs },
NULL, NULL
};
int error;
@@ -210,18 +220,12 @@ tmpfsinit(int fstype, char *name)
tmpfs_minfree = btopr(TMPMINFREE);
}
- /*
- * The maximum amount of space tmpfs can allocate is
- * TMPMAXPROCKMEM percent of kernel memory
- */
- if (tmpfs_maxkmem == 0)
- tmpfs_maxkmem = MAX(PAGESIZE, kmem_maxavail() / TMPMAXFRACKMEM);
-
if ((tmpfs_major = getudev()) == (major_t)-1) {
cmn_err(CE_WARN, "tmpfsinit: Can't get unique device number.");
tmpfs_major = 0;
}
mutex_init(&tmpfs_minor_lock, NULL, MUTEX_DEFAULT, NULL);
+ tmpfs_mountcount = 0;
return (0);
}
@@ -249,7 +253,7 @@ tmp_mount(
return (ENOTDIR);
mutex_enter(&mvp->v_lock);
- if ((uap->flags & MS_OVERLAY) == 0 &&
+ if ((uap->flags & MS_REMOUNT) == 0 && (uap->flags & MS_OVERLAY) == 0 &&
(mvp->v_count != 1 || (mvp->v_flag & VROOT))) {
mutex_exit(&mvp->v_lock);
return (EBUSY);
@@ -286,7 +290,23 @@ tmp_mount(
(uap->flags & MS_SYSSPACE) ? UIO_SYSSPACE : UIO_USERSPACE, &dpn))
goto out;
- if ((tm = tmp_memalloc(sizeof (struct tmount), 0)) == NULL) {
+ if (uap->flags & MS_REMOUNT) {
+ tm = (struct tmount *)VFSTOTM(vfsp);
+
+ /*
+ * If we change the size so its less than what is currently
+ * being used, we allow that. The file system will simply be
+ * full until enough files have been removed to get below the
+ * new max.
+ */
+ mutex_enter(&tm->tm_contents);
+ tm->tm_anonmax = anonmax;
+ mutex_exit(&tm->tm_contents);
+ goto out;
+ }
+
+ if ((tm = kmem_zalloc(sizeof (struct tmount),
+ KM_NOSLEEP | KM_NORMALPRI)) == NULL) {
pn_free(&dpn);
error = ENOMEM;
goto out;
@@ -318,7 +338,7 @@ tmp_mount(
vfsp->vfs_bsize = PAGESIZE;
vfsp->vfs_flag |= VFS_NOTRUNC;
vfs_make_fsid(&vfsp->vfs_fsid, tm->tm_dev, tmpfsfstype);
- tm->tm_mntpath = tmp_memalloc(dpn.pn_pathlen + 1, TMP_MUSTHAVE);
+ tm->tm_mntpath = kmem_zalloc(dpn.pn_pathlen + 1, KM_SLEEP);
(void) strcpy(tm->tm_mntpath, dpn.pn_path);
/*
@@ -328,7 +348,7 @@ tmp_mount(
rattr.va_mode = (mode_t)(S_IFDIR | 0777); /* XXX modes */
rattr.va_type = VDIR;
rattr.va_rdev = 0;
- tp = tmp_memalloc(sizeof (struct tmpnode), TMP_MUSTHAVE);
+ tp = kmem_zalloc(sizeof (struct tmpnode), KM_SLEEP);
tmpnode_init(tm, tp, &rattr, cr);
/*
@@ -366,6 +386,7 @@ tmp_mount(
pn_free(&dpn);
error = 0;
+ atomic_inc_32(&tmpfs_mountcount);
out:
if (error == 0)
@@ -381,36 +402,107 @@ tmp_unmount(struct vfs *vfsp, int flag, struct cred *cr)
struct tmpnode *tnp, *cancel;
struct vnode *vp;
int error;
+ uint_t cnt;
+ int i;
if ((error = secpolicy_fs_unmount(cr, vfsp)) != 0)
return (error);
- /*
- * forced unmount is not supported by this file system
- * and thus, ENOTSUP, is being returned.
- */
- if (flag & MS_FORCE)
- return (ENOTSUP);
-
mutex_enter(&tm->tm_contents);
/*
- * If there are no open files, only the root node should have
- * a reference count.
+ * In the normal unmount case (non-forced unmount), if there are no
+ * open files, only the root node should have a reference count.
+ *
* With tm_contents held, nothing can be added or removed.
* There may be some dirty pages. To prevent fsflush from
* disrupting the unmount, put a hold on each node while scanning.
* If we find a previously referenced node, undo the holds we have
* placed and fail EBUSY.
+ *
+ * However, in the case of a forced umount, things are a bit different.
+ * An additional VFS_HOLD is added for each outstanding VN_HOLD to
+ * ensure that the file system is not cleaned up (tmp_freevfs) until
+ * the last vfs hold is dropped. This happens in tmp_inactive as the
+ * vnodes are released. Also, we can't add an additional VN_HOLD in
+ * this case since that would prevent tmp_inactive from ever being
+ * called. Finally, we do need to drop the zone ref now (zone_rele_ref)
+ * so that the zone is not blocked waiting for the final file system
+ * cleanup.
*/
tnp = tm->tm_rootnode;
- if (TNTOV(tnp)->v_count > 1) {
+
+ vp = TNTOV(tnp);
+ mutex_enter(&vp->v_lock);
+ cnt = vp->v_count;
+ if (flag & MS_FORCE) {
+ vfsp->vfs_flag |= VFS_UNMOUNTED;
+ /* Extra hold which we rele below when we drop the zone ref */
+ VFS_HOLD(vfsp);
+
+ for (i = 1; i < cnt; i++)
+ VFS_HOLD(vfsp);
+
+ /* drop the mutex now because no one can find this mount */
+ mutex_exit(&tm->tm_contents);
+ } else if (cnt > 1) {
+ mutex_exit(&vp->v_lock);
mutex_exit(&tm->tm_contents);
return (EBUSY);
}
+ mutex_exit(&vp->v_lock);
+ /*
+ * Check for open files. An open file causes everything to unwind
+ * unless this is a forced umount.
+ */
for (tnp = tnp->tn_forw; tnp; tnp = tnp->tn_forw) {
- if ((vp = TNTOV(tnp))->v_count > 0) {
+ vp = TNTOV(tnp);
+ mutex_enter(&vp->v_lock);
+ cnt = vp->v_count;
+ if (flag & MS_FORCE) {
+ for (i = 0; i < cnt; i++)
+ VFS_HOLD(vfsp);
+
+ /*
+ * In the case of a forced umount don't add an
+ * additional VN_HOLD on the already held vnodes, like
+ * we do in the non-forced unmount case. If the
+ * cnt > 0, then the vnode already has at least one
+ * hold and we need tmp_inactive to get called when the
+ * last pre-existing hold on the node is released so
+ * that we can VFS_RELE the VFS holds we just added.
+ */
+ if (cnt == 0) {
+ /* directly add VN_HOLD since have the lock */
+ vp->v_count++;
+ }
+
+ mutex_exit(&vp->v_lock);
+
+ /*
+ * If the tmpnode has any pages associated with it
+ * (i.e. if it's a normal file with non-zero size), the
+ * tmpnode could still be discovered by pageout or
+ * fsflush via the page vnode pointers. To prevent this
+ * from interfering with the tmp_freevfs, truncate the
+ * tmpnode now.
+ */
+ if (tnp->tn_size != 0 && tnp->tn_type == VREG) {
+ rw_enter(&tnp->tn_rwlock, RW_WRITER);
+ rw_enter(&tnp->tn_contents, RW_WRITER);
+
+ (void) tmpnode_trunc(tm, tnp, 0);
+
+ rw_exit(&tnp->tn_contents);
+ rw_exit(&tnp->tn_rwlock);
+
+ ASSERT(tnp->tn_size == 0);
+ ASSERT(tnp->tn_nblocks == 0);
+ }
+ } else if (cnt > 0) {
+ /* An open file; unwind the holds we've been adding. */
+ mutex_exit(&vp->v_lock);
cancel = tm->tm_rootnode->tn_forw;
while (cancel != tnp) {
vp = TNTOV(cancel);
@@ -420,14 +512,50 @@ tmp_unmount(struct vfs *vfsp, int flag, struct cred *cr)
}
mutex_exit(&tm->tm_contents);
return (EBUSY);
+ } else {
+ /* directly add a VN_HOLD since we have the lock */
+ vp->v_count++;
+ mutex_exit(&vp->v_lock);
}
- VN_HOLD(vp);
}
- /*
- * We can drop the mutex now because no one can find this mount
- */
- mutex_exit(&tm->tm_contents);
+ if (flag & MS_FORCE) {
+ /*
+ * Drop the zone ref now since we don't know how long it will
+ * be until the final vfs_rele is called by tmp_inactive.
+ */
+ if (vfsp->vfs_zone) {
+ zone_rele_ref(&vfsp->vfs_implp->vi_zone_ref,
+ ZONE_REF_VFS);
+ vfsp->vfs_zone = 0;
+ }
+ /* We can now drop the extra hold we added above. */
+ VFS_RELE(vfsp);
+ } else {
+ /*
+ * For the non-forced case, we can drop the mutex now because
+ * no one can find this mount anymore
+ */
+ vfsp->vfs_flag |= VFS_UNMOUNTED;
+ mutex_exit(&tm->tm_contents);
+ }
+
+ return (0);
+}
+
+/*
+ * Implementation of VFS_FREEVFS() to support forced umounts. This is called by
+ * the vfs framework after umount and the last VFS_RELE, to trigger the release
+ * of any resources still associated with the given vfs_t. We only add
+ * additional VFS_HOLDs during the forced umount case, so this is normally
+ * called immediately after tmp_umount.
+ */
+void
+tmp_freevfs(vfs_t *vfsp)
+{
+ struct tmount *tm = (struct tmount *)VFSTOTM(vfsp);
+ struct tmpnode *tnp;
+ struct vnode *vp;
/*
* Free all kmemalloc'd and anonalloc'd memory associated with
@@ -437,6 +565,16 @@ tmp_unmount(struct vfs *vfsp, int flag, struct cred *cr)
* tmpnode_free which assumes that the directory entry has been
* removed before the file.
*/
+
+ /*
+ * Now that we are tearing ourselves down we need to remove the
+ * UNMOUNTED flag. If we don't, we'll later hit a VN_RELE when we remove
+ * files from the system causing us to have a negative value. Doing this
+ * seems a bit better than trying to set a flag on the tmount that says
+ * we're tearing down.
+ */
+ vfsp->vfs_flag &= ~VFS_UNMOUNTED;
+
/*
* Remove all directory entries
*/
@@ -503,15 +641,16 @@ tmp_unmount(struct vfs *vfsp, int flag, struct cred *cr)
ASSERT(tm->tm_mntpath);
- tmp_memfree(tm->tm_mntpath, strlen(tm->tm_mntpath) + 1);
+ kmem_free(tm->tm_mntpath, strlen(tm->tm_mntpath) + 1);
ASSERT(tm->tm_anonmem == 0);
mutex_destroy(&tm->tm_contents);
mutex_destroy(&tm->tm_renamelck);
- tmp_memfree(tm, sizeof (struct tmount));
+ kmem_free(tm, sizeof (struct tmount));
- return (0);
+ /* Allow _fini() to succeed now */
+ atomic_dec_32(&tmpfs_mountcount);
}
/*
@@ -614,13 +753,7 @@ tmp_statvfs(struct vfs *vfsp, struct statvfs64 *sbp)
* available to tmpfs. This is fairly inaccurate since it doesn't
* take into account the names stored in the directory entries.
*/
- if (tmpfs_maxkmem > tmp_kmemspace)
- sbp->f_ffree = (tmpfs_maxkmem - tmp_kmemspace) /
- (sizeof (struct tmpnode) + sizeof (struct tdirent));
- else
- sbp->f_ffree = 0;
-
- sbp->f_files = tmpfs_maxkmem /
+ sbp->f_ffree = sbp->f_files = ptob(availrmem) /
(sizeof (struct tmpnode) + sizeof (struct tdirent));
sbp->f_favail = (fsfilcnt64_t)(sbp->f_ffree);
(void) cmpldev(&d32, vfsp->vfs_dev);
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_vnops.c b/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
index e44bba1252..624ea30b7f 100644
--- a/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
+++ b/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
@@ -25,7 +25,7 @@
*/
/*
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -583,6 +583,10 @@ tmp_read(struct vnode *vp, struct uio *uiop, int ioflag, cred_t *cred,
struct tmount *tm = (struct tmount *)VTOTM(vp);
int error;
+ /* If the filesystem was umounted by force, return immediately. */
+ if (vp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
+ return (EIO);
+
/*
* We don't currently support reading non-regular files
*/
@@ -612,6 +616,10 @@ tmp_write(struct vnode *vp, struct uio *uiop, int ioflag, struct cred *cred,
struct tmount *tm = (struct tmount *)VTOTM(vp);
int error;
+ /* If the filesystem was umounted by force, return immediately. */
+ if (vp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
+ return (EIO);
+
/*
* We don't currently support writing to non-regular files
*/
@@ -832,6 +840,9 @@ tmp_lookup(
struct tmpnode *ntp = NULL;
int error;
+ /* If the filesystem was umounted by force, return immediately. */
+ if (dvp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
+ return (EIO);
/* allow cd into @ dir */
if (flags & LOOKUP_XATTR) {
@@ -870,8 +881,7 @@ tmp_lookup(
return (error);
}
- xdp = tmp_memalloc(sizeof (struct tmpnode),
- TMP_MUSTHAVE);
+ xdp = kmem_zalloc(sizeof (struct tmpnode), KM_SLEEP);
tm = VTOTM(dvp);
tmpnode_init(tm, xdp, &tp->tn_attr, NULL);
/*
@@ -1185,7 +1195,7 @@ tmp_rename(
struct tmpnode *toparent;
struct tmpnode *fromtp = NULL; /* source tmpnode */
struct tmount *tm = (struct tmount *)VTOTM(odvp);
- int error;
+ int error, err;
int samedir = 0; /* set if odvp == ndvp */
struct vnode *realvp;
@@ -1261,15 +1271,6 @@ tmp_rename(
error = 0;
goto done;
}
- vnevent_rename_src(TNTOV(fromtp), odvp, onm, ct);
-
- /*
- * Notify the target directory if not same as
- * source directory.
- */
- if (ndvp != odvp) {
- vnevent_rename_dest_dir(ndvp, ct);
- }
/*
* Unlink from source.
@@ -1277,7 +1278,7 @@ tmp_rename(
rw_enter(&fromparent->tn_rwlock, RW_WRITER);
rw_enter(&fromtp->tn_rwlock, RW_WRITER);
- error = tdirdelete(fromparent, fromtp, onm, DR_RENAME, cred);
+ error = err = tdirdelete(fromparent, fromtp, onm, DR_RENAME, cred);
/*
* The following handles the case where our source tmpnode was
@@ -1292,6 +1293,14 @@ tmp_rename(
rw_exit(&fromtp->tn_rwlock);
rw_exit(&fromparent->tn_rwlock);
+
+ if (err == 0) {
+ vnevent_rename_src(TNTOV(fromtp), odvp, onm, ct);
+ /* Notify the target dir if not same as source dir. */
+ if (ndvp != odvp)
+ vnevent_rename_dest_dir(ndvp, ct);
+ }
+
done:
tmpnode_rele(fromtp);
mutex_exit(&tm->tm_renamelck);
@@ -1458,6 +1467,10 @@ tmp_readdir(
int reclen;
caddr_t outbuf;
+ /* If the filesystem was umounted by force, return immediately. */
+ if (vp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
+ return (EIO);
+
if (uiop->uio_loffset >= MAXOFF_T) {
if (eofp)
*eofp = 1;
@@ -1596,7 +1609,7 @@ tmp_symlink(
return (error);
}
len = strlen(tnm) + 1;
- cp = tmp_memalloc(len, 0);
+ cp = kmem_alloc(len, KM_NOSLEEP | KM_NORMALPRI);
if (cp == NULL) {
tmpnode_rele(self);
return (ENOSPC);
@@ -1661,10 +1674,27 @@ top:
* there's little to do -- just drop our hold.
*/
if (vp->v_count > 1 || tp->tn_nlink != 0) {
- vp->v_count--;
+ if (vp->v_vfsp->vfs_flag & VFS_UNMOUNTED) {
+ /*
+ * Since the file system was forcibly unmounted, we can
+ * have a case (v_count == 1, tn_nlink != 0) where this
+ * file was open so we didn't add an extra hold on the
+ * file in tmp_unmount. We are counting on the
+ * interaction of the hold made in tmp_unmount and
+ * rele-ed in tmp_vfsfree so we need to be sure we
+ * don't decrement in this case.
+ */
+ if (vp->v_count > 1)
+ vp->v_count--;
+ } else {
+ vp->v_count--;
+ }
mutex_exit(&vp->v_lock);
mutex_exit(&tp->tn_tlock);
rw_exit(&tp->tn_rwlock);
+ /* If the filesystem was umounted by force, rele the vfs ref */
+ if (tm->tm_vfsp->vfs_flag & VFS_UNMOUNTED)
+ VFS_RELE(tm->tm_vfsp);
return;
}
@@ -1689,7 +1719,7 @@ top:
goto top;
}
if (tp->tn_type == VLNK)
- tmp_memfree(tp->tn_symlink, tp->tn_size + 1);
+ kmem_free(tp->tn_symlink, tp->tn_size + 1);
}
/*
@@ -1723,7 +1753,11 @@ top:
rw_destroy(&tp->tn_rwlock);
mutex_destroy(&tp->tn_tlock);
vn_free(TNTOV(tp));
- tmp_memfree(tp, sizeof (struct tmpnode));
+ kmem_free(tp, sizeof (struct tmpnode));
+
+ /* If the filesystem was umounted by force, rele the vfs ref */
+ if (tm->tm_vfsp->vfs_flag & VFS_UNMOUNTED)
+ VFS_RELE(tm->tm_vfsp);
}
/* ARGSUSED2 */
@@ -1849,6 +1883,10 @@ tmp_getapage(
struct vnode *pvp;
u_offset_t poff;
+ /* If the filesystem was umounted by force, return immediately. */
+ if (vp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
+ return (EIO);
+
if (protp != NULL)
*protp = PROT_ALL;
again:
@@ -2070,6 +2108,10 @@ tmp_putapage(
u_offset_t offset;
u_offset_t tmpoff;
+ /* If the filesystem was umounted by force, return immediately. */
+ if (vp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
+ return (EIO);
+
ASSERT(PAGE_LOCKED(pp));
/* Kluster in tmp_klustsize chunks */
diff --git a/usr/src/uts/common/fs/udfs/udf_vnops.c b/usr/src/uts/common/fs/udfs/udf_vnops.c
index 307d3987ed..2d8de23399 100644
--- a/usr/src/uts/common/fs/udfs/udf_vnops.c
+++ b/usr/src/uts/common/fs/udfs/udf_vnops.c
@@ -911,7 +911,7 @@ udf_rename(
caller_context_t *ct,
int flags)
{
- int32_t error = 0;
+ int32_t error = 0, err;
struct udf_vfs *udf_vfsp;
struct ud_inode *sip; /* source inode */
struct ud_inode *sdp, *tdp; /* source and target parent inode */
@@ -995,7 +995,6 @@ udf_rename(
rw_exit(&tdp->i_rwlock);
goto errout;
}
- vnevent_rename_src(ITOV(sip), sdvp, snm, ct);
rw_exit(&tdp->i_rwlock);
rw_enter(&sdp->i_rwlock, RW_WRITER);
@@ -1006,11 +1005,15 @@ udf_rename(
* If the entry has changed just forget about it. Release
* the source inode.
*/
- if ((error = ud_dirremove(sdp, snm, sip, (struct vnode *)0,
+ if ((error = err = ud_dirremove(sdp, snm, sip, (struct vnode *)0,
DR_RENAME, cr, ct)) == ENOENT) {
error = 0;
}
rw_exit(&sdp->i_rwlock);
+
+ if (err == 0)
+ vnevent_rename_src(ITOV(sip), sdvp, snm, ct);
+
errout:
ITIMES(sdp);
ITIMES(tdp);
diff --git a/usr/src/uts/common/fs/ufs/ufs_vnops.c b/usr/src/uts/common/fs/ufs/ufs_vnops.c
index 92bdb0d0a7..b1d861bbe0 100644
--- a/usr/src/uts/common/fs/ufs/ufs_vnops.c
+++ b/usr/src/uts/common/fs/ufs/ufs_vnops.c
@@ -3367,7 +3367,6 @@ ufs_rename(
struct inode *ip = NULL; /* check inode */
struct inode *sdp; /* old (source) parent inode */
struct inode *tdp; /* new (target) parent inode */
- struct vnode *svp = NULL; /* source vnode */
struct vnode *tvp = NULL; /* target vnode, if it exists */
struct vnode *realvp;
struct ufsvfs *ufsvfsp;
@@ -3380,7 +3379,7 @@ ufs_rename(
krwlock_t *first_lock;
krwlock_t *second_lock;
krwlock_t *reverse_lock;
- int serr, terr;
+ int terr;
sdp = VTOI(sdvp);
slot.fbp = NULL;
@@ -3389,30 +3388,6 @@ ufs_rename(
if (VOP_REALVP(tdvp, &realvp, ct) == 0)
tdvp = realvp;
- terr = ufs_eventlookup(tdvp, tnm, cr, &tvp);
- serr = ufs_eventlookup(sdvp, snm, cr, &svp);
-
- if ((serr == 0) && ((terr == 0) || (terr == ENOENT))) {
- if (tvp != NULL)
- vnevent_rename_dest(tvp, tdvp, tnm, ct);
-
- /*
- * Notify the target directory of the rename event
- * if source and target directories are not the same.
- */
- if (sdvp != tdvp)
- vnevent_rename_dest_dir(tdvp, ct);
-
- if (svp != NULL)
- vnevent_rename_src(svp, sdvp, snm, ct);
- }
-
- if (tvp != NULL)
- VN_RELE(tvp);
-
- if (svp != NULL)
- VN_RELE(svp);
-
retry_rename:
error = ufs_lockfs_begin(ufsvfsp, &ulp, ULOCKFS_RENAME_MASK);
if (error)
@@ -3698,6 +3673,8 @@ retry_firstlock:
}
}
+ terr = ufs_eventlookup(tdvp, tnm, cr, &tvp);
+
/*
* Link source to the target.
*/
@@ -3712,6 +3689,9 @@ retry_firstlock:
goto errout;
}
+ if (terr == 0 && tvp != NULL)
+ vnevent_rename_dest(tvp, tdvp, tnm, ct);
+
/*
* Unlink the source.
* Remove the source entry. ufs_dirremove() checks that the entry
@@ -3723,6 +3703,14 @@ retry_firstlock:
DR_RENAME, cr)) == ENOENT)
error = 0;
+ vnevent_rename_src(ITOV(sip), sdvp, snm, ct);
+ /*
+ * Notify the target directory of the rename event
+ * if source and target directories are not the same.
+ */
+ if (sdvp != tdvp)
+ vnevent_rename_dest_dir(tdvp, ct);
+
errout:
if (slot.fbp)
fbrelse(slot.fbp, S_OTHER);
@@ -3732,6 +3720,8 @@ errout:
rw_exit(&sdp->i_rwlock);
}
+ if (tvp != NULL)
+ VN_RELE(tvp);
VN_RELE(ITOV(sip));
unlock:
diff --git a/usr/src/uts/common/fs/vfs.c b/usr/src/uts/common/fs/vfs.c
index 83c53d859d..bea80bd609 100644
--- a/usr/src/uts/common/fs/vfs.c
+++ b/usr/src/uts/common/fs/vfs.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -1129,6 +1130,7 @@ domount(char *fsname, struct mounta *uap, vnode_t *vp, struct cred *credp,
struct pathname pn, rpn;
vsk_anchor_t *vskap;
char fstname[FSTYPSZ];
+ zone_t *zone;
/*
* The v_flag value for the mount point vp is permanently set
@@ -1590,9 +1592,24 @@ domount(char *fsname, struct mounta *uap, vnode_t *vp, struct cred *credp,
}
/*
- * Serialize with zone creations.
+ * Serialize with zone state transitions.
+ * See vfs_list_add; zone mounted into is:
+ * zone_find_by_path(refstr_value(vfsp->vfs_mntpt))
+ * not the zone doing the mount (curproc->p_zone), but if we're already
+ * inside a NGZ, then we know what zone we are.
*/
- mount_in_progress();
+ if (INGLOBALZONE(curproc)) {
+ zone = zone_find_by_path(mountpt);
+ ASSERT(zone != NULL);
+ } else {
+ zone = curproc->p_zone;
+ /*
+ * zone_find_by_path does a hold, so do one here too so that
+ * we can do a zone_rele after mount_completed.
+ */
+ zone_hold(zone);
+ }
+ mount_in_progress(zone);
/*
* Instantiate (or reinstantiate) the file system. If appropriate,
* splice it into the file system name space.
@@ -1761,7 +1778,8 @@ domount(char *fsname, struct mounta *uap, vnode_t *vp, struct cred *credp,
vfs_unlock(vfsp);
}
- mount_completed();
+ mount_completed(zone);
+ zone_rele(zone);
if (splice)
vn_vfsunlock(vp);
@@ -3881,6 +3899,8 @@ vfs_to_modname(const char *vfstype)
vfstype = "fdfs";
} else if (strncmp(vfstype, "nfs", 3) == 0) {
vfstype = "nfs";
+ } else if (strcmp(vfstype, "lxproc") == 0) {
+ vfstype = "lxprocfs";
}
return (vfstype);
diff --git a/usr/src/uts/common/fs/vnode.c b/usr/src/uts/common/fs/vnode.c
index d67d164286..679940cf5e 100644
--- a/usr/src/uts/common/fs/vnode.c
+++ b/usr/src/uts/common/fs/vnode.c
@@ -66,6 +66,7 @@
#include <fs/fs_subr.h>
#include <sys/taskq.h>
#include <fs/fs_reparse.h>
+#include <sys/time.h>
/* Determine if this vnode is a file that is read-only */
#define ISROFILE(vp) \
@@ -200,6 +201,11 @@ static void (**vsd_destructor)(void *);
cr = crgetmapped(cr); \
}
+#define VOP_LATENCY_10MS 10000000
+#define VOP_LATENCY_100MS 100000000
+#define VOP_LATENCY_1S 1000000000
+#define VOP_LATENCY_10S 10000000000
+
/*
* Convert stat(2) formats to vnode types and vice versa. (Knows about
* numerical order of S_IFMT and vnode types.)
@@ -3230,14 +3236,57 @@ fop_read(
cred_t *cr,
caller_context_t *ct)
{
- int err;
ssize_t resid_start = uiop->uio_resid;
+ zone_t *zonep = curzone;
+ zone_vfs_kstat_t *zvp = zonep->zone_vfs_stats;
+
+ hrtime_t start, lat;
+ ssize_t len;
+ int err;
+
+ if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ start = gethrtime();
+
+ mutex_enter(&zonep->zone_vfs_lock);
+ kstat_runq_enter(&zonep->zone_vfs_rwstats);
+ mutex_exit(&zonep->zone_vfs_lock);
+ }
VOPXID_MAP_CR(vp, cr);
err = (*(vp)->v_op->vop_read)(vp, uiop, ioflag, cr, ct);
- VOPSTATS_UPDATE_IO(vp, read,
- read_bytes, (resid_start - uiop->uio_resid));
+ len = resid_start - uiop->uio_resid;
+
+ VOPSTATS_UPDATE_IO(vp, read, read_bytes, len);
+
+ if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ mutex_enter(&zonep->zone_vfs_lock);
+ zonep->zone_vfs_rwstats.reads++;
+ zonep->zone_vfs_rwstats.nread += len;
+ kstat_runq_exit(&zonep->zone_vfs_rwstats);
+ mutex_exit(&zonep->zone_vfs_lock);
+
+ lat = gethrtime() - start;
+
+ if (lat >= VOP_LATENCY_10MS) {
+ if (lat < VOP_LATENCY_100MS)
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ else if (lat < VOP_LATENCY_1S) {
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_100ms_ops.value.ui64);
+ } else if (lat < VOP_LATENCY_10S) {
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_100ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_1s_ops.value.ui64);
+ } else {
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_100ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_1s_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_10s_ops.value.ui64);
+ }
+ }
+ }
+
return (err);
}
@@ -3249,14 +3298,62 @@ fop_write(
cred_t *cr,
caller_context_t *ct)
{
- int err;
ssize_t resid_start = uiop->uio_resid;
+ zone_t *zonep = curzone;
+ zone_vfs_kstat_t *zvp = zonep->zone_vfs_stats;
+
+ hrtime_t start, lat;
+ ssize_t len;
+ int err;
+
+ /*
+ * For the purposes of VFS kstat consumers, the "waitq" calculation is
+ * repurposed as the active queue for VFS write operations. There's no
+ * actual wait queue for VFS operations.
+ */
+ if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ start = gethrtime();
+
+ mutex_enter(&zonep->zone_vfs_lock);
+ kstat_waitq_enter(&zonep->zone_vfs_rwstats);
+ mutex_exit(&zonep->zone_vfs_lock);
+ }
VOPXID_MAP_CR(vp, cr);
err = (*(vp)->v_op->vop_write)(vp, uiop, ioflag, cr, ct);
- VOPSTATS_UPDATE_IO(vp, write,
- write_bytes, (resid_start - uiop->uio_resid));
+ len = resid_start - uiop->uio_resid;
+
+ VOPSTATS_UPDATE_IO(vp, write, write_bytes, len);
+
+ if (vp->v_type == VREG || vp->v_type == VDIR || vp->v_type == VBLK) {
+ mutex_enter(&zonep->zone_vfs_lock);
+ zonep->zone_vfs_rwstats.writes++;
+ zonep->zone_vfs_rwstats.nwritten += len;
+ kstat_waitq_exit(&zonep->zone_vfs_rwstats);
+ mutex_exit(&zonep->zone_vfs_lock);
+
+ lat = gethrtime() - start;
+
+ if (lat >= VOP_LATENCY_10MS) {
+ if (lat < VOP_LATENCY_100MS)
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ else if (lat < VOP_LATENCY_1S) {
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_100ms_ops.value.ui64);
+ } else if (lat < VOP_LATENCY_10S) {
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_100ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_1s_ops.value.ui64);
+ } else {
+ atomic_inc_64(&zvp->zv_10ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_100ms_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_1s_ops.value.ui64);
+ atomic_inc_64(&zvp->zv_10s_ops.value.ui64);
+ }
+ }
+ }
+
return (err);
}
diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c
index 8f593cf01d..581b69791d 100644
--- a/usr/src/uts/common/fs/zfs/arc.c
+++ b/usr/src/uts/common/fs/zfs/arc.c
@@ -129,6 +129,7 @@
#include <sys/vdev.h>
#include <sys/vdev_impl.h>
#include <sys/dsl_pool.h>
+#include <sys/zfs_zone.h>
#ifdef _KERNEL
#include <sys/vmsystm.h>
#include <vm/anon.h>
@@ -278,6 +279,7 @@ typedef struct arc_stats {
* not from the spa we're trying to evict from.
*/
kstat_named_t arcstat_evict_skip;
+ kstat_named_t arcstat_evict_allocfail;
kstat_named_t arcstat_evict_l2_cached;
kstat_named_t arcstat_evict_l2_eligible;
kstat_named_t arcstat_evict_l2_ineligible;
@@ -344,6 +346,7 @@ static arc_stats_t arc_stats = {
{ "recycle_miss", KSTAT_DATA_UINT64 },
{ "mutex_miss", KSTAT_DATA_UINT64 },
{ "evict_skip", KSTAT_DATA_UINT64 },
+ { "evict_allocfail", KSTAT_DATA_UINT64 },
{ "evict_l2_cached", KSTAT_DATA_UINT64 },
{ "evict_l2_eligible", KSTAT_DATA_UINT64 },
{ "evict_l2_ineligible", KSTAT_DATA_UINT64 },
@@ -2511,15 +2514,27 @@ arc_get_data_buf(arc_buf_t *buf)
*/
if (!arc_evict_needed(type)) {
if (type == ARC_BUFC_METADATA) {
- buf->b_data = zio_buf_alloc(size);
- arc_space_consume(size, ARC_SPACE_DATA);
+ buf->b_data = zio_buf_alloc_canfail(size);
+ if (buf->b_data != NULL) {
+ arc_space_consume(size, ARC_SPACE_DATA);
+ goto out;
+ }
} else {
ASSERT(type == ARC_BUFC_DATA);
- buf->b_data = zio_data_buf_alloc(size);
- ARCSTAT_INCR(arcstat_data_size, size);
- atomic_add_64(&arc_size, size);
+ buf->b_data = zio_data_buf_alloc_canfail(size);
+ if (buf->b_data != NULL) {
+ ARCSTAT_INCR(arcstat_data_size, size);
+ atomic_add_64(&arc_size, size);
+ goto out;
+ }
}
- goto out;
+
+ /*
+ * Memory allocation failed, presumably due to excessive
+ * fragmentation; we'll bump a counter and drop into the ARC
+ * eviction case.
+ */
+ ARCSTAT_BUMP(arcstat_evict_allocfail);
}
/*
@@ -3160,6 +3175,14 @@ top:
rzio = zio_read(pio, spa, bp, buf->b_data, size,
arc_read_done, buf, priority, zio_flags, zb);
+ /*
+ * At this point, this read I/O has already missed in the ARC
+ * and will be going through to the disk. The I/O throttle
+ * should delay this I/O if this zone is using more than its I/O
+ * priority allows.
+ */
+ zfs_zone_io_throttle(ZFS_ZONE_IOP_READ);
+
if (*arc_flags & ARC_WAIT)
return (zio_wait(rzio));
@@ -3760,9 +3783,6 @@ arc_init(void)
if (zfs_arc_meta_limit > 0 && zfs_arc_meta_limit <= arc_c_max)
arc_meta_limit = zfs_arc_meta_limit;
- if (arc_c_min < arc_meta_limit / 2 && zfs_arc_min == 0)
- arc_c_min = arc_meta_limit / 2;
-
if (zfs_arc_grow_retry > 0)
arc_grow_retry = zfs_arc_grow_retry;
diff --git a/usr/src/uts/common/fs/zfs/dbuf.c b/usr/src/uts/common/fs/zfs/dbuf.c
index ed1808dae7..6f347a0407 100644
--- a/usr/src/uts/common/fs/zfs/dbuf.c
+++ b/usr/src/uts/common/fs/zfs/dbuf.c
@@ -538,8 +538,19 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags)
arc_space_consume(DN_MAX_BONUSLEN, ARC_SPACE_OTHER);
if (bonuslen < DN_MAX_BONUSLEN)
bzero(db->db.db_data, DN_MAX_BONUSLEN);
- if (bonuslen)
- bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, bonuslen);
+
+ if (bonuslen) {
+ /*
+ * Absent byzantine on-disk corruption, we fully expect
+ * our bonuslen to be no more than DN_MAX_BONUSLEN --
+ * but we nonetheless explicitly clamp it on the bcopy()
+ * to prevent any on-disk corruption from becoming
+ * rampant in-kernel corruption.
+ */
+ bcopy(DN_BONUS(dn->dn_phys), db->db.db_data,
+ MIN(bonuslen, DN_MAX_BONUSLEN));
+ }
+
DB_DNODE_EXIT(db);
dbuf_update_data(db);
db->db_state = DB_CACHED;
diff --git a/usr/src/uts/common/fs/zfs/dmu.c b/usr/src/uts/common/fs/zfs/dmu.c
index 11d79b41da..4d5af7febe 100644
--- a/usr/src/uts/common/fs/zfs/dmu.c
+++ b/usr/src/uts/common/fs/zfs/dmu.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2011, Joyent, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
/* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */
@@ -972,6 +973,7 @@ xuio_stat_wbuf_nocopy()
}
#ifdef _KERNEL
+
int
dmu_read_uio(objset_t *os, uint64_t object, uio_t *uio, uint64_t size)
{
@@ -1629,7 +1631,6 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp)
if (!zio_checksum_table[checksum].ci_dedup)
dedup_verify = B_TRUE;
}
-
/*
* Enable nopwrite if we have a cryptographically secure
* checksum that has no known collisions (i.e. SHA-256)
diff --git a/usr/src/uts/common/fs/zfs/dmu_tx.c b/usr/src/uts/common/fs/zfs/dmu_tx.c
index 70c91aca8d..8569c66073 100644
--- a/usr/src/uts/common/fs/zfs/dmu_tx.c
+++ b/usr/src/uts/common/fs/zfs/dmu_tx.c
@@ -38,11 +38,11 @@
#include <sys/sa_impl.h>
#include <sys/zfs_context.h>
#include <sys/varargs.h>
+#include <sys/zfs_zone.h>
typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn,
uint64_t arg1, uint64_t arg2);
-
dmu_tx_t *
dmu_tx_create_dd(dsl_dir_t *dd)
{
@@ -223,6 +223,8 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, uint64_t off, uint64_t len)
if (len == 0)
return;
+ zfs_zone_io_throttle(ZFS_ZONE_IOP_LOGICAL_WRITE);
+
min_bs = SPA_MINBLOCKSHIFT;
max_bs = SPA_MAXBLOCKSHIFT;
min_ibs = DN_MIN_INDBLKSHIFT;
diff --git a/usr/src/uts/common/fs/zfs/dsl_dir.c b/usr/src/uts/common/fs/zfs/dsl_dir.c
index 9f2f959daf..33e8018fb3 100644
--- a/usr/src/uts/common/fs/zfs/dsl_dir.c
+++ b/usr/src/uts/common/fs/zfs/dsl_dir.c
@@ -39,6 +39,7 @@
#include <sys/zio.h>
#include <sys/arc.h>
#include <sys/sunddi.h>
+#include <sys/zfs_zone.h>
#include "zfs_namecheck.h"
static uint64_t dsl_dir_space_towrite(dsl_dir_t *dd);
@@ -747,7 +748,7 @@ dsl_dir_tempreserve_space(dsl_dir_t *dd, uint64_t lsize, uint64_t asize,
* locks are held.
*/
txg_delay(dd->dd_pool, tx->tx_txg,
- MSEC2NSEC(10), MSEC2NSEC(10));
+ zfs_zone_txg_delay(), MSEC2NSEC(10));
err = SET_ERROR(ERESTART);
}
}
diff --git a/usr/src/uts/common/fs/zfs/dsl_pool.c b/usr/src/uts/common/fs/zfs/dsl_pool.c
index b6bdc78f09..ba6df9a7e3 100644
--- a/usr/src/uts/common/fs/zfs/dsl_pool.c
+++ b/usr/src/uts/common/fs/zfs/dsl_pool.c
@@ -41,6 +41,7 @@
#include <sys/zfs_znode.h>
#include <sys/spa_impl.h>
#include <sys/dsl_deadlist.h>
+#include <sys/zfs_zone.h>
#include <sys/bptree.h>
#include <sys/zfeature.h>
#include <sys/zil_impl.h>
@@ -131,7 +132,6 @@ uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000;
*/
-hrtime_t zfs_throttle_delay = MSEC2NSEC(10);
hrtime_t zfs_throttle_resolution = MSEC2NSEC(10);
int
diff --git a/usr/src/uts/common/fs/zfs/metaslab.c b/usr/src/uts/common/fs/zfs/metaslab.c
index 7f8264e5b4..b078e3920e 100644
--- a/usr/src/uts/common/fs/zfs/metaslab.c
+++ b/usr/src/uts/common/fs/zfs/metaslab.c
@@ -62,6 +62,11 @@ uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */
int zfs_condense_pct = 200;
/*
+ * Never condense any space map. This is for debugging/recovery only.
+ */
+int zfs_condense_never = 0;
+
+/*
* This value defines the number of allowed allocation failures per vdev.
* If a device reaches this threshold in a given txg then we consider skipping
* allocations on that device. The value of zfs_mg_alloc_failures is computed
@@ -1288,6 +1293,9 @@ metaslab_should_condense(metaslab_t *msp)
ASSERT(MUTEX_HELD(&msp->ms_lock));
ASSERT(msp->ms_loaded);
+ if (zfs_condense_never != 0)
+ return (B_FALSE);
+
/*
* Use the ms_size_tree range tree, which is ordered by size, to
* obtain the largest segment in the free tree. If the tree is empty
diff --git a/usr/src/uts/common/fs/zfs/sys/dsl_dir.h b/usr/src/uts/common/fs/zfs/sys/dsl_dir.h
index 87e2ce8315..27f5e49bbc 100644
--- a/usr/src/uts/common/fs/zfs/sys/dsl_dir.h
+++ b/usr/src/uts/common/fs/zfs/sys/dsl_dir.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_DSL_DIR_H
diff --git a/usr/src/uts/common/fs/zfs/sys/vdev_impl.h b/usr/src/uts/common/fs/zfs/sys/vdev_impl.h
index 6d2ea2fc42..9961a373ab 100644
--- a/usr/src/uts/common/fs/zfs/sys/vdev_impl.h
+++ b/usr/src/uts/common/fs/zfs/sys/vdev_impl.h
@@ -114,6 +114,7 @@ struct vdev_queue {
vdev_queue_class_t vq_class[ZIO_PRIORITY_NUM_QUEUEABLE];
avl_tree_t vq_active_tree;
uint64_t vq_last_offset;
+ zoneid_t vq_last_zone_id;
hrtime_t vq_io_complete_ts; /* time last i/o completed */
kmutex_t vq_lock;
};
diff --git a/usr/src/uts/common/fs/zfs/sys/zfs_zone.h b/usr/src/uts/common/fs/zfs/sys/zfs_zone.h
new file mode 100644
index 0000000000..4f9383ffdb
--- /dev/null
+++ b/usr/src/uts/common/fs/zfs/sys/zfs_zone.h
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2013, Joyent, Inc. All rights reserved.
+ */
+
+#ifndef _SYS_FS_ZFS_ZONE_H
+#define _SYS_FS_ZFS_ZONE_H
+
+#ifdef _KERNEL
+#include <sys/isa_defs.h>
+#include <sys/types32.h>
+#include <sys/vdev_impl.h>
+#include <sys/zio.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ ZFS_ZONE_IOP_READ = 0,
+ ZFS_ZONE_IOP_WRITE,
+ ZFS_ZONE_IOP_LOGICAL_WRITE,
+} zfs_zone_iop_type_t;
+
+extern void zfs_zone_io_throttle(zfs_zone_iop_type_t);
+
+extern void zfs_zone_zio_init(zio_t *);
+extern void zfs_zone_zio_start(zio_t *);
+extern void zfs_zone_zio_done(zio_t *);
+extern void zfs_zone_zio_dequeue(zio_t *);
+extern void zfs_zone_zio_enqueue(zio_t *);
+extern void zfs_zone_report_txg_sync(void *);
+extern hrtime_t zfs_zone_txg_delay();
+#ifdef _KERNEL
+extern zio_t *zfs_zone_schedule(vdev_queue_t *, zio_priority_t, avl_index_t);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_FS_ZFS_ZONE_H */
diff --git a/usr/src/uts/common/fs/zfs/sys/zio.h b/usr/src/uts/common/fs/zfs/sys/zio.h
index d1160da470..8e901b804b 100644
--- a/usr/src/uts/common/fs/zfs/sys/zio.h
+++ b/usr/src/uts/common/fs/zfs/sys/zio.h
@@ -407,7 +407,8 @@ struct zio {
const zio_vsd_ops_t *io_vsd_ops;
uint64_t io_offset;
- hrtime_t io_timestamp;
+ hrtime_t io_timestamp; /* time I/O entered zio pipeline */
+ hrtime_t io_dispatched; /* time I/O was dispatched to disk */
avl_node_t io_queue_node;
/* Internal pipeline state */
@@ -435,6 +436,7 @@ struct zio {
zio_cksum_report_t *io_cksum_report;
uint64_t io_ena;
+ zoneid_t io_zoneid; /* zone which originated this I/O */
/* Taskq dispatching state */
taskq_ent_t io_tqent;
};
@@ -501,8 +503,10 @@ extern zio_t *zio_unique_parent(zio_t *cio);
extern void zio_add_child(zio_t *pio, zio_t *cio);
extern void *zio_buf_alloc(size_t size);
+extern void *zio_buf_alloc_canfail(size_t size);
extern void zio_buf_free(void *buf, size_t size);
extern void *zio_data_buf_alloc(size_t size);
+extern void *zio_data_buf_alloc_canfail(size_t size);
extern void zio_data_buf_free(void *buf, size_t size);
extern void zio_resubmit_stage_async(void *);
diff --git a/usr/src/uts/common/fs/zfs/txg.c b/usr/src/uts/common/fs/zfs/txg.c
index 2bee4294b4..5a7b3e85ee 100644
--- a/usr/src/uts/common/fs/zfs/txg.c
+++ b/usr/src/uts/common/fs/zfs/txg.c
@@ -31,6 +31,7 @@
#include <sys/dsl_pool.h>
#include <sys/dsl_scan.h>
#include <sys/callb.h>
+#include <sys/zfs_zone.h>
/*
* ZFS Transaction Groups
@@ -506,6 +507,8 @@ txg_sync_thread(dsl_pool_t *dp)
txg, tx->tx_quiesce_txg_waiting, tx->tx_sync_txg_waiting);
mutex_exit(&tx->tx_sync_lock);
+ zfs_zone_report_txg_sync(dp);
+
start = ddi_get_lbolt();
spa_sync(spa, txg);
delta = ddi_get_lbolt() - start;
diff --git a/usr/src/uts/common/fs/zfs/vdev_disk.c b/usr/src/uts/common/fs/zfs/vdev_disk.c
index 22e376d3ea..1e5b93bb89 100644
--- a/usr/src/uts/common/fs/zfs/vdev_disk.c
+++ b/usr/src/uts/common/fs/zfs/vdev_disk.c
@@ -21,11 +21,13 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
#include <sys/zfs_context.h>
+#include <sys/zfs_zone.h>
#include <sys/spa_impl.h>
#include <sys/refcount.h>
#include <sys/vdev_disk.h>
@@ -44,6 +46,11 @@ extern ldi_ident_t zfs_li;
static void vdev_disk_close(vdev_t *);
+typedef struct vdev_disk_buf {
+ buf_t vdb_buf;
+ zio_t *vdb_io;
+} vdev_disk_buf_t;
+
typedef struct vdev_disk_ldi_cb {
list_node_t lcb_next;
ldi_callback_id_t lcb_id;
@@ -127,6 +134,8 @@ vdev_disk_off_finalize(ldi_handle_t lh, ldi_ev_cookie_t ecookie,
int ldi_result, void *arg, void *ev_data)
{
vdev_t *vd = (vdev_t *)arg;
+ vdev_disk_t *dvd = vd->vdev_tsd;
+ vdev_disk_ldi_cb_t *lcb;
/*
* Ignore events other than offline.
@@ -586,6 +595,7 @@ static void
vdev_disk_close(vdev_t *vd)
{
vdev_disk_t *dvd = vd->vdev_tsd;
+ vdev_disk_ldi_cb_t *lcb;
if (vd->vdev_reopening || dvd == NULL)
return;
@@ -809,6 +819,8 @@ vdev_disk_io_start(zio_t *zio)
bp->b_bufsize = zio->io_size;
bp->b_iodone = (int (*)())vdev_disk_io_intr;
+ zfs_zone_zio_start(zio);
+
/* ldi_strategy() will return non-zero only on programming errors */
VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0);
@@ -820,6 +832,8 @@ vdev_disk_io_done(zio_t *zio)
{
vdev_t *vd = zio->io_vd;
+ zfs_zone_zio_done(zio);
+
/*
* If the device returned EIO, then attempt a DKIOCSTATE ioctl to see if
* the device has been removed. If this is the case, then we trigger an
diff --git a/usr/src/uts/common/fs/zfs/vdev_queue.c b/usr/src/uts/common/fs/zfs/vdev_queue.c
index a394b80c67..da50548bcb 100644
--- a/usr/src/uts/common/fs/zfs/vdev_queue.c
+++ b/usr/src/uts/common/fs/zfs/vdev_queue.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -33,6 +34,7 @@
#include <sys/zio.h>
#include <sys/avl.h>
#include <sys/dsl_pool.h>
+#include <sys/zfs_zone.h>
/*
* ZFS I/O Scheduler
@@ -141,7 +143,7 @@ uint32_t zfs_vdev_sync_write_min_active = 10;
uint32_t zfs_vdev_sync_write_max_active = 10;
uint32_t zfs_vdev_async_read_min_active = 1;
uint32_t zfs_vdev_async_read_max_active = 3;
-uint32_t zfs_vdev_async_write_min_active = 1;
+uint32_t zfs_vdev_async_write_min_active = 3;
uint32_t zfs_vdev_async_write_max_active = 10;
uint32_t zfs_vdev_scrub_min_active = 1;
uint32_t zfs_vdev_scrub_max_active = 2;
@@ -215,6 +217,8 @@ vdev_queue_init(vdev_t *vd)
avl_create(&vq->vq_active_tree, vdev_queue_offset_compare,
sizeof (zio_t), offsetof(struct zio, io_queue_node));
+ vq->vq_last_zone_id = 0;
+
for (zio_priority_t p = 0; p < ZIO_PRIORITY_NUM_QUEUEABLE; p++) {
/*
* The synchronous i/o queues are FIFO rather than LBA ordered.
@@ -248,6 +252,7 @@ vdev_queue_io_add(vdev_queue_t *vq, zio_t *zio)
{
spa_t *spa = zio->io_spa;
ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
+ zfs_zone_zio_enqueue(zio);
avl_add(&vq->vq_class[zio->io_priority].vqc_queued_tree, zio);
mutex_enter(&spa->spa_iokstat_lock);
@@ -262,6 +267,7 @@ vdev_queue_io_remove(vdev_queue_t *vq, zio_t *zio)
{
spa_t *spa = zio->io_spa;
ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
+ zfs_zone_zio_dequeue(zio);
avl_remove(&vq->vq_class[zio->io_priority].vqc_queued_tree, zio);
mutex_enter(&spa->spa_iokstat_lock);
@@ -622,7 +628,11 @@ again:
search.io_timestamp = 0;
search.io_offset = vq->vq_last_offset + 1;
VERIFY3P(avl_find(&vqc->vqc_queued_tree, &search, &idx), ==, NULL);
+#ifdef _KERNEL
+ zio = zfs_zone_schedule(vq, p, idx);
+#else
zio = avl_nearest(&vqc->vqc_queued_tree, idx, AVL_AFTER);
+#endif
if (zio == NULL)
zio = avl_first(&vqc->vqc_queued_tree);
ASSERT3U(zio->io_priority, ==, p);
diff --git a/usr/src/uts/common/fs/zfs/zfs_ioctl.c b/usr/src/uts/common/fs/zfs/zfs_ioctl.c
index 4d99271ab7..15fb771a8b 100644
--- a/usr/src/uts/common/fs/zfs/zfs_ioctl.c
+++ b/usr/src/uts/common/fs/zfs/zfs_ioctl.c
@@ -611,9 +611,10 @@ zfs_secpolicy_setprop(const char *dsname, zfs_prop_t prop, nvpair_t *propval,
* Check permissions for special properties.
*/
switch (prop) {
+ case ZFS_PROP_DEDUP:
case ZFS_PROP_ZONED:
/*
- * Disallow setting of 'zoned' from within a local zone.
+ * Disallow setting these properties from within a local zone.
*/
if (!INGLOBALZONE(curproc))
return (SET_ERROR(EPERM));
@@ -2032,7 +2033,8 @@ zfs_ioc_vdev_setfru(zfs_cmd_t *zc)
}
static int
-zfs_ioc_objset_stats_impl(zfs_cmd_t *zc, objset_t *os)
+zfs_ioc_objset_stats_impl(zfs_cmd_t *zc, objset_t *os,
+ boolean_t cachedpropsonly)
{
int error = 0;
nvlist_t *nv;
@@ -2050,7 +2052,8 @@ zfs_ioc_objset_stats_impl(zfs_cmd_t *zc, objset_t *os)
* XXX reading with out owning
*/
if (!zc->zc_objset_stats.dds_inconsistent &&
- dmu_objset_type(os) == DMU_OST_ZVOL) {
+ dmu_objset_type(os) == DMU_OST_ZVOL &&
+ !cachedpropsonly) {
error = zvol_get_stats(os, nv);
if (error == EIO)
return (error);
@@ -2077,11 +2080,24 @@ static int
zfs_ioc_objset_stats(zfs_cmd_t *zc)
{
objset_t *os;
+ nvlist_t *nvl = NULL;
+ boolean_t cachedpropsonly = B_FALSE;
int error;
+ if (zc->zc_nvlist_src != NULL &&
+ (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
+ zc->zc_iflags, &nvl) != 0))
+ return (error);
+
+ if (nvl != NULL) {
+ (void) nvlist_lookup_boolean_value(nvl, "cachedpropsonly",
+ &cachedpropsonly);
+ nvlist_free(nvl);
+ }
+
error = dmu_objset_hold(zc->zc_name, FTAG, &os);
if (error == 0) {
- error = zfs_ioc_objset_stats_impl(zc, os);
+ error = zfs_ioc_objset_stats_impl(zc, os, cachedpropsonly);
dmu_objset_rele(os, FTAG);
}
@@ -2275,8 +2291,21 @@ static int
zfs_ioc_snapshot_list_next(zfs_cmd_t *zc)
{
objset_t *os;
+ nvlist_t *nvl = NULL;
+ boolean_t cachedpropsonly = B_FALSE;
int error;
+ if (zc->zc_nvlist_src != NULL &&
+ (error = get_nvlist(zc->zc_nvlist_src, zc->zc_nvlist_src_size,
+ zc->zc_iflags, &nvl) != 0))
+ return (error);
+
+ if (nvl != NULL) {
+ (void) nvlist_lookup_boolean_value(nvl, "cachedpropsonly",
+ &cachedpropsonly);
+ nvlist_free(nvl);
+ }
+
error = dmu_objset_hold(zc->zc_name, FTAG, &os);
if (error != 0) {
return (error == ENOENT ? ESRCH : error);
@@ -2305,8 +2334,10 @@ zfs_ioc_snapshot_list_next(zfs_cmd_t *zc)
objset_t *ossnap;
error = dmu_objset_from_ds(ds, &ossnap);
- if (error == 0)
- error = zfs_ioc_objset_stats_impl(zc, ossnap);
+ if (error == 0) {
+ error = zfs_ioc_objset_stats_impl(zc,
+ ossnap, cachedpropsonly);
+ }
dsl_dataset_rele(ds, FTAG);
}
} else if (error == ENOENT) {
@@ -3032,6 +3063,7 @@ zfs_fill_zplprops_impl(objset_t *os, uint64_t zplver,
uint64_t sense = ZFS_PROP_UNDEFINED;
uint64_t norm = ZFS_PROP_UNDEFINED;
uint64_t u8 = ZFS_PROP_UNDEFINED;
+ int error;
ASSERT(zplprops != NULL);
@@ -3075,8 +3107,9 @@ zfs_fill_zplprops_impl(objset_t *os, uint64_t zplver,
VERIFY(nvlist_add_uint64(zplprops,
zfs_prop_to_name(ZFS_PROP_VERSION), zplver) == 0);
- if (norm == ZFS_PROP_UNDEFINED)
- VERIFY(zfs_get_zplprop(os, ZFS_PROP_NORMALIZE, &norm) == 0);
+ if (norm == ZFS_PROP_UNDEFINED &&
+ (error = zfs_get_zplprop(os, ZFS_PROP_NORMALIZE, &norm)) != 0)
+ return (error);
VERIFY(nvlist_add_uint64(zplprops,
zfs_prop_to_name(ZFS_PROP_NORMALIZE), norm) == 0);
@@ -3085,13 +3118,15 @@ zfs_fill_zplprops_impl(objset_t *os, uint64_t zplver,
*/
if (norm)
u8 = 1;
- if (u8 == ZFS_PROP_UNDEFINED)
- VERIFY(zfs_get_zplprop(os, ZFS_PROP_UTF8ONLY, &u8) == 0);
+ if (u8 == ZFS_PROP_UNDEFINED &&
+ (error = zfs_get_zplprop(os, ZFS_PROP_UTF8ONLY, &u8)) != 0)
+ return (error);
VERIFY(nvlist_add_uint64(zplprops,
zfs_prop_to_name(ZFS_PROP_UTF8ONLY), u8) == 0);
- if (sense == ZFS_PROP_UNDEFINED)
- VERIFY(zfs_get_zplprop(os, ZFS_PROP_CASE, &sense) == 0);
+ if (sense == ZFS_PROP_UNDEFINED &&
+ (error = zfs_get_zplprop(os, ZFS_PROP_CASE, &sense)) != 0)
+ return (error);
VERIFY(nvlist_add_uint64(zplprops,
zfs_prop_to_name(ZFS_PROP_CASE), sense) == 0);
diff --git a/usr/src/uts/common/fs/zfs/zfs_vfsops.c b/usr/src/uts/common/fs/zfs/zfs_vfsops.c
index b7aa2e076b..7a6437cbd4 100644
--- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c
+++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -1951,6 +1952,17 @@ zfs_umount(vfs_t *vfsp, int fflag, cred_t *cr)
if (zfsvfs->z_ctldir != NULL)
zfsctl_destroy(zfsvfs);
+ /*
+ * If we're doing a forced unmount on a dataset which still has
+ * references and is in a zone, then we need to cleanup the zone
+ * reference at this point or else the zone will never be able to
+ * shutdown.
+ */
+ if ((fflag & MS_FORCE) && vfsp->vfs_count > 1 && vfsp->vfs_zone) {
+ zone_rele_ref(&vfsp->vfs_implp->vi_zone_ref, ZONE_REF_VFS);
+ vfsp->vfs_zone = NULL;
+ }
+
return (0);
}
diff --git a/usr/src/uts/common/fs/zfs/zfs_vnops.c b/usr/src/uts/common/fs/zfs/zfs_vnops.c
index 6b5c6f852c..a2d2e67771 100644
--- a/usr/src/uts/common/fs/zfs/zfs_vnops.c
+++ b/usr/src/uts/common/fs/zfs/zfs_vnops.c
@@ -22,11 +22,16 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/* Portions Copyright 2007 Jeremy Teo */
/* Portions Copyright 2010 Robert Milkowski */
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
#include <sys/types.h>
#include <sys/param.h>
#include <sys/time.h>
@@ -633,6 +638,17 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
if (limit == RLIM64_INFINITY || limit > MAXOFFSET_T)
limit = MAXOFFSET_T;
+ /*
+ * Pre-fault the pages to ensure slow (eg NFS) pages
+ * don't hold up txg.
+ * Skip this if uio contains loaned arc_buf.
+ */
+ if ((uio->uio_extflg == UIO_XUIO) &&
+ (((xuio_t *)uio)->xu_type == UIOTYPE_ZEROCOPY))
+ xuio = (xuio_t *)uio;
+ else
+ uio_prefaultpages(n, uio);
+
ZFS_ENTER(zfsvfs);
ZFS_VERIFY_ZP(zp);
@@ -675,17 +691,6 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
}
/*
- * Pre-fault the pages to ensure slow (eg NFS) pages
- * don't hold up txg.
- * Skip this if uio contains loaned arc_buf.
- */
- if ((uio->uio_extflg == UIO_XUIO) &&
- (((xuio_t *)uio)->xu_type == UIOTYPE_ZEROCOPY))
- xuio = (xuio_t *)uio;
- else
- uio_prefaultpages(MIN(n, max_blksz), uio);
-
- /*
* If in append mode, set the io offset pointer to eof.
*/
if (ioflag & FAPPEND) {
@@ -919,9 +924,6 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
break;
ASSERT(tx_bytes == nbytes);
n -= nbytes;
-
- if (!xuio && n > 0)
- uio_prefaultpages(MIN(n, max_blksz), uio);
}
zfs_range_unlock(rl);
@@ -3586,18 +3588,6 @@ top:
}
}
- vnevent_rename_src(ZTOV(szp), sdvp, snm, ct);
- if (tzp)
- vnevent_rename_dest(ZTOV(tzp), tdvp, tnm, ct);
-
- /*
- * notify the target directory if it is not the same
- * as source directory.
- */
- if (tdvp != sdvp) {
- vnevent_rename_dest_dir(tdvp, ct);
- }
-
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, szp->z_sa_hdl, B_FALSE);
dmu_tx_hold_sa(tx, sdzp->z_sa_hdl, B_FALSE);
@@ -3638,8 +3628,12 @@ top:
return (error);
}
- if (tzp) /* Attempt to remove the existing target */
+ if (tzp) {
+ /* Attempt to remove the existing target */
error = zfs_link_destroy(tdl, tzp, tx, zflg, NULL);
+ if (error == 0)
+ vnevent_rename_dest(ZTOV(tzp), tdvp, tnm, ct);
+ }
if (error == 0) {
error = zfs_link_create(tdl, szp, tx, ZRENAMING);
@@ -3681,6 +3675,13 @@ top:
}
dmu_tx_commit(tx);
+
+ if (error == 0) {
+ vnevent_rename_src(ZTOV(szp), sdvp, snm, ct);
+ /* notify the target dir if it is not the same as source dir */
+ if (tdvp != sdvp)
+ vnevent_rename_dest_dir(tdvp, ct);
+ }
out:
if (zl != NULL)
zfs_rename_unlock(&zl);
@@ -4171,6 +4172,8 @@ zfs_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp,
&zp->z_pflags, 8);
zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime,
B_TRUE);
+ err = sa_bulk_update(zp->z_sa_hdl, bulk, count, tx);
+
zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0);
}
dmu_tx_commit(tx);
@@ -4674,27 +4677,6 @@ zfs_addmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr,
return (0);
}
-/*
- * The reason we push dirty pages as part of zfs_delmap() is so that we get a
- * more accurate mtime for the associated file. Since we don't have a way of
- * detecting when the data was actually modified, we have to resort to
- * heuristics. If an explicit msync() is done, then we mark the mtime when the
- * last page is pushed. The problem occurs when the msync() call is omitted,
- * which by far the most common case:
- *
- * open()
- * mmap()
- * <modify memory>
- * munmap()
- * close()
- * <time lapse>
- * putpage() via fsflush
- *
- * If we wait until fsflush to come along, we can have a modification time that
- * is some arbitrary point in the future. In order to prevent this in the
- * common case, we flush pages whenever a (MAP_SHARED, PROT_WRITE) mapping is
- * torn down.
- */
/* ARGSUSED */
static int
zfs_delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr,
@@ -4706,10 +4688,6 @@ zfs_delmap(vnode_t *vp, offset_t off, struct as *as, caddr_t addr,
ASSERT3U(VTOZ(vp)->z_mapcnt, >=, pages);
atomic_add_64(&VTOZ(vp)->z_mapcnt, -pages);
- if ((flags & MAP_SHARED) && (prot & PROT_WRITE) &&
- vn_has_cached_data(vp))
- (void) VOP_PUTPAGE(vp, off, len, B_ASYNC, cr, ct);
-
return (0);
}
diff --git a/usr/src/uts/common/fs/zfs/zfs_zone.c b/usr/src/uts/common/fs/zfs/zfs_zone.c
new file mode 100644
index 0000000000..503416b293
--- /dev/null
+++ b/usr/src/uts/common/fs/zfs/zfs_zone.c
@@ -0,0 +1,1329 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2013, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * The ZFS/Zone I/O throttle and scheduler attempts to ensure fair access to
+ * ZFS I/O resources for each zone.
+ *
+ * I/O contention can be major pain point on a multi-tenant system. A single
+ * zone can issue a stream of I/O operations, usually synchronous writes, which
+ * disrupt I/O performance for all other zones. This problem is further
+ * exacerbated by ZFS, which buffers all asynchronous writes in a single TXG,
+ * a set of blocks which are atomically synced to disk. The process of
+ * syncing a TXG can occupy all of a device's I/O bandwidth, thereby starving
+ * out any pending read operations.
+ *
+ * There are two facets to this capability; the throttle and the scheduler.
+ *
+ * Throttle
+ *
+ * The requirements on the throttle are:
+ *
+ * 1) Ensure consistent and predictable I/O latency across all zones.
+ * 2) Sequential and random workloads have very different characteristics,
+ * so it is a non-starter to track IOPS or throughput.
+ * 3) A zone should be able to use the full disk bandwidth if no other zone
+ * is actively using the disk.
+ *
+ * The throttle has two components: one to track and account for each zone's
+ * I/O requests, and another to throttle each zone's operations when it
+ * exceeds its fair share of disk I/O. When the throttle detects that a zone is
+ * consuming more than is appropriate, each read or write system call is
+ * delayed by up to 100 microseconds, which we've found is sufficient to allow
+ * other zones to interleave I/O requests during those delays.
+ *
+ * Note: The throttle will delay each logical I/O (as opposed to the physical
+ * I/O which will likely be issued asynchronously), so it may be easier to
+ * think of the I/O throttle delaying each read/write syscall instead of the
+ * actual I/O operation. For each zone, the throttle tracks an ongoing average
+ * of read and write operations performed to determine the overall I/O
+ * utilization for each zone.
+ *
+ * The throttle calculates a I/O utilization metric for each zone using the
+ * following formula:
+ *
+ * (# of read syscalls) x (Average read latency) +
+ * (# of write syscalls) x (Average write latency)
+ *
+ * Once each zone has its utilization metric, the I/O throttle will compare I/O
+ * utilization across all zones, and if a zone has a higher-than-average I/O
+ * utilization, system calls from that zone are throttled. That is, if one
+ * zone has a much higher utilization, that zone's delay is increased by 5
+ * microseconds, up to a maximum of 100 microseconds. Conversely, if a zone is
+ * already throttled and has a lower utilization than average, its delay will
+ * be lowered by 5 microseconds.
+ *
+ * The throttle calculation is driven by IO activity, but since IO does not
+ * happen at fixed intervals, timestamps are used to track when the last update
+ * was made and to drive recalculation.
+ *
+ * The throttle recalculates each zone's I/O usage and throttle delay (if any)
+ * on the zfs_zone_adjust_time interval. Overall I/O latency is maintained as
+ * a decayed average which is updated on the zfs_zone_sys_avg_cycle interval.
+ *
+ * Scheduler
+ *
+ * The I/O scheduler manages the vdev queues – the queues of pending I/Os to
+ * issue to the disks. It only makes scheduling decisions for the two
+ * synchronous I/O queues (read & write).
+ *
+ * The scheduler maintains how many I/Os in the queue are from each zone, and
+ * if one zone has a disproportionately large number of I/Os in the queue, the
+ * scheduler will allow certain I/Os from the underutilized zones to be "bumped"
+ * and pulled from the middle of the queue. This bump allows zones with a small
+ * number of I/Os (so small they may not even be taken into account by the
+ * throttle) to complete quickly instead of waiting behind dozens of I/Os from
+ * other zones.
+ */
+
+#include <sys/spa.h>
+#include <sys/vdev_impl.h>
+#include <sys/zfs_zone.h>
+
+#ifndef _KERNEL
+
+/*
+ * Stubs for when compiling for user-land.
+ */
+
+void
+zfs_zone_io_throttle(zfs_zone_iop_type_t type)
+{
+}
+
+void
+zfs_zone_zio_init(zio_t *zp)
+{
+}
+
+void
+zfs_zone_zio_start(zio_t *zp)
+{
+}
+
+void
+zfs_zone_zio_done(zio_t *zp)
+{
+}
+
+void
+zfs_zone_zio_dequeue(zio_t *zp)
+{
+}
+
+void
+zfs_zone_zio_enqueue(zio_t *zp)
+{
+}
+
+/*ARGSUSED*/
+void
+zfs_zone_report_txg_sync(void *dp)
+{
+}
+
+hrtime_t
+zfs_zone_txg_delay()
+{
+ return (MSEC2NSEC(10));
+}
+
+#else
+
+/*
+ * The real code.
+ */
+
+#include <sys/systm.h>
+#include <sys/thread.h>
+#include <sys/proc.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/atomic.h>
+#include <sys/zio.h>
+#include <sys/zone.h>
+#include <sys/avl.h>
+#include <sys/sdt.h>
+#include <sys/ddi.h>
+
+/*
+ * The zone throttle delays read and write operations from certain zones based
+ * on each zone's IO utilitzation. Once a cycle (defined by zfs_zone_cycle_time
+ * below), the delays for each zone are recalculated based on the utilization
+ * over the previous window.
+ */
+boolean_t zfs_zone_delay_enable = B_TRUE; /* enable IO throttle */
+uint16_t zfs_zone_delay_step = 5; /* usec amnt to change delay */
+uint16_t zfs_zone_delay_ceiling = 100; /* usec delay max */
+
+boolean_t zfs_zone_priority_enable = B_TRUE; /* enable IO priority */
+
+/*
+ * For certain workloads, one zone may be issuing primarily sequential I/O and
+ * another primarily random I/O. The sequential I/O will complete much more
+ * quickly than the random I/O, driving the average system latency for those
+ * operations way down. As a result, the random I/O may be throttled back, even
+ * though the sequential I/O should be throttled to allow the random I/O more
+ * access to the disk.
+ *
+ * This tunable limits the discrepancy between the read and write system
+ * latency. If one becomes excessively high, this tunable prevents the I/O
+ * throttler from exacerbating the imbalance.
+ */
+uint_t zfs_zone_rw_lat_limit = 10;
+
+/*
+ * The I/O throttle will only start delaying zones when it detects disk
+ * utilization has reached a certain level. This tunable controls the
+ * threshold at which the throttle will start delaying zones. When the number
+ * of vdevs is small, the calculation should correspond closely with the %b
+ * column from iostat -- but as the number of vdevs becomes large, it will
+ * correlate less and less to any single device (therefore making it a poor
+ * approximation for the actual I/O utilization on such systems). We
+ * therefore use our derived utilization conservatively: we know that low
+ * derived utilization does indeed correlate to low I/O use -- but that a high
+ * rate of derived utilization does not necesarily alone denote saturation;
+ * where we see a high rate of utilization, we also look for laggard I/Os to
+ * attempt to detect saturation.
+ */
+uint_t zfs_zone_util_threshold = 80;
+uint_t zfs_zone_underutil_threshold = 60;
+
+/*
+ * There are three important tunables here: zfs_zone_laggard_threshold denotes
+ * the threshold at which an I/O is considered to be of notably high latency;
+ * zfs_zone_laggard_recent denotes the number of microseconds before the
+ * current time after which the last laggard is considered to be sufficiently
+ * recent to merit increasing the throttle; zfs_zone_laggard_ancient denotes
+ * the microseconds before the current time before which the last laggard is
+ * considered to be sufficiently old to merit decreasing the throttle. The
+ * most important tunable of these three is the zfs_zone_laggard_threshold: in
+ * modeling data from a large public cloud, this tunable was found to have a
+ * much greater effect on the throttle than the two time-based thresholds.
+ * This must be set high enough to not result in spurious throttling, but not
+ * so high as to allow pathological I/O to persist in the system.
+ */
+uint_t zfs_zone_laggard_threshold = 50000; /* 50 ms */
+uint_t zfs_zone_laggard_recent = 1000000; /* 1000 ms */
+uint_t zfs_zone_laggard_ancient = 5000000; /* 5000 ms */
+
+/*
+ * Throughout this subsystem, our timestamps are in microseconds. Our system
+ * average cycle is one second or 1 million microseconds. Our zone counter
+ * update cycle is two seconds or 2 million microseconds. We use a longer
+ * duration for that cycle because some ops can see a little over two seconds of
+ * latency when they are being starved by another zone.
+ */
+uint_t zfs_zone_sys_avg_cycle = 1000000; /* 1 s */
+uint_t zfs_zone_cycle_time = 2000000; /* 2 s */
+
+/*
+ * How often the I/O throttle will reevaluate each zone's utilization, in
+ * microseconds. Default is 1/4 sec.
+ */
+uint_t zfs_zone_adjust_time = 250000; /* 250 ms */
+
+typedef struct {
+ hrtime_t cycle_start;
+ int cycle_cnt;
+ hrtime_t cycle_lat;
+ hrtime_t sys_avg_lat;
+} sys_lat_cycle_t;
+
+typedef struct {
+ hrtime_t zi_now;
+ uint_t zi_avgrlat;
+ uint_t zi_avgwlat;
+ uint64_t zi_totpri;
+ uint64_t zi_totutil;
+ int zi_active;
+ uint_t zi_diskutil;
+ boolean_t zi_underutil;
+ boolean_t zi_overutil;
+} zoneio_stats_t;
+
+static sys_lat_cycle_t rd_lat;
+static sys_lat_cycle_t wr_lat;
+
+/*
+ * Some basic disk stats to determine disk utilization. The utilization info
+ * for all disks on the system is aggregated into these values.
+ *
+ * Overall disk utilization for the current cycle is calculated as:
+ *
+ * ((zfs_disk_rtime - zfs_disk_last_rtime) * 100)
+ * ----------------------------------------------
+ * ((now - zfs_zone_last_checked) * 1000);
+ */
+kmutex_t zfs_disk_lock; /* protects the following: */
+uint_t zfs_disk_rcnt; /* Number of outstanding IOs */
+hrtime_t zfs_disk_rtime = 0; /* cummulative sum of time performing IO */
+hrtime_t zfs_disk_rlastupdate = 0; /* time last IO dispatched */
+
+hrtime_t zfs_disk_last_rtime = 0; /* prev. cycle's zfs_disk_rtime val */
+/* time that we last updated per-zone throttle info */
+hrtime_t zfs_zone_last_checked = 0;
+hrtime_t zfs_disk_last_laggard = 0;
+
+/*
+ * Data used to keep track of how often txg sync is running.
+ */
+extern int zfs_txg_timeout;
+static uint_t txg_last_check;
+static uint_t txg_cnt;
+static uint_t txg_sync_rate;
+
+boolean_t zfs_zone_schedule_enable = B_TRUE; /* enable IO sched. */
+/*
+ * Threshold for when zio scheduling should kick in.
+ *
+ * This threshold is based on the zfs_vdev_sync_read_max_active value for the
+ * number of I/Os that can be pending on a device. If there are more than the
+ * max_active ops already queued up, beyond those already issued to the vdev,
+ * then use zone-based scheduling to get the next synchronous zio.
+ */
+uint32_t zfs_zone_schedule_thresh = 10;
+
+/*
+ * On each pass of the scheduler we increment the zone's weight (up to this
+ * maximum). The weight is used by the scheduler to prevent starvation so
+ * that zones which haven't been able to do any IO over many iterations
+ * will max out thier weight to this value.
+ */
+#define SCHED_WEIGHT_MAX 20
+
+/*
+ * Tunables for delay throttling when TXG sync is occurring.
+ *
+ * If the zone is performing a write and we're doing above normal TXG syncing,
+ * then throttle for longer than normal. The zone's wait time is multiplied
+ * by the scale (zfs_zone_txg_throttle_scale).
+ */
+int zfs_zone_txg_throttle_scale = 2;
+hrtime_t zfs_zone_txg_delay_nsec = MSEC2NSEC(20);
+
+typedef struct {
+ int zq_qdepth;
+ zio_priority_t zq_queue;
+ int zq_priority;
+ int zq_wt;
+ zoneid_t zq_zoneid;
+} zone_q_bump_t;
+
+/*
+ * This uses gethrtime() but returns a value in usecs.
+ */
+#define GET_USEC_TIME (gethrtime() / 1000)
+#define NANO_TO_MICRO(x) (x / (NANOSEC / MICROSEC))
+
+/*
+ * Keep track of the zone's ZFS IOPs.
+ *
+ * See the comment on the zfs_zone_io_throttle function for which/how IOPs are
+ * accounted for.
+ *
+ * If the number of ops is >1 then we can just use that value. However,
+ * if the number of ops is <2 then we might have a zone which is trying to do
+ * IO but is not able to get any ops through the system. We don't want to lose
+ * track of this zone so we factor in its decayed count into the current count.
+ *
+ * Each cycle (zfs_zone_sys_avg_cycle) we want to update the decayed count.
+ * However, since this calculation is driven by IO activity and since IO does
+ * not happen at fixed intervals, we use a timestamp to see when the last update
+ * was made. If it was more than one cycle ago, then we need to decay the
+ * historical count by the proper number of additional cycles in which no IO was
+ * performed.
+ *
+ * Return a time delta indicating how far into the current cycle we are or 0
+ * if the last IO was more than a cycle ago.
+ */
+static hrtime_t
+compute_historical_zone_cnt(hrtime_t unow, sys_zio_cntr_t *cp)
+{
+ hrtime_t delta;
+ int gen_cnt;
+
+ /*
+ * Check if its time to recompute a new zone count.
+ * If we're still collecting data for the current cycle, return false.
+ */
+ delta = unow - cp->cycle_start;
+ if (delta < zfs_zone_cycle_time)
+ return (delta);
+
+ /* A previous cycle is past, compute the new zone count. */
+
+ /*
+ * Figure out how many generations we have to decay the historical
+ * count, since multiple cycles may have elapsed since our last IO.
+ * We depend on int rounding here.
+ */
+ gen_cnt = (int)(delta / zfs_zone_cycle_time);
+
+ /* If more than 5 cycles since last the IO, reset count. */
+ if (gen_cnt > 5) {
+ cp->zone_avg_cnt = 0;
+ } else {
+ /* Update the count. */
+ int i;
+
+ /*
+ * If the zone did more than 1 IO, just use its current count
+ * as the historical value, otherwise decay the historical
+ * count and factor that into the new historical count. We
+ * pick a threshold > 1 so that we don't lose track of IO due
+ * to int rounding.
+ */
+ if (cp->cycle_cnt > 1)
+ cp->zone_avg_cnt = cp->cycle_cnt;
+ else
+ cp->zone_avg_cnt = cp->cycle_cnt +
+ (cp->zone_avg_cnt / 2);
+
+ /*
+ * If more than one generation has elapsed since the last
+ * update, decay the values further.
+ */
+ for (i = 1; i < gen_cnt; i++)
+ cp->zone_avg_cnt = cp->zone_avg_cnt / 2;
+ }
+
+ /* A new cycle begins. */
+ cp->cycle_start = unow;
+ cp->cycle_cnt = 0;
+
+ return (0);
+}
+
+/*
+ * Add IO op data to the zone.
+ */
+static void
+add_zone_iop(zone_t *zonep, hrtime_t unow, zfs_zone_iop_type_t op)
+{
+ switch (op) {
+ case ZFS_ZONE_IOP_READ:
+ (void) compute_historical_zone_cnt(unow, &zonep->zone_rd_ops);
+ zonep->zone_rd_ops.cycle_cnt++;
+ break;
+ case ZFS_ZONE_IOP_WRITE:
+ (void) compute_historical_zone_cnt(unow, &zonep->zone_wr_ops);
+ zonep->zone_wr_ops.cycle_cnt++;
+ break;
+ case ZFS_ZONE_IOP_LOGICAL_WRITE:
+ (void) compute_historical_zone_cnt(unow, &zonep->zone_lwr_ops);
+ zonep->zone_lwr_ops.cycle_cnt++;
+ break;
+ }
+}
+
+/*
+ * Use a decaying average to keep track of the overall system latency.
+ *
+ * We want to have the recent activity heavily weighted, but if the
+ * activity decreases or stops, then the average should quickly decay
+ * down to the new value.
+ *
+ * Each cycle (zfs_zone_sys_avg_cycle) we want to update the decayed average.
+ * However, since this calculation is driven by IO activity and since IO does
+ * not happen at fixed intervals, we use a timestamp to see when the last
+ * update was made. If it was more than one cycle ago, then we need to decay
+ * the average by the proper number of additional cycles in which no IO was
+ * performed.
+ *
+ * Return true if we actually computed a new system average.
+ * If we're still within an active cycle there is nothing to do, return false.
+ */
+static boolean_t
+compute_new_sys_avg(hrtime_t unow, sys_lat_cycle_t *cp)
+{
+ hrtime_t delta;
+ int gen_cnt;
+
+ /*
+ * Check if its time to recompute a new average.
+ * If we're still collecting data for the current cycle, return false.
+ */
+ delta = unow - cp->cycle_start;
+ if (delta < zfs_zone_sys_avg_cycle)
+ return (B_FALSE);
+
+ /* A previous cycle is past, compute a new system average. */
+
+ /*
+ * Figure out how many generations we have to decay, since multiple
+ * cycles may have elapsed since our last IO.
+ * We count on int rounding here.
+ */
+ gen_cnt = (int)(delta / zfs_zone_sys_avg_cycle);
+
+ /* If more than 5 cycles since last the IO, reset average. */
+ if (gen_cnt > 5) {
+ cp->sys_avg_lat = 0;
+ } else {
+ /* Update the average. */
+ int i;
+
+ cp->sys_avg_lat =
+ (cp->sys_avg_lat + cp->cycle_lat) / (1 + cp->cycle_cnt);
+
+ /*
+ * If more than one generation has elapsed since the last
+ * update, decay the values further.
+ */
+ for (i = 1; i < gen_cnt; i++)
+ cp->sys_avg_lat = cp->sys_avg_lat / 2;
+ }
+
+ /* A new cycle begins. */
+ cp->cycle_start = unow;
+ cp->cycle_cnt = 0;
+ cp->cycle_lat = 0;
+
+ return (B_TRUE);
+}
+
+static void
+add_sys_iop(hrtime_t unow, int op, int lat)
+{
+ switch (op) {
+ case ZFS_ZONE_IOP_READ:
+ (void) compute_new_sys_avg(unow, &rd_lat);
+ rd_lat.cycle_cnt++;
+ rd_lat.cycle_lat += lat;
+ break;
+ case ZFS_ZONE_IOP_WRITE:
+ (void) compute_new_sys_avg(unow, &wr_lat);
+ wr_lat.cycle_cnt++;
+ wr_lat.cycle_lat += lat;
+ break;
+ }
+}
+
+/*
+ * Get the zone IO counts.
+ */
+static uint_t
+calc_zone_cnt(hrtime_t unow, sys_zio_cntr_t *cp)
+{
+ hrtime_t delta;
+ uint_t cnt;
+
+ if ((delta = compute_historical_zone_cnt(unow, cp)) == 0) {
+ /*
+ * No activity in the current cycle, we already have the
+ * historical data so we'll use that.
+ */
+ cnt = cp->zone_avg_cnt;
+ } else {
+ /*
+ * If we're less than half way through the cycle then use
+ * the current count plus half the historical count, otherwise
+ * just use the current count.
+ */
+ if (delta < (zfs_zone_cycle_time / 2))
+ cnt = cp->cycle_cnt + (cp->zone_avg_cnt / 2);
+ else
+ cnt = cp->cycle_cnt;
+ }
+
+ return (cnt);
+}
+
+/*
+ * Get the average read/write latency in usecs for the system.
+ */
+static uint_t
+calc_avg_lat(hrtime_t unow, sys_lat_cycle_t *cp)
+{
+ if (compute_new_sys_avg(unow, cp)) {
+ /*
+ * No activity in the current cycle, we already have the
+ * historical data so we'll use that.
+ */
+ return (cp->sys_avg_lat);
+ } else {
+ /*
+ * We're within a cycle; weight the current activity higher
+ * compared to the historical data and use that.
+ */
+ DTRACE_PROBE3(zfs__zone__calc__wt__avg,
+ uintptr_t, cp->sys_avg_lat,
+ uintptr_t, cp->cycle_lat,
+ uintptr_t, cp->cycle_cnt);
+
+ return ((cp->sys_avg_lat + (cp->cycle_lat * 8)) /
+ (1 + (cp->cycle_cnt * 8)));
+ }
+}
+
+/*
+ * Account for the current IOP on the zone and for the system as a whole.
+ * The latency parameter is in usecs.
+ */
+static void
+add_iop(zone_t *zonep, hrtime_t unow, zfs_zone_iop_type_t op, hrtime_t lat)
+{
+ /* Add op to zone */
+ add_zone_iop(zonep, unow, op);
+
+ /* Track system latency */
+ if (op != ZFS_ZONE_IOP_LOGICAL_WRITE)
+ add_sys_iop(unow, op, lat);
+}
+
+/*
+ * Calculate and return the total number of read ops, write ops and logical
+ * write ops for the given zone. If the zone has issued operations of any type
+ * return a non-zero value, otherwise return 0.
+ */
+static int
+get_zone_io_cnt(hrtime_t unow, zone_t *zonep, uint_t *rops, uint_t *wops,
+ uint_t *lwops)
+{
+ *rops = calc_zone_cnt(unow, &zonep->zone_rd_ops);
+ *wops = calc_zone_cnt(unow, &zonep->zone_wr_ops);
+ *lwops = calc_zone_cnt(unow, &zonep->zone_lwr_ops);
+
+ DTRACE_PROBE4(zfs__zone__io__cnt, uintptr_t, zonep->zone_id,
+ uintptr_t, *rops, uintptr_t, *wops, uintptr_t, *lwops);
+
+ return (*rops | *wops | *lwops);
+}
+
+/*
+ * Get the average read/write latency in usecs for the system.
+ */
+static void
+get_sys_avg_lat(hrtime_t unow, uint_t *rlat, uint_t *wlat)
+{
+ *rlat = calc_avg_lat(unow, &rd_lat);
+ *wlat = calc_avg_lat(unow, &wr_lat);
+
+ /*
+ * In an attempt to improve the accuracy of the throttling algorithm,
+ * assume that IO operations can't have zero latency. Instead, assume
+ * a reasonable lower bound for each operation type. If the actual
+ * observed latencies are non-zero, use those latency values instead.
+ */
+ if (*rlat == 0)
+ *rlat = 1000;
+ if (*wlat == 0)
+ *wlat = 1000;
+
+ DTRACE_PROBE2(zfs__zone__sys__avg__lat, uintptr_t, *rlat,
+ uintptr_t, *wlat);
+}
+
+/*
+ * Find disk utilization for each zone and average utilization for all active
+ * zones.
+ */
+static int
+zfs_zone_wait_adjust_calculate_cb(zone_t *zonep, void *arg)
+{
+ zoneio_stats_t *sp = arg;
+ uint_t rops, wops, lwops;
+
+ if (zonep->zone_id == GLOBAL_ZONEID ||
+ get_zone_io_cnt(sp->zi_now, zonep, &rops, &wops, &lwops) == 0) {
+ zonep->zone_io_util = 0;
+ return (0);
+ }
+
+ zonep->zone_io_util = (rops * sp->zi_avgrlat) +
+ (wops * sp->zi_avgwlat) + (lwops * sp->zi_avgwlat);
+ sp->zi_totutil += zonep->zone_io_util;
+
+ if (zonep->zone_io_util > 0) {
+ sp->zi_active++;
+ sp->zi_totpri += zonep->zone_zfs_io_pri;
+ }
+
+ /*
+ * sdt:::zfs-zone-utilization
+ *
+ * arg0: zone ID
+ * arg1: read operations observed during time window
+ * arg2: physical write operations observed during time window
+ * arg3: logical write ops observed during time window
+ * arg4: calculated utilization given read and write ops
+ * arg5: I/O priority assigned to this zone
+ */
+ DTRACE_PROBE6(zfs__zone__utilization, uint_t, zonep->zone_id,
+ uint_t, rops, uint_t, wops, uint_t, lwops,
+ uint_t, zonep->zone_io_util, uint_t, zonep->zone_zfs_io_pri);
+
+ return (0);
+}
+
+static void
+zfs_zone_delay_inc(zone_t *zonep)
+{
+ if (zonep->zone_io_delay < zfs_zone_delay_ceiling)
+ zonep->zone_io_delay += zfs_zone_delay_step;
+}
+
+static void
+zfs_zone_delay_dec(zone_t *zonep)
+{
+ if (zonep->zone_io_delay > 0)
+ zonep->zone_io_delay -= zfs_zone_delay_step;
+}
+
+/*
+ * For all zones "far enough" away from the average utilization, increase that
+ * zones delay. Otherwise, reduce its delay.
+ */
+static int
+zfs_zone_wait_adjust_delay_cb(zone_t *zonep, void *arg)
+{
+ zoneio_stats_t *sp = arg;
+ uint16_t delay = zonep->zone_io_delay;
+ uint_t fairutil = 0;
+
+ zonep->zone_io_util_above_avg = B_FALSE;
+
+ /*
+ * Given the calculated total utilitzation for all zones, calculate the
+ * fair share of I/O for this zone.
+ */
+ if (zfs_zone_priority_enable && sp->zi_totpri > 0) {
+ fairutil = (sp->zi_totutil * zonep->zone_zfs_io_pri) /
+ sp->zi_totpri;
+ } else if (sp->zi_active > 0) {
+ fairutil = sp->zi_totutil / sp->zi_active;
+ }
+
+ /*
+ * Adjust each IO's delay. If the overall delay becomes too high, avoid
+ * increasing beyond the ceiling value.
+ */
+ if (zonep->zone_io_util > fairutil && sp->zi_overutil) {
+ zonep->zone_io_util_above_avg = B_TRUE;
+
+ if (sp->zi_active > 1)
+ zfs_zone_delay_inc(zonep);
+ } else if (zonep->zone_io_util < fairutil || sp->zi_underutil ||
+ sp->zi_active <= 1) {
+ zfs_zone_delay_dec(zonep);
+ }
+
+ /*
+ * sdt:::zfs-zone-throttle
+ *
+ * arg0: zone ID
+ * arg1: old delay for this zone
+ * arg2: new delay for this zone
+ * arg3: calculated fair I/O utilization
+ * arg4: actual I/O utilization
+ */
+ DTRACE_PROBE5(zfs__zone__throttle, uintptr_t, zonep->zone_id,
+ uintptr_t, delay, uintptr_t, zonep->zone_io_delay,
+ uintptr_t, fairutil, uintptr_t, zonep->zone_io_util);
+
+ return (0);
+}
+
+/*
+ * Examine the utilization between different zones, and adjust the delay for
+ * each zone appropriately.
+ */
+static void
+zfs_zone_wait_adjust(hrtime_t unow, hrtime_t last_checked)
+{
+ zoneio_stats_t stats;
+ hrtime_t laggard_udelta = 0;
+
+ (void) bzero(&stats, sizeof (stats));
+
+ stats.zi_now = unow;
+ get_sys_avg_lat(unow, &stats.zi_avgrlat, &stats.zi_avgwlat);
+
+ if (stats.zi_avgrlat > stats.zi_avgwlat * zfs_zone_rw_lat_limit)
+ stats.zi_avgrlat = stats.zi_avgwlat * zfs_zone_rw_lat_limit;
+ else if (stats.zi_avgrlat * zfs_zone_rw_lat_limit < stats.zi_avgwlat)
+ stats.zi_avgwlat = stats.zi_avgrlat * zfs_zone_rw_lat_limit;
+
+ if (zone_walk(zfs_zone_wait_adjust_calculate_cb, &stats) != 0)
+ return;
+
+ /*
+ * Calculate disk utilization for the most recent period.
+ */
+ if (zfs_disk_last_rtime == 0 || unow - last_checked <= 0) {
+ stats.zi_diskutil = 0;
+ } else {
+ stats.zi_diskutil =
+ ((zfs_disk_rtime - zfs_disk_last_rtime) * 100) /
+ ((unow - last_checked) * 1000);
+ }
+ zfs_disk_last_rtime = zfs_disk_rtime;
+
+ if (unow > zfs_disk_last_laggard)
+ laggard_udelta = unow - zfs_disk_last_laggard;
+
+ /*
+ * To minimize porpoising, we have three separate states for our
+ * assessment of I/O performance: overutilized, underutilized, and
+ * neither overutilized nor underutilized. We will increment the
+ * throttle if a zone is using more than its fair share _and_ I/O
+ * is overutilized; we will decrement the throttle if a zone is using
+ * less than its fair share _or_ I/O is underutilized.
+ */
+ stats.zi_underutil = stats.zi_diskutil < zfs_zone_underutil_threshold ||
+ laggard_udelta > zfs_zone_laggard_ancient;
+
+ stats.zi_overutil = stats.zi_diskutil > zfs_zone_util_threshold &&
+ laggard_udelta < zfs_zone_laggard_recent;
+
+ /*
+ * sdt:::zfs-zone-stats
+ *
+ * Statistics observed over the last period:
+ *
+ * arg0: average system read latency
+ * arg1: average system write latency
+ * arg2: number of active zones
+ * arg3: total I/O 'utilization' for all zones
+ * arg4: total I/O priority of all active zones
+ * arg5: calculated disk utilization
+ */
+ DTRACE_PROBE6(zfs__zone__stats, uintptr_t, stats.zi_avgrlat,
+ uintptr_t, stats.zi_avgwlat, uintptr_t, stats.zi_active,
+ uintptr_t, stats.zi_totutil, uintptr_t, stats.zi_totpri,
+ uintptr_t, stats.zi_diskutil);
+
+ (void) zone_walk(zfs_zone_wait_adjust_delay_cb, &stats);
+}
+
+/*
+ * Callback used to calculate a zone's IO schedule priority.
+ *
+ * We scan the zones looking for ones with ops in the queue. Out of those,
+ * we pick the one that calculates to the highest schedule priority.
+ */
+static int
+get_sched_pri_cb(zone_t *zonep, void *arg)
+{
+ int pri;
+ uint_t cnt;
+ zone_q_bump_t *qbp = arg;
+ zio_priority_t p = qbp->zq_queue;
+
+ cnt = zonep->zone_zfs_queued[p];
+ if (cnt == 0) {
+ zonep->zone_zfs_weight = 0;
+ return (0);
+ }
+
+ /*
+ * On each pass, increment the zone's weight. We use this as input
+ * to the calculation to prevent starvation. The value is reset
+ * each time we issue an IO for this zone so zones which haven't
+ * done any IO over several iterations will see their weight max
+ * out.
+ */
+ if (zonep->zone_zfs_weight < SCHED_WEIGHT_MAX)
+ zonep->zone_zfs_weight++;
+
+ /*
+ * This zone's IO priority is the inverse of the number of IOs
+ * the zone has enqueued * zone's configured priority * weight.
+ * The queue depth has already been scaled by 10 to avoid problems
+ * with int rounding.
+ *
+ * This means that zones with fewer IOs in the queue will get
+ * preference unless other zone's assigned priority pulls them
+ * ahead. The weight is factored in to help ensure that zones
+ * which haven't done IO in a while aren't getting starved.
+ */
+ pri = (qbp->zq_qdepth / cnt) *
+ zonep->zone_zfs_io_pri * zonep->zone_zfs_weight;
+
+ /*
+ * If this zone has a higher priority than what we found so far,
+ * it becomes the new leading contender.
+ */
+ if (pri > qbp->zq_priority) {
+ qbp->zq_zoneid = zonep->zone_id;
+ qbp->zq_priority = pri;
+ qbp->zq_wt = zonep->zone_zfs_weight;
+ }
+ return (0);
+}
+
+/*
+ * See if we need to bump a zone's zio to the head of the queue. This is only
+ * done on the two synchronous I/O queues (see the block comment on the
+ * zfs_zone_schedule function). We get the correct vdev_queue_class_t and
+ * queue depth from our caller.
+ *
+ * For single-threaded synchronous processes a zone cannot get more than
+ * 1 op into the queue at a time unless the zone is running multiple processes
+ * in parallel. This can cause an imbalance in performance if there are zones
+ * with many parallel processes (and ops in the queue) vs. other zones which
+ * are doing simple single-threaded processes, such as interactive tasks in the
+ * shell. These zones can get backed up behind a deep queue and their IO
+ * performance will appear to be very poor as a result. This can make the
+ * zone work badly for interactive behavior.
+ *
+ * The scheduling algorithm kicks in once we start to get a deeper queue.
+ * Once that occurs, we look at all of the zones to see which one calculates
+ * to the highest priority. We bump that zone's first zio to the head of the
+ * queue.
+ *
+ * We use a counter on the zone so that we can quickly find how many ops each
+ * zone has in the queue without having to search the entire queue itself.
+ * This scales better since the number of zones is expected to be on the
+ * order of 10-100 whereas the queue depth can be in the range of 50-2000.
+ * In addition, since the zio's in the queue only have the zoneid, we would
+ * have to look up the zone for each zio enqueued and that means the overhead
+ * for scanning the queue each time would be much higher.
+ *
+ * In all cases, we fall back to simply pulling the next op off the queue
+ * if something should go wrong.
+ */
+static zio_t *
+get_next_zio(vdev_queue_class_t *vqc, int qdepth, zio_priority_t p)
+{
+ zone_q_bump_t qbump;
+ zio_t *zp = NULL, *zphead;
+ int cnt = 0;
+
+ /* To avoid problems with int rounding, scale the queue depth by 10 */
+ qbump.zq_qdepth = qdepth * 10;
+ qbump.zq_priority = 0;
+ qbump.zq_zoneid = 0;
+ qbump.zq_queue = p;
+ (void) zone_walk(get_sched_pri_cb, &qbump);
+
+ zphead = avl_first(&vqc->vqc_queued_tree);
+
+ /* Check if the scheduler didn't pick a zone for some reason!? */
+ if (qbump.zq_zoneid != 0) {
+ for (zp = avl_first(&vqc->vqc_queued_tree); zp != NULL;
+ zp = avl_walk(&vqc->vqc_queued_tree, zp, AVL_AFTER)) {
+ if (zp->io_zoneid == qbump.zq_zoneid)
+ break;
+ cnt++;
+ }
+ }
+
+ if (zp == NULL) {
+ zp = zphead;
+ } else if (zp != zphead) {
+ /*
+ * Only fire the probe if we actually picked a different zio
+ * than the one already at the head of the queue.
+ */
+ DTRACE_PROBE4(zfs__zone__sched__bump, uint_t, zp->io_zoneid,
+ uint_t, cnt, int, qbump.zq_priority, int, qbump.zq_wt);
+ }
+
+ return (zp);
+}
+
+/*
+ * Add our zone ID to the zio so we can keep track of which zones are doing
+ * what, even when the current thread processing the zio is not associated
+ * with the zone (e.g. the kernel taskq which pushes out RX groups).
+ */
+void
+zfs_zone_zio_init(zio_t *zp)
+{
+ zone_t *zonep = curzone;
+
+ zp->io_zoneid = zonep->zone_id;
+}
+
+/*
+ * Track IO operations per zone. Called from dmu_tx_count_write for write ops
+ * and dmu_read_uio for read ops. For each operation, increment that zone's
+ * counter based on the type of operation.
+ *
+ * There are three basic ways that we can see write ops:
+ * 1) An application does write syscalls. Those ops go into a TXG which
+ * we'll count here. Sometime later a kernel taskq thread (we'll see the
+ * vdev IO as zone 0) will perform some number of physical writes to commit
+ * the TXG to disk. Those writes are not associated with the zone which
+ * made the write syscalls and the number of operations is not correlated
+ * between the taskq and the zone.
+ * 2) An application opens a file with O_SYNC. Each write will result in
+ * an operation which we'll see here plus a low-level vdev write from
+ * that zone.
+ * 3) An application does write syscalls followed by an fsync(). We'll
+ * count the writes going into a TXG here. We'll also see some number
+ * (usually much smaller, maybe only 1) of low-level vdev writes from this
+ * zone when the fsync is performed, plus some other low-level vdev writes
+ * from the taskq in zone 0 (are these metadata writes?).
+ *
+ * 4) In addition to the above, there are misc. system-level writes, such as
+ * writing out dirty pages to swap, or sync(2) calls, which will be handled
+ * by the global zone and which we count but don't generally worry about.
+ *
+ * Because of the above, we can see writes twice because this is called
+ * at a high level by a zone thread, but we also will count the phys. writes
+ * that are performed at a low level via zfs_zone_zio_start.
+ *
+ * Without this, it can look like a non-global zone never writes (case 1).
+ * Depending on when the TXG is synced, the counts may be in the same sample
+ * bucket or in a different one.
+ *
+ * Tracking read operations is simpler due to their synchronous semantics. The
+ * zfs_read function -- called as a result of a read(2) syscall -- will always
+ * retrieve the data to be read through dmu_read_uio.
+ */
+void
+zfs_zone_io_throttle(zfs_zone_iop_type_t type)
+{
+ zone_t *zonep = curzone;
+ hrtime_t unow, last_checked;
+ uint16_t wait;
+
+ unow = GET_USEC_TIME;
+
+ /*
+ * Only bump the counters for logical operations here. The counters for
+ * tracking physical IO operations are handled in zfs_zone_zio_done.
+ */
+ if (type == ZFS_ZONE_IOP_LOGICAL_WRITE) {
+ mutex_enter(&zonep->zone_stg_io_lock);
+ add_iop(zonep, unow, type, 0);
+ mutex_exit(&zonep->zone_stg_io_lock);
+ }
+
+ if (!zfs_zone_delay_enable)
+ return;
+
+ /*
+ * If the zone's I/O priority is set to zero, don't throttle that zone's
+ * operations at all.
+ */
+ if (zonep->zone_zfs_io_pri == 0)
+ return;
+
+ /*
+ * XXX There's a potential race here in that more than one thread may
+ * update the zone delays concurrently. The worst outcome is corruption
+ * of our data to track each zone's IO, so the algorithm may make
+ * incorrect throttling decisions until the data is refreshed.
+ */
+ last_checked = zfs_zone_last_checked;
+ if ((unow - last_checked) > zfs_zone_adjust_time) {
+ zfs_zone_last_checked = unow;
+ zfs_zone_wait_adjust(unow, last_checked);
+ }
+
+ if ((wait = zonep->zone_io_delay) > 0) {
+ /*
+ * If this is a write and we're doing above normal TXG
+ * syncing, then throttle for longer than normal.
+ */
+ if (type == ZFS_ZONE_IOP_LOGICAL_WRITE &&
+ (txg_cnt > 1 || txg_sync_rate > 1))
+ wait *= zfs_zone_txg_throttle_scale;
+
+ /*
+ * sdt:::zfs-zone-wait
+ *
+ * arg0: zone ID
+ * arg1: type of IO operation
+ * arg2: time to delay (in us)
+ */
+ DTRACE_PROBE3(zfs__zone__wait, uintptr_t, zonep->zone_id,
+ uintptr_t, type, uintptr_t, wait);
+
+ drv_usecwait(wait);
+
+ if (zonep->zone_vfs_stats != NULL) {
+ atomic_inc_64(&zonep->zone_vfs_stats->
+ zv_delay_cnt.value.ui64);
+ atomic_add_64(&zonep->zone_vfs_stats->
+ zv_delay_time.value.ui64, wait);
+ }
+ }
+}
+
+/*
+ * XXX Ignore the pool pointer parameter for now.
+ *
+ * Keep track to see if the TXG sync rate is running above the expected rate.
+ * If so, this implies that we are filling TXG's at a high rate due to a heavy
+ * write workload. We use this as input into the zone throttle.
+ *
+ * This function is called every 5 seconds (zfs_txg_timeout) under a normal
+ * write load. In this case, the sync rate is going to be 1. When there
+ * is a heavy write load, TXG's fill up fast and the sync thread will write
+ * the TXG more frequently (perhaps once a second). In this case the rate
+ * will be > 1. The sync rate is a lagging indicator since it can be up
+ * to 5 seconds old. We use the txg_cnt to keep track of the rate in the
+ * current 5 second interval and txg_sync_rate to keep track of the previous
+ * 5 second interval. In that way we don't have a period (1 or more seconds)
+ * where the txg_cnt == 0 and we cut back on throttling even though the rate
+ * is still high.
+ */
+/*ARGSUSED*/
+void
+zfs_zone_report_txg_sync(void *dp)
+{
+ uint_t now;
+
+ txg_cnt++;
+ now = (uint_t)(gethrtime() / NANOSEC);
+ if ((now - txg_last_check) >= zfs_txg_timeout) {
+ txg_sync_rate = txg_cnt / 2;
+ txg_cnt = 0;
+ txg_last_check = now;
+ }
+}
+
+hrtime_t
+zfs_zone_txg_delay()
+{
+ if (curzone->zone_io_util_above_avg)
+ return (zfs_zone_txg_delay_nsec);
+
+ return (MSEC2NSEC(10));
+}
+
+/*
+ * Called from vdev_disk_io_start when an IO hits the end of the zio pipeline
+ * and is issued.
+ * Keep track of start time for latency calculation in zfs_zone_zio_done.
+ */
+void
+zfs_zone_zio_start(zio_t *zp)
+{
+ zone_t *zonep;
+
+ /*
+ * I/Os of type ZIO_TYPE_IOCTL are used to flush the disk cache, not for
+ * an actual I/O operation. Ignore those operations as they relate to
+ * throttling and scheduling.
+ */
+ if (zp->io_type == ZIO_TYPE_IOCTL)
+ return;
+
+ if ((zonep = zone_find_by_id(zp->io_zoneid)) == NULL)
+ return;
+
+ mutex_enter(&zonep->zone_zfs_lock);
+ if (zp->io_type == ZIO_TYPE_READ)
+ kstat_runq_enter(&zonep->zone_zfs_rwstats);
+ zonep->zone_zfs_weight = 0;
+ mutex_exit(&zonep->zone_zfs_lock);
+
+ mutex_enter(&zfs_disk_lock);
+ zp->io_dispatched = gethrtime();
+
+ if (zfs_disk_rcnt++ != 0)
+ zfs_disk_rtime += (zp->io_dispatched - zfs_disk_rlastupdate);
+ zfs_disk_rlastupdate = zp->io_dispatched;
+ mutex_exit(&zfs_disk_lock);
+
+ zone_rele(zonep);
+}
+
+/*
+ * Called from vdev_disk_io_done when an IO completes.
+ * Increment our counter for zone ops.
+ * Calculate the IO latency avg. for this zone.
+ */
+void
+zfs_zone_zio_done(zio_t *zp)
+{
+ zone_t *zonep;
+ hrtime_t now, unow, udelta;
+
+ if (zp->io_type == ZIO_TYPE_IOCTL)
+ return;
+
+ if ((zonep = zone_find_by_id(zp->io_zoneid)) == NULL)
+ return;
+
+ if (zp->io_dispatched == 0)
+ return;
+
+ now = gethrtime();
+ unow = NANO_TO_MICRO(now);
+ udelta = unow - NANO_TO_MICRO(zp->io_dispatched);
+
+ mutex_enter(&zonep->zone_zfs_lock);
+
+ /*
+ * To calculate the wsvc_t average, keep a cumulative sum of all the
+ * wait time before each I/O was dispatched. Since most writes are
+ * asynchronous, only track the wait time for read I/Os.
+ */
+ if (zp->io_type == ZIO_TYPE_READ) {
+ zonep->zone_zfs_rwstats.reads++;
+ zonep->zone_zfs_rwstats.nread += zp->io_size;
+
+ zonep->zone_zfs_stats->zz_waittime.value.ui64 +=
+ zp->io_dispatched - zp->io_timestamp;
+
+ kstat_runq_exit(&zonep->zone_zfs_rwstats);
+ } else {
+ zonep->zone_zfs_rwstats.writes++;
+ zonep->zone_zfs_rwstats.nwritten += zp->io_size;
+ }
+
+ mutex_exit(&zonep->zone_zfs_lock);
+
+ mutex_enter(&zfs_disk_lock);
+ zfs_disk_rcnt--;
+ zfs_disk_rtime += (now - zfs_disk_rlastupdate);
+ zfs_disk_rlastupdate = now;
+
+ if (udelta > zfs_zone_laggard_threshold)
+ zfs_disk_last_laggard = unow;
+
+ mutex_exit(&zfs_disk_lock);
+
+ if (zfs_zone_delay_enable) {
+ mutex_enter(&zonep->zone_stg_io_lock);
+ add_iop(zonep, unow, zp->io_type == ZIO_TYPE_READ ?
+ ZFS_ZONE_IOP_READ : ZFS_ZONE_IOP_WRITE, udelta);
+ mutex_exit(&zonep->zone_stg_io_lock);
+ }
+
+ zone_rele(zonep);
+
+ /*
+ * sdt:::zfs-zone-latency
+ *
+ * arg0: zone ID
+ * arg1: type of I/O operation
+ * arg2: I/O latency (in us)
+ */
+ DTRACE_PROBE3(zfs__zone__latency, uintptr_t, zp->io_zoneid,
+ uintptr_t, zp->io_type, uintptr_t, udelta);
+}
+
+void
+zfs_zone_zio_dequeue(zio_t *zp)
+{
+ zio_priority_t p;
+ zone_t *zonep;
+
+ p = zp->io_priority;
+ if (p != ZIO_PRIORITY_SYNC_READ && p != ZIO_PRIORITY_SYNC_WRITE)
+ return;
+
+ /* We depend on p being defined as either 0 or 1 */
+ ASSERT(p < 2);
+
+ if ((zonep = zone_find_by_id(zp->io_zoneid)) == NULL)
+ return;
+
+ mutex_enter(&zonep->zone_stg_io_lock);
+ ASSERT(zonep->zone_zfs_queued[p] > 0);
+ if (zonep->zone_zfs_queued[p] == 0)
+ cmn_err(CE_WARN, "zfs_zone_zio_dequeue: count==0");
+ else
+ zonep->zone_zfs_queued[p]--;
+ mutex_exit(&zonep->zone_stg_io_lock);
+ zone_rele(zonep);
+}
+
+void
+zfs_zone_zio_enqueue(zio_t *zp)
+{
+ zio_priority_t p;
+ zone_t *zonep;
+
+ p = zp->io_priority;
+ if (p != ZIO_PRIORITY_SYNC_READ && p != ZIO_PRIORITY_SYNC_WRITE)
+ return;
+
+ /* We depend on p being defined as either 0 or 1 */
+ ASSERT(p < 2);
+
+ if ((zonep = zone_find_by_id(zp->io_zoneid)) == NULL)
+ return;
+
+ mutex_enter(&zonep->zone_stg_io_lock);
+ zonep->zone_zfs_queued[p]++;
+ mutex_exit(&zonep->zone_stg_io_lock);
+ zone_rele(zonep);
+}
+
+/*
+ * Called from vdev_queue_io_to_issue. That function is where zio's are listed
+ * in FIFO order on one of the sync queues, then pulled off (by
+ * vdev_queue_io_remove) and issued. We potentially do zone-based scheduling
+ * here to find a zone's zio deeper in the sync queue and issue that instead
+ * of simply doing FIFO.
+ *
+ * We only do zone-based zio scheduling for the two synchronous I/O queues
+ * (read & write). These queues are normally serviced in FIFO order but we
+ * may decide to move a zone's zio to the head of the line. A typical I/O
+ * load will be mostly synchronous reads and some asynchronous writes (which
+ * are scheduled differently due to transaction groups). There will also be
+ * some synchronous writes for those apps which want to ensure their data is on
+ * disk. We want to make sure that a zone with a single-threaded app (e.g. the
+ * shell) that is doing synchronous I/O (typically reads) isn't penalized by
+ * other zones which are doing lots of synchronous I/O because they have many
+ * running threads.
+ *
+ * The vq->vq_lock mutex is held when we're executing this function so we
+ * can safely access the "last zone" variable on the queue.
+ */
+zio_t *
+zfs_zone_schedule(vdev_queue_t *vq, zio_priority_t p, avl_index_t idx)
+{
+ vdev_queue_class_t *vqc = &vq->vq_class[p];
+ uint_t cnt;
+ zoneid_t last_zone;
+ zio_t *zio;
+
+ ASSERT(MUTEX_HELD(&vq->vq_lock));
+
+ /* Don't change the order on the LBA ordered queues. */
+ if (p != ZIO_PRIORITY_SYNC_READ && p != ZIO_PRIORITY_SYNC_WRITE)
+ return (avl_nearest(&vqc->vqc_queued_tree, idx, AVL_AFTER));
+
+ /* We depend on p being defined as either 0 or 1 */
+ ASSERT(p < 2);
+
+ cnt = avl_numnodes(&vqc->vqc_queued_tree);
+ last_zone = vq->vq_last_zone_id;
+
+ /*
+ * If there are only a few zios in the queue then just issue the head.
+ * If there are more than a few zios already queued up, then use
+ * scheduling to get the next zio.
+ */
+ if (!zfs_zone_schedule_enable || cnt < zfs_zone_schedule_thresh)
+ zio = avl_nearest(&vqc->vqc_queued_tree, idx, AVL_AFTER);
+ else
+ zio = get_next_zio(vqc, cnt, p);
+
+ vq->vq_last_zone_id = zio->io_zoneid;
+
+ /*
+ * Probe with 4 args; the number of IOs in the queue, the zone that
+ * was last scheduled off this queue, the zone that was associated
+ * with the next IO that is scheduled, and which queue (priority).
+ */
+ DTRACE_PROBE4(zfs__zone__sched, uint_t, cnt, uint_t, last_zone,
+ uint_t, zio->io_zoneid, uint_t, p);
+
+ return (zio);
+}
+
+#endif
diff --git a/usr/src/uts/common/fs/zfs/zio.c b/usr/src/uts/common/fs/zfs/zio.c
index 1c8765ff94..f90df6ae04 100644
--- a/usr/src/uts/common/fs/zfs/zio.c
+++ b/usr/src/uts/common/fs/zfs/zio.c
@@ -22,6 +22,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -37,6 +38,7 @@
#include <sys/arc.h>
#include <sys/ddt.h>
#include <sys/zfeature.h>
+#include <sys/zfs_zone.h>
/*
* ==========================================================================
@@ -228,6 +230,20 @@ zio_buf_alloc(size_t size)
}
/*
+ * Same as zio_buf_alloc, but won't sleep in case memory cannot be allocated
+ * and will instead return immediately with a failure.
+ */
+void *
+zio_buf_alloc_canfail(size_t size)
+{
+ size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
+
+ ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+
+ return (kmem_cache_alloc(zio_buf_cache[c], KM_NOSLEEP | KM_NORMALPRI));
+}
+
+/*
* Use zio_data_buf_alloc to allocate data. The data will not appear in a
* crashdump if the kernel panics. This exists so that we will limit the amount
* of ZFS data that shows up in a kernel crashdump. (Thus reducing the amount
@@ -243,6 +259,21 @@ zio_data_buf_alloc(size_t size)
return (kmem_cache_alloc(zio_data_buf_cache[c], KM_PUSHPAGE));
}
+/*
+ * Same as zio_data_buf_alloc, but won't sleep in case memory cannot be
+ * allocated and will instead return immediately with a failure.
+ */
+void *
+zio_data_buf_alloc_canfail(size_t size)
+{
+ size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
+
+ ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+
+ return (kmem_cache_alloc(zio_data_buf_cache[c],
+ KM_NOSLEEP | KM_NORMALPRI));
+}
+
void
zio_buf_free(void *buf, size_t size)
{
@@ -563,11 +594,14 @@ zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp,
zio->io_bookmark = *zb;
if (pio != NULL) {
+ zio->io_zoneid = pio->io_zoneid;
if (zio->io_logical == NULL)
zio->io_logical = pio->io_logical;
if (zio->io_child_type == ZIO_CHILD_GANG)
zio->io_gang_leader = pio->io_gang_leader;
zio_add_child(pio, zio);
+ } else {
+ zfs_zone_zio_init(zio);
}
return (zio);
diff --git a/usr/src/uts/common/fs/zfs/zvol.c b/usr/src/uts/common/fs/zfs/zvol.c
index 36ccbe0049..47d5ae6891 100644
--- a/usr/src/uts/common/fs/zfs/zvol.c
+++ b/usr/src/uts/common/fs/zfs/zvol.c
@@ -83,6 +83,7 @@
#include <sys/zvol.h>
#include <sys/dumphdr.h>
#include <sys/zil_impl.h>
+#include <sys/sdt.h>
#include <sys/dbuf.h>
#include <sys/dmu_tx.h>
#include <sys/zfeature.h>
@@ -1386,6 +1387,8 @@ zvol_read(dev_t dev, uio_t *uio, cred_t *cr)
return (error);
}
+ DTRACE_PROBE3(zvol__uio__start, dev_t, dev, uio_t *, uio, int, 0);
+
rl = zfs_range_lock(&zv->zv_znode, uio->uio_loffset, uio->uio_resid,
RL_READER);
while (uio->uio_resid > 0 && uio->uio_loffset < volsize) {
@@ -1404,6 +1407,10 @@ zvol_read(dev_t dev, uio_t *uio, cred_t *cr)
}
}
zfs_range_unlock(rl);
+
+ DTRACE_PROBE4(zvol__uio__done, dev_t, dev, uio_t *, uio, int, 0, int,
+ error);
+
return (error);
}
@@ -1433,6 +1440,8 @@ zvol_write(dev_t dev, uio_t *uio, cred_t *cr)
return (error);
}
+ DTRACE_PROBE3(zvol__uio__start, dev_t, dev, uio_t *, uio, int, 1);
+
sync = !(zv->zv_flags & ZVOL_WCE) ||
(zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS);
@@ -1463,6 +1472,10 @@ zvol_write(dev_t dev, uio_t *uio, cred_t *cr)
zfs_range_unlock(rl);
if (sync)
zil_commit(zv->zv_zilog, ZVOL_OBJ);
+
+ DTRACE_PROBE4(zvol__uio__done, dev_t, dev, uio_t *, uio, int, 1, int,
+ error);
+
return (error);
}
diff --git a/usr/src/uts/common/inet/ilb/ilb_conn.c b/usr/src/uts/common/inet/ilb/ilb_conn.c
index 450adab5f4..11342de0f3 100644
--- a/usr/src/uts/common/inet/ilb/ilb_conn.c
+++ b/usr/src/uts/common/inet/ilb/ilb_conn.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2014 Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -364,6 +365,7 @@ ilb_conn_hash_fini(ilb_stack_t *ilbs)
{
uint32_t i;
ilb_conn_t *connp;
+ ilb_conn_hash_t *hash;
if (ilbs->ilbs_c2s_conn_hash == NULL) {
ASSERT(ilbs->ilbs_s2c_conn_hash == NULL);
@@ -387,10 +389,10 @@ ilb_conn_hash_fini(ilb_stack_t *ilbs)
ilbs->ilbs_conn_taskq = NULL;
/* Then remove all the conns. */
+ hash = ilbs->ilbs_s2c_conn_hash;
for (i = 0; i < ilbs->ilbs_conn_hash_size; i++) {
- while ((connp = ilbs->ilbs_s2c_conn_hash->ilb_connp) != NULL) {
- ilbs->ilbs_s2c_conn_hash->ilb_connp =
- connp->conn_s2c_next;
+ while ((connp = hash[i].ilb_connp) != NULL) {
+ hash[i].ilb_connp = connp->conn_s2c_next;
ILB_SERVER_REFRELE(connp->conn_server);
if (connp->conn_rule_cache.topo == ILB_TOPO_IMPL_NAT) {
ilb_nat_src_entry_t *ent;
diff --git a/usr/src/uts/common/inet/ip/ip_attr.c b/usr/src/uts/common/inet/ip/ip_attr.c
index 6a075639fc..e040af14ba 100644
--- a/usr/src/uts/common/inet/ip/ip_attr.c
+++ b/usr/src/uts/common/inet/ip/ip_attr.c
@@ -909,6 +909,11 @@ ixa_safe_copy(ip_xmit_attr_t *src, ip_xmit_attr_t *ixa)
*/
if (ixa->ixa_free_flags & IXA_FREE_CRED)
crhold(ixa->ixa_cred);
+
+ /*
+ * There is no cleanup in progress on this new copy.
+ */
+ ixa->ixa_tcpcleanup = IXATC_IDLE;
}
/*
diff --git a/usr/src/uts/common/inet/ip/ip_if.c b/usr/src/uts/common/inet/ip/ip_if.c
index 905197a9fa..c770cb2378 100644
--- a/usr/src/uts/common/inet/ip/ip_if.c
+++ b/usr/src/uts/common/inet/ip/ip_if.c
@@ -24,6 +24,9 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2014, OmniTI Computer Consulting, Inc. All rights reserved.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
/*
* This file contains the interface control functions for IP.
@@ -224,6 +227,8 @@ static void ipif_trace_cleanup(const ipif_t *);
static void ill_dlpi_clear_deferred(ill_t *ill);
+static void phyint_flags_init(phyint_t *, t_uscalar_t);
+
/*
* if we go over the memory footprint limit more than once in this msec
* interval, we'll start pruning aggressively.
@@ -282,7 +287,6 @@ static ip_m_t ip_m_tbl[] = {
ip_nodef_v6intfid }
};
-static ill_t ill_null; /* Empty ILL for init. */
char ipif_loopback_name[] = "lo0";
/* These are used by all IP network modules. */
@@ -3331,50 +3335,42 @@ ipsq_init(ill_t *ill, boolean_t enter)
}
/*
- * ill_init is called by ip_open when a device control stream is opened.
- * It does a few initializations, and shoots a DL_INFO_REQ message down
- * to the driver. The response is later picked up in ip_rput_dlpi and
- * used to set up default mechanisms for talking to the driver. (Always
- * called as writer.)
- *
- * If this function returns error, ip_open will call ip_close which in
- * turn will call ill_delete to clean up any memory allocated here that
- * is not yet freed.
+ * Here we perform initialisation of the ill_t common to both regular
+ * interface ILLs and the special loopback ILL created by ill_lookup_on_name.
*/
-int
-ill_init(queue_t *q, ill_t *ill)
+static int
+ill_init_common(ill_t *ill, queue_t *q, boolean_t isv6, boolean_t is_loopback,
+ boolean_t ipsq_enter)
{
- int count;
- dl_info_req_t *dlir;
- mblk_t *info_mp;
+ int count;
uchar_t *frag_ptr;
- /*
- * The ill is initialized to zero by mi_alloc*(). In addition
- * some fields already contain valid values, initialized in
- * ip_open(), before we reach here.
- */
mutex_init(&ill->ill_lock, NULL, MUTEX_DEFAULT, 0);
mutex_init(&ill->ill_saved_ire_lock, NULL, MUTEX_DEFAULT, NULL);
ill->ill_saved_ire_cnt = 0;
- ill->ill_rq = q;
- ill->ill_wq = WR(q);
+ if (is_loopback) {
+ ill->ill_max_frag = isv6 ? ip_loopback_mtu_v6plus :
+ ip_loopback_mtuplus;
+ /*
+ * No resolver here.
+ */
+ ill->ill_net_type = IRE_LOOPBACK;
+ } else {
+ ill->ill_rq = q;
+ ill->ill_wq = WR(q);
+ ill->ill_ppa = UINT_MAX;
+ }
- info_mp = allocb(MAX(sizeof (dl_info_req_t), sizeof (dl_info_ack_t)),
- BPRI_HI);
- if (info_mp == NULL)
- return (ENOMEM);
+ ill->ill_isv6 = isv6;
/*
* Allocate sufficient space to contain our fragment hash table and
* the device name.
*/
frag_ptr = (uchar_t *)mi_zalloc(ILL_FRAG_HASH_TBL_SIZE + 2 * LIFNAMSIZ);
- if (frag_ptr == NULL) {
- freemsg(info_mp);
+ if (frag_ptr == NULL)
return (ENOMEM);
- }
ill->ill_frag_ptr = frag_ptr;
ill->ill_frag_free_num_pkts = 0;
ill->ill_last_frag_clean_time = 0;
@@ -3387,35 +3383,30 @@ ill_init(queue_t *q, ill_t *ill)
ill->ill_phyint = (phyint_t *)mi_zalloc(sizeof (phyint_t));
if (ill->ill_phyint == NULL) {
- freemsg(info_mp);
mi_free(frag_ptr);
return (ENOMEM);
}
mutex_init(&ill->ill_phyint->phyint_lock, NULL, MUTEX_DEFAULT, 0);
- /*
- * For now pretend this is a v4 ill. We need to set phyint_ill*
- * at this point because of the following reason. If we can't
- * enter the ipsq at some point and cv_wait, the writer that
- * wakes us up tries to locate us using the list of all phyints
- * in an ipsq and the ills from the phyint thru the phyint_ill*.
- * If we don't set it now, we risk a missed wakeup.
- */
- ill->ill_phyint->phyint_illv4 = ill;
- ill->ill_ppa = UINT_MAX;
+ if (isv6) {
+ ill->ill_phyint->phyint_illv6 = ill;
+ } else {
+ ill->ill_phyint->phyint_illv4 = ill;
+ }
+ if (is_loopback) {
+ phyint_flags_init(ill->ill_phyint, DL_LOOP);
+ }
+
list_create(&ill->ill_nce, sizeof (nce_t), offsetof(nce_t, nce_node));
ill_set_inputfn(ill);
- if (!ipsq_init(ill, B_TRUE)) {
- freemsg(info_mp);
+ if (!ipsq_init(ill, ipsq_enter)) {
mi_free(frag_ptr);
mi_free(ill->ill_phyint);
return (ENOMEM);
}
- ill->ill_state_flags |= ILL_LL_SUBNET_PENDING;
-
/* Frag queue limit stuff */
ill->ill_frag_count = 0;
ill->ill_ipf_gen = 0;
@@ -3440,6 +3431,53 @@ ill_init(queue_t *q, ill_t *ill)
ill->ill_max_buf = ND_MAX_Q;
ill->ill_refcnt = 0;
+ return (0);
+}
+
+/*
+ * ill_init is called by ip_open when a device control stream is opened.
+ * It does a few initializations, and shoots a DL_INFO_REQ message down
+ * to the driver. The response is later picked up in ip_rput_dlpi and
+ * used to set up default mechanisms for talking to the driver. (Always
+ * called as writer.)
+ *
+ * If this function returns error, ip_open will call ip_close which in
+ * turn will call ill_delete to clean up any memory allocated here that
+ * is not yet freed.
+ *
+ * Note: ill_ipst and ill_zoneid must be set before calling ill_init.
+ */
+int
+ill_init(queue_t *q, ill_t *ill)
+{
+ int ret;
+ dl_info_req_t *dlir;
+ mblk_t *info_mp;
+
+ info_mp = allocb(MAX(sizeof (dl_info_req_t), sizeof (dl_info_ack_t)),
+ BPRI_HI);
+ if (info_mp == NULL)
+ return (ENOMEM);
+
+ /*
+ * The ill is initialized to zero by mi_alloc*(). In addition
+ * some fields already contain valid values, initialized in
+ * ip_open(), before we reach here.
+ *
+ * For now pretend this is a v4 ill. We need to set phyint_ill*
+ * at this point because of the following reason. If we can't
+ * enter the ipsq at some point and cv_wait, the writer that
+ * wakes us up tries to locate us using the list of all phyints
+ * in an ipsq and the ills from the phyint thru the phyint_ill*.
+ * If we don't set it now, we risk a missed wakeup.
+ */
+ if ((ret = ill_init_common(ill, q, B_FALSE, B_FALSE, B_TRUE)) != 0) {
+ freemsg(info_mp);
+ return (ret);
+ }
+
+ ill->ill_state_flags |= ILL_LL_SUBNET_PENDING;
+
/* Send down the Info Request to the driver. */
info_mp->b_datap->db_type = M_PCPROTO;
dlir = (dl_info_req_t *)info_mp->b_rptr;
@@ -3687,10 +3725,8 @@ ill_lookup_on_name(char *name, boolean_t do_alloc, boolean_t isv6,
if (ill == NULL)
goto done;
- *ill = ill_null;
- mutex_init(&ill->ill_lock, NULL, MUTEX_DEFAULT, NULL);
+ bzero(ill, sizeof (*ill));
ill->ill_ipst = ipst;
- list_create(&ill->ill_nce, sizeof (nce_t), offsetof(nce_t, nce_node));
netstack_hold(ipst->ips_netstack);
/*
* For exclusive stacks we set the zoneid to zero
@@ -3698,25 +3734,12 @@ ill_lookup_on_name(char *name, boolean_t do_alloc, boolean_t isv6,
*/
ill->ill_zoneid = GLOBAL_ZONEID;
- ill->ill_phyint = (phyint_t *)mi_zalloc(sizeof (phyint_t));
- if (ill->ill_phyint == NULL)
+ if (ill_init_common(ill, NULL, isv6, B_TRUE, B_FALSE) != 0)
goto done;
- if (isv6)
- ill->ill_phyint->phyint_illv6 = ill;
- else
- ill->ill_phyint->phyint_illv4 = ill;
- mutex_init(&ill->ill_phyint->phyint_lock, NULL, MUTEX_DEFAULT, 0);
- phyint_flags_init(ill->ill_phyint, DL_LOOP);
-
- if (isv6) {
- ill->ill_isv6 = B_TRUE;
- ill->ill_max_frag = ip_loopback_mtu_v6plus;
- } else {
- ill->ill_max_frag = ip_loopback_mtuplus;
- }
if (!ill_allocate_mibs(ill))
goto done;
+
ill->ill_current_frag = ill->ill_max_frag;
ill->ill_mtu = ill->ill_max_frag; /* Initial value */
ill->ill_mc_mtu = ill->ill_mtu;
@@ -3732,21 +3755,6 @@ ill_lookup_on_name(char *name, boolean_t do_alloc, boolean_t isv6,
/* Set ill_dlpi_pending for ipsq_current_finish() to work properly */
ill->ill_dlpi_pending = DL_PRIM_INVAL;
- rw_init(&ill->ill_mcast_lock, NULL, RW_DEFAULT, NULL);
- mutex_init(&ill->ill_mcast_serializer, NULL, MUTEX_DEFAULT, NULL);
- ill->ill_global_timer = INFINITY;
- ill->ill_mcast_v1_time = ill->ill_mcast_v2_time = 0;
- ill->ill_mcast_v1_tset = ill->ill_mcast_v2_tset = 0;
- ill->ill_mcast_rv = MCAST_DEF_ROBUSTNESS;
- ill->ill_mcast_qi = MCAST_DEF_QUERY_INTERVAL;
-
- /* No resolver here. */
- ill->ill_net_type = IRE_LOOPBACK;
-
- /* Initialize the ipsq */
- if (!ipsq_init(ill, B_FALSE))
- goto done;
-
ipif = ipif_allocate(ill, 0L, IRE_LOOPBACK, B_TRUE, B_TRUE, NULL);
if (ipif == NULL)
goto done;
@@ -3775,17 +3783,10 @@ ill_lookup_on_name(char *name, boolean_t do_alloc, boolean_t isv6,
* Chain us in at the end of the ill list. hold the ill
* before we make it globally visible. 1 for the lookup.
*/
- ill->ill_refcnt = 0;
ill_refhold(ill);
- ill->ill_frag_count = 0;
- ill->ill_frag_free_num_pkts = 0;
- ill->ill_last_frag_clean_time = 0;
-
ipsq = ill->ill_phyint->phyint_ipsq;
- ill_set_inputfn(ill);
-
if (ill_glist_insert(ill, "lo", isv6) != 0)
cmn_err(CE_PANIC, "cannot insert loopback interface");
diff --git a/usr/src/uts/common/inet/ip/ip_tunables.c b/usr/src/uts/common/inet/ip/ip_tunables.c
index 18fc81e7b7..e1f241d887 100644
--- a/usr/src/uts/common/inet/ip/ip_tunables.c
+++ b/usr/src/uts/common/inet/ip/ip_tunables.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
diff --git a/usr/src/uts/common/inet/ip/ipsecesp.c b/usr/src/uts/common/inet/ip/ipsecesp.c
index 47972a8c1a..96a0457678 100644
--- a/usr/src/uts/common/inet/ip/ipsecesp.c
+++ b/usr/src/uts/common/inet/ip/ipsecesp.c
@@ -234,8 +234,7 @@ esp_kstat_init(ipsecesp_stack_t *espstack, netstackid_t stackid)
{
espstack->esp_ksp = kstat_create_netstack("ipsecesp", 0, "esp_stat",
"net", KSTAT_TYPE_NAMED,
- sizeof (esp_kstats_t) / sizeof (kstat_named_t),
- KSTAT_FLAG_PERSISTENT, stackid);
+ sizeof (esp_kstats_t) / sizeof (kstat_named_t), 0, stackid);
if (espstack->esp_ksp == NULL || espstack->esp_ksp->ks_data == NULL)
return (B_FALSE);
diff --git a/usr/src/uts/common/inet/ipf/fil.c b/usr/src/uts/common/inet/ipf/fil.c
index 3955d881e8..f96d2780e6 100644
--- a/usr/src/uts/common/inet/ipf/fil.c
+++ b/usr/src/uts/common/inet/ipf/fil.c
@@ -4,6 +4,8 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#if defined(KERNEL) || defined(_KERNEL)
@@ -134,6 +136,9 @@ struct file;
# endif
#endif
#include "netinet/ipl.h"
+#if defined(SOLARIS) && defined(_KERNEL)
+#include <sys/sunddi.h>
+#endif
/* END OF INCLUDES */
#if !defined(lint)
@@ -5696,6 +5701,47 @@ static int fr_objbytes[NUM_OBJ_TYPES][2] = {
/* ------------------------------------------------------------------------ */
+/* Function: fr_getzoneid */
+/* Returns: int - 0 = success, else failure */
+/* Parameters: idsp(I) - pointer to ipf_devstate_t */
+/* data(I) - pointer to ioctl data */
+/* */
+/* Set the zone ID in idsp based on the zone name in ipfzoneobj. Further */
+/* ioctls will act on the IPF stack for that zone ID. */
+/* ------------------------------------------------------------------------ */
+#if defined(SOLARIS) && defined(_KERNEL)
+int fr_setzoneid(idsp, data)
+ipf_devstate_t *idsp;
+void *data;
+{
+ int error = 0;
+ ipfzoneobj_t ipfzo;
+ zone_t *zone;
+
+ error = BCOPYIN(data, &ipfzo, sizeof(ipfzo));
+ if (error != 0)
+ return EFAULT;
+
+ if (memchr(ipfzo.ipfz_zonename, '\0', ZONENAME_MAX) == NULL)
+ return EFAULT;
+
+ if ((zone = zone_find_by_name(ipfzo.ipfz_zonename)) == NULL)
+ return ENODEV;
+
+ /*
+ * Store the zone ID that to control, and whether it's the
+ * GZ-controlled stack that's wanted
+ */
+ idsp->ipfs_zoneid = zone->zone_id;
+ idsp->ipfs_gz = (ipfzo.ipfz_gz == 1) ? B_TRUE : B_FALSE;
+ zone_rele(zone);
+
+ return error;
+}
+#endif
+
+
+/* ------------------------------------------------------------------------ */
/* Function: fr_inobj */
/* Returns: int - 0 = success, else failure */
/* Parameters: data(I) - pointer to ioctl data */
diff --git a/usr/src/uts/common/inet/ipf/ip_fil_solaris.c b/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
index 98cda0b7cc..e93e0570db 100644
--- a/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
+++ b/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
@@ -4,6 +4,8 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#if !defined(lint)
@@ -101,6 +103,54 @@ u_long *ip_forwarding = NULL;
#endif
#endif
+vmem_t *ipf_minor; /* minor number arena */
+void *ipf_state; /* DDI state */
+
+/*
+ * GZ and per-zone stacks:
+ *
+ * For each non-global zone, we create two ipf stacks: the per-zone stack and
+ * the GZ-controlled stack. The per-zone stack can be controlled and observed
+ * from inside the zone or from the global zone. The GZ-controlled stack can
+ * only be controlled and observed from the global zone (though the rules
+ * still only affect that non-global zone).
+ *
+ * The two hooks are always arranged so that the GZ-controlled stack is always
+ * "outermost" with respect to the zone. The traffic flow then looks like
+ * this:
+ *
+ * Inbound:
+ *
+ * nic ---> [ GZ-controlled rules ] ---> [ per-zone rules ] ---> zone
+ *
+ * Outbound:
+ *
+ * nic <--- [ GZ-controlled rules ] <--- [ per-zone rules ] <--- zone
+ */
+
+/* IPv4 hook names */
+char *hook4_nicevents = "ipfilter_hook4_nicevents";
+char *hook4_nicevents_gz = "ipfilter_hook4_nicevents_gz";
+char *hook4_in = "ipfilter_hook4_in";
+char *hook4_in_gz = "ipfilter_hook4_in_gz";
+char *hook4_out = "ipfilter_hook4_out";
+char *hook4_out_gz = "ipfilter_hook4_out_gz";
+char *hook4_loop_in = "ipfilter_hook4_loop_in";
+char *hook4_loop_in_gz = "ipfilter_hook4_loop_in_gz";
+char *hook4_loop_out = "ipfilter_hook4_loop_out";
+char *hook4_loop_out_gz = "ipfilter_hook4_loop_out_gz";
+
+/* IPv6 hook names */
+char *hook6_nicevents = "ipfilter_hook6_nicevents";
+char *hook6_nicevents_gz = "ipfilter_hook6_nicevents_gz";
+char *hook6_in = "ipfilter_hook6_in";
+char *hook6_in_gz = "ipfilter_hook6_in_gz";
+char *hook6_out = "ipfilter_hook6_out";
+char *hook6_out_gz = "ipfilter_hook6_out_gz";
+char *hook6_loop_in = "ipfilter_hook6_loop_in";
+char *hook6_loop_in_gz = "ipfilter_hook6_loop_in_gz";
+char *hook6_loop_out = "ipfilter_hook6_loop_out";
+char *hook6_loop_out_gz = "ipfilter_hook6_loop_out_gz";
/* ------------------------------------------------------------------------ */
/* Function: ipldetach */
@@ -117,7 +167,7 @@ int ipldetach(ifs)
ipf_stack_t *ifs;
{
- ASSERT(rw_read_locked(&ifs->ifs_ipf_global.ipf_lk) == 0);
+ ASSERT(RW_WRITE_HELD(&ifs->ifs_ipf_global.ipf_lk));
#if SOLARIS2 < 10
@@ -141,11 +191,13 @@ ipf_stack_t *ifs;
#define UNDO_HOOK(_f, _b, _e, _h) \
do { \
+ int tmp; \
if (ifs->_f != NULL) { \
if (ifs->_b) { \
- ifs->_b = (net_hook_unregister(ifs->_f, \
- _e, ifs->_h) != 0); \
- if (!ifs->_b) { \
+ tmp = net_hook_unregister(ifs->_f, \
+ _e, ifs->_h); \
+ ifs->_b = (tmp != 0 && tmp != ENXIO); \
+ if (!ifs->_b && ifs->_h != NULL) { \
hook_free(ifs->_h); \
ifs->_h = NULL; \
} \
@@ -243,7 +295,7 @@ ipf_stack_t *ifs;
cmn_err(CE_CONT, "iplattach()\n");
#endif
- ASSERT(rw_read_locked(&ifs->ifs_ipf_global.ipf_lk) == 0);
+ ASSERT(RW_WRITE_HELD(&ifs->ifs_ipf_global.ipf_lk));
ifs->ifs_fr_flags = IPF_LOGGING;
#ifdef _KERNEL
ifs->ifs_fr_update_ipid = 0;
@@ -268,16 +320,35 @@ ipf_stack_t *ifs;
if (fr_initialise(ifs) < 0)
return -1;
- HOOK_INIT(ifs->ifs_ipfhook4_nicevents, ipf_nic_event_v4,
- "ipfilter_hook4_nicevents", ifs);
- HOOK_INIT(ifs->ifs_ipfhook4_in, ipf_hook4_in,
- "ipfilter_hook4_in", ifs);
- HOOK_INIT(ifs->ifs_ipfhook4_out, ipf_hook4_out,
- "ipfilter_hook4_out", ifs);
- HOOK_INIT(ifs->ifs_ipfhook4_loop_in, ipf_hook4_loop_in,
- "ipfilter_hook4_loop_in", ifs);
- HOOK_INIT(ifs->ifs_ipfhook4_loop_out, ipf_hook4_loop_out,
- "ipfilter_hook4_loop_out", ifs);
+ /*
+ * For incoming packets, we want the GZ hooks to run before the
+ * per-zone hooks, regardless of what order they're are installed.
+ */
+#define HOOK_INIT_GZ_BEFORE(x, fn, n, gzn, a) \
+ HOOK_INIT(x, fn, ifs->ifs_gz ? gzn : n, ifs); \
+ (x)->h_hint = ifs->ifs_gz ? HH_BEFORE : HH_AFTER; \
+ (x)->h_hintvalue = (uintptr_t) (ifs->ifs_gz ? n : gzn);
+
+ HOOK_INIT_GZ_BEFORE(ifs->ifs_ipfhook4_nicevents, ipf_nic_event_v4,
+ hook4_nicevents, hook4_nicevents_gz, ifs);
+ HOOK_INIT_GZ_BEFORE(ifs->ifs_ipfhook4_in, ipf_hook4_in,
+ hook4_in, hook4_in_gz, ifs);
+ HOOK_INIT_GZ_BEFORE(ifs->ifs_ipfhook4_loop_in, ipf_hook4_loop_in,
+ hook4_loop_in, hook4_loop_in_gz, ifs);
+
+ /*
+ * For outgoing packets, we want the GZ hooks to run after the
+ * per-zone hooks, regardless of what order they're are installed.
+ */
+#define HOOK_INIT_GZ_AFTER(x, fn, n, gzn, a) \
+ HOOK_INIT(x, fn, ifs->ifs_gz ? gzn : n, ifs); \
+ (x)->h_hint = ifs->ifs_gz ? HH_AFTER : HH_BEFORE; \
+ (x)->h_hintvalue = (uintptr_t) (ifs->ifs_gz ? n : gzn);
+
+ HOOK_INIT_GZ_AFTER(ifs->ifs_ipfhook4_out, ipf_hook4_out,
+ hook4_out, hook4_out_gz, ifs);
+ HOOK_INIT_GZ_AFTER(ifs->ifs_ipfhook4_loop_out, ipf_hook4_loop_out,
+ hook4_loop_out, hook4_loop_out_gz, ifs);
/*
* If we hold this lock over all of the net_hook_register calls, we
@@ -322,6 +393,7 @@ ipf_stack_t *ifs;
if (!ifs->ifs_hook4_loopback_out)
goto hookup_failed;
}
+
/*
* Add IPv6 hooks
*/
@@ -329,16 +401,16 @@ ipf_stack_t *ifs;
if (ifs->ifs_ipf_ipv6 == NULL)
goto hookup_failed;
- HOOK_INIT(ifs->ifs_ipfhook6_nicevents, ipf_nic_event_v6,
- "ipfilter_hook6_nicevents", ifs);
- HOOK_INIT(ifs->ifs_ipfhook6_in, ipf_hook6_in,
- "ipfilter_hook6_in", ifs);
- HOOK_INIT(ifs->ifs_ipfhook6_out, ipf_hook6_out,
- "ipfilter_hook6_out", ifs);
- HOOK_INIT(ifs->ifs_ipfhook6_loop_in, ipf_hook6_loop_in,
- "ipfilter_hook6_loop_in", ifs);
- HOOK_INIT(ifs->ifs_ipfhook6_loop_out, ipf_hook6_loop_out,
- "ipfilter_hook6_loop_out", ifs);
+ HOOK_INIT_GZ_BEFORE(ifs->ifs_ipfhook6_nicevents, ipf_nic_event_v6,
+ hook6_nicevents, hook6_nicevents_gz, ifs);
+ HOOK_INIT_GZ_BEFORE(ifs->ifs_ipfhook6_in, ipf_hook6_in,
+ hook6_in, hook6_in_gz, ifs);
+ HOOK_INIT_GZ_BEFORE(ifs->ifs_ipfhook6_loop_in, ipf_hook6_loop_in,
+ hook6_loop_in, hook6_loop_in_gz, ifs);
+ HOOK_INIT_GZ_AFTER(ifs->ifs_ipfhook6_out, ipf_hook6_out,
+ hook6_out, hook6_out_gz, ifs);
+ HOOK_INIT_GZ_AFTER(ifs->ifs_ipfhook6_loop_out, ipf_hook6_loop_out,
+ hook6_loop_out, hook6_loop_out_gz, ifs);
ifs->ifs_hook6_nic_events = (net_hook_register(ifs->ifs_ipf_ipv6,
NH_NIC_EVENTS, ifs->ifs_ipfhook6_nicevents) == 0);
@@ -518,35 +590,74 @@ int *rp;
minor_t unit;
u_int enable;
ipf_stack_t *ifs;
+ zoneid_t zid;
+ ipf_devstate_t *isp;
+ boolean_t gz_stack;
#ifdef IPFDEBUG
cmn_err(CE_CONT, "iplioctl(%x,%x,%x,%d,%x,%d)\n",
dev, cmd, data, mode, cp, rp);
#endif
unit = getminor(dev);
- if (IPL_LOGMAX < unit)
+
+ isp = ddi_get_soft_state(ipf_state, unit);
+ if (isp == NULL)
return ENXIO;
+ unit = isp->ipfs_minor;
+
+ zid = crgetzoneid(cp);
+ if (cmd == SIOCIPFZONESET) {
+ if (zid == GLOBAL_ZONEID)
+ return fr_setzoneid(isp, (caddr_t) data);
+ return EACCES;
+ }
+
+ /*
+ * If we're in the GZ, determine if we're acting on a zone's stack,
+ * and whether or not that stack is the GZ-controlled or in-zone
+ * one. See the "GZ and per-zone stacks" note at the top of this
+ * file.
+ */
+ if (zid == GLOBAL_ZONEID && (isp->ipfs_zoneid != -1)) {
+ /* Global zone, and we've set the zoneid for this fd already */
+
+ if (zid == isp->ipfs_zoneid) {
+ /* There's only a per-zone stack for the GZ */
+ gz_stack = B_FALSE;
+ } else {
+ gz_stack = isp->ipfs_gz;
+ }
+
+ zid = isp->ipfs_zoneid;
+ } else {
+ /*
+ * Non-global zone or GZ without having set a zoneid: act on
+ * the per-zone stack of the zone that this ioctl originated
+ * from.
+ */
+ gz_stack = B_FALSE;
+ }
/*
- * As we're calling ipf_find_stack in user space, from a given zone
- * to find the stack pointer for this zone, there is no need to have
- * a hold/refence count here.
+ * ipf_find_stack returns with a read lock on ifs_ipf_global
*/
- ifs = ipf_find_stack(crgetzoneid(cp));
- ASSERT(ifs != NULL);
+ ifs = ipf_find_stack(zid, gz_stack);
+ if (ifs == NULL)
+ return ENXIO;
if (ifs->ifs_fr_running <= 0) {
if (unit != IPL_LOGIPF) {
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return EIO;
}
if (cmd != SIOCIPFGETNEXT && cmd != SIOCIPFGET &&
cmd != SIOCIPFSET && cmd != SIOCFRENB &&
cmd != SIOCGETFS && cmd != SIOCGETFF) {
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return EIO;
}
}
- READ_ENTER(&ifs->ifs_ipf_global);
if (ifs->ifs_fr_enable_active != 0) {
RWLOCK_EXIT(&ifs->ifs_ipf_global);
return EBUSY;
@@ -847,7 +958,9 @@ dev_t *devp;
int flags, otype;
cred_t *cred;
{
+ ipf_devstate_t *isp;
minor_t min = getminor(*devp);
+ minor_t minor;
#ifdef IPFDEBUG
cmn_err(CE_CONT, "iplopen(%x,%x,%x,%x)\n", devp, flags, otype, cred);
@@ -855,8 +968,25 @@ cred_t *cred;
if (!(otype & OTYP_CHR))
return ENXIO;
- min = (IPL_LOGMAX < min) ? ENXIO : 0;
- return min;
+ if (IPL_LOGMAX < min)
+ return ENXIO;
+
+ minor = (minor_t)(uintptr_t)vmem_alloc(ipf_minor, 1,
+ VM_BESTFIT | VM_SLEEP);
+
+ if (ddi_soft_state_zalloc(ipf_state, minor) != 0) {
+ vmem_free(ipf_minor, (void *)(uintptr_t)minor, 1);
+ return ENXIO;
+ }
+
+ *devp = makedevice(getmajor(*devp), minor);
+ isp = ddi_get_soft_state(ipf_state, minor);
+ VERIFY(isp != NULL);
+
+ isp->ipfs_minor = min;
+ isp->ipfs_zoneid = -1;
+
+ return 0;
}
@@ -872,8 +1002,13 @@ cred_t *cred;
cmn_err(CE_CONT, "iplclose(%x,%x,%x,%x)\n", dev, flags, otype, cred);
#endif
- min = (IPL_LOGMAX < min) ? ENXIO : 0;
- return min;
+ if (IPL_LOGMAX < min)
+ return ENXIO;
+
+ ddi_soft_state_free(ipf_state, min);
+ vmem_free(ipf_minor, (void *)(uintptr_t)min, 1);
+
+ return 0;
}
#ifdef IPFILTER_LOG
@@ -891,30 +1026,70 @@ cred_t *cp;
{
ipf_stack_t *ifs;
int ret;
+ minor_t unit;
+ zoneid_t zid;
+ ipf_devstate_t *isp;
+ boolean_t gz_stack;
+
+ unit = getminor(dev);
+ isp = ddi_get_soft_state(ipf_state, unit);
+ if (isp == NULL)
+ return ENXIO;
+ unit = isp->ipfs_minor;
+
+ zid = crgetzoneid(cp);
+
+ /*
+ * If we're in the GZ, determine if we're acting on a zone's stack,
+ * and whether or not that stack is the GZ-controlled or in-zone
+ * one. See the "GZ and per-zone stacks" note at the top of this
+ * file.
+ */
+ if (zid == GLOBAL_ZONEID && (isp->ipfs_zoneid != -1)) {
+ /* Global zone, and we've set the zoneid for this fd already */
+
+ if (zid == isp->ipfs_zoneid) {
+ /* There's only a per-zone stack for the GZ */
+ gz_stack = B_FALSE;
+ } else {
+ gz_stack = isp->ipfs_gz;
+ }
+
+ zid = isp->ipfs_zoneid;
+ } else {
+ /*
+ * Non-global zone or GZ without having set a zoneid: act on
+ * the per-zone stack of the zone that this ioctl originated
+ * from.
+ */
+ gz_stack = B_FALSE;
+ }
/*
- * As we're calling ipf_find_stack in user space, from a given zone
- * to find the stack pointer for this zone, there is no need to have
- * a hold/refence count here.
+ * ipf_find_stack returns with a read lock on ifs_ipf_global
*/
- ifs = ipf_find_stack(crgetzoneid(cp));
- ASSERT(ifs != NULL);
+ ifs = ipf_find_stack(zid, gz_stack);
+ if (ifs == NULL)
+ return ENXIO;
# ifdef IPFDEBUG
cmn_err(CE_CONT, "iplread(%x,%x,%x)\n", dev, uio, cp);
# endif
if (ifs->ifs_fr_running < 1) {
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return EIO;
}
# ifdef IPFILTER_SYNC
- if (getminor(dev) == IPL_LOGSYNC) {
+ if (unit == IPL_LOGSYNC) {
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return ipfsync_read(uio);
}
# endif
- ret = ipflog_read(getminor(dev), uio, ifs);
+ ret = ipflog_read(unit, uio, ifs);
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return ret;
}
#endif /* IPFILTER_LOG */
@@ -932,30 +1107,71 @@ register struct uio *uio;
cred_t *cp;
{
ipf_stack_t *ifs;
+ minor_t unit;
+ zoneid_t zid;
+ ipf_devstate_t *isp;
+ boolean_t gz_stack;
+
+ unit = getminor(dev);
+ isp = ddi_get_soft_state(ipf_state, unit);
+ if (isp == NULL)
+ return ENXIO;
+ unit = isp->ipfs_minor;
/*
- * As we're calling ipf_find_stack in user space, from a given zone
- * to find the stack pointer for this zone, there is no need to have
- * a hold/refence count here.
+ * ipf_find_stack returns with a read lock on ifs_ipf_global
+ */
+ zid = crgetzoneid(cp);
+
+ /*
+ * If we're in the GZ, determine if we're acting on a zone's stack,
+ * and whether or not that stack is the GZ-controlled or in-zone
+ * one. See the "GZ and per-zone stacks" note at the top of this
+ * file.
*/
- ifs = ipf_find_stack(crgetzoneid(cp));
- ASSERT(ifs != NULL);
+ if (zid == GLOBAL_ZONEID && (isp->ipfs_zoneid != -1)) {
+ /* Global zone, and we've set the zoneid for this fd already */
+
+ if (zid == isp->ipfs_zoneid) {
+ /* There's only a per-zone stack for the GZ */
+ gz_stack = B_FALSE;
+ } else {
+ gz_stack = isp->ipfs_gz;
+ }
+
+ zid = isp->ipfs_zoneid;
+ } else {
+ /*
+ * Non-global zone or GZ without having set a zoneid: act on
+ * the per-zone stack of the zone that this ioctl originated
+ * from.
+ */
+ gz_stack = B_FALSE;
+ }
+
+ ifs = ipf_find_stack(zid, gz_stack);
+ if (ifs == NULL)
+ return ENXIO;
#ifdef IPFDEBUG
cmn_err(CE_CONT, "iplwrite(%x,%x,%x)\n", dev, uio, cp);
#endif
if (ifs->ifs_fr_running < 1) {
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return EIO;
}
#ifdef IPFILTER_SYNC
- if (getminor(dev) == IPL_LOGSYNC)
+ if (getminor(dev) == IPL_LOGSYNC) {
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return ipfsync_write(uio);
+ }
#endif /* IPFILTER_SYNC */
dev = dev; /* LINT */
uio = uio; /* LINT */
cp = cp; /* LINT */
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
return ENXIO;
}
@@ -2035,7 +2251,6 @@ int ipf_hook6(hook_data_t info, int out, int loopback, void *arg)
fw->hpe_mb = qpi.qpi_m;
fw->hpe_hdr = qpi.qpi_data;
return rval;
-
}
diff --git a/usr/src/uts/common/inet/ipf/ip_log.c b/usr/src/uts/common/inet/ipf/ip_log.c
index 1fe54f3a07..5d40498671 100644
--- a/usr/src/uts/common/inet/ipf/ip_log.c
+++ b/usr/src/uts/common/inet/ipf/ip_log.c
@@ -7,6 +7,8 @@
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <sys/param.h>
@@ -572,10 +574,16 @@ ipf_stack_t *ifs;
while (ifs->ifs_iplt[unit] == NULL) {
# if SOLARIS && defined(_KERNEL)
+ /*
+ * Prevent a deadlock with ipldetach()
+ */
+ RWLOCK_EXIT(&ifs->ifs_ipf_global);
if (!cv_wait_sig(&ifs->ifs_iplwait, &ifs->ifs_ipl_mutex.ipf_lk)) {
+ READ_ENTER(&ifs->ifs_ipf_global);
MUTEX_EXIT(&ifs->ifs_ipl_mutex);
return EINTR;
}
+ READ_ENTER(&ifs->ifs_ipf_global);
# else
# if defined(__hpux) && defined(_KERNEL)
lock_t *l;
diff --git a/usr/src/uts/common/inet/ipf/ip_state.c b/usr/src/uts/common/inet/ipf/ip_state.c
index c92262b3ad..adf9ff9382 100644
--- a/usr/src/uts/common/inet/ipf/ip_state.c
+++ b/usr/src/uts/common/inet/ipf/ip_state.c
@@ -1285,6 +1285,7 @@ u_int flags;
switch (ic->icmp_type)
{
case ICMP_ECHO :
+ case ICMP_ECHOREPLY :
case ICMP_TSTAMP :
case ICMP_IREQ :
case ICMP_MASKREQ :
diff --git a/usr/src/uts/common/inet/ipf/ipf.conf b/usr/src/uts/common/inet/ipf/ipf.conf
index 6b36f9fdbf..f49e024a72 100644
--- a/usr/src/uts/common/inet/ipf/ipf.conf
+++ b/usr/src/uts/common/inet/ipf/ipf.conf
@@ -1,3 +1,8 @@
#
#
name="ipf" parent="pseudo" instance=0;
+
+# Increase the state table limits. fr_statemax should be ~70% of fr_statesize,
+# and both should be prime numbers
+fr_statesize=151007;
+fr_statemax=113279;
diff --git a/usr/src/uts/common/inet/ipf/netinet/ip_fil.h b/usr/src/uts/common/inet/ipf/netinet/ip_fil.h
index 0a2d6431d8..3de0047f3b 100644
--- a/usr/src/uts/common/inet/ipf/netinet/ip_fil.h
+++ b/usr/src/uts/common/inet/ipf/netinet/ip_fil.h
@@ -7,6 +7,8 @@
* $Id: ip_fil.h,v 2.170.2.22 2005/07/16 05:55:35 darrenr Exp $
*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef __IP_FIL_H__
@@ -107,6 +109,10 @@
#define SIOCDELFR SIOCRMAFR
#define SIOCINSFR SIOCINAFR
+#ifdef SOLARIS
+# define SIOCIPFZONESET _IOWR('r', 97, struct ipfzoneobj)
+#endif
+
/*
* What type of table is getting flushed?
*/
@@ -1165,6 +1171,25 @@ typedef struct ipfobj {
u_char ipfo_xxxpad[32]; /* reserved for future use */
} ipfobj_t;
+#if defined(SOLARIS)
+
+#include <sys/zone.h>
+
+typedef struct ipfzoneobj {
+ u_32_t ipfz_gz; /* GZ stack */
+ char ipfz_zonename[ZONENAME_MAX]; /* zone to act on */
+} ipfzoneobj_t;
+
+#if defined(_KERNEL)
+typedef struct ipf_devstate {
+ zoneid_t ipfs_zoneid;
+ minor_t ipfs_minor;
+ boolean_t ipfs_gz;
+} ipf_devstate_t;
+#endif
+
+#endif
+
#define IPFOBJ_FRENTRY 0 /* struct frentry */
#define IPFOBJ_IPFSTAT 1 /* struct friostat */
#define IPFOBJ_IPFINFO 2 /* struct fr_info */
@@ -1352,7 +1377,7 @@ extern void ipfilterattach __P((int));
extern int ipl_enable __P((void));
extern int ipl_disable __P((void));
# ifdef MENTAT
-extern ipf_stack_t *ipf_find_stack(const zoneid_t zone);
+extern ipf_stack_t *ipf_find_stack(const zoneid_t zone, boolean_t gz);
extern int fr_check __P((struct ip *, int, void *, int, void *,
mblk_t **, ipf_stack_t *));
# if SOLARIS
@@ -1576,6 +1601,10 @@ extern int ipf_earlydrop __P((int, ipftq_t *, int, ipf_stack_t *));
extern u_32_t ipf_random __P((void));
#endif
+#if defined(SOLARIS) && defined(_KERNEL)
+extern int fr_setzoneid __P((ipf_devstate_t *, void *));
+#endif
+
extern char ipfilter_version[];
#ifdef USE_INET6
extern int icmptoicmp6types[ICMP_MAXTYPE+1];
diff --git a/usr/src/uts/common/inet/ipf/netinet/ipf_stack.h b/usr/src/uts/common/inet/ipf/netinet/ipf_stack.h
index 75703994a5..0238d1fa09 100644
--- a/usr/src/uts/common/inet/ipf/netinet/ipf_stack.h
+++ b/usr/src/uts/common/inet/ipf/netinet/ipf_stack.h
@@ -5,6 +5,8 @@
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
#ifndef __IPF_STACK_H__
@@ -43,6 +45,7 @@ struct ipf_stack {
struct ipf_stack **ifs_pnext;
netid_t ifs_netid;
zoneid_t ifs_zone;
+ boolean_t ifs_gz;
/* ipf module */
fr_info_t ifs_frcache[2][8];
diff --git a/usr/src/uts/common/inet/ipf/solaris.c b/usr/src/uts/common/inet/ipf/solaris.c
index 1a1d94def5..307ab2cf78 100644
--- a/usr/src/uts/common/inet/ipf/solaris.c
+++ b/usr/src/uts/common/inet/ipf/solaris.c
@@ -5,6 +5,50 @@
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
+
+/*
+ * ipfilter kernel module mutexes and locking:
+ *
+ * Enabling ipfilter creates a per-netstack ipf_stack_t object that is
+ * stored in the ipf_stacks list, which is protected by ipf_stack_lock.
+ * ipf_stack_t objects are accessed in three contexts:
+ *
+ * 1) administering that filter (eg: ioctls handled with iplioctl())
+ * 2) reading log data (eg: iplread() / iplwrite())
+ * 3) filtering packets (eg: ipf_hook4_* and ipf_hook6_* pfhooks
+ * functions)
+ *
+ * Each ipf_stack_t has a RW lock, ifs_ipf_global, protecting access to the
+ * whole structure. The structure also has locks protecting the various
+ * data structures used for filtering. The following guidelines should be
+ * followed for ipf_stack_t locks:
+ *
+ * - ipf_stack_lock must be held when accessing the ipf_stacks list
+ * - ipf_stack_lock should be held before acquiring ifs_ipf_global for
+ * a stack (the exception to this is ipf_stack_destroy(), which removes
+ * the ipf_stack_t from the list, then drops ipf_stack_lock before
+ * acquiring ifs_ipf_global)
+ * - ifs_ipf_global must be held when accessing an ipf_stack_t in that list:
+ * - The write lock is held only during stack creation / destruction
+ * - The read lock should be held for all other accesses
+ * - To alter the filtering data in the administrative context, one must:
+ * - acquire the read lock for ifs_ipf_global
+ * - then acquire the write lock for the data in question
+ * - In the filtering path, the read lock needs to be held for each type of
+ * filtering data used
+ * - ifs_ipf_global does not need to be held in the filtering path:
+ * - The filtering hooks don't need to modify the stack itself
+ * - The ipf_stack_t will not be destroyed until the hooks are unregistered.
+ * This requires a write lock on the hook, ensuring that no active hooks
+ * (eg: the filtering path) are running, and that the hooks won't be run
+ * afterward.
+ *
+ * Note that there is a deadlock possible when calling net_hook_register()
+ * or net_hook_unregister() with ifs_ipf_global held: see the comments in
+ * iplattach() and ipldetach() for details.
*/
#include <sys/systm.h>
@@ -73,7 +117,8 @@ static int ipf_property_g_update __P((dev_info_t *));
static char *ipf_devfiles[] = { IPL_NAME, IPNAT_NAME, IPSTATE_NAME,
IPAUTH_NAME, IPSYNC_NAME, IPSCAN_NAME,
IPLOOKUP_NAME, NULL };
-
+extern void *ipf_state; /* DDI state */
+extern vmem_t *ipf_minor; /* minor number arena */
static struct cb_ops ipf_cb_ops = {
iplopen,
@@ -221,10 +266,10 @@ static const filter_kstats_t ipf_kstat_tmp = {
static int ipf_kstat_update(kstat_t *ksp, int rwflag);
static void
-ipf_kstat_init(ipf_stack_t *ifs)
+ipf_kstat_init(ipf_stack_t *ifs, boolean_t from_gz)
{
ifs->ifs_kstatp[0] = net_kstat_create(ifs->ifs_netid, "ipf", 0,
- "inbound", "net", KSTAT_TYPE_NAMED,
+ (from_gz ? "inbound_gz" : "inbound"), "net", KSTAT_TYPE_NAMED,
sizeof (filter_kstats_t) / sizeof (kstat_named_t), 0);
if (ifs->ifs_kstatp[0] != NULL) {
bcopy(&ipf_kstat_tmp, ifs->ifs_kstatp[0]->ks_data,
@@ -235,7 +280,7 @@ ipf_kstat_init(ipf_stack_t *ifs)
}
ifs->ifs_kstatp[1] = net_kstat_create(ifs->ifs_netid, "ipf", 0,
- "outbound", "net", KSTAT_TYPE_NAMED,
+ (from_gz ? "outbound_gz" : "outbound"), "net", KSTAT_TYPE_NAMED,
sizeof (filter_kstats_t) / sizeof (kstat_named_t), 0);
if (ifs->ifs_kstatp[1] != NULL) {
bcopy(&ipf_kstat_tmp, ifs->ifs_kstatp[1]->ks_data,
@@ -369,12 +414,13 @@ dev_info_t *dip;
* Initialize things for IPF for each stack instance
*/
static void *
-ipf_stack_create(const netid_t id)
+ipf_stack_create_one(const netid_t id, const zoneid_t zid, boolean_t from_gz)
{
ipf_stack_t *ifs;
#ifdef IPFDEBUG
- cmn_err(CE_NOTE, "IP Filter:stack_create id=%d", id);
+ cmn_err(CE_NOTE, "IP Filter:stack_create_one id=%d global=%d", id,
+ global);
#endif
ifs = (ipf_stack_t *)kmem_alloc(sizeof (*ifs), KM_SLEEP);
@@ -398,8 +444,9 @@ ipf_stack_create(const netid_t id)
RWLOCK_INIT(&ifs->ifs_ipf_mutex, "ipf filter rwlock");
RWLOCK_INIT(&ifs->ifs_ipf_frcache, "ipf cache rwlock");
ifs->ifs_netid = id;
- ifs->ifs_zone = net_getzoneidbynetid(id);
- ipf_kstat_init(ifs);
+ ifs->ifs_zone = zid;
+ ifs->ifs_gz = from_gz;
+ ipf_kstat_init(ifs, from_gz);
#ifdef IPFDEBUG
cmn_err(CE_CONT, "IP Filter:stack_create zone=%d", ifs->ifs_zone);
@@ -427,26 +474,43 @@ ipf_stack_create(const netid_t id)
return (ifs);
}
+static void *
+ipf_stack_create(const netid_t id)
+{
+ ipf_stack_t *ifs;
+ zoneid_t zid = net_getzoneidbynetid(id);
+
+ /*
+ * Create two ipfilter stacks for a zone - the first can only be
+ * controlled from the global zone, and the second is owned by
+ * the zone itself. There is no need to create a GZ-controlled
+ * stack for the global zone, since we're already in the global
+ * zone.
+ */
+ if (zid != GLOBAL_ZONEID)
+ ipf_stack_create_one(id, zid, B_TRUE);
+
+ return ipf_stack_create_one(id, zid, B_FALSE);
+}
/*
- * This function should only ever be used to find the pointer to the
- * ipfilter stack structure for the zone that is currently being
- * executed... so if you're running in the context of zone 1, you
- * should not attempt to find the ipf_stack_t for zone 0 or 2 or
- * anything else but 1. In that way, the returned pointer is safe
- * as it will only be nuked when the instance is destroyed as part
- * of the final shutdown of a zone.
+ * This function returns with the ipf_stack_t's ifs_ipf_global
+ * read lock held (if the stack is found).
*/
ipf_stack_t *
-ipf_find_stack(const zoneid_t zone)
+ipf_find_stack(const zoneid_t zone, const boolean_t gz)
{
ipf_stack_t *ifs;
mutex_enter(&ipf_stack_lock);
for (ifs = ipf_stacks; ifs != NULL; ifs = ifs->ifs_next) {
- if (ifs->ifs_zone == zone)
+ if (ifs->ifs_zone == zone && ifs->ifs_gz == gz)
break;
}
+
+ if (ifs != NULL) {
+ READ_ENTER(&ifs->ifs_ipf_global);
+ }
mutex_exit(&ipf_stack_lock);
return (ifs);
}
@@ -586,27 +650,39 @@ ddi_attach_cmd_t cmd;
(void) ipf_property_g_update(dip);
+ if (ddi_soft_state_init(&ipf_state, sizeof (ipf_devstate_t), 1)
+ != 0) {
+ ddi_prop_remove_all(dip);
+ return (DDI_FAILURE);
+ }
+
for (i = 0; ((s = ipf_devfiles[i]) != NULL); i++) {
s = strrchr(s, '/');
if (s == NULL)
continue;
s++;
if (ddi_create_minor_node(dip, s, S_IFCHR, i,
- DDI_PSEUDO, 0) ==
- DDI_FAILURE) {
- ddi_remove_minor_node(dip, NULL);
+ DDI_PSEUDO, 0) == DDI_FAILURE)
goto attach_failed;
- }
}
ipf_dev_info = dip;
ipfncb = net_instance_alloc(NETINFO_VERSION);
+ if (ipfncb == NULL)
+ goto attach_failed;
+
ipfncb->nin_name = "ipf";
ipfncb->nin_create = ipf_stack_create;
ipfncb->nin_destroy = ipf_stack_destroy;
ipfncb->nin_shutdown = ipf_stack_shutdown;
- i = net_instance_register(ipfncb);
+ if (net_instance_register(ipfncb) == DDI_FAILURE) {
+ net_instance_free(ipfncb);
+ goto attach_failed;
+ }
+
+ ipf_minor = vmem_create("ipf_minor", (void *)1, UINT32_MAX - 1,
+ 1, NULL, NULL, NULL, 0, VM_SLEEP | VMC_IDENTIFIER);
#ifdef IPFDEBUG
cmn_err(CE_CONT, "IP Filter:stack_create callback_reg=%d", i);
@@ -619,7 +695,9 @@ ddi_attach_cmd_t cmd;
}
attach_failed:
+ ddi_remove_minor_node(dip, NULL);
ddi_prop_remove_all(dip);
+ ddi_soft_state_fini(&ipf_state);
return (DDI_FAILURE);
}
@@ -652,6 +730,9 @@ ddi_detach_cmd_t cmd;
return (DDI_FAILURE);
}
+ vmem_destroy(ipf_minor);
+ ddi_soft_state_fini(&ipf_state);
+
(void) net_instance_unregister(ipfncb);
net_instance_free(ipfncb);
diff --git a/usr/src/uts/common/inet/tcp/tcp_time_wait.c b/usr/src/uts/common/inet/tcp/tcp_time_wait.c
index 6f896fa740..adde51e745 100644
--- a/usr/src/uts/common/inet/tcp/tcp_time_wait.c
+++ b/usr/src/uts/common/inet/tcp/tcp_time_wait.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent Inc. All rights reserved.
*/
/*
@@ -111,6 +111,21 @@ tcp_time_wait_remove(tcp_t *tcp, tcp_squeue_priv_t *tcp_time_wait)
return (B_TRUE);
}
+/* Constants used for fast checking of a localhost address */
+#if defined(_BIG_ENDIAN)
+#define IPv4_LOCALHOST 0x7f000000U
+#define IPv4_LH_MASK 0xffffff00U
+#else
+#define IPv4_LOCALHOST 0x0000007fU
+#define IPv4_LH_MASK 0x00ffffffU
+#endif
+
+#define IS_LOCAL_HOST(x) ( \
+ ((x)->tcp_connp->conn_ipversion == IPV4_VERSION && \
+ ((x)->tcp_connp->conn_laddr_v4 & IPv4_LH_MASK) == IPv4_LOCALHOST) || \
+ ((x)->tcp_connp->conn_ipversion == IPV6_VERSION && \
+ IN6_IS_ADDR_LOOPBACK(&(x)->tcp_connp->conn_laddr_v6)))
+
/*
* Add a connection to the list of detached TIME_WAIT connections
* and set its time to expire.
@@ -122,6 +137,7 @@ tcp_time_wait_append(tcp_t *tcp)
squeue_t *sqp = tcp->tcp_connp->conn_sqp;
tcp_squeue_priv_t *tcp_time_wait =
*((tcp_squeue_priv_t **)squeue_getprivate(sqp, SQPRIVATE_TCP));
+ hrtime_t firetime = 0;
tcp_timers_stop(tcp);
@@ -138,13 +154,37 @@ tcp_time_wait_append(tcp_t *tcp)
ASSERT(tcp->tcp_listener == NULL);
tcp->tcp_time_wait_expire = ddi_get_lbolt64();
- /*
- * Since tcp_time_wait_expire is lbolt64, it should not wrap around
- * in practice. Hence it cannot be 0. Note that zero means that the
- * tcp_t is not in the TIME_WAIT list.
- */
- tcp->tcp_time_wait_expire += MSEC_TO_TICK(
- tcps->tcps_time_wait_interval);
+ if (IS_LOCAL_HOST(tcp)) {
+ /*
+ * This is the fastpath for handling localhost connections.
+ * Since we don't have to worry about packets on the localhost
+ * showing up after a long network delay, we want to expire
+ * these quickly so the port range on the localhost doesn't
+ * get starved by short-running, local apps.
+ *
+ * Leave tcp_time_wait_expire at the current time. This
+ * essentially means the connection is expired now and it will
+ * clean up the next time tcp_time_wait_collector runs. We set
+ * firetime to use a short delay so that if we have to start a
+ * tcp_time_wait_collector thread below, it runs soon instead
+ * of after a delay of time_wait_interval. firetime being set
+ * to a non-0 value is also our indicator that we should add
+ * this connection to the head of the time wait list (since we
+ * are already expired) so that its sure to get cleaned up on
+ * the next run of tcp_time_wait_collector (which expects the
+ * entries to appear in time-order and stops when it hits the
+ * first non-expired entry).
+ */
+ firetime = TCP_TIME_WAIT_DELAY;
+ } else {
+ /*
+ * Since tcp_time_wait_expire is lbolt64, it should not wrap
+ * around in practice. Hence it cannot be 0. Note that zero
+ * means that the tcp_t is not in the TIME_WAIT list.
+ */
+ tcp->tcp_time_wait_expire += MSEC_TO_TICK(
+ tcps->tcps_time_wait_interval);
+ }
ASSERT(TCP_IS_DETACHED(tcp));
ASSERT(tcp->tcp_state == TCPS_TIME_WAIT);
@@ -164,13 +204,17 @@ tcp_time_wait_append(tcp_t *tcp)
* a timer is needed.
*/
if (tcp_time_wait->tcp_time_wait_tid == 0) {
+ if (firetime == 0)
+ firetime = (hrtime_t)
+ (tcps->tcps_time_wait_interval + 1) *
+ MICROSEC;
+
tcp_time_wait->tcp_time_wait_tid =
timeout_generic(CALLOUT_NORMAL,
- tcp_time_wait_collector, sqp,
- (hrtime_t)(tcps->tcps_time_wait_interval + 1) *
- MICROSEC, CALLOUT_TCP_RESOLUTION,
- CALLOUT_FLAG_ROUNDUP);
+ tcp_time_wait_collector, sqp, firetime,
+ CALLOUT_TCP_RESOLUTION, CALLOUT_FLAG_ROUNDUP);
}
+ tcp_time_wait->tcp_time_wait_tail = tcp;
} else {
/*
* The list is not empty, so a timer must be running. If not,
@@ -182,11 +226,23 @@ tcp_time_wait_append(tcp_t *tcp)
ASSERT(tcp_time_wait->tcp_time_wait_tail != NULL);
ASSERT(tcp_time_wait->tcp_time_wait_tail->tcp_state ==
TCPS_TIME_WAIT);
- tcp_time_wait->tcp_time_wait_tail->tcp_time_wait_next = tcp;
- tcp->tcp_time_wait_prev = tcp_time_wait->tcp_time_wait_tail;
+ if (firetime == 0) {
+ /* add at end */
+ tcp_time_wait->tcp_time_wait_tail->tcp_time_wait_next =
+ tcp;
+ tcp->tcp_time_wait_prev =
+ tcp_time_wait->tcp_time_wait_tail;
+ tcp_time_wait->tcp_time_wait_tail = tcp;
+ } else {
+ /* add at head */
+ tcp->tcp_time_wait_next =
+ tcp_time_wait->tcp_time_wait_head;
+ tcp_time_wait->tcp_time_wait_head->tcp_time_wait_prev =
+ tcp;
+ tcp_time_wait->tcp_time_wait_head = tcp;
+ }
}
- tcp_time_wait->tcp_time_wait_tail = tcp;
mutex_exit(&tcp_time_wait->tcp_time_wait_lock);
}
@@ -416,6 +472,10 @@ tcp_time_wait_collector(void *arg)
tcp_time_wait->tcp_time_wait_tid == 0) {
hrtime_t firetime;
+ /* shouldn't be necessary, but just in case */
+ if (tcp->tcp_time_wait_expire < now)
+ tcp->tcp_time_wait_expire = now;
+
firetime = TICK_TO_NSEC(tcp->tcp_time_wait_expire - now);
/* This ensures that we won't wake up too often. */
firetime = MAX(TCP_TIME_WAIT_DELAY, firetime);
diff --git a/usr/src/uts/common/inet/tcp_impl.h b/usr/src/uts/common/inet/tcp_impl.h
index da0947bccb..de2d4529b0 100644
--- a/usr/src/uts/common/inet/tcp_impl.h
+++ b/usr/src/uts/common/inet/tcp_impl.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
*/
@@ -61,9 +61,9 @@ extern sock_downcalls_t sock_tcp_downcalls;
* by setting it to 0.
*/
#define TCP_XMIT_LOWATER 4096
-#define TCP_XMIT_HIWATER 49152
+#define TCP_XMIT_HIWATER 128000
#define TCP_RECV_LOWATER 2048
-#define TCP_RECV_HIWATER 128000
+#define TCP_RECV_HIWATER 1048576
/*
* Bind hash list size and has function. It has to be a power of 2 for
diff --git a/usr/src/uts/common/io/aggr/aggr_port.c b/usr/src/uts/common/io/aggr/aggr_port.c
index 00545d2c03..a39110255a 100644
--- a/usr/src/uts/common/io/aggr/aggr_port.c
+++ b/usr/src/uts/common/io/aggr/aggr_port.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 OmniTI Computer Consulting, Inc All rights reserved.
*/
/*
@@ -528,8 +529,13 @@ aggr_port_promisc(aggr_port_t *port, boolean_t on)
if (on) {
mac_rx_clear(port->lp_mch);
+ /* We use the promisc callback because without hardware
+ * rings, we deliver through flows that will cause duplicate
+ * delivery of packets when we've flipped into this mode
+ * to compensate for the lack of hardware MAC matching
+ */
rc = mac_promisc_add(port->lp_mch, MAC_CLIENT_PROMISC_ALL,
- aggr_recv_cb, port, &port->lp_mphp,
+ aggr_recv_promisc_cb, port, &port->lp_mphp,
MAC_PROMISC_FLAGS_NO_TX_LOOP);
if (rc != 0) {
mac_rx_set(port->lp_mch, aggr_recv_cb, port);
diff --git a/usr/src/uts/common/io/aggr/aggr_recv.c b/usr/src/uts/common/io/aggr/aggr_recv.c
index 2bdb7872e3..0dfe234b70 100644
--- a/usr/src/uts/common/io/aggr/aggr_recv.c
+++ b/usr/src/uts/common/io/aggr/aggr_recv.c
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 OmniTI Computer Consulting, Inc All rights reserved.
*/
/*
@@ -68,16 +69,27 @@ aggr_recv_lacp(aggr_port_t *port, mac_resource_handle_t mrh, mblk_t *mp)
/*
* Callback function invoked by MAC service module when packets are
- * made available by a MAC port.
+ * made available by a MAC port, both in promisc_on mode and not.
*/
/* ARGSUSED */
-void
-aggr_recv_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
- boolean_t loopback)
+static void
+aggr_recv_path_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
+ boolean_t loopback, boolean_t promisc_path)
{
aggr_port_t *port = (aggr_port_t *)arg;
aggr_grp_t *grp = port->lp_grp;
+ /* In the case where lp_promisc_on has been turned on to
+ * compensate for insufficient hardware MAC matching and
+ * hardware rings are not in use we will fall back to
+ * using flows for delivery which can result in duplicates
+ * pushed up the stack. Only respect the chosen path.
+ */
+ if (port->lp_promisc_on != promisc_path) {
+ freemsgchain(mp);
+ return;
+ }
+
if (grp->lg_lacp_mode == AGGR_LACP_OFF) {
aggr_mac_rx(grp->lg_mh, mrh, mp);
} else {
@@ -161,3 +173,19 @@ aggr_recv_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
}
}
}
+
+/* ARGSUSED */
+void
+aggr_recv_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
+ boolean_t loopback)
+{
+ aggr_recv_path_cb(arg, mrh, mp, loopback, B_FALSE);
+}
+
+/* ARGSUSED */
+void
+aggr_recv_promisc_cb(void *arg, mac_resource_handle_t mrh, mblk_t *mp,
+ boolean_t loopback)
+{
+ aggr_recv_path_cb(arg, mrh, mp, loopback, B_TRUE);
+}
diff --git a/usr/src/uts/common/io/bge/bge_chip2.c b/usr/src/uts/common/io/bge/bge_chip2.c
index f687ce4892..a459f867f3 100644
--- a/usr/src/uts/common/io/bge/bge_chip2.c
+++ b/usr/src/uts/common/io/bge/bge_chip2.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2011, 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include "bge_impl.h"
@@ -363,7 +363,34 @@ bge_chip_cfg_init(bge_t *bgep, chip_id_t *cidp, boolean_t enable_dma)
if (DEVICE_5717_SERIES_CHIPSETS(bgep))
pci_config_put32(handle, PCI_CONF_BGE_MHCR, 0);
mhcr = pci_config_get32(handle, PCI_CONF_BGE_MHCR);
- cidp->asic_rev = mhcr & MHCR_CHIP_REV_MASK;
+ cidp->asic_rev = (mhcr & MHCR_CHIP_REV_MASK) >> MHCR_CHIP_REV_SHIFT;
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_PRODID) {
+ uint32_t reg;
+ switch (cidp->device) {
+ case DEVICE_ID_5717:
+ case DEVICE_ID_5718:
+ case DEVICE_ID_5719:
+ case DEVICE_ID_5720:
+ reg = PCI_CONF_GEN2_PRODID_ASICREV;
+ break;
+ case DEVICE_ID_57781:
+ case DEVICE_ID_57785:
+ case DEVICE_ID_57761:
+ case DEVICE_ID_57765:
+ case DEVICE_ID_57791:
+ case DEVICE_ID_57795:
+ case DEVICE_ID_57762:
+ case DEVICE_ID_57766:
+ case DEVICE_ID_57782:
+ case DEVICE_ID_57786:
+ reg = PCI_CONF_GEN15_PRODID_ASICREV;
+ break;
+ default:
+ reg = PCI_CONF_PRODID_ASICREV;
+ break;
+ }
+ cidp->asic_rev = pci_config_get32(handle, reg);
+ }
cidp->businfo = pci_config_get32(handle, PCI_CONF_BGE_PCISTATE);
cidp->command = pci_config_get16(handle, PCI_CONF_COMM);
@@ -386,6 +413,45 @@ bge_chip_cfg_init(bge_t *bgep, chip_id_t *cidp, boolean_t enable_dma)
BGE_DEBUG(("bge_chip_cfg_init: clsize %d latency %d command 0x%x",
cidp->clsize, cidp->latency, cidp->command));
+ cidp->chip_type = 0;
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5717 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5719 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5720)
+ cidp->chip_type |= CHIP_TYPE_5717_PLUS;
+
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_57765 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_57766)
+ cidp->chip_type |= CHIP_TYPE_57765_CLASS;
+
+ if (cidp->chip_type & CHIP_TYPE_57765_CLASS ||
+ cidp->chip_type & CHIP_TYPE_5717_PLUS)
+ cidp->chip_type |= CHIP_TYPE_57765_PLUS;
+
+ /* Intentionally exclude ASIC_REV_5906 */
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5755 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5787 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5784 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5761 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5785 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_57780 ||
+ cidp->chip_type & CHIP_TYPE_57765_PLUS)
+ cidp->chip_type |= CHIP_TYPE_5755_PLUS;
+
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5780 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5714)
+ cidp->chip_type |= CHIP_TYPE_5780_CLASS;
+
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5750 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5752 ||
+ MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5906 ||
+ cidp->chip_type & CHIP_TYPE_5755_PLUS ||
+ cidp->chip_type & CHIP_TYPE_5780_CLASS)
+ cidp->chip_type |= CHIP_TYPE_5750_PLUS;
+
+ if (MHCR_CHIP_ASIC_REV(cidp->asic_rev) == MHCR_CHIP_ASIC_REV_5705 ||
+ cidp->chip_type & CHIP_TYPE_5750_PLUS)
+ cidp->chip_type |= CHIP_TYPE_5705_PLUS;
+
/*
* Step 2 (also step 6): disable and clear interrupts.
* Steps 11-13: configure PIO endianness options, and enable
@@ -445,8 +511,9 @@ bge_chip_cfg_init(bge_t *bgep, chip_id_t *cidp, boolean_t enable_dma)
* see whether the host is truly up to date, and regenerate
* its interrupt if not.
*/
- mhcr = MHCR_ENABLE_INDIRECT_ACCESS |
+ mhcr = MHCR_ENABLE_INDIRECT_ACCESS |
MHCR_ENABLE_TAGGED_STATUS_MODE |
+ MHCR_ENABLE_PCI_STATE_WRITE |
MHCR_MASK_INTERRUPT_MODE |
MHCR_CLEAR_INTERRUPT_INTA;
@@ -1896,10 +1963,16 @@ bge_nvmem_id(bge_t *bgep)
case DEVICE_ID_5705_2:
case DEVICE_ID_5717:
case DEVICE_ID_5718:
+ case DEVICE_ID_5719:
+ case DEVICE_ID_5720:
case DEVICE_ID_5724:
+ case DEVICE_ID_57760:
case DEVICE_ID_57780:
+ case DEVICE_ID_57788:
+ case DEVICE_ID_57790:
case DEVICE_ID_5780:
case DEVICE_ID_5782:
+ case DEVICE_ID_5784M:
case DEVICE_ID_5785:
case DEVICE_ID_5787:
case DEVICE_ID_5787M:
@@ -1918,6 +1991,8 @@ bge_nvmem_id(bge_t *bgep)
case DEVICE_ID_5723:
case DEVICE_ID_5761:
case DEVICE_ID_5761E:
+ case DEVICE_ID_5761S:
+ case DEVICE_ID_5761SE:
case DEVICE_ID_5764:
case DEVICE_ID_5714C:
case DEVICE_ID_5714S:
@@ -2023,14 +2098,35 @@ bge_chip_id_init(bge_t *bgep)
cidp->msi_enabled = B_FALSE;
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) >
+ MHCR_CHIP_ASIC_REV_PRODID ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5906 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5700 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5701 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5750)
+ /*
+ * Just a plain reset; the "check" code breaks these chips
+ */
+ cidp->flags |= CHIP_FLAG_NO_CHECK_RESET;
+
switch (cidp->device) {
case DEVICE_ID_5717:
case DEVICE_ID_5718:
+ case DEVICE_ID_5719:
+ case DEVICE_ID_5720:
case DEVICE_ID_5724:
if (cidp->device == DEVICE_ID_5717)
cidp->chip_label = 5717;
else if (cidp->device == DEVICE_ID_5718)
cidp->chip_label = 5718;
+ else if (cidp->device == DEVICE_ID_5719)
+ cidp->chip_label = 5719;
+ else if (cidp->device == DEVICE_ID_5720)
+ cidp->chip_label = 5720;
else
cidp->chip_label = 5724;
cidp->msi_enabled = bge_enable_msi;
@@ -2044,7 +2140,7 @@ bge_chip_id_init(bge_t *bgep)
cidp->mbuf_hi_water = MBUF_HIWAT_5717;
cidp->mbuf_base = bge_mbuf_pool_base_5705;
cidp->mbuf_length = bge_mbuf_pool_len_5705;
- cidp->recv_slots = BGE_RECV_SLOTS_5705;
+ cidp->recv_slots = BGE_RECV_SLOTS_5717;
cidp->bge_mlcr_default = MLCR_DEFAULT_5717;
cidp->rx_rings = BGE_RECV_RINGS_MAX_5705;
cidp->tx_rings = BGE_SEND_RINGS_MAX_5705;
@@ -2220,7 +2316,13 @@ bge_chip_id_init(bge_t *bgep)
case DEVICE_ID_5723:
case DEVICE_ID_5761:
case DEVICE_ID_5761E:
+ case DEVICE_ID_5761S:
+ case DEVICE_ID_5761SE:
+ case DEVICE_ID_5784M:
+ case DEVICE_ID_57760:
case DEVICE_ID_57780:
+ case DEVICE_ID_57788:
+ case DEVICE_ID_57790:
cidp->msi_enabled = bge_enable_msi;
/*
* We don't use MSI for BCM5764 and BCM5785, as the
@@ -2234,10 +2336,18 @@ bge_chip_id_init(bge_t *bgep)
cidp->chip_label = 5723;
else if (cidp->device == DEVICE_ID_5764)
cidp->chip_label = 5764;
+ else if (cidp->device == DEVICE_ID_5784M)
+ cidp->chip_label = 5784;
else if (cidp->device == DEVICE_ID_5785)
cidp->chip_label = 5785;
+ else if (cidp->device == DEVICE_ID_57760)
+ cidp->chip_label = 57760;
else if (cidp->device == DEVICE_ID_57780)
cidp->chip_label = 57780;
+ else if (cidp->device == DEVICE_ID_57788)
+ cidp->chip_label = 57788;
+ else if (cidp->device == DEVICE_ID_57790)
+ cidp->chip_label = 57790;
else
cidp->chip_label = 5761;
cidp->bge_dma_rwctrl = bge_dma_rwctrl_5721;
@@ -3401,18 +3511,27 @@ bge_chip_reset(bge_t *bgep, boolean_t enable_dma)
mhcr = MHCR_ENABLE_INDIRECT_ACCESS |
MHCR_ENABLE_TAGGED_STATUS_MODE |
MHCR_MASK_INTERRUPT_MODE |
- MHCR_MASK_PCI_INT_OUTPUT |
MHCR_CLEAR_INTERRUPT_INTA |
MHCR_ENABLE_ENDIAN_WORD_SWAP |
MHCR_ENABLE_ENDIAN_BYTE_SWAP;
+
+ if (bgep->intr_type == DDI_INTR_TYPE_FIXED)
+ mhcr |= MHCR_MASK_PCI_INT_OUTPUT;
+
if (DEVICE_5717_SERIES_CHIPSETS(bgep))
pci_config_put32(bgep->cfg_handle, PCI_CONF_BGE_MHCR,
0);
+#else
+ mhcr = MHCR_ENABLE_INDIRECT_ACCESS |
+ MHCR_ENABLE_TAGGED_STATUS_MODE |
+ MHCR_MASK_INTERRUPT_MODE |
+ MHCR_MASK_PCI_INT_OUTPUT |
+ MHCR_CLEAR_INTERRUPT_INTA;
+#endif
pci_config_put32(bgep->cfg_handle, PCI_CONF_BGE_MHCR, mhcr);
bge_reg_put32(bgep, MEMORY_ARBITER_MODE_REG,
bge_reg_get32(bgep, MEMORY_ARBITER_MODE_REG) |
MEMORY_ARBITER_ENABLE);
-#endif
if (asf_mode == ASF_MODE_INIT) {
bge_asf_pre_reset_operations(bgep, BGE_INIT_RESET);
} else if (asf_mode == ASF_MODE_SHUTDOWN) {
@@ -3436,9 +3555,13 @@ bge_chip_reset(bge_t *bgep, boolean_t enable_dma)
mhcr = MHCR_ENABLE_INDIRECT_ACCESS |
MHCR_ENABLE_TAGGED_STATUS_MODE |
+ MHCR_ENABLE_PCI_STATE_WRITE |
MHCR_MASK_INTERRUPT_MODE |
- MHCR_MASK_PCI_INT_OUTPUT |
MHCR_CLEAR_INTERRUPT_INTA;
+
+ if (bgep->intr_type == DDI_INTR_TYPE_FIXED)
+ mhcr |= MHCR_MASK_PCI_INT_OUTPUT;
+
#ifdef _BIG_ENDIAN
mhcr |= MHCR_ENABLE_ENDIAN_WORD_SWAP | MHCR_ENABLE_ENDIAN_BYTE_SWAP;
#endif /* _BIG_ENDIAN */
@@ -3449,6 +3572,12 @@ bge_chip_reset(bge_t *bgep, boolean_t enable_dma)
if (bgep->asf_enabled)
bgep->asf_wordswapped = B_FALSE;
#endif
+
+ if (DEVICE_IS_5755_PLUS(bgep) ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5752)
+ bge_reg_put32(bgep, GRC_FASTBOOT_PC, 0);
+
/*
* NVRAM Corruption Workaround
*/
@@ -3508,6 +3637,11 @@ bge_chip_reset(bge_t *bgep, boolean_t enable_dma)
#else
modeflags = MODE_WORD_SWAP_FRAME | MODE_BYTE_SWAP_FRAME;
#endif /* _BIG_ENDIAN */
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5720)
+ modeflags |=
+ MODE_BYTE_SWAP_B2HRX_DATA | MODE_WORD_SWAP_B2HRX_DATA |
+ MODE_B2HRX_ENABLE | MODE_HTX2B_ENABLE;
#ifdef BGE_IPMI_ASF
if (bgep->asf_enabled)
modeflags |= MODE_HOST_STACK_UP;
@@ -3592,6 +3726,13 @@ bge_chip_reset(bge_t *bgep, boolean_t enable_dma)
*/
bge_reg_put32(bgep, ETHERNET_MAC_MODE_REG, 0);
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5720) {
+ uint32_t regval = bge_reg_get32(bgep, CPMU_CLCK_ORIDE_REG);
+ bge_reg_put32(bgep, CPMU_CLCK_ORIDE_REG,
+ regval & ~CPMU_CLCK_ORIDE_MAC_ORIDE_EN);
+ }
+
/*
* Step 21: restore cache-line-size, latency timer, and
* subsystem ID registers to their original values (not
@@ -3818,8 +3959,17 @@ bge_chip_start(bge_t *bgep, boolean_t reset_phys)
/*
* Steps 34-36: enable buffer manager & internal h/w queues
*/
- if (!bge_chip_enable_engine(bgep, BUFFER_MANAGER_MODE_REG,
- STATE_MACHINE_ATTN_ENABLE_BIT))
+
+ regval = STATE_MACHINE_ATTN_ENABLE_BIT;
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5719)
+ regval |= BUFF_MGR_NO_TX_UNDERRUN;
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5717 ||
+ bgep->chipid.asic_rev == MHCR_CHIP_REV_5719_A0 ||
+ bgep->chipid.asic_rev == MHCR_CHIP_REV_5720_A0)
+ regval |= BUFF_MGR_MBUF_LOW_ATTN_ENABLE;
+ if (!bge_chip_enable_engine(bgep, BUFFER_MANAGER_MODE_REG, regval))
retval = DDI_FAILURE;
if (!bge_chip_enable_engine(bgep, FTQ_RESET_REG, 0))
retval = DDI_FAILURE;
@@ -3913,7 +4063,13 @@ bge_chip_start(bge_t *bgep, boolean_t reset_phys)
/*
* Step 50: configure the IPG et al
*/
- bge_reg_put32(bgep, MAC_TX_LENGTHS_REG, MAC_TX_LENGTHS_DEFAULT);
+ regval = MAC_TX_LENGTHS_DEFAULT;
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev)
+ == MHCR_CHIP_ASIC_REV_5720)
+ regval |= bge_reg_get32(bgep, MAC_TX_LENGTHS_REG) &
+ (MAC_TX_LENGTHS_JMB_FRM_LEN_MSK |
+ MAC_TX_LENGTHS_CNT_DWN_VAL_MSK);
+ bge_reg_put32(bgep, MAC_TX_LENGTHS_REG, regval);
/*
* Step 51: configure the default Rx Return Ring
@@ -4068,22 +4224,45 @@ bge_chip_start(bge_t *bgep, boolean_t reset_phys)
retval = DDI_FAILURE;
dma_wrprio = (bge_dma_wrprio << DMA_PRIORITY_SHIFT) |
ALL_DMA_ATTN_BITS;
- if ((MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
- MHCR_CHIP_ASIC_REV_5755) ||
- (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
- MHCR_CHIP_ASIC_REV_5723) ||
- (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
- MHCR_CHIP_ASIC_REV_5906)) {
+ if (DEVICE_IS_5755_PLUS(bgep))
dma_wrprio |= DMA_STATUS_TAG_FIX_CQ12384;
- }
if (!bge_chip_enable_engine(bgep, WRITE_DMA_MODE_REG,
dma_wrprio))
retval = DDI_FAILURE;
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5761 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5784 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5785 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_57780 ||
+ DEVICE_IS_57765_PLUS(bgep)) {
+ regval = bge_reg_get32(bgep, READ_DMA_RESERVED_CONTROL_REG);
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5719 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5720) {
+ regval &= ~(RDMA_RSRVCTRL_TXMRGN_MASK |
+ RDMA_RSRVCTRL_FIFO_LWM_MASK |
+ RDMA_RSRVCTRL_FIFO_HWM_MASK);
+ regval |= RDMA_RSRVCTRL_TXMRGN_320B |
+ RDMA_RSRVCTRL_FIFO_LWM_1_5K |
+ RDMA_RSRVCTRL_FIFO_HWM_1_5K;
+ }
+ bge_reg_put32(bgep, READ_DMA_RESERVED_CONTROL_REG,
+ regval | RDMA_RSRVCTRL_FIFO_OFLW_FIX);
+ }
if (DEVICE_5723_SERIES_CHIPSETS(bgep) ||
DEVICE_5717_SERIES_CHIPSETS(bgep))
bge_dma_rdprio = 0;
+ regval = bge_dma_rdprio << DMA_PRIORITY_SHIFT;
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5720)
+ regval |= bge_reg_get32(bgep, READ_DMA_MODE_REG) &
+ DMA_H2BNC_VLAN_DET;
if (!bge_chip_enable_engine(bgep, READ_DMA_MODE_REG,
- (bge_dma_rdprio << DMA_PRIORITY_SHIFT) | ALL_DMA_ATTN_BITS))
+ regval | ALL_DMA_ATTN_BITS))
retval = DDI_FAILURE;
if (!bge_chip_enable_engine(bgep, RCV_DATA_COMPLETION_MODE_REG,
STATE_MACHINE_ATTN_ENABLE_BIT))
@@ -4116,7 +4295,23 @@ bge_chip_start(bge_t *bgep, boolean_t reset_phys)
* Step 88: download firmware -- doesn't apply
* Steps 89-90: enable Transmit & Receive MAC Engines
*/
- if (!bge_chip_enable_engine(bgep, TRANSMIT_MAC_MODE_REG, 0))
+ if (DEVICE_IS_5755_PLUS(bgep) ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5906) {
+ regval = bge_reg_get32(bgep, TRANSMIT_MAC_MODE_REG);
+ regval |= TRANSMIT_MODE_MBUF_LOCKUP_FIX;
+ } else {
+ regval = 0;
+ }
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5720) {
+ regval &= ~(TRANSMIT_MODE_HTX2B_JMB_FRM_LEN |
+ TRANSMIT_MODE_HTX2B_CNT_DN_MODE);
+ regval |= bge_reg_get32(bgep, TRANSMIT_MAC_MODE_REG) &
+ (TRANSMIT_MODE_HTX2B_JMB_FRM_LEN |
+ TRANSMIT_MODE_HTX2B_CNT_DN_MODE);
+ }
+ if (!bge_chip_enable_engine(bgep, TRANSMIT_MAC_MODE_REG, regval))
retval = DDI_FAILURE;
#ifdef BGE_IPMI_ASF
if (!bgep->asf_enabled) {
@@ -4219,7 +4414,6 @@ bge_chip_start(bge_t *bgep, boolean_t reset_phys)
if (bgep->intr_type == DDI_INTR_TYPE_FIXED)
bge_cfg_clr32(bgep, PCI_CONF_BGE_MHCR,
bgep->chipid.mask_pci_int);
-
/*
* All done!
*/
diff --git a/usr/src/uts/common/io/bge/bge_hw.h b/usr/src/uts/common/io/bge/bge_hw.h
index f8e6c4d09a..cfcae929dd 100644
--- a/usr/src/uts/common/io/bge/bge_hw.h
+++ b/usr/src/uts/common/io/bge/bge_hw.h
@@ -23,6 +23,10 @@
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ */
+
#ifndef _BGE_HW_H
#define _BGE_HW_H
@@ -68,9 +72,12 @@ extern "C" {
#define DEVICE_ID_5724 0x165c
#define DEVICE_ID_5705M 0x165d
#define DEVICE_ID_5705MA3 0x165e
+#define DEVICE_ID_5719 0x1657
+#define DEVICE_ID_5720 0x165f
#define DEVICE_ID_5705F 0x166e
#define DEVICE_ID_5780 0x166a
#define DEVICE_ID_5782 0x1696
+#define DEVICE_ID_5784M 0x1698
#define DEVICE_ID_5785 0x1699
#define DEVICE_ID_5787 0x169b
#define DEVICE_ID_5787M 0x1693
@@ -92,12 +99,27 @@ extern "C" {
#define DEVICE_ID_5714S 0x1669
#define DEVICE_ID_5715C 0x1678
#define DEVICE_ID_5715S 0x1679
-#define DEVICE_ID_5761E 0x1680
#define DEVICE_ID_5761 0x1681
+#define DEVICE_ID_5761E 0x1680
+#define DEVICE_ID_5761S 0x1688
+#define DEVICE_ID_5761SE 0x1689
#define DEVICE_ID_5764 0x1684
#define DEVICE_ID_5906 0x1712
#define DEVICE_ID_5906M 0x1713
+#define DEVICE_ID_57760 0x1690
#define DEVICE_ID_57780 0x1692
+#define DEVICE_ID_57788 0x1691
+#define DEVICE_ID_57790 0x1694
+#define DEVICE_ID_57781 0x16b1
+#define DEVICE_ID_57785 0x16b5
+#define DEVICE_ID_57761 0x16b0
+#define DEVICE_ID_57765 0x16b4
+#define DEVICE_ID_57791 0x16b2
+#define DEVICE_ID_57795 0x16b6
+#define DEVICE_ID_57762 0x1682
+#define DEVICE_ID_57766 0x1686
+#define DEVICE_ID_57786 0x16b3
+#define DEVICE_ID_57782 0x16b7
#define REVISION_ID_5700_B0 0x10
#define REVISION_ID_5700_B2 0x12
@@ -189,15 +211,23 @@ extern "C" {
#define DEVICE_5717_SERIES_CHIPSETS(bgep) \
(bgep->chipid.device == DEVICE_ID_5717) ||\
(bgep->chipid.device == DEVICE_ID_5718) ||\
+ (bgep->chipid.device == DEVICE_ID_5719) ||\
+ (bgep->chipid.device == DEVICE_ID_5720) ||\
(bgep->chipid.device == DEVICE_ID_5724)
#define DEVICE_5723_SERIES_CHIPSETS(bgep) \
((bgep->chipid.device == DEVICE_ID_5723) ||\
(bgep->chipid.device == DEVICE_ID_5761) ||\
(bgep->chipid.device == DEVICE_ID_5761E) ||\
+ (bgep->chipid.device == DEVICE_ID_5761S) ||\
+ (bgep->chipid.device == DEVICE_ID_5761SE) ||\
(bgep->chipid.device == DEVICE_ID_5764) ||\
+ (bgep->chipid.device == DEVICE_ID_5784M) ||\
(bgep->chipid.device == DEVICE_ID_5785) ||\
- (bgep->chipid.device == DEVICE_ID_57780))
+ (bgep->chipid.device == DEVICE_ID_57760) ||\
+ (bgep->chipid.device == DEVICE_ID_57780) ||\
+ (bgep->chipid.device == DEVICE_ID_57788) ||\
+ (bgep->chipid.device == DEVICE_ID_57790))
#define DEVICE_5714_SERIES_CHIPSETS(bgep) \
((bgep->chipid.device == DEVICE_ID_5714C) ||\
@@ -209,6 +239,20 @@ extern "C" {
((bgep->chipid.device == DEVICE_ID_5906) ||\
(bgep->chipid.device == DEVICE_ID_5906M))
+
+#define CHIP_TYPE_5705_PLUS (1 << 0)
+#define CHIP_TYPE_5750_PLUS (1 << 1)
+#define CHIP_TYPE_5780_CLASS (1 << 2)
+#define CHIP_TYPE_5755_PLUS (1 << 3)
+#define CHIP_TYPE_57765_CLASS (1 << 4)
+#define CHIP_TYPE_57765_PLUS (1 << 5)
+#define CHIP_TYPE_5717_PLUS (1 << 6)
+
+#define DEVICE_IS_57765_PLUS(bgep) \
+ (bgep->chipid.chip_type & CHIP_TYPE_57765_PLUS)
+#define DEVICE_IS_5755_PLUS(bgep) \
+ (bgep->chipid.chip_type & CHIP_TYPE_5755_PLUS)
+
/*
* Second section:
* Offsets of important registers & definitions for bits therein
@@ -225,6 +269,7 @@ extern "C" {
*/
#define PCI_CONF_BGE_MHCR 0x68
#define MHCR_CHIP_REV_MASK 0xffff0000
+#define MHCR_CHIP_REV_SHIFT 16
#define MHCR_ENABLE_TAGGED_STATUS_MODE 0x00000200
#define MHCR_MASK_INTERRUPT_MODE 0x00000100
#define MHCR_ENABLE_INDIRECT_ACCESS 0x00000080
@@ -236,95 +281,38 @@ extern "C" {
#define MHCR_MASK_PCI_INT_OUTPUT 0x00000002
#define MHCR_CLEAR_INTERRUPT_INTA 0x00000001
-#define MHCR_CHIP_REV_5700_B0 0x71000000
-#define MHCR_CHIP_REV_5700_B2 0x71020000
-#define MHCR_CHIP_REV_5700_B3 0x71030000
-#define MHCR_CHIP_REV_5700_C0 0x72000000
-#define MHCR_CHIP_REV_5700_C1 0x72010000
-#define MHCR_CHIP_REV_5700_C2 0x72020000
-
-#define MHCR_CHIP_REV_5701_A0 0x00000000
-#define MHCR_CHIP_REV_5701_A2 0x00020000
-#define MHCR_CHIP_REV_5701_A3 0x00030000
-#define MHCR_CHIP_REV_5701_A5 0x01050000
-
-#define MHCR_CHIP_REV_5702_A0 0x10000000
-#define MHCR_CHIP_REV_5702_A1 0x10010000
-#define MHCR_CHIP_REV_5702_A2 0x10020000
-
-#define MHCR_CHIP_REV_5703_A0 0x10000000
-#define MHCR_CHIP_REV_5703_A1 0x10010000
-#define MHCR_CHIP_REV_5703_A2 0x10020000
-#define MHCR_CHIP_REV_5703_B0 0x11000000
-#define MHCR_CHIP_REV_5703_B1 0x11010000
-
-#define MHCR_CHIP_REV_5704_A0 0x20000000
-#define MHCR_CHIP_REV_5704_A1 0x20010000
-#define MHCR_CHIP_REV_5704_A2 0x20020000
-#define MHCR_CHIP_REV_5704_A3 0x20030000
-#define MHCR_CHIP_REV_5704_B0 0x21000000
-
-#define MHCR_CHIP_REV_5705_A0 0x30000000
-#define MHCR_CHIP_REV_5705_A1 0x30010000
-#define MHCR_CHIP_REV_5705_A2 0x30020000
-#define MHCR_CHIP_REV_5705_A3 0x30030000
-#define MHCR_CHIP_REV_5705_A5 0x30050000
-
-#define MHCR_CHIP_REV_5782_A0 0x30030000
-#define MHCR_CHIP_REV_5782_A1 0x30030088
-
-#define MHCR_CHIP_REV_5788_A1 0x30050000
-
-#define MHCR_CHIP_REV_5751_A0 0x40000000
-#define MHCR_CHIP_REV_5751_A1 0x40010000
-
-#define MHCR_CHIP_REV_5721_A0 0x41000000
-#define MHCR_CHIP_REV_5721_A1 0x41010000
-
-#define MHCR_CHIP_REV_5714_A0 0x50000000
-#define MHCR_CHIP_REV_5714_A1 0x90010000
-
-#define MHCR_CHIP_REV_5715_A0 0x50000000
-#define MHCR_CHIP_REV_5715_A1 0x90010000
-
-#define MHCR_CHIP_REV_5715S_A0 0x50000000
-#define MHCR_CHIP_REV_5715S_A1 0x90010000
-
-#define MHCR_CHIP_REV_5754_A0 0xb0000000
-#define MHCR_CHIP_REV_5754_A1 0xb0010000
-
-#define MHCR_CHIP_REV_5787_A0 0xb0000000
-#define MHCR_CHIP_REV_5787_A1 0xb0010000
-#define MHCR_CHIP_REV_5787_A2 0xb0020000
-
-#define MHCR_CHIP_REV_5755_A0 0xa0000000
-#define MHCR_CHIP_REV_5755_A1 0xa0010000
-
-#define MHCR_CHIP_REV_5906_A0 0xc0000000
-#define MHCR_CHIP_REV_5906_A1 0xc0010000
-#define MHCR_CHIP_REV_5906_A2 0xc0020000
-
-#define MHCR_CHIP_REV_5723_A0 0xf0000000
-#define MHCR_CHIP_REV_5723_A1 0xf0010000
-#define MHCR_CHIP_REV_5723_A2 0xf0020000
-#define MHCR_CHIP_REV_5723_B0 0xf1000000
-
-#define MHCR_CHIP_ASIC_REV(ChipRevId) ((ChipRevId) & 0xf0000000)
-#define MHCR_CHIP_ASIC_REV_5700 (0x7 << 28)
-#define MHCR_CHIP_ASIC_REV_5701 (0x0 << 28)
-#define MHCR_CHIP_ASIC_REV_5703 (0x1 << 28)
-#define MHCR_CHIP_ASIC_REV_5704 (0x2 << 28)
-#define MHCR_CHIP_ASIC_REV_5705 (0x3 << 28)
-#define MHCR_CHIP_ASIC_REV_5721_5751 (0x4 << 28)
-#define MHCR_CHIP_ASIC_REV_5714 (0x5 << 28)
-#define MHCR_CHIP_ASIC_REV_5752 (0x6 << 28)
-#define MHCR_CHIP_ASIC_REV_5754 (0xb << 28)
-#define MHCR_CHIP_ASIC_REV_5787 ((uint32_t)0xb << 28)
-#define MHCR_CHIP_ASIC_REV_5755 ((uint32_t)0xa << 28)
-#define MHCR_CHIP_ASIC_REV_5715 ((uint32_t)0x9 << 28)
-#define MHCR_CHIP_ASIC_REV_5906 ((uint32_t)0xc << 28)
-#define MHCR_CHIP_ASIC_REV_5723 ((uint32_t)0xf << 28)
-
+#define MHCR_CHIP_REV_5703_A0 0x1000
+#define MHCR_CHIP_REV_5704_A0 0x2000
+#define MHCR_CHIP_REV_5751_A0 0x4000
+#define MHCR_CHIP_REV_5721_A0 0x4100
+#define MHCR_CHIP_REV_5755_A0 0xa000
+#define MHCR_CHIP_REV_5755_A1 0xa001
+#define MHCR_CHIP_REV_5719_A0 0x05719000
+#define MHCR_CHIP_REV_5720_A0 0x05720000
+
+#define MHCR_CHIP_ASIC_REV(ChipRevId) ((ChipRevId) >> 12)
+#define MHCR_CHIP_ASIC_REV_5700 0x07
+#define MHCR_CHIP_ASIC_REV_5701 0x00
+#define MHCR_CHIP_ASIC_REV_5703 0x01
+#define MHCR_CHIP_ASIC_REV_5704 0x02
+#define MHCR_CHIP_ASIC_REV_5705 0x03
+#define MHCR_CHIP_ASIC_REV_5750 0x04
+#define MHCR_CHIP_ASIC_REV_5752 0x06
+#define MHCR_CHIP_ASIC_REV_5780 0x08
+#define MHCR_CHIP_ASIC_REV_5714 0x09
+#define MHCR_CHIP_ASIC_REV_5755 0x0a
+#define MHCR_CHIP_ASIC_REV_5787 0x0b
+#define MHCR_CHIP_ASIC_REV_5906 0x0c
+#define MHCR_CHIP_ASIC_REV_PRODID 0x0f
+#define MHCR_CHIP_ASIC_REV_5784 0x5784
+#define MHCR_CHIP_ASIC_REV_5761 0x5761
+#define MHCR_CHIP_ASIC_REV_5785 0x5785
+#define MHCR_CHIP_ASIC_REV_5717 0x5717
+#define MHCR_CHIP_ASIC_REV_5719 0x5719
+#define MHCR_CHIP_ASIC_REV_5720 0x5720
+#define MHCR_CHIP_ASIC_REV_57780 0x57780
+#define MHCR_CHIP_ASIC_REV_57765 0x57785
+#define MHCR_CHIP_ASIC_REV_57766 0x57766
/*
* PCI DMA read/write Control Register, in PCI config space
@@ -466,6 +454,10 @@ extern "C" {
#define PCI_CONF_DEV_STUS_5723 0xd6
#define DEVICE_ERROR_STUS 0xf
+#define PCI_CONF_PRODID_ASICREV 0x000000bc
+#define PCI_CONF_GEN2_PRODID_ASICREV 0x000000f4
+#define PCI_CONF_GEN15_PRODID_ASICREV 0x000000fc
+
#define NIC_MEM_WINDOW_OFFSET 0x00008000 /* 32k */
/*
@@ -541,6 +533,7 @@ extern "C" {
#define MEMORY_ARBITER_MODE_REG 0x4000
#define BUFFER_MANAGER_MODE_REG 0x4400
#define READ_DMA_MODE_REG 0x4800
+#define READ_DMA_RESERVED_CONTROL_REG 0x4900
#define WRITE_DMA_MODE_REG 0x4c00
#define DMA_COMPLETION_MODE_REG 0x6400
@@ -552,6 +545,9 @@ extern "C" {
* Transmit MAC Mode Register
* (TRANSMIT_MAC_MODE_REG, 0x045c)
*/
+#define TRANSMIT_MODE_HTX2B_CNT_DN_MODE 0x00800000
+#define TRANSMIT_MODE_HTX2B_JMB_FRM_LEN 0x00400000
+#define TRANSMIT_MODE_MBUF_LOCKUP_FIX 0x00000100
#define TRANSMIT_MODE_LONG_PAUSE 0x00000040
#define TRANSMIT_MODE_BIG_BACKOFF 0x00000020
#define TRANSMIT_MODE_FLOW_CONTROL 0x00000010
@@ -619,12 +615,14 @@ extern "C" {
*/
#define BUFF_MGR_TEST_MODE 0x00000008
#define BUFF_MGR_MBUF_LOW_ATTN_ENABLE 0x00000010
+#define BUFF_MGR_NO_TX_UNDERRUN 0x80000000
#define BUFF_MGR_ALL_ATTN_BITS 0x00000014
/*
* Read and Write DMA Mode Registers (READ_DMA_MODE_REG,
- * 0x4800 and WRITE_DMA_MODE_REG, 0x4c00)
+ * 0x4800, READ_DMA_RESERVED_CONTROL_REG, 0x4900,
+ * WRITE_DMA_MODE_REG, 0x4c00)
*
* These registers each contain a 2-bit priority field, which controls
* the relative priority of that type of DMA (read vs. write vs. MSI),
@@ -635,6 +633,15 @@ extern "C" {
#define DMA_PRIORITY_SHIFT 30
#define ALL_DMA_ATTN_BITS 0x000003fc
+#define RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
+#define RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000c00
+#define RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000ff0
+#define RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000c0000
+#define RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000ff000
+#define RDMA_RSRVCTRL_TXMRGN_320B 0x28000000
+#define RDMA_RSRVCTRL_TXMRGN_MASK 0xffe00000
+
+
/*
* BCM5755, 5755M, 5906, 5906M only
* 1 - Enable Fix. Device will send out the status block before
@@ -644,6 +651,10 @@ extern "C" {
*/
#define DMA_STATUS_TAG_FIX_CQ12384 0x20000000
+/* 5720 only */
+#define DMA_H2BNC_VLAN_DET 0x20000000
+
+
/*
* End of state machine control register definitions
*/
@@ -781,6 +792,8 @@ extern "C" {
#define MAC_RX_MTU_DEFAULT 0x000005f2 /* 1522 */
#define MAC_TX_LENGTHS_REG 0x0464
#define MAC_TX_LENGTHS_DEFAULT 0x00002620
+#define MAC_TX_LENGTHS_JMB_FRM_LEN_MSK 0x00ff0000
+#define MAC_TX_LENGTHS_CNT_DWN_VAL_MSK 0xff000000
/*
* MII access registers
@@ -1069,10 +1082,16 @@ extern "C" {
#define JUMBO_RCV_BD_REPLENISH_DEFAULT 0x00000020 /* 32 */
/*
- * CPMU registers (5717/5718 only)
+ * CPMU registers (5717/5718/5719/5720 only)
*/
-#define CPMU_STATUS_REG 0x362c
-#define CPMU_STATUS_FUN_NUM 0x20000000
+#define CPMU_CLCK_ORIDE_REG 0x3624
+#define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000
+
+#define CPMU_STATUS_REG 0x362c
+#define CPMU_STATUS_FUN_NUM_5717 0x20000000
+#define CPMU_STATUS_FUN_NUM_5719 0xc0000000
+#define CPMU_STATUS_FUN_NUM_5719_SHIFT 30
+
/*
* Host Coalescing Engine Control Registers
@@ -1191,6 +1210,8 @@ extern "C" {
#define VCPU_EXT_CTL 0x6890
#define VCPU_EXT_CTL_HALF 0x00400000
+#define GRC_FASTBOOT_PC 0x6894
+
#define FTQ_RESET_REG 0x5c00
#define MSI_MODE_REG 0x6000
@@ -1210,14 +1231,18 @@ extern "C" {
#define MODE_INT_ON_TXRISC_ATTN 0x01000000
#define MODE_RECV_NO_PSEUDO_HDR_CSUM 0x00800000
#define MODE_SEND_NO_PSEUDO_HDR_CSUM 0x00100000
+#define MODE_HTX2B_ENABLE 0x00040000
#define MODE_HOST_SEND_BDS 0x00020000
#define MODE_HOST_STACK_UP 0x00010000
#define MODE_FORCE_32_BIT_PCI 0x00008000
+#define MODE_B2HRX_ENABLE 0x00008000
#define MODE_NO_INT_ON_RECV 0x00004000
#define MODE_NO_INT_ON_SEND 0x00002000
#define MODE_ALLOW_BAD_FRAMES 0x00000800
#define MODE_NO_CRC 0x00000400
#define MODE_NO_FRAME_CRACKING 0x00000200
+#define MODE_WORD_SWAP_B2HRX_DATA 0x00000080
+#define MODE_BYTE_SWAP_B2HRX_DATA 0x00000040
#define MODE_WORD_SWAP_FRAME 0x00000020
#define MODE_BYTE_SWAP_FRAME 0x00000010
#define MODE_WORD_SWAP_NONFRAME 0x00000004
@@ -1246,7 +1271,7 @@ extern "C" {
*/
#define CORE_CLOCK_MHZ 66
#define MISC_CONFIG_REG 0x6804
-#define MISC_CONFIG_GRC_RESET_DISABLE 0x20000000
+#define MISC_CONFIG_GRC_RESET_DISABLE 0x20000000
#define MISC_CONFIG_GPHY_POWERDOWN_OVERRIDE 0x04000000
#define MISC_CONFIG_POWERDOWN 0x00100000
#define MISC_CONFIG_POWER_STATE 0x00060000
@@ -1567,6 +1592,7 @@ extern "C" {
#define BGE_MINI_SLOTS_MAX 1024
#define BGE_RECV_SLOTS_MAX 2048
#define BGE_RECV_SLOTS_5705 512
+#define BGE_RECV_SLOTS_5717 1024
#define BGE_RECV_SLOTS_5782 512
#define BGE_RECV_SLOTS_5721 512
diff --git a/usr/src/uts/common/io/bge/bge_impl.h b/usr/src/uts/common/io/bge/bge_impl.h
index 772c989092..0c51c2bc8e 100644
--- a/usr/src/uts/common/io/bge/bge_impl.h
+++ b/usr/src/uts/common/io/bge/bge_impl.h
@@ -23,6 +23,10 @@
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ */
+
#ifndef _BGE_IMPL_H
#define _BGE_IMPL_H
@@ -605,6 +609,7 @@ typedef struct {
uint8_t latency; /* latency-timer */
uint8_t flags;
+ uint32_t chip_type; /* see CHIP_TYPE_ in bge_hw.h */
uint16_t chip_label; /* numeric part only */
/* (e.g. 5703/5794/etc) */
uint32_t mbuf_base; /* Mbuf pool parameters */
@@ -640,10 +645,11 @@ typedef struct {
uint32_t mask_pci_int;
} chip_id_t;
-#define CHIP_FLAG_SUPPORTED 0x80
-#define CHIP_FLAG_SERDES 0x40
-#define CHIP_FLAG_PARTIAL_CSUM 0x20
-#define CHIP_FLAG_NO_JUMBO 0x1
+#define CHIP_FLAG_SUPPORTED 0x80
+#define CHIP_FLAG_SERDES 0x40
+#define CHIP_FLAG_PARTIAL_CSUM 0x20
+#define CHIP_FLAG_NO_CHECK_RESET 0x2
+#define CHIP_FLAG_NO_JUMBO 0x1
/*
* Collection of physical-layer functions to:
diff --git a/usr/src/uts/common/io/bge/bge_main2.c b/usr/src/uts/common/io/bge/bge_main2.c
index f191f313c0..d0f309730d 100644
--- a/usr/src/uts/common/io/bge/bge_main2.c
+++ b/usr/src/uts/common/io/bge/bge_main2.c
@@ -23,6 +23,10 @@
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ */
+
#include "bge_impl.h"
#include <sys/sdt.h>
#include <sys/mac_provider.h>
@@ -3211,13 +3215,17 @@ bge_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
*/
if (DEVICE_5717_SERIES_CHIPSETS(bgep))
pci_config_put32(bgep->cfg_handle, PCI_CONF_BGE_MHCR, 0);
+#else
+ mhcrValue = MHCR_ENABLE_INDIRECT_ACCESS |
+ MHCR_ENABLE_TAGGED_STATUS_MODE |
+ MHCR_MASK_INTERRUPT_MODE |
+ MHCR_MASK_PCI_INT_OUTPUT |
+ MHCR_CLEAR_INTERRUPT_INTA;
+#endif
pci_config_put32(bgep->cfg_handle, PCI_CONF_BGE_MHCR, mhcrValue);
bge_ind_put32(bgep, MEMORY_ARBITER_MODE_REG,
bge_ind_get32(bgep, MEMORY_ARBITER_MODE_REG) |
MEMORY_ARBITER_ENABLE);
-#else
- mhcrValue = pci_config_get32(bgep->cfg_handle, PCI_CONF_BGE_MHCR);
-#endif
if (mhcrValue & MHCR_ENABLE_ENDIAN_WORD_SWAP) {
bgep->asf_wordswapped = B_TRUE;
} else {
diff --git a/usr/src/uts/common/io/bge/bge_mii.c b/usr/src/uts/common/io/bge/bge_mii.c
index f24b6a3f16..b47c043d8c 100644
--- a/usr/src/uts/common/io/bge/bge_mii.c
+++ b/usr/src/uts/common/io/bge/bge_mii.c
@@ -23,6 +23,10 @@
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ */
+
#include "bge_impl.h"
/*
@@ -207,6 +211,7 @@ bge_phy_reset(bge_t *bgep)
{
uint16_t control;
uint_t count;
+ boolean_t ret = B_FALSE;
BGE_TRACE(("bge_phy_reset($%p)", (void *)bgep));
@@ -221,22 +226,26 @@ bge_phy_reset(bge_t *bgep)
}
/*
- * Set the PHY RESET bit, then wait up to 5 ms for it to self-clear
+ * Set the PHY RESET bit, then wait up to 50 ms for it to self-clear
*/
bge_mii_put16(bgep, MII_CONTROL, MII_CONTROL_RESET);
- for (count = 0; ++count < 1000; ) {
- drv_usecwait(5);
+ for (count = 0; ++count < 5000; ) {
control = bge_mii_get16(bgep, MII_CONTROL);
- if (BIC(control, MII_CONTROL_RESET))
- return (B_TRUE);
+ if (BIC(control, MII_CONTROL_RESET)) {
+ drv_usecwait(40);
+ ret = B_TRUE;
+ break;
+ }
+ drv_usecwait(10);
}
- if (DEVICE_5906_SERIES_CHIPSETS(bgep))
+ if (ret == B_TRUE && DEVICE_5906_SERIES_CHIPSETS(bgep))
(void) bge_adj_volt_5906(bgep);
- BGE_DEBUG(("bge_phy_reset: FAILED, control now 0x%x", control));
+ if (ret == B_FALSE)
+ BGE_DEBUG(("bge_phy_reset: FAILED, control now 0x%x", control));
- return (B_FALSE);
+ return (ret);
}
/*
@@ -541,34 +550,14 @@ bge_restart_copper(bge_t *bgep, boolean_t powerdown)
ASSERT(mutex_owned(bgep->genlock));
- switch (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev)) {
- default:
- /*
- * Shouldn't happen; it means we don't recognise this chip.
- * It's probably a new one, so we'll try our best anyway ...
- */
- case MHCR_CHIP_ASIC_REV_5703:
- case MHCR_CHIP_ASIC_REV_5704:
- case MHCR_CHIP_ASIC_REV_5705:
- case MHCR_CHIP_ASIC_REV_5752:
- case MHCR_CHIP_ASIC_REV_5714:
- case MHCR_CHIP_ASIC_REV_5715:
- reset_ok = bge_phy_reset_and_check(bgep);
- break;
-
- case MHCR_CHIP_ASIC_REV_5906:
- case MHCR_CHIP_ASIC_REV_5700:
- case MHCR_CHIP_ASIC_REV_5701:
- case MHCR_CHIP_ASIC_REV_5723:
- case MHCR_CHIP_ASIC_REV_5721_5751:
- /*
- * Just a plain reset; the "check" code breaks these chips
- */
+ if (bgep->chipid.flags & CHIP_FLAG_NO_CHECK_RESET) {
reset_ok = bge_phy_reset(bgep);
if (!reset_ok)
bge_fm_ereport(bgep, DDI_FM_DEVICE_NO_RESPONSE);
- break;
+ } else {
+ reset_ok = bge_phy_reset_and_check(bgep);
}
+
if (!reset_ok) {
BGE_REPORT((bgep, "PHY failed to reset correctly"));
return (DDI_FAILURE);
@@ -590,7 +579,7 @@ bge_restart_copper(bge_t *bgep, boolean_t powerdown)
switch (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev)) {
case MHCR_CHIP_ASIC_REV_5705:
- case MHCR_CHIP_ASIC_REV_5721_5751:
+ case MHCR_CHIP_ASIC_REV_5750:
bge_phy_bit_err_fix(bgep);
break;
}
@@ -1507,14 +1496,22 @@ bge_phys_init(bge_t *bgep)
*/
bgep->phy_mii_addr = 1;
if (DEVICE_5717_SERIES_CHIPSETS(bgep)) {
- int regval = bge_reg_get32(bgep, CPMU_STATUS_REG);
- if (regval & CPMU_STATUS_FUN_NUM)
- bgep->phy_mii_addr += 1;
+ uint32_t regval = bge_reg_get32(bgep, CPMU_STATUS_REG);
+ if (MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5719 ||
+ MHCR_CHIP_ASIC_REV(bgep->chipid.asic_rev) ==
+ MHCR_CHIP_ASIC_REV_5720) {
+ bgep->phy_mii_addr +=
+ (regval & CPMU_STATUS_FUN_NUM_5719) >>
+ CPMU_STATUS_FUN_NUM_5719_SHIFT;
+ } else {
+ bgep->phy_mii_addr +=
+ (regval & CPMU_STATUS_FUN_NUM_5717) ? 1 : 0;
+ }
regval = bge_reg_get32(bgep, SGMII_STATUS_REG);
if (regval & MEDIA_SELECTION_MODE)
bgep->phy_mii_addr += 7;
}
-
if (bge_phy_probe(bgep)) {
bgep->chipid.flags &= ~CHIP_FLAG_SERDES;
bgep->physops = &copper_ops;
diff --git a/usr/src/uts/common/io/dld/dld_drv.c b/usr/src/uts/common/io/dld/dld_drv.c
index 40cbe86170..2152ce0baa 100644
--- a/usr/src/uts/common/io/dld/dld_drv.c
+++ b/usr/src/uts/common/io/dld/dld_drv.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/*
@@ -701,7 +702,8 @@ drv_ioc_prop_common(dld_ioc_macprop_t *prop, intptr_t arg, boolean_t set,
err = EACCES;
goto done;
}
- err = dls_devnet_setzid(dlh, dzp->diz_zid);
+ err = dls_devnet_setzid(dlh, dzp->diz_zid,
+ dzp->diz_transient);
} else {
kprop->pr_perm_flags = MAC_PROP_PERM_RW;
(*(zoneid_t *)kprop->pr_val) = dls_devnet_getzid(dlh);
@@ -865,7 +867,7 @@ drv_ioc_rename(void *karg, intptr_t arg, int mode, cred_t *cred, int *rvalp)
return (err);
if ((err = dls_devnet_rename(dir->dir_linkid1, dir->dir_linkid2,
- dir->dir_link)) != 0)
+ dir->dir_link, dir->dir_zoneinit)) != 0)
return (err);
if (dir->dir_linkid2 == DATALINK_INVALID_LINKID)
diff --git a/usr/src/uts/common/io/dls/dls.c b/usr/src/uts/common/io/dls/dls.c
index 92993ada58..61e4afb5b6 100644
--- a/usr/src/uts/common/io/dls/dls.c
+++ b/usr/src/uts/common/io/dls/dls.c
@@ -629,6 +629,22 @@ boolean_t
dls_accept_promisc(dld_str_t *dsp, mac_header_info_t *mhip, dls_rx_t *ds_rx,
void **ds_rx_arg, boolean_t loopback)
{
+ if (dsp->ds_promisc == 0) {
+ /*
+ * If there are active walkers of the mi_promisc_list when
+ * promiscuousness is disabled, ds_promisc will be cleared,
+ * but the DLS will remain on the mi_promisc_list until the
+ * walk is completed. If we do not recognize this case here,
+ * we won't properly execute the ds_promisc case in the common
+ * accept routine -- and we will potentially accept a packet
+ * that has originated with this DLS (which in turn can
+ * induce recursion and death by stack overflow). If
+ * ds_promisc is zero, we know that we are in this window --
+ * and we refuse to accept the packet.
+ */
+ return (B_FALSE);
+ }
+
return (dls_accept_common(dsp, mhip, ds_rx, ds_rx_arg, B_TRUE,
loopback));
}
diff --git a/usr/src/uts/common/io/dls/dls_mgmt.c b/usr/src/uts/common/io/dls/dls_mgmt.c
index 049c4bd757..27a808f211 100644
--- a/usr/src/uts/common/io/dls/dls_mgmt.c
+++ b/usr/src/uts/common/io/dls/dls_mgmt.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -105,12 +106,13 @@ typedef struct dls_devnet_s {
zoneid_t dd_zid; /* current zone */
boolean_t dd_prop_loaded;
taskqid_t dd_prop_taskid;
+ boolean_t dd_transient; /* link goes away when zone does */
} dls_devnet_t;
static int i_dls_devnet_create_iptun(const char *, const char *,
datalink_id_t *);
static int i_dls_devnet_destroy_iptun(datalink_id_t);
-static int i_dls_devnet_setzid(dls_devnet_t *, zoneid_t, boolean_t);
+static int i_dls_devnet_setzid(dls_devnet_t *, zoneid_t, boolean_t, boolean_t);
static int dls_devnet_unset(const char *, datalink_id_t *, boolean_t);
/*ARGSUSED*/
@@ -145,7 +147,12 @@ dls_zone_remove(datalink_id_t linkid, void *arg)
dls_devnet_t *ddp;
if (dls_devnet_hold_tmp(linkid, &ddp) == 0) {
- (void) dls_devnet_setzid(ddp, GLOBAL_ZONEID);
+ /*
+ * Don't bother moving transient links back to the global zone
+ * since we will simply delete them in dls_devnet_unset.
+ */
+ if (!ddp->dd_transient)
+ (void) dls_devnet_setzid(ddp, GLOBAL_ZONEID, B_FALSE);
dls_devnet_rele_tmp(ddp);
}
return (0);
@@ -526,6 +533,7 @@ dls_mgmt_get_linkid(const char *link, datalink_id_t *linkid)
getlinkid.ld_cmd = DLMGMT_CMD_GETLINKID;
(void) strlcpy(getlinkid.ld_link, link, MAXLINKNAMELEN);
+ getlinkid.ld_zoneid = getzoneid();
if ((err = i_dls_mgmt_upcall(&getlinkid, sizeof (getlinkid), &retval,
sizeof (retval))) == 0) {
@@ -740,12 +748,23 @@ dls_devnet_stat_update(kstat_t *ksp, int rw)
* Create the "link" kstats.
*/
static void
-dls_devnet_stat_create(dls_devnet_t *ddp, zoneid_t zoneid)
+dls_devnet_stat_create(dls_devnet_t *ddp, zoneid_t zoneid, zoneid_t newzoneid)
{
kstat_t *ksp;
+ char *nm;
+ char kname[MAXLINKNAMELEN];
+
+ if (zoneid != newzoneid) {
+ ASSERT(zoneid == GLOBAL_ZONEID);
+ (void) snprintf(kname, sizeof (kname), "z%d_%s", newzoneid,
+ ddp->dd_linkname);
+ nm = kname;
+ } else {
+ nm = ddp->dd_linkname;
+ }
- if (dls_stat_create("link", 0, ddp->dd_linkname, zoneid,
- dls_devnet_stat_update, ddp, &ksp) == 0) {
+ if (dls_stat_create("link", 0, nm, zoneid,
+ dls_devnet_stat_update, ddp, &ksp, newzoneid) == 0) {
ASSERT(ksp != NULL);
if (zoneid == ddp->dd_owner_zid) {
ASSERT(ddp->dd_ksp == NULL);
@@ -765,12 +784,12 @@ dls_devnet_stat_destroy(dls_devnet_t *ddp, zoneid_t zoneid)
{
if (zoneid == ddp->dd_owner_zid) {
if (ddp->dd_ksp != NULL) {
- kstat_delete(ddp->dd_ksp);
+ dls_stat_delete(ddp->dd_ksp);
ddp->dd_ksp = NULL;
}
} else {
if (ddp->dd_zone_ksp != NULL) {
- kstat_delete(ddp->dd_zone_ksp);
+ dls_stat_delete(ddp->dd_zone_ksp);
ddp->dd_zone_ksp = NULL;
}
}
@@ -781,15 +800,25 @@ dls_devnet_stat_destroy(dls_devnet_t *ddp, zoneid_t zoneid)
* and create the new set using the new name.
*/
static void
-dls_devnet_stat_rename(dls_devnet_t *ddp)
+dls_devnet_stat_rename(dls_devnet_t *ddp, boolean_t zoneinit)
{
if (ddp->dd_ksp != NULL) {
- kstat_delete(ddp->dd_ksp);
+ dls_stat_delete(ddp->dd_ksp);
ddp->dd_ksp = NULL;
}
- /* We can't rename a link while it's assigned to a non-global zone. */
+ if (zoneinit && ddp->dd_zone_ksp != NULL) {
+ dls_stat_delete(ddp->dd_zone_ksp);
+ ddp->dd_zone_ksp = NULL;
+ }
+ /*
+ * We can't rename a link while it's assigned to a non-global zone
+ * unless we're first initializing the zone while readying it.
+ */
ASSERT(ddp->dd_zone_ksp == NULL);
- dls_devnet_stat_create(ddp, ddp->dd_owner_zid);
+ dls_devnet_stat_create(ddp, ddp->dd_owner_zid,
+ (zoneinit ? ddp->dd_zid : ddp->dd_owner_zid));
+ if (zoneinit)
+ dls_devnet_stat_create(ddp, ddp->dd_zid, ddp->dd_zid);
}
/*
@@ -878,7 +907,8 @@ done:
rw_exit(&i_dls_devnet_lock);
if (err == 0) {
if (zoneid != GLOBAL_ZONEID &&
- (err = i_dls_devnet_setzid(ddp, zoneid, B_FALSE)) != 0)
+ (err = i_dls_devnet_setzid(ddp, zoneid, B_FALSE,
+ B_FALSE)) != 0)
(void) dls_devnet_unset(macname, &linkid, B_TRUE);
/*
* The kstat subsystem holds its own locks (rather perimeter)
@@ -887,7 +917,7 @@ done:
* lock hierarchy is kstat locks -> i_dls_devnet_lock.
*/
if (stat_create)
- dls_devnet_stat_create(ddp, zoneid);
+ dls_devnet_stat_create(ddp, zoneid, zoneid);
if (ddpp != NULL)
*ddpp = ddp;
}
@@ -924,17 +954,78 @@ dls_devnet_unset(const char *macname, datalink_id_t *id, boolean_t wait)
ASSERT(ddp->dd_ref != 0);
if ((ddp->dd_ref != 1) || (!wait &&
(ddp->dd_tref != 0 || ddp->dd_prop_taskid != NULL))) {
- mutex_exit(&ddp->dd_mutex);
- rw_exit(&i_dls_devnet_lock);
- return (EBUSY);
+ int zstatus = 0;
+
+ /*
+ * There are a couple of alternatives that might be going on
+ * here; a) the zone is shutting down and it has a transient
+ * link assigned, in which case we want to clean it up instead
+ * of moving it back to the global zone, or b) its possible
+ * that we're trying to clean up an orphaned vnic that was
+ * delegated to a zone and which wasn't cleaned up properly
+ * when the zone went away. Check for either of these cases
+ * before we simply return EBUSY.
+ *
+ * zstatus indicates which situation we are dealing with:
+ * 0 - means return EBUSY
+ * 1 - means case (a), cleanup transient link
+ * -1 - means case (b), orphained VNIC
+ */
+ if (ddp->dd_ref > 1 && ddp->dd_zid != GLOBAL_ZONEID) {
+ zone_t *zp;
+
+ if ((zp = zone_find_by_id(ddp->dd_zid)) == NULL) {
+ zstatus = -1;
+ } else {
+ if (ddp->dd_transient) {
+ zone_status_t s = zone_status_get(zp);
+
+ if (s >= ZONE_IS_SHUTTING_DOWN)
+ zstatus = 1;
+ }
+ zone_rele(zp);
+ }
+ }
+
+ if (zstatus == 0) {
+ mutex_exit(&ddp->dd_mutex);
+ rw_exit(&i_dls_devnet_lock);
+ return (EBUSY);
+ }
+
+ /*
+ * We want to delete the link, reset ref to 1;
+ */
+ if (zstatus == -1)
+ /* Log a warning, but continue in this case */
+ cmn_err(CE_WARN, "clear orphaned datalink: %s\n",
+ ddp->dd_linkname);
+ ddp->dd_ref = 1;
}
ddp->dd_flags |= DD_CONDEMNED;
ddp->dd_ref--;
*id = ddp->dd_linkid;
- if (ddp->dd_zid != GLOBAL_ZONEID)
- (void) i_dls_devnet_setzid(ddp, GLOBAL_ZONEID, B_FALSE);
+ if (ddp->dd_zid != GLOBAL_ZONEID) {
+ /*
+ * We need to release the dd_mutex before we try and destroy the
+ * stat. When we destroy it, we'll need to grab the lock for the
+ * kstat but if there's a concurrent reader of the kstat, we'll
+ * be blocked on it. This will lead to deadlock because these
+ * kstats employ a ks_update function (dls_devnet_stat_update)
+ * which needs the dd_mutex that we currently hold.
+ *
+ * Because we've already flagged the dls_devnet_t as
+ * DD_CONDEMNED and we still have a write lock on
+ * i_dls_devnet_lock, we should be able to release the dd_mutex.
+ */
+ mutex_exit(&ddp->dd_mutex);
+ dls_devnet_stat_destroy(ddp, ddp->dd_zid);
+ mutex_enter(&ddp->dd_mutex);
+ (void) i_dls_devnet_setzid(ddp, GLOBAL_ZONEID, B_FALSE,
+ B_FALSE);
+ }
/*
* Remove this dls_devnet_t from the hash table.
@@ -960,8 +1051,15 @@ dls_devnet_unset(const char *macname, datalink_id_t *id, boolean_t wait)
ASSERT(ddp->dd_tref == 0 && ddp->dd_prop_taskid == NULL);
}
- if (ddp->dd_linkid != DATALINK_INVALID_LINKID)
+ if (ddp->dd_linkid != DATALINK_INVALID_LINKID) {
+ /*
+ * See the earlier call in this function for an explanation.
+ */
+ mutex_exit(&ddp->dd_mutex);
dls_devnet_stat_destroy(ddp, ddp->dd_owner_zid);
+ mutex_enter(&ddp->dd_mutex);
+ }
+
ddp->dd_prop_loaded = B_FALSE;
ddp->dd_linkid = DATALINK_INVALID_LINKID;
@@ -1261,9 +1359,15 @@ dls_devnet_phydev(datalink_id_t vlanid, dev_t *devp)
*
* This case does not change the <link name, linkid> mapping, so the link's
* kstats need to be updated with using name associated the given id2.
+ *
+ * The zonename parameter is used to allow us to create a VNIC in the global
+ * zone which is assigned to a non-global zone. Since there is a race condition
+ * in the create process if two VNICs have the same name, we need to rename it
+ * after it has been assigned to the zone.
*/
int
-dls_devnet_rename(datalink_id_t id1, datalink_id_t id2, const char *link)
+dls_devnet_rename(datalink_id_t id1, datalink_id_t id2, const char *link,
+ boolean_t zoneinit)
{
dls_dev_handle_t ddh = NULL;
int err = 0;
@@ -1313,13 +1417,16 @@ dls_devnet_rename(datalink_id_t id1, datalink_id_t id2, const char *link)
* is currently accessing the link kstats, or if the link is on-loan
* to a non-global zone. Then set the DD_KSTAT_CHANGING flag to
* prevent any access to the kstats while we delete and recreate
- * kstats below.
+ * kstats below. However, we skip this check if we're renaming the
+ * vnic as part of bringing it up for a zone.
*/
mutex_enter(&ddp->dd_mutex);
- if (ddp->dd_ref > 1) {
- mutex_exit(&ddp->dd_mutex);
- err = EBUSY;
- goto done;
+ if (!zoneinit) {
+ if (ddp->dd_ref > 1) {
+ mutex_exit(&ddp->dd_mutex);
+ err = EBUSY;
+ goto done;
+ }
}
ddp->dd_flags |= DD_KSTAT_CHANGING;
@@ -1333,7 +1440,15 @@ dls_devnet_rename(datalink_id_t id1, datalink_id_t id2, const char *link)
/* rename mac client name and its flow if exists */
if ((err = mac_open(ddp->dd_mac, &mh)) != 0)
goto done;
- (void) mac_rename_primary(mh, link);
+ if (zoneinit) {
+ char tname[MAXLINKNAMELEN];
+
+ (void) snprintf(tname, sizeof (tname), "z%d_%s",
+ ddp->dd_zid, link);
+ (void) mac_rename_primary(mh, tname);
+ } else {
+ (void) mac_rename_primary(mh, link);
+ }
mac_close(mh);
goto done;
}
@@ -1406,7 +1521,7 @@ done:
*/
rw_exit(&i_dls_devnet_lock);
if (err == 0)
- dls_devnet_stat_rename(ddp);
+ dls_devnet_stat_rename(ddp, zoneinit);
if (clear_dd_flag) {
mutex_enter(&ddp->dd_mutex);
@@ -1421,7 +1536,8 @@ done:
}
static int
-i_dls_devnet_setzid(dls_devnet_t *ddp, zoneid_t new_zoneid, boolean_t setprop)
+i_dls_devnet_setzid(dls_devnet_t *ddp, zoneid_t new_zoneid, boolean_t setprop,
+ boolean_t transient)
{
int err;
mac_perim_handle_t mph;
@@ -1454,6 +1570,7 @@ i_dls_devnet_setzid(dls_devnet_t *ddp, zoneid_t new_zoneid, boolean_t setprop)
}
if ((err = dls_link_setzid(ddp->dd_mac, new_zoneid)) == 0) {
ddp->dd_zid = new_zoneid;
+ ddp->dd_transient = transient;
devnet_need_rebuild = B_TRUE;
}
@@ -1468,7 +1585,7 @@ done:
}
int
-dls_devnet_setzid(dls_dl_handle_t ddh, zoneid_t new_zid)
+dls_devnet_setzid(dls_dl_handle_t ddh, zoneid_t new_zid, boolean_t transient)
{
dls_devnet_t *ddp;
int err;
@@ -1490,7 +1607,7 @@ dls_devnet_setzid(dls_dl_handle_t ddh, zoneid_t new_zid)
refheld = B_TRUE;
}
- if ((err = i_dls_devnet_setzid(ddh, new_zid, B_TRUE)) != 0) {
+ if ((err = i_dls_devnet_setzid(ddh, new_zid, B_TRUE, transient)) != 0) {
if (refheld)
dls_devnet_rele(ddp);
return (err);
@@ -1507,7 +1624,7 @@ dls_devnet_setzid(dls_dl_handle_t ddh, zoneid_t new_zid)
if (old_zid != GLOBAL_ZONEID)
dls_devnet_stat_destroy(ddh, old_zid);
if (new_zid != GLOBAL_ZONEID)
- dls_devnet_stat_create(ddh, new_zid);
+ dls_devnet_stat_create(ddh, new_zid, new_zid);
return (0);
}
diff --git a/usr/src/uts/common/io/dls/dls_stat.c b/usr/src/uts/common/io/dls/dls_stat.c
index 51e4be7260..82dceff278 100644
--- a/usr/src/uts/common/io/dls/dls_stat.c
+++ b/usr/src/uts/common/io/dls/dls_stat.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
/*
@@ -30,30 +31,33 @@
#include <sys/dld_impl.h>
#include <sys/mac_ether.h>
-static mac_stat_info_t i_dls_si[] = {
- { MAC_STAT_IFSPEED, "ifspeed", KSTAT_DATA_UINT64, 0 },
- { MAC_STAT_MULTIRCV, "multircv", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_BRDCSTRCV, "brdcstrcv", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_MULTIXMT, "multixmt", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_BRDCSTXMT, "brdcstxmt", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_NORCVBUF, "norcvbuf", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_IERRORS, "ierrors", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_NOXMTBUF, "noxmtbuf", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_OERRORS, "oerrors", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_COLLISIONS, "collisions", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_RBYTES, "rbytes", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_IPACKETS, "ipackets", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_OBYTES, "obytes", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_OPACKETS, "opackets", KSTAT_DATA_UINT32, 0 },
- { MAC_STAT_RBYTES, "rbytes64", KSTAT_DATA_UINT64, 0 },
- { MAC_STAT_IPACKETS, "ipackets64", KSTAT_DATA_UINT64, 0 },
- { MAC_STAT_OBYTES, "obytes64", KSTAT_DATA_UINT64, 0 },
- { MAC_STAT_OPACKETS, "opackets64", KSTAT_DATA_UINT64, 0 },
- { MAC_STAT_LINK_STATE, "link_state", KSTAT_DATA_UINT32,
- (uint64_t)LINK_STATE_UNKNOWN}
-};
-
-#define STAT_INFO_COUNT (sizeof (i_dls_si) / sizeof (i_dls_si[0]))
+/*
+ * structure for link kstats
+ */
+typedef struct {
+ kstat_named_t dk_ifspeed;
+ kstat_named_t dk_multircv;
+ kstat_named_t dk_brdcstrcv;
+ kstat_named_t dk_multixmt;
+ kstat_named_t dk_brdcstxmt;
+ kstat_named_t dk_norcvbuf;
+ kstat_named_t dk_ierrors;
+ kstat_named_t dk_noxmtbuf;
+ kstat_named_t dk_oerrors;
+ kstat_named_t dk_collisions;
+ kstat_named_t dk_rbytes;
+ kstat_named_t dk_ipackets;
+ kstat_named_t dk_obytes;
+ kstat_named_t dk_opackets;
+ kstat_named_t dk_rbytes64;
+ kstat_named_t dk_ipackets64;
+ kstat_named_t dk_obytes64;
+ kstat_named_t dk_opackets64;
+ kstat_named_t dk_link_state;
+ kstat_named_t dk_link_duplex;
+ kstat_named_t dk_unknowns;
+ kstat_named_t dk_zonename;
+} dls_kstat_t;
/*
* Exported functions.
@@ -61,42 +65,54 @@ static mac_stat_info_t i_dls_si[] = {
int
dls_stat_update(kstat_t *ksp, dls_link_t *dlp, int rw)
{
- kstat_named_t *knp;
- uint_t i;
- uint64_t val;
+ dls_kstat_t *dkp = ksp->ks_data;
if (rw != KSTAT_READ)
return (EACCES);
- knp = (kstat_named_t *)ksp->ks_data;
- for (i = 0; i < STAT_INFO_COUNT; i++) {
- val = mac_stat_get(dlp->dl_mh, i_dls_si[i].msi_stat);
-
- switch (i_dls_si[i].msi_type) {
- case KSTAT_DATA_UINT64:
- knp->value.ui64 = val;
- break;
- case KSTAT_DATA_UINT32:
- knp->value.ui32 = (uint32_t)val;
- break;
- default:
- ASSERT(B_FALSE);
- }
-
- knp++;
- }
+ dkp->dk_ifspeed.value.ui64 = mac_stat_get(dlp->dl_mh, MAC_STAT_IFSPEED);
+ dkp->dk_multircv.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_MULTIRCV);
+ dkp->dk_brdcstrcv.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_BRDCSTRCV);
+ dkp->dk_multixmt.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_MULTIXMT);
+ dkp->dk_brdcstxmt.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_BRDCSTXMT);
+ dkp->dk_norcvbuf.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_NORCVBUF);
+ dkp->dk_ierrors.value.ui32 = mac_stat_get(dlp->dl_mh, MAC_STAT_IERRORS);
+ dkp->dk_noxmtbuf.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_NOXMTBUF);
+ dkp->dk_oerrors.value.ui32 = mac_stat_get(dlp->dl_mh, MAC_STAT_OERRORS);
+ dkp->dk_collisions.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_COLLISIONS);
+ dkp->dk_rbytes.value.ui32 = mac_stat_get(dlp->dl_mh, MAC_STAT_RBYTES);
+ dkp->dk_ipackets.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_IPACKETS);
+ dkp->dk_obytes.value.ui32 = mac_stat_get(dlp->dl_mh, MAC_STAT_OBYTES);
+ dkp->dk_opackets.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_OPACKETS);
+ dkp->dk_rbytes64.value.ui64 = mac_stat_get(dlp->dl_mh, MAC_STAT_RBYTES);
+ dkp->dk_ipackets64.value.ui64 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_IPACKETS);
+ dkp->dk_obytes64.value.ui64 = mac_stat_get(dlp->dl_mh, MAC_STAT_OBYTES);
+ dkp->dk_opackets64.value.ui64 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_OPACKETS);
+ dkp->dk_link_state.value.ui32 = mac_stat_get(dlp->dl_mh,
+ MAC_STAT_LINK_STATE);
/*
* Ethernet specific kstat "link_duplex"
*/
if (dlp->dl_mip->mi_nativemedia != DL_ETHER) {
- knp->value.ui32 = LINK_DUPLEX_UNKNOWN;
+ dkp->dk_link_duplex.value.ui32 = LINK_DUPLEX_UNKNOWN;
} else {
- val = mac_stat_get(dlp->dl_mh, ETHER_STAT_LINK_DUPLEX);
- knp->value.ui32 = (uint32_t)val;
+ dkp->dk_link_duplex.value.ui32 =
+ (uint32_t)mac_stat_get(dlp->dl_mh, ETHER_STAT_LINK_DUPLEX);
}
- knp++;
- knp->value.ui32 = dlp->dl_unknowns;
+
+ dkp->dk_unknowns.value.ui32 = dlp->dl_unknowns;
return (0);
}
@@ -104,30 +120,66 @@ dls_stat_update(kstat_t *ksp, dls_link_t *dlp, int rw)
int
dls_stat_create(const char *module, int instance, const char *name,
zoneid_t zoneid, int (*update)(struct kstat *, int), void *private,
- kstat_t **kspp)
+ kstat_t **kspp, zoneid_t newzoneid)
{
kstat_t *ksp;
- kstat_named_t *knp;
- uint_t i;
+ zone_t *zone;
+ dls_kstat_t *dkp;
if ((ksp = kstat_create_zone(module, instance, name, "net",
- KSTAT_TYPE_NAMED, STAT_INFO_COUNT + 2, 0, zoneid)) == NULL) {
+ KSTAT_TYPE_NAMED, sizeof (dls_kstat_t) / sizeof (kstat_named_t),
+ KSTAT_FLAG_VIRTUAL, zoneid)) == NULL) {
return (EINVAL);
}
ksp->ks_update = update;
ksp->ks_private = private;
+ dkp = ksp->ks_data = kmem_zalloc(sizeof (dls_kstat_t), KM_SLEEP);
+ if ((zone = zone_find_by_id(newzoneid)) != NULL) {
+ ksp->ks_data_size += strlen(zone->zone_name) + 1;
+ }
- knp = (kstat_named_t *)ksp->ks_data;
- for (i = 0; i < STAT_INFO_COUNT; i++) {
- kstat_named_init(knp, i_dls_si[i].msi_name,
- i_dls_si[i].msi_type);
- knp++;
+ kstat_named_init(&dkp->dk_ifspeed, "ifspeed", KSTAT_DATA_UINT64);
+ kstat_named_init(&dkp->dk_multircv, "multircv", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_brdcstrcv, "brdcstrcv", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_multixmt, "multixmt", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_brdcstxmt, "brdcstxmt", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_norcvbuf, "norcvbuf", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_ierrors, "ierrors", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_noxmtbuf, "noxmtbuf", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_oerrors, "oerrors", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_collisions, "collisions", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_rbytes, "rbytes", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_ipackets, "ipackets", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_obytes, "obytes", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_opackets, "opackets", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_rbytes64, "rbytes64", KSTAT_DATA_UINT64);
+ kstat_named_init(&dkp->dk_ipackets64, "ipackets64", KSTAT_DATA_UINT64);
+ kstat_named_init(&dkp->dk_obytes64, "obytes64", KSTAT_DATA_UINT64);
+ kstat_named_init(&dkp->dk_opackets64, "opackets64", KSTAT_DATA_UINT64);
+ kstat_named_init(&dkp->dk_link_state, "link_state", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_link_duplex, "link_duplex",
+ KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_unknowns, "unknowns", KSTAT_DATA_UINT32);
+ kstat_named_init(&dkp->dk_zonename, "zonename", KSTAT_DATA_STRING);
+
+ if (zone != NULL) {
+ kstat_named_setstr(&dkp->dk_zonename, zone->zone_name);
+ zone_rele(zone);
}
- kstat_named_init(knp++, "link_duplex", KSTAT_DATA_UINT32);
- kstat_named_init(knp, "unknowns", KSTAT_DATA_UINT32);
kstat_install(ksp);
*kspp = ksp;
return (0);
}
+
+void
+dls_stat_delete(kstat_t *ksp)
+{
+ void *data;
+ if (ksp != NULL) {
+ data = ksp->ks_data;
+ kstat_delete(ksp);
+ kmem_free(data, sizeof (dls_kstat_t));
+ }
+}
diff --git a/usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE b/usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE
new file mode 100644
index 0000000000..00aefb6f51
--- /dev/null
+++ b/usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE
@@ -0,0 +1,32 @@
+/*
+ * MegaRAID device driver for SAS2.0 controllers
+ * Copyright (c) 2009, LSI Logic Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the author nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
diff --git a/usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE.descrip b/usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE.descrip
new file mode 100644
index 0000000000..ac6d2d1b15
--- /dev/null
+++ b/usr/src/uts/common/io/dr_sas/THIRDPARTYLICENSE.descrip
@@ -0,0 +1 @@
+DR_SAS DRIVER
diff --git a/usr/src/uts/common/io/dr_sas/dr_sas.c b/usr/src/uts/common/io/dr_sas/dr_sas.c
new file mode 100644
index 0000000000..5b1dc82938
--- /dev/null
+++ b/usr/src/uts/common/io/dr_sas/dr_sas.c
@@ -0,0 +1,5506 @@
+/*
+ * dr_sas.c: source for dr_sas driver
+ *
+ * MegaRAID device driver for SAS2.0 controllers
+ * Copyright (c) 2008-2009, LSI Logic Corporation.
+ * All rights reserved.
+ *
+ * Version:
+ * Author:
+ * Arun Chandrashekhar
+ * Manju R
+ * Rajesh Prabhakaran
+ * Seokmann Ju
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the author nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/errno.h>
+#include <sys/open.h>
+#include <sys/cred.h>
+#include <sys/modctl.h>
+#include <sys/conf.h>
+#include <sys/devops.h>
+#include <sys/cmn_err.h>
+#include <sys/kmem.h>
+#include <sys/stat.h>
+#include <sys/mkdev.h>
+#include <sys/pci.h>
+#include <sys/scsi/scsi.h>
+#include <sys/ddi.h>
+#include <sys/sunddi.h>
+#include <sys/atomic.h>
+#include <sys/signal.h>
+#include <sys/fs/dv_node.h> /* devfs_clean */
+
+#include "dr_sas.h"
+
+/*
+ * FMA header files
+ */
+#include <sys/ddifm.h>
+#include <sys/fm/protocol.h>
+#include <sys/fm/util.h>
+#include <sys/fm/io/ddi.h>
+
+/*
+ * Local static data
+ */
+static void *drsas_state = NULL;
+static int debug_level_g = CL_NONE;
+
+#pragma weak scsi_hba_open
+#pragma weak scsi_hba_close
+#pragma weak scsi_hba_ioctl
+
+static ddi_dma_attr_t drsas_generic_dma_attr = {
+ DMA_ATTR_V0, /* dma_attr_version */
+ 0, /* low DMA address range */
+ 0xFFFFFFFFU, /* high DMA address range */
+ 0xFFFFFFFFU, /* DMA counter register */
+ 8, /* DMA address alignment */
+ 0x07, /* DMA burstsizes */
+ 1, /* min DMA size */
+ 0xFFFFFFFFU, /* max DMA size */
+ 0xFFFFFFFFU, /* segment boundary */
+ DRSAS_MAX_SGE_CNT, /* dma_attr_sglen */
+ 512, /* granularity of device */
+ 0 /* bus specific DMA flags */
+};
+
+int32_t drsas_max_cap_maxxfer = 0x1000000;
+
+/*
+ * cb_ops contains base level routines
+ */
+static struct cb_ops drsas_cb_ops = {
+ drsas_open, /* open */
+ drsas_close, /* close */
+ nodev, /* strategy */
+ nodev, /* print */
+ nodev, /* dump */
+ nodev, /* read */
+ nodev, /* write */
+ drsas_ioctl, /* ioctl */
+ nodev, /* devmap */
+ nodev, /* mmap */
+ nodev, /* segmap */
+ nochpoll, /* poll */
+ nodev, /* cb_prop_op */
+ 0, /* streamtab */
+ D_NEW | D_HOTPLUG, /* cb_flag */
+ CB_REV, /* cb_rev */
+ nodev, /* cb_aread */
+ nodev /* cb_awrite */
+};
+
+/*
+ * dev_ops contains configuration routines
+ */
+static struct dev_ops drsas_ops = {
+ DEVO_REV, /* rev, */
+ 0, /* refcnt */
+ drsas_getinfo, /* getinfo */
+ nulldev, /* identify */
+ nulldev, /* probe */
+ drsas_attach, /* attach */
+ drsas_detach, /* detach */
+ drsas_reset, /* reset */
+ &drsas_cb_ops, /* char/block ops */
+ NULL, /* bus ops */
+ NULL, /* power */
+ ddi_quiesce_not_supported, /* quiesce */
+};
+
+char _depends_on[] = "misc/scsi";
+
+static struct modldrv modldrv = {
+ &mod_driverops, /* module type - driver */
+ DRSAS_VERSION,
+ &drsas_ops, /* driver ops */
+};
+
+static struct modlinkage modlinkage = {
+ MODREV_1, /* ml_rev - must be MODREV_1 */
+ &modldrv, /* ml_linkage */
+ NULL /* end of driver linkage */
+};
+
+static struct ddi_device_acc_attr endian_attr = {
+ DDI_DEVICE_ATTR_V0,
+ DDI_STRUCTURE_LE_ACC,
+ DDI_STRICTORDER_ACC
+};
+
+
+/*
+ * ************************************************************************** *
+ * *
+ * common entry points - for loadable kernel modules *
+ * *
+ * ************************************************************************** *
+ */
+
+int
+_init(void)
+{
+ int ret;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ ret = ddi_soft_state_init(&drsas_state,
+ sizeof (struct drsas_instance), 0);
+
+ if (ret != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas: could not init state"));
+ return (ret);
+ }
+
+ if ((ret = scsi_hba_init(&modlinkage)) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas: could not init scsi hba"));
+ ddi_soft_state_fini(&drsas_state);
+ return (ret);
+ }
+
+ ret = mod_install(&modlinkage);
+
+ if (ret != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas: mod_install failed"));
+ scsi_hba_fini(&modlinkage);
+ ddi_soft_state_fini(&drsas_state);
+ }
+
+ return (ret);
+}
+
+int
+_info(struct modinfo *modinfop)
+{
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ return (mod_info(&modlinkage, modinfop));
+}
+
+int
+_fini(void)
+{
+ int ret;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ if ((ret = mod_remove(&modlinkage)) != DDI_SUCCESS)
+ return (ret);
+
+ scsi_hba_fini(&modlinkage);
+
+ ddi_soft_state_fini(&drsas_state);
+
+ return (ret);
+}
+
+
+/*
+ * ************************************************************************** *
+ * *
+ * common entry points - for autoconfiguration *
+ * *
+ * ************************************************************************** *
+ */
+
+static int
+drsas_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
+{
+ int instance_no;
+ int nregs;
+ uint8_t added_isr_f = 0;
+ uint8_t added_soft_isr_f = 0;
+ uint8_t create_devctl_node_f = 0;
+ uint8_t create_scsi_node_f = 0;
+ uint8_t create_ioc_node_f = 0;
+ uint8_t tran_alloc_f = 0;
+ uint8_t irq;
+ uint16_t vendor_id;
+ uint16_t device_id;
+ uint16_t subsysvid;
+ uint16_t subsysid;
+ uint16_t command;
+ off_t reglength = 0;
+ int intr_types = 0;
+ char *data;
+ int msi_enable = 0;
+
+ scsi_hba_tran_t *tran;
+ ddi_dma_attr_t tran_dma_attr;
+ struct drsas_instance *instance;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* CONSTCOND */
+ ASSERT(NO_COMPETING_THREADS);
+
+ instance_no = ddi_get_instance(dip);
+
+ /*
+ * check to see whether this device is in a DMA-capable slot.
+ */
+ if (ddi_slaveonly(dip) == DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas%d: Device in slave-only slot, unused",
+ instance_no));
+ return (DDI_FAILURE);
+ }
+
+ switch (cmd) {
+ case DDI_ATTACH:
+ con_log(CL_DLEVEL1, (CE_NOTE, "dr_sas: DDI_ATTACH"));
+ /* allocate the soft state for the instance */
+ if (ddi_soft_state_zalloc(drsas_state, instance_no)
+ != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas%d: Failed to allocate soft state",
+ instance_no));
+
+ return (DDI_FAILURE);
+ }
+
+ instance = (struct drsas_instance *)ddi_get_soft_state
+ (drsas_state, instance_no);
+
+ if (instance == NULL) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas%d: Bad soft state", instance_no));
+
+ ddi_soft_state_free(drsas_state, instance_no);
+
+ return (DDI_FAILURE);
+ }
+
+ bzero((caddr_t)instance,
+ sizeof (struct drsas_instance));
+
+ instance->func_ptr = kmem_zalloc(
+ sizeof (struct drsas_func_ptr), KM_SLEEP);
+ ASSERT(instance->func_ptr);
+
+ /* Setup the PCI configuration space handles */
+ if (pci_config_setup(dip, &instance->pci_handle) !=
+ DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas%d: pci config setup failed ",
+ instance_no));
+
+ kmem_free(instance->func_ptr,
+ sizeof (struct drsas_func_ptr));
+ ddi_soft_state_free(drsas_state, instance_no);
+
+ return (DDI_FAILURE);
+ }
+
+ if (ddi_dev_nregs(dip, &nregs) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: failed to get registers."));
+
+ pci_config_teardown(&instance->pci_handle);
+ kmem_free(instance->func_ptr,
+ sizeof (struct drsas_func_ptr));
+ ddi_soft_state_free(drsas_state, instance_no);
+
+ return (DDI_FAILURE);
+ }
+
+ vendor_id = pci_config_get16(instance->pci_handle,
+ PCI_CONF_VENID);
+ device_id = pci_config_get16(instance->pci_handle,
+ PCI_CONF_DEVID);
+
+ subsysvid = pci_config_get16(instance->pci_handle,
+ PCI_CONF_SUBVENID);
+ subsysid = pci_config_get16(instance->pci_handle,
+ PCI_CONF_SUBSYSID);
+
+ pci_config_put16(instance->pci_handle, PCI_CONF_COMM,
+ (pci_config_get16(instance->pci_handle,
+ PCI_CONF_COMM) | PCI_COMM_ME));
+ irq = pci_config_get8(instance->pci_handle,
+ PCI_CONF_ILINE);
+
+ con_log(CL_DLEVEL1, (CE_CONT, "dr_sas%d: "
+ "0x%x:0x%x 0x%x:0x%x, irq:%d drv-ver:%s",
+ instance_no, vendor_id, device_id, subsysvid,
+ subsysid, irq, DRSAS_VERSION));
+
+ /* enable bus-mastering */
+ command = pci_config_get16(instance->pci_handle,
+ PCI_CONF_COMM);
+
+ if (!(command & PCI_COMM_ME)) {
+ command |= PCI_COMM_ME;
+
+ pci_config_put16(instance->pci_handle,
+ PCI_CONF_COMM, command);
+
+ con_log(CL_ANN, (CE_CONT, "dr_sas%d: "
+ "enable bus-mastering", instance_no));
+ } else {
+ con_log(CL_DLEVEL1, (CE_CONT, "dr_sas%d: "
+ "bus-mastering already set", instance_no));
+ }
+
+ /* initialize function pointers */
+ if ((device_id == PCI_DEVICE_ID_LSI_2108VDE) ||
+ (device_id == PCI_DEVICE_ID_LSI_2108V)) {
+ con_log(CL_DLEVEL1, (CE_CONT, "dr_sas%d: "
+ "2108V/DE detected", instance_no));
+ instance->func_ptr->read_fw_status_reg =
+ read_fw_status_reg_ppc;
+ instance->func_ptr->issue_cmd = issue_cmd_ppc;
+ instance->func_ptr->issue_cmd_in_sync_mode =
+ issue_cmd_in_sync_mode_ppc;
+ instance->func_ptr->issue_cmd_in_poll_mode =
+ issue_cmd_in_poll_mode_ppc;
+ instance->func_ptr->enable_intr =
+ enable_intr_ppc;
+ instance->func_ptr->disable_intr =
+ disable_intr_ppc;
+ instance->func_ptr->intr_ack = intr_ack_ppc;
+ } else {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: Invalid device detected"));
+
+ pci_config_teardown(&instance->pci_handle);
+ kmem_free(instance->func_ptr,
+ sizeof (struct drsas_func_ptr));
+ ddi_soft_state_free(drsas_state, instance_no);
+
+ return (DDI_FAILURE);
+ }
+
+ instance->baseaddress = pci_config_get32(
+ instance->pci_handle, PCI_CONF_BASE0);
+ instance->baseaddress &= 0x0fffc;
+
+ instance->dip = dip;
+ instance->vendor_id = vendor_id;
+ instance->device_id = device_id;
+ instance->subsysvid = subsysvid;
+ instance->subsysid = subsysid;
+ instance->instance = instance_no;
+
+ /* Initialize FMA */
+ instance->fm_capabilities = ddi_prop_get_int(
+ DDI_DEV_T_ANY, instance->dip, DDI_PROP_DONTPASS,
+ "fm-capable", DDI_FM_EREPORT_CAPABLE |
+ DDI_FM_ACCCHK_CAPABLE | DDI_FM_DMACHK_CAPABLE
+ | DDI_FM_ERRCB_CAPABLE);
+
+ drsas_fm_init(instance);
+
+ /* Initialize Interrupts */
+ if ((ddi_dev_regsize(instance->dip,
+ REGISTER_SET_IO_2108, &reglength) != DDI_SUCCESS) ||
+ reglength < MINIMUM_MFI_MEM_SZ) {
+ return (DDI_FAILURE);
+ }
+ if (reglength > DEFAULT_MFI_MEM_SZ) {
+ reglength = DEFAULT_MFI_MEM_SZ;
+ con_log(CL_DLEVEL1, (CE_NOTE,
+ "dr_sas: register length to map is "
+ "0x%lx bytes", reglength));
+ }
+ if (ddi_regs_map_setup(instance->dip,
+ REGISTER_SET_IO_2108, &instance->regmap, 0,
+ reglength, &endian_attr, &instance->regmap_handle)
+ != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: couldn't map control registers"));
+ goto fail_attach;
+ }
+
+ /*
+ * Disable Interrupt Now.
+ * Setup Software interrupt
+ */
+ instance->func_ptr->disable_intr(instance);
+
+ msi_enable = 0;
+ if (ddi_prop_lookup_string(DDI_DEV_T_ANY, dip, 0,
+ "drsas-enable-msi", &data) == DDI_SUCCESS) {
+ if (strncmp(data, "yes", 3) == 0) {
+ msi_enable = 1;
+ con_log(CL_ANN, (CE_WARN,
+ "msi_enable = %d ENABLED",
+ msi_enable));
+ }
+ ddi_prop_free(data);
+ }
+
+ con_log(CL_DLEVEL1, (CE_WARN, "msi_enable = %d",
+ msi_enable));
+
+ /* Check for all supported interrupt types */
+ if (ddi_intr_get_supported_types(
+ dip, &intr_types) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "ddi_intr_get_supported_types() failed"));
+ goto fail_attach;
+ }
+
+ con_log(CL_DLEVEL1, (CE_NOTE,
+ "ddi_intr_get_supported_types() ret: 0x%x",
+ intr_types));
+
+ /* Initialize and Setup Interrupt handler */
+ if (msi_enable && (intr_types & DDI_INTR_TYPE_MSIX)) {
+ if (drsas_add_intrs(instance,
+ DDI_INTR_TYPE_MSIX) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "MSIX interrupt query failed"));
+ goto fail_attach;
+ }
+ instance->intr_type = DDI_INTR_TYPE_MSIX;
+ } else if (msi_enable && (intr_types &
+ DDI_INTR_TYPE_MSI)) {
+ if (drsas_add_intrs(instance,
+ DDI_INTR_TYPE_MSI) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "MSI interrupt query failed"));
+ goto fail_attach;
+ }
+ instance->intr_type = DDI_INTR_TYPE_MSI;
+ } else if (intr_types & DDI_INTR_TYPE_FIXED) {
+ msi_enable = 0;
+ if (drsas_add_intrs(instance,
+ DDI_INTR_TYPE_FIXED) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "FIXED interrupt query failed"));
+ goto fail_attach;
+ }
+ instance->intr_type = DDI_INTR_TYPE_FIXED;
+ } else {
+ con_log(CL_ANN, (CE_WARN, "Device cannot "
+ "suppport either FIXED or MSI/X "
+ "interrupts"));
+ goto fail_attach;
+ }
+
+ added_isr_f = 1;
+
+ /* setup the mfi based low level driver */
+ if (init_mfi(instance) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas: "
+ "could not initialize the low level driver"));
+
+ goto fail_attach;
+ }
+
+ /* Initialize all Mutex */
+ INIT_LIST_HEAD(&instance->completed_pool_list);
+ mutex_init(&instance->completed_pool_mtx,
+ "completed_pool_mtx", MUTEX_DRIVER,
+ DDI_INTR_PRI(instance->intr_pri));
+
+ mutex_init(&instance->int_cmd_mtx, "int_cmd_mtx",
+ MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
+ cv_init(&instance->int_cmd_cv, NULL, CV_DRIVER, NULL);
+
+ mutex_init(&instance->cmd_pool_mtx, "cmd_pool_mtx",
+ MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
+
+ /* Register our soft-isr for highlevel interrupts. */
+ instance->isr_level = instance->intr_pri;
+ if (instance->isr_level == HIGH_LEVEL_INTR) {
+ if (ddi_add_softintr(dip, DDI_SOFTINT_HIGH,
+ &instance->soft_intr_id, NULL, NULL,
+ drsas_softintr, (caddr_t)instance) !=
+ DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ " Software ISR did not register"));
+
+ goto fail_attach;
+ }
+
+ added_soft_isr_f = 1;
+ }
+
+ /* Allocate a transport structure */
+ tran = scsi_hba_tran_alloc(dip, SCSI_HBA_CANSLEEP);
+
+ if (tran == NULL) {
+ con_log(CL_ANN, (CE_WARN,
+ "scsi_hba_tran_alloc failed"));
+ goto fail_attach;
+ }
+
+ tran_alloc_f = 1;
+
+ instance->tran = tran;
+
+ tran->tran_hba_private = instance;
+ tran->tran_tgt_init = drsas_tran_tgt_init;
+ tran->tran_tgt_probe = scsi_hba_probe;
+ tran->tran_tgt_free = drsas_tran_tgt_free;
+ tran->tran_init_pkt = drsas_tran_init_pkt;
+ tran->tran_start = drsas_tran_start;
+ tran->tran_abort = drsas_tran_abort;
+ tran->tran_reset = drsas_tran_reset;
+ tran->tran_getcap = drsas_tran_getcap;
+ tran->tran_setcap = drsas_tran_setcap;
+ tran->tran_destroy_pkt = drsas_tran_destroy_pkt;
+ tran->tran_dmafree = drsas_tran_dmafree;
+ tran->tran_sync_pkt = drsas_tran_sync_pkt;
+ tran->tran_bus_config = drsas_tran_bus_config;
+
+ tran_dma_attr = drsas_generic_dma_attr;
+ tran_dma_attr.dma_attr_sgllen = instance->max_num_sge;
+
+ /* Attach this instance of the hba */
+ if (scsi_hba_attach_setup(dip, &tran_dma_attr, tran, 0)
+ != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "scsi_hba_attach failed"));
+
+ goto fail_attach;
+ }
+
+ /* create devctl node for cfgadm command */
+ if (ddi_create_minor_node(dip, "devctl",
+ S_IFCHR, INST2DEVCTL(instance_no),
+ DDI_NT_SCSI_NEXUS, 0) == DDI_FAILURE) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: failed to create devctl node."));
+
+ goto fail_attach;
+ }
+
+ create_devctl_node_f = 1;
+
+ /* create scsi node for cfgadm command */
+ if (ddi_create_minor_node(dip, "scsi", S_IFCHR,
+ INST2SCSI(instance_no),
+ DDI_NT_SCSI_ATTACHMENT_POINT, 0) ==
+ DDI_FAILURE) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: failed to create scsi node."));
+
+ goto fail_attach;
+ }
+
+ create_scsi_node_f = 1;
+
+ (void) sprintf(instance->iocnode, "%d:lsirdctl",
+ instance_no);
+
+ /*
+ * Create a node for applications
+ * for issuing ioctl to the driver.
+ */
+ if (ddi_create_minor_node(dip, instance->iocnode,
+ S_IFCHR, INST2LSIRDCTL(instance_no),
+ DDI_PSEUDO, 0) == DDI_FAILURE) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: failed to create ioctl node."));
+
+ goto fail_attach;
+ }
+
+ create_ioc_node_f = 1;
+
+ /* Create a taskq to handle dr events */
+ if ((instance->taskq = ddi_taskq_create(dip,
+ "drsas_dr_taskq", 1,
+ TASKQ_DEFAULTPRI, 0)) == NULL) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: failed to create taskq "));
+ instance->taskq = NULL;
+ goto fail_attach;
+ }
+
+ /* enable interrupt */
+ instance->func_ptr->enable_intr(instance);
+
+ /* initiate AEN */
+ if (start_mfi_aen(instance)) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: failed to initiate AEN."));
+ goto fail_initiate_aen;
+ }
+
+ con_log(CL_DLEVEL1, (CE_NOTE,
+ "AEN started for instance %d.", instance_no));
+
+ /* Finally! We are on the air. */
+ ddi_report_dev(dip);
+
+ if (drsas_check_acc_handle(instance->regmap_handle) !=
+ DDI_SUCCESS) {
+ goto fail_attach;
+ }
+ if (drsas_check_acc_handle(instance->pci_handle) !=
+ DDI_SUCCESS) {
+ goto fail_attach;
+ }
+ instance->dr_ld_list =
+ kmem_zalloc(MRDRV_MAX_LD * sizeof (struct drsas_ld),
+ KM_SLEEP);
+ break;
+ case DDI_PM_RESUME:
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: DDI_PM_RESUME"));
+ break;
+ case DDI_RESUME:
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: DDI_RESUME"));
+ break;
+ default:
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: invalid attach cmd=%x", cmd));
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+
+fail_initiate_aen:
+fail_attach:
+ if (create_devctl_node_f) {
+ ddi_remove_minor_node(dip, "devctl");
+ }
+
+ if (create_scsi_node_f) {
+ ddi_remove_minor_node(dip, "scsi");
+ }
+
+ if (create_ioc_node_f) {
+ ddi_remove_minor_node(dip, instance->iocnode);
+ }
+
+ if (tran_alloc_f) {
+ scsi_hba_tran_free(tran);
+ }
+
+
+ if (added_soft_isr_f) {
+ ddi_remove_softintr(instance->soft_intr_id);
+ }
+
+ if (added_isr_f) {
+ drsas_rem_intrs(instance);
+ }
+
+ if (instance && instance->taskq) {
+ ddi_taskq_destroy(instance->taskq);
+ }
+
+ drsas_fm_ereport(instance, DDI_FM_DEVICE_NO_RESPONSE);
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
+
+ drsas_fm_fini(instance);
+
+ pci_config_teardown(&instance->pci_handle);
+
+ ddi_soft_state_free(drsas_state, instance_no);
+
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: return failure from drsas_attach"));
+
+ return (DDI_FAILURE);
+}
+
+/*ARGSUSED*/
+static int
+drsas_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **resultp)
+{
+ int rval;
+ int drsas_minor = getminor((dev_t)arg);
+
+ struct drsas_instance *instance;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ switch (cmd) {
+ case DDI_INFO_DEVT2DEVINFO:
+ instance = (struct drsas_instance *)
+ ddi_get_soft_state(drsas_state,
+ MINOR2INST(drsas_minor));
+
+ if (instance == NULL) {
+ *resultp = NULL;
+ rval = DDI_FAILURE;
+ } else {
+ *resultp = instance->dip;
+ rval = DDI_SUCCESS;
+ }
+ break;
+ case DDI_INFO_DEVT2INSTANCE:
+ *resultp = (void *)instance;
+ rval = DDI_SUCCESS;
+ break;
+ default:
+ *resultp = NULL;
+ rval = DDI_FAILURE;
+ }
+
+ return (rval);
+}
+
+static int
+drsas_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
+{
+ int instance_no;
+
+ struct drsas_instance *instance;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* CONSTCOND */
+ ASSERT(NO_COMPETING_THREADS);
+
+ instance_no = ddi_get_instance(dip);
+
+ instance = (struct drsas_instance *)ddi_get_soft_state(drsas_state,
+ instance_no);
+
+ if (!instance) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas:%d could not get instance in detach",
+ instance_no));
+
+ return (DDI_FAILURE);
+ }
+
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas%d: detaching device 0x%4x:0x%4x:0x%4x:0x%4x",
+ instance_no, instance->vendor_id, instance->device_id,
+ instance->subsysvid, instance->subsysid));
+
+ switch (cmd) {
+ case DDI_DETACH:
+ con_log(CL_ANN, (CE_NOTE,
+ "drsas_detach: DDI_DETACH"));
+
+ if (scsi_hba_detach(dip) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas:%d failed to detach",
+ instance_no));
+
+ return (DDI_FAILURE);
+ }
+
+ scsi_hba_tran_free(instance->tran);
+
+ flush_cache(instance);
+
+ if (abort_aen_cmd(instance, instance->aen_cmd)) {
+ con_log(CL_ANN, (CE_WARN, "drsas_detach: "
+ "failed to abort prevous AEN command"));
+
+ return (DDI_FAILURE);
+ }
+
+ instance->func_ptr->disable_intr(instance);
+
+ if (instance->isr_level == HIGH_LEVEL_INTR) {
+ ddi_remove_softintr(instance->soft_intr_id);
+ }
+
+ drsas_rem_intrs(instance);
+
+ if (instance->taskq) {
+ ddi_taskq_destroy(instance->taskq);
+ }
+ kmem_free(instance->dr_ld_list, MRDRV_MAX_LD
+ * sizeof (struct drsas_ld));
+ free_space_for_mfi(instance);
+
+ drsas_fm_fini(instance);
+
+ pci_config_teardown(&instance->pci_handle);
+
+ kmem_free(instance->func_ptr,
+ sizeof (struct drsas_func_ptr));
+
+ ddi_soft_state_free(drsas_state, instance_no);
+ break;
+ case DDI_PM_SUSPEND:
+ con_log(CL_ANN, (CE_NOTE,
+ "drsas_detach: DDI_PM_SUSPEND"));
+
+ break;
+ case DDI_SUSPEND:
+ con_log(CL_ANN, (CE_NOTE,
+ "drsas_detach: DDI_SUSPEND"));
+
+ break;
+ default:
+ con_log(CL_ANN, (CE_WARN,
+ "invalid detach command:0x%x", cmd));
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * ************************************************************************** *
+ * *
+ * common entry points - for character driver types *
+ * *
+ * ************************************************************************** *
+ */
+static int
+drsas_open(dev_t *dev, int openflags, int otyp, cred_t *credp)
+{
+ int rval = 0;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* Check root permissions */
+ if (drv_priv(credp) != 0) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: Non-root ioctl access denied!"));
+ return (EPERM);
+ }
+
+ /* Verify we are being opened as a character device */
+ if (otyp != OTYP_CHR) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: ioctl node must be a char node"));
+ return (EINVAL);
+ }
+
+ if (ddi_get_soft_state(drsas_state, MINOR2INST(getminor(*dev)))
+ == NULL) {
+ return (ENXIO);
+ }
+
+ if (scsi_hba_open) {
+ rval = scsi_hba_open(dev, openflags, otyp, credp);
+ }
+
+ return (rval);
+}
+
+static int
+drsas_close(dev_t dev, int openflags, int otyp, cred_t *credp)
+{
+ int rval = 0;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* no need for locks! */
+
+ if (scsi_hba_close) {
+ rval = scsi_hba_close(dev, openflags, otyp, credp);
+ }
+
+ return (rval);
+}
+
+static int
+drsas_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
+ int *rvalp)
+{
+ int rval = 0;
+
+ struct drsas_instance *instance;
+ struct drsas_ioctl *ioctl;
+ struct drsas_aen aen;
+ int i;
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ instance = ddi_get_soft_state(drsas_state, MINOR2INST(getminor(dev)));
+
+ if (instance == NULL) {
+ /* invalid minor number */
+ con_log(CL_ANN, (CE_WARN, "dr_sas: adapter not found."));
+ return (ENXIO);
+ }
+
+ ioctl = (struct drsas_ioctl *)kmem_zalloc(sizeof (struct drsas_ioctl),
+ KM_SLEEP);
+ ASSERT(ioctl);
+
+ switch ((uint_t)cmd) {
+ case DRSAS_IOCTL_FIRMWARE:
+ for (i = 0; i < sizeof (struct drsas_ioctl); i++) {
+ if (ddi_copyin((uint8_t *)arg+i,
+ (uint8_t *)ioctl+i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "drsas_ioctl "
+ "ERROR IOCTL copyin"));
+ kmem_free(ioctl,
+ sizeof (struct drsas_ioctl));
+ return (EFAULT);
+ }
+ }
+ if (ioctl->control_code == DRSAS_DRIVER_IOCTL_COMMON) {
+ rval = handle_drv_ioctl(instance, ioctl, mode);
+ } else {
+ rval = handle_mfi_ioctl(instance, ioctl, mode);
+ }
+ for (i = 0; i < sizeof (struct drsas_ioctl) - 1; i++) {
+ if (ddi_copyout((uint8_t *)ioctl+i,
+ (uint8_t *)arg+i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "drsas_ioctl: ddi_copyout "
+ "failed"));
+ rval = 1;
+ break;
+ }
+ }
+
+ break;
+ case DRSAS_IOCTL_AEN:
+ for (i = 0; i < sizeof (struct drsas_aen); i++) {
+ if (ddi_copyin((uint8_t *)arg+i,
+ (uint8_t *)&aen+i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "drsas_ioctl: "
+ "ERROR AEN copyin"));
+ kmem_free(ioctl,
+ sizeof (struct drsas_ioctl));
+ return (EFAULT);
+ }
+ }
+
+ rval = handle_mfi_aen(instance, &aen);
+ for (i = 0; i < sizeof (struct drsas_aen); i++) {
+ if (ddi_copyout((uint8_t *)&aen + i,
+ (uint8_t *)arg + i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "drsas_ioctl: "
+ "ddi_copyout failed"));
+ rval = 1;
+ break;
+ }
+ }
+
+ break;
+ default:
+ rval = scsi_hba_ioctl(dev, cmd, arg,
+ mode, credp, rvalp);
+
+ con_log(CL_DLEVEL1, (CE_NOTE, "drsas_ioctl: "
+ "scsi_hba_ioctl called, ret = %x.", rval));
+ }
+
+ kmem_free(ioctl, sizeof (struct drsas_ioctl));
+ return (rval);
+}
+
+/*
+ * ************************************************************************** *
+ * *
+ * common entry points - for block driver types *
+ * *
+ * ************************************************************************** *
+ */
+/*ARGSUSED*/
+static int
+drsas_reset(dev_info_t *dip, ddi_reset_cmd_t cmd)
+{
+ int instance_no;
+
+ struct drsas_instance *instance;
+
+ instance_no = ddi_get_instance(dip);
+ instance = (struct drsas_instance *)ddi_get_soft_state
+ (drsas_state, instance_no);
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ if (!instance) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas:%d could not get adapter "
+ "in reset", instance_no));
+ return (DDI_FAILURE);
+ }
+
+ instance->func_ptr->disable_intr(instance);
+
+ con_log(CL_ANN1, (CE_NOTE, "flushing cache for instance %d",
+ instance_no));
+
+ flush_cache(instance);
+
+ return (DDI_SUCCESS);
+}
+
+
+/*
+ * ************************************************************************** *
+ * *
+ * entry points (SCSI HBA) *
+ * *
+ * ************************************************************************** *
+ */
+/*ARGSUSED*/
+static int
+drsas_tran_tgt_init(dev_info_t *hba_dip, dev_info_t *tgt_dip,
+ scsi_hba_tran_t *tran, struct scsi_device *sd)
+{
+ struct drsas_instance *instance;
+ uint16_t tgt = sd->sd_address.a_target;
+ uint8_t lun = sd->sd_address.a_lun;
+
+ con_log(CL_ANN1, (CE_NOTE, "drsas_tgt_init target %d lun %d",
+ tgt, lun));
+
+ instance = ADDR2MR(&sd->sd_address);
+
+ if (ndi_dev_is_persistent_node(tgt_dip) == 0) {
+ (void) ndi_merge_node(tgt_dip, drsas_name_node);
+ ddi_set_name_addr(tgt_dip, NULL);
+
+ con_log(CL_ANN1, (CE_NOTE, "drsas_tgt_init in "
+ "ndi_dev_is_persistent_node DDI_FAILURE t = %d l = %d",
+ tgt, lun));
+ return (DDI_FAILURE);
+ }
+
+ con_log(CL_ANN1, (CE_NOTE, "drsas_tgt_init dev_dip %p tgt_dip %p",
+ (void *)instance->dr_ld_list[tgt].dip, (void *)tgt_dip));
+
+ if (tgt < MRDRV_MAX_LD && lun == 0) {
+ if (instance->dr_ld_list[tgt].dip == NULL &&
+ strcmp(ddi_driver_name(sd->sd_dev), "sd") == 0) {
+ instance->dr_ld_list[tgt].dip = tgt_dip;
+ instance->dr_ld_list[tgt].lun_type = DRSAS_LD_LUN;
+ }
+ }
+ return (DDI_SUCCESS);
+}
+
+/*ARGSUSED*/
+static void
+drsas_tran_tgt_free(dev_info_t *hba_dip, dev_info_t *tgt_dip,
+ scsi_hba_tran_t *hba_tran, struct scsi_device *sd)
+{
+ struct drsas_instance *instance;
+ int tgt = sd->sd_address.a_target;
+ int lun = sd->sd_address.a_lun;
+
+ instance = ADDR2MR(&sd->sd_address);
+
+ con_log(CL_ANN1, (CE_NOTE, "tgt_free t = %d l = %d", tgt, lun));
+
+ if (tgt < MRDRV_MAX_LD && lun == 0) {
+ if (instance->dr_ld_list[tgt].dip == tgt_dip) {
+ instance->dr_ld_list[tgt].dip = NULL;
+ }
+ }
+}
+
+static dev_info_t *
+drsas_find_child(struct drsas_instance *instance, uint16_t tgt, uint8_t lun)
+{
+ dev_info_t *child = NULL;
+ char addr[SCSI_MAXNAMELEN];
+ char tmp[MAXNAMELEN];
+
+ (void) sprintf(addr, "%x,%x", tgt, lun);
+ for (child = ddi_get_child(instance->dip); child;
+ child = ddi_get_next_sibling(child)) {
+
+ if (drsas_name_node(child, tmp, MAXNAMELEN) !=
+ DDI_SUCCESS) {
+ continue;
+ }
+
+ if (strcmp(addr, tmp) == 0) {
+ break;
+ }
+ }
+ con_log(CL_ANN1, (CE_NOTE, "drsas_find_child: return child = %p",
+ (void *)child));
+ return (child);
+}
+
+static int
+drsas_name_node(dev_info_t *dip, char *name, int len)
+{
+ int tgt, lun;
+
+ tgt = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
+ DDI_PROP_DONTPASS, "target", -1);
+ con_log(CL_ANN1, (CE_NOTE,
+ "drsas_name_node: dip %p tgt %d", (void *)dip, tgt));
+ if (tgt == -1) {
+ return (DDI_FAILURE);
+ }
+ lun = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
+ "lun", -1);
+ con_log(CL_ANN1,
+ (CE_NOTE, "drsas_name_node: tgt %d lun %d", tgt, lun));
+ if (lun == -1) {
+ return (DDI_FAILURE);
+ }
+ (void) snprintf(name, len, "%x,%x", tgt, lun);
+ return (DDI_SUCCESS);
+}
+
+static struct scsi_pkt *
+drsas_tran_init_pkt(struct scsi_address *ap, register struct scsi_pkt *pkt,
+ struct buf *bp, int cmdlen, int statuslen, int tgtlen,
+ int flags, int (*callback)(), caddr_t arg)
+{
+ struct scsa_cmd *acmd;
+ struct drsas_instance *instance;
+ struct scsi_pkt *new_pkt;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ instance = ADDR2MR(ap);
+
+ /* step #1 : pkt allocation */
+ if (pkt == NULL) {
+ pkt = scsi_hba_pkt_alloc(instance->dip, ap, cmdlen, statuslen,
+ tgtlen, sizeof (struct scsa_cmd), callback, arg);
+ if (pkt == NULL) {
+ return (NULL);
+ }
+
+ acmd = PKT2CMD(pkt);
+
+ /*
+ * Initialize the new pkt - we redundantly initialize
+ * all the fields for illustrative purposes.
+ */
+ acmd->cmd_pkt = pkt;
+ acmd->cmd_flags = 0;
+ acmd->cmd_scblen = statuslen;
+ acmd->cmd_cdblen = cmdlen;
+ acmd->cmd_dmahandle = NULL;
+ acmd->cmd_ncookies = 0;
+ acmd->cmd_cookie = 0;
+ acmd->cmd_cookiecnt = 0;
+ acmd->cmd_nwin = 0;
+
+ pkt->pkt_address = *ap;
+ pkt->pkt_comp = (void (*)())NULL;
+ pkt->pkt_flags = 0;
+ pkt->pkt_time = 0;
+ pkt->pkt_resid = 0;
+ pkt->pkt_state = 0;
+ pkt->pkt_statistics = 0;
+ pkt->pkt_reason = 0;
+ new_pkt = pkt;
+ } else {
+ acmd = PKT2CMD(pkt);
+ new_pkt = NULL;
+ }
+
+ /* step #2 : dma allocation/move */
+ if (bp && bp->b_bcount != 0) {
+ if (acmd->cmd_dmahandle == NULL) {
+ if (drsas_dma_alloc(instance, pkt, bp, flags,
+ callback) == DDI_FAILURE) {
+ if (new_pkt) {
+ scsi_hba_pkt_free(ap, new_pkt);
+ }
+ return ((struct scsi_pkt *)NULL);
+ }
+ } else {
+ if (drsas_dma_move(instance, pkt, bp) == DDI_FAILURE) {
+ return ((struct scsi_pkt *)NULL);
+ }
+ }
+ }
+
+ return (pkt);
+}
+
+static int
+drsas_tran_start(struct scsi_address *ap, register struct scsi_pkt *pkt)
+{
+ uchar_t cmd_done = 0;
+
+ struct drsas_instance *instance = ADDR2MR(ap);
+ struct drsas_cmd *cmd;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d:SCSI CDB[0]=0x%x",
+ __func__, __LINE__, pkt->pkt_cdbp[0]));
+
+ pkt->pkt_reason = CMD_CMPLT;
+ *pkt->pkt_scbp = STATUS_GOOD; /* clear arq scsi_status */
+
+ cmd = build_cmd(instance, ap, pkt, &cmd_done);
+
+ /*
+ * Check if the command is already completed by the drsas_build_cmd()
+ * routine. In which case the busy_flag would be clear and scb will be
+ * NULL and appropriate reason provided in pkt_reason field
+ */
+ if (cmd_done) {
+ pkt->pkt_reason = CMD_CMPLT;
+ pkt->pkt_scbp[0] = STATUS_GOOD;
+ pkt->pkt_state |= STATE_GOT_BUS | STATE_GOT_TARGET
+ | STATE_SENT_CMD;
+ if (((pkt->pkt_flags & FLAG_NOINTR) == 0) && pkt->pkt_comp) {
+ (*pkt->pkt_comp)(pkt);
+ }
+
+ return (TRAN_ACCEPT);
+ }
+
+ if (cmd == NULL) {
+ return (TRAN_BUSY);
+ }
+
+ if ((pkt->pkt_flags & FLAG_NOINTR) == 0) {
+ if (instance->fw_outstanding > instance->max_fw_cmds) {
+ con_log(CL_ANN, (CE_CONT, "dr_sas:Firmware busy"));
+ return_mfi_pkt(instance, cmd);
+ return (TRAN_BUSY);
+ }
+
+ /* Synchronize the Cmd frame for the controller */
+ (void) ddi_dma_sync(cmd->frame_dma_obj.dma_handle, 0, 0,
+ DDI_DMA_SYNC_FORDEV);
+
+ instance->func_ptr->issue_cmd(cmd, instance);
+
+ } else {
+ struct drsas_header *hdr = &cmd->frame->hdr;
+
+ cmd->sync_cmd = DRSAS_TRUE;
+
+ instance->func_ptr-> issue_cmd_in_poll_mode(instance, cmd);
+
+ pkt->pkt_reason = CMD_CMPLT;
+ pkt->pkt_statistics = 0;
+ pkt->pkt_state |= STATE_XFERRED_DATA | STATE_GOT_STATUS;
+
+ switch (ddi_get8(cmd->frame_dma_obj.acc_handle,
+ &hdr->cmd_status)) {
+ case MFI_STAT_OK:
+ pkt->pkt_scbp[0] = STATUS_GOOD;
+ break;
+
+ case MFI_STAT_SCSI_DONE_WITH_ERROR:
+
+ pkt->pkt_reason = CMD_CMPLT;
+ pkt->pkt_statistics = 0;
+
+ ((struct scsi_status *)pkt->pkt_scbp)->sts_chk = 1;
+ break;
+
+ case MFI_STAT_DEVICE_NOT_FOUND:
+ pkt->pkt_reason = CMD_DEV_GONE;
+ pkt->pkt_statistics = STAT_DISCON;
+ break;
+
+ default:
+ ((struct scsi_status *)pkt->pkt_scbp)->sts_busy = 1;
+ }
+
+ return_mfi_pkt(instance, cmd);
+ (void) drsas_common_check(instance, cmd);
+
+ if (pkt->pkt_comp) {
+ (*pkt->pkt_comp)(pkt);
+ }
+
+ }
+
+ return (TRAN_ACCEPT);
+}
+
+/*ARGSUSED*/
+static int
+drsas_tran_abort(struct scsi_address *ap, struct scsi_pkt *pkt)
+{
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* abort command not supported by H/W */
+
+ return (DDI_FAILURE);
+}
+
+/*ARGSUSED*/
+static int
+drsas_tran_reset(struct scsi_address *ap, int level)
+{
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* reset command not supported by H/W */
+
+ return (DDI_FAILURE);
+
+}
+
+/*ARGSUSED*/
+static int
+drsas_tran_getcap(struct scsi_address *ap, char *cap, int whom)
+{
+ int rval = 0;
+
+ struct drsas_instance *instance = ADDR2MR(ap);
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* we do allow inquiring about capabilities for other targets */
+ if (cap == NULL) {
+ return (-1);
+ }
+
+ switch (scsi_hba_lookup_capstr(cap)) {
+ case SCSI_CAP_DMA_MAX:
+ /* Limit to 16MB max transfer */
+ rval = drsas_max_cap_maxxfer;
+ break;
+ case SCSI_CAP_MSG_OUT:
+ rval = 1;
+ break;
+ case SCSI_CAP_DISCONNECT:
+ rval = 0;
+ break;
+ case SCSI_CAP_SYNCHRONOUS:
+ rval = 0;
+ break;
+ case SCSI_CAP_WIDE_XFER:
+ rval = 1;
+ break;
+ case SCSI_CAP_TAGGED_QING:
+ rval = 1;
+ break;
+ case SCSI_CAP_UNTAGGED_QING:
+ rval = 1;
+ break;
+ case SCSI_CAP_PARITY:
+ rval = 1;
+ break;
+ case SCSI_CAP_INITIATOR_ID:
+ rval = instance->init_id;
+ break;
+ case SCSI_CAP_ARQ:
+ rval = 1;
+ break;
+ case SCSI_CAP_LINKED_CMDS:
+ rval = 0;
+ break;
+ case SCSI_CAP_RESET_NOTIFICATION:
+ rval = 1;
+ break;
+ case SCSI_CAP_GEOMETRY:
+ rval = -1;
+
+ break;
+ default:
+ con_log(CL_DLEVEL2, (CE_NOTE, "Default cap coming 0x%x",
+ scsi_hba_lookup_capstr(cap)));
+ rval = -1;
+ break;
+ }
+
+ return (rval);
+}
+
+/*ARGSUSED*/
+static int
+drsas_tran_setcap(struct scsi_address *ap, char *cap, int value, int whom)
+{
+ int rval = 1;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ /* We don't allow setting capabilities for other targets */
+ if (cap == NULL || whom == 0) {
+ return (-1);
+ }
+
+ switch (scsi_hba_lookup_capstr(cap)) {
+ case SCSI_CAP_DMA_MAX:
+ case SCSI_CAP_MSG_OUT:
+ case SCSI_CAP_PARITY:
+ case SCSI_CAP_LINKED_CMDS:
+ case SCSI_CAP_RESET_NOTIFICATION:
+ case SCSI_CAP_DISCONNECT:
+ case SCSI_CAP_SYNCHRONOUS:
+ case SCSI_CAP_UNTAGGED_QING:
+ case SCSI_CAP_WIDE_XFER:
+ case SCSI_CAP_INITIATOR_ID:
+ case SCSI_CAP_ARQ:
+ /*
+ * None of these are settable via
+ * the capability interface.
+ */
+ break;
+ case SCSI_CAP_TAGGED_QING:
+ rval = 1;
+ break;
+ case SCSI_CAP_SECTOR_SIZE:
+ rval = 1;
+ break;
+
+ case SCSI_CAP_TOTAL_SECTORS:
+ rval = 1;
+ break;
+ default:
+ rval = -1;
+ break;
+ }
+
+ return (rval);
+}
+
+static void
+drsas_tran_destroy_pkt(struct scsi_address *ap, struct scsi_pkt *pkt)
+{
+ struct scsa_cmd *acmd = PKT2CMD(pkt);
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ if (acmd->cmd_flags & CFLAG_DMAVALID) {
+ acmd->cmd_flags &= ~CFLAG_DMAVALID;
+
+ (void) ddi_dma_unbind_handle(acmd->cmd_dmahandle);
+
+ ddi_dma_free_handle(&acmd->cmd_dmahandle);
+
+ acmd->cmd_dmahandle = NULL;
+ }
+
+ /* free the pkt */
+ scsi_hba_pkt_free(ap, pkt);
+}
+
+/*ARGSUSED*/
+static void
+drsas_tran_dmafree(struct scsi_address *ap, struct scsi_pkt *pkt)
+{
+ register struct scsa_cmd *acmd = PKT2CMD(pkt);
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ if (acmd->cmd_flags & CFLAG_DMAVALID) {
+ acmd->cmd_flags &= ~CFLAG_DMAVALID;
+
+ (void) ddi_dma_unbind_handle(acmd->cmd_dmahandle);
+
+ ddi_dma_free_handle(&acmd->cmd_dmahandle);
+
+ acmd->cmd_dmahandle = NULL;
+ }
+}
+
+/*ARGSUSED*/
+static void
+drsas_tran_sync_pkt(struct scsi_address *ap, struct scsi_pkt *pkt)
+{
+ register struct scsa_cmd *acmd = PKT2CMD(pkt);
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ if (acmd->cmd_flags & CFLAG_DMAVALID) {
+ (void) ddi_dma_sync(acmd->cmd_dmahandle, acmd->cmd_dma_offset,
+ acmd->cmd_dma_len, (acmd->cmd_flags & CFLAG_DMASEND) ?
+ DDI_DMA_SYNC_FORDEV : DDI_DMA_SYNC_FORCPU);
+ }
+}
+
+/*
+ * drsas_isr(caddr_t)
+ *
+ * The Interrupt Service Routine
+ *
+ * Collect status for all completed commands and do callback
+ *
+ */
+static uint_t
+drsas_isr(struct drsas_instance *instance)
+{
+ int need_softintr;
+ uint32_t producer;
+ uint32_t consumer;
+ uint32_t context;
+
+ struct drsas_cmd *cmd;
+
+ con_log(CL_ANN1, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
+
+ ASSERT(instance);
+ if ((instance->intr_type == DDI_INTR_TYPE_FIXED) &&
+ !instance->func_ptr->intr_ack(instance)) {
+ return (DDI_INTR_UNCLAIMED);
+ }
+
+ (void) ddi_dma_sync(instance->mfi_internal_dma_obj.dma_handle,
+ 0, 0, DDI_DMA_SYNC_FORCPU);
+
+ if (drsas_check_dma_handle(instance->mfi_internal_dma_obj.dma_handle)
+ != DDI_SUCCESS) {
+ drsas_fm_ereport(instance, DDI_FM_DEVICE_NO_RESPONSE);
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
+ return (DDI_INTR_UNCLAIMED);
+ }
+
+ producer = ddi_get32(instance->mfi_internal_dma_obj.acc_handle,
+ instance->producer);
+ consumer = ddi_get32(instance->mfi_internal_dma_obj.acc_handle,
+ instance->consumer);
+
+ con_log(CL_ANN1, (CE_CONT, " producer %x consumer %x ",
+ producer, consumer));
+ if (producer == consumer) {
+ con_log(CL_ANN1, (CE_WARN, "producer = consumer case"));
+ return (DDI_INTR_UNCLAIMED);
+ }
+ mutex_enter(&instance->completed_pool_mtx);
+
+ while (consumer != producer) {
+ context = ddi_get32(instance->mfi_internal_dma_obj.acc_handle,
+ &instance->reply_queue[consumer]);
+ cmd = instance->cmd_list[context];
+ mlist_add_tail(&cmd->list, &instance->completed_pool_list);
+
+ consumer++;
+ if (consumer == (instance->max_fw_cmds + 1)) {
+ consumer = 0;
+ }
+ }
+
+ mutex_exit(&instance->completed_pool_mtx);
+
+ ddi_put32(instance->mfi_internal_dma_obj.acc_handle,
+ instance->consumer, consumer);
+ (void) ddi_dma_sync(instance->mfi_internal_dma_obj.dma_handle,
+ 0, 0, DDI_DMA_SYNC_FORDEV);
+
+ if (instance->softint_running) {
+ need_softintr = 0;
+ } else {
+ need_softintr = 1;
+ }
+
+ if (instance->isr_level == HIGH_LEVEL_INTR) {
+ if (need_softintr) {
+ ddi_trigger_softintr(instance->soft_intr_id);
+ }
+ } else {
+ /*
+ * Not a high-level interrupt, therefore call the soft level
+ * interrupt explicitly
+ */
+ (void) drsas_softintr(instance);
+ }
+
+ return (DDI_INTR_CLAIMED);
+}
+
+
+/*
+ * ************************************************************************** *
+ * *
+ * libraries *
+ * *
+ * ************************************************************************** *
+ */
+/*
+ * get_mfi_pkt : Get a command from the free pool
+ * After successful allocation, the caller of this routine
+ * must clear the frame buffer (memset to zero) before
+ * using the packet further.
+ *
+ * ***** Note *****
+ * After clearing the frame buffer the context id of the
+ * frame buffer SHOULD be restored back.
+ */
+static struct drsas_cmd *
+get_mfi_pkt(struct drsas_instance *instance)
+{
+ mlist_t *head = &instance->cmd_pool_list;
+ struct drsas_cmd *cmd = NULL;
+
+ mutex_enter(&instance->cmd_pool_mtx);
+ ASSERT(mutex_owned(&instance->cmd_pool_mtx));
+
+ if (!mlist_empty(head)) {
+ cmd = mlist_entry(head->next, struct drsas_cmd, list);
+ mlist_del_init(head->next);
+ }
+ if (cmd != NULL)
+ cmd->pkt = NULL;
+ mutex_exit(&instance->cmd_pool_mtx);
+
+ return (cmd);
+}
+
+/*
+ * return_mfi_pkt : Return a cmd to free command pool
+ */
+static void
+return_mfi_pkt(struct drsas_instance *instance, struct drsas_cmd *cmd)
+{
+ mutex_enter(&instance->cmd_pool_mtx);
+ ASSERT(mutex_owned(&instance->cmd_pool_mtx));
+
+ mlist_add(&cmd->list, &instance->cmd_pool_list);
+
+ mutex_exit(&instance->cmd_pool_mtx);
+}
+
+/*
+ * destroy_mfi_frame_pool
+ */
+static void
+destroy_mfi_frame_pool(struct drsas_instance *instance)
+{
+ int i;
+ uint32_t max_cmd = instance->max_fw_cmds;
+
+ struct drsas_cmd *cmd;
+
+ /* return all frames to pool */
+ for (i = 0; i < max_cmd+1; i++) {
+
+ cmd = instance->cmd_list[i];
+
+ if (cmd->frame_dma_obj_status == DMA_OBJ_ALLOCATED)
+ (void) drsas_free_dma_obj(instance, cmd->frame_dma_obj);
+
+ cmd->frame_dma_obj_status = DMA_OBJ_FREED;
+ }
+
+}
+
+/*
+ * create_mfi_frame_pool
+ */
+static int
+create_mfi_frame_pool(struct drsas_instance *instance)
+{
+ int i = 0;
+ int cookie_cnt;
+ uint16_t max_cmd;
+ uint16_t sge_sz;
+ uint32_t sgl_sz;
+ uint32_t tot_frame_size;
+
+ struct drsas_cmd *cmd;
+
+ max_cmd = instance->max_fw_cmds;
+
+ sge_sz = sizeof (struct drsas_sge64);
+
+ /* calculated the number of 64byte frames required for SGL */
+ sgl_sz = sge_sz * instance->max_num_sge;
+ tot_frame_size = sgl_sz + MRMFI_FRAME_SIZE + SENSE_LENGTH;
+
+ con_log(CL_DLEVEL3, (CE_NOTE, "create_mfi_frame_pool: "
+ "sgl_sz %x tot_frame_size %x", sgl_sz, tot_frame_size));
+
+ while (i < max_cmd+1) {
+ cmd = instance->cmd_list[i];
+
+ cmd->frame_dma_obj.size = tot_frame_size;
+ cmd->frame_dma_obj.dma_attr = drsas_generic_dma_attr;
+ cmd->frame_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ cmd->frame_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ cmd->frame_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ cmd->frame_dma_obj.dma_attr.dma_attr_align = 64;
+
+
+ cookie_cnt = drsas_alloc_dma_obj(instance, &cmd->frame_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC);
+
+ if (cookie_cnt == -1 || cookie_cnt > 1) {
+ con_log(CL_ANN, (CE_WARN,
+ "create_mfi_frame_pool: could not alloc."));
+ return (DDI_FAILURE);
+ }
+
+ bzero(cmd->frame_dma_obj.buffer, tot_frame_size);
+
+ cmd->frame_dma_obj_status = DMA_OBJ_ALLOCATED;
+ cmd->frame = (union drsas_frame *)cmd->frame_dma_obj.buffer;
+ cmd->frame_phys_addr =
+ cmd->frame_dma_obj.dma_cookie[0].dmac_address;
+
+ cmd->sense = (uint8_t *)(((unsigned long)
+ cmd->frame_dma_obj.buffer) +
+ tot_frame_size - SENSE_LENGTH);
+ cmd->sense_phys_addr =
+ cmd->frame_dma_obj.dma_cookie[0].dmac_address +
+ tot_frame_size - SENSE_LENGTH;
+
+ if (!cmd->frame || !cmd->sense) {
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: pci_pool_alloc failed"));
+
+ return (ENOMEM);
+ }
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &cmd->frame->io.context, cmd->index);
+ i++;
+
+ con_log(CL_DLEVEL3, (CE_NOTE, "[%x]-%x",
+ cmd->index, cmd->frame_phys_addr));
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * free_additional_dma_buffer
+ */
+static void
+free_additional_dma_buffer(struct drsas_instance *instance)
+{
+ if (instance->mfi_internal_dma_obj.status == DMA_OBJ_ALLOCATED) {
+ (void) drsas_free_dma_obj(instance,
+ instance->mfi_internal_dma_obj);
+ instance->mfi_internal_dma_obj.status = DMA_OBJ_FREED;
+ }
+
+ if (instance->mfi_evt_detail_obj.status == DMA_OBJ_ALLOCATED) {
+ (void) drsas_free_dma_obj(instance,
+ instance->mfi_evt_detail_obj);
+ instance->mfi_evt_detail_obj.status = DMA_OBJ_FREED;
+ }
+}
+
+/*
+ * alloc_additional_dma_buffer
+ */
+static int
+alloc_additional_dma_buffer(struct drsas_instance *instance)
+{
+ uint32_t reply_q_sz;
+ uint32_t internal_buf_size = PAGESIZE*2;
+
+ /* max cmds plus 1 + producer & consumer */
+ reply_q_sz = sizeof (uint32_t) * (instance->max_fw_cmds + 1 + 2);
+
+ instance->mfi_internal_dma_obj.size = internal_buf_size;
+ instance->mfi_internal_dma_obj.dma_attr = drsas_generic_dma_attr;
+ instance->mfi_internal_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ instance->mfi_internal_dma_obj.dma_attr.dma_attr_count_max =
+ 0xFFFFFFFFU;
+ instance->mfi_internal_dma_obj.dma_attr.dma_attr_sgllen = 1;
+
+ if (drsas_alloc_dma_obj(instance, &instance->mfi_internal_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas: could not alloc reply queue"));
+ return (DDI_FAILURE);
+ }
+
+ bzero(instance->mfi_internal_dma_obj.buffer, internal_buf_size);
+
+ instance->mfi_internal_dma_obj.status |= DMA_OBJ_ALLOCATED;
+
+ instance->producer = (uint32_t *)((unsigned long)
+ instance->mfi_internal_dma_obj.buffer);
+ instance->consumer = (uint32_t *)((unsigned long)
+ instance->mfi_internal_dma_obj.buffer + 4);
+ instance->reply_queue = (uint32_t *)((unsigned long)
+ instance->mfi_internal_dma_obj.buffer + 8);
+ instance->internal_buf = (caddr_t)(((unsigned long)
+ instance->mfi_internal_dma_obj.buffer) + reply_q_sz + 8);
+ instance->internal_buf_dmac_add =
+ instance->mfi_internal_dma_obj.dma_cookie[0].dmac_address +
+ (reply_q_sz + 8);
+ instance->internal_buf_size = internal_buf_size -
+ (reply_q_sz + 8);
+
+ /* allocate evt_detail */
+ instance->mfi_evt_detail_obj.size = sizeof (struct drsas_evt_detail);
+ instance->mfi_evt_detail_obj.dma_attr = drsas_generic_dma_attr;
+ instance->mfi_evt_detail_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ instance->mfi_evt_detail_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ instance->mfi_evt_detail_obj.dma_attr.dma_attr_sgllen = 1;
+ instance->mfi_evt_detail_obj.dma_attr.dma_attr_align = 1;
+
+ if (drsas_alloc_dma_obj(instance, &instance->mfi_evt_detail_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "alloc_additional_dma_buffer: "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ bzero(instance->mfi_evt_detail_obj.buffer,
+ sizeof (struct drsas_evt_detail));
+
+ instance->mfi_evt_detail_obj.status |= DMA_OBJ_ALLOCATED;
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * free_space_for_mfi
+ */
+static void
+free_space_for_mfi(struct drsas_instance *instance)
+{
+ int i;
+ uint32_t max_cmd = instance->max_fw_cmds;
+
+ /* already freed */
+ if (instance->cmd_list == NULL) {
+ return;
+ }
+
+ free_additional_dma_buffer(instance);
+
+ /* first free the MFI frame pool */
+ destroy_mfi_frame_pool(instance);
+
+ /* free all the commands in the cmd_list */
+ for (i = 0; i < instance->max_fw_cmds+1; i++) {
+ kmem_free(instance->cmd_list[i],
+ sizeof (struct drsas_cmd));
+
+ instance->cmd_list[i] = NULL;
+ }
+
+ /* free the cmd_list buffer itself */
+ kmem_free(instance->cmd_list,
+ sizeof (struct drsas_cmd *) * (max_cmd+1));
+
+ instance->cmd_list = NULL;
+
+ INIT_LIST_HEAD(&instance->cmd_pool_list);
+}
+
+/*
+ * alloc_space_for_mfi
+ */
+static int
+alloc_space_for_mfi(struct drsas_instance *instance)
+{
+ int i;
+ uint32_t max_cmd;
+ size_t sz;
+
+ struct drsas_cmd *cmd;
+
+ max_cmd = instance->max_fw_cmds;
+
+ /* reserve 1 more slot for flush_cache */
+ sz = sizeof (struct drsas_cmd *) * (max_cmd+1);
+
+ /*
+ * instance->cmd_list is an array of struct drsas_cmd pointers.
+ * Allocate the dynamic array first and then allocate individual
+ * commands.
+ */
+ instance->cmd_list = kmem_zalloc(sz, KM_SLEEP);
+ ASSERT(instance->cmd_list);
+
+ for (i = 0; i < max_cmd+1; i++) {
+ instance->cmd_list[i] = kmem_zalloc(sizeof (struct drsas_cmd),
+ KM_SLEEP);
+ ASSERT(instance->cmd_list[i]);
+ }
+
+ INIT_LIST_HEAD(&instance->cmd_pool_list);
+
+ /* add all the commands to command pool (instance->cmd_pool) */
+ for (i = 0; i < max_cmd; i++) {
+ cmd = instance->cmd_list[i];
+ cmd->index = i;
+
+ mlist_add_tail(&cmd->list, &instance->cmd_pool_list);
+ }
+
+ /* single slot for flush_cache won't be added in command pool */
+ cmd = instance->cmd_list[max_cmd];
+ cmd->index = i;
+
+ /* create a frame pool and assign one frame to each cmd */
+ if (create_mfi_frame_pool(instance)) {
+ con_log(CL_ANN, (CE_NOTE, "error creating frame DMA pool"));
+ return (DDI_FAILURE);
+ }
+
+ /* create a frame pool and assign one frame to each cmd */
+ if (alloc_additional_dma_buffer(instance)) {
+ con_log(CL_ANN, (CE_NOTE, "error creating frame DMA pool"));
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * get_ctrl_info
+ */
+static int
+get_ctrl_info(struct drsas_instance *instance,
+ struct drsas_ctrl_info *ctrl_info)
+{
+ int ret = 0;
+
+ struct drsas_cmd *cmd;
+ struct drsas_dcmd_frame *dcmd;
+ struct drsas_ctrl_info *ci;
+
+ cmd = get_mfi_pkt(instance);
+
+ if (!cmd) {
+ con_log(CL_ANN, (CE_WARN,
+ "Failed to get a cmd for ctrl info"));
+ return (DDI_FAILURE);
+ }
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &cmd->frame->hdr.context,
+ cmd->index);
+
+ dcmd = &cmd->frame->dcmd;
+
+ ci = (struct drsas_ctrl_info *)instance->internal_buf;
+
+ if (!ci) {
+ con_log(CL_ANN, (CE_WARN,
+ "Failed to alloc mem for ctrl info"));
+ return_mfi_pkt(instance, cmd);
+ return (DDI_FAILURE);
+ }
+
+ (void) memset(ci, 0, sizeof (struct drsas_ctrl_info));
+
+ /* for( i = 0; i < DCMD_MBOX_SZ; i++ ) dcmd->mbox.b[i] = 0; */
+ (void) memset(dcmd->mbox.b, 0, DCMD_MBOX_SZ);
+
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd, MFI_CMD_OP_DCMD);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd_status,
+ MFI_CMD_STATUS_POLL_MODE);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->sge_count, 1);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->flags,
+ MFI_FRAME_DIR_READ);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->timeout, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->data_xfer_len,
+ sizeof (struct drsas_ctrl_info));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->opcode,
+ DR_DCMD_CTRL_GET_INFO);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->sgl.sge32[0].phys_addr,
+ instance->internal_buf_dmac_add);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->sgl.sge32[0].length,
+ sizeof (struct drsas_ctrl_info));
+
+ cmd->frame_count = 1;
+
+ if (!instance->func_ptr->issue_cmd_in_poll_mode(instance, cmd)) {
+ ret = 0;
+ ddi_rep_get8(cmd->frame_dma_obj.acc_handle,
+ (uint8_t *)ctrl_info, (uint8_t *)ci,
+ sizeof (struct drsas_ctrl_info), DDI_DEV_AUTOINCR);
+ } else {
+ con_log(CL_ANN, (CE_WARN, "get_ctrl_info: Ctrl info failed"));
+ ret = -1;
+ }
+
+ return_mfi_pkt(instance, cmd);
+ if (drsas_common_check(instance, cmd) != DDI_SUCCESS) {
+ ret = -1;
+ }
+
+ return (ret);
+}
+
+/*
+ * abort_aen_cmd
+ */
+static int
+abort_aen_cmd(struct drsas_instance *instance,
+ struct drsas_cmd *cmd_to_abort)
+{
+ int ret = 0;
+
+ struct drsas_cmd *cmd;
+ struct drsas_abort_frame *abort_fr;
+
+ cmd = get_mfi_pkt(instance);
+
+ if (!cmd) {
+ con_log(CL_ANN, (CE_WARN,
+ "Failed to get a cmd for ctrl info"));
+ return (DDI_FAILURE);
+ }
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &cmd->frame->hdr.context,
+ cmd->index);
+
+ abort_fr = &cmd->frame->abort;
+
+ /* prepare and issue the abort frame */
+ ddi_put8(cmd->frame_dma_obj.acc_handle,
+ &abort_fr->cmd, MFI_CMD_OP_ABORT);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &abort_fr->cmd_status,
+ MFI_CMD_STATUS_SYNC_MODE);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &abort_fr->flags, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &abort_fr->abort_context,
+ cmd_to_abort->index);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &abort_fr->abort_mfi_phys_addr_lo, cmd_to_abort->frame_phys_addr);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &abort_fr->abort_mfi_phys_addr_hi, 0);
+
+ instance->aen_cmd->abort_aen = 1;
+
+ cmd->sync_cmd = DRSAS_TRUE;
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_sync_mode(instance, cmd)) {
+ con_log(CL_ANN, (CE_WARN,
+ "abort_aen_cmd: issue_cmd_in_sync_mode failed"));
+ ret = -1;
+ } else {
+ ret = 0;
+ }
+
+ instance->aen_cmd->abort_aen = 1;
+ instance->aen_cmd = 0;
+
+ return_mfi_pkt(instance, cmd);
+ (void) drsas_common_check(instance, cmd);
+
+ return (ret);
+}
+
+/*
+ * init_mfi
+ */
+static int
+init_mfi(struct drsas_instance *instance)
+{
+ struct drsas_cmd *cmd;
+ struct drsas_ctrl_info ctrl_info;
+ struct drsas_init_frame *init_frame;
+ struct drsas_init_queue_info *initq_info;
+
+ /* we expect the FW state to be READY */
+ if (mfi_state_transition_to_ready(instance)) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas: F/W is not ready"));
+ goto fail_ready_state;
+ }
+
+ /* get various operational parameters from status register */
+ instance->max_num_sge =
+ (instance->func_ptr->read_fw_status_reg(instance) &
+ 0xFF0000) >> 0x10;
+ /*
+ * Reduce the max supported cmds by 1. This is to ensure that the
+ * reply_q_sz (1 more than the max cmd that driver may send)
+ * does not exceed max cmds that the FW can support
+ */
+ instance->max_fw_cmds =
+ instance->func_ptr->read_fw_status_reg(instance) & 0xFFFF;
+ instance->max_fw_cmds = instance->max_fw_cmds - 1;
+
+ instance->max_num_sge =
+ (instance->max_num_sge > DRSAS_MAX_SGE_CNT) ?
+ DRSAS_MAX_SGE_CNT : instance->max_num_sge;
+
+ /* create a pool of commands */
+ if (alloc_space_for_mfi(instance) != DDI_SUCCESS)
+ goto fail_alloc_fw_space;
+
+ /*
+ * Prepare a init frame. Note the init frame points to queue info
+ * structure. Each frame has SGL allocated after first 64 bytes. For
+ * this frame - since we don't need any SGL - we use SGL's space as
+ * queue info structure
+ */
+ cmd = get_mfi_pkt(instance);
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &cmd->frame->hdr.context,
+ cmd->index);
+
+ init_frame = (struct drsas_init_frame *)cmd->frame;
+ initq_info = (struct drsas_init_queue_info *)
+ ((unsigned long)init_frame + 64);
+
+ (void) memset(init_frame, 0, MRMFI_FRAME_SIZE);
+ (void) memset(initq_info, 0, sizeof (struct drsas_init_queue_info));
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &initq_info->init_flags, 0);
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->reply_queue_entries, instance->max_fw_cmds + 1);
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->producer_index_phys_addr_hi, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->producer_index_phys_addr_lo,
+ instance->mfi_internal_dma_obj.dma_cookie[0].dmac_address);
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->consumer_index_phys_addr_hi, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->consumer_index_phys_addr_lo,
+ instance->mfi_internal_dma_obj.dma_cookie[0].dmac_address + 4);
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->reply_queue_start_phys_addr_hi, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &initq_info->reply_queue_start_phys_addr_lo,
+ instance->mfi_internal_dma_obj.dma_cookie[0].dmac_address + 8);
+
+ ddi_put8(cmd->frame_dma_obj.acc_handle,
+ &init_frame->cmd, MFI_CMD_OP_INIT);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &init_frame->cmd_status,
+ MFI_CMD_STATUS_POLL_MODE);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &init_frame->flags, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &init_frame->queue_info_new_phys_addr_lo,
+ cmd->frame_phys_addr + 64);
+ ddi_put32(cmd->frame_dma_obj.acc_handle,
+ &init_frame->queue_info_new_phys_addr_hi, 0);
+
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &init_frame->data_xfer_len,
+ sizeof (struct drsas_init_queue_info));
+
+ cmd->frame_count = 1;
+
+ /* issue the init frame in polled mode */
+ if (instance->func_ptr->issue_cmd_in_poll_mode(instance, cmd)) {
+ con_log(CL_ANN, (CE_WARN, "failed to init firmware"));
+ goto fail_fw_init;
+ }
+
+ return_mfi_pkt(instance, cmd);
+ if (drsas_common_check(instance, cmd) != DDI_SUCCESS) {
+ goto fail_fw_init;
+ }
+
+ /* gather misc FW related information */
+ if (!get_ctrl_info(instance, &ctrl_info)) {
+ instance->max_sectors_per_req = ctrl_info.max_request_size;
+ con_log(CL_ANN1, (CE_NOTE, "product name %s ld present %d",
+ ctrl_info.product_name, ctrl_info.ld_present_count));
+ } else {
+ instance->max_sectors_per_req = instance->max_num_sge *
+ PAGESIZE / 512;
+ }
+
+ if (drsas_check_acc_handle(instance->regmap_handle) != DDI_SUCCESS) {
+ goto fail_fw_init;
+ }
+
+ return (DDI_SUCCESS);
+
+fail_fw_init:
+fail_alloc_fw_space:
+
+ free_space_for_mfi(instance);
+
+fail_ready_state:
+ ddi_regs_map_free(&instance->regmap_handle);
+
+fail_mfi_reg_setup:
+ return (DDI_FAILURE);
+}
+
+/*
+ * mfi_state_transition_to_ready : Move the FW to READY state
+ *
+ * @reg_set : MFI register set
+ */
+static int
+mfi_state_transition_to_ready(struct drsas_instance *instance)
+{
+ int i;
+ uint8_t max_wait;
+ uint32_t fw_ctrl;
+ uint32_t fw_state;
+ uint32_t cur_state;
+
+ fw_state =
+ instance->func_ptr->read_fw_status_reg(instance) & MFI_STATE_MASK;
+ con_log(CL_ANN1, (CE_NOTE,
+ "mfi_state_transition_to_ready:FW state = 0x%x", fw_state));
+
+ while (fw_state != MFI_STATE_READY) {
+ con_log(CL_ANN, (CE_NOTE,
+ "mfi_state_transition_to_ready:FW state%x", fw_state));
+
+ switch (fw_state) {
+ case MFI_STATE_FAULT:
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: FW in FAULT state!!"));
+
+ return (ENODEV);
+ case MFI_STATE_WAIT_HANDSHAKE:
+ /* set the CLR bit in IMR0 */
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: FW waiting for HANDSHAKE"));
+ /*
+ * PCI_Hot Plug: MFI F/W requires
+ * (MFI_INIT_CLEAR_HANDSHAKE|MFI_INIT_HOTPLUG)
+ * to be set
+ */
+ /* WR_IB_MSG_0(MFI_INIT_CLEAR_HANDSHAKE, instance); */
+ WR_IB_DOORBELL(MFI_INIT_CLEAR_HANDSHAKE |
+ MFI_INIT_HOTPLUG, instance);
+
+ max_wait = 2;
+ cur_state = MFI_STATE_WAIT_HANDSHAKE;
+ break;
+ case MFI_STATE_BOOT_MESSAGE_PENDING:
+ /* set the CLR bit in IMR0 */
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: FW state boot message pending"));
+ /*
+ * PCI_Hot Plug: MFI F/W requires
+ * (MFI_INIT_CLEAR_HANDSHAKE|MFI_INIT_HOTPLUG)
+ * to be set
+ */
+ WR_IB_DOORBELL(MFI_INIT_HOTPLUG, instance);
+
+ max_wait = 10;
+ cur_state = MFI_STATE_BOOT_MESSAGE_PENDING;
+ break;
+ case MFI_STATE_OPERATIONAL:
+ /* bring it to READY state; assuming max wait 2 secs */
+ instance->func_ptr->disable_intr(instance);
+ con_log(CL_ANN1, (CE_NOTE,
+ "dr_sas: FW in OPERATIONAL state"));
+ /*
+ * PCI_Hot Plug: MFI F/W requires
+ * (MFI_INIT_READY | MFI_INIT_MFIMODE | MFI_INIT_ABORT)
+ * to be set
+ */
+ /* WR_IB_DOORBELL(MFI_INIT_READY, instance); */
+ WR_IB_DOORBELL(MFI_RESET_FLAGS, instance);
+
+ max_wait = 10;
+ cur_state = MFI_STATE_OPERATIONAL;
+ break;
+ case MFI_STATE_UNDEFINED:
+ /* this state should not last for more than 2 seconds */
+ con_log(CL_ANN, (CE_NOTE, "FW state undefined"));
+
+ max_wait = 2;
+ cur_state = MFI_STATE_UNDEFINED;
+ break;
+ case MFI_STATE_BB_INIT:
+ max_wait = 2;
+ cur_state = MFI_STATE_BB_INIT;
+ break;
+ case MFI_STATE_FW_INIT:
+ max_wait = 2;
+ cur_state = MFI_STATE_FW_INIT;
+ break;
+ case MFI_STATE_DEVICE_SCAN:
+ max_wait = 10;
+ cur_state = MFI_STATE_DEVICE_SCAN;
+ break;
+ default:
+ con_log(CL_ANN, (CE_NOTE,
+ "dr_sas: Unknown state 0x%x", fw_state));
+ return (ENODEV);
+ }
+
+ /* the cur_state should not last for more than max_wait secs */
+ for (i = 0; i < (max_wait * MILLISEC); i++) {
+ /* fw_state = RD_OB_MSG_0(instance) & MFI_STATE_MASK; */
+ fw_state =
+ instance->func_ptr->read_fw_status_reg(instance) &
+ MFI_STATE_MASK;
+
+ if (fw_state == cur_state) {
+ delay(1 * drv_usectohz(MILLISEC));
+ } else {
+ break;
+ }
+ }
+
+ /* return error if fw_state hasn't changed after max_wait */
+ if (fw_state == cur_state) {
+ con_log(CL_ANN, (CE_NOTE,
+ "FW state hasn't changed in %d secs", max_wait));
+ return (ENODEV);
+ }
+ };
+
+ fw_ctrl = RD_IB_DOORBELL(instance);
+
+ con_log(CL_ANN1, (CE_NOTE,
+ "mfi_state_transition_to_ready:FW ctrl = 0x%x", fw_ctrl));
+
+ /*
+ * Write 0xF to the doorbell register to do the following.
+ * - Abort all outstanding commands (bit 0).
+ * - Transition from OPERATIONAL to READY state (bit 1).
+ * - Discard (possible) low MFA posted in 64-bit mode (bit-2).
+ * - Set to release FW to continue running (i.e. BIOS handshake
+ * (bit 3).
+ */
+ WR_IB_DOORBELL(0xF, instance);
+
+ if (drsas_check_acc_handle(instance->regmap_handle) != DDI_SUCCESS) {
+ return (ENODEV);
+ }
+ return (DDI_SUCCESS);
+}
+
+/*
+ * get_seq_num
+ */
+static int
+get_seq_num(struct drsas_instance *instance,
+ struct drsas_evt_log_info *eli)
+{
+ int ret = DDI_SUCCESS;
+
+ dma_obj_t dcmd_dma_obj;
+ struct drsas_cmd *cmd;
+ struct drsas_dcmd_frame *dcmd;
+
+ cmd = get_mfi_pkt(instance);
+
+ if (!cmd) {
+ cmn_err(CE_WARN, "dr_sas: failed to get a cmd");
+ return (ENOMEM);
+ }
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &cmd->frame->hdr.context,
+ cmd->index);
+
+ dcmd = &cmd->frame->dcmd;
+
+ /* allocate the data transfer buffer */
+ dcmd_dma_obj.size = sizeof (struct drsas_evt_log_info);
+ dcmd_dma_obj.dma_attr = drsas_generic_dma_attr;
+ dcmd_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ dcmd_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ dcmd_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ dcmd_dma_obj.dma_attr.dma_attr_align = 1;
+
+ if (drsas_alloc_dma_obj(instance, &dcmd_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN,
+ "get_seq_num: could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ (void) memset(dcmd_dma_obj.buffer, 0,
+ sizeof (struct drsas_evt_log_info));
+
+ (void) memset(dcmd->mbox.b, 0, DCMD_MBOX_SZ);
+
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd, MFI_CMD_OP_DCMD);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd_status, 0);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->sge_count, 1);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->flags,
+ MFI_FRAME_DIR_READ);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->timeout, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->data_xfer_len,
+ sizeof (struct drsas_evt_log_info));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->opcode,
+ DR_DCMD_CTRL_EVENT_GET_INFO);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->sgl.sge32[0].length,
+ sizeof (struct drsas_evt_log_info));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->sgl.sge32[0].phys_addr,
+ dcmd_dma_obj.dma_cookie[0].dmac_address);
+
+ cmd->sync_cmd = DRSAS_TRUE;
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_sync_mode(instance, cmd)) {
+ cmn_err(CE_WARN, "get_seq_num: "
+ "failed to issue DRSAS_DCMD_CTRL_EVENT_GET_INFO");
+ ret = DDI_FAILURE;
+ } else {
+ /* copy the data back into callers buffer */
+ ddi_rep_get8(cmd->frame_dma_obj.acc_handle, (uint8_t *)eli,
+ (uint8_t *)dcmd_dma_obj.buffer,
+ sizeof (struct drsas_evt_log_info), DDI_DEV_AUTOINCR);
+ ret = DDI_SUCCESS;
+ }
+
+ if (drsas_free_dma_obj(instance, dcmd_dma_obj) != DDI_SUCCESS)
+ ret = DDI_FAILURE;
+
+ return_mfi_pkt(instance, cmd);
+ if (drsas_common_check(instance, cmd) != DDI_SUCCESS) {
+ ret = DDI_FAILURE;
+ }
+ return (ret);
+}
+
+/*
+ * start_mfi_aen
+ */
+static int
+start_mfi_aen(struct drsas_instance *instance)
+{
+ int ret = 0;
+
+ struct drsas_evt_log_info eli;
+ union drsas_evt_class_locale class_locale;
+
+ /* get the latest sequence number from FW */
+ (void) memset(&eli, 0, sizeof (struct drsas_evt_log_info));
+
+ if (get_seq_num(instance, &eli)) {
+ cmn_err(CE_WARN, "start_mfi_aen: failed to get seq num");
+ return (-1);
+ }
+
+ /* register AEN with FW for latest sequence number plus 1 */
+ class_locale.members.reserved = 0;
+ class_locale.members.locale = DR_EVT_LOCALE_ALL;
+ class_locale.members.class = DR_EVT_CLASS_INFO;
+ ret = register_mfi_aen(instance, eli.newest_seq_num + 1,
+ class_locale.word);
+
+ if (ret) {
+ cmn_err(CE_WARN, "start_mfi_aen: aen registration failed");
+ return (-1);
+ }
+
+ return (ret);
+}
+
+/*
+ * flush_cache
+ */
+static void
+flush_cache(struct drsas_instance *instance)
+{
+ struct drsas_cmd *cmd = NULL;
+ struct drsas_dcmd_frame *dcmd;
+ uint32_t max_cmd = instance->max_fw_cmds;
+
+ cmd = instance->cmd_list[max_cmd];
+
+ if (cmd == NULL)
+ return;
+
+ dcmd = &cmd->frame->dcmd;
+
+ (void) memset(dcmd->mbox.b, 0, DCMD_MBOX_SZ);
+
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd, MFI_CMD_OP_DCMD);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd_status, 0x0);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->sge_count, 0);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->flags,
+ MFI_FRAME_DIR_NONE);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->timeout, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->data_xfer_len, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->opcode,
+ DR_DCMD_CTRL_CACHE_FLUSH);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->mbox.b[0],
+ DR_FLUSH_CTRL_CACHE | DR_FLUSH_DISK_CACHE);
+
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_poll_mode(instance, cmd)) {
+ con_log(CL_ANN1, (CE_WARN,
+ "flush_cache: failed to issue MFI_DCMD_CTRL_CACHE_FLUSH"));
+ }
+ con_log(CL_DLEVEL1, (CE_NOTE, "done"));
+}
+
+/*
+ * service_mfi_aen- Completes an AEN command
+ * @instance: Adapter soft state
+ * @cmd: Command to be completed
+ *
+ */
+static void
+service_mfi_aen(struct drsas_instance *instance, struct drsas_cmd *cmd)
+{
+ uint32_t seq_num;
+ struct drsas_evt_detail *evt_detail =
+ (struct drsas_evt_detail *)instance->mfi_evt_detail_obj.buffer;
+ int rval = 0;
+ int tgt = 0;
+ ddi_acc_handle_t acc_handle;
+
+ acc_handle = cmd->frame_dma_obj.acc_handle;
+
+ cmd->cmd_status = ddi_get8(acc_handle, &cmd->frame->io.cmd_status);
+
+ if (cmd->cmd_status == ENODATA) {
+ cmd->cmd_status = 0;
+ }
+
+ /*
+ * log the MFI AEN event to the sysevent queue so that
+ * application will get noticed
+ */
+ if (ddi_log_sysevent(instance->dip, DDI_VENDOR_LSI, "LSIMEGA", "SAS",
+ NULL, NULL, DDI_NOSLEEP) != DDI_SUCCESS) {
+ int instance_no = ddi_get_instance(instance->dip);
+ con_log(CL_ANN, (CE_WARN,
+ "dr_sas%d: Failed to log AEN event", instance_no));
+ }
+ /*
+ * Check for any ld devices that has changed state. i.e. online
+ * or offline.
+ */
+ con_log(CL_ANN1, (CE_NOTE,
+ "AEN: code = %x class = %x locale = %x args = %x",
+ ddi_get32(acc_handle, &evt_detail->code),
+ evt_detail->cl.members.class,
+ ddi_get16(acc_handle, &evt_detail->cl.members.locale),
+ ddi_get8(acc_handle, &evt_detail->arg_type)));
+
+ switch (ddi_get32(acc_handle, &evt_detail->code)) {
+ case DR_EVT_CFG_CLEARED: {
+ for (tgt = 0; tgt < MRDRV_MAX_LD; tgt++) {
+ if (instance->dr_ld_list[tgt].dip != NULL) {
+ rval = drsas_service_evt(instance, tgt, 0,
+ DRSAS_EVT_UNCONFIG_TGT, NULL);
+ con_log(CL_ANN1, (CE_WARN,
+ "dr_sas: CFG CLEARED AEN rval = %d "
+ "tgt id = %d", rval, tgt));
+ }
+ }
+ break;
+ }
+
+ case DR_EVT_LD_DELETED: {
+ rval = drsas_service_evt(instance,
+ ddi_get16(acc_handle, &evt_detail->args.ld.target_id), 0,
+ DRSAS_EVT_UNCONFIG_TGT, NULL);
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: LD DELETED AEN rval = %d "
+ "tgt id = %d index = %d", rval,
+ ddi_get16(acc_handle, &evt_detail->args.ld.target_id),
+ ddi_get8(acc_handle, &evt_detail->args.ld.ld_index)));
+ break;
+ } /* End of DR_EVT_LD_DELETED */
+
+ case DR_EVT_LD_CREATED: {
+ rval = drsas_service_evt(instance,
+ ddi_get16(acc_handle, &evt_detail->args.ld.target_id), 0,
+ DRSAS_EVT_CONFIG_TGT, NULL);
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: LD CREATED AEN rval = %d "
+ "tgt id = %d index = %d", rval,
+ ddi_get16(acc_handle, &evt_detail->args.ld.target_id),
+ ddi_get8(acc_handle, &evt_detail->args.ld.ld_index)));
+ break;
+ } /* End of DR_EVT_LD_CREATED */
+ } /* End of Main Switch */
+
+ /* get copy of seq_num and class/locale for re-registration */
+ seq_num = ddi_get32(acc_handle, &evt_detail->seq_num);
+ seq_num++;
+ (void) memset(instance->mfi_evt_detail_obj.buffer, 0,
+ sizeof (struct drsas_evt_detail));
+
+ ddi_put8(acc_handle, &cmd->frame->dcmd.cmd_status, 0x0);
+ ddi_put32(acc_handle, &cmd->frame->dcmd.mbox.w[0], seq_num);
+
+ instance->aen_seq_num = seq_num;
+
+ cmd->frame_count = 1;
+
+ /* Issue the aen registration frame */
+ instance->func_ptr->issue_cmd(cmd, instance);
+}
+
+/*
+ * complete_cmd_in_sync_mode - Completes an internal command
+ * @instance: Adapter soft state
+ * @cmd: Command to be completed
+ *
+ * The issue_cmd_in_sync_mode() function waits for a command to complete
+ * after it issues a command. This function wakes up that waiting routine by
+ * calling wake_up() on the wait queue.
+ */
+static void
+complete_cmd_in_sync_mode(struct drsas_instance *instance,
+ struct drsas_cmd *cmd)
+{
+ cmd->cmd_status = ddi_get8(cmd->frame_dma_obj.acc_handle,
+ &cmd->frame->io.cmd_status);
+
+ cmd->sync_cmd = DRSAS_FALSE;
+
+ if (cmd->cmd_status == ENODATA) {
+ cmd->cmd_status = 0;
+ }
+
+ cv_broadcast(&instance->int_cmd_cv);
+}
+
+/*
+ * drsas_softintr - The Software ISR
+ * @param arg : HBA soft state
+ *
+ * called from high-level interrupt if hi-level interrupt are not there,
+ * otherwise triggered as a soft interrupt
+ */
+static uint_t
+drsas_softintr(struct drsas_instance *instance)
+{
+ struct scsi_pkt *pkt;
+ struct scsa_cmd *acmd;
+ struct drsas_cmd *cmd;
+ struct mlist_head *pos, *next;
+ mlist_t process_list;
+ struct drsas_header *hdr;
+ struct scsi_arq_status *arqstat;
+
+ con_log(CL_ANN1, (CE_CONT, "drsas_softintr called"));
+
+ ASSERT(instance);
+ mutex_enter(&instance->completed_pool_mtx);
+
+ if (mlist_empty(&instance->completed_pool_list)) {
+ mutex_exit(&instance->completed_pool_mtx);
+ return (DDI_INTR_UNCLAIMED);
+ }
+
+ instance->softint_running = 1;
+
+ INIT_LIST_HEAD(&process_list);
+ mlist_splice(&instance->completed_pool_list, &process_list);
+ INIT_LIST_HEAD(&instance->completed_pool_list);
+
+ mutex_exit(&instance->completed_pool_mtx);
+
+ /* perform all callbacks first, before releasing the SCBs */
+ mlist_for_each_safe(pos, next, &process_list) {
+ cmd = mlist_entry(pos, struct drsas_cmd, list);
+
+ /* syncronize the Cmd frame for the controller */
+ (void) ddi_dma_sync(cmd->frame_dma_obj.dma_handle,
+ 0, 0, DDI_DMA_SYNC_FORCPU);
+
+ if (drsas_check_dma_handle(cmd->frame_dma_obj.dma_handle) !=
+ DDI_SUCCESS) {
+ drsas_fm_ereport(instance, DDI_FM_DEVICE_NO_RESPONSE);
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
+ return (DDI_INTR_UNCLAIMED);
+ }
+
+ hdr = &cmd->frame->hdr;
+
+ /* remove the internal command from the process list */
+ mlist_del_init(&cmd->list);
+
+ switch (ddi_get8(cmd->frame_dma_obj.acc_handle, &hdr->cmd)) {
+ case MFI_CMD_OP_PD_SCSI:
+ case MFI_CMD_OP_LD_SCSI:
+ case MFI_CMD_OP_LD_READ:
+ case MFI_CMD_OP_LD_WRITE:
+ /*
+ * MFI_CMD_OP_PD_SCSI and MFI_CMD_OP_LD_SCSI
+ * could have been issued either through an
+ * IO path or an IOCTL path. If it was via IOCTL,
+ * we will send it to internal completion.
+ */
+ if (cmd->sync_cmd == DRSAS_TRUE) {
+ complete_cmd_in_sync_mode(instance, cmd);
+ break;
+ }
+
+ /* regular commands */
+ acmd = cmd->cmd;
+ pkt = CMD2PKT(acmd);
+
+ if (acmd->cmd_flags & CFLAG_DMAVALID) {
+ if (acmd->cmd_flags & CFLAG_CONSISTENT) {
+ (void) ddi_dma_sync(acmd->cmd_dmahandle,
+ acmd->cmd_dma_offset,
+ acmd->cmd_dma_len,
+ DDI_DMA_SYNC_FORCPU);
+ }
+ }
+
+ pkt->pkt_reason = CMD_CMPLT;
+ pkt->pkt_statistics = 0;
+ pkt->pkt_state = STATE_GOT_BUS
+ | STATE_GOT_TARGET | STATE_SENT_CMD
+ | STATE_XFERRED_DATA | STATE_GOT_STATUS;
+
+ con_log(CL_ANN1, (CE_CONT,
+ "CDB[0] = %x completed for %s: size %lx context %x",
+ pkt->pkt_cdbp[0], ((acmd->islogical) ? "LD" : "PD"),
+ acmd->cmd_dmacount, hdr->context));
+
+ if (pkt->pkt_cdbp[0] == SCMD_INQUIRY) {
+ struct scsi_inquiry *inq;
+
+ if (acmd->cmd_dmacount != 0) {
+ bp_mapin(acmd->cmd_buf);
+ inq = (struct scsi_inquiry *)
+ acmd->cmd_buf->b_un.b_addr;
+
+ /* don't expose physical drives to OS */
+ if (acmd->islogical &&
+ (hdr->cmd_status == MFI_STAT_OK)) {
+ display_scsi_inquiry(
+ (caddr_t)inq);
+ } else if ((hdr->cmd_status ==
+ MFI_STAT_OK) && inq->inq_dtype ==
+ DTYPE_DIRECT) {
+
+ display_scsi_inquiry(
+ (caddr_t)inq);
+
+ /* for physical disk */
+ hdr->cmd_status =
+ MFI_STAT_DEVICE_NOT_FOUND;
+ }
+ }
+ }
+
+ switch (hdr->cmd_status) {
+ case MFI_STAT_OK:
+ pkt->pkt_scbp[0] = STATUS_GOOD;
+ break;
+ case MFI_STAT_LD_CC_IN_PROGRESS:
+ case MFI_STAT_LD_RECON_IN_PROGRESS:
+ pkt->pkt_scbp[0] = STATUS_GOOD;
+ break;
+ case MFI_STAT_LD_INIT_IN_PROGRESS:
+ con_log(CL_ANN,
+ (CE_WARN, "Initialization in Progress"));
+ pkt->pkt_reason = CMD_TRAN_ERR;
+
+ break;
+ case MFI_STAT_SCSI_DONE_WITH_ERROR:
+ con_log(CL_ANN1, (CE_CONT, "scsi_done error"));
+
+ pkt->pkt_reason = CMD_CMPLT;
+ ((struct scsi_status *)
+ pkt->pkt_scbp)->sts_chk = 1;
+
+ if (pkt->pkt_cdbp[0] == SCMD_TEST_UNIT_READY) {
+
+ con_log(CL_ANN,
+ (CE_WARN, "TEST_UNIT_READY fail"));
+
+ } else {
+ pkt->pkt_state |= STATE_ARQ_DONE;
+ arqstat = (void *)(pkt->pkt_scbp);
+ arqstat->sts_rqpkt_reason = CMD_CMPLT;
+ arqstat->sts_rqpkt_resid = 0;
+ arqstat->sts_rqpkt_state |=
+ STATE_GOT_BUS | STATE_GOT_TARGET
+ | STATE_SENT_CMD
+ | STATE_XFERRED_DATA;
+ *(uint8_t *)&arqstat->sts_rqpkt_status =
+ STATUS_GOOD;
+ ddi_rep_get8(
+ cmd->frame_dma_obj.acc_handle,
+ (uint8_t *)
+ &(arqstat->sts_sensedata),
+ cmd->sense,
+ acmd->cmd_scblen -
+ offsetof(struct scsi_arq_status,
+ sts_sensedata), DDI_DEV_AUTOINCR);
+ }
+ break;
+ case MFI_STAT_LD_OFFLINE:
+ case MFI_STAT_DEVICE_NOT_FOUND:
+ con_log(CL_ANN1, (CE_CONT,
+ "device not found error"));
+ pkt->pkt_reason = CMD_DEV_GONE;
+ pkt->pkt_statistics = STAT_DISCON;
+ break;
+ case MFI_STAT_LD_LBA_OUT_OF_RANGE:
+ pkt->pkt_state |= STATE_ARQ_DONE;
+ pkt->pkt_reason = CMD_CMPLT;
+ ((struct scsi_status *)
+ pkt->pkt_scbp)->sts_chk = 1;
+
+ arqstat = (void *)(pkt->pkt_scbp);
+ arqstat->sts_rqpkt_reason = CMD_CMPLT;
+ arqstat->sts_rqpkt_resid = 0;
+ arqstat->sts_rqpkt_state |= STATE_GOT_BUS
+ | STATE_GOT_TARGET | STATE_SENT_CMD
+ | STATE_XFERRED_DATA;
+ *(uint8_t *)&arqstat->sts_rqpkt_status =
+ STATUS_GOOD;
+
+ arqstat->sts_sensedata.es_valid = 1;
+ arqstat->sts_sensedata.es_key =
+ KEY_ILLEGAL_REQUEST;
+ arqstat->sts_sensedata.es_class =
+ CLASS_EXTENDED_SENSE;
+
+ /*
+ * LOGICAL BLOCK ADDRESS OUT OF RANGE:
+ * ASC: 0x21h; ASCQ: 0x00h;
+ */
+ arqstat->sts_sensedata.es_add_code = 0x21;
+ arqstat->sts_sensedata.es_qual_code = 0x00;
+
+ break;
+
+ default:
+ con_log(CL_ANN, (CE_CONT, "Unknown status!"));
+ pkt->pkt_reason = CMD_TRAN_ERR;
+
+ break;
+ }
+
+ atomic_add_16(&instance->fw_outstanding, (-1));
+
+ return_mfi_pkt(instance, cmd);
+
+ (void) drsas_common_check(instance, cmd);
+
+ if (acmd->cmd_dmahandle) {
+ if (drsas_check_dma_handle(
+ acmd->cmd_dmahandle) != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip,
+ DDI_SERVICE_UNAFFECTED);
+ pkt->pkt_reason = CMD_TRAN_ERR;
+ pkt->pkt_statistics = 0;
+ }
+ }
+
+ /* Call the callback routine */
+ if (((pkt->pkt_flags & FLAG_NOINTR) == 0) &&
+ pkt->pkt_comp) {
+ (*pkt->pkt_comp)(pkt);
+ }
+
+ break;
+ case MFI_CMD_OP_SMP:
+ case MFI_CMD_OP_STP:
+ complete_cmd_in_sync_mode(instance, cmd);
+ break;
+ case MFI_CMD_OP_DCMD:
+ /* see if got an event notification */
+ if (ddi_get32(cmd->frame_dma_obj.acc_handle,
+ &cmd->frame->dcmd.opcode) ==
+ DR_DCMD_CTRL_EVENT_WAIT) {
+ if ((instance->aen_cmd == cmd) &&
+ (instance->aen_cmd->abort_aen)) {
+ con_log(CL_ANN, (CE_WARN,
+ "drsas_softintr: "
+ "aborted_aen returned"));
+ } else {
+ atomic_add_16(&instance->fw_outstanding,
+ (-1));
+ service_mfi_aen(instance, cmd);
+ }
+ } else {
+ complete_cmd_in_sync_mode(instance, cmd);
+ }
+
+ break;
+ case MFI_CMD_OP_ABORT:
+ con_log(CL_ANN, (CE_WARN, "MFI_CMD_OP_ABORT complete"));
+ /*
+ * MFI_CMD_OP_ABORT successfully completed
+ * in the synchronous mode
+ */
+ complete_cmd_in_sync_mode(instance, cmd);
+ break;
+ default:
+ drsas_fm_ereport(instance, DDI_FM_DEVICE_NO_RESPONSE);
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
+
+ if (cmd->pkt != NULL) {
+ pkt = cmd->pkt;
+ if (((pkt->pkt_flags & FLAG_NOINTR) == 0) &&
+ pkt->pkt_comp) {
+ (*pkt->pkt_comp)(pkt);
+ }
+ }
+ con_log(CL_ANN, (CE_WARN, "Cmd type unknown !"));
+ break;
+ }
+ }
+
+ instance->softint_running = 0;
+
+ return (DDI_INTR_CLAIMED);
+}
+
+/*
+ * drsas_alloc_dma_obj
+ *
+ * Allocate the memory and other resources for an dma object.
+ */
+static int
+drsas_alloc_dma_obj(struct drsas_instance *instance, dma_obj_t *obj,
+ uchar_t endian_flags)
+{
+ int i;
+ size_t alen = 0;
+ uint_t cookie_cnt;
+ struct ddi_device_acc_attr tmp_endian_attr;
+
+ tmp_endian_attr = endian_attr;
+ tmp_endian_attr.devacc_attr_endian_flags = endian_flags;
+
+ i = ddi_dma_alloc_handle(instance->dip, &obj->dma_attr,
+ DDI_DMA_SLEEP, NULL, &obj->dma_handle);
+ if (i != DDI_SUCCESS) {
+
+ switch (i) {
+ case DDI_DMA_BADATTR :
+ con_log(CL_ANN, (CE_WARN,
+ "Failed ddi_dma_alloc_handle- Bad attribute"));
+ break;
+ case DDI_DMA_NORESOURCES :
+ con_log(CL_ANN, (CE_WARN,
+ "Failed ddi_dma_alloc_handle- No Resources"));
+ break;
+ default :
+ con_log(CL_ANN, (CE_WARN,
+ "Failed ddi_dma_alloc_handle: "
+ "unknown status %d", i));
+ break;
+ }
+
+ return (-1);
+ }
+
+ if ((ddi_dma_mem_alloc(obj->dma_handle, obj->size, &tmp_endian_attr,
+ DDI_DMA_RDWR | DDI_DMA_STREAMING, DDI_DMA_SLEEP, NULL,
+ &obj->buffer, &alen, &obj->acc_handle) != DDI_SUCCESS) ||
+ alen < obj->size) {
+
+ ddi_dma_free_handle(&obj->dma_handle);
+
+ con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_mem_alloc"));
+
+ return (-1);
+ }
+
+ if (ddi_dma_addr_bind_handle(obj->dma_handle, NULL, obj->buffer,
+ obj->size, DDI_DMA_RDWR | DDI_DMA_STREAMING, DDI_DMA_SLEEP,
+ NULL, &obj->dma_cookie[0], &cookie_cnt) != DDI_SUCCESS) {
+
+ ddi_dma_mem_free(&obj->acc_handle);
+ ddi_dma_free_handle(&obj->dma_handle);
+
+ con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_addr_bind_handle"));
+
+ return (-1);
+ }
+
+ if (drsas_check_dma_handle(obj->dma_handle) != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
+ return (-1);
+ }
+
+ if (drsas_check_acc_handle(obj->acc_handle) != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
+ return (-1);
+ }
+
+ return (cookie_cnt);
+}
+
+/*
+ * drsas_free_dma_obj(struct drsas_instance *, dma_obj_t)
+ *
+ * De-allocate the memory and other resources for an dma object, which must
+ * have been alloated by a previous call to drsas_alloc_dma_obj()
+ */
+static int
+drsas_free_dma_obj(struct drsas_instance *instance, dma_obj_t obj)
+{
+
+ if (drsas_check_dma_handle(obj.dma_handle) != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_UNAFFECTED);
+ return (DDI_FAILURE);
+ }
+
+ if (drsas_check_acc_handle(obj.acc_handle) != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_UNAFFECTED);
+ return (DDI_FAILURE);
+ }
+
+ (void) ddi_dma_unbind_handle(obj.dma_handle);
+ ddi_dma_mem_free(&obj.acc_handle);
+ ddi_dma_free_handle(&obj.dma_handle);
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * drsas_dma_alloc(instance_t *, struct scsi_pkt *, struct buf *,
+ * int, int (*)())
+ *
+ * Allocate dma resources for a new scsi command
+ */
+static int
+drsas_dma_alloc(struct drsas_instance *instance, struct scsi_pkt *pkt,
+ struct buf *bp, int flags, int (*callback)())
+{
+ int dma_flags;
+ int (*cb)(caddr_t);
+ int i;
+
+ ddi_dma_attr_t tmp_dma_attr = drsas_generic_dma_attr;
+ struct scsa_cmd *acmd = PKT2CMD(pkt);
+
+ acmd->cmd_buf = bp;
+
+ if (bp->b_flags & B_READ) {
+ acmd->cmd_flags &= ~CFLAG_DMASEND;
+ dma_flags = DDI_DMA_READ;
+ } else {
+ acmd->cmd_flags |= CFLAG_DMASEND;
+ dma_flags = DDI_DMA_WRITE;
+ }
+
+ if (flags & PKT_CONSISTENT) {
+ acmd->cmd_flags |= CFLAG_CONSISTENT;
+ dma_flags |= DDI_DMA_CONSISTENT;
+ }
+
+ if (flags & PKT_DMA_PARTIAL) {
+ dma_flags |= DDI_DMA_PARTIAL;
+ }
+
+ dma_flags |= DDI_DMA_REDZONE;
+
+ cb = (callback == NULL_FUNC) ? DDI_DMA_DONTWAIT : DDI_DMA_SLEEP;
+
+ tmp_dma_attr.dma_attr_sgllen = instance->max_num_sge;
+ tmp_dma_attr.dma_attr_addr_hi = 0xffffffffffffffffull;
+
+ if ((i = ddi_dma_alloc_handle(instance->dip, &tmp_dma_attr,
+ cb, 0, &acmd->cmd_dmahandle)) != DDI_SUCCESS) {
+ switch (i) {
+ case DDI_DMA_BADATTR:
+ bioerror(bp, EFAULT);
+ return (DDI_FAILURE);
+
+ case DDI_DMA_NORESOURCES:
+ bioerror(bp, 0);
+ return (DDI_FAILURE);
+
+ default:
+ con_log(CL_ANN, (CE_PANIC, "ddi_dma_alloc_handle: "
+ "impossible result (0x%x)", i));
+ bioerror(bp, EFAULT);
+ return (DDI_FAILURE);
+ }
+ }
+
+ i = ddi_dma_buf_bind_handle(acmd->cmd_dmahandle, bp, dma_flags,
+ cb, 0, &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies);
+
+ switch (i) {
+ case DDI_DMA_PARTIAL_MAP:
+ if ((dma_flags & DDI_DMA_PARTIAL) == 0) {
+ con_log(CL_ANN, (CE_PANIC, "ddi_dma_buf_bind_handle: "
+ "DDI_DMA_PARTIAL_MAP impossible"));
+ goto no_dma_cookies;
+ }
+
+ if (ddi_dma_numwin(acmd->cmd_dmahandle, &acmd->cmd_nwin) ==
+ DDI_FAILURE) {
+ con_log(CL_ANN, (CE_PANIC, "ddi_dma_numwin failed"));
+ goto no_dma_cookies;
+ }
+
+ if (ddi_dma_getwin(acmd->cmd_dmahandle, acmd->cmd_curwin,
+ &acmd->cmd_dma_offset, &acmd->cmd_dma_len,
+ &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies) ==
+ DDI_FAILURE) {
+
+ con_log(CL_ANN, (CE_PANIC, "ddi_dma_getwin failed"));
+ goto no_dma_cookies;
+ }
+
+ goto get_dma_cookies;
+ case DDI_DMA_MAPPED:
+ acmd->cmd_nwin = 1;
+ acmd->cmd_dma_len = 0;
+ acmd->cmd_dma_offset = 0;
+
+get_dma_cookies:
+ i = 0;
+ acmd->cmd_dmacount = 0;
+ for (;;) {
+ acmd->cmd_dmacount +=
+ acmd->cmd_dmacookies[i++].dmac_size;
+
+ if (i == instance->max_num_sge ||
+ i == acmd->cmd_ncookies)
+ break;
+
+ ddi_dma_nextcookie(acmd->cmd_dmahandle,
+ &acmd->cmd_dmacookies[i]);
+ }
+
+ acmd->cmd_cookie = i;
+ acmd->cmd_cookiecnt = i;
+
+ acmd->cmd_flags |= CFLAG_DMAVALID;
+
+ if (bp->b_bcount >= acmd->cmd_dmacount) {
+ pkt->pkt_resid = bp->b_bcount - acmd->cmd_dmacount;
+ } else {
+ pkt->pkt_resid = 0;
+ }
+
+ return (DDI_SUCCESS);
+ case DDI_DMA_NORESOURCES:
+ bioerror(bp, 0);
+ break;
+ case DDI_DMA_NOMAPPING:
+ bioerror(bp, EFAULT);
+ break;
+ case DDI_DMA_TOOBIG:
+ bioerror(bp, EINVAL);
+ break;
+ case DDI_DMA_INUSE:
+ con_log(CL_ANN, (CE_PANIC, "ddi_dma_buf_bind_handle:"
+ " DDI_DMA_INUSE impossible"));
+ break;
+ default:
+ con_log(CL_ANN, (CE_PANIC, "ddi_dma_buf_bind_handle: "
+ "impossible result (0x%x)", i));
+ break;
+ }
+
+no_dma_cookies:
+ ddi_dma_free_handle(&acmd->cmd_dmahandle);
+ acmd->cmd_dmahandle = NULL;
+ acmd->cmd_flags &= ~CFLAG_DMAVALID;
+ return (DDI_FAILURE);
+}
+
+/*
+ * drsas_dma_move(struct drsas_instance *, struct scsi_pkt *, struct buf *)
+ *
+ * move dma resources to next dma window
+ *
+ */
+static int
+drsas_dma_move(struct drsas_instance *instance, struct scsi_pkt *pkt,
+ struct buf *bp)
+{
+ int i = 0;
+
+ struct scsa_cmd *acmd = PKT2CMD(pkt);
+
+ /*
+ * If there are no more cookies remaining in this window,
+ * must move to the next window first.
+ */
+ if (acmd->cmd_cookie == acmd->cmd_ncookies) {
+ if (acmd->cmd_curwin == acmd->cmd_nwin && acmd->cmd_nwin == 1) {
+ return (DDI_SUCCESS);
+ }
+
+ /* at last window, cannot move */
+ if (++acmd->cmd_curwin >= acmd->cmd_nwin) {
+ return (DDI_FAILURE);
+ }
+
+ if (ddi_dma_getwin(acmd->cmd_dmahandle, acmd->cmd_curwin,
+ &acmd->cmd_dma_offset, &acmd->cmd_dma_len,
+ &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies) ==
+ DDI_FAILURE) {
+ return (DDI_FAILURE);
+ }
+
+ acmd->cmd_cookie = 0;
+ } else {
+ /* still more cookies in this window - get the next one */
+ ddi_dma_nextcookie(acmd->cmd_dmahandle,
+ &acmd->cmd_dmacookies[0]);
+ }
+
+ /* get remaining cookies in this window, up to our maximum */
+ for (;;) {
+ acmd->cmd_dmacount += acmd->cmd_dmacookies[i++].dmac_size;
+ acmd->cmd_cookie++;
+
+ if (i == instance->max_num_sge ||
+ acmd->cmd_cookie == acmd->cmd_ncookies) {
+ break;
+ }
+
+ ddi_dma_nextcookie(acmd->cmd_dmahandle,
+ &acmd->cmd_dmacookies[i]);
+ }
+
+ acmd->cmd_cookiecnt = i;
+
+ if (bp->b_bcount >= acmd->cmd_dmacount) {
+ pkt->pkt_resid = bp->b_bcount - acmd->cmd_dmacount;
+ } else {
+ pkt->pkt_resid = 0;
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * build_cmd
+ */
+static struct drsas_cmd *
+build_cmd(struct drsas_instance *instance, struct scsi_address *ap,
+ struct scsi_pkt *pkt, uchar_t *cmd_done)
+{
+ uint16_t flags = 0;
+ uint32_t i;
+ uint32_t context;
+ uint32_t sge_bytes;
+ ddi_acc_handle_t acc_handle;
+ struct drsas_cmd *cmd;
+ struct drsas_sge64 *mfi_sgl;
+ struct scsa_cmd *acmd = PKT2CMD(pkt);
+ struct drsas_pthru_frame *pthru;
+ struct drsas_io_frame *ldio;
+
+ /* find out if this is logical or physical drive command. */
+ acmd->islogical = MRDRV_IS_LOGICAL(ap);
+ acmd->device_id = MAP_DEVICE_ID(instance, ap);
+ *cmd_done = 0;
+
+ /* get the command packet */
+ if (!(cmd = get_mfi_pkt(instance))) {
+ return (NULL);
+ }
+
+ acc_handle = cmd->frame_dma_obj.acc_handle;
+
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(acc_handle, &cmd->frame->hdr.context, cmd->index);
+
+ cmd->pkt = pkt;
+ cmd->cmd = acmd;
+
+ /* lets get the command directions */
+ if (acmd->cmd_flags & CFLAG_DMASEND) {
+ flags = MFI_FRAME_DIR_WRITE;
+
+ if (acmd->cmd_flags & CFLAG_CONSISTENT) {
+ (void) ddi_dma_sync(acmd->cmd_dmahandle,
+ acmd->cmd_dma_offset, acmd->cmd_dma_len,
+ DDI_DMA_SYNC_FORDEV);
+ }
+ } else if (acmd->cmd_flags & ~CFLAG_DMASEND) {
+ flags = MFI_FRAME_DIR_READ;
+
+ if (acmd->cmd_flags & CFLAG_CONSISTENT) {
+ (void) ddi_dma_sync(acmd->cmd_dmahandle,
+ acmd->cmd_dma_offset, acmd->cmd_dma_len,
+ DDI_DMA_SYNC_FORCPU);
+ }
+ } else {
+ flags = MFI_FRAME_DIR_NONE;
+ }
+
+ flags |= MFI_FRAME_SGL64;
+
+ switch (pkt->pkt_cdbp[0]) {
+
+ /*
+ * case SCMD_SYNCHRONIZE_CACHE:
+ * flush_cache(instance);
+ * return_mfi_pkt(instance, cmd);
+ * *cmd_done = 1;
+ *
+ * return (NULL);
+ */
+
+ case SCMD_READ:
+ case SCMD_WRITE:
+ case SCMD_READ_G1:
+ case SCMD_WRITE_G1:
+ if (acmd->islogical) {
+ ldio = (struct drsas_io_frame *)cmd->frame;
+
+ /*
+ * preare the Logical IO frame:
+ * 2nd bit is zero for all read cmds
+ */
+ ddi_put8(acc_handle, &ldio->cmd,
+ (pkt->pkt_cdbp[0] & 0x02) ? MFI_CMD_OP_LD_WRITE
+ : MFI_CMD_OP_LD_READ);
+ ddi_put8(acc_handle, &ldio->cmd_status, 0x0);
+ ddi_put8(acc_handle, &ldio->scsi_status, 0x0);
+ ddi_put8(acc_handle, &ldio->target_id, acmd->device_id);
+ ddi_put16(acc_handle, &ldio->timeout, 0);
+ ddi_put8(acc_handle, &ldio->reserved_0, 0);
+ ddi_put16(acc_handle, &ldio->pad_0, 0);
+ ddi_put16(acc_handle, &ldio->flags, flags);
+
+ /* Initialize sense Information */
+ bzero(cmd->sense, SENSE_LENGTH);
+ ddi_put8(acc_handle, &ldio->sense_len, SENSE_LENGTH);
+ ddi_put32(acc_handle, &ldio->sense_buf_phys_addr_hi, 0);
+ ddi_put32(acc_handle, &ldio->sense_buf_phys_addr_lo,
+ cmd->sense_phys_addr);
+ ddi_put32(acc_handle, &ldio->start_lba_hi, 0);
+ ddi_put8(acc_handle, &ldio->access_byte,
+ (acmd->cmd_cdblen != 6) ? pkt->pkt_cdbp[1] : 0);
+ ddi_put8(acc_handle, &ldio->sge_count,
+ acmd->cmd_cookiecnt);
+ mfi_sgl = (struct drsas_sge64 *)&ldio->sgl;
+
+ context = ddi_get32(acc_handle, &ldio->context);
+
+ if (acmd->cmd_cdblen == CDB_GROUP0) {
+ ddi_put32(acc_handle, &ldio->lba_count, (
+ (uint16_t)(pkt->pkt_cdbp[4])));
+
+ ddi_put32(acc_handle, &ldio->start_lba_lo, (
+ ((uint32_t)(pkt->pkt_cdbp[3])) |
+ ((uint32_t)(pkt->pkt_cdbp[2]) << 8) |
+ ((uint32_t)((pkt->pkt_cdbp[1]) & 0x1F)
+ << 16)));
+ } else if (acmd->cmd_cdblen == CDB_GROUP1) {
+ ddi_put32(acc_handle, &ldio->lba_count, (
+ ((uint16_t)(pkt->pkt_cdbp[8])) |
+ ((uint16_t)(pkt->pkt_cdbp[7]) << 8)));
+
+ ddi_put32(acc_handle, &ldio->start_lba_lo, (
+ ((uint32_t)(pkt->pkt_cdbp[5])) |
+ ((uint32_t)(pkt->pkt_cdbp[4]) << 8) |
+ ((uint32_t)(pkt->pkt_cdbp[3]) << 16) |
+ ((uint32_t)(pkt->pkt_cdbp[2]) << 24)));
+ } else if (acmd->cmd_cdblen == CDB_GROUP2) {
+ ddi_put32(acc_handle, &ldio->lba_count, (
+ ((uint16_t)(pkt->pkt_cdbp[9])) |
+ ((uint16_t)(pkt->pkt_cdbp[8]) << 8) |
+ ((uint16_t)(pkt->pkt_cdbp[7]) << 16) |
+ ((uint16_t)(pkt->pkt_cdbp[6]) << 24)));
+
+ ddi_put32(acc_handle, &ldio->start_lba_lo, (
+ ((uint32_t)(pkt->pkt_cdbp[5])) |
+ ((uint32_t)(pkt->pkt_cdbp[4]) << 8) |
+ ((uint32_t)(pkt->pkt_cdbp[3]) << 16) |
+ ((uint32_t)(pkt->pkt_cdbp[2]) << 24)));
+ } else if (acmd->cmd_cdblen == CDB_GROUP3) {
+ ddi_put32(acc_handle, &ldio->lba_count, (
+ ((uint16_t)(pkt->pkt_cdbp[13])) |
+ ((uint16_t)(pkt->pkt_cdbp[12]) << 8) |
+ ((uint16_t)(pkt->pkt_cdbp[11]) << 16) |
+ ((uint16_t)(pkt->pkt_cdbp[10]) << 24)));
+
+ ddi_put32(acc_handle, &ldio->start_lba_lo, (
+ ((uint32_t)(pkt->pkt_cdbp[9])) |
+ ((uint32_t)(pkt->pkt_cdbp[8]) << 8) |
+ ((uint32_t)(pkt->pkt_cdbp[7]) << 16) |
+ ((uint32_t)(pkt->pkt_cdbp[6]) << 24)));
+
+ ddi_put32(acc_handle, &ldio->start_lba_lo, (
+ ((uint32_t)(pkt->pkt_cdbp[5])) |
+ ((uint32_t)(pkt->pkt_cdbp[4]) << 8) |
+ ((uint32_t)(pkt->pkt_cdbp[3]) << 16) |
+ ((uint32_t)(pkt->pkt_cdbp[2]) << 24)));
+ }
+
+ break;
+ }
+ /* fall through For all non-rd/wr cmds */
+ default:
+
+ switch (pkt->pkt_cdbp[0]) {
+ case SCMD_MODE_SENSE:
+ case SCMD_MODE_SENSE_G1: {
+ union scsi_cdb *cdbp;
+ uint16_t page_code;
+
+ cdbp = (void *)pkt->pkt_cdbp;
+ page_code = (uint16_t)cdbp->cdb_un.sg.scsi[0];
+ switch (page_code) {
+ case 0x3:
+ case 0x4:
+ (void) drsas_mode_sense_build(pkt);
+ return_mfi_pkt(instance, cmd);
+ *cmd_done = 1;
+ return (NULL);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ pthru = (struct drsas_pthru_frame *)cmd->frame;
+
+ /* prepare the DCDB frame */
+ ddi_put8(acc_handle, &pthru->cmd, (acmd->islogical) ?
+ MFI_CMD_OP_LD_SCSI : MFI_CMD_OP_PD_SCSI);
+ ddi_put8(acc_handle, &pthru->cmd_status, 0x0);
+ ddi_put8(acc_handle, &pthru->scsi_status, 0x0);
+ ddi_put8(acc_handle, &pthru->target_id, acmd->device_id);
+ ddi_put8(acc_handle, &pthru->lun, 0);
+ ddi_put8(acc_handle, &pthru->cdb_len, acmd->cmd_cdblen);
+ ddi_put16(acc_handle, &pthru->timeout, 0);
+ ddi_put16(acc_handle, &pthru->flags, flags);
+ ddi_put32(acc_handle, &pthru->data_xfer_len,
+ acmd->cmd_dmacount);
+ ddi_put8(acc_handle, &pthru->sge_count, acmd->cmd_cookiecnt);
+ mfi_sgl = (struct drsas_sge64 *)&pthru->sgl;
+
+ bzero(cmd->sense, SENSE_LENGTH);
+ ddi_put8(acc_handle, &pthru->sense_len, SENSE_LENGTH);
+ ddi_put32(acc_handle, &pthru->sense_buf_phys_addr_hi, 0);
+ ddi_put32(acc_handle, &pthru->sense_buf_phys_addr_lo,
+ cmd->sense_phys_addr);
+
+ context = ddi_get32(acc_handle, &pthru->context);
+ ddi_rep_put8(acc_handle, (uint8_t *)pkt->pkt_cdbp,
+ (uint8_t *)pthru->cdb, acmd->cmd_cdblen, DDI_DEV_AUTOINCR);
+
+ break;
+ }
+#ifdef lint
+ context = context;
+#endif
+ /* prepare the scatter-gather list for the firmware */
+ for (i = 0; i < acmd->cmd_cookiecnt; i++, mfi_sgl++) {
+ ddi_put64(acc_handle, &mfi_sgl->phys_addr,
+ acmd->cmd_dmacookies[i].dmac_laddress);
+ ddi_put32(acc_handle, &mfi_sgl->length,
+ acmd->cmd_dmacookies[i].dmac_size);
+ }
+
+ sge_bytes = sizeof (struct drsas_sge64)*acmd->cmd_cookiecnt;
+
+ cmd->frame_count = (sge_bytes / MRMFI_FRAME_SIZE) +
+ ((sge_bytes % MRMFI_FRAME_SIZE) ? 1 : 0) + 1;
+
+ if (cmd->frame_count >= 8) {
+ cmd->frame_count = 8;
+ }
+
+ return (cmd);
+}
+
+/*
+ * issue_mfi_pthru
+ */
+static int
+issue_mfi_pthru(struct drsas_instance *instance, struct drsas_ioctl *ioctl,
+ struct drsas_cmd *cmd, int mode)
+{
+ void *ubuf;
+ uint32_t kphys_addr = 0;
+ uint32_t xferlen = 0;
+ uint_t model;
+ ddi_acc_handle_t acc_handle = cmd->frame_dma_obj.acc_handle;
+ dma_obj_t pthru_dma_obj;
+ struct drsas_pthru_frame *kpthru;
+ struct drsas_pthru_frame *pthru;
+ int i;
+ pthru = &cmd->frame->pthru;
+ kpthru = (struct drsas_pthru_frame *)&ioctl->frame[0];
+
+ model = ddi_model_convert_from(mode & FMODELS);
+ if (model == DDI_MODEL_ILP32) {
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_pthru: DDI_MODEL_LP32"));
+
+ xferlen = kpthru->sgl.sge32[0].length;
+
+ ubuf = (void *)(ulong_t)kpthru->sgl.sge32[0].phys_addr;
+ } else {
+#ifdef _ILP32
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_pthru: DDI_MODEL_LP32"));
+ xferlen = kpthru->sgl.sge32[0].length;
+ ubuf = (void *)(ulong_t)kpthru->sgl.sge32[0].phys_addr;
+#else
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_pthru: DDI_MODEL_LP64"));
+ xferlen = kpthru->sgl.sge64[0].length;
+ ubuf = (void *)(ulong_t)kpthru->sgl.sge64[0].phys_addr;
+#endif
+ }
+
+ if (xferlen) {
+ /* means IOCTL requires DMA */
+ /* allocate the data transfer buffer */
+ pthru_dma_obj.size = xferlen;
+ pthru_dma_obj.dma_attr = drsas_generic_dma_attr;
+ pthru_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ pthru_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ pthru_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ pthru_dma_obj.dma_attr.dma_attr_align = 1;
+
+ /* allocate kernel buffer for DMA */
+ if (drsas_alloc_dma_obj(instance, &pthru_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_pthru: "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ /* If IOCTL requires DMA WRITE, do ddi_copyin IOCTL data copy */
+ if (kpthru->flags & MFI_FRAME_DIR_WRITE) {
+ for (i = 0; i < xferlen; i++) {
+ if (ddi_copyin((uint8_t *)ubuf+i,
+ (uint8_t *)pthru_dma_obj.buffer+i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_pthru : "
+ "copy from user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ kphys_addr = pthru_dma_obj.dma_cookie[0].dmac_address;
+ }
+
+ ddi_put8(acc_handle, &pthru->cmd, kpthru->cmd);
+ ddi_put8(acc_handle, &pthru->sense_len, kpthru->sense_len);
+ ddi_put8(acc_handle, &pthru->cmd_status, 0);
+ ddi_put8(acc_handle, &pthru->scsi_status, 0);
+ ddi_put8(acc_handle, &pthru->target_id, kpthru->target_id);
+ ddi_put8(acc_handle, &pthru->lun, kpthru->lun);
+ ddi_put8(acc_handle, &pthru->cdb_len, kpthru->cdb_len);
+ ddi_put8(acc_handle, &pthru->sge_count, kpthru->sge_count);
+ ddi_put16(acc_handle, &pthru->timeout, kpthru->timeout);
+ ddi_put32(acc_handle, &pthru->data_xfer_len, kpthru->data_xfer_len);
+
+ ddi_put32(acc_handle, &pthru->sense_buf_phys_addr_hi, 0);
+ /* pthru->sense_buf_phys_addr_lo = cmd->sense_phys_addr; */
+ ddi_put32(acc_handle, &pthru->sense_buf_phys_addr_lo, 0);
+
+ ddi_rep_put8(acc_handle, (uint8_t *)kpthru->cdb, (uint8_t *)pthru->cdb,
+ pthru->cdb_len, DDI_DEV_AUTOINCR);
+
+ ddi_put16(acc_handle, &pthru->flags, kpthru->flags & ~MFI_FRAME_SGL64);
+ ddi_put32(acc_handle, &pthru->sgl.sge32[0].length, xferlen);
+ ddi_put32(acc_handle, &pthru->sgl.sge32[0].phys_addr, kphys_addr);
+
+ cmd->sync_cmd = DRSAS_TRUE;
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_sync_mode(instance, cmd)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_pthru: fw_ioctl failed"));
+ } else {
+ if (xferlen && kpthru->flags & MFI_FRAME_DIR_READ) {
+ for (i = 0; i < xferlen; i++) {
+ if (ddi_copyout(
+ (uint8_t *)pthru_dma_obj.buffer+i,
+ (uint8_t *)ubuf+i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_pthru : "
+ "copy to user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+ }
+
+ kpthru->cmd_status = ddi_get8(acc_handle, &pthru->cmd_status);
+ kpthru->scsi_status = ddi_get8(acc_handle, &pthru->scsi_status);
+
+ con_log(CL_ANN, (CE_NOTE, "issue_mfi_pthru: cmd_status %x, "
+ "scsi_status %x", kpthru->cmd_status, kpthru->scsi_status));
+
+ if (xferlen) {
+ /* free kernel buffer */
+ if (drsas_free_dma_obj(instance, pthru_dma_obj) != DDI_SUCCESS)
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * issue_mfi_dcmd
+ */
+static int
+issue_mfi_dcmd(struct drsas_instance *instance, struct drsas_ioctl *ioctl,
+ struct drsas_cmd *cmd, int mode)
+{
+ void *ubuf;
+ uint32_t kphys_addr = 0;
+ uint32_t xferlen = 0;
+ uint32_t model;
+ dma_obj_t dcmd_dma_obj;
+ struct drsas_dcmd_frame *kdcmd;
+ struct drsas_dcmd_frame *dcmd;
+ ddi_acc_handle_t acc_handle = cmd->frame_dma_obj.acc_handle;
+ int i;
+ dcmd = &cmd->frame->dcmd;
+ kdcmd = (struct drsas_dcmd_frame *)&ioctl->frame[0];
+
+ model = ddi_model_convert_from(mode & FMODELS);
+ if (model == DDI_MODEL_ILP32) {
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_dcmd: DDI_MODEL_ILP32"));
+
+ xferlen = kdcmd->sgl.sge32[0].length;
+
+ ubuf = (void *)(ulong_t)kdcmd->sgl.sge32[0].phys_addr;
+ } else {
+#ifdef _ILP32
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_dcmd: DDI_MODEL_ILP32"));
+ xferlen = kdcmd->sgl.sge32[0].length;
+ ubuf = (void *)(ulong_t)kdcmd->sgl.sge32[0].phys_addr;
+#else
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_dcmd: DDI_MODEL_LP64"));
+ xferlen = kdcmd->sgl.sge64[0].length;
+ ubuf = (void *)(ulong_t)kdcmd->sgl.sge64[0].phys_addr;
+#endif
+ }
+ if (xferlen) {
+ /* means IOCTL requires DMA */
+ /* allocate the data transfer buffer */
+ dcmd_dma_obj.size = xferlen;
+ dcmd_dma_obj.dma_attr = drsas_generic_dma_attr;
+ dcmd_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ dcmd_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ dcmd_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ dcmd_dma_obj.dma_attr.dma_attr_align = 1;
+
+ /* allocate kernel buffer for DMA */
+ if (drsas_alloc_dma_obj(instance, &dcmd_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_dcmd: "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ /* If IOCTL requires DMA WRITE, do ddi_copyin IOCTL data copy */
+ if (kdcmd->flags & MFI_FRAME_DIR_WRITE) {
+ for (i = 0; i < xferlen; i++) {
+ if (ddi_copyin((uint8_t *)ubuf + i,
+ (uint8_t *)dcmd_dma_obj.buffer + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_dcmd : "
+ "copy from user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ kphys_addr = dcmd_dma_obj.dma_cookie[0].dmac_address;
+ }
+
+ ddi_put8(acc_handle, &dcmd->cmd, kdcmd->cmd);
+ ddi_put8(acc_handle, &dcmd->cmd_status, 0);
+ ddi_put8(acc_handle, &dcmd->sge_count, kdcmd->sge_count);
+ ddi_put16(acc_handle, &dcmd->timeout, kdcmd->timeout);
+ ddi_put32(acc_handle, &dcmd->data_xfer_len, kdcmd->data_xfer_len);
+ ddi_put32(acc_handle, &dcmd->opcode, kdcmd->opcode);
+
+ ddi_rep_put8(acc_handle, (uint8_t *)kdcmd->mbox.b,
+ (uint8_t *)dcmd->mbox.b, DCMD_MBOX_SZ, DDI_DEV_AUTOINCR);
+
+ ddi_put16(acc_handle, &dcmd->flags, kdcmd->flags & ~MFI_FRAME_SGL64);
+ ddi_put32(acc_handle, &dcmd->sgl.sge32[0].length, xferlen);
+ ddi_put32(acc_handle, &dcmd->sgl.sge32[0].phys_addr, kphys_addr);
+
+ cmd->sync_cmd = DRSAS_TRUE;
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_sync_mode(instance, cmd)) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_dcmd: fw_ioctl failed"));
+ } else {
+ if (xferlen && (kdcmd->flags & MFI_FRAME_DIR_READ)) {
+ for (i = 0; i < xferlen; i++) {
+ if (ddi_copyout(
+ (uint8_t *)dcmd_dma_obj.buffer + i,
+ (uint8_t *)ubuf + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_dcmd : "
+ "copy to user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+ }
+
+ kdcmd->cmd_status = ddi_get8(acc_handle, &dcmd->cmd_status);
+
+ if (xferlen) {
+ /* free kernel buffer */
+ if (drsas_free_dma_obj(instance, dcmd_dma_obj) != DDI_SUCCESS)
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * issue_mfi_smp
+ */
+static int
+issue_mfi_smp(struct drsas_instance *instance, struct drsas_ioctl *ioctl,
+ struct drsas_cmd *cmd, int mode)
+{
+ void *request_ubuf;
+ void *response_ubuf;
+ uint32_t request_xferlen = 0;
+ uint32_t response_xferlen = 0;
+ uint_t model;
+ dma_obj_t request_dma_obj;
+ dma_obj_t response_dma_obj;
+ ddi_acc_handle_t acc_handle = cmd->frame_dma_obj.acc_handle;
+ struct drsas_smp_frame *ksmp;
+ struct drsas_smp_frame *smp;
+ struct drsas_sge32 *sge32;
+#ifndef _ILP32
+ struct drsas_sge64 *sge64;
+#endif
+ int i;
+ uint64_t tmp_sas_addr;
+
+ smp = &cmd->frame->smp;
+ ksmp = (struct drsas_smp_frame *)&ioctl->frame[0];
+
+ model = ddi_model_convert_from(mode & FMODELS);
+ if (model == DDI_MODEL_ILP32) {
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp: DDI_MODEL_ILP32"));
+
+ sge32 = &ksmp->sgl[0].sge32[0];
+ response_xferlen = sge32[0].length;
+ request_xferlen = sge32[1].length;
+ con_log(CL_ANN, (CE_NOTE, "issue_mfi_smp: "
+ "response_xferlen = %x, request_xferlen = %x",
+ response_xferlen, request_xferlen));
+
+ response_ubuf = (void *)(ulong_t)sge32[0].phys_addr;
+ request_ubuf = (void *)(ulong_t)sge32[1].phys_addr;
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp: "
+ "response_ubuf = %p, request_ubuf = %p",
+ response_ubuf, request_ubuf));
+ } else {
+#ifdef _ILP32
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp: DDI_MODEL_ILP32"));
+
+ sge32 = &ksmp->sgl[0].sge32[0];
+ response_xferlen = sge32[0].length;
+ request_xferlen = sge32[1].length;
+ con_log(CL_ANN, (CE_NOTE, "issue_mfi_smp: "
+ "response_xferlen = %x, request_xferlen = %x",
+ response_xferlen, request_xferlen));
+
+ response_ubuf = (void *)(ulong_t)sge32[0].phys_addr;
+ request_ubuf = (void *)(ulong_t)sge32[1].phys_addr;
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp: "
+ "response_ubuf = %p, request_ubuf = %p",
+ response_ubuf, request_ubuf));
+#else
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp: DDI_MODEL_LP64"));
+
+ sge64 = &ksmp->sgl[0].sge64[0];
+ response_xferlen = sge64[0].length;
+ request_xferlen = sge64[1].length;
+
+ response_ubuf = (void *)(ulong_t)sge64[0].phys_addr;
+ request_ubuf = (void *)(ulong_t)sge64[1].phys_addr;
+#endif
+ }
+ if (request_xferlen) {
+ /* means IOCTL requires DMA */
+ /* allocate the data transfer buffer */
+ request_dma_obj.size = request_xferlen;
+ request_dma_obj.dma_attr = drsas_generic_dma_attr;
+ request_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ request_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ request_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ request_dma_obj.dma_attr.dma_attr_align = 1;
+
+ /* allocate kernel buffer for DMA */
+ if (drsas_alloc_dma_obj(instance, &request_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_smp: "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ /* If IOCTL requires DMA WRITE, do ddi_copyin IOCTL data copy */
+ for (i = 0; i < request_xferlen; i++) {
+ if (ddi_copyin((uint8_t *)request_ubuf + i,
+ (uint8_t *)request_dma_obj.buffer + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_smp: "
+ "copy from user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ if (response_xferlen) {
+ /* means IOCTL requires DMA */
+ /* allocate the data transfer buffer */
+ response_dma_obj.size = response_xferlen;
+ response_dma_obj.dma_attr = drsas_generic_dma_attr;
+ response_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ response_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ response_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ response_dma_obj.dma_attr.dma_attr_align = 1;
+
+ /* allocate kernel buffer for DMA */
+ if (drsas_alloc_dma_obj(instance, &response_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_smp: "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ /* If IOCTL requires DMA WRITE, do ddi_copyin IOCTL data copy */
+ for (i = 0; i < response_xferlen; i++) {
+ if (ddi_copyin((uint8_t *)response_ubuf + i,
+ (uint8_t *)response_dma_obj.buffer + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_smp: "
+ "copy from user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ ddi_put8(acc_handle, &smp->cmd, ksmp->cmd);
+ ddi_put8(acc_handle, &smp->cmd_status, 0);
+ ddi_put8(acc_handle, &smp->connection_status, 0);
+ ddi_put8(acc_handle, &smp->sge_count, ksmp->sge_count);
+ /* smp->context = ksmp->context; */
+ ddi_put16(acc_handle, &smp->timeout, ksmp->timeout);
+ ddi_put32(acc_handle, &smp->data_xfer_len, ksmp->data_xfer_len);
+
+ bcopy((void *)&ksmp->sas_addr, (void *)&tmp_sas_addr,
+ sizeof (uint64_t));
+ ddi_put64(acc_handle, &smp->sas_addr, tmp_sas_addr);
+
+ ddi_put16(acc_handle, &smp->flags, ksmp->flags & ~MFI_FRAME_SGL64);
+
+ model = ddi_model_convert_from(mode & FMODELS);
+ if (model == DDI_MODEL_ILP32) {
+ con_log(CL_ANN1, (CE_NOTE,
+ "handle_drv_ioctl: DDI_MODEL_ILP32"));
+
+ sge32 = &smp->sgl[0].sge32[0];
+ ddi_put32(acc_handle, &sge32[0].length, response_xferlen);
+ ddi_put32(acc_handle, &sge32[0].phys_addr,
+ response_dma_obj.dma_cookie[0].dmac_address);
+ ddi_put32(acc_handle, &sge32[1].length, request_xferlen);
+ ddi_put32(acc_handle, &sge32[1].phys_addr,
+ request_dma_obj.dma_cookie[0].dmac_address);
+ } else {
+#ifdef _ILP32
+ con_log(CL_ANN1, (CE_NOTE,
+ "handle_drv_ioctl: DDI_MODEL_ILP32"));
+ sge32 = &smp->sgl[0].sge32[0];
+ ddi_put32(acc_handle, &sge32[0].length, response_xferlen);
+ ddi_put32(acc_handle, &sge32[0].phys_addr,
+ response_dma_obj.dma_cookie[0].dmac_address);
+ ddi_put32(acc_handle, &sge32[1].length, request_xferlen);
+ ddi_put32(acc_handle, &sge32[1].phys_addr,
+ request_dma_obj.dma_cookie[0].dmac_address);
+#else
+ con_log(CL_ANN1, (CE_NOTE,
+ "issue_mfi_smp: DDI_MODEL_LP64"));
+ sge64 = &smp->sgl[0].sge64[0];
+ ddi_put32(acc_handle, &sge64[0].length, response_xferlen);
+ ddi_put64(acc_handle, &sge64[0].phys_addr,
+ response_dma_obj.dma_cookie[0].dmac_address);
+ ddi_put32(acc_handle, &sge64[1].length, request_xferlen);
+ ddi_put64(acc_handle, &sge64[1].phys_addr,
+ request_dma_obj.dma_cookie[0].dmac_address);
+#endif
+ }
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp : "
+ "smp->response_xferlen = %d, smp->request_xferlen = %d "
+ "smp->data_xfer_len = %d", ddi_get32(acc_handle, &sge32[0].length),
+ ddi_get32(acc_handle, &sge32[1].length),
+ ddi_get32(acc_handle, &smp->data_xfer_len)));
+
+ cmd->sync_cmd = DRSAS_TRUE;
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_sync_mode(instance, cmd)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_smp: fw_ioctl failed"));
+ } else {
+ con_log(CL_ANN1, (CE_NOTE,
+ "issue_mfi_smp: copy to user space"));
+
+ if (request_xferlen) {
+ for (i = 0; i < request_xferlen; i++) {
+ if (ddi_copyout(
+ (uint8_t *)request_dma_obj.buffer +
+ i, (uint8_t *)request_ubuf + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_smp : copy to user space"
+ " failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ if (response_xferlen) {
+ for (i = 0; i < response_xferlen; i++) {
+ if (ddi_copyout(
+ (uint8_t *)response_dma_obj.buffer
+ + i, (uint8_t *)response_ubuf
+ + i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_smp : copy to "
+ "user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+ }
+
+ ksmp->cmd_status = ddi_get8(acc_handle, &smp->cmd_status);
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_smp: smp->cmd_status = %d",
+ ddi_get8(acc_handle, &smp->cmd_status)));
+
+
+ if (request_xferlen) {
+ /* free kernel buffer */
+ if (drsas_free_dma_obj(instance, request_dma_obj) !=
+ DDI_SUCCESS)
+ return (DDI_FAILURE);
+ }
+
+ if (response_xferlen) {
+ /* free kernel buffer */
+ if (drsas_free_dma_obj(instance, response_dma_obj) !=
+ DDI_SUCCESS)
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * issue_mfi_stp
+ */
+static int
+issue_mfi_stp(struct drsas_instance *instance, struct drsas_ioctl *ioctl,
+ struct drsas_cmd *cmd, int mode)
+{
+ void *fis_ubuf;
+ void *data_ubuf;
+ uint32_t fis_xferlen = 0;
+ uint32_t data_xferlen = 0;
+ uint_t model;
+ dma_obj_t fis_dma_obj;
+ dma_obj_t data_dma_obj;
+ struct drsas_stp_frame *kstp;
+ struct drsas_stp_frame *stp;
+ ddi_acc_handle_t acc_handle = cmd->frame_dma_obj.acc_handle;
+ int i;
+
+ stp = &cmd->frame->stp;
+ kstp = (struct drsas_stp_frame *)&ioctl->frame[0];
+
+ model = ddi_model_convert_from(mode & FMODELS);
+ if (model == DDI_MODEL_ILP32) {
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_stp: DDI_MODEL_ILP32"));
+
+ fis_xferlen = kstp->sgl.sge32[0].length;
+ data_xferlen = kstp->sgl.sge32[1].length;
+
+ fis_ubuf = (void *)(ulong_t)kstp->sgl.sge32[0].phys_addr;
+ data_ubuf = (void *)(ulong_t)kstp->sgl.sge32[1].phys_addr;
+ }
+ else
+ {
+#ifdef _ILP32
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_stp: DDI_MODEL_ILP32"));
+
+ fis_xferlen = kstp->sgl.sge32[0].length;
+ data_xferlen = kstp->sgl.sge32[1].length;
+
+ fis_ubuf = (void *)(ulong_t)kstp->sgl.sge32[0].phys_addr;
+ data_ubuf = (void *)(ulong_t)kstp->sgl.sge32[1].phys_addr;
+#else
+ con_log(CL_ANN1, (CE_NOTE, "issue_mfi_stp: DDI_MODEL_LP64"));
+
+ fis_xferlen = kstp->sgl.sge64[0].length;
+ data_xferlen = kstp->sgl.sge64[1].length;
+
+ fis_ubuf = (void *)(ulong_t)kstp->sgl.sge64[0].phys_addr;
+ data_ubuf = (void *)(ulong_t)kstp->sgl.sge64[1].phys_addr;
+#endif
+ }
+
+
+ if (fis_xferlen) {
+ con_log(CL_ANN, (CE_NOTE, "issue_mfi_stp: "
+ "fis_ubuf = %p fis_xferlen = %x", fis_ubuf, fis_xferlen));
+
+ /* means IOCTL requires DMA */
+ /* allocate the data transfer buffer */
+ fis_dma_obj.size = fis_xferlen;
+ fis_dma_obj.dma_attr = drsas_generic_dma_attr;
+ fis_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ fis_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ fis_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ fis_dma_obj.dma_attr.dma_attr_align = 1;
+
+ /* allocate kernel buffer for DMA */
+ if (drsas_alloc_dma_obj(instance, &fis_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_stp : "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ /* If IOCTL requires DMA WRITE, do ddi_copyin IOCTL data copy */
+ for (i = 0; i < fis_xferlen; i++) {
+ if (ddi_copyin((uint8_t *)fis_ubuf + i,
+ (uint8_t *)fis_dma_obj.buffer + i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_stp: "
+ "copy from user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ if (data_xferlen) {
+ con_log(CL_ANN, (CE_NOTE, "issue_mfi_stp: data_ubuf = %p "
+ "data_xferlen = %x", data_ubuf, data_xferlen));
+
+ /* means IOCTL requires DMA */
+ /* allocate the data transfer buffer */
+ data_dma_obj.size = data_xferlen;
+ data_dma_obj.dma_attr = drsas_generic_dma_attr;
+ data_dma_obj.dma_attr.dma_attr_addr_hi = 0xFFFFFFFFU;
+ data_dma_obj.dma_attr.dma_attr_count_max = 0xFFFFFFFFU;
+ data_dma_obj.dma_attr.dma_attr_sgllen = 1;
+ data_dma_obj.dma_attr.dma_attr_align = 1;
+
+/* allocate kernel buffer for DMA */
+ if (drsas_alloc_dma_obj(instance, &data_dma_obj,
+ (uchar_t)DDI_STRUCTURE_LE_ACC) != 1) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_stp: "
+ "could not allocate data transfer buffer."));
+ return (DDI_FAILURE);
+ }
+
+ /* If IOCTL requires DMA WRITE, do ddi_copyin IOCTL data copy */
+ for (i = 0; i < data_xferlen; i++) {
+ if (ddi_copyin((uint8_t *)data_ubuf + i,
+ (uint8_t *)data_dma_obj.buffer + i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_stp: "
+ "copy from user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ ddi_put8(acc_handle, &stp->cmd, kstp->cmd);
+ ddi_put8(acc_handle, &stp->cmd_status, 0);
+ ddi_put8(acc_handle, &stp->connection_status, 0);
+ ddi_put8(acc_handle, &stp->target_id, kstp->target_id);
+ ddi_put8(acc_handle, &stp->sge_count, kstp->sge_count);
+
+ ddi_put16(acc_handle, &stp->timeout, kstp->timeout);
+ ddi_put32(acc_handle, &stp->data_xfer_len, kstp->data_xfer_len);
+
+ ddi_rep_put8(acc_handle, (uint8_t *)kstp->fis, (uint8_t *)stp->fis, 10,
+ DDI_DEV_AUTOINCR);
+
+ ddi_put16(acc_handle, &stp->flags, kstp->flags & ~MFI_FRAME_SGL64);
+ ddi_put32(acc_handle, &stp->stp_flags, kstp->stp_flags);
+ ddi_put32(acc_handle, &stp->sgl.sge32[0].length, fis_xferlen);
+ ddi_put32(acc_handle, &stp->sgl.sge32[0].phys_addr,
+ fis_dma_obj.dma_cookie[0].dmac_address);
+ ddi_put32(acc_handle, &stp->sgl.sge32[1].length, data_xferlen);
+ ddi_put32(acc_handle, &stp->sgl.sge32[1].phys_addr,
+ data_dma_obj.dma_cookie[0].dmac_address);
+
+ cmd->sync_cmd = DRSAS_TRUE;
+ cmd->frame_count = 1;
+
+ if (instance->func_ptr->issue_cmd_in_sync_mode(instance, cmd)) {
+ con_log(CL_ANN, (CE_WARN, "issue_mfi_stp: fw_ioctl failed"));
+ } else {
+
+ if (fis_xferlen) {
+ for (i = 0; i < fis_xferlen; i++) {
+ if (ddi_copyout(
+ (uint8_t *)fis_dma_obj.buffer + i,
+ (uint8_t *)fis_ubuf + i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_stp : copy to "
+ "user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+ }
+ if (data_xferlen) {
+ for (i = 0; i < data_xferlen; i++) {
+ if (ddi_copyout(
+ (uint8_t *)data_dma_obj.buffer + i,
+ (uint8_t *)data_ubuf + i, 1, mode)) {
+ con_log(CL_ANN, (CE_WARN,
+ "issue_mfi_stp : copy to"
+ " user space failed"));
+ return (DDI_FAILURE);
+ }
+ }
+ }
+
+ kstp->cmd_status = ddi_get8(acc_handle, &stp->cmd_status);
+
+ if (fis_xferlen) {
+ /* free kernel buffer */
+ if (drsas_free_dma_obj(instance, fis_dma_obj) != DDI_SUCCESS)
+ return (DDI_FAILURE);
+ }
+
+ if (data_xferlen) {
+ /* free kernel buffer */
+ if (drsas_free_dma_obj(instance, data_dma_obj) != DDI_SUCCESS)
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+/*
+ * fill_up_drv_ver
+ */
+static void
+fill_up_drv_ver(struct drsas_drv_ver *dv)
+{
+ (void) memset(dv, 0, sizeof (struct drsas_drv_ver));
+
+ (void) memcpy(dv->signature, "$LSI LOGIC$", strlen("$LSI LOGIC$"));
+ (void) memcpy(dv->os_name, "Solaris", strlen("Solaris"));
+ (void) memcpy(dv->drv_name, "dr_sas", strlen("dr_sas"));
+ (void) memcpy(dv->drv_ver, DRSAS_VERSION, strlen(DRSAS_VERSION));
+ (void) memcpy(dv->drv_rel_date, DRSAS_RELDATE,
+ strlen(DRSAS_RELDATE));
+}
+
+/*
+ * handle_drv_ioctl
+ */
+static int
+handle_drv_ioctl(struct drsas_instance *instance, struct drsas_ioctl *ioctl,
+ int mode)
+{
+ int i;
+ int rval = DDI_SUCCESS;
+ int *props = NULL;
+ void *ubuf;
+
+ uint8_t *pci_conf_buf;
+ uint32_t xferlen;
+ uint32_t num_props;
+ uint_t model;
+ struct drsas_dcmd_frame *kdcmd;
+ struct drsas_drv_ver dv;
+ struct drsas_pci_information pi;
+
+ kdcmd = (struct drsas_dcmd_frame *)&ioctl->frame[0];
+
+ model = ddi_model_convert_from(mode & FMODELS);
+ if (model == DDI_MODEL_ILP32) {
+ con_log(CL_ANN1, (CE_NOTE,
+ "handle_drv_ioctl: DDI_MODEL_ILP32"));
+
+ xferlen = kdcmd->sgl.sge32[0].length;
+
+ ubuf = (void *)(ulong_t)kdcmd->sgl.sge32[0].phys_addr;
+ } else {
+#ifdef _ILP32
+ con_log(CL_ANN1, (CE_NOTE,
+ "handle_drv_ioctl: DDI_MODEL_ILP32"));
+ xferlen = kdcmd->sgl.sge32[0].length;
+ ubuf = (void *)(ulong_t)kdcmd->sgl.sge32[0].phys_addr;
+#else
+ con_log(CL_ANN1, (CE_NOTE,
+ "handle_drv_ioctl: DDI_MODEL_LP64"));
+ xferlen = kdcmd->sgl.sge64[0].length;
+ ubuf = (void *)(ulong_t)kdcmd->sgl.sge64[0].phys_addr;
+#endif
+ }
+ con_log(CL_ANN1, (CE_NOTE, "handle_drv_ioctl: "
+ "dataBuf=%p size=%d bytes", ubuf, xferlen));
+
+ switch (kdcmd->opcode) {
+ case DRSAS_DRIVER_IOCTL_DRIVER_VERSION:
+ con_log(CL_ANN1, (CE_NOTE, "handle_drv_ioctl: "
+ "DRSAS_DRIVER_IOCTL_DRIVER_VERSION"));
+
+ fill_up_drv_ver(&dv);
+ for (i = 0; i < xferlen; i++) {
+ if (ddi_copyout((uint8_t *)&dv + i, (uint8_t *)ubuf + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "handle_drv_ioctl: "
+ "DRSAS_DRIVER_IOCTL_DRIVER_VERSION"
+ " : copy to user space failed"));
+ kdcmd->cmd_status = 1;
+ rval = DDI_FAILURE;
+ break;
+ }
+ }
+ if (i == xferlen)
+ kdcmd->cmd_status = 0;
+ break;
+ case DRSAS_DRIVER_IOCTL_PCI_INFORMATION:
+ con_log(CL_ANN1, (CE_NOTE, "handle_drv_ioctl: "
+ "DRSAS_DRIVER_IOCTL_PCI_INFORMAITON"));
+
+ if (ddi_prop_lookup_int_array(DDI_DEV_T_ANY, instance->dip,
+ 0, "reg", &props, &num_props)) {
+ con_log(CL_ANN, (CE_WARN, "handle_drv_ioctl: "
+ "DRSAS_DRIVER_IOCTL_PCI_INFORMATION : "
+ "ddi_prop_look_int_array failed"));
+ rval = DDI_FAILURE;
+ } else {
+
+ pi.busNumber = (props[0] >> 16) & 0xFF;
+ pi.deviceNumber = (props[0] >> 11) & 0x1f;
+ pi.functionNumber = (props[0] >> 8) & 0x7;
+ ddi_prop_free((void *)props);
+ }
+
+ pci_conf_buf = (uint8_t *)&pi.pciHeaderInfo;
+
+ for (i = 0; i < (sizeof (struct drsas_pci_information) -
+ offsetof(struct drsas_pci_information, pciHeaderInfo));
+ i++) {
+ pci_conf_buf[i] =
+ pci_config_get8(instance->pci_handle, i);
+ }
+ for (i = 0; i < xferlen; i++) {
+ if (ddi_copyout((uint8_t *)&pi + i, (uint8_t *)ubuf + i,
+ 1, mode)) {
+ con_log(CL_ANN, (CE_WARN, "handle_drv_ioctl: "
+ "DRSAS_DRIVER_IOCTL_PCI_INFORMATION"
+ " : copy to user space failed"));
+ kdcmd->cmd_status = 1;
+ rval = DDI_FAILURE;
+ break;
+ }
+ }
+
+ if (i == xferlen)
+ kdcmd->cmd_status = 0;
+
+ break;
+ default:
+ con_log(CL_ANN, (CE_WARN, "handle_drv_ioctl: "
+ "invalid driver specific IOCTL opcode = 0x%x",
+ kdcmd->opcode));
+ kdcmd->cmd_status = 1;
+ rval = DDI_FAILURE;
+ break;
+ }
+
+ return (rval);
+}
+
+/*
+ * handle_mfi_ioctl
+ */
+static int
+handle_mfi_ioctl(struct drsas_instance *instance, struct drsas_ioctl *ioctl,
+ int mode)
+{
+ int rval = DDI_SUCCESS;
+
+ struct drsas_header *hdr;
+ struct drsas_cmd *cmd;
+
+ cmd = get_mfi_pkt(instance);
+
+ if (!cmd) {
+ con_log(CL_ANN, (CE_WARN, "dr_sas: "
+ "failed to get a cmd packet"));
+ return (DDI_FAILURE);
+ }
+
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &cmd->frame->hdr.context,
+ cmd->index);
+
+ hdr = (struct drsas_header *)&ioctl->frame[0];
+
+ switch (hdr->cmd) {
+ case MFI_CMD_OP_DCMD:
+ rval = issue_mfi_dcmd(instance, ioctl, cmd, mode);
+ break;
+ case MFI_CMD_OP_SMP:
+ rval = issue_mfi_smp(instance, ioctl, cmd, mode);
+ break;
+ case MFI_CMD_OP_STP:
+ rval = issue_mfi_stp(instance, ioctl, cmd, mode);
+ break;
+ case MFI_CMD_OP_LD_SCSI:
+ case MFI_CMD_OP_PD_SCSI:
+ rval = issue_mfi_pthru(instance, ioctl, cmd, mode);
+ break;
+ default:
+ con_log(CL_ANN, (CE_WARN, "handle_mfi_ioctl: "
+ "invalid mfi ioctl hdr->cmd = %d", hdr->cmd));
+ rval = DDI_FAILURE;
+ break;
+ }
+
+
+ return_mfi_pkt(instance, cmd);
+ if (drsas_common_check(instance, cmd) != DDI_SUCCESS)
+ rval = DDI_FAILURE;
+ return (rval);
+}
+
+/*
+ * AEN
+ */
+static int
+handle_mfi_aen(struct drsas_instance *instance, struct drsas_aen *aen)
+{
+ int rval = 0;
+
+ rval = register_mfi_aen(instance, instance->aen_seq_num,
+ aen->class_locale_word);
+
+ aen->cmd_status = (uint8_t)rval;
+
+ return (rval);
+}
+
+static int
+register_mfi_aen(struct drsas_instance *instance, uint32_t seq_num,
+ uint32_t class_locale_word)
+{
+ int ret_val;
+
+ struct drsas_cmd *cmd, *aen_cmd;
+ struct drsas_dcmd_frame *dcmd;
+ union drsas_evt_class_locale curr_aen;
+ union drsas_evt_class_locale prev_aen;
+
+ /*
+ * If there an AEN pending already (aen_cmd), check if the
+ * class_locale of that pending AEN is inclusive of the new
+ * AEN request we currently have. If it is, then we don't have
+ * to do anything. In other words, whichever events the current
+ * AEN request is subscribing to, have already been subscribed
+ * to.
+ *
+ * If the old_cmd is _not_ inclusive, then we have to abort
+ * that command, form a class_locale that is superset of both
+ * old and current and re-issue to the FW
+ */
+
+ curr_aen.word = class_locale_word;
+ aen_cmd = instance->aen_cmd;
+ if (aen_cmd) {
+ prev_aen.word = ddi_get32(aen_cmd->frame_dma_obj.acc_handle,
+ &aen_cmd->frame->dcmd.mbox.w[1]);
+
+ /*
+ * A class whose enum value is smaller is inclusive of all
+ * higher values. If a PROGRESS (= -1) was previously
+ * registered, then a new registration requests for higher
+ * classes need not be sent to FW. They are automatically
+ * included.
+ *
+ * Locale numbers don't have such hierarchy. They are bitmap
+ * values
+ */
+ if ((prev_aen.members.class <= curr_aen.members.class) &&
+ !((prev_aen.members.locale & curr_aen.members.locale) ^
+ curr_aen.members.locale)) {
+ /*
+ * Previously issued event registration includes
+ * current request. Nothing to do.
+ */
+
+ return (0);
+ } else {
+ curr_aen.members.locale |= prev_aen.members.locale;
+
+ if (prev_aen.members.class < curr_aen.members.class)
+ curr_aen.members.class = prev_aen.members.class;
+
+ ret_val = abort_aen_cmd(instance, aen_cmd);
+
+ if (ret_val) {
+ con_log(CL_ANN, (CE_WARN, "register_mfi_aen: "
+ "failed to abort prevous AEN command"));
+
+ return (ret_val);
+ }
+ }
+ } else {
+ curr_aen.word = class_locale_word;
+ }
+
+ cmd = get_mfi_pkt(instance);
+
+ if (!cmd)
+ return (ENOMEM);
+ /* Clear the frame buffer and assign back the context id */
+ (void) memset((char *)&cmd->frame[0], 0, sizeof (union drsas_frame));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &cmd->frame->hdr.context,
+ cmd->index);
+
+ dcmd = &cmd->frame->dcmd;
+
+ /* for(i = 0; i < DCMD_MBOX_SZ; i++) dcmd->mbox.b[i] = 0; */
+ (void) memset(dcmd->mbox.b, 0, DCMD_MBOX_SZ);
+
+ (void) memset(instance->mfi_evt_detail_obj.buffer, 0,
+ sizeof (struct drsas_evt_detail));
+
+ /* Prepare DCMD for aen registration */
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd, MFI_CMD_OP_DCMD);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->cmd_status, 0x0);
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &dcmd->sge_count, 1);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->flags,
+ MFI_FRAME_DIR_READ);
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &dcmd->timeout, 0);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->data_xfer_len,
+ sizeof (struct drsas_evt_detail));
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->opcode,
+ DR_DCMD_CTRL_EVENT_WAIT);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->mbox.w[0], seq_num);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->mbox.w[1],
+ curr_aen.word);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->sgl.sge32[0].phys_addr,
+ instance->mfi_evt_detail_obj.dma_cookie[0].dmac_address);
+ ddi_put32(cmd->frame_dma_obj.acc_handle, &dcmd->sgl.sge32[0].length,
+ sizeof (struct drsas_evt_detail));
+
+ instance->aen_seq_num = seq_num;
+
+
+ /*
+ * Store reference to the cmd used to register for AEN. When an
+ * application wants us to register for AEN, we have to abort this
+ * cmd and re-register with a new EVENT LOCALE supplied by that app
+ */
+ instance->aen_cmd = cmd;
+
+ cmd->frame_count = 1;
+
+ /* Issue the aen registration frame */
+ /* atomic_add_16 (&instance->fw_outstanding, 1); */
+ instance->func_ptr->issue_cmd(cmd, instance);
+
+ return (0);
+}
+
+static void
+display_scsi_inquiry(caddr_t scsi_inq)
+{
+#define MAX_SCSI_DEVICE_CODE 14
+ int i;
+ char inquiry_buf[256] = {0};
+ int len;
+ const char *const scsi_device_types[] = {
+ "Direct-Access ",
+ "Sequential-Access",
+ "Printer ",
+ "Processor ",
+ "WORM ",
+ "CD-ROM ",
+ "Scanner ",
+ "Optical Device ",
+ "Medium Changer ",
+ "Communications ",
+ "Unknown ",
+ "Unknown ",
+ "Unknown ",
+ "Enclosure ",
+ };
+
+ len = 0;
+
+ len += snprintf(inquiry_buf + len, 265 - len, " Vendor: ");
+ for (i = 8; i < 16; i++) {
+ len += snprintf(inquiry_buf + len, 265 - len, "%c",
+ scsi_inq[i]);
+ }
+
+ len += snprintf(inquiry_buf + len, 265 - len, " Model: ");
+
+ for (i = 16; i < 32; i++) {
+ len += snprintf(inquiry_buf + len, 265 - len, "%c",
+ scsi_inq[i]);
+ }
+
+ len += snprintf(inquiry_buf + len, 265 - len, " Rev: ");
+
+ for (i = 32; i < 36; i++) {
+ len += snprintf(inquiry_buf + len, 265 - len, "%c",
+ scsi_inq[i]);
+ }
+
+ len += snprintf(inquiry_buf + len, 265 - len, "\n");
+
+
+ i = scsi_inq[0] & 0x1f;
+
+
+ len += snprintf(inquiry_buf + len, 265 - len, " Type: %s ",
+ i < MAX_SCSI_DEVICE_CODE ? scsi_device_types[i] :
+ "Unknown ");
+
+
+ len += snprintf(inquiry_buf + len, 265 - len,
+ " ANSI SCSI revision: %02x", scsi_inq[2] & 0x07);
+
+ if ((scsi_inq[2] & 0x07) == 1 && (scsi_inq[3] & 0x0f) == 1) {
+ len += snprintf(inquiry_buf + len, 265 - len, " CCS\n");
+ } else {
+ len += snprintf(inquiry_buf + len, 265 - len, "\n");
+ }
+
+ con_log(CL_ANN1, (CE_CONT, inquiry_buf));
+}
+
+static int
+read_fw_status_reg_ppc(struct drsas_instance *instance)
+{
+ return ((int)RD_OB_SCRATCH_PAD_0(instance));
+}
+
+static void
+issue_cmd_ppc(struct drsas_cmd *cmd, struct drsas_instance *instance)
+{
+ atomic_add_16(&instance->fw_outstanding, 1);
+
+ /* Issue the command to the FW */
+ WR_IB_QPORT((cmd->frame_phys_addr) |
+ (((cmd->frame_count - 1) << 1) | 1), instance);
+}
+
+/*
+ * issue_cmd_in_sync_mode
+ */
+static int
+issue_cmd_in_sync_mode_ppc(struct drsas_instance *instance,
+ struct drsas_cmd *cmd)
+{
+ int i;
+ uint32_t msecs = MFI_POLL_TIMEOUT_SECS * (10 * MILLISEC);
+
+ con_log(CL_ANN1, (CE_NOTE, "issue_cmd_in_sync_mode_ppc: called"));
+
+ cmd->cmd_status = ENODATA;
+
+ WR_IB_QPORT((cmd->frame_phys_addr) |
+ (((cmd->frame_count - 1) << 1) | 1), instance);
+
+ mutex_enter(&instance->int_cmd_mtx);
+
+ for (i = 0; i < msecs && (cmd->cmd_status == ENODATA); i++) {
+ cv_wait(&instance->int_cmd_cv, &instance->int_cmd_mtx);
+ }
+
+ mutex_exit(&instance->int_cmd_mtx);
+
+ con_log(CL_ANN1, (CE_NOTE, "issue_cmd_in_sync_mode_ppc: done"));
+
+ if (i < (msecs -1)) {
+ return (DDI_SUCCESS);
+ } else {
+ return (DDI_FAILURE);
+ }
+}
+
+/*
+ * issue_cmd_in_poll_mode
+ */
+static int
+issue_cmd_in_poll_mode_ppc(struct drsas_instance *instance,
+ struct drsas_cmd *cmd)
+{
+ int i;
+ uint16_t flags;
+ uint32_t msecs = MFI_POLL_TIMEOUT_SECS * MILLISEC;
+ struct drsas_header *frame_hdr;
+
+ con_log(CL_ANN1, (CE_NOTE, "issue_cmd_in_poll_mode_ppc: called"));
+
+ frame_hdr = (struct drsas_header *)cmd->frame;
+ ddi_put8(cmd->frame_dma_obj.acc_handle, &frame_hdr->cmd_status,
+ MFI_CMD_STATUS_POLL_MODE);
+ flags = ddi_get16(cmd->frame_dma_obj.acc_handle, &frame_hdr->flags);
+ flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE;
+
+ ddi_put16(cmd->frame_dma_obj.acc_handle, &frame_hdr->flags, flags);
+
+ /* issue the frame using inbound queue port */
+ WR_IB_QPORT((cmd->frame_phys_addr) |
+ (((cmd->frame_count - 1) << 1) | 1), instance);
+
+ /* wait for cmd_status to change from 0xFF */
+ for (i = 0; i < msecs && (
+ ddi_get8(cmd->frame_dma_obj.acc_handle, &frame_hdr->cmd_status)
+ == MFI_CMD_STATUS_POLL_MODE); i++) {
+ drv_usecwait(MILLISEC); /* wait for 1000 usecs */
+ }
+
+ if (ddi_get8(cmd->frame_dma_obj.acc_handle, &frame_hdr->cmd_status)
+ == MFI_CMD_STATUS_POLL_MODE) {
+ con_log(CL_ANN, (CE_NOTE, "issue_cmd_in_poll_mode: "
+ "cmd polling timed out"));
+ return (DDI_FAILURE);
+ }
+
+ return (DDI_SUCCESS);
+}
+
+static void
+enable_intr_ppc(struct drsas_instance *instance)
+{
+ uint32_t mask;
+
+ con_log(CL_ANN1, (CE_NOTE, "enable_intr_ppc: called"));
+
+ /* WR_OB_DOORBELL_CLEAR(0xFFFFFFFF, instance); */
+ WR_OB_DOORBELL_CLEAR(OB_DOORBELL_CLEAR_MASK, instance);
+
+ /* WR_OB_INTR_MASK(~0x80000000, instance); */
+ WR_OB_INTR_MASK(~(MFI_REPLY_2108_MESSAGE_INTR_MASK), instance);
+
+ /* dummy read to force PCI flush */
+ mask = RD_OB_INTR_MASK(instance);
+
+ con_log(CL_ANN1, (CE_NOTE, "enable_intr_ppc: "
+ "outbound_intr_mask = 0x%x", mask));
+}
+
+static void
+disable_intr_ppc(struct drsas_instance *instance)
+{
+ uint32_t mask;
+
+ con_log(CL_ANN1, (CE_NOTE, "disable_intr_ppc: called"));
+
+ con_log(CL_ANN1, (CE_NOTE, "disable_intr_ppc: before : "
+ "outbound_intr_mask = 0x%x", RD_OB_INTR_MASK(instance)));
+
+ /* WR_OB_INTR_MASK(0xFFFFFFFF, instance); */
+ WR_OB_INTR_MASK(OB_INTR_MASK, instance);
+
+ con_log(CL_ANN1, (CE_NOTE, "disable_intr_ppc: after : "
+ "outbound_intr_mask = 0x%x", RD_OB_INTR_MASK(instance)));
+
+ /* dummy read to force PCI flush */
+ mask = RD_OB_INTR_MASK(instance);
+#ifdef lint
+ mask = mask;
+#endif
+}
+
+static int
+intr_ack_ppc(struct drsas_instance *instance)
+{
+ uint32_t status;
+
+ con_log(CL_ANN1, (CE_NOTE, "intr_ack_ppc: called"));
+
+ /* check if it is our interrupt */
+ status = RD_OB_INTR_STATUS(instance);
+
+ con_log(CL_ANN1, (CE_NOTE, "intr_ack_ppc: status = 0x%x", status));
+
+ if (!(status & MFI_REPLY_2108_MESSAGE_INTR)) {
+ return (DDI_INTR_UNCLAIMED);
+ }
+
+ /* clear the interrupt by writing back the same value */
+ WR_OB_DOORBELL_CLEAR(status, instance);
+
+ /* dummy READ */
+ status = RD_OB_INTR_STATUS(instance);
+
+ con_log(CL_ANN1, (CE_NOTE, "intr_ack_ppc: interrupt cleared"));
+
+ return (DDI_INTR_CLAIMED);
+}
+
+static int
+drsas_common_check(struct drsas_instance *instance,
+ struct drsas_cmd *cmd)
+{
+ int ret = DDI_SUCCESS;
+
+ if (drsas_check_dma_handle(cmd->frame_dma_obj.dma_handle) !=
+ DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_UNAFFECTED);
+ if (cmd->pkt != NULL) {
+ cmd->pkt->pkt_reason = CMD_TRAN_ERR;
+ cmd->pkt->pkt_statistics = 0;
+ }
+ ret = DDI_FAILURE;
+ }
+ if (drsas_check_dma_handle(instance->mfi_internal_dma_obj.dma_handle)
+ != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_UNAFFECTED);
+ if (cmd->pkt != NULL) {
+ cmd->pkt->pkt_reason = CMD_TRAN_ERR;
+ cmd->pkt->pkt_statistics = 0;
+ }
+ ret = DDI_FAILURE;
+ }
+ if (drsas_check_dma_handle(instance->mfi_evt_detail_obj.dma_handle) !=
+ DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_UNAFFECTED);
+ if (cmd->pkt != NULL) {
+ cmd->pkt->pkt_reason = CMD_TRAN_ERR;
+ cmd->pkt->pkt_statistics = 0;
+ }
+ ret = DDI_FAILURE;
+ }
+ if (drsas_check_acc_handle(instance->regmap_handle) != DDI_SUCCESS) {
+ ddi_fm_service_impact(instance->dip, DDI_SERVICE_UNAFFECTED);
+
+ ddi_fm_acc_err_clear(instance->regmap_handle, DDI_FME_VER0);
+
+ if (cmd->pkt != NULL) {
+ cmd->pkt->pkt_reason = CMD_TRAN_ERR;
+ cmd->pkt->pkt_statistics = 0;
+ }
+ ret = DDI_FAILURE;
+ }
+
+ return (ret);
+}
+
+/*ARGSUSED*/
+static int
+drsas_fm_error_cb(dev_info_t *dip, ddi_fm_error_t *err, const void *impl_data)
+{
+ /*
+ * as the driver can always deal with an error in any dma or
+ * access handle, we can just return the fme_status value.
+ */
+ pci_ereport_post(dip, err, NULL);
+ return (err->fme_status);
+}
+
+static void
+drsas_fm_init(struct drsas_instance *instance)
+{
+ /* Need to change iblock to priority for new MSI intr */
+ ddi_iblock_cookie_t fm_ibc;
+
+ /* Only register with IO Fault Services if we have some capability */
+ if (instance->fm_capabilities) {
+ /* Adjust access and dma attributes for FMA */
+ endian_attr.devacc_attr_access = DDI_FLAGERR_ACC;
+ drsas_generic_dma_attr.dma_attr_flags = DDI_DMA_FLAGERR;
+
+ /*
+ * Register capabilities with IO Fault Services.
+ * fm_capabilities will be updated to indicate
+ * capabilities actually supported (not requested.)
+ */
+
+ ddi_fm_init(instance->dip, &instance->fm_capabilities, &fm_ibc);
+
+ /*
+ * Initialize pci ereport capabilities if ereport
+ * capable (should always be.)
+ */
+
+ if (DDI_FM_EREPORT_CAP(instance->fm_capabilities) ||
+ DDI_FM_ERRCB_CAP(instance->fm_capabilities)) {
+ pci_ereport_setup(instance->dip);
+ }
+
+ /*
+ * Register error callback if error callback capable.
+ */
+ if (DDI_FM_ERRCB_CAP(instance->fm_capabilities)) {
+ ddi_fm_handler_register(instance->dip,
+ drsas_fm_error_cb, (void*) instance);
+ }
+ } else {
+ endian_attr.devacc_attr_access = DDI_DEFAULT_ACC;
+ drsas_generic_dma_attr.dma_attr_flags = 0;
+ }
+}
+
+static void
+drsas_fm_fini(struct drsas_instance *instance)
+{
+ /* Only unregister FMA capabilities if registered */
+ if (instance->fm_capabilities) {
+ /*
+ * Un-register error callback if error callback capable.
+ */
+ if (DDI_FM_ERRCB_CAP(instance->fm_capabilities)) {
+ ddi_fm_handler_unregister(instance->dip);
+ }
+
+ /*
+ * Release any resources allocated by pci_ereport_setup()
+ */
+ if (DDI_FM_EREPORT_CAP(instance->fm_capabilities) ||
+ DDI_FM_ERRCB_CAP(instance->fm_capabilities)) {
+ pci_ereport_teardown(instance->dip);
+ }
+
+ /* Unregister from IO Fault Services */
+ ddi_fm_fini(instance->dip);
+
+ /* Adjust access and dma attributes for FMA */
+ endian_attr.devacc_attr_access = DDI_DEFAULT_ACC;
+ drsas_generic_dma_attr.dma_attr_flags = 0;
+ }
+}
+
+int
+drsas_check_acc_handle(ddi_acc_handle_t handle)
+{
+ ddi_fm_error_t de;
+
+ if (handle == NULL) {
+ return (DDI_FAILURE);
+ }
+
+ ddi_fm_acc_err_get(handle, &de, DDI_FME_VERSION);
+
+ return (de.fme_status);
+}
+
+int
+drsas_check_dma_handle(ddi_dma_handle_t handle)
+{
+ ddi_fm_error_t de;
+
+ if (handle == NULL) {
+ return (DDI_FAILURE);
+ }
+
+ ddi_fm_dma_err_get(handle, &de, DDI_FME_VERSION);
+
+ return (de.fme_status);
+}
+
+void
+drsas_fm_ereport(struct drsas_instance *instance, char *detail)
+{
+ uint64_t ena;
+ char buf[FM_MAX_CLASS];
+
+ (void) snprintf(buf, FM_MAX_CLASS, "%s.%s", DDI_FM_DEVICE, detail);
+ ena = fm_ena_generate(0, FM_ENA_FMT1);
+ if (DDI_FM_EREPORT_CAP(instance->fm_capabilities)) {
+ ddi_fm_ereport_post(instance->dip, buf, ena, DDI_NOSLEEP,
+ FM_VERSION, DATA_TYPE_UINT8, FM_EREPORT_VERSION, NULL);
+ }
+}
+
+static int
+drsas_add_intrs(struct drsas_instance *instance, int intr_type)
+{
+
+ dev_info_t *dip = instance->dip;
+ int avail, actual, count;
+ int i, flag, ret;
+
+ con_log(CL_DLEVEL1, (CE_WARN, "drsas_add_intrs: intr_type = %x",
+ intr_type));
+
+ /* Get number of interrupts */
+ ret = ddi_intr_get_nintrs(dip, intr_type, &count);
+ if ((ret != DDI_SUCCESS) || (count == 0)) {
+ con_log(CL_ANN, (CE_WARN, "ddi_intr_get_nintrs() failed:"
+ "ret %d count %d", ret, count));
+
+ return (DDI_FAILURE);
+ }
+
+ con_log(CL_DLEVEL1, (CE_WARN, "drsas_add_intrs: count = %d ", count));
+
+ /* Get number of available interrupts */
+ ret = ddi_intr_get_navail(dip, intr_type, &avail);
+ if ((ret != DDI_SUCCESS) || (avail == 0)) {
+ con_log(CL_ANN, (CE_WARN, "ddi_intr_get_navail() failed:"
+ "ret %d avail %d", ret, avail));
+
+ return (DDI_FAILURE);
+ }
+ con_log(CL_DLEVEL1, (CE_WARN, "drsas_add_intrs: avail = %d ", avail));
+
+ /* Only one interrupt routine. So limit the count to 1 */
+ if (count > 1) {
+ count = 1;
+ }
+
+ /*
+ * Allocate an array of interrupt handlers. Currently we support
+ * only one interrupt. The framework can be extended later.
+ */
+ instance->intr_size = count * sizeof (ddi_intr_handle_t);
+ instance->intr_htable = kmem_zalloc(instance->intr_size, KM_SLEEP);
+ ASSERT(instance->intr_htable);
+
+ flag = ((intr_type == DDI_INTR_TYPE_MSI) || (intr_type ==
+ DDI_INTR_TYPE_MSIX)) ? DDI_INTR_ALLOC_STRICT:DDI_INTR_ALLOC_NORMAL;
+
+ /* Allocate interrupt */
+ ret = ddi_intr_alloc(dip, instance->intr_htable, intr_type, 0,
+ count, &actual, flag);
+
+ if ((ret != DDI_SUCCESS) || (actual == 0)) {
+ con_log(CL_ANN, (CE_WARN, "drsas_add_intrs: "
+ "avail = %d", avail));
+ kmem_free(instance->intr_htable, instance->intr_size);
+ return (DDI_FAILURE);
+ }
+ if (actual < count) {
+ con_log(CL_ANN, (CE_WARN, "drsas_add_intrs: "
+ "Requested = %d Received = %d", count, actual));
+ }
+ instance->intr_cnt = actual;
+
+ /*
+ * Get the priority of the interrupt allocated.
+ */
+ if ((ret = ddi_intr_get_pri(instance->intr_htable[0],
+ &instance->intr_pri)) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "drsas_add_intrs: "
+ "get priority call failed"));
+
+ for (i = 0; i < actual; i++) {
+ (void) ddi_intr_free(instance->intr_htable[i]);
+ }
+ kmem_free(instance->intr_htable, instance->intr_size);
+ return (DDI_FAILURE);
+ }
+
+ /*
+ * Test for high level mutex. we don't support them.
+ */
+ if (instance->intr_pri >= ddi_intr_get_hilevel_pri()) {
+ con_log(CL_ANN, (CE_WARN, "drsas_add_intrs: "
+ "High level interrupts not supported."));
+
+ for (i = 0; i < actual; i++) {
+ (void) ddi_intr_free(instance->intr_htable[i]);
+ }
+ kmem_free(instance->intr_htable, instance->intr_size);
+ return (DDI_FAILURE);
+ }
+
+ con_log(CL_DLEVEL1, (CE_NOTE, "drsas_add_intrs: intr_pri = 0x%x ",
+ instance->intr_pri));
+
+ /* Call ddi_intr_add_handler() */
+ for (i = 0; i < actual; i++) {
+ ret = ddi_intr_add_handler(instance->intr_htable[i],
+ (ddi_intr_handler_t *)drsas_isr, (caddr_t)instance,
+ (caddr_t)(uintptr_t)i);
+
+ if (ret != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "drsas_add_intrs:"
+ "failed %d", ret));
+
+ for (i = 0; i < actual; i++) {
+ (void) ddi_intr_free(instance->intr_htable[i]);
+ }
+ kmem_free(instance->intr_htable, instance->intr_size);
+ return (DDI_FAILURE);
+ }
+
+ }
+
+ con_log(CL_DLEVEL1, (CE_WARN, " ddi_intr_add_handler done"));
+
+ if ((ret = ddi_intr_get_cap(instance->intr_htable[0],
+ &instance->intr_cap)) != DDI_SUCCESS) {
+ con_log(CL_ANN, (CE_WARN, "ddi_intr_get_cap() failed %d",
+ ret));
+
+ /* Free already allocated intr */
+ for (i = 0; i < actual; i++) {
+ (void) ddi_intr_remove_handler(
+ instance->intr_htable[i]);
+ (void) ddi_intr_free(instance->intr_htable[i]);
+ }
+ kmem_free(instance->intr_htable, instance->intr_size);
+ return (DDI_FAILURE);
+ }
+
+ if (instance->intr_cap & DDI_INTR_FLAG_BLOCK) {
+ con_log(CL_ANN, (CE_WARN, "Calling ddi_intr_block _enable"));
+
+ (void) ddi_intr_block_enable(instance->intr_htable,
+ instance->intr_cnt);
+ } else {
+ con_log(CL_ANN, (CE_NOTE, " calling ddi_intr_enable"));
+
+ for (i = 0; i < instance->intr_cnt; i++) {
+ (void) ddi_intr_enable(instance->intr_htable[i]);
+ con_log(CL_ANN, (CE_NOTE, "ddi intr enable returns "
+ "%d", i));
+ }
+ }
+
+ return (DDI_SUCCESS);
+
+}
+
+
+static void
+drsas_rem_intrs(struct drsas_instance *instance)
+{
+ int i;
+
+ con_log(CL_ANN, (CE_NOTE, "drsas_rem_intrs called"));
+
+ /* Disable all interrupts first */
+ if (instance->intr_cap & DDI_INTR_FLAG_BLOCK) {
+ (void) ddi_intr_block_disable(instance->intr_htable,
+ instance->intr_cnt);
+ } else {
+ for (i = 0; i < instance->intr_cnt; i++) {
+ (void) ddi_intr_disable(instance->intr_htable[i]);
+ }
+ }
+
+ /* Remove all the handlers */
+
+ for (i = 0; i < instance->intr_cnt; i++) {
+ (void) ddi_intr_remove_handler(instance->intr_htable[i]);
+ (void) ddi_intr_free(instance->intr_htable[i]);
+ }
+
+ kmem_free(instance->intr_htable, instance->intr_size);
+}
+
+static int
+drsas_tran_bus_config(dev_info_t *parent, uint_t flags,
+ ddi_bus_config_op_t op, void *arg, dev_info_t **childp)
+{
+ struct drsas_instance *instance;
+ int config;
+ int rval;
+
+ char *ptr = NULL;
+ int tgt, lun;
+
+ con_log(CL_ANN1, (CE_NOTE, "Bus config called for op = %x", op));
+
+ if ((instance = ddi_get_soft_state(drsas_state,
+ ddi_get_instance(parent))) == NULL) {
+ return (NDI_FAILURE);
+ }
+
+ /* Hold nexus during bus_config */
+ ndi_devi_enter(parent, &config);
+ switch (op) {
+ case BUS_CONFIG_ONE: {
+
+ /* parse wwid/target name out of name given */
+ if ((ptr = strchr((char *)arg, '@')) == NULL) {
+ rval = NDI_FAILURE;
+ break;
+ }
+ ptr++;
+
+ if (drsas_parse_devname(arg, &tgt, &lun) != 0) {
+ rval = NDI_FAILURE;
+ break;
+ }
+
+ if (lun == 0) {
+ rval = drsas_config_ld(instance, tgt, lun, childp);
+ } else {
+ rval = NDI_FAILURE;
+ }
+
+ break;
+ }
+ case BUS_CONFIG_DRIVER:
+ case BUS_CONFIG_ALL: {
+
+ rval = drsas_config_all_devices(instance);
+
+ rval = NDI_SUCCESS;
+ break;
+ }
+ }
+
+ if (rval == NDI_SUCCESS) {
+ rval = ndi_busop_bus_config(parent, flags, op, arg, childp, 0);
+
+ }
+ ndi_devi_exit(parent, config);
+
+ con_log(CL_ANN1, (CE_NOTE, "drsas_tran_bus_config: rval = %x",
+ rval));
+ return (rval);
+}
+
+static int
+drsas_config_all_devices(struct drsas_instance *instance)
+{
+ int rval, tgt;
+
+ for (tgt = 0; tgt < MRDRV_MAX_LD; tgt++) {
+ (void) drsas_config_ld(instance, tgt, 0, NULL);
+
+ }
+
+ rval = NDI_SUCCESS;
+ return (rval);
+}
+
+static int
+drsas_parse_devname(char *devnm, int *tgt, int *lun)
+{
+ char devbuf[SCSI_MAXNAMELEN];
+ char *addr;
+ char *p, *tp, *lp;
+ long num;
+
+ /* Parse dev name and address */
+ (void) strcpy(devbuf, devnm);
+ addr = "";
+ for (p = devbuf; *p != '\0'; p++) {
+ if (*p == '@') {
+ addr = p + 1;
+ *p = '\0';
+ } else if (*p == ':') {
+ *p = '\0';
+ break;
+ }
+ }
+
+ /* Parse target and lun */
+ for (p = tp = addr, lp = NULL; *p != '\0'; p++) {
+ if (*p == ',') {
+ lp = p + 1;
+ *p = '\0';
+ break;
+ }
+ }
+ if (tgt && tp) {
+ if (ddi_strtol(tp, NULL, 0x10, &num)) {
+ return (DDI_FAILURE); /* Can declare this as constant */
+ }
+ *tgt = (int)num;
+ }
+ if (lun && lp) {
+ if (ddi_strtol(lp, NULL, 0x10, &num)) {
+ return (DDI_FAILURE);
+ }
+ *lun = (int)num;
+ }
+ return (DDI_SUCCESS); /* Success case */
+}
+
+static int
+drsas_config_ld(struct drsas_instance *instance, uint16_t tgt,
+ uint8_t lun, dev_info_t **ldip)
+{
+ struct scsi_device *sd;
+ dev_info_t *child;
+ int rval;
+
+ con_log(CL_ANN1, (CE_NOTE, "drsas_config_ld: t = %d l = %d",
+ tgt, lun));
+
+ if ((child = drsas_find_child(instance, tgt, lun)) != NULL) {
+ if (ldip) {
+ *ldip = child;
+ }
+ con_log(CL_ANN1, (CE_NOTE,
+ "drsas_config_ld: Child = %p found t = %d l = %d",
+ (void *)child, tgt, lun));
+ return (NDI_SUCCESS);
+ }
+
+ sd = kmem_zalloc(sizeof (struct scsi_device), KM_SLEEP);
+ sd->sd_address.a_hba_tran = instance->tran;
+ sd->sd_address.a_target = (uint16_t)tgt;
+ sd->sd_address.a_lun = (uint8_t)lun;
+
+ if (scsi_hba_probe(sd, NULL) == SCSIPROBE_EXISTS)
+ rval = drsas_config_scsi_device(instance, sd, ldip);
+ else
+ rval = NDI_FAILURE;
+
+ /* sd_unprobe is blank now. Free buffer manually */
+ if (sd->sd_inq) {
+ kmem_free(sd->sd_inq, SUN_INQSIZE);
+ sd->sd_inq = (struct scsi_inquiry *)NULL;
+ }
+
+ kmem_free(sd, sizeof (struct scsi_device));
+ con_log(CL_ANN1, (CE_NOTE, "drsas_config_ld: return rval = %d",
+ rval));
+ return (rval);
+}
+
+static int
+drsas_config_scsi_device(struct drsas_instance *instance,
+ struct scsi_device *sd, dev_info_t **dipp)
+{
+ char *nodename = NULL;
+ char **compatible = NULL;
+ int ncompatible = 0;
+ char *childname;
+ dev_info_t *ldip = NULL;
+ int tgt = sd->sd_address.a_target;
+ int lun = sd->sd_address.a_lun;
+ int dtype = sd->sd_inq->inq_dtype & DTYPE_MASK;
+ int rval;
+
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: scsi_device t%dL%d", tgt, lun));
+ scsi_hba_nodename_compatible_get(sd->sd_inq, NULL, dtype,
+ NULL, &nodename, &compatible, &ncompatible);
+
+ if (nodename == NULL) {
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: Found no compatible driver "
+ "for t%dL%d", tgt, lun));
+ rval = NDI_FAILURE;
+ goto finish;
+ }
+
+ childname = (dtype == DTYPE_DIRECT) ? "sd" : nodename;
+ con_log(CL_ANN1, (CE_WARN,
+ "dr_sas: Childname = %2s nodename = %s", childname, nodename));
+
+ /* Create a dev node */
+ rval = ndi_devi_alloc(instance->dip, childname, DEVI_SID_NODEID, &ldip);
+ con_log(CL_ANN1, (CE_WARN,
+ "dr_sas_config_scsi_device: ndi_devi_alloc rval = %x", rval));
+ if (rval == NDI_SUCCESS) {
+ if (ndi_prop_update_int(DDI_DEV_T_NONE, ldip, "target", tgt) !=
+ DDI_PROP_SUCCESS) {
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: unable to create "
+ "property for t%dl%d target", tgt, lun));
+ rval = NDI_FAILURE;
+ goto finish;
+ }
+ if (ndi_prop_update_int(DDI_DEV_T_NONE, ldip, "lun", lun) !=
+ DDI_PROP_SUCCESS) {
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: unable to create "
+ "property for t%dl%d lun", tgt, lun));
+ rval = NDI_FAILURE;
+ goto finish;
+ }
+
+ if (ndi_prop_update_string_array(DDI_DEV_T_NONE, ldip,
+ "compatible", compatible, ncompatible) !=
+ DDI_PROP_SUCCESS) {
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: unable to create "
+ "property for t%dl%d compatible", tgt, lun));
+ rval = NDI_FAILURE;
+ goto finish;
+ }
+
+ rval = ndi_devi_online(ldip, NDI_ONLINE_ATTACH);
+ if (rval != NDI_SUCCESS) {
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: unable to online "
+ "t%dl%d", tgt, lun));
+ ndi_prop_remove_all(ldip);
+ (void) ndi_devi_free(ldip);
+ } else {
+ con_log(CL_ANN1, (CE_WARN, "dr_sas: online Done :"
+ "0 t%dl%d", tgt, lun));
+ }
+
+ }
+finish:
+ if (dipp) {
+ *dipp = ldip;
+ }
+
+ con_log(CL_DLEVEL1, (CE_WARN,
+ "dr_sas: config_scsi_device rval = %d t%dL%d",
+ rval, tgt, lun));
+ scsi_hba_nodename_compatible_free(nodename, compatible);
+ return (rval);
+}
+
+/*ARGSUSED*/
+static int
+drsas_service_evt(struct drsas_instance *instance, int tgt, int lun, int event,
+ uint64_t wwn)
+{
+ struct drsas_eventinfo *mrevt = NULL;
+
+ con_log(CL_ANN1, (CE_NOTE,
+ "drsas_service_evt called for t%dl%d event = %d",
+ tgt, lun, event));
+
+ if ((instance->taskq == NULL) || (mrevt =
+ kmem_zalloc(sizeof (struct drsas_eventinfo), KM_NOSLEEP)) == NULL) {
+ return (ENOMEM);
+ }
+
+ mrevt->instance = instance;
+ mrevt->tgt = tgt;
+ mrevt->lun = lun;
+ mrevt->event = event;
+
+ if ((ddi_taskq_dispatch(instance->taskq,
+ (void (*)(void *))drsas_issue_evt_taskq, mrevt, DDI_NOSLEEP)) !=
+ DDI_SUCCESS) {
+ con_log(CL_ANN1, (CE_NOTE,
+ "dr_sas: Event task failed for t%dl%d event = %d",
+ tgt, lun, event));
+ kmem_free(mrevt, sizeof (struct drsas_eventinfo));
+ return (DDI_FAILURE);
+ }
+ return (DDI_SUCCESS);
+}
+
+static void
+drsas_issue_evt_taskq(struct drsas_eventinfo *mrevt)
+{
+ struct drsas_instance *instance = mrevt->instance;
+ dev_info_t *dip, *pdip;
+ int circ1 = 0;
+ char *devname;
+
+ con_log(CL_ANN1, (CE_NOTE, "drsas_issue_evt_taskq: called for"
+ " tgt %d lun %d event %d",
+ mrevt->tgt, mrevt->lun, mrevt->event));
+
+ if (mrevt->tgt < MRDRV_MAX_LD && mrevt->lun == 0) {
+ dip = instance->dr_ld_list[mrevt->tgt].dip;
+ } else {
+ return;
+ }
+
+ ndi_devi_enter(instance->dip, &circ1);
+ switch (mrevt->event) {
+ case DRSAS_EVT_CONFIG_TGT:
+ if (dip == NULL) {
+
+ if (mrevt->lun == 0) {
+ (void) drsas_config_ld(instance, mrevt->tgt,
+ 0, NULL);
+ }
+ con_log(CL_ANN1, (CE_NOTE,
+ "dr_sas: EVT_CONFIG_TGT called:"
+ " for tgt %d lun %d event %d",
+ mrevt->tgt, mrevt->lun, mrevt->event));
+
+ } else {
+ con_log(CL_ANN1, (CE_NOTE,
+ "dr_sas: EVT_CONFIG_TGT dip != NULL:"
+ " for tgt %d lun %d event %d",
+ mrevt->tgt, mrevt->lun, mrevt->event));
+ }
+ break;
+ case DRSAS_EVT_UNCONFIG_TGT:
+ if (dip) {
+ if (i_ddi_devi_attached(dip)) {
+
+ pdip = ddi_get_parent(dip);
+
+ devname = kmem_zalloc(MAXNAMELEN + 1, KM_SLEEP);
+ (void) ddi_deviname(dip, devname);
+
+ (void) devfs_clean(pdip, devname + 1,
+ DV_CLEAN_FORCE);
+ kmem_free(devname, MAXNAMELEN + 1);
+ }
+ (void) ndi_devi_offline(dip, NDI_DEVI_REMOVE);
+ con_log(CL_ANN1, (CE_NOTE,
+ "dr_sas: EVT_UNCONFIG_TGT called:"
+ " for tgt %d lun %d event %d",
+ mrevt->tgt, mrevt->lun, mrevt->event));
+ } else {
+ con_log(CL_ANN1, (CE_NOTE,
+ "dr_sas: EVT_UNCONFIG_TGT dip == NULL:"
+ " for tgt %d lun %d event %d",
+ mrevt->tgt, mrevt->lun, mrevt->event));
+ }
+ break;
+ }
+ kmem_free(mrevt, sizeof (struct drsas_eventinfo));
+ ndi_devi_exit(instance->dip, circ1);
+}
+
+static int
+drsas_mode_sense_build(struct scsi_pkt *pkt)
+{
+ union scsi_cdb *cdbp;
+ uint16_t page_code;
+ struct scsa_cmd *acmd;
+ struct buf *bp;
+ struct mode_header *modehdrp;
+
+ cdbp = (void *)pkt->pkt_cdbp;
+ page_code = cdbp->cdb_un.sg.scsi[0];
+ acmd = PKT2CMD(pkt);
+ bp = acmd->cmd_buf;
+ if ((!bp) && bp->b_un.b_addr && bp->b_bcount && acmd->cmd_dmacount) {
+ con_log(CL_ANN1, (CE_WARN, "Failing MODESENSE Command"));
+ /* ADD pkt statistics as Command failed. */
+ return (NULL);
+ }
+
+ bp_mapin(bp);
+ bzero(bp->b_un.b_addr, bp->b_bcount);
+
+ switch (page_code) {
+ case 0x3: {
+ struct mode_format *page3p = NULL;
+ modehdrp = (struct mode_header *)(bp->b_un.b_addr);
+ modehdrp->bdesc_length = MODE_BLK_DESC_LENGTH;
+
+ page3p = (void *)((caddr_t)modehdrp +
+ MODE_HEADER_LENGTH + MODE_BLK_DESC_LENGTH);
+ page3p->mode_page.code = 0x3;
+ page3p->mode_page.length =
+ (uchar_t)(sizeof (struct mode_format));
+ page3p->data_bytes_sect = 512;
+ page3p->sect_track = 63;
+ break;
+ }
+ case 0x4: {
+ struct mode_geometry *page4p = NULL;
+ modehdrp = (struct mode_header *)(bp->b_un.b_addr);
+ modehdrp->bdesc_length = MODE_BLK_DESC_LENGTH;
+
+ page4p = (void *)((caddr_t)modehdrp +
+ MODE_HEADER_LENGTH + MODE_BLK_DESC_LENGTH);
+ page4p->mode_page.code = 0x4;
+ page4p->mode_page.length =
+ (uchar_t)(sizeof (struct mode_geometry));
+ page4p->heads = 255;
+ page4p->rpm = 10000;
+ break;
+ }
+ default:
+ break;
+ }
+ return (NULL);
+}
diff --git a/usr/src/uts/common/io/dr_sas/dr_sas.conf b/usr/src/uts/common/io/dr_sas/dr_sas.conf
new file mode 100644
index 0000000000..3792f43ca4
--- /dev/null
+++ b/usr/src/uts/common/io/dr_sas/dr_sas.conf
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2008-2009, LSI Logic Corporation.
+# All rights reserved.
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# dr_sas.conf for sol 10 (and later) for all supported architectures
+#
+# global definitions
+
+# MSI specific flag. user can uncomment this line and set flag "yes" to enable MSI
+#drsas-enable-msi="yes";
diff --git a/usr/src/uts/common/io/dr_sas/dr_sas.h b/usr/src/uts/common/io/dr_sas/dr_sas.h
new file mode 100644
index 0000000000..8f78658edf
--- /dev/null
+++ b/usr/src/uts/common/io/dr_sas/dr_sas.h
@@ -0,0 +1,1766 @@
+/*
+ * dr_sas.h: header for dr_sas
+ *
+ * Solaris MegaRAID driver for SAS2.0 controllers
+ * Copyright (c) 2008-2009, LSI Logic Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the author nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _DR_SAS_H_
+#define _DR_SAS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/scsi/scsi.h>
+#include "dr_sas_list.h"
+
+/*
+ * MegaRAID SAS2.0 Driver meta data
+ */
+#define DRSAS_VERSION "LSIv2.0"
+#define DRSAS_RELDATE "Jan 9, 2009"
+
+#define DRSAS_TRUE 1
+#define DRSAS_FALSE 0
+
+/*
+ * MegaRAID SAS2.0 device id conversion definitions.
+ */
+#define INST2LSIRDCTL(x) ((x) << INST_MINOR_SHIFT)
+
+/*
+ * MegaRAID SAS2.0 supported controllers
+ */
+#define PCI_DEVICE_ID_LSI_2108VDE 0x0078
+#define PCI_DEVICE_ID_LSI_2108V 0x0079
+
+/*
+ * Register Index for 2108 Controllers.
+ */
+#define REGISTER_SET_IO_2108 (2)
+
+#define DRSAS_MAX_SGE_CNT 0x50
+
+#define DRSAS_IOCTL_DRIVER 0x12341234
+#define DRSAS_IOCTL_FIRMWARE 0x12345678
+#define DRSAS_IOCTL_AEN 0x87654321
+
+#define DRSAS_1_SECOND 1000000
+
+/* Dynamic Enumeration Flags */
+#define DRSAS_PD_LUN 1
+#define DRSAS_LD_LUN 0
+#define DRSAS_PD_TGT_MAX 255
+#define DRSAS_GET_PD_MAX(s) ((s)->dr_pd_max)
+#define WWN_STRLEN 17
+
+/*
+ * =====================================
+ * MegaRAID SAS2.0 MFI firmware definitions
+ * =====================================
+ */
+/*
+ * MFI stands for MegaRAID SAS2.0 FW Interface. This is just a moniker for
+ * protocol between the software and firmware. Commands are issued using
+ * "message frames"
+ */
+
+/*
+ * FW posts its state in upper 4 bits of outbound_msg_0 register
+ */
+#define MFI_STATE_SHIFT 28
+#define MFI_STATE_MASK ((uint32_t)0xF<<MFI_STATE_SHIFT)
+#define MFI_STATE_UNDEFINED ((uint32_t)0x0<<MFI_STATE_SHIFT)
+#define MFI_STATE_BB_INIT ((uint32_t)0x1<<MFI_STATE_SHIFT)
+#define MFI_STATE_FW_INIT ((uint32_t)0x4<<MFI_STATE_SHIFT)
+#define MFI_STATE_WAIT_HANDSHAKE ((uint32_t)0x6<<MFI_STATE_SHIFT)
+#define MFI_STATE_FW_INIT_2 ((uint32_t)0x7<<MFI_STATE_SHIFT)
+#define MFI_STATE_DEVICE_SCAN ((uint32_t)0x8<<MFI_STATE_SHIFT)
+#define MFI_STATE_BOOT_MESSAGE_PENDING ((uint32_t)0x9<<MFI_STATE_SHIFT)
+#define MFI_STATE_FLUSH_CACHE ((uint32_t)0xA<<MFI_STATE_SHIFT)
+#define MFI_STATE_READY ((uint32_t)0xB<<MFI_STATE_SHIFT)
+#define MFI_STATE_OPERATIONAL ((uint32_t)0xC<<MFI_STATE_SHIFT)
+#define MFI_STATE_FAULT ((uint32_t)0xF<<MFI_STATE_SHIFT)
+
+#define MRMFI_FRAME_SIZE 64
+
+/*
+ * During FW init, clear pending cmds & reset state using inbound_msg_0
+ *
+ * ABORT : Abort all pending cmds
+ * READY : Move from OPERATIONAL to READY state; discard queue info
+ * MFIMODE : Discard (possible) low MFA posted in 64-bit mode (??)
+ * CLR_HANDSHAKE: FW is waiting for HANDSHAKE from BIOS or Driver
+ */
+#define MFI_INIT_ABORT 0x00000001
+#define MFI_INIT_READY 0x00000002
+#define MFI_INIT_MFIMODE 0x00000004
+#define MFI_INIT_CLEAR_HANDSHAKE 0x00000008
+#define MFI_INIT_HOTPLUG 0x00000010
+#define MFI_STOP_ADP 0x00000020
+#define MFI_RESET_FLAGS MFI_INIT_READY|MFI_INIT_MFIMODE|MFI_INIT_ABORT
+
+/*
+ * MFI frame flags
+ */
+#define MFI_FRAME_POST_IN_REPLY_QUEUE 0x0000
+#define MFI_FRAME_DONT_POST_IN_REPLY_QUEUE 0x0001
+#define MFI_FRAME_SGL32 0x0000
+#define MFI_FRAME_SGL64 0x0002
+#define MFI_FRAME_SENSE32 0x0000
+#define MFI_FRAME_SENSE64 0x0004
+#define MFI_FRAME_DIR_NONE 0x0000
+#define MFI_FRAME_DIR_WRITE 0x0008
+#define MFI_FRAME_DIR_READ 0x0010
+#define MFI_FRAME_DIR_BOTH 0x0018
+
+/*
+ * Definition for cmd_status
+ */
+#define MFI_CMD_STATUS_POLL_MODE 0xFF
+#define MFI_CMD_STATUS_SYNC_MODE 0xFF
+
+/*
+ * MFI command opcodes
+ */
+#define MFI_CMD_OP_INIT 0x00
+#define MFI_CMD_OP_LD_READ 0x01
+#define MFI_CMD_OP_LD_WRITE 0x02
+#define MFI_CMD_OP_LD_SCSI 0x03
+#define MFI_CMD_OP_PD_SCSI 0x04
+#define MFI_CMD_OP_DCMD 0x05
+#define MFI_CMD_OP_ABORT 0x06
+#define MFI_CMD_OP_SMP 0x07
+#define MFI_CMD_OP_STP 0x08
+
+#define DR_DCMD_CTRL_GET_INFO 0x01010000
+
+#define DR_DCMD_CTRL_CACHE_FLUSH 0x01101000
+#define DR_FLUSH_CTRL_CACHE 0x01
+#define DR_FLUSH_DISK_CACHE 0x02
+
+#define DR_DCMD_CTRL_SHUTDOWN 0x01050000
+#define DRSAS_ENABLE_DRIVE_SPINDOWN 0x01
+
+#define DR_DCMD_CTRL_EVENT_GET_INFO 0x01040100
+#define DR_DCMD_CTRL_EVENT_GET 0x01040300
+#define DR_DCMD_CTRL_EVENT_WAIT 0x01040500
+#define DR_DCMD_LD_GET_PROPERTIES 0x03030000
+#define DR_DCMD_PD_GET_INFO 0x02020000
+
+/*
+ * Solaris Specific MAX values
+ */
+#define MAX_SGL 24
+/*
+ * MFI command completion codes
+ */
+enum MFI_STAT {
+ MFI_STAT_OK = 0x00,
+ MFI_STAT_INVALID_CMD = 0x01,
+ MFI_STAT_INVALID_DCMD = 0x02,
+ MFI_STAT_INVALID_PARAMETER = 0x03,
+ MFI_STAT_INVALID_SEQUENCE_NUMBER = 0x04,
+ MFI_STAT_ABORT_NOT_POSSIBLE = 0x05,
+ MFI_STAT_APP_HOST_CODE_NOT_FOUND = 0x06,
+ MFI_STAT_APP_IN_USE = 0x07,
+ MFI_STAT_APP_NOT_INITIALIZED = 0x08,
+ MFI_STAT_ARRAY_INDEX_INVALID = 0x09,
+ MFI_STAT_ARRAY_ROW_NOT_EMPTY = 0x0a,
+ MFI_STAT_CONFIG_RESOURCE_CONFLICT = 0x0b,
+ MFI_STAT_DEVICE_NOT_FOUND = 0x0c,
+ MFI_STAT_DRIVE_TOO_SMALL = 0x0d,
+ MFI_STAT_FLASH_ALLOC_FAIL = 0x0e,
+ MFI_STAT_FLASH_BUSY = 0x0f,
+ MFI_STAT_FLASH_ERROR = 0x10,
+ MFI_STAT_FLASH_IMAGE_BAD = 0x11,
+ MFI_STAT_FLASH_IMAGE_INCOMPLETE = 0x12,
+ MFI_STAT_FLASH_NOT_OPEN = 0x13,
+ MFI_STAT_FLASH_NOT_STARTED = 0x14,
+ MFI_STAT_FLUSH_FAILED = 0x15,
+ MFI_STAT_HOST_CODE_NOT_FOUNT = 0x16,
+ MFI_STAT_LD_CC_IN_PROGRESS = 0x17,
+ MFI_STAT_LD_INIT_IN_PROGRESS = 0x18,
+ MFI_STAT_LD_LBA_OUT_OF_RANGE = 0x19,
+ MFI_STAT_LD_MAX_CONFIGURED = 0x1a,
+ MFI_STAT_LD_NOT_OPTIMAL = 0x1b,
+ MFI_STAT_LD_RBLD_IN_PROGRESS = 0x1c,
+ MFI_STAT_LD_RECON_IN_PROGRESS = 0x1d,
+ MFI_STAT_LD_WRONG_RAID_LEVEL = 0x1e,
+ MFI_STAT_MAX_SPARES_EXCEEDED = 0x1f,
+ MFI_STAT_MEMORY_NOT_AVAILABLE = 0x20,
+ MFI_STAT_MFC_HW_ERROR = 0x21,
+ MFI_STAT_NO_HW_PRESENT = 0x22,
+ MFI_STAT_NOT_FOUND = 0x23,
+ MFI_STAT_NOT_IN_ENCL = 0x24,
+ MFI_STAT_PD_CLEAR_IN_PROGRESS = 0x25,
+ MFI_STAT_PD_TYPE_WRONG = 0x26,
+ MFI_STAT_PR_DISABLED = 0x27,
+ MFI_STAT_ROW_INDEX_INVALID = 0x28,
+ MFI_STAT_SAS_CONFIG_INVALID_ACTION = 0x29,
+ MFI_STAT_SAS_CONFIG_INVALID_DATA = 0x2a,
+ MFI_STAT_SAS_CONFIG_INVALID_PAGE = 0x2b,
+ MFI_STAT_SAS_CONFIG_INVALID_TYPE = 0x2c,
+ MFI_STAT_SCSI_DONE_WITH_ERROR = 0x2d,
+ MFI_STAT_SCSI_IO_FAILED = 0x2e,
+ MFI_STAT_SCSI_RESERVATION_CONFLICT = 0x2f,
+ MFI_STAT_SHUTDOWN_FAILED = 0x30,
+ MFI_STAT_TIME_NOT_SET = 0x31,
+ MFI_STAT_WRONG_STATE = 0x32,
+ MFI_STAT_LD_OFFLINE = 0x33,
+ /* UNUSED: 0x34 to 0xfe */
+ MFI_STAT_INVALID_STATUS = 0xFF
+};
+
+enum DR_EVT_CLASS {
+ DR_EVT_CLASS_DEBUG = -2,
+ DR_EVT_CLASS_PROGRESS = -1,
+ DR_EVT_CLASS_INFO = 0,
+ DR_EVT_CLASS_WARNING = 1,
+ DR_EVT_CLASS_CRITICAL = 2,
+ DR_EVT_CLASS_FATAL = 3,
+ DR_EVT_CLASS_DEAD = 4
+};
+
+enum DR_EVT_LOCALE {
+ DR_EVT_LOCALE_LD = 0x0001,
+ DR_EVT_LOCALE_PD = 0x0002,
+ DR_EVT_LOCALE_ENCL = 0x0004,
+ DR_EVT_LOCALE_BBU = 0x0008,
+ DR_EVT_LOCALE_SAS = 0x0010,
+ DR_EVT_LOCALE_CTRL = 0x0020,
+ DR_EVT_LOCALE_CONFIG = 0x0040,
+ DR_EVT_LOCALE_CLUSTER = 0x0080,
+ DR_EVT_LOCALE_ALL = 0xffff
+};
+
+#define DR_EVT_CFG_CLEARED 0x0004
+#define DR_EVT_LD_CREATED 0x008a
+#define DR_EVT_LD_DELETED 0x008b
+#define DR_EVT_PD_REMOVED_EXT 0x00f8
+#define DR_EVT_PD_INSERTED_EXT 0x00f7
+
+enum LD_STATE {
+ LD_OFFLINE = 0,
+ LD_PARTIALLY_DEGRADED = 1,
+ LD_DEGRADED = 2,
+ LD_OPTIMAL = 3,
+ LD_INVALID = 0xFF
+};
+
+enum DRSAS_EVT {
+ DRSAS_EVT_CONFIG_TGT = 0,
+ DRSAS_EVT_UNCONFIG_TGT = 1,
+ DRSAS_EVT_UNCONFIG_SMP = 2
+};
+
+#define DMA_OBJ_ALLOCATED 1
+#define DMA_OBJ_REALLOCATED 2
+#define DMA_OBJ_FREED 3
+
+/*
+ * dma_obj_t - Our DMA object
+ * @param buffer : kernel virtual address
+ * @param size : size of the data to be allocated
+ * @param acc_handle : access handle
+ * @param dma_handle : dma handle
+ * @param dma_cookie : scatter-gather list
+ * @param dma_attr : dma attributes for this buffer
+ * Our DMA object. The caller must initialize the size and dma attributes
+ * (dma_attr) fields before allocating the resources.
+ */
+typedef struct {
+ caddr_t buffer;
+ uint32_t size;
+ ddi_acc_handle_t acc_handle;
+ ddi_dma_handle_t dma_handle;
+ ddi_dma_cookie_t dma_cookie[DRSAS_MAX_SGE_CNT];
+ ddi_dma_attr_t dma_attr;
+ uint8_t status;
+ uint8_t reserved[3];
+} dma_obj_t;
+
+struct drsas_eventinfo {
+ struct drsas_instance *instance;
+ int tgt;
+ int lun;
+ int event;
+};
+
+struct drsas_ld {
+ dev_info_t *dip;
+ uint8_t lun_type;
+ uint8_t reserved[3];
+};
+
+struct drsas_pd {
+ dev_info_t *dip;
+ uint8_t lun_type;
+ uint8_t dev_id;
+ uint8_t flags;
+ uint8_t reserved;
+};
+
+struct drsas_pd_info {
+ uint16_t deviceId;
+ uint16_t seqNum;
+ uint8_t inquiryData[96];
+ uint8_t vpdPage83[64];
+ uint8_t notSupported;
+ uint8_t scsiDevType;
+ uint8_t a;
+ uint8_t device_speed;
+ uint32_t mediaerrcnt;
+ uint32_t other;
+ uint32_t pred;
+ uint32_t lastpred;
+ uint16_t fwState;
+ uint8_t disabled;
+ uint8_t linkspwwd;
+ uint32_t ddfType;
+ struct {
+ uint8_t count;
+ uint8_t isPathBroken;
+ uint8_t connectorIndex[2];
+ uint8_t reserved[4];
+ uint64_t sasAddr[2];
+ uint8_t reserved2[16];
+ } pathInfo;
+};
+
+typedef struct drsas_instance {
+ uint32_t *producer;
+ uint32_t *consumer;
+
+ uint32_t *reply_queue;
+ dma_obj_t mfi_internal_dma_obj;
+
+ uint8_t init_id;
+ uint8_t reserved[3];
+
+ uint16_t max_num_sge;
+ uint16_t max_fw_cmds;
+ uint32_t max_sectors_per_req;
+
+ struct drsas_cmd **cmd_list;
+
+ mlist_t cmd_pool_list;
+ kmutex_t cmd_pool_mtx;
+
+ mlist_t cmd_pend_list;
+ kmutex_t cmd_pend_mtx;
+
+ dma_obj_t mfi_evt_detail_obj;
+ struct drsas_cmd *aen_cmd;
+
+ uint32_t aen_seq_num;
+ uint32_t aen_class_locale_word;
+
+ scsi_hba_tran_t *tran;
+
+ kcondvar_t int_cmd_cv;
+ kmutex_t int_cmd_mtx;
+
+ kcondvar_t aen_cmd_cv;
+ kmutex_t aen_cmd_mtx;
+
+ kcondvar_t abort_cmd_cv;
+ kmutex_t abort_cmd_mtx;
+
+ dev_info_t *dip;
+ ddi_acc_handle_t pci_handle;
+
+ timeout_id_t timeout_id;
+ uint32_t unique_id;
+ uint16_t fw_outstanding;
+ caddr_t regmap;
+ ddi_acc_handle_t regmap_handle;
+ uint8_t isr_level;
+ ddi_iblock_cookie_t iblock_cookie;
+ ddi_iblock_cookie_t soft_iblock_cookie;
+ ddi_softintr_t soft_intr_id;
+ uint8_t softint_running;
+ kmutex_t completed_pool_mtx;
+ mlist_t completed_pool_list;
+
+ caddr_t internal_buf;
+ uint32_t internal_buf_dmac_add;
+ uint32_t internal_buf_size;
+
+ uint16_t vendor_id;
+ uint16_t device_id;
+ uint16_t subsysvid;
+ uint16_t subsysid;
+ int instance;
+ int baseaddress;
+ char iocnode[16];
+
+ int fm_capabilities;
+
+ struct drsas_func_ptr *func_ptr;
+ /* MSI interrupts specific */
+ ddi_intr_handle_t *intr_htable;
+ int intr_type;
+ int intr_cnt;
+ size_t intr_size;
+ uint_t intr_pri;
+ int intr_cap;
+
+ ddi_taskq_t *taskq;
+ struct drsas_ld *dr_ld_list;
+} drsas_t;
+
+struct drsas_func_ptr {
+ int (*read_fw_status_reg)(struct drsas_instance *);
+ void (*issue_cmd)(struct drsas_cmd *, struct drsas_instance *);
+ int (*issue_cmd_in_sync_mode)(struct drsas_instance *,
+ struct drsas_cmd *);
+ int (*issue_cmd_in_poll_mode)(struct drsas_instance *,
+ struct drsas_cmd *);
+ void (*enable_intr)(struct drsas_instance *);
+ void (*disable_intr)(struct drsas_instance *);
+ int (*intr_ack)(struct drsas_instance *);
+};
+
+/*
+ * ### Helper routines ###
+ */
+
+/*
+ * con_log() - console log routine
+ * @param level : indicates the severity of the message.
+ * @fparam mt : format string
+ *
+ * con_log displays the error messages on the console based on the current
+ * debug level. Also it attaches the appropriate kernel severity level with
+ * the message.
+ *
+ *
+ * console messages debug levels
+ */
+#define CL_NONE 0 /* No debug information */
+#define CL_ANN 1 /* print unconditionally, announcements */
+#define CL_ANN1 2 /* No o/p */
+#define CL_DLEVEL1 3 /* debug level 1, informative */
+#define CL_DLEVEL2 4 /* debug level 2, verbose */
+#define CL_DLEVEL3 5 /* debug level 3, very verbose */
+
+#ifdef __SUNPRO_C
+#define __func__ ""
+#endif
+
+#define con_log(level, fmt) { if (debug_level_g >= level) cmn_err fmt; }
+
+/*
+ * ### SCSA definitions ###
+ */
+#define PKT2TGT(pkt) ((pkt)->pkt_address.a_target)
+#define PKT2LUN(pkt) ((pkt)->pkt_address.a_lun)
+#define PKT2TRAN(pkt) ((pkt)->pkt_adress.a_hba_tran)
+#define ADDR2TRAN(ap) ((ap)->a_hba_tran)
+
+#define TRAN2MR(tran) (struct drsas_instance *)(tran)->tran_hba_private)
+#define ADDR2MR(ap) (TRAN2MR(ADDR2TRAN(ap))
+
+#define PKT2CMD(pkt) ((struct scsa_cmd *)(pkt)->pkt_ha_private)
+#define CMD2PKT(sp) ((sp)->cmd_pkt)
+#define PKT2REQ(pkt) (&(PKT2CMD(pkt)->request))
+
+#define CMD2ADDR(cmd) (&CMD2PKT(cmd)->pkt_address)
+#define CMD2TRAN(cmd) (CMD2PKT(cmd)->pkt_address.a_hba_tran)
+#define CMD2MR(cmd) (TRAN2MR(CMD2TRAN(cmd)))
+
+#define CFLAG_DMAVALID 0x0001 /* requires a dma operation */
+#define CFLAG_DMASEND 0x0002 /* Transfer from the device */
+#define CFLAG_CONSISTENT 0x0040 /* consistent data transfer */
+
+/*
+ * ### Data structures for ioctl inteface and internal commands ###
+ */
+
+/*
+ * Data direction flags
+ */
+#define UIOC_RD 0x00001
+#define UIOC_WR 0x00002
+
+#define SCP2HOST(scp) (scp)->device->host /* to host */
+#define SCP2HOSTDATA(scp) SCP2HOST(scp)->hostdata /* to soft state */
+#define SCP2CHANNEL(scp) (scp)->device->channel /* to channel */
+#define SCP2TARGET(scp) (scp)->device->id /* to target */
+#define SCP2LUN(scp) (scp)->device->lun /* to LUN */
+
+#define SCSIHOST2ADAP(host) (((caddr_t *)(host->hostdata))[0])
+#define SCP2ADAPTER(scp) \
+ (struct drsas_instance *)SCSIHOST2ADAP(SCP2HOST(scp))
+
+#define MRDRV_IS_LOGICAL_SCSA(instance, acmd) \
+ (acmd->device_id < MRDRV_MAX_LD) ? 1 : 0
+#define MRDRV_IS_LOGICAL(ap) \
+ ((ap->a_target < MRDRV_MAX_LD) && (ap->a_lun == 0)) ? 1 : 0
+#define MAP_DEVICE_ID(instance, ap) \
+ (ap->a_target)
+
+#define HIGH_LEVEL_INTR 1
+#define NORMAL_LEVEL_INTR 0
+
+/*
+ * scsa_cmd - Per-command mr private data
+ * @param cmd_dmahandle : dma handle
+ * @param cmd_dmacookies : current dma cookies
+ * @param cmd_pkt : scsi_pkt reference
+ * @param cmd_dmacount : dma count
+ * @param cmd_cookie : next cookie
+ * @param cmd_ncookies : cookies per window
+ * @param cmd_cookiecnt : cookies per sub-win
+ * @param cmd_nwin : number of dma windows
+ * @param cmd_curwin : current dma window
+ * @param cmd_dma_offset : current window offset
+ * @param cmd_dma_len : current window length
+ * @param cmd_flags : private flags
+ * @param cmd_cdblen : length of cdb
+ * @param cmd_scblen : length of scb
+ * @param cmd_buf : command buffer
+ * @param channel : channel for scsi sub-system
+ * @param target : target for scsi sub-system
+ * @param lun : LUN for scsi sub-system
+ *
+ * - Allocated at same time as scsi_pkt by scsi_hba_pkt_alloc(9E)
+ * - Pointed to by pkt_ha_private field in scsi_pkt
+ */
+struct scsa_cmd {
+ ddi_dma_handle_t cmd_dmahandle;
+ ddi_dma_cookie_t cmd_dmacookies[DRSAS_MAX_SGE_CNT];
+ struct scsi_pkt *cmd_pkt;
+ ulong_t cmd_dmacount;
+ uint_t cmd_cookie;
+ uint_t cmd_ncookies;
+ uint_t cmd_cookiecnt;
+ uint_t cmd_nwin;
+ uint_t cmd_curwin;
+ off_t cmd_dma_offset;
+ ulong_t cmd_dma_len;
+ ulong_t cmd_flags;
+ uint_t cmd_cdblen;
+ uint_t cmd_scblen;
+ struct buf *cmd_buf;
+ ushort_t device_id;
+ uchar_t islogical;
+ uchar_t lun;
+ struct drsas_device *drsas_dev;
+};
+
+
+struct drsas_cmd {
+ union drsas_frame *frame;
+ uint32_t frame_phys_addr;
+ uint8_t *sense;
+ uint32_t sense_phys_addr;
+ dma_obj_t frame_dma_obj;
+ uint8_t frame_dma_obj_status;
+
+ uint32_t index;
+ uint8_t sync_cmd;
+ uint8_t cmd_status;
+ uint16_t abort_aen;
+ mlist_t list;
+ uint32_t frame_count;
+ struct scsa_cmd *cmd;
+ struct scsi_pkt *pkt;
+};
+
+#define MAX_MGMT_ADAPTERS 1024
+#define IOC_SIGNATURE "MR-SAS"
+
+#define IOC_CMD_FIRMWARE 0x0
+#define DRSAS_DRIVER_IOCTL_COMMON 0xF0010000
+#define DRSAS_DRIVER_IOCTL_DRIVER_VERSION 0xF0010100
+#define DRSAS_DRIVER_IOCTL_PCI_INFORMATION 0xF0010200
+#define DRSAS_DRIVER_IOCTL_MRRAID_STATISTICS 0xF0010300
+
+
+#define DRSAS_MAX_SENSE_LENGTH 32
+
+struct drsas_mgmt_info {
+
+ uint16_t count;
+ struct drsas_instance *instance[MAX_MGMT_ADAPTERS];
+ uint16_t map[MAX_MGMT_ADAPTERS];
+ int max_index;
+};
+
+#pragma pack(1)
+
+/*
+ * SAS controller properties
+ */
+struct drsas_ctrl_prop {
+ uint16_t seq_num;
+ uint16_t pred_fail_poll_interval;
+ uint16_t intr_throttle_count;
+ uint16_t intr_throttle_timeouts;
+
+ uint8_t rebuild_rate;
+ uint8_t patrol_read_rate;
+ uint8_t bgi_rate;
+ uint8_t cc_rate;
+ uint8_t recon_rate;
+
+ uint8_t cache_flush_interval;
+
+ uint8_t spinup_drv_count;
+ uint8_t spinup_delay;
+
+ uint8_t cluster_enable;
+ uint8_t coercion_mode;
+ uint8_t disk_write_cache_disable;
+ uint8_t alarm_enable;
+
+ uint8_t reserved[44];
+};
+
+/*
+ * SAS controller information
+ */
+struct drsas_ctrl_info {
+ /* PCI device information */
+ struct {
+ uint16_t vendor_id;
+ uint16_t device_id;
+ uint16_t sub_vendor_id;
+ uint16_t sub_device_id;
+ uint8_t reserved[24];
+ } pci;
+
+ /* Host interface information */
+ struct {
+ uint8_t PCIX : 1;
+ uint8_t PCIE : 1;
+ uint8_t iSCSI : 1;
+ uint8_t SAS_3G : 1;
+ uint8_t reserved_0 : 4;
+ uint8_t reserved_1[6];
+ uint8_t port_count;
+ uint64_t port_addr[8];
+ } host_interface;
+
+ /* Device (backend) interface information */
+ struct {
+ uint8_t SPI : 1;
+ uint8_t SAS_3G : 1;
+ uint8_t SATA_1_5G : 1;
+ uint8_t SATA_3G : 1;
+ uint8_t reserved_0 : 4;
+ uint8_t reserved_1[6];
+ uint8_t port_count;
+ uint64_t port_addr[8];
+ } device_interface;
+
+ /* List of components residing in flash. All str are null terminated */
+ uint32_t image_check_word;
+ uint32_t image_component_count;
+
+ struct {
+ char name[8];
+ char version[32];
+ char build_date[16];
+ char built_time[16];
+ } image_component[8];
+
+ /*
+ * List of flash components that have been flashed on the card, but
+ * are not in use, pending reset of the adapter. This list will be
+ * empty if a flash operation has not occurred. All stings are null
+ * terminated
+ */
+ uint32_t pending_image_component_count;
+
+ struct {
+ char name[8];
+ char version[32];
+ char build_date[16];
+ char build_time[16];
+ } pending_image_component[8];
+
+ uint8_t max_arms;
+ uint8_t max_spans;
+ uint8_t max_arrays;
+ uint8_t max_lds;
+
+ char product_name[80];
+ char serial_no[32];
+
+ /*
+ * Other physical/controller/operation information. Indicates the
+ * presence of the hardware
+ */
+ struct {
+ uint32_t bbu : 1;
+ uint32_t alarm : 1;
+ uint32_t nvram : 1;
+ uint32_t uart : 1;
+ uint32_t reserved : 28;
+ } hw_present;
+
+ uint32_t current_fw_time;
+
+ /* Maximum data transfer sizes */
+ uint16_t max_concurrent_cmds;
+ uint16_t max_sge_count;
+ uint32_t max_request_size;
+
+ /* Logical and physical device counts */
+ uint16_t ld_present_count;
+ uint16_t ld_degraded_count;
+ uint16_t ld_offline_count;
+
+ uint16_t pd_present_count;
+ uint16_t pd_disk_present_count;
+ uint16_t pd_disk_pred_failure_count;
+ uint16_t pd_disk_failed_count;
+
+ /* Memory size information */
+ uint16_t nvram_size;
+ uint16_t memory_size;
+ uint16_t flash_size;
+
+ /* Error counters */
+ uint16_t mem_correctable_error_count;
+ uint16_t mem_uncorrectable_error_count;
+
+ /* Cluster information */
+ uint8_t cluster_permitted;
+ uint8_t cluster_active;
+ uint8_t reserved_1[2];
+
+ /* Controller capabilities structures */
+ struct {
+ uint32_t raid_level_0 : 1;
+ uint32_t raid_level_1 : 1;
+ uint32_t raid_level_5 : 1;
+ uint32_t raid_level_1E : 1;
+ uint32_t reserved : 28;
+ } raid_levels;
+
+ struct {
+ uint32_t rbld_rate : 1;
+ uint32_t cc_rate : 1;
+ uint32_t bgi_rate : 1;
+ uint32_t recon_rate : 1;
+ uint32_t patrol_rate : 1;
+ uint32_t alarm_control : 1;
+ uint32_t cluster_supported : 1;
+ uint32_t bbu : 1;
+ uint32_t spanning_allowed : 1;
+ uint32_t dedicated_hotspares : 1;
+ uint32_t revertible_hotspares : 1;
+ uint32_t foreign_config_import : 1;
+ uint32_t self_diagnostic : 1;
+ uint32_t reserved : 19;
+ } adapter_operations;
+
+ struct {
+ uint32_t read_policy : 1;
+ uint32_t write_policy : 1;
+ uint32_t io_policy : 1;
+ uint32_t access_policy : 1;
+ uint32_t reserved : 28;
+ } ld_operations;
+
+ struct {
+ uint8_t min;
+ uint8_t max;
+ uint8_t reserved[2];
+ } stripe_size_operations;
+
+ struct {
+ uint32_t force_online : 1;
+ uint32_t force_offline : 1;
+ uint32_t force_rebuild : 1;
+ uint32_t reserved : 29;
+ } pd_operations;
+
+ struct {
+ uint32_t ctrl_supports_sas : 1;
+ uint32_t ctrl_supports_sata : 1;
+ uint32_t allow_mix_in_encl : 1;
+ uint32_t allow_mix_in_ld : 1;
+ uint32_t allow_sata_in_cluster : 1;
+ uint32_t reserved : 27;
+ } pd_mix_support;
+
+ /* Include the controller properties (changeable items) */
+ uint8_t reserved_2[12];
+ struct drsas_ctrl_prop properties;
+
+ uint8_t pad[0x800 - 0x640];
+};
+
+/*
+ * ==================================
+ * MegaRAID SAS2.0 driver definitions
+ * ==================================
+ */
+#define MRDRV_MAX_NUM_CMD 1024
+
+#define MRDRV_MAX_PD_CHANNELS 2
+#define MRDRV_MAX_LD_CHANNELS 2
+#define MRDRV_MAX_CHANNELS (MRDRV_MAX_PD_CHANNELS + \
+ MRDRV_MAX_LD_CHANNELS)
+#define MRDRV_MAX_DEV_PER_CHANNEL 128
+#define MRDRV_DEFAULT_INIT_ID -1
+#define MRDRV_MAX_CMD_PER_LUN 1000
+#define MRDRV_MAX_LUN 1
+#define MRDRV_MAX_LD 64
+
+#define MRDRV_RESET_WAIT_TIME 300
+#define MRDRV_RESET_NOTICE_INTERVAL 5
+
+#define DRSAS_IOCTL_CMD 0
+
+/*
+ * FW can accept both 32 and 64 bit SGLs. We want to allocate 32/64 bit
+ * SGLs based on the size of dma_addr_t
+ */
+#define IS_DMA64 (sizeof (dma_addr_t) == 8)
+
+#define IB_MSG_0_OFF 0x10 /* XScale */
+#define OB_MSG_0_OFF 0x18 /* XScale */
+#define IB_DOORBELL_OFF 0x20 /* XScale & ROC */
+#define OB_INTR_STATUS_OFF 0x30 /* XScale & ROC */
+#define OB_INTR_MASK_OFF 0x34 /* XScale & ROC */
+#define IB_QPORT_OFF 0x40 /* XScale & ROC */
+#define OB_DOORBELL_CLEAR_OFF 0xA0 /* ROC */
+#define OB_SCRATCH_PAD_0_OFF 0xB0 /* ROC */
+#define OB_INTR_MASK 0xFFFFFFFF
+#define OB_DOORBELL_CLEAR_MASK 0xFFFFFFFF
+
+/*
+ * All MFI register set macros accept drsas_register_set*
+ */
+#define WR_IB_MSG_0(v, instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + IB_MSG_0_OFF), (v))
+
+#define RD_OB_MSG_0(instance) ddi_get32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_MSG_0_OFF))
+
+#define WR_IB_DOORBELL(v, instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + IB_DOORBELL_OFF), (v))
+
+#define RD_IB_DOORBELL(instance) ddi_get32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + IB_DOORBELL_OFF))
+
+#define WR_OB_INTR_STATUS(v, instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_INTR_STATUS_OFF), (v))
+
+#define RD_OB_INTR_STATUS(instance) ddi_get32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_INTR_STATUS_OFF))
+
+#define WR_OB_INTR_MASK(v, instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_INTR_MASK_OFF), (v))
+
+#define RD_OB_INTR_MASK(instance) ddi_get32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_INTR_MASK_OFF))
+
+#define WR_IB_QPORT(v, instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + IB_QPORT_OFF), (v))
+
+#define WR_OB_DOORBELL_CLEAR(v, instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_DOORBELL_CLEAR_OFF), \
+ (v))
+
+#define RD_OB_SCRATCH_PAD_0(instance) ddi_get32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_SCRATCH_PAD_0_OFF))
+
+/*
+ * When FW is in MFI_STATE_READY or MFI_STATE_OPERATIONAL, the state data
+ * of Outbound Msg Reg 0 indicates max concurrent cmds supported, max SGEs
+ * supported per cmd and if 64-bit MFAs (M64) is enabled or disabled.
+ */
+#define MFI_OB_INTR_STATUS_MASK 0x00000002
+
+/*
+ * This MFI_REPLY_2108_MESSAGE_INTR flag is used also
+ * in enable_intr_ppc also. Hence bit 2, i.e. 0x4 has
+ * been set in this flag along with bit 1.
+ */
+#define MFI_REPLY_2108_MESSAGE_INTR 0x00000001
+#define MFI_REPLY_2108_MESSAGE_INTR_MASK 0x00000005
+
+#define MFI_POLL_TIMEOUT_SECS 60
+
+#define MFI_ENABLE_INTR(instance) ddi_put32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_INTR_MASK_OFF), 1)
+#define MFI_DISABLE_INTR(instance) \
+{ \
+ uint32_t disable = 1; \
+ uint32_t mask = ddi_get32((instance)->regmap_handle, \
+ (uint32_t *)((uintptr_t)(instance)->regmap + OB_INTR_MASK_OFF));\
+ mask &= ~disable; \
+ ddi_put32((instance)->regmap_handle, (uint32_t *) \
+ (uintptr_t)((instance)->regmap + OB_INTR_MASK_OFF), mask); \
+}
+
+/* By default, the firmware programs for 8 Kbytes of memory */
+#define DEFAULT_MFI_MEM_SZ 8192
+#define MINIMUM_MFI_MEM_SZ 4096
+
+/* DCMD Message Frame MAILBOX0-11 */
+#define DCMD_MBOX_SZ 12
+
+
+struct drsas_register_set {
+ uint32_t reserved_0[4];
+
+ uint32_t inbound_msg_0;
+ uint32_t inbound_msg_1;
+ uint32_t outbound_msg_0;
+ uint32_t outbound_msg_1;
+
+ uint32_t inbound_doorbell;
+ uint32_t inbound_intr_status;
+ uint32_t inbound_intr_mask;
+
+ uint32_t outbound_doorbell;
+ uint32_t outbound_intr_status;
+ uint32_t outbound_intr_mask;
+
+ uint32_t reserved_1[2];
+
+ uint32_t inbound_queue_port;
+ uint32_t outbound_queue_port;
+
+ uint32_t reserved_2[22];
+
+ uint32_t outbound_doorbell_clear;
+
+ uint32_t reserved_3[3];
+
+ uint32_t outbound_scratch_pad;
+
+ uint32_t reserved_4[3];
+
+ uint32_t inbound_low_queue_port;
+
+ uint32_t inbound_high_queue_port;
+
+ uint32_t reserved_5;
+ uint32_t index_registers[820];
+};
+
+struct drsas_sge32 {
+ uint32_t phys_addr;
+ uint32_t length;
+};
+
+struct drsas_sge64 {
+ uint64_t phys_addr;
+ uint32_t length;
+};
+
+union drsas_sgl {
+ struct drsas_sge32 sge32[1];
+ struct drsas_sge64 sge64[1];
+};
+
+struct drsas_header {
+ uint8_t cmd;
+ uint8_t sense_len;
+ uint8_t cmd_status;
+ uint8_t scsi_status;
+
+ uint8_t target_id;
+ uint8_t lun;
+ uint8_t cdb_len;
+ uint8_t sge_count;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t timeout;
+ uint32_t data_xferlen;
+};
+
+union drsas_sgl_frame {
+ struct drsas_sge32 sge32[8];
+ struct drsas_sge64 sge64[5];
+};
+
+struct drsas_init_frame {
+ uint8_t cmd;
+ uint8_t reserved_0;
+ uint8_t cmd_status;
+
+ uint8_t reserved_1;
+ uint32_t reserved_2;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t reserved_3;
+ uint32_t data_xfer_len;
+
+ uint32_t queue_info_new_phys_addr_lo;
+ uint32_t queue_info_new_phys_addr_hi;
+ uint32_t queue_info_old_phys_addr_lo;
+ uint32_t queue_info_old_phys_addr_hi;
+
+ uint32_t reserved_4[6];
+};
+
+struct drsas_init_queue_info {
+ uint32_t init_flags;
+ uint32_t reply_queue_entries;
+
+ uint32_t reply_queue_start_phys_addr_lo;
+ uint32_t reply_queue_start_phys_addr_hi;
+ uint32_t producer_index_phys_addr_lo;
+ uint32_t producer_index_phys_addr_hi;
+ uint32_t consumer_index_phys_addr_lo;
+ uint32_t consumer_index_phys_addr_hi;
+};
+
+struct drsas_io_frame {
+ uint8_t cmd;
+ uint8_t sense_len;
+ uint8_t cmd_status;
+ uint8_t scsi_status;
+
+ uint8_t target_id;
+ uint8_t access_byte;
+ uint8_t reserved_0;
+ uint8_t sge_count;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t timeout;
+ uint32_t lba_count;
+
+ uint32_t sense_buf_phys_addr_lo;
+ uint32_t sense_buf_phys_addr_hi;
+
+ uint32_t start_lba_lo;
+ uint32_t start_lba_hi;
+
+ union drsas_sgl sgl;
+};
+
+struct drsas_pthru_frame {
+ uint8_t cmd;
+ uint8_t sense_len;
+ uint8_t cmd_status;
+ uint8_t scsi_status;
+
+ uint8_t target_id;
+ uint8_t lun;
+ uint8_t cdb_len;
+ uint8_t sge_count;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t timeout;
+ uint32_t data_xfer_len;
+
+ uint32_t sense_buf_phys_addr_lo;
+ uint32_t sense_buf_phys_addr_hi;
+
+ uint8_t cdb[16];
+ union drsas_sgl sgl;
+};
+
+struct drsas_dcmd_frame {
+ uint8_t cmd;
+ uint8_t reserved_0;
+ uint8_t cmd_status;
+ uint8_t reserved_1[4];
+ uint8_t sge_count;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t timeout;
+
+ uint32_t data_xfer_len;
+ uint32_t opcode;
+
+ union {
+ uint8_t b[DCMD_MBOX_SZ];
+ uint16_t s[6];
+ uint32_t w[3];
+ } mbox;
+
+ union drsas_sgl sgl;
+};
+
+struct drsas_abort_frame {
+ uint8_t cmd;
+ uint8_t reserved_0;
+ uint8_t cmd_status;
+
+ uint8_t reserved_1;
+ uint32_t reserved_2;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t reserved_3;
+ uint32_t reserved_4;
+
+ uint32_t abort_context;
+ uint32_t pad_1;
+
+ uint32_t abort_mfi_phys_addr_lo;
+ uint32_t abort_mfi_phys_addr_hi;
+
+ uint32_t reserved_5[6];
+};
+
+struct drsas_smp_frame {
+ uint8_t cmd;
+ uint8_t reserved_1;
+ uint8_t cmd_status;
+ uint8_t connection_status;
+
+ uint8_t reserved_2[3];
+ uint8_t sge_count;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t timeout;
+
+ uint32_t data_xfer_len;
+
+ uint64_t sas_addr;
+
+ union drsas_sgl sgl[2];
+};
+
+struct drsas_stp_frame {
+ uint8_t cmd;
+ uint8_t reserved_1;
+ uint8_t cmd_status;
+ uint8_t connection_status;
+
+ uint8_t target_id;
+ uint8_t reserved_2[2];
+ uint8_t sge_count;
+
+ uint32_t context;
+ uint8_t req_id;
+ uint8_t msgvector;
+ uint16_t pad_0;
+
+ uint16_t flags;
+ uint16_t timeout;
+
+ uint32_t data_xfer_len;
+
+ uint16_t fis[10];
+ uint32_t stp_flags;
+ union drsas_sgl sgl;
+};
+
+union drsas_frame {
+ struct drsas_header hdr;
+ struct drsas_init_frame init;
+ struct drsas_io_frame io;
+ struct drsas_pthru_frame pthru;
+ struct drsas_dcmd_frame dcmd;
+ struct drsas_abort_frame abort;
+ struct drsas_smp_frame smp;
+ struct drsas_stp_frame stp;
+
+ uint8_t raw_bytes[64];
+};
+
+typedef struct drsas_pd_address {
+ uint16_t device_id;
+ uint16_t encl_id;
+
+ union {
+ struct {
+ uint8_t encl_index;
+ uint8_t slot_number;
+ } pd_address;
+ struct {
+ uint8_t encl_position;
+ uint8_t encl_connector_index;
+ } encl_address;
+ }address;
+
+ uint8_t scsi_dev_type;
+
+ union {
+ uint8_t port_bitmap;
+ uint8_t port_numbers;
+ } connected;
+
+ uint64_t sas_addr[2];
+} drsas_pd_address_t;
+
+union drsas_evt_class_locale {
+ struct {
+ uint16_t locale;
+ uint8_t reserved;
+ int8_t class;
+ } members;
+
+ uint32_t word;
+};
+
+struct drsas_evt_log_info {
+ uint32_t newest_seq_num;
+ uint32_t oldest_seq_num;
+ uint32_t clear_seq_num;
+ uint32_t shutdown_seq_num;
+ uint32_t boot_seq_num;
+};
+
+struct drsas_progress {
+ uint16_t progress;
+ uint16_t elapsed_seconds;
+};
+
+struct drsas_evtarg_ld {
+ uint16_t target_id;
+ uint8_t ld_index;
+ uint8_t reserved;
+};
+
+struct drsas_evtarg_pd {
+ uint16_t device_id;
+ uint8_t encl_index;
+ uint8_t slot_number;
+};
+
+struct drsas_evt_detail {
+ uint32_t seq_num;
+ uint32_t time_stamp;
+ uint32_t code;
+ union drsas_evt_class_locale cl;
+ uint8_t arg_type;
+ uint8_t reserved1[15];
+
+ union {
+ struct {
+ struct drsas_evtarg_pd pd;
+ uint8_t cdb_length;
+ uint8_t sense_length;
+ uint8_t reserved[2];
+ uint8_t cdb[16];
+ uint8_t sense[64];
+ } cdbSense;
+
+ struct drsas_evtarg_ld ld;
+
+ struct {
+ struct drsas_evtarg_ld ld;
+ uint64_t count;
+ } ld_count;
+
+ struct {
+ uint64_t lba;
+ struct drsas_evtarg_ld ld;
+ } ld_lba;
+
+ struct {
+ struct drsas_evtarg_ld ld;
+ uint32_t prevOwner;
+ uint32_t newOwner;
+ } ld_owner;
+
+ struct {
+ uint64_t ld_lba;
+ uint64_t pd_lba;
+ struct drsas_evtarg_ld ld;
+ struct drsas_evtarg_pd pd;
+ } ld_lba_pd_lba;
+
+ struct {
+ struct drsas_evtarg_ld ld;
+ struct drsas_progress prog;
+ } ld_prog;
+
+ struct {
+ struct drsas_evtarg_ld ld;
+ uint32_t prev_state;
+ uint32_t new_state;
+ } ld_state;
+
+ struct {
+ uint64_t strip;
+ struct drsas_evtarg_ld ld;
+ } ld_strip;
+
+ struct drsas_evtarg_pd pd;
+
+ struct {
+ struct drsas_evtarg_pd pd;
+ uint32_t err;
+ } pd_err;
+
+ struct {
+ uint64_t lba;
+ struct drsas_evtarg_pd pd;
+ } pd_lba;
+
+ struct {
+ uint64_t lba;
+ struct drsas_evtarg_pd pd;
+ struct drsas_evtarg_ld ld;
+ } pd_lba_ld;
+
+ struct {
+ struct drsas_evtarg_pd pd;
+ struct drsas_progress prog;
+ } pd_prog;
+
+ struct {
+ struct drsas_evtarg_pd pd;
+ uint32_t prevState;
+ uint32_t newState;
+ } pd_state;
+
+ struct {
+ uint16_t vendorId;
+ uint16_t deviceId;
+ uint16_t subVendorId;
+ uint16_t subDeviceId;
+ } pci;
+
+ uint32_t rate;
+ char str[96];
+
+ struct {
+ uint32_t rtc;
+ uint32_t elapsedSeconds;
+ } time;
+
+ struct {
+ uint32_t ecar;
+ uint32_t elog;
+ char str[64];
+ } ecc;
+
+ drsas_pd_address_t pd_addr;
+
+ uint8_t b[96];
+ uint16_t s[48];
+ uint32_t w[24];
+ uint64_t d[12];
+ } args;
+
+ char description[128];
+
+};
+
+/* only 63 are usable by the application */
+#define MAX_LOGICAL_DRIVES 64
+/* only 255 physical devices may be used */
+#define MAX_PHYSICAL_DEVICES 256
+#define MAX_PD_PER_ENCLOSURE 64
+/* maximum disks per array */
+#define MAX_ROW_SIZE 32
+/* maximum spans per logical drive */
+#define MAX_SPAN_DEPTH 8
+/* maximum number of arrays a hot spare may be dedicated to */
+#define MAX_ARRAYS_DEDICATED 16
+/* maximum number of arrays which may exist */
+#define MAX_ARRAYS 128
+/* maximum number of foreign configs that may ha managed at once */
+#define MAX_FOREIGN_CONFIGS 8
+/* maximum spares (global and dedicated combined) */
+#define MAX_SPARES_FOR_THE_CONTROLLER MAX_PHYSICAL_DEVICES
+/* maximum possible Target IDs (i.e. 0 to 63) */
+#define MAX_TARGET_ID 63
+/* maximum number of supported enclosures */
+#define MAX_ENCLOSURES 32
+/* maximum number of PHYs per controller */
+#define MAX_PHYS_PER_CONTROLLER 16
+/* maximum number of LDs per array (due to DDF limitations) */
+#define MAX_LDS_PER_ARRAY 16
+
+/*
+ * -----------------------------------------------------------------------------
+ * -----------------------------------------------------------------------------
+ *
+ * Logical Drive commands
+ *
+ * -----------------------------------------------------------------------------
+ * -----------------------------------------------------------------------------
+ */
+#define DR_DCMD_LD 0x03000000, /* Logical Device (LD) opcodes */
+
+/*
+ * Input: dcmd.opcode - DR_DCMD_LD_GET_LIST
+ * dcmd.mbox - reserved
+ * dcmd.sge IN - ptr to returned DR_LD_LIST structure
+ * Desc: Return the logical drive list structure
+ * Status: No error
+ */
+
+/*
+ * defines the logical drive reference structure
+ */
+typedef union _DR_LD_REF { /* LD reference structure */
+ struct {
+ uint8_t targetId; /* LD target id (0 to MAX_TARGET_ID) */
+ uint8_t reserved; /* reserved for in line with DR_PD_REF */
+ uint16_t seqNum; /* Sequence Number */
+ } ld_ref;
+ uint32_t ref; /* shorthand reference to full 32-bits */
+} DR_LD_REF; /* 4 bytes */
+
+/*
+ * defines the logical drive list structure
+ */
+typedef struct _DR_LD_LIST {
+ uint32_t ldCount; /* number of LDs */
+ uint32_t reserved; /* pad to 8-byte boundary */
+ struct {
+ DR_LD_REF ref; /* LD reference */
+ uint8_t state; /* current LD state (DR_LD_STATE) */
+ uint8_t reserved[3]; /* pad to 8-byte boundary */
+ uint64_t size; /* LD size */
+ } ldList[MAX_LOGICAL_DRIVES];
+} DR_LD_LIST;
+
+struct drsas_drv_ver {
+ uint8_t signature[12];
+ uint8_t os_name[16];
+ uint8_t os_ver[12];
+ uint8_t drv_name[20];
+ uint8_t drv_ver[32];
+ uint8_t drv_rel_date[20];
+};
+
+#define PCI_TYPE0_ADDRESSES 6
+#define PCI_TYPE1_ADDRESSES 2
+#define PCI_TYPE2_ADDRESSES 5
+
+struct drsas_pci_common_header {
+ uint16_t vendorID; /* (ro) */
+ uint16_t deviceID; /* (ro) */
+ uint16_t command; /* Device control */
+ uint16_t status;
+ uint8_t revisionID; /* (ro) */
+ uint8_t progIf; /* (ro) */
+ uint8_t subClass; /* (ro) */
+ uint8_t baseClass; /* (ro) */
+ uint8_t cacheLineSize; /* (ro+) */
+ uint8_t latencyTimer; /* (ro+) */
+ uint8_t headerType; /* (ro) */
+ uint8_t bist; /* Built in self test */
+
+ union {
+ struct {
+ uint32_t baseAddresses[PCI_TYPE0_ADDRESSES];
+ uint32_t cis;
+ uint16_t subVendorID;
+ uint16_t subSystemID;
+ uint32_t romBaseAddress;
+ uint8_t capabilitiesPtr;
+ uint8_t reserved1[3];
+ uint32_t reserved2;
+ uint8_t interruptLine;
+ uint8_t interruptPin; /* (ro) */
+ uint8_t minimumGrant; /* (ro) */
+ uint8_t maximumLatency; /* (ro) */
+ } type_0;
+
+ struct {
+ uint32_t baseAddresses[PCI_TYPE1_ADDRESSES];
+ uint8_t primaryBus;
+ uint8_t secondaryBus;
+ uint8_t subordinateBus;
+ uint8_t secondaryLatency;
+ uint8_t ioBase;
+ uint8_t ioLimit;
+ uint16_t secondaryStatus;
+ uint16_t memoryBase;
+ uint16_t memoryLimit;
+ uint16_t prefetchBase;
+ uint16_t prefetchLimit;
+ uint32_t prefetchBaseUpper32;
+ uint32_t prefetchLimitUpper32;
+ uint16_t ioBaseUpper16;
+ uint16_t ioLimitUpper16;
+ uint8_t capabilitiesPtr;
+ uint8_t reserved1[3];
+ uint32_t romBaseAddress;
+ uint8_t interruptLine;
+ uint8_t interruptPin;
+ uint16_t bridgeControl;
+ } type_1;
+
+ struct {
+ uint32_t socketRegistersBaseAddress;
+ uint8_t capabilitiesPtr;
+ uint8_t reserved;
+ uint16_t secondaryStatus;
+ uint8_t primaryBus;
+ uint8_t secondaryBus;
+ uint8_t subordinateBus;
+ uint8_t secondaryLatency;
+ struct {
+ uint32_t base;
+ uint32_t limit;
+ } range[PCI_TYPE2_ADDRESSES-1];
+ uint8_t interruptLine;
+ uint8_t interruptPin;
+ uint16_t bridgeControl;
+ } type_2;
+ } header;
+};
+
+struct drsas_pci_link_capability {
+ union {
+ struct {
+ uint32_t linkSpeed :4;
+ uint32_t linkWidth :6;
+ uint32_t aspmSupport :2;
+ uint32_t losExitLatency :3;
+ uint32_t l1ExitLatency :3;
+ uint32_t rsvdp :6;
+ uint32_t portNumber :8;
+ } bits;
+
+ uint32_t asUlong;
+ } cap;
+
+};
+
+struct drsas_pci_link_status_capability {
+ union {
+ struct {
+ uint16_t linkSpeed :4;
+ uint16_t negotiatedLinkWidth :6;
+ uint16_t linkTrainingError :1;
+ uint16_t linkTraning :1;
+ uint16_t slotClockConfig :1;
+ uint16_t rsvdZ :3;
+ } bits;
+
+ uint16_t asUshort;
+ } stat_cap;
+
+ uint16_t reserved;
+
+};
+
+struct drsas_pci_capabilities {
+ struct drsas_pci_link_capability linkCapability;
+ struct drsas_pci_link_status_capability linkStatusCapability;
+};
+
+struct drsas_pci_information
+{
+ uint32_t busNumber;
+ uint8_t deviceNumber;
+ uint8_t functionNumber;
+ uint8_t interruptVector;
+ uint8_t reserved;
+ struct drsas_pci_common_header pciHeaderInfo;
+ struct drsas_pci_capabilities capability;
+ uint8_t reserved2[32];
+};
+
+struct drsas_ioctl {
+ uint16_t version;
+ uint16_t controller_id;
+ uint8_t signature[8];
+ uint32_t reserved_1;
+ uint32_t control_code;
+ uint32_t reserved_2[2];
+ uint8_t frame[64];
+ union drsas_sgl_frame sgl_frame;
+ uint8_t sense_buff[DRSAS_MAX_SENSE_LENGTH];
+ uint8_t data[1];
+};
+
+struct drsas_aen {
+ uint16_t host_no;
+ uint16_t cmd_status;
+ uint32_t seq_num;
+ uint32_t class_locale_word;
+};
+#pragma pack()
+
+#ifndef DDI_VENDOR_LSI
+#define DDI_VENDOR_LSI "LSI"
+#endif /* DDI_VENDOR_LSI */
+
+static int drsas_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **);
+static int drsas_attach(dev_info_t *, ddi_attach_cmd_t);
+static int drsas_reset(dev_info_t *, ddi_reset_cmd_t);
+static int drsas_detach(dev_info_t *, ddi_detach_cmd_t);
+static int drsas_open(dev_t *, int, int, cred_t *);
+static int drsas_close(dev_t, int, int, cred_t *);
+static int drsas_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
+
+static int drsas_tran_tgt_init(dev_info_t *, dev_info_t *,
+ scsi_hba_tran_t *, struct scsi_device *);
+static struct scsi_pkt *drsas_tran_init_pkt(struct scsi_address *, register
+ struct scsi_pkt *, struct buf *, int, int, int, int,
+ int (*)(), caddr_t);
+static int drsas_tran_start(struct scsi_address *,
+ register struct scsi_pkt *);
+static int drsas_tran_abort(struct scsi_address *, struct scsi_pkt *);
+static int drsas_tran_reset(struct scsi_address *, int);
+static int drsas_tran_getcap(struct scsi_address *, char *, int);
+static int drsas_tran_setcap(struct scsi_address *, char *, int, int);
+static void drsas_tran_destroy_pkt(struct scsi_address *,
+ struct scsi_pkt *);
+static void drsas_tran_dmafree(struct scsi_address *, struct scsi_pkt *);
+static void drsas_tran_sync_pkt(struct scsi_address *, struct scsi_pkt *);
+static uint_t drsas_isr();
+static uint_t drsas_softintr();
+
+static int init_mfi(struct drsas_instance *);
+static int drsas_free_dma_obj(struct drsas_instance *, dma_obj_t);
+static int drsas_alloc_dma_obj(struct drsas_instance *, dma_obj_t *,
+ uchar_t);
+static struct drsas_cmd *get_mfi_pkt(struct drsas_instance *);
+static void return_mfi_pkt(struct drsas_instance *,
+ struct drsas_cmd *);
+
+static void free_space_for_mfi(struct drsas_instance *);
+static void free_additional_dma_buffer(struct drsas_instance *);
+static int alloc_additional_dma_buffer(struct drsas_instance *);
+static int read_fw_status_reg_ppc(struct drsas_instance *);
+static void issue_cmd_ppc(struct drsas_cmd *, struct drsas_instance *);
+static int issue_cmd_in_poll_mode_ppc(struct drsas_instance *,
+ struct drsas_cmd *);
+static int issue_cmd_in_sync_mode_ppc(struct drsas_instance *,
+ struct drsas_cmd *);
+static void enable_intr_ppc(struct drsas_instance *);
+static void disable_intr_ppc(struct drsas_instance *);
+static int intr_ack_ppc(struct drsas_instance *);
+static int mfi_state_transition_to_ready(struct drsas_instance *);
+static void destroy_mfi_frame_pool(struct drsas_instance *);
+static int create_mfi_frame_pool(struct drsas_instance *);
+static int drsas_dma_alloc(struct drsas_instance *, struct scsi_pkt *,
+ struct buf *, int, int (*)());
+static int drsas_dma_move(struct drsas_instance *,
+ struct scsi_pkt *, struct buf *);
+static void flush_cache(struct drsas_instance *instance);
+static void display_scsi_inquiry(caddr_t);
+static int start_mfi_aen(struct drsas_instance *instance);
+static int handle_drv_ioctl(struct drsas_instance *instance,
+ struct drsas_ioctl *ioctl, int mode);
+static int handle_mfi_ioctl(struct drsas_instance *instance,
+ struct drsas_ioctl *ioctl, int mode);
+static int handle_mfi_aen(struct drsas_instance *instance,
+ struct drsas_aen *aen);
+static void fill_up_drv_ver(struct drsas_drv_ver *dv);
+static struct drsas_cmd *build_cmd(struct drsas_instance *instance,
+ struct scsi_address *ap, struct scsi_pkt *pkt,
+ uchar_t *cmd_done);
+static int register_mfi_aen(struct drsas_instance *instance,
+ uint32_t seq_num, uint32_t class_locale_word);
+static int issue_mfi_pthru(struct drsas_instance *instance, struct
+ drsas_ioctl *ioctl, struct drsas_cmd *cmd, int mode);
+static int issue_mfi_dcmd(struct drsas_instance *instance, struct
+ drsas_ioctl *ioctl, struct drsas_cmd *cmd, int mode);
+static int issue_mfi_smp(struct drsas_instance *instance, struct
+ drsas_ioctl *ioctl, struct drsas_cmd *cmd, int mode);
+static int issue_mfi_stp(struct drsas_instance *instance, struct
+ drsas_ioctl *ioctl, struct drsas_cmd *cmd, int mode);
+static int abort_aen_cmd(struct drsas_instance *instance,
+ struct drsas_cmd *cmd_to_abort);
+
+static int drsas_common_check(struct drsas_instance *instance,
+ struct drsas_cmd *cmd);
+static void drsas_fm_init(struct drsas_instance *instance);
+static void drsas_fm_fini(struct drsas_instance *instance);
+static int drsas_fm_error_cb(dev_info_t *, ddi_fm_error_t *,
+ const void *);
+static void drsas_fm_ereport(struct drsas_instance *instance,
+ char *detail);
+static int drsas_check_dma_handle(ddi_dma_handle_t handle);
+static int drsas_check_acc_handle(ddi_acc_handle_t handle);
+
+static void drsas_rem_intrs(struct drsas_instance *instance);
+static int drsas_add_intrs(struct drsas_instance *instance, int intr_type);
+
+static void drsas_tran_tgt_free(dev_info_t *, dev_info_t *,
+ scsi_hba_tran_t *, struct scsi_device *);
+static int drsas_tran_bus_config(dev_info_t *, uint_t,
+ ddi_bus_config_op_t, void *, dev_info_t **);
+static int drsas_parse_devname(char *, int *, int *);
+static int drsas_config_all_devices(struct drsas_instance *);
+static int drsas_config_scsi_device(struct drsas_instance *,
+ struct scsi_device *, dev_info_t **);
+static int drsas_config_ld(struct drsas_instance *, uint16_t,
+ uint8_t, dev_info_t **);
+static dev_info_t *drsas_find_child(struct drsas_instance *, uint16_t,
+ uint8_t);
+static int drsas_name_node(dev_info_t *, char *, int);
+static void drsas_issue_evt_taskq(struct drsas_eventinfo *);
+static int drsas_service_evt(struct drsas_instance *, int, int, int,
+ uint64_t);
+static int drsas_mode_sense_build(struct scsi_pkt *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _DR_SAS_H_ */
diff --git a/usr/src/uts/common/io/dr_sas/dr_sas_list.h b/usr/src/uts/common/io/dr_sas/dr_sas_list.h
new file mode 100644
index 0000000000..4154a77796
--- /dev/null
+++ b/usr/src/uts/common/io/dr_sas/dr_sas_list.h
@@ -0,0 +1,212 @@
+/*
+ * dr_sas_list.h: header for dr_sas
+ *
+ * Solaris MegaRAID driver for SAS2.0 controllers
+ * Copyright (c) 2008-2009, LSI Logic Corporation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the author nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _DR_SAS_LIST_H_
+#define _DR_SAS_LIST_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Simple doubly linked list implementation.
+ *
+ * Some of the internal functions ("__xxx") are useful when
+ * manipulating whole lists rather than single entries, as
+ * sometimes we already know the next/prev entries and we can
+ * generate better code by using them directly rather than
+ * using the generic single-entry routines.
+ */
+
+struct mlist_head {
+ struct mlist_head *next, *prev;
+};
+
+typedef struct mlist_head mlist_t;
+
+#define LIST_HEAD_INIT(name) { &(name), &(name) }
+
+#define LIST_HEAD(name) \
+ struct mlist_head name = LIST_HEAD_INIT(name)
+
+#define INIT_LIST_HEAD(ptr) { \
+ (ptr)->next = (ptr); (ptr)->prev = (ptr); \
+}
+
+
+/*
+ * Insert a new entry between two known consecutive entries.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static void __list_add(struct mlist_head *new,
+ struct mlist_head *prev,
+ struct mlist_head *next)
+{
+ next->prev = new;
+ new->next = next;
+ new->prev = prev;
+ prev->next = new;
+}
+
+
+/*
+ * mlist_add - add a new entry
+ * @new: new entry to be added
+ * @head: list head to add it after
+ *
+ * Insert a new entry after the specified head.
+ * This is good for implementing stacks.
+ */
+static void mlist_add(struct mlist_head *new, struct mlist_head *head)
+{
+ __list_add(new, head, head->next);
+}
+
+
+/*
+ * mlist_add_tail - add a new entry
+ * @new: new entry to be added
+ * @head: list head to add it before
+ *
+ * Insert a new entry before the specified head.
+ * This is useful for implementing queues.
+ */
+static void mlist_add_tail(struct mlist_head *new, struct mlist_head *head)
+{
+ __list_add(new, head->prev, head);
+}
+
+
+
+/*
+ * Delete a list entry by making the prev/next entries
+ * point to each other.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static void __list_del(struct mlist_head *prev,
+ struct mlist_head *next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
+
+/*
+ * mlist_del_init - deletes entry from list and reinitialize it.
+ * @entry: the element to delete from the list.
+ */
+static void mlist_del_init(struct mlist_head *entry)
+{
+ __list_del(entry->prev, entry->next);
+ INIT_LIST_HEAD(entry);
+}
+
+
+/*
+ * mlist_empty - tests whether a list is empty
+ * @head: the list to test.
+ */
+static int mlist_empty(struct mlist_head *head)
+{
+ return (head->next == head);
+}
+
+
+/*
+ * mlist_splice - join two lists
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ */
+static void mlist_splice(struct mlist_head *list, struct mlist_head *head)
+{
+ struct mlist_head *first = list->next;
+
+ if (first != list) {
+ struct mlist_head *last = list->prev;
+ struct mlist_head *at = head->next;
+
+ first->prev = head;
+ head->next = first;
+
+ last->next = at;
+ at->prev = last;
+ }
+}
+
+
+/*
+ * mlist_entry - get the struct for this entry
+ * @ptr: the &struct mlist_head pointer.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_struct within the struct.
+ */
+#define mlist_entry(ptr, type, member) \
+ ((type *)((size_t)(ptr) - offsetof(type, member)))
+
+
+/*
+ * mlist_for_each - iterate over a list
+ * @pos: the &struct mlist_head to use as a loop counter.
+ * @head: the head for your list.
+ */
+#define mlist_for_each(pos, head) \
+ for (pos = (head)->next, prefetch(pos->next); pos != (head); \
+ pos = pos->next, prefetch(pos->next))
+
+
+/*
+ * mlist_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos: the &struct mlist_head to use as a loop counter.
+ * @n: another &struct mlist_head to use as temporary storage
+ * @head: the head for your list.
+ */
+#define mlist_for_each_safe(pos, n, head) \
+ for (pos = (head)->next, n = pos->next; pos != (head); \
+ pos = n, n = pos->next)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _DR_SAS_LIST_H_ */
diff --git a/usr/src/uts/common/io/fibre-channel/fca/oce/oce_rx.c b/usr/src/uts/common/io/fibre-channel/fca/oce/oce_rx.c
index da00160b68..2efb178ff1 100644
--- a/usr/src/uts/common/io/fibre-channel/fca/oce/oce_rx.c
+++ b/usr/src/uts/common/io/fibre-channel/fca/oce/oce_rx.c
@@ -532,8 +532,7 @@ oce_drain_rq_cq(void *arg)
if (dev->function_mode & FLEX10_MODE) {
if (cqe->u0.s.vlan_tag_present &&
cqe->u0.s.qnq) {
- oce_rx_insert_tag(mp,
- cqe->u0.s.vlan_tag);
+ oce_rx_insert_tag(mp, cqe->u0.s.vlan_tag);
}
} else if (cqe->u0.s.vlan_tag_present) {
oce_rx_insert_tag(mp, cqe->u0.s.vlan_tag);
diff --git a/usr/src/uts/common/io/hook.c b/usr/src/uts/common/io/hook.c
index 2c774094e9..f7ed005413 100644
--- a/usr/src/uts/common/io/hook.c
+++ b/usr/src/uts/common/io/hook.c
@@ -21,6 +21,8 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
#include <sys/param.h>
#include <sys/types.h>
@@ -49,6 +51,8 @@ static struct modlinkage modlinkage = {
NULL
};
+static const char *hook_hintvalue_none = "<none>";
+
/*
* How it works.
* =============
@@ -521,7 +525,7 @@ hook_stack_init(netstackid_t stackid, netstack_t *ns)
* all of the data structures and sets the flag(s) there? The answer is
* that it is expected that this will happen when the zone shutdown calls
* the shutdown callbacks for other modules that they will initiate the
- * free'ing and shutdown of the hooks themselves.
+ * free'ing and shutdown of the hooks themselves.
*/
/*ARGSUSED*/
static void
@@ -807,7 +811,7 @@ hook_run(hook_family_int_t *hfi, hook_event_token_t token, hook_data_t info)
/*
* If we consider that this function is only called from within the
- * stack while an instance is currently active,
+ * stack while an instance is currently active,
*/
CVW_ENTER_READ(&hfi->hfi_lock);
@@ -2326,7 +2330,7 @@ hook_init_kstats(hook_family_int_t *hfi, hook_event_int_t *hei, hook_int_t *hi)
{ "version", KSTAT_DATA_INT32 },
{ "flags", KSTAT_DATA_UINT32 },
{ "hint", KSTAT_DATA_INT32 },
- { "hint_value", KSTAT_DATA_UINT64 },
+ { "hint_value", KSTAT_DATA_STRING },
{ "position", KSTAT_DATA_INT32 },
{ "hook_hits", KSTAT_DATA_UINT64 }
};
@@ -2359,11 +2363,12 @@ hook_init_kstats(hook_family_int_t *hfi, hook_event_int_t *hei, hook_int_t *hi)
switch (hi->hi_hook.h_hint) {
case HH_BEFORE :
case HH_AFTER :
- hi->hi_kstats.hook_hintvalue.data_type = KSTAT_DATA_STRING;
- hi->hi_kstats.hook_hintvalue.value.ui64 =
- hi->hi_hook.h_hintvalue;
+ kstat_named_setstr(&(hi->hi_kstats.hook_hintvalue),
+ (const char *)hi->hi_hook.h_hintvalue);
break;
default :
+ kstat_named_setstr(&(hi->hi_kstats.hook_hintvalue),
+ hook_hintvalue_none);
break;
}
@@ -2371,6 +2376,8 @@ hook_init_kstats(hook_family_int_t *hfi, hook_event_int_t *hei, hook_int_t *hi)
hi->hi_kstatp->ks_data = (void *)&hi->hi_kstats;
hi->hi_kstatp->ks_private =
(void *)(uintptr_t)hks->hks_netstackid;
+ hi->hi_kstatp->ks_data_size +=
+ KSTAT_NAMED_STR_BUFLEN(&(hi->hi_kstats.hook_hintvalue)) + 1;
kstat_install(hi->hi_kstatp);
}
diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_main.c b/usr/src/uts/common/io/ixgbe/ixgbe_main.c
index 848e3470c7..117b7da16a 100644
--- a/usr/src/uts/common/io/ixgbe/ixgbe_main.c
+++ b/usr/src/uts/common/io/ixgbe/ixgbe_main.c
@@ -1792,6 +1792,7 @@ ixgbe_cbfunc(dev_info_t *dip, ddi_cb_action_t cbaction, void *cbarg,
void *arg1, void *arg2)
{
ixgbe_t *ixgbe = (ixgbe_t *)arg1;
+ int prev = ixgbe->intr_cnt;
switch (cbaction) {
/* IRM callback */
@@ -1805,7 +1806,8 @@ ixgbe_cbfunc(dev_info_t *dip, ddi_cb_action_t cbaction, void *cbarg,
if (ixgbe_intr_adjust(ixgbe, cbaction, count) !=
DDI_SUCCESS) {
ixgbe_error(ixgbe,
- "IRM CB: Failed to adjust interrupts");
+ "IRM CB: Failed to adjust interrupts [%d %d %d]",
+ cbaction, count, prev);
goto cb_fail;
}
break;
diff --git a/usr/src/uts/common/io/mac/mac.c b/usr/src/uts/common/io/mac/mac.c
index 4e1979cf54..61a5353365 100644
--- a/usr/src/uts/common/io/mac/mac.c
+++ b/usr/src/uts/common/io/mac/mac.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -2989,6 +2990,9 @@ mac_prop_check_size(mac_prop_id_t id, uint_t valsize, boolean_t is_range)
case MAC_PROP_WL_MLME:
minsize = sizeof (wl_mlme_t);
break;
+ case MAC_PROP_VN_PROMISC_FILTERED:
+ minsize = sizeof (boolean_t);
+ break;
}
return (valsize >= minsize);
diff --git a/usr/src/uts/common/io/mac/mac_client.c b/usr/src/uts/common/io/mac/mac_client.c
index dc1132941b..0f0d44cda5 100644
--- a/usr/src/uts/common/io/mac/mac_client.c
+++ b/usr/src/uts/common/io/mac/mac_client.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -84,13 +85,23 @@
* client opens a VNIC (upper MAC), the MAC layer detects that
* the MAC being opened is a VNIC, and gets the MAC client handle
* that the VNIC driver obtained from the lower MAC. This exchange
- * is doing through a private capability between the MAC layer
+ * is done through a private capability between the MAC layer
* and the VNIC driver. The upper MAC then returns that handle
* directly to its MAC client. Any operation done by the upper
* MAC client is now done on the lower MAC client handle, which
* allows the VNIC driver to be completely bypassed for the
* performance sensitive data-path.
*
+ * - Secondary MACs for VNICs:
+ *
+ * VNICs support multiple upper mac clients to enable support for
+ * multiple MAC addresses on the VNIC. When the VNIC is created the
+ * initial mac client is the primary upper mac. Any additional mac
+ * clients are secondary macs. These are kept in sync with the primary
+ * (for things such as the rx function and resource control settings)
+ * using the same private capability interface between the MAC layer
+ * and the VNIC layer.
+ *
*/
#include <sys/types.h>
@@ -148,6 +159,7 @@ static int mac_client_datapath_setup(mac_client_impl_t *, uint16_t,
uint8_t *, mac_resource_props_t *, boolean_t, mac_unicast_impl_t *);
static void mac_client_datapath_teardown(mac_client_handle_t,
mac_unicast_impl_t *, flow_entry_t *);
+static int mac_resource_ctl_set(mac_client_handle_t, mac_resource_props_t *);
/* ARGSUSED */
static int
@@ -266,6 +278,18 @@ mac_vnic_lower(mac_impl_t *mip)
}
/*
+ * Update the secondary macs
+ */
+void
+mac_vnic_secondary_update(mac_impl_t *mip)
+{
+ mac_capab_vnic_t cap;
+
+ VERIFY(i_mac_capab_get((mac_handle_t)mip, MAC_CAPAB_VNIC, &cap));
+ cap.mcv_mac_secondary_update(cap.mcv_arg);
+}
+
+/*
* Return the MAC client handle of the primary MAC client for the
* specified MAC instance, or NULL otherwise.
*/
@@ -1048,6 +1072,18 @@ mac_unicast_primary_get(mac_handle_t mh, uint8_t *addr)
}
/*
+ * Return the secondary MAC address for the specified handle
+ */
+void
+mac_unicast_secondary_get(mac_client_handle_t mh, uint8_t *addr)
+{
+ mac_client_impl_t *mcip = (mac_client_impl_t *)mh;
+
+ ASSERT(mcip->mci_unicast != NULL);
+ bcopy(mcip->mci_unicast->ma_addr, addr, mcip->mci_unicast->ma_len);
+}
+
+/*
* Return information about the use of the primary MAC address of the
* specified MAC instance:
*
@@ -1290,6 +1326,10 @@ mac_client_open(mac_handle_t mh, mac_client_handle_t *mchp, char *name,
mip->mi_clients_list = mcip;
i_mac_perim_exit(mip);
*mchp = (mac_client_handle_t)mcip;
+
+ DTRACE_PROBE2(mac__client__open__nonallocated, mac_impl_t *,
+ mcip->mci_mip, mac_client_impl_t *, mcip);
+
return (err);
}
@@ -1304,6 +1344,7 @@ mac_client_open(mac_handle_t mh, mac_client_handle_t *mchp, char *name,
mcip->mci_p_unicast_list = NULL;
mcip->mci_direct_rx_fn = NULL;
mcip->mci_direct_rx_arg = NULL;
+ mcip->mci_vidcache = MCIP_VIDCACHE_INVALID;
mcip->mci_unicast_list = NULL;
@@ -1394,10 +1435,6 @@ mac_client_open(mac_handle_t mh, mac_client_handle_t *mchp, char *name,
if (share_desired)
i_mac_share_alloc(mcip);
- DTRACE_PROBE2(mac__client__open__allocated, mac_impl_t *,
- mcip->mci_mip, mac_client_impl_t *, mcip);
- *mchp = (mac_client_handle_t)mcip;
-
/*
* We will do mimimal datapath setup to allow a MAC client to
* transmit or receive non-unicast packets without waiting
@@ -1409,6 +1446,11 @@ mac_client_open(mac_handle_t mh, mac_client_handle_t *mchp, char *name,
goto done;
}
}
+
+ DTRACE_PROBE2(mac__client__open__allocated, mac_impl_t *,
+ mcip->mci_mip, mac_client_impl_t *, mcip);
+
+ *mchp = (mac_client_handle_t)mcip;
i_mac_perim_exit(mip);
return (0);
@@ -1532,6 +1574,7 @@ mac_rx_set(mac_client_handle_t mch, mac_rx_t rx_fn, void *arg)
{
mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
mac_impl_t *mip = mcip->mci_mip;
+ mac_impl_t *umip = mcip->mci_upper_mip;
/*
* Instead of adding an extra set of locks and refcnts in
@@ -1547,6 +1590,15 @@ mac_rx_set(mac_client_handle_t mch, mac_rx_t rx_fn, void *arg)
mcip->mci_rx_arg = arg;
mac_rx_client_restart(mch);
i_mac_perim_exit(mip);
+
+ /*
+ * If we're changing the rx function on the primary mac of a vnic,
+ * make sure any secondary macs on the vnic are updated as well.
+ */
+ if (umip != NULL) {
+ ASSERT((umip->mi_state_flags & MIS_IS_VNIC) != 0);
+ mac_vnic_secondary_update(umip);
+ }
}
/*
@@ -1558,6 +1610,42 @@ mac_rx_clear(mac_client_handle_t mch)
mac_rx_set(mch, mac_pkt_drop, NULL);
}
+void
+mac_secondary_dup(mac_client_handle_t smch, mac_client_handle_t dmch)
+{
+ mac_client_impl_t *smcip = (mac_client_impl_t *)smch;
+ mac_client_impl_t *dmcip = (mac_client_impl_t *)dmch;
+ flow_entry_t *flent = dmcip->mci_flent;
+
+ /* This should only be called to setup secondary macs */
+ ASSERT((flent->fe_type & FLOW_PRIMARY_MAC) == 0);
+
+ mac_rx_set(dmch, smcip->mci_rx_fn, smcip->mci_rx_arg);
+ dmcip->mci_promisc_list = smcip->mci_promisc_list;
+
+ /*
+ * Duplicate the primary mac resources to the secondary.
+ * Since we already validated the resource controls when setting
+ * them on the primary, we can ignore errors here.
+ */
+ (void) mac_resource_ctl_set(dmch, MCIP_RESOURCE_PROPS(smcip));
+}
+
+/*
+ * Called when removing a secondary MAC. Currently only clears the promisc_list
+ * since we share the primary mac's promisc_list.
+ */
+void
+mac_secondary_cleanup(mac_client_handle_t mch)
+{
+ mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
+ flow_entry_t *flent = mcip->mci_flent;
+
+ /* This should only be called for secondary macs */
+ ASSERT((flent->fe_type & FLOW_PRIMARY_MAC) == 0);
+ mcip->mci_promisc_list = NULL;
+}
+
/*
* Walk the MAC client subflow table and updates their priority values.
*/
@@ -1910,11 +1998,12 @@ mac_client_set_rings_prop(mac_client_impl_t *mcip, mac_resource_props_t *mrp,
* mac_client_impl_t from the mac_impl_t (i.e if there are any cached
* properties before the flow entry for the unicast address was created).
*/
-int
+static int
mac_resource_ctl_set(mac_client_handle_t mch, mac_resource_props_t *mrp)
{
mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
mac_impl_t *mip = (mac_impl_t *)mcip->mci_mip;
+ mac_impl_t *umip = mcip->mci_upper_mip;
int err = 0;
flow_entry_t *flent = mcip->mci_flent;
mac_resource_props_t *omrp, *nmrp = MCIP_RESOURCE_PROPS(mcip);
@@ -1998,20 +2087,17 @@ mac_resource_ctl_set(mac_client_handle_t mch, mac_resource_props_t *mrp)
mac_flow_modify(mip->mi_flow_tab, flent, mrp);
if (mrp->mrp_mask & MRP_PRIORITY)
mac_update_subflow_priority(mcip);
+
+ /* Apply these resource settings to any secondary macs */
+ if (umip != NULL) {
+ ASSERT((umip->mi_state_flags & MIS_IS_VNIC) != 0);
+ mac_vnic_secondary_update(umip);
+ }
}
kmem_free(omrp, sizeof (*omrp));
return (0);
}
-void
-mac_resource_ctl_get(mac_client_handle_t mch, mac_resource_props_t *mrp)
-{
- mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
- mac_resource_props_t *mcip_mrp = MCIP_RESOURCE_PROPS(mcip);
-
- bcopy(mcip_mrp, mrp, sizeof (mac_resource_props_t));
-}
-
static int
mac_unicast_flow_create(mac_client_impl_t *mcip, uint8_t *mac_addr,
uint16_t vid, boolean_t is_primary, boolean_t first_flow,
@@ -3170,7 +3256,8 @@ mac_promisc_add(mac_client_handle_t mch, mac_client_promisc_type_t type,
}
if ((mcip->mci_state_flags & MCIS_IS_VNIC) &&
- type == MAC_CLIENT_PROMISC_ALL) {
+ type == MAC_CLIENT_PROMISC_ALL &&
+ (mcip->mci_protect_flags & MPT_FLAG_PROMISC_FILTERED)) {
/*
* The function is being invoked by the upper MAC client
* of a VNIC. The VNIC should only see the traffic
@@ -3219,7 +3306,16 @@ mac_promisc_add(mac_client_handle_t mch, mac_client_promisc_type_t type,
mutex_exit(mcbi->mcbi_lockp);
*mphp = (mac_promisc_handle_t)mpip;
+
+ if (mcip->mci_state_flags & MCIS_IS_VNIC) {
+ mac_impl_t *umip = mcip->mci_upper_mip;
+
+ ASSERT(umip != NULL);
+ mac_vnic_secondary_update(umip);
+ }
+
i_mac_perim_exit(mip);
+
return (0);
}
@@ -3258,6 +3354,14 @@ mac_promisc_remove(mac_promisc_handle_t mph)
} else {
mac_callback_remove_wait(&mip->mi_promisc_cb_info);
}
+
+ if (mcip->mci_state_flags & MCIS_IS_VNIC) {
+ mac_impl_t *umip = mcip->mci_upper_mip;
+
+ ASSERT(umip != NULL);
+ mac_vnic_secondary_update(umip);
+ }
+
mutex_exit(mcbi->mcbi_lockp);
mac_stop((mac_handle_t)mip);
@@ -4032,16 +4136,15 @@ mac_info_get(const char *name, mac_info_t *minfop)
/*
* To get the capabilities that MAC layer cares about, such as rings, factory
* mac address, vnic or not, it should directly invoke this function. If the
- * link is part of a bridge, then the only "capability" it has is the inability
- * to do zero copy.
+ * link is part of a bridge, then the link is unable to do zero copy.
*/
boolean_t
i_mac_capab_get(mac_handle_t mh, mac_capab_t cap, void *cap_data)
{
mac_impl_t *mip = (mac_impl_t *)mh;
- if (mip->mi_bridge_link != NULL)
- return (cap == MAC_CAPAB_NO_ZCOPY);
+ if (mip->mi_bridge_link != NULL && cap == MAC_CAPAB_NO_ZCOPY)
+ return (B_TRUE);
else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB)
return (mip->mi_getcapab(mip->mi_driver, cap, cap_data));
else
@@ -4698,6 +4801,8 @@ mac_client_add_to_flow_list(mac_client_impl_t *mcip, flow_entry_t *flent)
*/
rw_enter(&mcip->mci_rw_lock, RW_WRITER);
+ mcip->mci_vidcache = MCIP_VIDCACHE_INVALID;
+
/* Add it to the head */
flent->fe_client_next = mcip->mci_flent_list;
mcip->mci_flent_list = flent;
@@ -4728,6 +4833,8 @@ mac_client_remove_flow_from_list(mac_client_impl_t *mcip, flow_entry_t *flent)
* using mci_rw_lock
*/
rw_enter(&mcip->mci_rw_lock, RW_WRITER);
+ mcip->mci_vidcache = MCIP_VIDCACHE_INVALID;
+
while ((fe != NULL) && (fe != flent)) {
prev_fe = fe;
fe = fe->fe_client_next;
@@ -4756,6 +4863,14 @@ mac_client_check_flow_vid(mac_client_impl_t *mcip, uint16_t vid)
{
flow_entry_t *flent;
uint16_t mci_vid;
+ uint32_t cache = mcip->mci_vidcache;
+
+ /*
+ * In hopes of not having to touch the mci_rw_lock, check to see if
+ * this vid matches our cached result.
+ */
+ if (MCIP_VIDCACHE_ISVALID(cache) && MCIP_VIDCACHE_VID(cache) == vid)
+ return (MCIP_VIDCACHE_BOOL(cache) ? B_TRUE : B_FALSE);
/* The mci_flent_list is protected by mci_rw_lock */
rw_enter(&mcip->mci_rw_lock, RW_WRITER);
@@ -4763,10 +4878,13 @@ mac_client_check_flow_vid(mac_client_impl_t *mcip, uint16_t vid)
flent = flent->fe_client_next) {
mci_vid = i_mac_flow_vid(flent);
if (vid == mci_vid) {
+ mcip->mci_vidcache = MCIP_VIDCACHE_CACHE(vid, B_TRUE);
rw_exit(&mcip->mci_rw_lock);
return (B_TRUE);
}
}
+
+ mcip->mci_vidcache = MCIP_VIDCACHE_CACHE(vid, B_FALSE);
rw_exit(&mcip->mci_rw_lock);
return (B_FALSE);
}
@@ -5411,3 +5529,23 @@ mac_client_set_rings(mac_client_handle_t mch, int rxrings, int txrings)
mrp->mrp_ntxrings = txrings;
}
}
+
+boolean_t
+mac_get_promisc_filtered(mac_client_handle_t mch)
+{
+ mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
+
+ return (mcip->mci_protect_flags & MPT_FLAG_PROMISC_FILTERED);
+}
+
+void
+mac_set_promisc_filtered(mac_client_handle_t mch, boolean_t enable)
+{
+ mac_client_impl_t *mcip = (mac_client_impl_t *)mch;
+
+ ASSERT(MAC_PERIM_HELD((mac_handle_t)mcip->mci_mip));
+ if (enable)
+ mcip->mci_protect_flags |= MPT_FLAG_PROMISC_FILTERED;
+ else
+ mcip->mci_protect_flags &= ~MPT_FLAG_PROMISC_FILTERED;
+}
diff --git a/usr/src/uts/common/io/mac/mac_protect.c b/usr/src/uts/common/io/mac/mac_protect.c
index 0dc825492e..5016cc2665 100644
--- a/usr/src/uts/common/io/mac/mac_protect.c
+++ b/usr/src/uts/common/io/mac/mac_protect.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/strsun.h>
@@ -1532,9 +1533,20 @@ ipnospoof_check_v4(mac_client_impl_t *mcip, mac_protect_t *protect,
for (i = 0; i < protect->mp_ipaddrcnt; i++) {
mac_ipaddr_t *v4addr = &protect->mp_ipaddrs[i];
- if (v4addr->ip_version == IPV4_VERSION &&
- V4_PART_OF_V6(v4addr->ip_addr) == *addr)
- return (B_TRUE);
+ if (v4addr->ip_version == IPV4_VERSION) {
+ if (v4addr->ip_v4netmask != 0) {
+ /*
+ * Since we have a netmask we know this entry
+ * signifies the entire subnet. Check if the
+ * given address is on the subnet.
+ */
+ if (htonl(V4_PART_OF_V6(v4addr->ip_addr)) ==
+ (htonl(*addr) & v4addr->ip_v4netmask))
+ return (B_TRUE);
+ } else if (V4_PART_OF_V6(v4addr->ip_addr) == *addr) {
+ return (B_TRUE);
+ }
+ }
}
return (protect->mp_ipaddrcnt == 0 ?
check_dhcpv4_dyn_ip(mcip, *addr) : B_FALSE);
@@ -2267,6 +2279,9 @@ mac_protect_init(mac_client_impl_t *mcip)
sizeof (dhcpv6_cid_t), offsetof(dhcpv6_cid_t, dc_node));
avl_create(&mcip->mci_v6_dyn_ip, compare_dhcpv6_ip,
sizeof (dhcpv6_addr_t), offsetof(dhcpv6_addr_t, da_node));
+
+ if (mcip->mci_state_flags & MCIS_IS_VNIC)
+ mcip->mci_protect_flags |= MPT_FLAG_PROMISC_FILTERED;
}
void
diff --git a/usr/src/uts/common/io/mac/mac_stat.c b/usr/src/uts/common/io/mac/mac_stat.c
index 31972f94d8..c1a5c9c069 100644
--- a/usr/src/uts/common/io/mac/mac_stat.c
+++ b/usr/src/uts/common/io/mac/mac_stat.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -390,8 +391,8 @@ i_mac_stat_create(void *handle, const char *modname, const char *statname,
kstat_t *ksp;
kstat_named_t *knp;
- ksp = kstat_create(modname, 0, statname, "net",
- KSTAT_TYPE_NAMED, count, 0);
+ ksp = kstat_create_zone(modname, 0, statname, "net",
+ KSTAT_TYPE_NAMED, count, 0, getzoneid());
if (ksp == NULL)
return (NULL);
@@ -948,9 +949,9 @@ mac_driver_stat_create(mac_impl_t *mip)
major_t major = getmajor(mip->mi_phy_dev);
count = MAC_MOD_NKSTAT + MAC_NKSTAT + mip->mi_type->mt_statcount;
- ksp = kstat_create((const char *)ddi_major_to_name(major),
+ ksp = kstat_create_zone((const char *)ddi_major_to_name(major),
getminor(mip->mi_phy_dev) - 1, MAC_KSTAT_NAME,
- MAC_KSTAT_CLASS, KSTAT_TYPE_NAMED, count, 0);
+ MAC_KSTAT_CLASS, KSTAT_TYPE_NAMED, count, 0, getzoneid());
if (ksp == NULL)
return;
diff --git a/usr/src/uts/common/io/mr_sas/mr_sas.conf b/usr/src/uts/common/io/mr_sas/mr_sas.conf
index cfda434e23..6c585c6a42 100644
--- a/usr/src/uts/common/io/mr_sas/mr_sas.conf
+++ b/usr/src/uts/common/io/mr_sas/mr_sas.conf
@@ -13,3 +13,11 @@
# Fast-Path specific flag. Default is "yes".
# mrsas-enable-fp="yes";
+flow_control="dmult" queue="qsort" tape="sctp";
+
+# MSI specific flag. To enable MSI modify the flag value to "yes"
+mrsas-enable-msi="yes";
+
+# Fast-Path specific flag. To enable Fast-Path modify the flag value to "yes"
+mrsas-enable-fp="yes";
+
diff --git a/usr/src/uts/common/io/scsi/targets/sd.c b/usr/src/uts/common/io/scsi/targets/sd.c
index d9ca686014..adeb59c87f 100644
--- a/usr/src/uts/common/io/scsi/targets/sd.c
+++ b/usr/src/uts/common/io/scsi/targets/sd.c
@@ -3503,9 +3503,13 @@ sd_set_mmc_caps(sd_ssc_t *ssc)
* according to the successful response to the page
* 0x2A mode sense request.
*/
- scsi_log(SD_DEVINFO(un), sd_label, CE_WARN,
- "sd_set_mmc_caps: Mode Sense returned "
- "invalid block descriptor length\n");
+ /*
+ * The following warning occurs due to the KVM CD-ROM
+ * mishandling the multi-media commands. Ignore it.
+ * scsi_log(SD_DEVINFO(un), sd_label, CE_WARN,
+ * "sd_set_mmc_caps: Mode Sense returned "
+ * "invalid block descriptor length\n");
+ */
kmem_free(buf, BUFLEN_MODE_CDROM_CAP);
return;
}
@@ -4450,18 +4454,77 @@ sd_sdconf_id_match(struct sd_lun *un, char *id, int idlen)
{
struct scsi_inquiry *sd_inq;
int rval = SD_SUCCESS;
+ char *p;
+ int chk_vidlen = 0, chk_pidlen = 0;
+ int has_tail = 0;
+ static const int VSZ = sizeof (sd_inq->inq_vid);
+ static const int PSZ = sizeof (sd_inq->inq_pid);
ASSERT(un != NULL);
sd_inq = un->un_sd->sd_inq;
ASSERT(id != NULL);
/*
- * We use the inq_vid as a pointer to a buffer containing the
- * vid and pid and use the entire vid/pid length of the table
- * entry for the comparison. This works because the inq_pid
- * data member follows inq_vid in the scsi_inquiry structure.
+ * We would like to use the inq_vid as a pointer to a buffer
+ * containing the vid and pid and use the entire vid/pid length of
+ * the table entry for the comparison. However, this does not work
+ * because, while the inq_pid data member follows inq_vid in the
+ * scsi_inquiry structure, we do not control the contents of this
+ * buffer, and some broken devices violate SPC 4.3.1 and return
+ * fields with null bytes in them.
+ */
+ chk_vidlen = MIN(VSZ, idlen);
+ p = id + chk_vidlen - 1;
+ while (*p == ' ' && chk_vidlen > 0) {
+ --p;
+ --chk_vidlen;
+ }
+
+ /*
+ * If it's all spaces, check the whole thing.
*/
- if (strncasecmp(sd_inq->inq_vid, id, idlen) != 0) {
+ if (chk_vidlen == 0)
+ chk_vidlen = MIN(VSZ, idlen);
+
+ if (idlen > VSZ) {
+ chk_pidlen = idlen - VSZ;
+ p = id + idlen - 1;
+ while (*p == ' ' && chk_pidlen > 0) {
+ --p;
+ --chk_pidlen;
+ }
+ if (chk_pidlen == 0)
+ chk_pidlen = MIN(PSZ, idlen - VSZ);
+ }
+
+ /*
+ * There's one more thing we need to do here. If the user specified
+ * an ID with trailing spaces, we need to make sure the inquiry
+ * vid/pid has only spaces or NULs after the check length; otherwise, it
+ * can't match.
+ */
+ if (idlen > chk_vidlen && chk_vidlen < VSZ) {
+ for (p = sd_inq->inq_vid + chk_vidlen;
+ p < sd_inq->inq_vid + VSZ; ++p) {
+ if (*p != ' ' && *p != '\0') {
+ ++has_tail;
+ break;
+ }
+ }
+ }
+ if (idlen > chk_pidlen + VSZ && chk_pidlen < PSZ) {
+ for (p = sd_inq->inq_pid + chk_pidlen;
+ p < sd_inq->inq_pid + PSZ; ++p) {
+ if (*p != ' ' && *p != '\0') {
+ ++has_tail;
+ break;
+ }
+ }
+ }
+
+ if (has_tail || strncasecmp(sd_inq->inq_vid, id, chk_vidlen) != 0 ||
+ (idlen > VSZ &&
+ strncasecmp(sd_inq->inq_pid, id + VSZ, chk_pidlen) != 0)) {
/*
* The user id string is compared to the inquiry vid/pid
* using a case insensitive comparison and ignoring
diff --git a/usr/src/uts/common/io/vnic/vnic_dev.c b/usr/src/uts/common/io/vnic/vnic_dev.c
index c70ff2b22b..dd2a359206 100644
--- a/usr/src/uts/common/io/vnic/vnic_dev.c
+++ b/usr/src/uts/common/io/vnic/vnic_dev.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -51,6 +52,7 @@
#include <sys/vlan.h>
#include <sys/vnic.h>
#include <sys/vnic_impl.h>
+#include <sys/mac_impl.h>
#include <sys/mac_flow_impl.h>
#include <inet/ip_impl.h>
@@ -70,6 +72,11 @@
* Due to this passthrough, some of the entry points exported by the
* VNIC driver are never directly invoked. These entry points include
* vnic_m_start, vnic_m_stop, vnic_m_promisc, vnic_m_multicst, etc.
+ *
+ * VNICs support multiple upper mac clients to enable support for
+ * multiple MAC addresses on the VNIC. When the VNIC is created the
+ * initial mac client is the primary upper mac. Any additional mac
+ * clients are secondary macs.
*/
static int vnic_m_start(void *);
@@ -81,11 +88,13 @@ static int vnic_m_stat(void *, uint_t, uint64_t *);
static void vnic_m_ioctl(void *, queue_t *, mblk_t *);
static int vnic_m_setprop(void *, const char *, mac_prop_id_t, uint_t,
const void *);
+static int vnic_m_getprop(void *, const char *, mac_prop_id_t, uint_t, void *);
static void vnic_m_propinfo(void *, const char *, mac_prop_id_t,
mac_prop_info_handle_t);
static mblk_t *vnic_m_tx(void *, mblk_t *);
static boolean_t vnic_m_capab_get(void *, mac_capab_t, void *);
static void vnic_notify_cb(void *, mac_notify_type_t);
+static void vnic_cleanup_secondary_macs(vnic_t *, int);
static kmem_cache_t *vnic_cache;
static krwlock_t vnic_lock;
@@ -100,7 +109,7 @@ static mod_hash_t *vnic_hash;
#define VNIC_HASH_KEY(vnic_id) ((mod_hash_key_t)(uintptr_t)vnic_id)
#define VNIC_M_CALLBACK_FLAGS \
- (MC_IOCTL | MC_GETCAPAB | MC_SETPROP | MC_PROPINFO)
+ (MC_IOCTL | MC_GETCAPAB | MC_SETPROP | MC_GETPROP | MC_PROPINFO)
static mac_callbacks_t vnic_m_callbacks = {
VNIC_M_CALLBACK_FLAGS,
@@ -117,7 +126,7 @@ static mac_callbacks_t vnic_m_callbacks = {
NULL,
NULL,
vnic_m_setprop,
- NULL,
+ vnic_m_getprop,
vnic_m_propinfo
};
@@ -621,6 +630,8 @@ vnic_dev_delete(datalink_id_t vnic_id, uint32_t flags, cred_t *credp)
return (rc);
}
+ vnic_cleanup_secondary_macs(vnic, vnic->vn_nhandles);
+
vnic->vn_enabled = B_FALSE;
(void) mod_hash_remove(vnic_hash, VNIC_HASH_KEY(vnic_id), &val);
ASSERT(vnic == (vnic_t *)val);
@@ -741,6 +752,20 @@ vnic_mac_client_handle(void *vnic_arg)
return (vnic->vn_mch);
}
+/*
+ * Invoked when updating the primary MAC so that the secondary MACs are
+ * kept in sync.
+ */
+static void
+vnic_mac_secondary_update(void *vnic_arg)
+{
+ vnic_t *vn = vnic_arg;
+ int i;
+
+ for (i = 1; i <= vn->vn_nhandles; i++) {
+ mac_secondary_dup(vn->vn_mc_handles[0], vn->vn_mc_handles[i]);
+ }
+}
/*
* Return information about the specified capability.
@@ -775,6 +800,8 @@ vnic_m_capab_get(void *arg, mac_capab_t cap, void *cap_data)
vnic_capab->mcv_arg = vnic;
vnic_capab->mcv_mac_client_handle =
vnic_mac_client_handle;
+ vnic_capab->mcv_mac_secondary_update =
+ vnic_mac_secondary_update;
}
break;
}
@@ -841,6 +868,126 @@ vnic_m_unicst(void *arg, const uint8_t *macaddr)
return (mac_vnic_unicast_set(vnic->vn_mch, macaddr));
}
+static void
+vnic_cleanup_secondary_macs(vnic_t *vn, int cnt)
+{
+ int i;
+
+ /* Remove existing secondaries (primary is at 0) */
+ for (i = 1; i <= cnt; i++) {
+ mac_rx_clear(vn->vn_mc_handles[i]);
+
+ /* unicast handle might not have been set yet */
+ if (vn->vn_mu_handles[i] != NULL)
+ mac_unicast_remove(vn->vn_mc_handles[i],
+ vn->vn_mu_handles[i]);
+
+ mac_secondary_cleanup(vn->vn_mc_handles[i]);
+
+ mac_client_close(vn->vn_mc_handles[i], MAC_CLOSE_FLAGS_IS_VNIC);
+
+ vn->vn_mu_handles[i] = NULL;
+ vn->vn_mc_handles[i] = NULL;
+ }
+
+ vn->vn_nhandles = 0;
+}
+
+/*
+ * Setup secondary MAC addresses on the vnic. Due to limitations in the mac
+ * code, each mac address must be associated with a mac_client (and the
+ * flow that goes along with the client) so we need to create those clients
+ * here.
+ */
+static int
+vnic_set_secondary_macs(vnic_t *vn, mac_secondary_addr_t *msa)
+{
+ int i, err;
+ char primary_name[MAXNAMELEN];
+
+ /* First, remove pre-existing secondaries */
+ ASSERT(vn->vn_nhandles < MPT_MAXMACADDR);
+ vnic_cleanup_secondary_macs(vn, vn->vn_nhandles);
+
+ if (msa->ms_addrcnt == (uint32_t)-1)
+ msa->ms_addrcnt = 0;
+
+ vn->vn_nhandles = msa->ms_addrcnt;
+
+ (void) dls_mgmt_get_linkinfo(vn->vn_id, primary_name, NULL, NULL, NULL);
+
+ /*
+ * Now add the new secondary MACs
+ * Recall that the primary MAC address is the first element.
+ * The secondary clients are named after the primary with their
+ * index to distinguish them.
+ */
+ for (i = 1; i <= vn->vn_nhandles; i++) {
+ uint8_t *addr;
+ mac_diag_t mac_diag;
+ char secondary_name[MAXNAMELEN];
+
+ (void) snprintf(secondary_name, sizeof (secondary_name),
+ "%s%02d", primary_name, i);
+
+ err = mac_client_open(vn->vn_lower_mh, &vn->vn_mc_handles[i],
+ secondary_name, MAC_OPEN_FLAGS_IS_VNIC);
+ if (err != 0) {
+ /* Remove any that we successfully added */
+ vnic_cleanup_secondary_macs(vn, --i);
+ return (err);
+ }
+
+ /*
+ * Assign a MAC address to the VNIC
+ *
+ * Normally this would be done with vnic_unicast_add but since
+ * we know these are fixed adddresses, and since we need to
+ * save this in the proper array slot, we bypass that function
+ * and go direct.
+ */
+ addr = msa->ms_addrs[i - 1];
+ err = mac_unicast_add(vn->vn_mc_handles[i], addr, 0,
+ &vn->vn_mu_handles[i], vn->vn_vid, &mac_diag);
+ if (err != 0) {
+ /* Remove any that we successfully added */
+ vnic_cleanup_secondary_macs(vn, i);
+ return (err);
+ }
+
+ /*
+ * Setup the secondary the same way as the primary (i.e.
+ * receiver function/argument (e.g. i_dls_link_rx, mac_pkt_drop,
+ * etc.), the promisc list, and the resource controls).
+ */
+ mac_secondary_dup(vn->vn_mc_handles[0], vn->vn_mc_handles[i]);
+ }
+
+ return (0);
+}
+
+static int
+vnic_get_secondary_macs(vnic_t *vn, uint_t pr_valsize, void *pr_val)
+{
+ int i;
+ mac_secondary_addr_t msa;
+
+ if (pr_valsize < sizeof (msa))
+ return (EINVAL);
+
+ /* Get existing addresses (primary is at 0) */
+ ASSERT(vn->vn_nhandles < MPT_MAXMACADDR);
+ for (i = 1; i <= vn->vn_nhandles; i++) {
+ ASSERT(vn->vn_mc_handles[i] != NULL);
+ mac_unicast_secondary_get(vn->vn_mc_handles[i],
+ msa.ms_addrs[i - 1]);
+ }
+ msa.ms_addrcnt = vn->vn_nhandles;
+
+ bcopy(&msa, pr_val, sizeof (msa));
+ return (0);
+}
+
/*
* Callback functions for set/get of properties
*/
@@ -849,17 +996,19 @@ static int
vnic_m_setprop(void *m_driver, const char *pr_name, mac_prop_id_t pr_num,
uint_t pr_valsize, const void *pr_val)
{
- int err = ENOTSUP;
+ int err = 0;
vnic_t *vn = m_driver;
- /* allow setting MTU only on an etherstub */
- if (vn->vn_link_id != DATALINK_INVALID_LINKID)
- return (err);
-
switch (pr_num) {
case MAC_PROP_MTU: {
uint32_t mtu;
+ /* allow setting MTU only on an etherstub */
+ if (vn->vn_link_id != DATALINK_INVALID_LINKID) {
+ err = ENOTSUP;
+ break;
+ }
+
if (pr_valsize < sizeof (mtu)) {
err = EINVAL;
break;
@@ -872,12 +1021,57 @@ vnic_m_setprop(void *m_driver, const char *pr_name, mac_prop_id_t pr_num,
err = mac_maxsdu_update(vn->vn_mh, mtu);
break;
}
+ case MAC_PROP_VN_PROMISC_FILTERED: {
+ boolean_t filtered;
+
+ if (pr_valsize < sizeof (filtered)) {
+ err = EINVAL;
+ break;
+ }
+
+ bcopy(pr_val, &filtered, sizeof (filtered));
+ mac_set_promisc_filtered(vn->vn_mch, filtered);
+ break;
+ }
+ case MAC_PROP_SECONDARY_ADDRS: {
+ mac_secondary_addr_t msa;
+
+ bcopy(pr_val, &msa, sizeof (msa));
+ vnic_set_secondary_macs(vn, &msa);
+ break;
+ }
default:
+ err = ENOTSUP;
break;
}
return (err);
}
+static int
+vnic_m_getprop(void *arg, const char *pr_name, mac_prop_id_t pr_num,
+ uint_t pr_valsize, void *pr_val)
+{
+ vnic_t *vn = arg;
+ int ret = 0;
+ boolean_t out;
+
+ switch (pr_num) {
+ case MAC_PROP_VN_PROMISC_FILTERED:
+ out = mac_get_promisc_filtered(vn->vn_mch);
+ ASSERT(pr_valsize >= sizeof (boolean_t));
+ bcopy(&out, pr_val, sizeof (boolean_t));
+ break;
+ case MAC_PROP_SECONDARY_ADDRS:
+ ret = vnic_get_secondary_macs(vn, pr_valsize, pr_val);
+ break;
+ default:
+ ret = EINVAL;
+ break;
+ }
+
+ return (ret);
+}
+
/* ARGSUSED */
static void vnic_m_propinfo(void *m_driver, const char *pr_name,
mac_prop_id_t pr_num, mac_prop_info_handle_t prh)
@@ -929,7 +1123,8 @@ vnic_info(vnic_info_t *info, cred_t *credp)
bzero(&info->vn_resource_props, sizeof (mac_resource_props_t));
if (vnic->vn_mch != NULL)
- mac_resource_ctl_get(vnic->vn_mch, &info->vn_resource_props);
+ mac_client_get_resources(vnic->vn_mch,
+ &info->vn_resource_props);
rw_exit(&vnic_lock);
return (0);
diff --git a/usr/src/uts/common/krtld/bootrd.c b/usr/src/uts/common/krtld/bootrd.c
index 08e5d98c09..35ad67da96 100644
--- a/usr/src/uts/common/krtld/bootrd.c
+++ b/usr/src/uts/common/krtld/bootrd.c
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
@@ -36,17 +37,95 @@
extern void (*_kobj_printf)(void *, const char *fmt, ...);
extern int get_weakish_int(int *);
extern struct bootops *ops;
-extern struct boot_fs_ops bufs_ops, bhsfs_ops;
+extern struct boot_fs_ops bufs_ops, bhsfs_ops, bbootfs_ops;
extern int kmem_ready;
static uint64_t rd_start, rd_end;
struct boot_fs_ops *bfs_ops;
-struct boot_fs_ops *bfs_tab[] = {&bufs_ops, &bhsfs_ops, NULL};
+struct boot_fs_ops *bfs_tab[] = {&bufs_ops, &bhsfs_ops, &bbootfs_ops, NULL};
static uintptr_t scratch_max = 0;
#define _kmem_ready get_weakish_int(&kmem_ready)
+int
+BRD_MOUNTROOT(struct boot_fs_ops *ops, char *str)
+{
+ return (ops->fsw_mountroot(str));
+}
+
+int
+BRD_UNMOUNTROOT(struct boot_fs_ops *ops)
+{
+ if (bfs_ops != &bbootfs_ops)
+ bbootfs_ops.fsw_closeall(1);
+
+ return (ops->fsw_unmountroot());
+}
+
+int
+BRD_OPEN(struct boot_fs_ops *ops, char *file, int flags)
+{
+ int len = strlen(SYSTEM_BOOT_PATH);
+ int fd;
+
+ /*
+ * Our policy is that we try bootfs first. If bootfs is the only
+ * filesystem, that's the end of it. Otherwise we will fall back to
+ * the normal root (i.e., ramdisk) filesystem at this point and try
+ * again if the file does not exist in bootfs.
+ */
+ fd = bbootfs_ops.fsw_open(file, flags);
+
+ if (bfs_ops == &bbootfs_ops)
+ return (fd);
+
+ if (strncmp(file, SYSTEM_BOOT_PATH, len) == 0 || fd >= 0)
+ return ((fd < 0) ? fd : (fd | BFD_F_SYSTEM_BOOT));
+
+ return (ops->fsw_open(file, flags));
+}
+
+int
+BRD_CLOSE(struct boot_fs_ops *ops, int fd)
+{
+ if (fd & BFD_F_SYSTEM_BOOT)
+ return (bbootfs_ops.fsw_close(fd & ~BFD_F_SYSTEM_BOOT));
+
+ return (ops->fsw_close(fd));
+}
+
+ssize_t
+BRD_READ(struct boot_fs_ops *ops, int fd, caddr_t buf, size_t len)
+{
+ if (fd & BFD_F_SYSTEM_BOOT) {
+ return (bbootfs_ops.fsw_read(fd & ~BFD_F_SYSTEM_BOOT,
+ buf, len));
+ }
+
+ return (ops->fsw_read(fd, buf, len));
+}
+
+off_t
+BRD_SEEK(struct boot_fs_ops *ops, int fd, off_t addr, int whence)
+{
+ if (fd & BFD_F_SYSTEM_BOOT) {
+ return (bbootfs_ops.fsw_lseek(fd & ~BFD_F_SYSTEM_BOOT,
+ addr, whence));
+ }
+
+ return (ops->fsw_lseek(fd, addr, whence));
+}
+
+int
+BRD_FSTAT(struct boot_fs_ops *ops, int fd, struct bootstat *bsp)
+{
+ if (fd & BFD_F_SYSTEM_BOOT)
+ return (bbootfs_ops.fsw_fstat(fd & ~BFD_F_SYSTEM_BOOT, bsp));
+
+ return (ops->fsw_fstat(fd, bsp));
+}
+
/*
* This one reads the ramdisk. If fi_memp is set, we copy the
* ramdisk content to the designated buffer. Otherwise, we
diff --git a/usr/src/uts/common/os/bio.c b/usr/src/uts/common/os/bio.c
index 0db01f80d7..c3d04e5508 100644
--- a/usr/src/uts/common/os/bio.c
+++ b/usr/src/uts/common/os/bio.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -1320,6 +1321,9 @@ pageio_setup(struct page *pp, size_t len, struct vnode *vp, int flags)
cpup = CPU; /* get pointer AFTER preemption is disabled */
CPU_STATS_ADDQ(cpup, vm, pgin, 1);
CPU_STATS_ADDQ(cpup, vm, pgpgin, btopr(len));
+
+ atomic_add_64(&curzone->zone_pgpgin, btopr(len));
+
if ((flags & B_ASYNC) == 0) {
klwp_t *lwp = ttolwp(curthread);
if (lwp != NULL)
@@ -1336,13 +1340,19 @@ pageio_setup(struct page *pp, size_t len, struct vnode *vp, int flags)
if (pp != NULL && pp->p_vnode != NULL) {
if (IS_SWAPFSVP(pp->p_vnode)) {
CPU_STATS_ADDQ(cpup, vm, anonpgin, btopr(len));
+ atomic_add_64(&curzone->zone_anonpgin,
+ btopr(len));
} else {
if (pp->p_vnode->v_flag & VVMEXEC) {
CPU_STATS_ADDQ(cpup, vm, execpgin,
btopr(len));
+ atomic_add_64(&curzone->zone_execpgin,
+ btopr(len));
} else {
CPU_STATS_ADDQ(cpup, vm, fspgin,
btopr(len));
+ atomic_add_64(&curzone->zone_fspgin,
+ btopr(len));
}
}
}
diff --git a/usr/src/uts/common/os/clock.c b/usr/src/uts/common/os/clock.c
index 1ceb12b935..1aeb7678c6 100644
--- a/usr/src/uts/common/os/clock.c
+++ b/usr/src/uts/common/os/clock.c
@@ -67,6 +67,7 @@
#include <sys/ddi_periodic.h>
#include <sys/random.h>
#include <sys/modctl.h>
+#include <sys/zone.h>
/*
* for NTP support
@@ -1149,6 +1150,10 @@ loadavg_update()
} while ((cpupart = cpupart->cp_next) != cp_list_head);
+ /*
+ * Third pass totals up per-zone statistics.
+ */
+ zone_loadavg_update();
}
/*
diff --git a/usr/src/uts/common/os/core.c b/usr/src/uts/common/os/core.c
index 71242af678..05deaf4151 100644
--- a/usr/src/uts/common/os/core.c
+++ b/usr/src/uts/common/os/core.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -63,6 +64,7 @@
#include <sys/contract/process_impl.h>
#include <sys/ddi.h>
+extern int yield(void);
/*
* Processes running within a zone potentially dump core in 3 locations,
* based on the per-process, per-zone, and the global zone's core settings.
@@ -534,6 +536,10 @@ expand_string(const char *pat, char *fp, int size, cred_t *cr)
case 'z':
s = p->p_zone->zone_name;
break;
+ case 'Z':
+ /* This is zonepath + "/root/", except for GZ */
+ s = p->p_zone->zone_rootpath;
+ break;
case '%':
(void) strcpy((s = buf), "%");
break;
@@ -548,6 +554,9 @@ expand_string(const char *pat, char *fp, int size, cred_t *cr)
if ((size -= len) <= 0)
return (ENAMETOOLONG);
(void) strcpy(fp, s);
+ /* strip trailing "/root/" from non-GZ zonepath string */
+ if (c == 'Z' && len > 6)
+ len -= 6;
fp += len;
}
diff --git a/usr/src/uts/common/os/cred.c b/usr/src/uts/common/os/cred.c
index 7add6a4b8e..866c19678f 100644
--- a/usr/src/uts/common/os/cred.c
+++ b/usr/src/uts/common/os/cred.c
@@ -727,6 +727,14 @@ crgetzoneid(const cred_t *cr)
cr->cr_zone->zone_id);
}
+zoneid_t
+crgetzonedid(const cred_t *cr)
+{
+ return (cr->cr_zone == NULL ?
+ (cr->cr_uid == -1 ? (zoneid_t)-1 : GLOBAL_ZONEID) :
+ cr->cr_zone->zone_did);
+}
+
projid_t
crgetprojid(const cred_t *cr)
{
diff --git a/usr/src/uts/common/os/ddi_intr_irm.c b/usr/src/uts/common/os/ddi_intr_irm.c
index c3c0481e7f..a4b35dcb5b 100644
--- a/usr/src/uts/common/os/ddi_intr_irm.c
+++ b/usr/src/uts/common/os/ddi_intr_irm.c
@@ -1320,7 +1320,7 @@ i_ddi_irm_notify(ddi_irm_pool_t *pool_p, ddi_irm_req_t *req_p)
/* Log callback errors */
if (ret != DDI_SUCCESS) {
- cmn_err(CE_WARN, "%s%d: failed callback (action=%d, ret=%d)\n",
+ cmn_err(CE_WARN, "!%s%d: failed callback (action=%d, ret=%d)\n",
ddi_driver_name(req_p->ireq_dip),
ddi_get_instance(req_p->ireq_dip), (int)action, ret);
}
diff --git a/usr/src/uts/common/os/dtrace_subr.c b/usr/src/uts/common/os/dtrace_subr.c
index f2a9ac1b7d..d2ce3361c1 100644
--- a/usr/src/uts/common/os/dtrace_subr.c
+++ b/usr/src/uts/common/os/dtrace_subr.c
@@ -44,6 +44,7 @@ void (*dtrace_helpers_fork)(proc_t *, proc_t *);
void (*dtrace_cpustart_init)(void);
void (*dtrace_cpustart_fini)(void);
void (*dtrace_cpc_fire)(uint64_t);
+void (*dtrace_closef)(void);
void (*dtrace_debugger_init)(void);
void (*dtrace_debugger_fini)(void);
diff --git a/usr/src/uts/common/os/exit.c b/usr/src/uts/common/os/exit.c
index b97a09454b..7c5b8323e3 100644
--- a/usr/src/uts/common/os/exit.c
+++ b/usr/src/uts/common/os/exit.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -388,10 +389,16 @@ proc_exit(int why, int what)
if (p->p_pid == z->zone_proc_initpid) {
if (z->zone_boot_err == 0 &&
zone_status_get(z) < ZONE_IS_SHUTTING_DOWN &&
- zone_status_get(global_zone) < ZONE_IS_SHUTTING_DOWN &&
- z->zone_restart_init == B_TRUE &&
- restart_init(what, why) == 0)
- return (0);
+ zone_status_get(global_zone) < ZONE_IS_SHUTTING_DOWN) {
+ if (z->zone_restart_init == B_TRUE) {
+ if (restart_init(what, why) == 0)
+ return (0);
+ } else {
+ (void) zone_kadmin(A_SHUTDOWN, AD_HALT, NULL,
+ CRED());
+ }
+ }
+
/*
* Since we didn't or couldn't restart init, we clear
* the zone's init state and proceed with exit
diff --git a/usr/src/uts/common/os/fio.c b/usr/src/uts/common/os/fio.c
index a014d25c0f..3b47e05ef2 100644
--- a/usr/src/uts/common/os/fio.c
+++ b/usr/src/uts/common/os/fio.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -54,6 +55,7 @@
#include <sys/poll.h>
#include <sys/rctl.h>
#include <sys/port_impl.h>
+#include <sys/dtrace.h>
#include <c2/audit.h>
#include <sys/nbmlock.h>
@@ -952,6 +954,18 @@ closef(file_t *fp)
ASSERT(fp->f_count == 0);
mutex_exit(&fp->f_tlock);
+ /*
+ * If DTrace has getf() subroutines active, it will set dtrace_closef
+ * to point to code that implements a barrier with respect to probe
+ * context. This must be called before the file_t is freed (and the
+ * vnode that it refers to is released) -- but it must be after the
+ * file_t has been removed from the uf_entry_t. That is, there must
+ * be no way for a racing getf() in probe context to yield the fp that
+ * we're operating upon.
+ */
+ if (dtrace_closef != NULL)
+ (*dtrace_closef)();
+
VN_RELE(vp);
/*
* deallocate resources to audit_data
diff --git a/usr/src/uts/common/os/fork.c b/usr/src/uts/common/os/fork.c
index 2e9b2ef403..0f57c03442 100644
--- a/usr/src/uts/common/os/fork.c
+++ b/usr/src/uts/common/os/fork.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -149,6 +150,7 @@ cfork(int isvfork, int isfork1, int flags)
*/
if ((flags & ~(FORK_NOSIGCHLD | FORK_WAITPID)) != 0) {
error = EINVAL;
+ atomic_add_32(&curproc->p_zone->zone_ffmisc, 1);
goto forkerr;
}
@@ -157,11 +159,14 @@ cfork(int isvfork, int isfork1, int flags)
*/
if (curthread == p->p_agenttp) {
error = ENOTSUP;
+ atomic_add_32(&curproc->p_zone->zone_ffmisc, 1);
goto forkerr;
}
- if ((error = secpolicy_basic_fork(CRED())) != 0)
+ if ((error = secpolicy_basic_fork(CRED())) != 0) {
+ atomic_add_32(&p->p_zone->zone_ffmisc, 1);
goto forkerr;
+ }
/*
* If the calling lwp is doing a fork1() then the
@@ -175,6 +180,7 @@ cfork(int isvfork, int isfork1, int flags)
if (!holdlwps(isfork1 ? SHOLDFORK1 : SHOLDFORK)) {
aston(curthread);
error = EINTR;
+ atomic_add_32(&p->p_zone->zone_ffmisc, 1);
goto forkerr;
}
@@ -290,6 +296,7 @@ cfork(int isvfork, int isfork1, int flags)
* map all others to EAGAIN.
*/
error = (error == ENOMEM) ? ENOMEM : EAGAIN;
+ atomic_add_32(&p->p_zone->zone_ffnomem, 1);
goto forkerr;
}
@@ -424,8 +431,10 @@ cfork(int isvfork, int isfork1, int flags)
* fork event (if requested) to whatever contract the child is
* a member of. Fails if the parent has been SIGKILLed.
*/
- if (contract_process_fork(NULL, cp, p, B_TRUE) == NULL)
+ if (contract_process_fork(NULL, cp, p, B_TRUE) == NULL) {
+ atomic_add_32(&p->p_zone->zone_ffmisc, 1);
goto forklwperr;
+ }
/*
* No fork failures occur beyond this point.
@@ -960,6 +969,7 @@ getproc(proc_t **cpp, pid_t pid, uint_t flags)
if (rctlfail) {
mutex_exit(&zone->zone_nlwps_lock);
mutex_exit(&pp->p_lock);
+ atomic_add_32(&zone->zone_ffcap, 1);
goto punish;
}
}
@@ -1233,6 +1243,7 @@ bad:
proj->kpj_nprocs--;
zone->zone_nprocs--;
mutex_exit(&zone->zone_nlwps_lock);
+ atomic_add_32(&zone->zone_ffnoproc, 1);
punish:
/*
diff --git a/usr/src/uts/common/os/kstat_fr.c b/usr/src/uts/common/os/kstat_fr.c
index fb5333921d..7cd75fa8a6 100644
--- a/usr/src/uts/common/os/kstat_fr.c
+++ b/usr/src/uts/common/os/kstat_fr.c
@@ -161,6 +161,7 @@ struct {
kstat_named_t avenrun_5min;
kstat_named_t avenrun_15min;
kstat_named_t boot_time;
+ kstat_named_t nsec_per_tick;
} system_misc_kstat = {
{ "ncpus", KSTAT_DATA_UINT32 },
{ "lbolt", KSTAT_DATA_UINT32 },
@@ -172,6 +173,7 @@ struct {
{ "avenrun_5min", KSTAT_DATA_UINT32 },
{ "avenrun_15min", KSTAT_DATA_UINT32 },
{ "boot_time", KSTAT_DATA_UINT32 },
+ { "nsec_per_tick", KSTAT_DATA_UINT32 },
};
struct {
@@ -806,7 +808,6 @@ system_misc_kstat_update(kstat_t *ksp, int rw)
{
int myncpus = ncpus;
int *loadavgp = &avenrun[0];
- int loadavg[LOADAVG_NSTATS];
time_t zone_boot_time;
clock_t zone_lbolt;
hrtime_t zone_hrtime;
@@ -823,17 +824,11 @@ system_misc_kstat_update(kstat_t *ksp, int rw)
*/
mutex_enter(&cpu_lock);
if (pool_pset_enabled()) {
- psetid_t mypsid = zone_pset_get(curproc->p_zone);
- int error;
-
myncpus = zone_ncpus_get(curproc->p_zone);
ASSERT(myncpus > 0);
- error = cpupart_get_loadavg(mypsid, &loadavg[0],
- LOADAVG_NSTATS);
- ASSERT(error == 0);
- loadavgp = &loadavg[0];
}
mutex_exit(&cpu_lock);
+ loadavgp = &curproc->p_zone->zone_avenrun[0];
}
if (INGLOBALZONE(curproc)) {
@@ -862,6 +857,8 @@ system_misc_kstat_update(kstat_t *ksp, int rw)
system_misc_kstat.avenrun_15min.value.ui32 = (uint32_t)loadavgp[2];
system_misc_kstat.boot_time.value.ui32 = (uint32_t)
zone_boot_time;
+ system_misc_kstat.nsec_per_tick.value.ui32 = (uint32_t)
+ nsec_per_tick;
return (0);
}
diff --git a/usr/src/uts/common/os/logsubr.c b/usr/src/uts/common/os/logsubr.c
index 149f5f8a88..86e9045887 100644
--- a/usr/src/uts/common/os/logsubr.c
+++ b/usr/src/uts/common/os/logsubr.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2013 Gary Mills
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -249,8 +250,7 @@ log_init(void)
*/
printf("\rSunOS Release %s Version %s %u-bit\n",
utsname.release, utsname.version, NBBY * (uint_t)sizeof (void *));
- printf("Copyright (c) 1983, 2010, Oracle and/or its affiliates. "
- "All rights reserved.\n");
+ printf("Copyright (c) 2010-2014, Joyent Inc. All rights reserved.\n");
#ifdef DEBUG
printf("DEBUG enabled\n");
#endif
diff --git a/usr/src/uts/common/os/lwp.c b/usr/src/uts/common/os/lwp.c
index 6d518e1aae..a94cb6515a 100644
--- a/usr/src/uts/common/os/lwp.c
+++ b/usr/src/uts/common/os/lwp.c
@@ -146,6 +146,7 @@ lwp_create(void (*proc)(), caddr_t arg, size_t len, proc_t *p,
if (rctlfail) {
mutex_exit(&p->p_zone->zone_nlwps_lock);
mutex_exit(&p->p_lock);
+ atomic_add_32(&p->p_zone->zone_ffcap, 1);
return (NULL);
}
p->p_task->tk_nlwps++;
@@ -204,6 +205,7 @@ lwp_create(void (*proc)(), caddr_t arg, size_t len, proc_t *p,
p->p_zone->zone_nlwps--;
mutex_exit(&p->p_zone->zone_nlwps_lock);
mutex_exit(&p->p_lock);
+ atomic_add_32(&p->p_zone->zone_ffnomem, 1);
return (NULL);
}
} else {
@@ -217,6 +219,7 @@ lwp_create(void (*proc)(), caddr_t arg, size_t len, proc_t *p,
p->p_zone->zone_nlwps--;
mutex_exit(&p->p_zone->zone_nlwps_lock);
mutex_exit(&p->p_lock);
+ atomic_add_32(&p->p_zone->zone_ffnomem, 1);
return (NULL);
}
}
@@ -582,10 +585,12 @@ grow:
err = CL_FORK(curthread, t, bufp);
t->t_cid = cid;
}
- if (err)
+ if (err) {
+ atomic_add_32(&p->p_zone->zone_ffmisc, 1);
goto error;
- else
+ } else {
bufp = NULL;
+ }
}
/*
@@ -612,6 +617,7 @@ grow:
* All lwpids are allocated; fail the request.
*/
err = 1;
+ atomic_add_32(&p->p_zone->zone_ffnoproc, 1);
goto error;
}
/*
@@ -631,6 +637,7 @@ grow:
if (PROC_IS_BRANDED(p)) {
if (BROP(p)->b_initlwp(lwp)) {
err = 1;
+ atomic_add_32(&p->p_zone->zone_ffmisc, 1);
goto error;
}
branded = 1;
diff --git a/usr/src/uts/common/os/msacct.c b/usr/src/uts/common/os/msacct.c
index df975eb7ee..30e50cce72 100644
--- a/usr/src/uts/common/os/msacct.c
+++ b/usr/src/uts/common/os/msacct.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -33,6 +34,7 @@
#include <sys/debug.h>
#include <sys/msacct.h>
#include <sys/time.h>
+#include <sys/zone.h>
/*
* Mega-theory block comment:
@@ -390,6 +392,7 @@ void
syscall_mstate(int fromms, int toms)
{
kthread_t *t = curthread;
+ zone_t *z = ttozone(t);
struct mstate *ms;
hrtime_t *mstimep;
hrtime_t curtime;
@@ -413,6 +416,10 @@ syscall_mstate(int fromms, int toms)
newtime = curtime - ms->ms_state_start;
}
*mstimep += newtime;
+ if (fromms == LMS_USER)
+ atomic_add_64(&z->zone_utime, newtime);
+ else if (fromms == LMS_SYSTEM)
+ atomic_add_64(&z->zone_stime, newtime);
t->t_mstate = toms;
ms->ms_state_start = curtime;
ms->ms_prev = fromms;
@@ -560,27 +567,18 @@ cpu_update_pct(kthread_t *t, hrtime_t newtime)
*/
do {
- if (T_ONPROC(t) && t->t_waitrq == 0) {
- hrlb = t->t_hrtime;
+ pctcpu = t->t_pctcpu;
+ hrlb = t->t_hrtime;
+ delta = newtime - hrlb;
+ if (delta < 0) {
+ newtime = gethrtime_unscaled();
delta = newtime - hrlb;
- if (delta < 0) {
- newtime = gethrtime_unscaled();
- delta = newtime - hrlb;
- }
- t->t_hrtime = newtime;
- scalehrtime(&delta);
- pctcpu = t->t_pctcpu;
+ }
+ t->t_hrtime = newtime;
+ scalehrtime(&delta);
+ if (T_ONPROC(t) && t->t_waitrq == 0) {
npctcpu = cpu_grow(pctcpu, delta);
} else {
- hrlb = t->t_hrtime;
- delta = newtime - hrlb;
- if (delta < 0) {
- newtime = gethrtime_unscaled();
- delta = newtime - hrlb;
- }
- t->t_hrtime = newtime;
- scalehrtime(&delta);
- pctcpu = t->t_pctcpu;
npctcpu = cpu_decay(pctcpu, delta);
}
} while (cas32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu);
@@ -602,7 +600,10 @@ new_mstate(kthread_t *t, int new_state)
hrtime_t curtime;
hrtime_t newtime;
hrtime_t oldtime;
+ hrtime_t ztime;
+ hrtime_t origstart;
klwp_t *lwp;
+ zone_t *z;
ASSERT(new_state != LMS_WAIT_CPU);
ASSERT((unsigned)new_state < NMSTATES);
@@ -625,6 +626,7 @@ new_mstate(kthread_t *t, int new_state)
ms = &lwp->lwp_mstate;
state = t->t_mstate;
+ origstart = ms->ms_state_start;
do {
switch (state) {
case LMS_TFAULT:
@@ -637,7 +639,7 @@ new_mstate(kthread_t *t, int new_state)
mstimep = &ms->ms_acct[state];
break;
}
- newtime = curtime - ms->ms_state_start;
+ ztime = newtime = curtime - ms->ms_state_start;
if (newtime < 0) {
curtime = gethrtime_unscaled();
oldtime = *mstimep - 1; /* force CAS to fail */
@@ -648,6 +650,20 @@ new_mstate(kthread_t *t, int new_state)
t->t_mstate = new_state;
ms->ms_state_start = curtime;
} while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime);
+
+ /*
+ * When the system boots the initial startup thread will have a
+ * ms_state_start of 0 which would add a huge system time to the global
+ * zone. We want to skip aggregating that initial bit of work.
+ */
+ if (origstart != 0) {
+ z = ttozone(t);
+ if (state == LMS_USER)
+ atomic_add_64(&z->zone_utime, ztime);
+ else if (state == LMS_SYSTEM)
+ atomic_add_64(&z->zone_stime, ztime);
+ }
+
/*
* Remember the previous running microstate.
*/
@@ -686,6 +702,8 @@ restore_mstate(kthread_t *t)
hrtime_t waitrq;
hrtime_t newtime;
hrtime_t oldtime;
+ hrtime_t waittime;
+ zone_t *z;
/*
* Don't call restore mstate of threads without lwps. (Kernel threads)
@@ -756,11 +774,15 @@ restore_mstate(kthread_t *t)
oldtime = *mstimep;
newtime += oldtime;
} while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime);
+
/*
* Update the WAIT_CPU timer and per-cpu waitrq total.
*/
- ms->ms_acct[LMS_WAIT_CPU] += (curtime - waitrq);
- CPU->cpu_waitrq += (curtime - waitrq);
+ z = ttozone(t);
+ waittime = curtime - waitrq;
+ ms->ms_acct[LMS_WAIT_CPU] += waittime;
+ atomic_add_64(&z->zone_wtime, waittime);
+ CPU->cpu_waitrq += waittime;
ms->ms_state_start = curtime;
}
diff --git a/usr/src/uts/common/os/netstack.c b/usr/src/uts/common/os/netstack.c
index b8467fbe13..5c556bffef 100644
--- a/usr/src/uts/common/os/netstack.c
+++ b/usr/src/uts/common/os/netstack.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/param.h>
@@ -220,10 +221,37 @@ netstack_unregister(int moduleid)
* instances can use this module.
*/
for (ns = netstack_head; ns != NULL; ns = ns->netstack_next) {
+ boolean_t created = B_FALSE;
nm_state_t *nms = &ns->netstack_m_state[moduleid];
mutex_enter(&ns->netstack_lock);
- if (ns_reg[moduleid].nr_shutdown != NULL &&
+
+ /*
+ * We need to be careful here. We could actually have a netstack
+ * being created as we speak waiting for us to let go of this
+ * lock to proceed. It may have set NSS_CREATE_NEEDED, but not
+ * have gotten to the point of completing it yet. If
+ * NSS_CREATE_NEEDED, we can safely just remove it here and
+ * never create the module. However, if NSS_CREATE_INPROGRESS is
+ * set, we need to still flag this module for shutdown and
+ * deletion, just as though it had reached NSS_CREATE_COMPLETED.
+ *
+ * It is safe to do that because of two different guarantees
+ * that exist in the system. The first is that before we do a
+ * create, shutdown, or destroy, we ensure that nothing else is
+ * in progress in the system for this netstack and wait for it
+ * to complete. Secondly, because the zone is being created, we
+ * know that the following call to apply_all_netstack will block
+ * on the zone finishing its initialization.
+ */
+ if (nms->nms_flags & NSS_CREATE_NEEDED)
+ nms->nms_flags &= ~NSS_CREATE_NEEDED;
+
+ if (nms->nms_flags & NSS_CREATE_INPROGRESS ||
+ nms->nms_flags & NSS_CREATE_COMPLETED)
+ created = B_TRUE;
+
+ if (ns_reg[moduleid].nr_shutdown != NULL && created &&
(nms->nms_flags & NSS_CREATE_COMPLETED) &&
(nms->nms_flags & NSS_SHUTDOWN_ALL) == 0) {
nms->nms_flags |= NSS_SHUTDOWN_NEEDED;
@@ -231,8 +259,7 @@ netstack_unregister(int moduleid)
netstack_t *, ns, int, moduleid);
}
if ((ns_reg[moduleid].nr_flags & NRF_REGISTERED) &&
- ns_reg[moduleid].nr_destroy != NULL &&
- (nms->nms_flags & NSS_CREATE_COMPLETED) &&
+ ns_reg[moduleid].nr_destroy != NULL && created &&
(nms->nms_flags & NSS_DESTROY_ALL) == 0) {
nms->nms_flags |= NSS_DESTROY_NEEDED;
DTRACE_PROBE2(netstack__destroy__needed,
diff --git a/usr/src/uts/common/os/policy.c b/usr/src/uts/common/os/policy.c
index 05deaaf43b..40db66fb8d 100644
--- a/usr/src/uts/common/os/policy.c
+++ b/usr/src/uts/common/os/policy.c
@@ -2575,3 +2575,12 @@ secpolicy_ppp_config(const cred_t *cr)
return (secpolicy_net_config(cr, B_FALSE));
return (PRIV_POLICY(cr, PRIV_SYS_PPP_CONFIG, B_FALSE, EPERM, NULL));
}
+
+int
+secpolicy_hyprlofs_control(const cred_t *cr)
+{
+ if (PRIV_POLICY(cr, PRIV_HYPRLOFS_CONTROL, B_FALSE, EPERM, NULL))
+ return (EPERM);
+ return (0);
+}
+
diff --git a/usr/src/uts/common/os/priv_defs b/usr/src/uts/common/os/priv_defs
index bfacce1739..f510050a01 100644
--- a/usr/src/uts/common/os/priv_defs
+++ b/usr/src/uts/common/os/priv_defs
@@ -177,6 +177,10 @@ privilege PRIV_GRAPHICS_MAP
Allows a process to perform privileged mappings through a
graphics device.
+privilege PRIV_HYPRLOFS_CONTROL
+
+ Allows a process to manage hyprlofs entries.
+
privilege PRIV_IPC_DAC_READ
Allows a process to read a System V IPC
diff --git a/usr/src/uts/common/os/vmem.c b/usr/src/uts/common/os/vmem.c
index 6946a35a38..1b222538b3 100644
--- a/usr/src/uts/common/os/vmem.c
+++ b/usr/src/uts/common/os/vmem.c
@@ -1619,7 +1619,7 @@ vmem_destroy(vmem_t *vmp)
leaked = vmem_size(vmp, VMEM_ALLOC);
if (leaked != 0)
- cmn_err(CE_WARN, "vmem_destroy('%s'): leaked %lu %s",
+ cmn_err(CE_WARN, "!vmem_destroy('%s'): leaked %lu %s",
vmp->vm_name, leaked, (vmp->vm_cflags & VMC_IDENTIFIER) ?
"identifiers" : "bytes");
diff --git a/usr/src/uts/common/os/zone.c b/usr/src/uts/common/os/zone.c
index 826fba8718..3f8122047b 100644
--- a/usr/src/uts/common/os/zone.c
+++ b/usr/src/uts/common/os/zone.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent Inc. All rights reserved.
*/
/*
@@ -369,21 +370,18 @@ static char *zone_ref_subsys_names[] = {
rctl_hndl_t rc_zone_cpu_shares;
rctl_hndl_t rc_zone_locked_mem;
rctl_hndl_t rc_zone_max_swap;
+rctl_hndl_t rc_zone_phys_mem;
rctl_hndl_t rc_zone_max_lofi;
rctl_hndl_t rc_zone_cpu_cap;
+rctl_hndl_t rc_zone_cpu_baseline;
+rctl_hndl_t rc_zone_cpu_burst_time;
+rctl_hndl_t rc_zone_zfs_io_pri;
rctl_hndl_t rc_zone_nlwps;
rctl_hndl_t rc_zone_nprocs;
rctl_hndl_t rc_zone_shmmax;
rctl_hndl_t rc_zone_shmmni;
rctl_hndl_t rc_zone_semmni;
rctl_hndl_t rc_zone_msgmni;
-/*
- * Synchronization primitives used to synchronize between mounts and zone
- * creation/destruction.
- */
-static int mounts_in_progress;
-static kcondvar_t mount_cv;
-static kmutex_t mount_lock;
const char * const zone_default_initname = "/sbin/init";
static char * const zone_prefix = "/zone/";
@@ -423,23 +421,27 @@ static boolean_t zsd_wait_for_inprogress(zone_t *, struct zsd_entry *,
* Version 5 alters the zone_boot system call, and converts its old
* bootargs parameter to be set by the zone_setattr API instead.
* Version 6 adds the flag argument to zone_create.
+ * Version 7 adds the requested zoneid to zone_create.
*/
-static const int ZONE_SYSCALL_API_VERSION = 6;
+static const int ZONE_SYSCALL_API_VERSION = 7;
/*
* Certain filesystems (such as NFS and autofs) need to know which zone
* the mount is being placed in. Because of this, we need to be able to
- * ensure that a zone isn't in the process of being created such that
- * nfs_mount() thinks it is in the global zone, while by the time it
- * gets added the list of mounted zones, it ends up on zoneA's mount
- * list.
+ * ensure that a zone isn't in the process of being created/destroyed such
+ * that nfs_mount() thinks it is in the global/NGZ zone, while by the time
+ * it gets added the list of mounted zones, it ends up on the wrong zone's
+ * mount list. Since a zone can't reside on an NFS file system, we don't
+ * have to worry about the zonepath itself.
*
* The following functions: block_mounts()/resume_mounts() and
* mount_in_progress()/mount_completed() are used by zones and the VFS
- * layer (respectively) to synchronize zone creation and new mounts.
+ * layer (respectively) to synchronize zone state transitions and new
+ * mounts within a zone. This syncronization is on a per-zone basis, so
+ * activity for one zone will not interfere with activity for another zone.
*
* The semantics are like a reader-reader lock such that there may
- * either be multiple mounts (or zone creations, if that weren't
+ * either be multiple mounts (or zone state transitions, if that weren't
* serialized by zonehash_lock) in progress at the same time, but not
* both.
*
@@ -447,10 +449,8 @@ static const int ZONE_SYSCALL_API_VERSION = 6;
* taking too long.
*
* The semantics are such that there is unfair bias towards the
- * "current" operation. This means that zone creations may starve if
- * there is a rapid succession of new mounts coming in to the system, or
- * there is a remote possibility that zones will be created at such a
- * rate that new mounts will not be able to proceed.
+ * "current" operation. This means that zone halt may starve if
+ * there is a rapid succession of new mounts coming in to the zone.
*/
/*
* Prevent new mounts from progressing to the point of calling
@@ -458,7 +458,7 @@ static const int ZONE_SYSCALL_API_VERSION = 6;
* them to complete.
*/
static int
-block_mounts(void)
+block_mounts(zone_t *zp)
{
int retval = 0;
@@ -467,19 +467,21 @@ block_mounts(void)
* called with zonehash_lock held.
*/
ASSERT(MUTEX_NOT_HELD(&zonehash_lock));
- mutex_enter(&mount_lock);
- while (mounts_in_progress > 0) {
- if (cv_wait_sig(&mount_cv, &mount_lock) == 0)
+ mutex_enter(&zp->zone_mount_lock);
+ while (zp->zone_mounts_in_progress > 0) {
+ if (cv_wait_sig(&zp->zone_mount_cv, &zp->zone_mount_lock) == 0)
goto signaled;
}
/*
* A negative value of mounts_in_progress indicates that mounts
- * have been blocked by (-mounts_in_progress) different callers.
+ * have been blocked by (-mounts_in_progress) different callers
+ * (remotely possible if two threads enter zone_shutdown at the same
+ * time).
*/
- mounts_in_progress--;
+ zp->zone_mounts_in_progress--;
retval = 1;
signaled:
- mutex_exit(&mount_lock);
+ mutex_exit(&zp->zone_mount_lock);
return (retval);
}
@@ -488,26 +490,26 @@ signaled:
* Allow them to progress if we were the last obstacle.
*/
static void
-resume_mounts(void)
+resume_mounts(zone_t *zp)
{
- mutex_enter(&mount_lock);
- if (++mounts_in_progress == 0)
- cv_broadcast(&mount_cv);
- mutex_exit(&mount_lock);
+ mutex_enter(&zp->zone_mount_lock);
+ if (++zp->zone_mounts_in_progress == 0)
+ cv_broadcast(&zp->zone_mount_cv);
+ mutex_exit(&zp->zone_mount_lock);
}
/*
- * The VFS layer is busy with a mount; zones should wait until all
- * mounts are completed to progress.
+ * The VFS layer is busy with a mount; this zone should wait until all
+ * of its mounts are completed to progress.
*/
void
-mount_in_progress(void)
+mount_in_progress(zone_t *zp)
{
- mutex_enter(&mount_lock);
- while (mounts_in_progress < 0)
- cv_wait(&mount_cv, &mount_lock);
- mounts_in_progress++;
- mutex_exit(&mount_lock);
+ mutex_enter(&zp->zone_mount_lock);
+ while (zp->zone_mounts_in_progress < 0)
+ cv_wait(&zp->zone_mount_cv, &zp->zone_mount_lock);
+ zp->zone_mounts_in_progress++;
+ mutex_exit(&zp->zone_mount_lock);
}
/*
@@ -515,12 +517,12 @@ mount_in_progress(void)
* callers if this is the last mount.
*/
void
-mount_completed(void)
+mount_completed(zone_t *zp)
{
- mutex_enter(&mount_lock);
- if (--mounts_in_progress == 0)
- cv_broadcast(&mount_cv);
- mutex_exit(&mount_lock);
+ mutex_enter(&zp->zone_mount_lock);
+ if (--zp->zone_mounts_in_progress == 0)
+ cv_broadcast(&zp->zone_mount_cv);
+ mutex_exit(&zp->zone_mount_lock);
}
/*
@@ -1380,6 +1382,114 @@ static rctl_ops_t zone_cpu_cap_ops = {
/*ARGSUSED*/
static rctl_qty_t
+zone_cpu_base_get(rctl_t *rctl, struct proc *p)
+{
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ return (cpucaps_zone_get_base(p->p_zone));
+}
+
+/*
+ * The zone cpu base is used to set the baseline CPU for the zone
+ * so we can track when the zone is bursting.
+ */
+/*ARGSUSED*/
+static int
+zone_cpu_base_set(rctl_t *rctl, struct proc *p, rctl_entity_p_t *e,
+ rctl_qty_t nv)
+{
+ zone_t *zone = e->rcep_p.zone;
+
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ ASSERT(e->rcep_t == RCENTITY_ZONE);
+
+ if (zone == NULL)
+ return (0);
+
+ return (cpucaps_zone_set_base(zone, nv));
+}
+
+static rctl_ops_t zone_cpu_base_ops = {
+ rcop_no_action,
+ zone_cpu_base_get,
+ zone_cpu_base_set,
+ rcop_no_test
+};
+
+/*ARGSUSED*/
+static rctl_qty_t
+zone_cpu_burst_time_get(rctl_t *rctl, struct proc *p)
+{
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ return (cpucaps_zone_get_burst_time(p->p_zone));
+}
+
+/*
+ * The zone cpu burst time is used to set the amount of time CPU(s) can be
+ * bursting for the zone.
+ */
+/*ARGSUSED*/
+static int
+zone_cpu_burst_time_set(rctl_t *rctl, struct proc *p, rctl_entity_p_t *e,
+ rctl_qty_t nv)
+{
+ zone_t *zone = e->rcep_p.zone;
+
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ ASSERT(e->rcep_t == RCENTITY_ZONE);
+
+ if (zone == NULL)
+ return (0);
+
+ return (cpucaps_zone_set_burst_time(zone, nv));
+}
+
+static rctl_ops_t zone_cpu_burst_time_ops = {
+ rcop_no_action,
+ zone_cpu_burst_time_get,
+ zone_cpu_burst_time_set,
+ rcop_no_test
+};
+
+/*
+ * zone.zfs-io-pri resource control support (IO priority).
+ */
+/*ARGSUSED*/
+static rctl_qty_t
+zone_zfs_io_pri_get(rctl_t *rctl, struct proc *p)
+{
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ return (p->p_zone->zone_zfs_io_pri);
+}
+
+/*ARGSUSED*/
+static int
+zone_zfs_io_pri_set(rctl_t *rctl, struct proc *p, rctl_entity_p_t *e,
+ rctl_qty_t nv)
+{
+ zone_t *zone = e->rcep_p.zone;
+
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ ASSERT(e->rcep_t == RCENTITY_ZONE);
+
+ if (zone == NULL)
+ return (0);
+
+ /*
+ * set priority to the new value.
+ */
+ zone->zone_zfs_io_pri = nv;
+ return (0);
+}
+
+static rctl_ops_t zone_zfs_io_pri_ops = {
+ rcop_no_action,
+ zone_zfs_io_pri_get,
+ zone_zfs_io_pri_set,
+ rcop_no_test
+};
+
+/*ARGSUSED*/
+static rctl_qty_t
zone_lwps_usage(rctl_t *r, proc_t *p)
{
rctl_qty_t nlwps;
@@ -1674,6 +1784,39 @@ static rctl_ops_t zone_max_swap_ops = {
/*ARGSUSED*/
static rctl_qty_t
+zone_phys_mem_usage(rctl_t *rctl, struct proc *p)
+{
+ rctl_qty_t q;
+ zone_t *z = p->p_zone;
+
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ /* No additional lock because not enforced in the kernel */
+ q = z->zone_phys_mem;
+ return (q);
+}
+
+/*ARGSUSED*/
+static int
+zone_phys_mem_set(rctl_t *rctl, struct proc *p, rctl_entity_p_t *e,
+ rctl_qty_t nv)
+{
+ ASSERT(MUTEX_HELD(&p->p_lock));
+ ASSERT(e->rcep_t == RCENTITY_ZONE);
+ if (e->rcep_p.zone == NULL)
+ return (0);
+ e->rcep_p.zone->zone_phys_mem_ctl = nv;
+ return (0);
+}
+
+static rctl_ops_t zone_phys_mem_ops = {
+ rcop_no_action,
+ zone_phys_mem_usage,
+ zone_phys_mem_set,
+ rcop_no_test
+};
+
+/*ARGSUSED*/
+static rctl_qty_t
zone_max_lofi_usage(rctl_t *rctl, struct proc *p)
{
rctl_qty_t q;
@@ -1767,6 +1910,20 @@ zone_lockedmem_kstat_update(kstat_t *ksp, int rw)
}
static int
+zone_physmem_kstat_update(kstat_t *ksp, int rw)
+{
+ zone_t *zone = ksp->ks_private;
+ zone_kstat_t *zk = ksp->ks_data;
+
+ if (rw == KSTAT_WRITE)
+ return (EACCES);
+
+ zk->zk_usage.value.ui64 = zone->zone_phys_mem;
+ zk->zk_value.value.ui64 = zone->zone_phys_mem_ctl;
+ return (0);
+}
+
+static int
zone_nprocs_kstat_update(kstat_t *ksp, int rw)
{
zone_t *zone = ksp->ks_private;
@@ -1795,7 +1952,7 @@ zone_swapresv_kstat_update(kstat_t *ksp, int rw)
}
static kstat_t *
-zone_kstat_create_common(zone_t *zone, char *name,
+zone_rctl_kstat_create_common(zone_t *zone, char *name,
int (*updatefunc) (kstat_t *, int))
{
kstat_t *ksp;
@@ -1820,26 +1977,347 @@ zone_kstat_create_common(zone_t *zone, char *name,
return (ksp);
}
+static int
+zone_vfs_kstat_update(kstat_t *ksp, int rw)
+{
+ zone_t *zone = ksp->ks_private;
+ zone_vfs_kstat_t *zvp = ksp->ks_data;
+ kstat_io_t *kiop = &zone->zone_vfs_rwstats;
+
+ if (rw == KSTAT_WRITE)
+ return (EACCES);
+
+ /*
+ * Extract the VFS statistics from the kstat_io_t structure used by
+ * kstat_runq_enter() and related functions. Since the slow ops
+ * counters are updated directly by the VFS layer, there's no need to
+ * copy those statistics here.
+ *
+ * Note that kstat_runq_enter() and the related functions use
+ * gethrtime_unscaled(), so scale the time here.
+ */
+ zvp->zv_nread.value.ui64 = kiop->nread;
+ zvp->zv_reads.value.ui64 = kiop->reads;
+ zvp->zv_rtime.value.ui64 = kiop->rtime;
+ zvp->zv_rlentime.value.ui64 = kiop->rlentime;
+ zvp->zv_nwritten.value.ui64 = kiop->nwritten;
+ zvp->zv_writes.value.ui64 = kiop->writes;
+ zvp->zv_wtime.value.ui64 = kiop->wtime;
+ zvp->zv_wlentime.value.ui64 = kiop->wlentime;
+
+ scalehrtime((hrtime_t *)&zvp->zv_rtime.value.ui64);
+ scalehrtime((hrtime_t *)&zvp->zv_rlentime.value.ui64);
+ scalehrtime((hrtime_t *)&zvp->zv_wtime.value.ui64);
+ scalehrtime((hrtime_t *)&zvp->zv_wlentime.value.ui64);
+
+ return (0);
+}
+
+static kstat_t *
+zone_vfs_kstat_create(zone_t *zone)
+{
+ kstat_t *ksp;
+ zone_vfs_kstat_t *zvp;
+
+ if ((ksp = kstat_create_zone("zone_vfs", zone->zone_id,
+ zone->zone_name, "zone_vfs", KSTAT_TYPE_NAMED,
+ sizeof (zone_vfs_kstat_t) / sizeof (kstat_named_t),
+ KSTAT_FLAG_VIRTUAL, zone->zone_id)) == NULL)
+ return (NULL);
+
+ if (zone->zone_id != GLOBAL_ZONEID)
+ kstat_zone_add(ksp, GLOBAL_ZONEID);
+
+ zvp = ksp->ks_data = kmem_zalloc(sizeof (zone_vfs_kstat_t), KM_SLEEP);
+ ksp->ks_data_size += strlen(zone->zone_name) + 1;
+ ksp->ks_lock = &zone->zone_vfs_lock;
+ zone->zone_vfs_stats = zvp;
+
+ /* The kstat "name" field is not large enough for a full zonename */
+ kstat_named_init(&zvp->zv_zonename, "zonename", KSTAT_DATA_STRING);
+ kstat_named_setstr(&zvp->zv_zonename, zone->zone_name);
+ kstat_named_init(&zvp->zv_nread, "nread", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_reads, "reads", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_rtime, "rtime", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_rlentime, "rlentime", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_nwritten, "nwritten", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_writes, "writes", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_wtime, "wtime", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_wlentime, "wlentime", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_10ms_ops, "10ms_ops", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_100ms_ops, "100ms_ops", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_1s_ops, "1s_ops", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_10s_ops, "10s_ops", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_delay_cnt, "delay_cnt", KSTAT_DATA_UINT64);
+ kstat_named_init(&zvp->zv_delay_time, "delay_time", KSTAT_DATA_UINT64);
+
+ ksp->ks_update = zone_vfs_kstat_update;
+ ksp->ks_private = zone;
+
+ kstat_install(ksp);
+ return (ksp);
+}
+
+static int
+zone_zfs_kstat_update(kstat_t *ksp, int rw)
+{
+ zone_t *zone = ksp->ks_private;
+ zone_zfs_kstat_t *zzp = ksp->ks_data;
+ kstat_io_t *kiop = &zone->zone_zfs_rwstats;
+
+ if (rw == KSTAT_WRITE)
+ return (EACCES);
+
+ /*
+ * Extract the ZFS statistics from the kstat_io_t structure used by
+ * kstat_runq_enter() and related functions. Since the I/O throttle
+ * counters are updated directly by the ZFS layer, there's no need to
+ * copy those statistics here.
+ *
+ * Note that kstat_runq_enter() and the related functions use
+ * gethrtime_unscaled(), so scale the time here.
+ */
+ zzp->zz_nread.value.ui64 = kiop->nread;
+ zzp->zz_reads.value.ui64 = kiop->reads;
+ zzp->zz_rtime.value.ui64 = kiop->rtime;
+ zzp->zz_rlentime.value.ui64 = kiop->rlentime;
+ zzp->zz_nwritten.value.ui64 = kiop->nwritten;
+ zzp->zz_writes.value.ui64 = kiop->writes;
+
+ scalehrtime((hrtime_t *)&zzp->zz_rtime.value.ui64);
+ scalehrtime((hrtime_t *)&zzp->zz_rlentime.value.ui64);
+
+ return (0);
+}
+
+static kstat_t *
+zone_zfs_kstat_create(zone_t *zone)
+{
+ kstat_t *ksp;
+ zone_zfs_kstat_t *zzp;
+
+ if ((ksp = kstat_create_zone("zone_zfs", zone->zone_id,
+ zone->zone_name, "zone_zfs", KSTAT_TYPE_NAMED,
+ sizeof (zone_zfs_kstat_t) / sizeof (kstat_named_t),
+ KSTAT_FLAG_VIRTUAL, zone->zone_id)) == NULL)
+ return (NULL);
+
+ if (zone->zone_id != GLOBAL_ZONEID)
+ kstat_zone_add(ksp, GLOBAL_ZONEID);
+
+ zzp = ksp->ks_data = kmem_zalloc(sizeof (zone_zfs_kstat_t), KM_SLEEP);
+ ksp->ks_data_size += strlen(zone->zone_name) + 1;
+ ksp->ks_lock = &zone->zone_zfs_lock;
+ zone->zone_zfs_stats = zzp;
+
+ /* The kstat "name" field is not large enough for a full zonename */
+ kstat_named_init(&zzp->zz_zonename, "zonename", KSTAT_DATA_STRING);
+ kstat_named_setstr(&zzp->zz_zonename, zone->zone_name);
+ kstat_named_init(&zzp->zz_nread, "nread", KSTAT_DATA_UINT64);
+ kstat_named_init(&zzp->zz_reads, "reads", KSTAT_DATA_UINT64);
+ kstat_named_init(&zzp->zz_rtime, "rtime", KSTAT_DATA_UINT64);
+ kstat_named_init(&zzp->zz_rlentime, "rlentime", KSTAT_DATA_UINT64);
+ kstat_named_init(&zzp->zz_nwritten, "nwritten", KSTAT_DATA_UINT64);
+ kstat_named_init(&zzp->zz_writes, "writes", KSTAT_DATA_UINT64);
+ kstat_named_init(&zzp->zz_waittime, "waittime", KSTAT_DATA_UINT64);
+
+ ksp->ks_update = zone_zfs_kstat_update;
+ ksp->ks_private = zone;
+
+ kstat_install(ksp);
+ return (ksp);
+}
+
+static int
+zone_mcap_kstat_update(kstat_t *ksp, int rw)
+{
+ zone_t *zone = ksp->ks_private;
+ zone_mcap_kstat_t *zmp = ksp->ks_data;
+
+ if (rw == KSTAT_WRITE)
+ return (EACCES);
+
+ zmp->zm_rss.value.ui64 = zone->zone_phys_mem;
+ zmp->zm_phys_cap.value.ui64 = zone->zone_phys_mem_ctl;
+ zmp->zm_swap.value.ui64 = zone->zone_max_swap;
+ zmp->zm_swap_cap.value.ui64 = zone->zone_max_swap_ctl;
+ zmp->zm_nover.value.ui64 = zone->zone_mcap_nover;
+ zmp->zm_pagedout.value.ui64 = zone->zone_mcap_pagedout;
+ zmp->zm_pgpgin.value.ui64 = zone->zone_pgpgin;
+ zmp->zm_anonpgin.value.ui64 = zone->zone_anonpgin;
+ zmp->zm_execpgin.value.ui64 = zone->zone_execpgin;
+ zmp->zm_fspgin.value.ui64 = zone->zone_fspgin;
+ zmp->zm_anon_alloc_fail.value.ui64 = zone->zone_anon_alloc_fail;
+ zmp->zm_pf_throttle.value.ui64 = zone->zone_pf_throttle;
+ zmp->zm_pf_throttle_usec.value.ui64 = zone->zone_pf_throttle_usec;
+
+ return (0);
+}
+
+static kstat_t *
+zone_mcap_kstat_create(zone_t *zone)
+{
+ kstat_t *ksp;
+ zone_mcap_kstat_t *zmp;
+
+ if ((ksp = kstat_create_zone("memory_cap", zone->zone_id,
+ zone->zone_name, "zone_memory_cap", KSTAT_TYPE_NAMED,
+ sizeof (zone_mcap_kstat_t) / sizeof (kstat_named_t),
+ KSTAT_FLAG_VIRTUAL, zone->zone_id)) == NULL)
+ return (NULL);
+
+ if (zone->zone_id != GLOBAL_ZONEID)
+ kstat_zone_add(ksp, GLOBAL_ZONEID);
+
+ zmp = ksp->ks_data = kmem_zalloc(sizeof (zone_mcap_kstat_t), KM_SLEEP);
+ ksp->ks_data_size += strlen(zone->zone_name) + 1;
+ ksp->ks_lock = &zone->zone_mcap_lock;
+ zone->zone_mcap_stats = zmp;
+
+ /* The kstat "name" field is not large enough for a full zonename */
+ kstat_named_init(&zmp->zm_zonename, "zonename", KSTAT_DATA_STRING);
+ kstat_named_setstr(&zmp->zm_zonename, zone->zone_name);
+ kstat_named_init(&zmp->zm_rss, "rss", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_phys_cap, "physcap", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_swap, "swap", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_swap_cap, "swapcap", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_nover, "nover", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_pagedout, "pagedout", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_pgpgin, "pgpgin", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_anonpgin, "anonpgin", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_execpgin, "execpgin", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_fspgin, "fspgin", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_anon_alloc_fail, "anon_alloc_fail",
+ KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_pf_throttle, "n_pf_throttle",
+ KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_pf_throttle_usec, "n_pf_throttle_usec",
+ KSTAT_DATA_UINT64);
+
+ ksp->ks_update = zone_mcap_kstat_update;
+ ksp->ks_private = zone;
+
+ kstat_install(ksp);
+ return (ksp);
+}
+
+static int
+zone_misc_kstat_update(kstat_t *ksp, int rw)
+{
+ zone_t *zone = ksp->ks_private;
+ zone_misc_kstat_t *zmp = ksp->ks_data;
+ hrtime_t tmp;
+
+ if (rw == KSTAT_WRITE)
+ return (EACCES);
+
+ tmp = zone->zone_utime;
+ scalehrtime(&tmp);
+ zmp->zm_utime.value.ui64 = tmp;
+ tmp = zone->zone_stime;
+ scalehrtime(&tmp);
+ zmp->zm_stime.value.ui64 = tmp;
+ tmp = zone->zone_wtime;
+ scalehrtime(&tmp);
+ zmp->zm_wtime.value.ui64 = tmp;
+
+ zmp->zm_avenrun1.value.ui32 = zone->zone_avenrun[0];
+ zmp->zm_avenrun5.value.ui32 = zone->zone_avenrun[1];
+ zmp->zm_avenrun15.value.ui32 = zone->zone_avenrun[2];
+
+ zmp->zm_ffcap.value.ui32 = zone->zone_ffcap;
+ zmp->zm_ffnoproc.value.ui32 = zone->zone_ffnoproc;
+ zmp->zm_ffnomem.value.ui32 = zone->zone_ffnomem;
+ zmp->zm_ffmisc.value.ui32 = zone->zone_ffmisc;
+
+ return (0);
+}
+
+static kstat_t *
+zone_misc_kstat_create(zone_t *zone)
+{
+ kstat_t *ksp;
+ zone_misc_kstat_t *zmp;
+
+ if ((ksp = kstat_create_zone("zones", zone->zone_id,
+ zone->zone_name, "zone_misc", KSTAT_TYPE_NAMED,
+ sizeof (zone_misc_kstat_t) / sizeof (kstat_named_t),
+ KSTAT_FLAG_VIRTUAL, zone->zone_id)) == NULL)
+ return (NULL);
+
+ if (zone->zone_id != GLOBAL_ZONEID)
+ kstat_zone_add(ksp, GLOBAL_ZONEID);
+
+ zmp = ksp->ks_data = kmem_zalloc(sizeof (zone_misc_kstat_t), KM_SLEEP);
+ ksp->ks_data_size += strlen(zone->zone_name) + 1;
+ ksp->ks_lock = &zone->zone_misc_lock;
+ zone->zone_misc_stats = zmp;
+
+ /* The kstat "name" field is not large enough for a full zonename */
+ kstat_named_init(&zmp->zm_zonename, "zonename", KSTAT_DATA_STRING);
+ kstat_named_setstr(&zmp->zm_zonename, zone->zone_name);
+ kstat_named_init(&zmp->zm_utime, "nsec_user", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_stime, "nsec_sys", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_wtime, "nsec_waitrq", KSTAT_DATA_UINT64);
+ kstat_named_init(&zmp->zm_avenrun1, "avenrun_1min", KSTAT_DATA_UINT32);
+ kstat_named_init(&zmp->zm_avenrun5, "avenrun_5min", KSTAT_DATA_UINT32);
+ kstat_named_init(&zmp->zm_avenrun15, "avenrun_15min",
+ KSTAT_DATA_UINT32);
+ kstat_named_init(&zmp->zm_ffcap, "forkfail_cap", KSTAT_DATA_UINT32);
+ kstat_named_init(&zmp->zm_ffnoproc, "forkfail_noproc",
+ KSTAT_DATA_UINT32);
+ kstat_named_init(&zmp->zm_ffnomem, "forkfail_nomem", KSTAT_DATA_UINT32);
+ kstat_named_init(&zmp->zm_ffmisc, "forkfail_misc", KSTAT_DATA_UINT32);
+
+ ksp->ks_update = zone_misc_kstat_update;
+ ksp->ks_private = zone;
+
+ kstat_install(ksp);
+ return (ksp);
+}
+
static void
zone_kstat_create(zone_t *zone)
{
- zone->zone_lockedmem_kstat = zone_kstat_create_common(zone,
+ zone->zone_lockedmem_kstat = zone_rctl_kstat_create_common(zone,
"lockedmem", zone_lockedmem_kstat_update);
- zone->zone_swapresv_kstat = zone_kstat_create_common(zone,
+ zone->zone_swapresv_kstat = zone_rctl_kstat_create_common(zone,
"swapresv", zone_swapresv_kstat_update);
- zone->zone_nprocs_kstat = zone_kstat_create_common(zone,
+ zone->zone_physmem_kstat = zone_rctl_kstat_create_common(zone,
+ "physicalmem", zone_physmem_kstat_update);
+ zone->zone_nprocs_kstat = zone_rctl_kstat_create_common(zone,
"nprocs", zone_nprocs_kstat_update);
+
+ if ((zone->zone_vfs_ksp = zone_vfs_kstat_create(zone)) == NULL) {
+ zone->zone_vfs_stats = kmem_zalloc(
+ sizeof (zone_vfs_kstat_t), KM_SLEEP);
+ }
+
+ if ((zone->zone_zfs_ksp = zone_zfs_kstat_create(zone)) == NULL) {
+ zone->zone_zfs_stats = kmem_zalloc(
+ sizeof (zone_zfs_kstat_t), KM_SLEEP);
+ }
+
+ if ((zone->zone_mcap_ksp = zone_mcap_kstat_create(zone)) == NULL) {
+ zone->zone_mcap_stats = kmem_zalloc(
+ sizeof (zone_mcap_kstat_t), KM_SLEEP);
+ }
+
+ if ((zone->zone_misc_ksp = zone_misc_kstat_create(zone)) == NULL) {
+ zone->zone_misc_stats = kmem_zalloc(
+ sizeof (zone_misc_kstat_t), KM_SLEEP);
+ }
}
static void
-zone_kstat_delete_common(kstat_t **pkstat)
+zone_kstat_delete_common(kstat_t **pkstat, size_t datasz)
{
void *data;
if (*pkstat != NULL) {
data = (*pkstat)->ks_data;
kstat_delete(*pkstat);
- kmem_free(data, sizeof (zone_kstat_t));
+ kmem_free(data, datasz);
*pkstat = NULL;
}
}
@@ -1847,9 +2325,23 @@ zone_kstat_delete_common(kstat_t **pkstat)
static void
zone_kstat_delete(zone_t *zone)
{
- zone_kstat_delete_common(&zone->zone_lockedmem_kstat);
- zone_kstat_delete_common(&zone->zone_swapresv_kstat);
- zone_kstat_delete_common(&zone->zone_nprocs_kstat);
+ zone_kstat_delete_common(&zone->zone_lockedmem_kstat,
+ sizeof (zone_kstat_t));
+ zone_kstat_delete_common(&zone->zone_swapresv_kstat,
+ sizeof (zone_kstat_t));
+ zone_kstat_delete_common(&zone->zone_physmem_kstat,
+ sizeof (zone_kstat_t));
+ zone_kstat_delete_common(&zone->zone_nprocs_kstat,
+ sizeof (zone_kstat_t));
+
+ zone_kstat_delete_common(&zone->zone_vfs_ksp,
+ sizeof (zone_vfs_kstat_t));
+ zone_kstat_delete_common(&zone->zone_zfs_ksp,
+ sizeof (zone_zfs_kstat_t));
+ zone_kstat_delete_common(&zone->zone_mcap_ksp,
+ sizeof (zone_mcap_kstat_t));
+ zone_kstat_delete_common(&zone->zone_misc_ksp,
+ sizeof (zone_misc_kstat_t));
}
/*
@@ -1883,6 +2375,8 @@ zone_zsd_init(void)
zone0.zone_locked_mem_ctl = UINT64_MAX;
ASSERT(zone0.zone_max_swap == 0);
zone0.zone_max_swap_ctl = UINT64_MAX;
+ zone0.zone_phys_mem = 0;
+ zone0.zone_phys_mem_ctl = UINT64_MAX;
zone0.zone_max_lofi = 0;
zone0.zone_max_lofi_ctl = UINT64_MAX;
zone0.zone_shmmax = 0;
@@ -1906,7 +2400,13 @@ zone_zsd_init(void)
zone0.zone_initname = initname;
zone0.zone_lockedmem_kstat = NULL;
zone0.zone_swapresv_kstat = NULL;
+ zone0.zone_physmem_kstat = NULL;
zone0.zone_nprocs_kstat = NULL;
+ zone0.zone_zfs_io_pri = 1;
+ zone0.zone_stime = 0;
+ zone0.zone_utime = 0;
+ zone0.zone_wtime = 0;
+
list_create(&zone0.zone_ref_list, sizeof (zone_ref_t),
offsetof(zone_ref_t, zref_linkage));
list_create(&zone0.zone_zsd, sizeof (struct zsd_entry),
@@ -2013,6 +2513,21 @@ zone_init(void)
RCTL_GLOBAL_INFINITE,
MAXCAP, MAXCAP, &zone_cpu_cap_ops);
+ rc_zone_cpu_baseline = rctl_register("zone.cpu-baseline",
+ RCENTITY_ZONE, RCTL_GLOBAL_SIGNAL_NEVER | RCTL_GLOBAL_DENY_NEVER |
+ RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_COUNT | RCTL_GLOBAL_SYSLOG_NEVER,
+ MAXCAP, MAXCAP, &zone_cpu_base_ops);
+
+ rc_zone_cpu_burst_time = rctl_register("zone.cpu-burst-time",
+ RCENTITY_ZONE, RCTL_GLOBAL_SIGNAL_NEVER | RCTL_GLOBAL_DENY_NEVER |
+ RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_COUNT | RCTL_GLOBAL_SYSLOG_NEVER,
+ INT_MAX, INT_MAX, &zone_cpu_burst_time_ops);
+
+ rc_zone_zfs_io_pri = rctl_register("zone.zfs-io-priority",
+ RCENTITY_ZONE, RCTL_GLOBAL_SIGNAL_NEVER | RCTL_GLOBAL_DENY_NEVER |
+ RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_COUNT | RCTL_GLOBAL_SYSLOG_NEVER,
+ 1024, 1024, &zone_zfs_io_pri_ops);
+
rc_zone_nlwps = rctl_register("zone.max-lwps", RCENTITY_ZONE,
RCTL_GLOBAL_NOACTION | RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_COUNT,
INT_MAX, INT_MAX, &zone_lwps_ops);
@@ -2054,6 +2569,20 @@ zone_init(void)
rde = rctl_dict_lookup("zone.cpu-shares");
(void) rctl_val_list_insert(&rde->rcd_default_value, dval);
+ /*
+ * Create a rctl_val with PRIVILEGED, NOACTION, value = 1. Then attach
+ * this at the head of the rctl_dict_entry for ``zone.zfs-io-priority'.
+ */
+ dval = kmem_cache_alloc(rctl_val_cache, KM_SLEEP);
+ bzero(dval, sizeof (rctl_val_t));
+ dval->rcv_value = 1;
+ dval->rcv_privilege = RCPRIV_PRIVILEGED;
+ dval->rcv_flagaction = RCTL_LOCAL_NOACTION;
+ dval->rcv_action_recip_pid = -1;
+
+ rde = rctl_dict_lookup("zone.zfs-io-priority");
+ (void) rctl_val_list_insert(&rde->rcd_default_value, dval);
+
rc_zone_locked_mem = rctl_register("zone.max-locked-memory",
RCENTITY_ZONE, RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_BYTES |
RCTL_GLOBAL_DENY_ALWAYS, UINT64_MAX, UINT64_MAX,
@@ -2064,6 +2593,11 @@ zone_init(void)
RCTL_GLOBAL_DENY_ALWAYS, UINT64_MAX, UINT64_MAX,
&zone_max_swap_ops);
+ rc_zone_phys_mem = rctl_register("zone.max-physical-memory",
+ RCENTITY_ZONE, RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_BYTES |
+ RCTL_GLOBAL_DENY_ALWAYS, UINT64_MAX, UINT64_MAX,
+ &zone_phys_mem_ops);
+
rc_zone_max_lofi = rctl_register("zone.max-lofi",
RCENTITY_ZONE, RCTL_GLOBAL_NOBASIC | RCTL_GLOBAL_COUNT |
RCTL_GLOBAL_DENY_ALWAYS, UINT64_MAX, UINT64_MAX,
@@ -2236,12 +2770,18 @@ zone_free(zone_t *zone)
static void
zone_status_set(zone_t *zone, zone_status_t status)
{
+ timestruc_t now;
+ uint64_t t;
nvlist_t *nvl = NULL;
ASSERT(MUTEX_HELD(&zone_status_lock));
ASSERT(status > ZONE_MIN_STATE && status <= ZONE_MAX_STATE &&
status >= zone_status_get(zone));
+ /* Current time since Jan 1 1970 but consumers expect NS */
+ gethrestime(&now);
+ t = (now.tv_sec * NANOSEC) + now.tv_nsec;
+
if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP) ||
nvlist_add_string(nvl, ZONE_CB_NAME, zone->zone_name) ||
nvlist_add_string(nvl, ZONE_CB_NEWSTATE,
@@ -2249,7 +2789,7 @@ zone_status_set(zone_t *zone, zone_status_t status)
nvlist_add_string(nvl, ZONE_CB_OLDSTATE,
zone_status_table[zone->zone_status]) ||
nvlist_add_int32(nvl, ZONE_CB_ZONEID, zone->zone_id) ||
- nvlist_add_uint64(nvl, ZONE_CB_TIMESTAMP, (uint64_t)gethrtime()) ||
+ nvlist_add_uint64(nvl, ZONE_CB_TIMESTAMP, t) ||
sysevent_evc_publish(zone_event_chan, ZONE_EVENT_STATUS_CLASS,
ZONE_EVENT_STATUS_SUBCLASS, "sun.com", "kernel", nvl, EVCH_SLEEP)) {
#ifdef DEBUG
@@ -2375,14 +2915,65 @@ zone_set_initname(zone_t *zone, const char *zone_initname)
return (0);
}
+/*
+ * The zone_set_mcap_nover and zone_set_mcap_pageout functions are used
+ * to provide the physical memory capping kstats. Since physical memory
+ * capping is currently implemented in userland, that code uses the setattr
+ * entry point to increment the kstats. We always simply increment nover
+ * every time that setattr is called and we always add in the input value
+ * to zone_mcap_pagedout every time that is called.
+ */
+/*ARGSUSED*/
static int
-zone_set_phys_mcap(zone_t *zone, const uint64_t *zone_mcap)
+zone_set_mcap_nover(zone_t *zone, const uint64_t *zone_nover)
{
- uint64_t mcap;
- int err = 0;
+ zone->zone_mcap_nover++;
+
+ return (0);
+}
+
+static int
+zone_set_mcap_pageout(zone_t *zone, const uint64_t *zone_pageout)
+{
+ uint64_t pageout;
+ int err;
+
+ if ((err = copyin(zone_pageout, &pageout, sizeof (uint64_t))) == 0)
+ zone->zone_mcap_pagedout += pageout;
+
+ return (err);
+}
+
+/*
+ * The zone_set_page_fault_delay function is used to set the number of usecs
+ * to throttle page faults. This is normally 0 but can be set to a non-0 value
+ * by the user-land memory capping code when the zone is over its physcial
+ * memory cap.
+ */
+static int
+zone_set_page_fault_delay(zone_t *zone, const uint32_t *pfdelay)
+{
+ uint32_t dusec;
+ int err;
- if ((err = copyin(zone_mcap, &mcap, sizeof (uint64_t))) == 0)
- zone->zone_phys_mcap = mcap;
+ if ((err = copyin(pfdelay, &dusec, sizeof (uint32_t))) == 0)
+ zone->zone_pg_flt_delay = dusec;
+
+ return (err);
+}
+
+/*
+ * The zone_set_rss function is used to set the zone's RSS when we do the
+ * fast, approximate calculation in user-land.
+ */
+static int
+zone_set_rss(zone_t *zone, const uint64_t *prss)
+{
+ uint64_t rss;
+ int err;
+
+ if ((err = copyin(prss, &rss, sizeof (uint64_t))) == 0)
+ zone->zone_phys_mem = rss;
return (err);
}
@@ -2794,6 +3385,12 @@ getzoneid(void)
return (curproc->p_zone->zone_id);
}
+zoneid_t
+getzonedid(void)
+{
+ return (curproc->p_zone->zone_did);
+}
+
/*
* Internal versions of zone_find_by_*(). These don't zone_hold() or
* check the validity of a zone's state.
@@ -2977,6 +3574,92 @@ zone_find_by_path(const char *path)
}
/*
+ * Public interface for updating per-zone load averages. Called once per
+ * second.
+ *
+ * Based on loadavg_update(), genloadavg() and calcloadavg() from clock.c.
+ */
+void
+zone_loadavg_update()
+{
+ zone_t *zp;
+ zone_status_t status;
+ struct loadavg_s *lavg;
+ hrtime_t zone_total;
+ int i;
+ hrtime_t hr_avg;
+ int nrun;
+ static int64_t f[3] = { 135, 27, 9 };
+ int64_t q, r;
+
+ mutex_enter(&zonehash_lock);
+ for (zp = list_head(&zone_active); zp != NULL;
+ zp = list_next(&zone_active, zp)) {
+ mutex_enter(&zp->zone_lock);
+
+ /* Skip zones that are on the way down or not yet up */
+ status = zone_status_get(zp);
+ if (status < ZONE_IS_READY || status >= ZONE_IS_DOWN) {
+ /* For all practical purposes the zone doesn't exist. */
+ mutex_exit(&zp->zone_lock);
+ continue;
+ }
+
+ /*
+ * Update the 10 second moving average data in zone_loadavg.
+ */
+ lavg = &zp->zone_loadavg;
+
+ zone_total = zp->zone_utime + zp->zone_stime + zp->zone_wtime;
+ scalehrtime(&zone_total);
+
+ /* The zone_total should always be increasing. */
+ lavg->lg_loads[lavg->lg_cur] = (zone_total > lavg->lg_total) ?
+ zone_total - lavg->lg_total : 0;
+ lavg->lg_cur = (lavg->lg_cur + 1) % S_LOADAVG_SZ;
+ /* lg_total holds the prev. 1 sec. total */
+ lavg->lg_total = zone_total;
+
+ /*
+ * To simplify the calculation, we don't calculate the load avg.
+ * until the zone has been up for at least 10 seconds and our
+ * moving average is thus full.
+ */
+ if ((lavg->lg_len + 1) < S_LOADAVG_SZ) {
+ lavg->lg_len++;
+ mutex_exit(&zp->zone_lock);
+ continue;
+ }
+
+ /* Now calculate the 1min, 5min, 15 min load avg. */
+ hr_avg = 0;
+ for (i = 0; i < S_LOADAVG_SZ; i++)
+ hr_avg += lavg->lg_loads[i];
+ hr_avg = hr_avg / S_LOADAVG_SZ;
+ nrun = hr_avg / (NANOSEC / LGRP_LOADAVG_IN_THREAD_MAX);
+
+ /* Compute load avg. See comment in calcloadavg() */
+ for (i = 0; i < 3; i++) {
+ q = (zp->zone_hp_avenrun[i] >> 16) << 7;
+ r = (zp->zone_hp_avenrun[i] & 0xffff) << 7;
+ zp->zone_hp_avenrun[i] +=
+ ((nrun - q) * f[i] - ((r * f[i]) >> 16)) >> 4;
+
+ /* avenrun[] can only hold 31 bits of load avg. */
+ if (zp->zone_hp_avenrun[i] <
+ ((uint64_t)1<<(31+16-FSHIFT)))
+ zp->zone_avenrun[i] = (int32_t)
+ (zp->zone_hp_avenrun[i] >> (16 - FSHIFT));
+ else
+ zp->zone_avenrun[i] = 0x7fffffff;
+ }
+
+ mutex_exit(&zp->zone_lock);
+ }
+ mutex_exit(&zonehash_lock);
+}
+
+/*
* Get the number of cpus visible to this zone. The system-wide global
* 'ncpus' is returned if pools are disabled, the caller is in the
* global zone, or a NULL zone argument is passed in.
@@ -4084,7 +4767,7 @@ zone_create(const char *zone_name, const char *zone_root,
caddr_t rctlbuf, size_t rctlbufsz,
caddr_t zfsbuf, size_t zfsbufsz, int *extended_error,
int match, uint32_t doi, const bslabel_t *label,
- int flags)
+ int flags, zoneid_t zone_did)
{
struct zsched_arg zarg;
nvlist_t *rctls = NULL;
@@ -4107,6 +4790,7 @@ zone_create(const char *zone_name, const char *zone_root,
zone = kmem_zalloc(sizeof (zone_t), KM_SLEEP);
zoneid = zone->zone_id = id_alloc(zoneid_space);
+ zone->zone_did = zone_did;
zone->zone_status = ZONE_IS_UNINITIALIZED;
zone->zone_pool = pool_default;
zone->zone_pool_mod = gethrtime();
@@ -4175,10 +4859,14 @@ zone_create(const char *zone_name, const char *zone_root,
zone->zone_locked_mem_ctl = UINT64_MAX;
zone->zone_max_swap = 0;
zone->zone_max_swap_ctl = UINT64_MAX;
+ zone->zone_phys_mem = 0;
+ zone->zone_phys_mem_ctl = UINT64_MAX;
zone->zone_max_lofi = 0;
zone->zone_max_lofi_ctl = UINT64_MAX;
- zone0.zone_lockedmem_kstat = NULL;
- zone0.zone_swapresv_kstat = NULL;
+ zone->zone_lockedmem_kstat = NULL;
+ zone->zone_swapresv_kstat = NULL;
+ zone->zone_physmem_kstat = NULL;
+ zone->zone_zfs_io_pri = 1;
/*
* Zsched initializes the rctls.
@@ -4232,7 +4920,7 @@ zone_create(const char *zone_name, const char *zone_root,
return (zone_create_error(error, 0, extended_error));
}
- if (block_mounts() == 0) {
+ if (block_mounts(zone) == 0) {
mutex_enter(&pp->p_lock);
if (curthread != pp->p_agenttp)
continuelwps(pp);
@@ -4383,7 +5071,7 @@ zone_create(const char *zone_name, const char *zone_root,
/*
* The zone is fully visible, so we can let mounts progress.
*/
- resume_mounts();
+ resume_mounts(zone);
if (rctls)
nvlist_free(rctls);
@@ -4399,7 +5087,7 @@ errout:
continuelwps(pp);
mutex_exit(&pp->p_lock);
- resume_mounts();
+ resume_mounts(zone);
if (rctls)
nvlist_free(rctls);
/*
@@ -4477,6 +5165,7 @@ zone_boot(zoneid_t zoneid)
static int
zone_empty(zone_t *zone)
{
+ int cnt = 0;
int waitstatus;
/*
@@ -4487,7 +5176,16 @@ zone_empty(zone_t *zone)
ASSERT(MUTEX_NOT_HELD(&zonehash_lock));
while ((waitstatus = zone_status_timedwait_sig(zone,
ddi_get_lbolt() + hz, ZONE_IS_EMPTY)) == -1) {
- killall(zone->zone_id);
+ boolean_t force = B_FALSE;
+
+ /* Every 30 seconds, try harder */
+ if (cnt++ >= 30) {
+ cmn_err(CE_WARN, "attempt to force kill zone %d\n",
+ zone->zone_id);
+ force = B_TRUE;
+ cnt = 0;
+ }
+ killall(zone->zone_id, force);
}
/*
* return EINTR if we were signaled
@@ -4554,15 +5252,6 @@ zone_shutdown(zoneid_t zoneid)
if (zoneid < MIN_USERZONEID || zoneid > MAX_ZONEID)
return (set_errno(EINVAL));
- /*
- * Block mounts so that VFS_MOUNT() can get an accurate view of
- * the zone's status with regards to ZONE_IS_SHUTTING down.
- *
- * e.g. NFS can fail the mount if it determines that the zone
- * has already begun the shutdown sequence.
- */
- if (block_mounts() == 0)
- return (set_errno(EINTR));
mutex_enter(&zonehash_lock);
/*
* Look for zone under hash lock to prevent races with other
@@ -4570,9 +5259,30 @@ zone_shutdown(zoneid_t zoneid)
*/
if ((zone = zone_find_all_by_id(zoneid)) == NULL) {
mutex_exit(&zonehash_lock);
- resume_mounts();
return (set_errno(EINVAL));
}
+
+ /*
+ * We have to drop zonehash_lock before calling block_mounts.
+ * Hold the zone so we can continue to use the zone_t.
+ */
+ zone_hold(zone);
+ mutex_exit(&zonehash_lock);
+
+ /*
+ * Block mounts so that VFS_MOUNT() can get an accurate view of
+ * the zone's status with regards to ZONE_IS_SHUTTING down.
+ *
+ * e.g. NFS can fail the mount if it determines that the zone
+ * has already begun the shutdown sequence.
+ *
+ */
+ if (block_mounts(zone) == 0) {
+ zone_rele(zone);
+ return (set_errno(EINTR));
+ }
+
+ mutex_enter(&zonehash_lock);
mutex_enter(&zone_status_lock);
status = zone_status_get(zone);
/*
@@ -4581,7 +5291,8 @@ zone_shutdown(zoneid_t zoneid)
if (status < ZONE_IS_READY) {
mutex_exit(&zone_status_lock);
mutex_exit(&zonehash_lock);
- resume_mounts();
+ resume_mounts(zone);
+ zone_rele(zone);
return (set_errno(EINVAL));
}
/*
@@ -4591,7 +5302,8 @@ zone_shutdown(zoneid_t zoneid)
if (status >= ZONE_IS_DOWN) {
mutex_exit(&zone_status_lock);
mutex_exit(&zonehash_lock);
- resume_mounts();
+ resume_mounts(zone);
+ zone_rele(zone);
return (0);
}
/*
@@ -4626,10 +5338,9 @@ zone_shutdown(zoneid_t zoneid)
}
}
}
- zone_hold(zone); /* so we can use the zone_t later */
mutex_exit(&zone_status_lock);
mutex_exit(&zonehash_lock);
- resume_mounts();
+ resume_mounts(zone);
if (error = zone_empty(zone)) {
zone_rele(zone);
@@ -5225,14 +5936,6 @@ zone_getattr(zoneid_t zoneid, int attr, void *buf, size_t bufsize)
error = EFAULT;
}
break;
- case ZONE_ATTR_PHYS_MCAP:
- size = sizeof (zone->zone_phys_mcap);
- if (bufsize > size)
- bufsize = size;
- if (buf != NULL &&
- copyout(&zone->zone_phys_mcap, buf, bufsize) != 0)
- error = EFAULT;
- break;
case ZONE_ATTR_SCHED_CLASS:
mutex_enter(&class_lock);
@@ -5287,6 +5990,14 @@ zone_getattr(zoneid_t zoneid, int attr, void *buf, size_t bufsize)
}
kmem_free(zbuf, bufsize);
break;
+ case ZONE_ATTR_DID:
+ size = sizeof (zoneid_t);
+ if (bufsize > size)
+ bufsize = size;
+
+ if (buf != NULL && copyout(&zone->zone_did, buf, bufsize) != 0)
+ error = EFAULT;
+ break;
default:
if ((attr >= ZONE_ATTR_BRAND_ATTRS) && ZONE_IS_BRANDED(zone)) {
size = bufsize;
@@ -5318,10 +6029,11 @@ zone_setattr(zoneid_t zoneid, int attr, void *buf, size_t bufsize)
return (set_errno(EPERM));
/*
- * Only the ZONE_ATTR_PHYS_MCAP attribute can be set on the
- * global zone.
+ * Only the ZONE_ATTR_PMCAP_NOVER and ZONE_ATTR_PMCAP_PAGEOUT
+ * attributes can be set on the global zone.
*/
- if (zoneid == GLOBAL_ZONEID && attr != ZONE_ATTR_PHYS_MCAP) {
+ if (zoneid == GLOBAL_ZONEID &&
+ attr != ZONE_ATTR_PMCAP_NOVER && attr != ZONE_ATTR_PMCAP_PAGEOUT) {
return (set_errno(EINVAL));
}
@@ -5338,7 +6050,9 @@ zone_setattr(zoneid_t zoneid, int attr, void *buf, size_t bufsize)
* non-global zones.
*/
zone_status = zone_status_get(zone);
- if (attr != ZONE_ATTR_PHYS_MCAP && zone_status > ZONE_IS_READY) {
+ if (attr != ZONE_ATTR_PMCAP_NOVER && attr != ZONE_ATTR_PMCAP_PAGEOUT &&
+ attr != ZONE_ATTR_PG_FLT_DELAY && attr != ZONE_ATTR_RSS &&
+ zone_status > ZONE_IS_READY) {
err = EINVAL;
goto done;
}
@@ -5347,6 +6061,10 @@ zone_setattr(zoneid_t zoneid, int attr, void *buf, size_t bufsize)
case ZONE_ATTR_INITNAME:
err = zone_set_initname(zone, (const char *)buf);
break;
+ case ZONE_ATTR_INITNORESTART:
+ zone->zone_restart_init = B_FALSE;
+ err = 0;
+ break;
case ZONE_ATTR_BOOTARGS:
err = zone_set_bootargs(zone, (const char *)buf);
break;
@@ -5356,8 +6074,17 @@ zone_setattr(zoneid_t zoneid, int attr, void *buf, size_t bufsize)
case ZONE_ATTR_FS_ALLOWED:
err = zone_set_fs_allowed(zone, (const char *)buf);
break;
- case ZONE_ATTR_PHYS_MCAP:
- err = zone_set_phys_mcap(zone, (const uint64_t *)buf);
+ case ZONE_ATTR_PMCAP_NOVER:
+ err = zone_set_mcap_nover(zone, (const uint64_t *)buf);
+ break;
+ case ZONE_ATTR_PMCAP_PAGEOUT:
+ err = zone_set_mcap_pageout(zone, (const uint64_t *)buf);
+ break;
+ case ZONE_ATTR_PG_FLT_DELAY:
+ err = zone_set_page_fault_delay(zone, (const uint32_t *)buf);
+ break;
+ case ZONE_ATTR_RSS:
+ err = zone_set_rss(zone, (const uint64_t *)buf);
break;
case ZONE_ATTR_SCHED_CLASS:
err = zone_set_sched_class(zone, (const char *)buf);
@@ -6078,6 +6805,7 @@ zone(int cmd, void *arg1, void *arg2, void *arg3, void *arg4)
zs.doi = zs32.doi;
zs.label = (const bslabel_t *)(uintptr_t)zs32.label;
zs.flags = zs32.flags;
+ zs.zoneid = zs32.zoneid;
#else
panic("get_udatamodel() returned bogus result\n");
#endif
@@ -6088,7 +6816,7 @@ zone(int cmd, void *arg1, void *arg2, void *arg3, void *arg4)
(caddr_t)zs.rctlbuf, zs.rctlbufsz,
(caddr_t)zs.zfsbuf, zs.zfsbufsz,
zs.extended_error, zs.match, zs.doi,
- zs.label, zs.flags));
+ zs.label, zs.flags, zs.zoneid));
case ZONE_BOOT:
return (zone_boot((zoneid_t)(uintptr_t)arg1));
case ZONE_DESTROY:
@@ -6366,7 +7094,7 @@ zone_kadmin(int cmd, int fcn, const char *mdep, cred_t *credp)
* zone_ki_call_zoneadmd() will do a more thorough job of this
* later.
*/
- killall(zone->zone_id);
+ killall(zone->zone_id, B_FALSE);
/*
* Now, create the thread to contact zoneadmd and do the rest of the
* work. This thread can't be created in our zone otherwise
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile
index 656494c228..08d82726d6 100644
--- a/usr/src/uts/common/sys/Makefile
+++ b/usr/src/uts/common/sys/Makefile
@@ -859,6 +859,8 @@ FSHDRS= \
hsfs_rrip.h \
hsfs_spec.h \
hsfs_susp.h \
+ hyprlofs.h \
+ hyprlofs_info.h \
lofs_info.h \
lofs_node.h \
mntdata.h \
diff --git a/usr/src/uts/common/sys/aggr_impl.h b/usr/src/uts/common/sys/aggr_impl.h
index 8363d231cf..e0cfd6f778 100644
--- a/usr/src/uts/common/sys/aggr_impl.h
+++ b/usr/src/uts/common/sys/aggr_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 OmniTI Computer Consulting, Inc All rights reserved.
*/
#ifndef _SYS_AGGR_IMPL_H
@@ -307,6 +308,8 @@ extern boolean_t aggr_port_notify_link(aggr_grp_t *, aggr_port_t *);
extern void aggr_port_init_callbacks(aggr_port_t *);
extern void aggr_recv_cb(void *, mac_resource_handle_t, mblk_t *, boolean_t);
+extern void aggr_recv_promisc_cb(void *, mac_resource_handle_t, mblk_t *,
+ boolean_t);
extern void aggr_tx_ring_update(void *, uintptr_t);
extern void aggr_tx_notify_thread(void *);
diff --git a/usr/src/uts/common/sys/buf.h b/usr/src/uts/common/sys/buf.h
index a9191aed7c..cb8a6012fc 100644
--- a/usr/src/uts/common/sys/buf.h
+++ b/usr/src/uts/common/sys/buf.h
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -186,6 +187,7 @@ struct biostats {
#define B_STARTED 0x2000000 /* io:::start probe called for buf */
#define B_ABRWRITE 0x4000000 /* Application based recovery active */
#define B_PAGE_NOWAIT 0x8000000 /* Skip the page if it is locked */
+#define B_INVALCURONLY 0x10000000 /* invalidate only for curproc */
/*
* There is some confusion over the meaning of B_FREE and B_INVAL and what
@@ -198,6 +200,12 @@ struct biostats {
* between the sole use of these two flags. In both cases, IO will be done
* if the page is not yet committed to storage.
*
+ * The B_INVALCURONLY flag modifies the behavior of the B_INVAL flag and is
+ * intended to be used in conjunction with B_INVAL. B_INVALCURONLY has no
+ * meaning on its own. When both B_INVALCURONLY and B_INVAL are set, then
+ * the mapping for the page is only invalidated for the current process.
+ * In this case, the page is not destroyed unless this was the final mapping.
+ *
* In order to discard pages without writing them back, (B_INVAL | B_TRUNC)
* should be used.
*
diff --git a/usr/src/uts/common/sys/cpucaps.h b/usr/src/uts/common/sys/cpucaps.h
index 6063ff4380..6bc042108c 100644
--- a/usr/src/uts/common/sys/cpucaps.h
+++ b/usr/src/uts/common/sys/cpucaps.h
@@ -22,6 +22,7 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011, 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_CPUCAPS_H
@@ -84,12 +85,16 @@ extern void cpucaps_zone_remove(zone_t *);
*/
extern int cpucaps_project_set(kproject_t *, rctl_qty_t);
extern int cpucaps_zone_set(zone_t *, rctl_qty_t);
+extern int cpucaps_zone_set_base(zone_t *, rctl_qty_t);
+extern int cpucaps_zone_set_burst_time(zone_t *, rctl_qty_t);
/*
* Get current CPU usage for a project/zone.
*/
extern rctl_qty_t cpucaps_project_get(kproject_t *);
extern rctl_qty_t cpucaps_zone_get(zone_t *);
+extern rctl_qty_t cpucaps_zone_get_base(zone_t *);
+extern rctl_qty_t cpucaps_zone_get_burst_time(zone_t *);
/*
* Scheduling class hooks into CPU caps framework.
diff --git a/usr/src/uts/common/sys/cpucaps_impl.h b/usr/src/uts/common/sys/cpucaps_impl.h
index 95afd21827..2cd4ed644d 100644
--- a/usr/src/uts/common/sys/cpucaps_impl.h
+++ b/usr/src/uts/common/sys/cpucaps_impl.h
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011, 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_CPUCAPS_IMPL_H
@@ -66,8 +67,12 @@ typedef struct cpucap {
waitq_t cap_waitq; /* waitq for capped threads */
kstat_t *cap_kstat; /* cpucaps specific kstat */
int64_t cap_gen; /* zone cap specific */
+ hrtime_t cap_chk_value; /* effective CPU usage cap */
hrtime_t cap_value; /* scaled CPU usage cap */
hrtime_t cap_usage; /* current CPU usage */
+ hrtime_t cap_base; /* base CPU for burst */
+ u_longlong_t cap_burst_limit; /* max secs (in tics) for a burst */
+ u_longlong_t cap_bursting; /* # of ticks currently bursting */
disp_lock_t cap_usagelock; /* protects cap_usage above */
/*
* Per cap statistics.
@@ -75,6 +80,7 @@ typedef struct cpucap {
hrtime_t cap_maxusage; /* maximum cap usage */
u_longlong_t cap_below; /* # of ticks spend below the cap */
u_longlong_t cap_above; /* # of ticks spend above the cap */
+ u_longlong_t cap_above_base; /* # of ticks spent above the base */
} cpucap_t;
/*
diff --git a/usr/src/uts/common/sys/cred.h b/usr/src/uts/common/sys/cred.h
index 5056f9a511..914f132dc0 100644
--- a/usr/src/uts/common/sys/cred.h
+++ b/usr/src/uts/common/sys/cred.h
@@ -93,6 +93,7 @@ extern gid_t crgetgid(const cred_t *);
extern gid_t crgetrgid(const cred_t *);
extern gid_t crgetsgid(const cred_t *);
extern zoneid_t crgetzoneid(const cred_t *);
+extern zoneid_t crgetzonedid(const cred_t *);
extern projid_t crgetprojid(const cred_t *);
extern cred_t *crgetmapped(const cred_t *);
diff --git a/usr/src/uts/common/sys/ctf_api.h b/usr/src/uts/common/sys/ctf_api.h
index c08acf1950..04d73c3181 100644
--- a/usr/src/uts/common/sys/ctf_api.h
+++ b/usr/src/uts/common/sys/ctf_api.h
@@ -24,7 +24,7 @@
* Use is subject to license terms.
*/
/*
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
@@ -151,6 +151,7 @@ extern ctf_file_t *ctf_bufopen(const ctf_sect_t *, const ctf_sect_t *,
extern ctf_file_t *ctf_fdopen(int, int *);
extern ctf_file_t *ctf_open(const char *, int *);
extern ctf_file_t *ctf_create(int *);
+extern ctf_file_t *ctf_dup(ctf_file_t *);
extern void ctf_close(ctf_file_t *);
extern ctf_file_t *ctf_parent_file(ctf_file_t *);
@@ -176,6 +177,8 @@ extern ctf_id_t ctf_lookup_by_symbol(ctf_file_t *, ulong_t);
extern ctf_id_t ctf_type_resolve(ctf_file_t *, ctf_id_t);
extern ssize_t ctf_type_lname(ctf_file_t *, ctf_id_t, char *, size_t);
extern char *ctf_type_name(ctf_file_t *, ctf_id_t, char *, size_t);
+extern char *ctf_type_qname(ctf_file_t *, ctf_id_t, char *, size_t,
+ const char *);
extern ssize_t ctf_type_size(ctf_file_t *, ctf_id_t);
extern ssize_t ctf_type_align(ctf_file_t *, ctf_id_t);
extern int ctf_type_kind(ctf_file_t *, ctf_id_t);
diff --git a/usr/src/uts/common/sys/dktp/dadk.h b/usr/src/uts/common/sys/dktp/dadk.h
index f5c990e7c0..2178ad1f0d 100644
--- a/usr/src/uts/common/sys/dktp/dadk.h
+++ b/usr/src/uts/common/sys/dktp/dadk.h
@@ -65,6 +65,8 @@ struct dadk {
kstat_t *dad_errstats; /* error stats */
kmutex_t dad_cmd_mutex;
int dad_cmd_count;
+ uint32_t dad_err_cnt; /* number of recent errors */
+ hrtime_t dad_last_log; /* time of last error log */
};
#define DAD_SECSIZ dad_phyg.g_secsiz
diff --git a/usr/src/uts/common/sys/dld.h b/usr/src/uts/common/sys/dld.h
index fb2a0749d3..303a9c7e45 100644
--- a/usr/src/uts/common/sys/dld.h
+++ b/usr/src/uts/common/sys/dld.h
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_DLD_H
@@ -191,6 +192,7 @@ typedef struct dld_ioc_rename {
datalink_id_t dir_linkid1;
datalink_id_t dir_linkid2;
char dir_link[MAXLINKNAMELEN];
+ boolean_t dir_zoneinit;
} dld_ioc_rename_t;
/*
@@ -203,6 +205,7 @@ typedef struct dld_ioc_rename {
typedef struct dld_ioc_zid {
zoneid_t diz_zid;
datalink_id_t diz_linkid;
+ boolean_t diz_transient;
} dld_ioc_zid_t;
/*
diff --git a/usr/src/uts/common/sys/dls.h b/usr/src/uts/common/sys/dls.h
index 6bd2bbe35a..adcfe76c08 100644
--- a/usr/src/uts/common/sys/dls.h
+++ b/usr/src/uts/common/sys/dls.h
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_DLS_H
@@ -110,7 +111,7 @@ extern void dls_devnet_close(dls_dl_handle_t);
extern boolean_t dls_devnet_rebuild();
extern int dls_devnet_rename(datalink_id_t, datalink_id_t,
- const char *);
+ const char *, boolean_t);
extern int dls_devnet_create(mac_handle_t, datalink_id_t,
zoneid_t);
extern int dls_devnet_destroy(mac_handle_t, datalink_id_t *,
@@ -127,7 +128,7 @@ extern uint16_t dls_devnet_vid(dls_dl_handle_t);
extern datalink_id_t dls_devnet_linkid(dls_dl_handle_t);
extern int dls_devnet_dev2linkid(dev_t, datalink_id_t *);
extern int dls_devnet_phydev(datalink_id_t, dev_t *);
-extern int dls_devnet_setzid(dls_dl_handle_t, zoneid_t);
+extern int dls_devnet_setzid(dls_dl_handle_t, zoneid_t, boolean_t);
extern zoneid_t dls_devnet_getzid(dls_dl_handle_t);
extern zoneid_t dls_devnet_getownerzid(dls_dl_handle_t);
extern boolean_t dls_devnet_islinkvisible(datalink_id_t, zoneid_t);
diff --git a/usr/src/uts/common/sys/dls_impl.h b/usr/src/uts/common/sys/dls_impl.h
index 60f51c47b5..8f7af6856c 100644
--- a/usr/src/uts/common/sys/dls_impl.h
+++ b/usr/src/uts/common/sys/dls_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_DLS_IMPL_H
@@ -96,7 +97,8 @@ extern void dls_create_str_kstats(dld_str_t *);
extern int dls_stat_update(kstat_t *, dls_link_t *, int);
extern int dls_stat_create(const char *, int, const char *,
zoneid_t, int (*)(struct kstat *, int), void *,
- kstat_t **);
+ kstat_t **, zoneid_t);
+extern void dls_stat_delete(kstat_t *);
extern int dls_devnet_open_by_dev(dev_t, dls_link_t **,
dls_dl_handle_t *);
diff --git a/usr/src/uts/common/sys/dls_mgmt.h b/usr/src/uts/common/sys/dls_mgmt.h
index b4032c24d6..4f73d92118 100644
--- a/usr/src/uts/common/sys/dls_mgmt.h
+++ b/usr/src/uts/common/sys/dls_mgmt.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#ifndef _DLS_MGMT_H
@@ -165,6 +166,7 @@ typedef struct dlmgmt_door_getname {
typedef struct dlmgmt_door_getlinkid {
int ld_cmd;
char ld_link[MAXLINKNAMELEN];
+ zoneid_t ld_zoneid;
} dlmgmt_door_getlinkid_t;
typedef struct dlmgmt_door_getnext_s {
diff --git a/usr/src/uts/common/sys/dtrace.h b/usr/src/uts/common/sys/dtrace.h
index fd7612f88a..3b1869a4ff 100644
--- a/usr/src/uts/common/sys/dtrace.h
+++ b/usr/src/uts/common/sys/dtrace.h
@@ -25,8 +25,8 @@
*/
/*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#ifndef _SYS_DTRACE_H
@@ -288,8 +288,11 @@ typedef enum dtrace_probespec {
#define DIF_SUBR_INET_NTOA6 43
#define DIF_SUBR_TOUPPER 44
#define DIF_SUBR_TOLOWER 45
+#define DIF_SUBR_GETF 46
+#define DIF_SUBR_JSON 47
+#define DIF_SUBR_STRTOLL 48
-#define DIF_SUBR_MAX 45 /* max subroutine value */
+#define DIF_SUBR_MAX 48 /* max subroutine value */
typedef uint32_t dif_instr_t;
@@ -351,6 +354,7 @@ typedef struct dtrace_diftype {
#define DIF_TYPE_STRING 1 /* type is a D string */
#define DIF_TF_BYREF 0x1 /* type is passed by reference */
+#define DIF_TF_BYUREF 0x2 /* user type is passed by reference */
/*
* A DTrace Intermediate Format variable record is used to describe each of the
@@ -1019,7 +1023,11 @@ typedef struct dtrace_fmtdesc {
#define DTRACEOPT_AGGSORTPOS 25 /* agg. position to sort on */
#define DTRACEOPT_AGGSORTKEYPOS 26 /* agg. key position to sort on */
#define DTRACEOPT_TEMPORAL 27 /* temporally ordered output */
-#define DTRACEOPT_MAX 28 /* number of options */
+#define DTRACEOPT_AGGHIST 28 /* histogram aggregation output */
+#define DTRACEOPT_AGGPACK 29 /* packed aggregation output */
+#define DTRACEOPT_AGGZOOM 30 /* zoomed aggregation scaling */
+#define DTRACEOPT_ZONE 31 /* zone in which to enable probes */
+#define DTRACEOPT_MAX 32 /* number of options */
#define DTRACEOPT_UNSET (dtrace_optval_t)-2 /* unset option */
@@ -1649,13 +1657,20 @@ typedef struct dof_helper {
*
* A bitwise OR that encapsulates both the mode (either DTRACE_MODE_KERNEL
* or DTRACE_MODE_USER) and the policy when the privilege of the enabling
- * is insufficient for that mode (either DTRACE_MODE_NOPRIV_DROP or
- * DTRACE_MODE_NOPRIV_RESTRICT). If the policy is DTRACE_MODE_NOPRIV_DROP,
- * insufficient privilege will result in the probe firing being silently
- * ignored for the enabling; if the policy is DTRACE_NODE_NOPRIV_RESTRICT,
- * insufficient privilege will not prevent probe processing for the
- * enabling, but restrictions will be in place that induce a UPRIV fault
- * upon attempt to examine probe arguments or current process state.
+ * is insufficient for that mode (a combination of DTRACE_MODE_NOPRIV_DROP,
+ * DTRACE_MODE_NOPRIV_RESTRICT, and DTRACE_MODE_LIMITEDPRIV_RESTRICT). If
+ * DTRACE_MODE_NOPRIV_DROP bit is set, insufficient privilege will result
+ * in the probe firing being silently ignored for the enabling; if the
+ * DTRACE_NODE_NOPRIV_RESTRICT bit is set, insufficient privilege will not
+ * prevent probe processing for the enabling, but restrictions will be in
+ * place that induce a UPRIV fault upon attempt to examine probe arguments
+ * or current process state. If the DTRACE_MODE_LIMITEDPRIV_RESTRICT bit
+ * is set, similar restrictions will be placed upon operation if the
+ * privilege is sufficient to process the enabling, but does not otherwise
+ * entitle the enabling to all zones. The DTRACE_MODE_NOPRIV_DROP and
+ * DTRACE_MODE_NOPRIV_RESTRICT are mutually exclusive (and one of these
+ * two policies must be specified), but either may be combined (or not)
+ * with DTRACE_MODE_LIMITEDPRIV_RESTRICT.
*
* 1.10.4 Caller's context
*
@@ -2054,6 +2069,7 @@ typedef struct dtrace_pops {
#define DTRACE_MODE_USER 0x02
#define DTRACE_MODE_NOPRIV_DROP 0x10
#define DTRACE_MODE_NOPRIV_RESTRICT 0x20
+#define DTRACE_MODE_LIMITEDPRIV_RESTRICT 0x40
typedef uintptr_t dtrace_provider_id_t;
@@ -2268,6 +2284,7 @@ extern void (*dtrace_helpers_cleanup)();
extern void (*dtrace_helpers_fork)(proc_t *parent, proc_t *child);
extern void (*dtrace_cpustart_init)();
extern void (*dtrace_cpustart_fini)();
+extern void (*dtrace_closef)();
extern void (*dtrace_debugger_init)();
extern void (*dtrace_debugger_fini)();
diff --git a/usr/src/uts/common/sys/dtrace_impl.h b/usr/src/uts/common/sys/dtrace_impl.h
index d780082137..f79bf1e42e 100644
--- a/usr/src/uts/common/sys/dtrace_impl.h
+++ b/usr/src/uts/common/sys/dtrace_impl.h
@@ -924,6 +924,7 @@ typedef struct dtrace_mstate {
uintptr_t dtms_strtok; /* saved strtok() pointer */
uint32_t dtms_access; /* memory access rights */
dtrace_difo_t *dtms_difo; /* current dif object */
+ file_t *dtms_getf; /* cached rval of getf() */
} dtrace_mstate_t;
#define DTRACE_COND_OWNER 0x1
@@ -1144,6 +1145,7 @@ struct dtrace_state {
dtrace_optval_t dts_options[DTRACEOPT_MAX]; /* options */
dtrace_cred_t dts_cred; /* credentials */
size_t dts_nretained; /* number of retained enabs */
+ int dts_getf; /* number of getf() calls */
};
struct dtrace_provider {
diff --git a/usr/src/uts/common/sys/fs/hyprlofs.h b/usr/src/uts/common/sys/fs/hyprlofs.h
new file mode 100644
index 0000000000..b8c4149df2
--- /dev/null
+++ b/usr/src/uts/common/sys/fs/hyprlofs.h
@@ -0,0 +1,91 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#ifndef _SYS_FS_HYPRLOFS_H
+#define _SYS_FS_HYPRLOFS_H
+
+#include <sys/param.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * hyprlofs ioctl numbers.
+ */
+#define HYPRLOFS_IOC ('H' << 8)
+
+#define HYPRLOFS_ADD_ENTRIES (HYPRLOFS_IOC | 1)
+#define HYPRLOFS_RM_ENTRIES (HYPRLOFS_IOC | 2)
+#define HYPRLOFS_RM_ALL (HYPRLOFS_IOC | 3)
+#define HYPRLOFS_GET_ENTRIES (HYPRLOFS_IOC | 4)
+
+typedef struct {
+ char *hle_path;
+ uint_t hle_plen;
+ char *hle_name;
+ uint_t hle_nlen;
+} hyprlofs_entry_t;
+
+typedef struct {
+ hyprlofs_entry_t *hle_entries;
+ uint_t hle_len;
+} hyprlofs_entries_t;
+
+typedef struct {
+ char hce_path[MAXPATHLEN];
+ char hce_name[MAXPATHLEN];
+} hyprlofs_curr_entry_t;
+
+typedef struct {
+ hyprlofs_curr_entry_t *hce_entries;
+ uint_t hce_cnt;
+} hyprlofs_curr_entries_t;
+
+#ifdef _KERNEL
+typedef struct {
+ caddr32_t hle_path;
+ uint_t hle_plen;
+ caddr32_t hle_name;
+ uint_t hle_nlen;
+} hyprlofs_entry32_t;
+
+typedef struct {
+ caddr32_t hle_entries;
+ uint_t hle_len;
+} hyprlofs_entries32_t;
+
+typedef struct {
+ caddr32_t hce_entries;
+ uint_t hce_cnt;
+} hyprlofs_curr_entries32_t;
+
+#endif /* _KERNEL */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_FS_HYPRLOFS_H */
diff --git a/usr/src/uts/common/sys/fs/hyprlofs_info.h b/usr/src/uts/common/sys/fs/hyprlofs_info.h
new file mode 100644
index 0000000000..38389f77d9
--- /dev/null
+++ b/usr/src/uts/common/sys/fs/hyprlofs_info.h
@@ -0,0 +1,174 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#ifndef _SYS_FS_HYPRLOFS_INFO_H
+#define _SYS_FS_HYPRLOFS_INFO_H
+
+#include <sys/t_lock.h>
+#include <vm/seg.h>
+#include <vm/seg_vn.h>
+#include <sys/vfs_opreg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * hlnode is the file system dependent node for hyprlofs.
+ * It is modeled on the tmpfs tmpnode.
+ *
+ * hln_rwlock protects access of the directory list at hln_dir
+ * as well as syncronizing read/writes to directory hlnodes.
+ * hln_tlock protects updates to hln_mode and hln_nlink.
+ * hln_tlock doesn't require any hlnode locks.
+ */
+typedef struct hlnode {
+ struct hlnode *hln_back; /* linked list of hlnodes */
+ struct hlnode *hln_forw; /* linked list of hlnodes */
+ union {
+ struct {
+ struct hldirent *un_dirlist; /* dirent list */
+ uint_t un_dirents; /* number of dirents */
+ } un_dirstruct;
+ vnode_t *un_realvp; /* real vnode */
+ } un_hlnode;
+ vnode_t *hln_vnode; /* vnode for this hlnode */
+ int hln_gen; /* pseudo gen num for hlfid */
+ int hln_looped; /* flag indicating loopback */
+ vattr_t hln_attr; /* attributes */
+ krwlock_t hln_rwlock; /* rw - serialize mods and */
+ /* directory updates */
+ kmutex_t hln_tlock; /* time, flag, and nlink lock */
+} hlnode_t;
+
+/*
+ * hyprlofs per-mount data structure.
+ * All fields are protected by hlm_contents.
+ */
+typedef struct {
+ vfs_t *hlm_vfsp; /* filesystem's vfs struct */
+ hlnode_t *hlm_rootnode; /* root hlnode */
+ char *hlm_mntpath; /* name of hyprlofs mount point */
+ dev_t hlm_dev; /* unique dev # of mounted `device' */
+ uint_t hlm_gen; /* pseudo generation number for files */
+ kmutex_t hlm_contents; /* lock for hlfsmount structure */
+} hlfsmount_t;
+
+/*
+ * hyprlofs directories are made up of a linked list of hldirent structures
+ * hanging off directory hlnodes. File names are not fixed length,
+ * but are null terminated.
+ */
+typedef struct hldirent {
+ hlnode_t *hld_hlnode; /* hlnode for this file */
+ struct hldirent *hld_next; /* next directory entry */
+ struct hldirent *hld_prev; /* prev directory entry */
+ uint_t hld_offset; /* "offset" of dir entry */
+ uint_t hld_hash; /* a hash of td_name */
+ struct hldirent *hld_link; /* linked via the hash table */
+ hlnode_t *hld_parent; /* parent, dir we are in */
+ char *hld_name; /* must be null terminated */
+ /* max length is MAXNAMELEN */
+} hldirent_t;
+
+/*
+ * hlfid overlays the fid structure (for VFS_VGET)
+ */
+typedef struct {
+ uint16_t hlfid_len;
+ ino32_t hlfid_ino;
+ int32_t hlfid_gen;
+} hlfid_t;
+
+/*
+ * File system independent to hyprlofs conversion macros
+ */
+#define VFSTOHLM(vfsp) ((hlfsmount_t *)(vfsp)->vfs_data)
+#define VTOHLM(vp) ((hlfsmount_t *)(vp)->v_vfsp->vfs_data)
+#define VTOHLN(vp) ((hlnode_t *)(vp)->v_data)
+#define HLNTOV(tp) ((tp)->hln_vnode)
+#define REALVP(vp) ((vnode_t *)VTOHLN(vp)->hln_realvp)
+#define hlnode_hold(tp) VN_HOLD(HLNTOV(tp))
+#define hlnode_rele(tp) VN_RELE(HLNTOV(tp))
+
+#define hln_dir un_hlnode.un_dirstruct.un_dirlist
+#define hln_dirents un_hlnode.un_dirstruct.un_dirents
+#define hln_realvp un_hlnode.un_realvp
+
+/*
+ * Attributes
+ */
+#define hln_mask hln_attr.va_mask
+#define hln_type hln_attr.va_type
+#define hln_mode hln_attr.va_mode
+#define hln_uid hln_attr.va_uid
+#define hln_gid hln_attr.va_gid
+#define hln_fsid hln_attr.va_fsid
+#define hln_nodeid hln_attr.va_nodeid
+#define hln_nlink hln_attr.va_nlink
+#define hln_size hln_attr.va_size
+#define hln_atime hln_attr.va_atime
+#define hln_mtime hln_attr.va_mtime
+#define hln_ctime hln_attr.va_ctime
+#define hln_rdev hln_attr.va_rdev
+#define hln_blksize hln_attr.va_blksize
+#define hln_nblocks hln_attr.va_nblocks
+#define hln_seq hln_attr.va_seq
+
+/*
+ * enums
+ */
+enum de_op { DE_CREATE, DE_MKDIR }; /* direnter ops */
+enum dr_op { DR_REMOVE, DR_RMDIR }; /* dirremove ops */
+
+/*
+ * hyprlofs_minfree is the amount (in pages) of anonymous memory that hyprlofs
+ * leaves free for the rest of the system. The default value for
+ * hyprlofs_minfree is btopr(HYPRLOFSMINFREE) but it can be patched to a
+ * different number of pages. Since hyprlofs doesn't actually use much
+ * memory, its unlikely this ever needs to be patched.
+ */
+#define HYPRLOFSMINFREE 8 * 1024 * 1024 /* 8 Megabytes */
+
+extern size_t hyprlofs_minfree; /* Anonymous memory in pages */
+
+extern void hyprlofs_node_init(hlfsmount_t *, hlnode_t *, vattr_t *,
+ cred_t *);
+extern int hyprlofs_dirlookup(hlnode_t *, char *, hlnode_t **, cred_t *);
+extern int hyprlofs_dirdelete(hlnode_t *, hlnode_t *, char *, enum dr_op,
+ cred_t *);
+extern void hyprlofs_dirinit(hlnode_t *, hlnode_t *);
+extern void hyprlofs_dirtrunc(hlnode_t *);
+extern int hyprlofs_taccess(void *, int, cred_t *);
+extern int hyprlofs_direnter(hlfsmount_t *, hlnode_t *, char *, enum de_op,
+ vnode_t *, vattr_t *, hlnode_t **, cred_t *);
+
+extern struct vnodeops *hyprlofs_vnodeops;
+extern const struct fs_operation_def hyprlofs_vnodeops_template[];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_FS_HYPRLOFS_INFO_H */
diff --git a/usr/src/uts/common/sys/fs/tmp.h b/usr/src/uts/common/sys/fs/tmp.h
index 68dd67c61e..4a6e86bdd9 100644
--- a/usr/src/uts/common/sys/fs/tmp.h
+++ b/usr/src/uts/common/sys/fs/tmp.h
@@ -68,29 +68,28 @@ enum dr_op { DR_REMOVE, DR_RMDIR, DR_RENAME }; /* dirremove ops */
/*
* tmpfs_minfree is the amount (in pages) of anonymous memory that tmpfs
- * leaves free for the rest of the system. E.g. in a system with 32MB of
- * configured swap space, if 16MB were reserved (leaving 16MB free),
- * tmpfs could allocate up to 16MB - tmpfs_minfree. The default value
- * for tmpfs_minfree is btopr(TMPMINFREE) but it can cautiously patched
- * to a different number of pages.
- * NB: If tmpfs allocates too much swap space, other processes will be
- * unable to execute.
+ * leaves free for the rest of the system. In antiquity, this number could be
+ * relevant on a system-wide basis, as physical DRAM was routinely exhausted;
+ * however, in more modern times, the relative growth of DRAM with respect to
+ * application footprint means that this number is only likely to become
+ * factor in a virtualized OS environment (e.g., a zone) -- and even then only
+ * when DRAM and swap have both been capped low to allow for maximum tenancy.
+ * TMPMINFREE -- the value from which tmpfs_minfree is derived -- should
+ * therefore be configured to a value that is roughly the smallest practical
+ * value for memory + swap minus the largest reasonable size for tmpfs in such
+ * a configuration. As of this writing, the smallest practical memory + swap
+ * configuration is 128MB, and it seems reasonable to allow tmpfs to consume
+ * no more than seven-eighths of this, yielding a TMPMINFREE of 16MB. Care
+ * should be exercised in changing this: tuning this value too high will
+ * result in spurious ENOSPC errors in tmpfs in small zones (a problem that
+ * can induce cascading failure surprisingly often); tuning this value too low
+ * will result in tmpfs consumption alone to alone induce application-level
+ * memory allocation failure.
*/
-#define TMPMINFREE 2 * 1024 * 1024 /* 2 Megabytes */
+#define TMPMINFREE 16 * 1024 * 1024 /* 16 Megabytes */
extern size_t tmpfs_minfree; /* Anonymous memory in pages */
-/*
- * tmpfs can allocate only a certain percentage of kernel memory,
- * which is used for tmpnodes, directories, file names, etc.
- * This is statically set as TMPMAXFRACKMEM of physical memory.
- * The actual number of allocatable bytes can be patched in tmpfs_maxkmem.
- */
-#define TMPMAXFRACKMEM 25 /* 1/25 of physical memory */
-
-extern size_t tmp_kmemspace;
-extern size_t tmpfs_maxkmem; /* Allocatable kernel memory in bytes */
-
extern void tmpnode_init(struct tmount *, struct tmpnode *,
struct vattr *, struct cred *);
extern int tmpnode_trunc(struct tmount *, struct tmpnode *, ulong_t);
@@ -101,8 +100,6 @@ extern int tdirdelete(struct tmpnode *, struct tmpnode *, char *,
enum dr_op, struct cred *);
extern void tdirinit(struct tmpnode *, struct tmpnode *);
extern void tdirtrunc(struct tmpnode *);
-extern void *tmp_memalloc(size_t, int);
-extern void tmp_memfree(void *, size_t);
extern int tmp_resv(struct tmount *, struct tmpnode *, size_t, int);
extern int tmp_taccess(void *, int, struct cred *);
extern int tmp_sticky_remove_access(struct tmpnode *, struct tmpnode *,
diff --git a/usr/src/uts/common/sys/fss.h b/usr/src/uts/common/sys/fss.h
index 583586fd75..03c35277d4 100644
--- a/usr/src/uts/common/sys/fss.h
+++ b/usr/src/uts/common/sys/fss.h
@@ -22,6 +22,7 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_FSS_H
@@ -86,6 +87,7 @@ typedef struct fsspset {
/* on the list */
struct fssproj *fssps_list; /* list of project parts */
struct fsszone *fssps_zones; /* list of fsszone_t's in pset */
+ uint32_t fssps_gen; /* generation for zone's kstats */
} fsspset_t;
/*
@@ -101,7 +103,10 @@ typedef struct fssproj {
/* protected by fssps_lock */
uint32_t fssp_shares; /* copy of our kpj_shares */
/* protected by fssps_displock */
- uint32_t fssp_ticks; /* total of all ticks */
+ uint32_t fssp_ticks; /* total of nice tick values */
+ /* protected by fssps_displock */
+ uint32_t fssp_tick_cnt; /* cnt of all ticks in this sec */
+ uint32_t fssp_shr_pct; /* active shr % in this sec */
/* protected by fssps_displock */
fssusage_t fssp_usage; /* this project's decayed usage */
fssusage_t fssp_shusage; /* normalized usage */
diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h
index 6876fccb1a..38049b991e 100644
--- a/usr/src/uts/common/sys/mac.h
+++ b/usr/src/uts/common/sys/mac.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_MAC_H
@@ -128,6 +129,13 @@ typedef struct mac_propval_range_s {
*/
#define MAXMACADDRLEN 20
+#define MPT_MAXMACADDR 32
+
+typedef struct mac_secondary_addr_s {
+ uint32_t ms_addrcnt;
+ uint8_t ms_addrs[MPT_MAXMACADDR][MAXMACADDRLEN];
+} mac_secondary_addr_t;
+
typedef enum {
MAC_LOGTYPE_LINK = 1,
MAC_LOGTYPE_FLOW
@@ -205,6 +213,8 @@ typedef enum {
MAC_PROP_MAX_RXHWCLNT_AVAIL,
MAC_PROP_MAX_TXHWCLNT_AVAIL,
MAC_PROP_IB_LINKMODE,
+ MAC_PROP_VN_PROMISC_FILTERED,
+ MAC_PROP_SECONDARY_ADDRS,
MAC_PROP_PRIVATE = -1
} mac_prop_id_t;
@@ -312,13 +322,18 @@ typedef struct mac_info_s {
*
* This capability allows the MAC layer to detect when a VNIC is being
* access, and implement the required shortcuts.
+ *
+ * In addition, this capability is used to keep the VNIC's secondary
+ * mac_clients in sync when the primary MAC is updated.
*/
typedef void *(*mac_client_handle_fn_t)(void *);
+typedef void (*mac_client_update_fn_t)(void *);
typedef struct mac_capab_vnic_s {
void *mcv_arg;
mac_client_handle_fn_t mcv_mac_client_handle;
+ mac_client_update_fn_t mcv_mac_secondary_update;
} mac_capab_vnic_t;
typedef void (*mac_rename_fn_t)(const char *, void *);
diff --git a/usr/src/uts/common/sys/mac_client.h b/usr/src/uts/common/sys/mac_client.h
index 40cd15a1b8..0fc4939503 100644
--- a/usr/src/uts/common/sys/mac_client.h
+++ b/usr/src/uts/common/sys/mac_client.h
@@ -22,6 +22,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -135,6 +136,8 @@ extern void mac_multicast_remove(mac_client_handle_t, const uint8_t *);
extern void mac_rx_set(mac_client_handle_t, mac_rx_t, void *);
extern void mac_rx_clear(mac_client_handle_t);
+extern void mac_secondary_dup(mac_client_handle_t, mac_client_handle_t);
+extern void mac_secondary_cleanup(mac_client_handle_t);
extern mac_tx_cookie_t mac_tx(mac_client_handle_t, mblk_t *,
uintptr_t, uint16_t, mblk_t **);
extern boolean_t mac_tx_is_flow_blocked(mac_client_handle_t, mac_tx_cookie_t);
@@ -158,6 +161,8 @@ extern int mac_unicast_primary_set(mac_handle_t, const uint8_t *);
extern void mac_unicast_primary_get(mac_handle_t, uint8_t *);
extern void mac_unicast_primary_info(mac_handle_t, char *, boolean_t *);
+extern void mac_unicast_secondary_get(mac_client_handle_t, uint8_t *);
+
extern boolean_t mac_dst_get(mac_handle_t, uint8_t *);
extern int mac_addr_random(mac_client_handle_t, uint_t, uint8_t *,
diff --git a/usr/src/uts/common/sys/mac_client_impl.h b/usr/src/uts/common/sys/mac_client_impl.h
index ae25df6a0d..ce1a6f1d7c 100644
--- a/usr/src/uts/common/sys/mac_client_impl.h
+++ b/usr/src/uts/common/sys/mac_client_impl.h
@@ -22,6 +22,9 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
#ifndef _SYS_MAC_CLIENT_IMPL_H
#define _SYS_MAC_CLIENT_IMPL_H
@@ -137,6 +140,7 @@ struct mac_client_impl_s { /* Protected by */
flow_entry_t *mci_flent_list; /* mci_rw_lock */
uint_t mci_nflents; /* mci_rw_lock */
uint_t mci_nvids; /* mci_rw_lock */
+ volatile uint32_t mci_vidcache; /* VID cache */
/* Resource Management Functions */
mac_resource_add_t mci_resource_add; /* SL */
@@ -280,6 +284,28 @@ extern int mac_tx_percpu_cnt;
} \
}
+/*
+ * To allow the hot path to not grab any additional locks, we keep a single
+ * entry VLAD ID cache that caches whether or not a given VID belongs to a
+ * MAC client.
+ */
+#define MCIP_VIDCACHE_VALIDSHIFT 31
+#define MCIP_VIDCACHE_VIDSHIFT 1
+#define MCIP_VIDCACHE_VIDMASK (UINT16_MAX << MCIP_VIDCACHE_VIDSHIFT)
+#define MCIP_VIDCACHE_BOOLSHIFT 0
+
+#define MCIP_VIDCACHE_INVALID 0
+
+#define MCIP_VIDCACHE_CACHE(vid, bool) \
+ ((1U << MCIP_VIDCACHE_VALIDSHIFT) | \
+ ((vid) << MCIP_VIDCACHE_VIDSHIFT) | \
+ ((bool) ? (1U << MCIP_VIDCACHE_BOOLSHIFT) : 0))
+
+#define MCIP_VIDCACHE_ISVALID(v) ((v) & (1U << MCIP_VIDCACHE_VALIDSHIFT))
+#define MCIP_VIDCACHE_VID(v) \
+ (((v) & MCIP_VIDCACHE_VIDMASK) >> MCIP_VIDCACHE_VIDSHIFT)
+#define MCIP_VIDCACHE_BOOL(v) ((v) & (1U << MCIP_VIDCACHE_BOOLSHIFT))
+
#define MAC_TAG_NEEDED(mcip) \
(((mcip)->mci_state_flags & MCIS_TAG_DISABLE) == 0 && \
(mcip)->mci_nvids == 1) \
@@ -302,6 +328,7 @@ extern int mac_tx_percpu_cnt;
/* Mac protection flags */
#define MPT_FLAG_V6_LOCAL_ADDR_SET 0x0001
+#define MPT_FLAG_PROMISC_FILTERED 0x0002
/* in mac_client.c */
extern void mac_promisc_client_dispatch(mac_client_impl_t *, mblk_t *);
diff --git a/usr/src/uts/common/sys/mac_client_priv.h b/usr/src/uts/common/sys/mac_client_priv.h
index 0ddc1f074d..bed2e293b3 100644
--- a/usr/src/uts/common/sys/mac_client_priv.h
+++ b/usr/src/uts/common/sys/mac_client_priv.h
@@ -22,6 +22,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -91,9 +92,6 @@ extern boolean_t mac_client_is_vlan_vnic(mac_client_handle_t);
extern void mac_client_poll_enable(mac_client_handle_t);
extern void mac_client_poll_disable(mac_client_handle_t);
-extern int mac_resource_ctl_set(mac_client_handle_t, mac_resource_props_t *);
-extern void mac_resource_ctl_get(mac_client_handle_t, mac_resource_props_t *);
-
/*
* Flow-related APIs for MAC clients.
*/
diff --git a/usr/src/uts/common/sys/mac_flow.h b/usr/src/uts/common/sys/mac_flow.h
index 9f9902fc29..4d7905de18 100644
--- a/usr/src/uts/common/sys/mac_flow.h
+++ b/usr/src/uts/common/sys/mac_flow.h
@@ -22,6 +22,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
#ifndef _MAC_FLOW_H
@@ -157,6 +158,7 @@ typedef enum {
typedef struct mac_ipaddr_s {
uint32_t ip_version;
in6_addr_t ip_addr;
+ uint32_t ip_v4netmask;
} mac_ipaddr_t;
typedef enum {
diff --git a/usr/src/uts/common/sys/mac_impl.h b/usr/src/uts/common/sys/mac_impl.h
index 8f9f23ff71..2eef66113d 100644
--- a/usr/src/uts/common/sys/mac_impl.h
+++ b/usr/src/uts/common/sys/mac_impl.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_MAC_IMPL_H
@@ -885,6 +886,8 @@ extern void mac_protect_fini(mac_client_impl_t *);
extern int mac_set_resources(mac_handle_t, mac_resource_props_t *);
extern void mac_get_resources(mac_handle_t, mac_resource_props_t *);
extern void mac_get_effective_resources(mac_handle_t, mac_resource_props_t *);
+extern void mac_set_promisc_filtered(mac_client_handle_t, boolean_t);
+extern boolean_t mac_get_promisc_filtered(mac_client_handle_t);
extern cpupart_t *mac_pset_find(mac_resource_props_t *, boolean_t *);
extern void mac_set_pool_effective(boolean_t, cpupart_t *,
diff --git a/usr/src/uts/common/sys/mman.h b/usr/src/uts/common/sys/mman.h
index 8f66bf7489..ae2f5fb1bf 100644
--- a/usr/src/uts/common/sys/mman.h
+++ b/usr/src/uts/common/sys/mman.h
@@ -23,6 +23,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -356,6 +357,7 @@ struct memcntl_mha32 {
#define MS_SYNC 0x4 /* wait for msync */
#define MS_ASYNC 0x1 /* return immediately */
#define MS_INVALIDATE 0x2 /* invalidate caches */
+#define MS_INVALCURPROC 0x8 /* invalidate cache for curproc only */
#if (_POSIX_C_SOURCE <= 2) && !defined(_XPG4_2) || defined(__EXTENSIONS__)
/* functions to mctl */
diff --git a/usr/src/uts/common/sys/mntent.h b/usr/src/uts/common/sys/mntent.h
index e95ef3fccc..d215d88790 100644
--- a/usr/src/uts/common/sys/mntent.h
+++ b/usr/src/uts/common/sys/mntent.h
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012, Joyent, Inc. All rights reserved.
*
* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
* All Rights Reserved
@@ -47,6 +48,7 @@ extern "C" {
#define MNTTYPE_PCFS "pcfs" /* PC (MSDOS) file system */
#define MNTTYPE_PC MNTTYPE_PCFS /* Deprecated name; use MNTTYPE_PCFS */
#define MNTTYPE_LOFS "lofs" /* Loop back file system */
+#define MNTTYPE_HYPRLOFS "hyprlofs" /* Hyperlofs file system */
#define MNTTYPE_LO MNTTYPE_LOFS /* Deprecated name; use MNTTYPE_LOFS */
#define MNTTYPE_HSFS "hsfs" /* High Sierra (9660) file system */
#define MNTTYPE_SWAP "swap" /* Swap file system */
diff --git a/usr/src/uts/common/sys/param.h b/usr/src/uts/common/sys/param.h
index 50f6084cfb..657acc869e 100644
--- a/usr/src/uts/common/sys/param.h
+++ b/usr/src/uts/common/sys/param.h
@@ -101,7 +101,7 @@ extern "C" {
#define DEFAULT_MAXPID 999999
#define DEFAULT_JUMPPID 100000
#else
-#define DEFAULT_MAXPID 30000
+#define DEFAULT_MAXPID 99999
#define DEFAULT_JUMPPID 0
#endif
diff --git a/usr/src/uts/common/sys/policy.h b/usr/src/uts/common/sys/policy.h
index 276c4d386e..597c166b31 100644
--- a/usr/src/uts/common/sys/policy.h
+++ b/usr/src/uts/common/sys/policy.h
@@ -173,6 +173,7 @@ int secpolicy_setid_setsticky_clear(vnode_t *, vattr_t *,
const vattr_t *, cred_t *);
int secpolicy_xvattr(xvattr_t *, uid_t, cred_t *, vtype_t);
int secpolicy_xvm_control(const cred_t *);
+int secpolicy_hyprlofs_control(const cred_t *);
int secpolicy_basic_exec(const cred_t *, vnode_t *);
int secpolicy_basic_fork(const cred_t *);
diff --git a/usr/src/uts/common/sys/sdt_impl.h b/usr/src/uts/common/sys/sdt_impl.h
index cbe95f7c66..f7cc683f2f 100644
--- a/usr/src/uts/common/sys/sdt_impl.h
+++ b/usr/src/uts/common/sys/sdt_impl.h
@@ -24,11 +24,13 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
#ifndef _SYS_SDT_IMPL_H
#define _SYS_SDT_IMPL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -45,6 +47,7 @@ typedef struct sdt_provider {
char *sdtp_name; /* name of provider */
char *sdtp_prefix; /* prefix for probe names */
dtrace_pattr_t *sdtp_attr; /* stability attributes */
+ uint32_t sdtp_priv; /* privilege, if any */
dtrace_provider_id_t sdtp_id; /* provider ID */
} sdt_provider_t;
@@ -75,6 +78,7 @@ typedef struct sdt_argdesc {
} sdt_argdesc_t;
extern void sdt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *);
+extern int sdt_mode(void *, dtrace_id_t, void *);
#ifdef __cplusplus
}
diff --git a/usr/src/uts/common/sys/sunddi.h b/usr/src/uts/common/sys/sunddi.h
index 8d1fd5e730..18d2284b4a 100644
--- a/usr/src/uts/common/sys/sunddi.h
+++ b/usr/src/uts/common/sys/sunddi.h
@@ -462,6 +462,7 @@ extern size_t strlcat(char *, const char *, size_t);
extern size_t strlcpy(char *, const char *, size_t);
extern size_t strspn(const char *, const char *);
extern size_t strcspn(const char *, const char *);
+extern char *strsep(char **, const char *);
extern int bcmp(const void *, const void *, size_t) __PURE;
extern int stoi(char **);
extern void numtos(ulong_t, char *);
diff --git a/usr/src/uts/common/sys/thread.h b/usr/src/uts/common/sys/thread.h
index 188230d61e..c7f460e7c7 100644
--- a/usr/src/uts/common/sys/thread.h
+++ b/usr/src/uts/common/sys/thread.h
@@ -68,6 +68,8 @@ typedef struct ctxop {
void (*free_op)(void *, int); /* function which frees the context */
void *arg; /* argument to above functions, ctx pointer */
struct ctxop *next; /* next context ops */
+ hrtime_t save_ts; /* timestamp of last save */
+ hrtime_t restore_ts; /* timestamp of last restore */
} ctxop_t;
/*
diff --git a/usr/src/uts/common/sys/uadmin.h b/usr/src/uts/common/sys/uadmin.h
index c35d0a5cfb..6adeb477bb 100644
--- a/usr/src/uts/common/sys/uadmin.h
+++ b/usr/src/uts/common/sys/uadmin.h
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -157,7 +158,7 @@ extern kmutex_t ualock;
extern void mdboot(int, int, char *, boolean_t);
extern void mdpreboot(int, int, char *);
extern int kadmin(int, int, void *, cred_t *);
-extern void killall(zoneid_t);
+extern void killall(zoneid_t, boolean_t);
#endif
#if defined(__STDC__)
diff --git a/usr/src/uts/common/sys/vm_usage.h b/usr/src/uts/common/sys/vm_usage.h
index 1aa4a8ee6d..97e3430ae2 100644
--- a/usr/src/uts/common/sys/vm_usage.h
+++ b/usr/src/uts/common/sys/vm_usage.h
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_VM_USAGE_H
@@ -79,8 +80,9 @@ extern "C" {
/* zoneid */
#define VMUSAGE_COL_EUSERS 0x2000 /* same as VMUSAGE_COL_RUSERS, but by */
/* euser */
+#define VMUSAGE_A_ZONE 0x4000 /* rss/swap for a specified zone */
-#define VMUSAGE_MASK 0x3fff /* all valid flags for getvmusage() */
+#define VMUSAGE_MASK 0x7fff /* all valid flags for getvmusage() */
typedef struct vmusage {
id_t vmu_zoneid; /* zoneid, or ALL_ZONES for */
diff --git a/usr/src/uts/common/sys/vnic_impl.h b/usr/src/uts/common/sys/vnic_impl.h
index 2bb48a60c6..ffaa2939f5 100644
--- a/usr/src/uts/common/sys/vnic_impl.h
+++ b/usr/src/uts/common/sys/vnic_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_VNIC_IMPL_H
@@ -46,8 +47,10 @@ typedef struct vnic_s {
mac_handle_t vn_mh;
mac_handle_t vn_lower_mh;
- mac_client_handle_t vn_mch;
- mac_unicast_handle_t vn_muh;
+ uint_t vn_nhandles; /* # of secondary mac handles */
+ /* The primary handle is always the first element in the array */
+ mac_client_handle_t vn_mc_handles[MPT_MAXMACADDR];
+ mac_unicast_handle_t vn_mu_handles[MPT_MAXMACADDR];
uint32_t vn_margin;
int vn_slot_id;
vnic_mac_addr_type_t vn_addr_type;
@@ -63,6 +66,9 @@ typedef struct vnic_s {
uint32_t vn_hcksum_txflags;
} vnic_t;
+#define vn_mch vn_mc_handles[0]
+#define vn_muh vn_mu_handles[0]
+
extern int vnic_dev_create(datalink_id_t, datalink_id_t, vnic_mac_addr_type_t *,
int *, uchar_t *, int *, uint_t, uint16_t, vrid_t, int,
mac_resource_props_t *, uint32_t, vnic_ioc_diag_t *, cred_t *);
diff --git a/usr/src/uts/common/sys/zone.h b/usr/src/uts/common/sys/zone.h
index 75d03ee712..95839d8494 100644
--- a/usr/src/uts/common/sys/zone.h
+++ b/usr/src/uts/common/sys/zone.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_ZONE_H
@@ -94,12 +95,17 @@ extern "C" {
#define ZONE_ATTR_INITNAME 9
#define ZONE_ATTR_BOOTARGS 10
#define ZONE_ATTR_BRAND 11
-#define ZONE_ATTR_PHYS_MCAP 12
+#define ZONE_ATTR_PMCAP_NOVER 12
#define ZONE_ATTR_SCHED_CLASS 13
#define ZONE_ATTR_FLAGS 14
#define ZONE_ATTR_HOSTID 15
#define ZONE_ATTR_FS_ALLOWED 16
#define ZONE_ATTR_NETWORK 17
+#define ZONE_ATTR_DID 18
+#define ZONE_ATTR_PMCAP_PAGEOUT 19
+#define ZONE_ATTR_INITNORESTART 20
+#define ZONE_ATTR_PG_FLT_DELAY 21
+#define ZONE_ATTR_RSS 22
/* Start of the brand-specific attribute namespace */
#define ZONE_ATTR_BRAND_ATTRS 32768
@@ -180,6 +186,7 @@ typedef struct {
uint32_t doi; /* DOI for label */
caddr32_t label; /* label associated with zone */
int flags;
+ zoneid_t zoneid; /* requested zoneid */
} zone_def32;
#endif
typedef struct {
@@ -196,6 +203,7 @@ typedef struct {
uint32_t doi; /* DOI for label */
const bslabel_t *label; /* label associated with zone */
int flags;
+ zoneid_t zoneid; /* requested zoneid */
} zone_def;
/* extended error information */
@@ -240,7 +248,7 @@ typedef enum zone_cmd {
typedef struct zone_cmd_arg {
uint64_t uniqid; /* unique "generation number" */
zone_cmd_t cmd; /* requested action */
- uint32_t _pad; /* need consistent 32/64 bit alignmt */
+ uint32_t debug; /* enable brand hook debug */
char locale[MAXPATHLEN]; /* locale in which to render messages */
char bootbuf[BOOTARGS_MAX]; /* arguments passed to zone_boot() */
} zone_cmd_arg_t;
@@ -320,6 +328,7 @@ typedef struct zone_net_data {
* libraries which may be defining ther own versions.
*/
#include <sys/list.h>
+#include <sys/cpuvar.h>
#define GLOBAL_ZONEUNIQID 0 /* uniqid of the global zone */
@@ -367,7 +376,7 @@ typedef struct zone_dataset {
} zone_dataset_t;
/*
- * structure for zone kstats
+ * structure for rctl zone kstats
*/
typedef struct zone_kstat {
kstat_named_t zk_zonename;
@@ -377,6 +386,77 @@ typedef struct zone_kstat {
struct cpucap;
+typedef struct {
+ hrtime_t cycle_start;
+ uint_t cycle_cnt;
+ hrtime_t zone_avg_cnt;
+} sys_zio_cntr_t;
+
+typedef struct {
+ kstat_named_t zv_zonename;
+ kstat_named_t zv_nread;
+ kstat_named_t zv_reads;
+ kstat_named_t zv_rtime;
+ kstat_named_t zv_rlentime;
+ kstat_named_t zv_nwritten;
+ kstat_named_t zv_writes;
+ kstat_named_t zv_wtime;
+ kstat_named_t zv_wlentime;
+ kstat_named_t zv_10ms_ops;
+ kstat_named_t zv_100ms_ops;
+ kstat_named_t zv_1s_ops;
+ kstat_named_t zv_10s_ops;
+ kstat_named_t zv_delay_cnt;
+ kstat_named_t zv_delay_time;
+} zone_vfs_kstat_t;
+
+typedef struct {
+ kstat_named_t zz_zonename;
+ kstat_named_t zz_nread;
+ kstat_named_t zz_reads;
+ kstat_named_t zz_rtime;
+ kstat_named_t zz_rlentime;
+ kstat_named_t zz_nwritten;
+ kstat_named_t zz_writes;
+ kstat_named_t zz_waittime;
+} zone_zfs_kstat_t;
+
+typedef struct {
+ kstat_named_t zm_zonename;
+ kstat_named_t zm_rss;
+ kstat_named_t zm_phys_cap;
+ kstat_named_t zm_swap;
+ kstat_named_t zm_swap_cap;
+ kstat_named_t zm_nover;
+ kstat_named_t zm_pagedout;
+ kstat_named_t zm_pgpgin;
+ kstat_named_t zm_anonpgin;
+ kstat_named_t zm_execpgin;
+ kstat_named_t zm_fspgin;
+ kstat_named_t zm_anon_alloc_fail;
+ kstat_named_t zm_pf_throttle;
+ kstat_named_t zm_pf_throttle_usec;
+} zone_mcap_kstat_t;
+
+typedef struct {
+ kstat_named_t zm_zonename; /* full name, kstat truncates name */
+ kstat_named_t zm_utime;
+ kstat_named_t zm_stime;
+ kstat_named_t zm_wtime;
+ kstat_named_t zm_avenrun1;
+ kstat_named_t zm_avenrun5;
+ kstat_named_t zm_avenrun15;
+ kstat_named_t zm_run_ticks;
+ kstat_named_t zm_run_wait;
+ kstat_named_t zm_fss_shr_pct;
+ kstat_named_t zm_fss_pri_hi;
+ kstat_named_t zm_fss_pri_avg;
+ kstat_named_t zm_ffcap;
+ kstat_named_t zm_ffnoproc;
+ kstat_named_t zm_ffnomem;
+ kstat_named_t zm_ffmisc;
+} zone_misc_kstat_t;
+
typedef struct zone {
/*
* zone_name is never modified once set.
@@ -416,6 +496,7 @@ typedef struct zone {
*/
list_node_t zone_linkage;
zoneid_t zone_id; /* ID of zone */
+ zoneid_t zone_did; /* persistent debug ID of zone */
uint_t zone_ref; /* count of zone_hold()s on zone */
uint_t zone_cred_ref; /* count of zone_hold_cred()s on zone */
/*
@@ -471,7 +552,7 @@ typedef struct zone {
char *zone_initname; /* fs path to 'init' */
int zone_boot_err; /* for zone_boot() if boot fails */
char *zone_bootargs; /* arguments passed via zone_boot() */
- uint64_t zone_phys_mcap; /* physical memory cap */
+ rctl_qty_t zone_phys_mem_ctl; /* current phys. memory limit */
/*
* zone_kthreads is protected by zone_status_lock.
*/
@@ -520,6 +601,37 @@ typedef struct zone {
list_t zone_dl_list;
netstack_t *zone_netstack;
struct cpucap *zone_cpucap; /* CPU caps data */
+
+ /*
+ * Data and counters used for ZFS fair-share disk IO.
+ */
+ rctl_qty_t zone_zfs_io_pri; /* ZFS IO priority */
+ uint_t zone_zfs_queued[2]; /* sync I/O enqueued count */
+ uint64_t zone_zfs_weight; /* used to prevent starvation */
+ uint64_t zone_io_util; /* IO utilization metric */
+ boolean_t zone_io_util_above_avg; /* IO util percent > avg. */
+ uint16_t zone_io_delay; /* IO delay on logical r/w */
+ kmutex_t zone_stg_io_lock; /* protects IO window data */
+ sys_zio_cntr_t zone_rd_ops; /* Counters for ZFS reads, */
+ sys_zio_cntr_t zone_wr_ops; /* writes and */
+ sys_zio_cntr_t zone_lwr_ops; /* logical writes. */
+
+ /*
+ * kstats and counters for VFS ops and bytes.
+ */
+ kmutex_t zone_vfs_lock; /* protects VFS statistics */
+ kstat_t *zone_vfs_ksp;
+ kstat_io_t zone_vfs_rwstats;
+ zone_vfs_kstat_t *zone_vfs_stats;
+
+ /*
+ * kstats for ZFS I/O ops and bytes.
+ */
+ kmutex_t zone_zfs_lock; /* protects ZFS statistics */
+ kstat_t *zone_zfs_ksp;
+ kstat_io_t zone_zfs_rwstats;
+ zone_zfs_kstat_t *zone_zfs_stats;
+
/*
* Solaris Auditing per-zone audit context
*/
@@ -537,6 +649,74 @@ typedef struct zone {
rctl_qty_t zone_nprocs_ctl; /* current limit protected by */
/* zone_rctls->rcs_lock */
kstat_t *zone_nprocs_kstat;
+
+ /*
+ * kstats and counters for physical memory capping.
+ */
+ rctl_qty_t zone_phys_mem; /* current bytes of phys. mem. (RSS) */
+ kstat_t *zone_physmem_kstat;
+ uint64_t zone_mcap_nover; /* # of times over phys. cap */
+ uint64_t zone_mcap_pagedout; /* bytes of mem. paged out */
+ kmutex_t zone_mcap_lock; /* protects mcap statistics */
+ kstat_t *zone_mcap_ksp;
+ zone_mcap_kstat_t *zone_mcap_stats;
+ uint64_t zone_pgpgin; /* pages paged in */
+ uint64_t zone_anonpgin; /* anon pages paged in */
+ uint64_t zone_execpgin; /* exec pages paged in */
+ uint64_t zone_fspgin; /* fs pages paged in */
+ uint64_t zone_anon_alloc_fail; /* cnt of anon alloc fails */
+ uint64_t zone_pf_throttle; /* cnt of page flt throttles */
+ uint64_t zone_pf_throttle_usec; /* time of page flt throttles */
+
+ /* Num usecs to throttle page fault when zone is over phys. mem cap */
+ uint32_t zone_pg_flt_delay;
+
+ /*
+ * Misc. kstats and counters for zone cpu-usage aggregation.
+ * The zone_Xtime values are the sum of the micro-state accounting
+ * values for all threads that are running or have run in the zone.
+ * This is tracked in msacct.c as threads change state.
+ * The zone_stime is the sum of the LMS_SYSTEM times.
+ * The zone_utime is the sum of the LMS_USER times.
+ * The zone_wtime is the sum of the LMS_WAIT_CPU times.
+ * As with per-thread micro-state accounting values, these values are
+ * not scaled to nanosecs. The scaling is done by the
+ * zone_misc_kstat_update function when kstats are requested.
+ */
+ kmutex_t zone_misc_lock; /* protects misc statistics */
+ kstat_t *zone_misc_ksp;
+ zone_misc_kstat_t *zone_misc_stats;
+ uint64_t zone_stime; /* total system time */
+ uint64_t zone_utime; /* total user time */
+ uint64_t zone_wtime; /* total time waiting in runq */
+ /* fork-fail kstat tracking */
+ uint32_t zone_ffcap; /* hit an rctl cap */
+ uint32_t zone_ffnoproc; /* get proc/lwp error */
+ uint32_t zone_ffnomem; /* as_dup/memory error */
+ uint32_t zone_ffmisc; /* misc. other error */
+
+ struct loadavg_s zone_loadavg; /* loadavg for this zone */
+ uint64_t zone_hp_avenrun[3]; /* high-precision avenrun */
+ int zone_avenrun[3]; /* FSCALED avg. run queue len */
+
+ /*
+ * FSS stats updated once per second by fss_decay_usage.
+ */
+ uint32_t zone_fss_gen; /* FSS generation cntr */
+ uint64_t zone_run_ticks; /* tot # of ticks running */
+
+ /*
+ * DTrace-private per-zone state
+ */
+ int zone_dtrace_getf; /* # of unprivileged getf()s */
+
+ /*
+ * Synchronization primitives used to synchronize between mounts and
+ * zone creation/destruction.
+ */
+ int zone_mounts_in_progress;
+ kcondvar_t zone_mount_cv;
+ kmutex_t zone_mount_lock;
} zone_t;
/*
@@ -569,9 +749,11 @@ extern zone_t *zone_find_by_name(char *);
extern zone_t *zone_find_by_any_path(const char *, boolean_t);
extern zone_t *zone_find_by_path(const char *);
extern zoneid_t getzoneid(void);
+extern zoneid_t getzonedid(void);
extern zone_t *zone_find_by_id_nolock(zoneid_t);
extern int zone_datalink_walk(zoneid_t, int (*)(datalink_id_t, void *), void *);
extern int zone_check_datalink(zoneid_t *, datalink_id_t);
+extern void zone_loadavg_update();
/*
* Zone-specific data (ZSD) APIs
@@ -755,13 +937,14 @@ extern int zone_dataset_visible(const char *, int *);
extern int zone_kadmin(int, int, const char *, cred_t *);
extern void zone_shutdown_global(void);
-extern void mount_in_progress(void);
-extern void mount_completed(void);
+extern void mount_in_progress(zone_t *);
+extern void mount_completed(zone_t *);
extern int zone_walk(int (*)(zone_t *, void *), void *);
extern rctl_hndl_t rc_zone_locked_mem;
extern rctl_hndl_t rc_zone_max_swap;
+extern rctl_hndl_t rc_zone_phys_mem;
extern rctl_hndl_t rc_zone_max_lofi;
#endif /* _KERNEL */
diff --git a/usr/src/uts/common/syscall/getloadavg.c b/usr/src/uts/common/syscall/getloadavg.c
index c669f9b8ba..0f44064e90 100644
--- a/usr/src/uts/common/syscall/getloadavg.c
+++ b/usr/src/uts/common/syscall/getloadavg.c
@@ -22,10 +22,9 @@
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2011 Joyent, Inc. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/errno.h>
@@ -41,7 +40,6 @@ int
getloadavg(int *buf, int nelem)
{
int *loadbuf = &avenrun[0];
- int loadavg[LOADAVG_NSTATS];
int error;
if (nelem < 0)
@@ -50,15 +48,7 @@ getloadavg(int *buf, int nelem)
nelem = LOADAVG_NSTATS;
if (!INGLOBALZONE(curproc)) {
- mutex_enter(&cpu_lock);
- if (pool_pset_enabled()) {
- psetid_t psetid = zone_pset_get(curproc->p_zone);
-
- error = cpupart_get_loadavg(psetid, &loadavg[0], nelem);
- ASSERT(error == 0); /* pset isn't going anywhere */
- loadbuf = &loadavg[0];
- }
- mutex_exit(&cpu_lock);
+ loadbuf = &curproc->p_zone->zone_avenrun[0];
}
error = copyout(loadbuf, buf, nelem * sizeof (avenrun[0]));
diff --git a/usr/src/uts/common/syscall/memcntl.c b/usr/src/uts/common/syscall/memcntl.c
index 1ab3a8b65e..63c8b64ad0 100644
--- a/usr/src/uts/common/syscall/memcntl.c
+++ b/usr/src/uts/common/syscall/memcntl.c
@@ -21,6 +21,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -116,13 +117,17 @@ memcntl(caddr_t addr, size_t len, int cmd, caddr_t arg, int attr, int mask)
* MS_SYNC used to be defined to be zero but is now non-zero.
* For binary compatibility we still accept zero
* (the absence of MS_ASYNC) to mean the same thing.
+ * Binary compatibility is not an issue for MS_INVALCURPROC.
*/
iarg = (uintptr_t)arg;
if ((iarg & ~MS_INVALIDATE) == 0)
iarg |= MS_SYNC;
- if (((iarg & ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE)) != 0) ||
- ((iarg & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC))) {
+ if (((iarg &
+ ~(MS_SYNC|MS_ASYNC|MS_INVALIDATE|MS_INVALCURPROC)) != 0) ||
+ ((iarg & (MS_SYNC|MS_ASYNC)) == (MS_SYNC|MS_ASYNC)) ||
+ ((iarg & (MS_INVALIDATE|MS_INVALCURPROC)) ==
+ (MS_INVALIDATE|MS_INVALCURPROC))) {
error = set_errno(EINVAL);
} else {
error = as_ctl(as, addr, len, cmd, attr, iarg, NULL, 0);
diff --git a/usr/src/uts/common/syscall/sysconfig.c b/usr/src/uts/common/syscall/sysconfig.c
index 03f2fabe13..26ea859224 100644
--- a/usr/src/uts/common/syscall/sysconfig.c
+++ b/usr/src/uts/common/syscall/sysconfig.c
@@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -170,8 +171,8 @@ sysconfig(int which)
* even though rcapd can be used on the global zone too.
*/
if (!INGLOBALZONE(curproc) &&
- curproc->p_zone->zone_phys_mcap != 0)
- return (MIN(btop(curproc->p_zone->zone_phys_mcap),
+ curproc->p_zone->zone_phys_mem_ctl != UINT64_MAX)
+ return (MIN(btop(curproc->p_zone->zone_phys_mem_ctl),
physinstalled));
return (physinstalled);
@@ -179,26 +180,23 @@ sysconfig(int which)
case _CONFIG_AVPHYS_PAGES:
/*
* If the non-global zone has a phys. memory cap, use
- * the phys. memory cap - zone's current rss. We always
+ * the phys. memory cap - zone's rss. We always
* report the system-wide value for the global zone, even
- * though rcapd can be used on the global zone too.
+ * though memory capping can be used on the global zone too.
+ * We use the cached value for the RSS since vm_getusage()
+ * is so expensive and we don't need this value to be exact.
*/
if (!INGLOBALZONE(curproc) &&
- curproc->p_zone->zone_phys_mcap != 0) {
+ curproc->p_zone->zone_phys_mem_ctl != UINT64_MAX) {
pgcnt_t cap, rss, free;
- vmusage_t in_use;
- size_t cnt = 1;
- cap = btop(curproc->p_zone->zone_phys_mcap);
+ cap = btop(curproc->p_zone->zone_phys_mem_ctl);
if (cap > physinstalled)
return (freemem);
- if (vm_getusage(VMUSAGE_ZONE, 1, &in_use, &cnt,
- FKIOCTL) != 0)
- in_use.vmu_rss_all = 0;
- rss = btop(in_use.vmu_rss_all);
+ rss = btop(curproc->p_zone->zone_phys_mem);
/*
- * Because rcapd implements a soft cap, it is possible
+ * Because this is a soft cap, it is possible
* for rss to be temporarily over the cap.
*/
if (cap > rss)
diff --git a/usr/src/uts/common/syscall/uadmin.c b/usr/src/uts/common/syscall/uadmin.c
index 2dda4001bf..68aa1a95f5 100644
--- a/usr/src/uts/common/syscall/uadmin.c
+++ b/usr/src/uts/common/syscall/uadmin.c
@@ -78,7 +78,7 @@ volatile int fastreboot_dryrun = 0;
* system with many zones.
*/
void
-killall(zoneid_t zoneid)
+killall(zoneid_t zoneid, boolean_t force)
{
proc_t *p;
@@ -108,7 +108,7 @@ killall(zoneid_t zoneid)
p->p_stat != SIDL &&
p->p_stat != SZOMB) {
mutex_enter(&p->p_lock);
- if (sigismember(&p->p_sig, SIGKILL)) {
+ if (!force && sigismember(&p->p_sig, SIGKILL)) {
mutex_exit(&p->p_lock);
p = p->p_next;
} else {
@@ -245,7 +245,7 @@ kadmin(int cmd, int fcn, void *mdep, cred_t *credp)
*/
zone_shutdown_global();
- killall(ALL_ZONES);
+ killall(ALL_ZONES, B_FALSE);
/*
* If we are calling kadmin() from a kernel context then we
* do not release these resources.
diff --git a/usr/src/uts/common/vm/hat.h b/usr/src/uts/common/vm/hat.h
index 1d91475e38..156b810046 100644
--- a/usr/src/uts/common/vm/hat.h
+++ b/usr/src/uts/common/vm/hat.h
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -460,6 +461,7 @@ void hat_setstat(struct as *, caddr_t, size_t, uint_t);
*/
#define HAT_ADV_PGUNLOAD 0x00
#define HAT_FORCE_PGUNLOAD 0x01
+#define HAT_CURPROC_PGUNLOAD 0x02
/*
* Attributes for hat_page_*attr, hat_setstats and
diff --git a/usr/src/uts/common/vm/seg_vn.c b/usr/src/uts/common/vm/seg_vn.c
index 31c293d416..5f106f6c06 100644
--- a/usr/src/uts/common/vm/seg_vn.c
+++ b/usr/src/uts/common/vm/seg_vn.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -7254,7 +7255,8 @@ segvn_sync(struct seg *seg, caddr_t addr, size_t len, int attr, uint_t flags)
vpp = svd->vpage;
offset = svd->offset + (uintptr_t)(addr - seg->s_base);
bflags = ((flags & MS_ASYNC) ? B_ASYNC : 0) |
- ((flags & MS_INVALIDATE) ? B_INVAL : 0);
+ ((flags & MS_INVALIDATE) ? B_INVAL : 0) |
+ ((flags & MS_INVALCURPROC) ? (B_INVALCURONLY | B_INVAL) : 0);
if (attr) {
pageprot = attr & ~(SHARED|PRIVATE);
@@ -7279,11 +7281,11 @@ segvn_sync(struct seg *seg, caddr_t addr, size_t len, int attr, uint_t flags)
vpp = &svd->vpage[seg_page(seg, addr)];
} else if (svd->vp && svd->amp == NULL &&
- (flags & MS_INVALIDATE) == 0) {
+ (flags & (MS_INVALIDATE | MS_INVALCURPROC)) == 0) {
/*
- * No attributes, no anonymous pages and MS_INVALIDATE flag
- * is not on, just use one big request.
+ * No attributes, no anonymous pages and MS_INVAL* flags
+ * are not on, just use one big request.
*/
err = VOP_PUTPAGE(svd->vp, (offset_t)offset, len,
bflags, svd->cred, NULL);
@@ -7335,7 +7337,7 @@ segvn_sync(struct seg *seg, caddr_t addr, size_t len, int attr, uint_t flags)
* might race in and lock the page after we unlock and before
* we do the PUTPAGE, then PUTPAGE simply does nothing.
*/
- if (flags & MS_INVALIDATE) {
+ if (flags & (MS_INVALIDATE | MS_INVALCURPROC)) {
if ((pp = page_lookup(vp, off, SE_SHARED)) != NULL) {
if (pp->p_lckcnt != 0 || pp->p_cowcnt != 0) {
page_unlock(pp);
diff --git a/usr/src/uts/common/vm/vm_anon.c b/usr/src/uts/common/vm/vm_anon.c
index fdf9f7790c..21ab9b237c 100644
--- a/usr/src/uts/common/vm/vm_anon.c
+++ b/usr/src/uts/common/vm/vm_anon.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -787,13 +788,21 @@ anon_resvmem(size_t size, boolean_t takemem, zone_t *zone, int tryhard)
pgcnt_t pswap_pages = 0;
proc_t *p = curproc;
- if (zone != NULL && takemem) {
+ if (zone != NULL) {
/* test zone.max-swap resource control */
mutex_enter(&p->p_lock);
if (rctl_incr_swap(p, zone, ptob(npages)) != 0) {
mutex_exit(&p->p_lock);
+
+ if (takemem)
+ atomic_add_64(&zone->zone_anon_alloc_fail, 1);
+
return (0);
}
+
+ if (!takemem)
+ rctl_decr_swap(zone, ptob(npages));
+
mutex_exit(&p->p_lock);
}
mutex_enter(&anoninfo_lock);
diff --git a/usr/src/uts/common/vm/vm_as.c b/usr/src/uts/common/vm/vm_as.c
index 01ad32e0b1..8caa257486 100644
--- a/usr/src/uts/common/vm/vm_as.c
+++ b/usr/src/uts/common/vm/vm_as.c
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -56,6 +57,7 @@
#include <sys/debug.h>
#include <sys/tnf_probe.h>
#include <sys/vtrace.h>
+#include <sys/ddi.h>
#include <vm/hat.h>
#include <vm/xhat.h>
@@ -879,6 +881,7 @@ as_fault(struct hat *hat, struct as *as, caddr_t addr, size_t size,
struct seg *segsav;
int as_lock_held;
klwp_t *lwp = ttolwp(curthread);
+ zone_t *zonep = curzone;
int is_xhat = 0;
int holding_wpage = 0;
extern struct seg_ops segdev_ops;
@@ -928,6 +931,23 @@ retry:
if (as == &kas)
CPU_STATS_ADDQ(CPU, vm, kernel_asflt, 1);
CPU_STATS_EXIT_K();
+ if (zonep->zone_pg_flt_delay != 0) {
+ /*
+ * The zone in which this process is running
+ * is currently over it's physical memory cap.
+ * Throttle page faults to help the user-land
+ * memory capper catch up. Note that
+ * drv_usectohz() rounds up.
+ */
+ atomic_add_64(&zonep->zone_pf_throttle, 1);
+ atomic_add_64(&zonep->zone_pf_throttle_usec,
+ zonep->zone_pg_flt_delay);
+ if (zonep->zone_pg_flt_delay < TICK_TO_USEC(1))
+ drv_usecwait(zonep->zone_pg_flt_delay);
+ else
+ delay(drv_usectohz(
+ zonep->zone_pg_flt_delay));
+ }
break;
}
}
diff --git a/usr/src/uts/common/vm/vm_pvn.c b/usr/src/uts/common/vm/vm_pvn.c
index 7233581227..39ace0b3c2 100644
--- a/usr/src/uts/common/vm/vm_pvn.c
+++ b/usr/src/uts/common/vm/vm_pvn.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -431,7 +432,14 @@ pvn_write_done(page_t *plist, int flags)
page_io_unlock(pp);
page_unlock(pp);
}
- } else if (flags & B_INVAL) {
+ } else if ((flags & (B_INVAL | B_INVALCURONLY)) == B_INVAL) {
+ /*
+ * If B_INVALCURONLY is set, then we handle that case
+ * in the next conditional if hat_page_is_mapped()
+ * indicates that there are no additional mappings
+ * to the page.
+ */
+
/*
* XXX - Failed writes with B_INVAL set are
* not handled appropriately.
@@ -572,8 +580,9 @@ pvn_write_done(page_t *plist, int flags)
}
/*
- * Flags are composed of {B_ASYNC, B_INVAL, B_FREE, B_DONTNEED, B_DELWRI,
- * B_TRUNC, B_FORCE}. B_DELWRI indicates that this page is part of a kluster
+ * Flags are composed of {B_ASYNC, B_INVAL, B_INVALCURONLY, B_FREE,
+ * B_DONTNEED, B_DELWRI, B_TRUNC, B_FORCE}.
+ * B_DELWRI indicates that this page is part of a kluster
* operation and is only to be considered if it doesn't involve any
* waiting here. B_TRUNC indicates that the file is being truncated
* and so no i/o needs to be done. B_FORCE indicates that the page
@@ -627,13 +636,17 @@ pvn_getdirty(page_t *pp, int flags)
* If we want to free or invalidate the page then
* we need to unload it so that anyone who wants
* it will have to take a minor fault to get it.
+ * If we are only invalidating the page for the
+ * current process, then pass in a different flag.
* Otherwise, we're just writing the page back so we
* need to sync up the hardwre and software mod bit to
* detect any future modifications. We clear the
* software mod bit when we put the page on the dirty
* list.
*/
- if (flags & (B_INVAL | B_FREE)) {
+ if (flags & B_INVALCURONLY) {
+ (void) hat_pageunload(pp, HAT_CURPROC_PGUNLOAD);
+ } else if (flags & (B_INVAL | B_FREE)) {
(void) hat_pageunload(pp, HAT_FORCE_PGUNLOAD);
} else {
(void) hat_pagesync(pp, HAT_SYNC_ZERORM);
@@ -645,7 +658,7 @@ pvn_getdirty(page_t *pp, int flags)
* list after all.
*/
page_io_unlock(pp);
- if (flags & B_INVAL) {
+ if ((flags & (B_INVAL | B_INVALCURONLY)) == B_INVAL) {
/*LINTED: constant in conditional context*/
VN_DISPOSE(pp, B_INVAL, 0, kcred);
} else if (flags & B_FREE) {
@@ -657,6 +670,9 @@ pvn_getdirty(page_t *pp, int flags)
* of VOP_PUTPAGE() who prefer freeing the
* page _only_ if no one else is accessing it.
* E.g. segmap_release()
+ * We also take this path for B_INVALCURONLY and
+ * let page_release call VN_DISPOSE if no one else is
+ * using the page.
*
* The above hat_ismod() check is useless because:
* (1) we may not be holding SE_EXCL lock;
@@ -681,7 +697,7 @@ pvn_getdirty(page_t *pp, int flags)
* We'll detect the fact that they used it when the
* i/o is done and avoid freeing the page.
*/
- if (flags & B_FREE)
+ if (flags & (B_FREE | B_INVALCURONLY))
page_downgrade(pp);
diff --git a/usr/src/uts/common/vm/vm_usage.c b/usr/src/uts/common/vm/vm_usage.c
index d422f8d0e8..8f425e9e4f 100644
--- a/usr/src/uts/common/vm/vm_usage.c
+++ b/usr/src/uts/common/vm/vm_usage.c
@@ -25,6 +25,10 @@
*/
/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+/*
* vm_usage
*
* This file implements the getvmusage() private system call.
@@ -114,7 +118,7 @@
* For accurate counting of map-shared and COW-shared pages.
*
* - visited private anons (refcnt > 1) for each collective.
- * (entity->vme_anon_hash)
+ * (entity->vme_anon)
* For accurate counting of COW-shared pages.
*
* The common accounting structure is the vmu_entity_t, which represents
@@ -152,6 +156,7 @@
#include <sys/vm_usage.h>
#include <sys/zone.h>
#include <sys/sunddi.h>
+#include <sys/sysmacros.h>
#include <sys/avl.h>
#include <vm/anon.h>
#include <vm/as.h>
@@ -199,6 +204,14 @@ typedef struct vmu_object {
} vmu_object_t;
/*
+ * Node for tree of visited COW anons.
+ */
+typedef struct vmu_anon {
+ avl_node_t vma_node;
+ uintptr_t vma_addr;
+} vmu_anon_t;
+
+/*
* Entity by which to count results.
*
* The entity structure keeps the current rss/swap counts for each entity
@@ -221,7 +234,7 @@ typedef struct vmu_entity {
struct vmu_entity *vme_next_calc;
mod_hash_t *vme_vnode_hash; /* vnodes visited for entity */
mod_hash_t *vme_amp_hash; /* shared amps visited for entity */
- mod_hash_t *vme_anon_hash; /* COW anons visited for entity */
+ avl_tree_t vme_anon; /* COW anons visited for entity */
vmusage_t vme_result; /* identifies entity and results */
} vmu_entity_t;
@@ -324,6 +337,23 @@ bounds_cmp(const void *bnd1, const void *bnd2)
}
/*
+ * Comparison routine for our AVL tree of anon structures.
+ */
+static int
+vmu_anon_cmp(const void *lhs, const void *rhs)
+{
+ const vmu_anon_t *l = lhs, *r = rhs;
+
+ if (l->vma_addr == r->vma_addr)
+ return (0);
+
+ if (l->vma_addr < r->vma_addr)
+ return (-1);
+
+ return (1);
+}
+
+/*
* Save a bound on the free list.
*/
static void
@@ -363,13 +393,18 @@ static void
vmu_free_entity(mod_hash_val_t val)
{
vmu_entity_t *entity = (vmu_entity_t *)val;
+ vmu_anon_t *anon;
+ void *cookie = NULL;
if (entity->vme_vnode_hash != NULL)
i_mod_hash_clear_nosync(entity->vme_vnode_hash);
if (entity->vme_amp_hash != NULL)
i_mod_hash_clear_nosync(entity->vme_amp_hash);
- if (entity->vme_anon_hash != NULL)
- i_mod_hash_clear_nosync(entity->vme_anon_hash);
+
+ while ((anon = avl_destroy_nodes(&entity->vme_anon, &cookie)) != NULL)
+ kmem_free(anon, sizeof (vmu_anon_t));
+
+ avl_destroy(&entity->vme_anon);
entity->vme_next = vmu_data.vmu_free_entities;
vmu_data.vmu_free_entities = entity;
@@ -485,10 +520,10 @@ vmu_alloc_entity(id_t id, int type, id_t zoneid)
"vmusage amp hash", VMUSAGE_HASH_SIZE, vmu_free_object,
sizeof (struct anon_map));
- if (entity->vme_anon_hash == NULL)
- entity->vme_anon_hash = mod_hash_create_ptrhash(
- "vmusage anon hash", VMUSAGE_HASH_SIZE,
- mod_hash_null_valdtor, sizeof (struct anon));
+ VERIFY(avl_first(&entity->vme_anon) == NULL);
+
+ avl_create(&entity->vme_anon, vmu_anon_cmp, sizeof (struct vmu_anon),
+ offsetof(struct vmu_anon, vma_node));
entity->vme_next = vmu_data.vmu_entities;
vmu_data.vmu_entities = entity;
@@ -518,7 +553,8 @@ vmu_alloc_zone(id_t id)
zone->vmz_id = id;
- if ((vmu_data.vmu_calc_flags & (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES)) != 0)
+ if ((vmu_data.vmu_calc_flags &
+ (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES | VMUSAGE_A_ZONE)) != 0)
zone->vmz_zone = vmu_alloc_entity(id, VMUSAGE_ZONE, id);
if ((vmu_data.vmu_calc_flags & (VMUSAGE_PROJECTS |
@@ -613,21 +649,19 @@ vmu_find_insert_object(mod_hash_t *hash, caddr_t key, uint_t type)
}
static int
-vmu_find_insert_anon(mod_hash_t *hash, caddr_t key)
+vmu_find_insert_anon(vmu_entity_t *entity, void *key)
{
- int ret;
- caddr_t val;
+ vmu_anon_t anon, *ap;
- ret = i_mod_hash_find_nosync(hash, (mod_hash_key_t)key,
- (mod_hash_val_t *)&val);
+ anon.vma_addr = (uintptr_t)key;
- if (ret == 0)
+ if (avl_find(&entity->vme_anon, &anon, NULL) != NULL)
return (0);
- ret = i_mod_hash_insert_nosync(hash, (mod_hash_key_t)key,
- (mod_hash_val_t)key, (mod_hash_hndl_t)0);
+ ap = kmem_alloc(sizeof (vmu_anon_t), KM_SLEEP);
+ ap->vma_addr = (uintptr_t)key;
- ASSERT(ret == 0);
+ avl_add(&entity->vme_anon, ap);
return (1);
}
@@ -937,7 +971,10 @@ vmu_amp_update_incore_bounds(avl_tree_t *tree, struct anon_map *amp,
if (ap != NULL && vn != NULL && vn->v_pages != NULL &&
(page = page_exists(vn, off)) != NULL) {
- page_type = VMUSAGE_BOUND_INCORE;
+ if (PP_ISFREE(page))
+ page_type = VMUSAGE_BOUND_NOT_INCORE;
+ else
+ page_type = VMUSAGE_BOUND_INCORE;
if (page->p_szc > 0) {
pgcnt = page_get_pagecnt(page->p_szc);
pgshft = page_get_shift(page->p_szc);
@@ -1024,7 +1061,10 @@ vmu_vnode_update_incore_bounds(avl_tree_t *tree, vnode_t *vnode,
if (vnode->v_pages != NULL &&
(page = page_exists(vnode, ptob(index))) != NULL) {
- page_type = VMUSAGE_BOUND_INCORE;
+ if (PP_ISFREE(page))
+ page_type = VMUSAGE_BOUND_NOT_INCORE;
+ else
+ page_type = VMUSAGE_BOUND_INCORE;
if (page->p_szc > 0) {
pgcnt = page_get_pagecnt(page->p_szc);
pgshft = page_get_shift(page->p_szc);
@@ -1304,6 +1344,12 @@ vmu_calculate_seg(vmu_entity_t *vmu_entities, struct seg *seg)
}
/*
+ * Pages on the free list aren't counted for the rss.
+ */
+ if (PP_ISFREE(page))
+ continue;
+
+ /*
* Assume anon structs with a refcnt
* of 1 are not COW shared, so there
* is no reason to track them per entity.
@@ -1320,8 +1366,7 @@ vmu_calculate_seg(vmu_entity_t *vmu_entities, struct seg *seg)
* Track COW anons per entity so
* they are not double counted.
*/
- if (vmu_find_insert_anon(entity->vme_anon_hash,
- (caddr_t)ap) == 0)
+ if (vmu_find_insert_anon(entity, ap) == 0)
continue;
result->vmu_rss_all += (pgcnt << PAGESHIFT);
@@ -1461,8 +1506,9 @@ vmu_calculate_proc(proc_t *p)
entities = tmp;
}
if (vmu_data.vmu_calc_flags &
- (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES | VMUSAGE_PROJECTS |
- VMUSAGE_ALL_PROJECTS | VMUSAGE_TASKS | VMUSAGE_ALL_TASKS |
+ (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES | VMUSAGE_A_ZONE |
+ VMUSAGE_PROJECTS | VMUSAGE_ALL_PROJECTS |
+ VMUSAGE_TASKS | VMUSAGE_ALL_TASKS |
VMUSAGE_RUSERS | VMUSAGE_ALL_RUSERS | VMUSAGE_EUSERS |
VMUSAGE_ALL_EUSERS)) {
ret = i_mod_hash_find_nosync(vmu_data.vmu_zones_hash,
@@ -1594,8 +1640,7 @@ vmu_free_extra()
mod_hash_destroy_hash(te->vme_vnode_hash);
if (te->vme_amp_hash != NULL)
mod_hash_destroy_hash(te->vme_amp_hash);
- if (te->vme_anon_hash != NULL)
- mod_hash_destroy_hash(te->vme_anon_hash);
+ VERIFY(avl_first(&te->vme_anon) == NULL);
kmem_free(te, sizeof (vmu_entity_t));
}
while (vmu_data.vmu_free_zones != NULL) {
@@ -1739,12 +1784,34 @@ vmu_cache_rele(vmu_cache_t *cache)
}
/*
+ * When new data is calculated, update the phys_mem rctl usage value in the
+ * zones.
+ */
+static void
+vmu_update_zone_rctls(vmu_cache_t *cache)
+{
+ vmusage_t *rp;
+ size_t i = 0;
+ zone_t *zp;
+
+ for (rp = cache->vmc_results; i < cache->vmc_nresults; rp++, i++) {
+ if (rp->vmu_type == VMUSAGE_ZONE &&
+ rp->vmu_zoneid != ALL_ZONES) {
+ if ((zp = zone_find_by_id(rp->vmu_zoneid)) != NULL) {
+ zp->zone_phys_mem = rp->vmu_rss_all;
+ zone_rele(zp);
+ }
+ }
+ }
+}
+
+/*
* Copy out the cached results to a caller. Inspect the callers flags
* and zone to determine which cached results should be copied.
*/
static int
vmu_copyout_results(vmu_cache_t *cache, vmusage_t *buf, size_t *nres,
- uint_t flags, int cpflg)
+ uint_t flags, id_t req_zone_id, int cpflg)
{
vmusage_t *result, *out_result;
vmusage_t dummy;
@@ -1763,7 +1830,7 @@ vmu_copyout_results(vmu_cache_t *cache, vmusage_t *buf, size_t *nres,
/* figure out what results the caller is interested in. */
if ((flags & VMUSAGE_SYSTEM) && curproc->p_zone == global_zone)
types |= VMUSAGE_SYSTEM;
- if (flags & (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES))
+ if (flags & (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES | VMUSAGE_A_ZONE))
types |= VMUSAGE_ZONE;
if (flags & (VMUSAGE_PROJECTS | VMUSAGE_ALL_PROJECTS |
VMUSAGE_COL_PROJECTS))
@@ -1826,26 +1893,33 @@ vmu_copyout_results(vmu_cache_t *cache, vmusage_t *buf, size_t *nres,
continue;
}
- /* Skip "other zone" results if not requested */
- if (result->vmu_zoneid != curproc->p_zone->zone_id) {
- if (result->vmu_type == VMUSAGE_ZONE &&
- (flags & VMUSAGE_ALL_ZONES) == 0)
- continue;
- if (result->vmu_type == VMUSAGE_PROJECTS &&
- (flags & (VMUSAGE_ALL_PROJECTS |
- VMUSAGE_COL_PROJECTS)) == 0)
- continue;
- if (result->vmu_type == VMUSAGE_TASKS &&
- (flags & VMUSAGE_ALL_TASKS) == 0)
- continue;
- if (result->vmu_type == VMUSAGE_RUSERS &&
- (flags & (VMUSAGE_ALL_RUSERS |
- VMUSAGE_COL_RUSERS)) == 0)
- continue;
- if (result->vmu_type == VMUSAGE_EUSERS &&
- (flags & (VMUSAGE_ALL_EUSERS |
- VMUSAGE_COL_EUSERS)) == 0)
+ if (result->vmu_type == VMUSAGE_ZONE &&
+ flags & VMUSAGE_A_ZONE) {
+ /* Skip non-requested zone results */
+ if (result->vmu_zoneid != req_zone_id)
continue;
+ } else {
+ /* Skip "other zone" results if not requested */
+ if (result->vmu_zoneid != curproc->p_zone->zone_id) {
+ if (result->vmu_type == VMUSAGE_ZONE &&
+ (flags & VMUSAGE_ALL_ZONES) == 0)
+ continue;
+ if (result->vmu_type == VMUSAGE_PROJECTS &&
+ (flags & (VMUSAGE_ALL_PROJECTS |
+ VMUSAGE_COL_PROJECTS)) == 0)
+ continue;
+ if (result->vmu_type == VMUSAGE_TASKS &&
+ (flags & VMUSAGE_ALL_TASKS) == 0)
+ continue;
+ if (result->vmu_type == VMUSAGE_RUSERS &&
+ (flags & (VMUSAGE_ALL_RUSERS |
+ VMUSAGE_COL_RUSERS)) == 0)
+ continue;
+ if (result->vmu_type == VMUSAGE_EUSERS &&
+ (flags & (VMUSAGE_ALL_EUSERS |
+ VMUSAGE_COL_EUSERS)) == 0)
+ continue;
+ }
}
count++;
if (out_result != NULL) {
@@ -1901,10 +1975,12 @@ vm_getusage(uint_t flags, time_t age, vmusage_t *buf, size_t *nres, int cpflg)
int cacherecent = 0;
hrtime_t now;
uint_t flags_orig;
+ id_t req_zone_id;
/*
* Non-global zones cannot request system wide and/or collated
- * results, or the system result, so munge the flags accordingly.
+ * results, or the system result, or usage of another zone, so munge
+ * the flags accordingly.
*/
flags_orig = flags;
if (curproc->p_zone != global_zone) {
@@ -1924,6 +2000,10 @@ vm_getusage(uint_t flags, time_t age, vmusage_t *buf, size_t *nres, int cpflg)
flags &= ~VMUSAGE_SYSTEM;
flags |= VMUSAGE_ZONE;
}
+ if (flags & VMUSAGE_A_ZONE) {
+ flags &= ~VMUSAGE_A_ZONE;
+ flags |= VMUSAGE_ZONE;
+ }
}
/* Check for unknown flags */
@@ -1934,6 +2014,21 @@ vm_getusage(uint_t flags, time_t age, vmusage_t *buf, size_t *nres, int cpflg)
if ((flags & VMUSAGE_MASK) == 0)
return (set_errno(EINVAL));
+ /* If requesting results for a specific zone, get the zone ID */
+ if (flags & VMUSAGE_A_ZONE) {
+ size_t bufsize;
+ vmusage_t zreq;
+
+ if (ddi_copyin((caddr_t)nres, &bufsize, sizeof (size_t), cpflg))
+ return (set_errno(EFAULT));
+ /* Requested zone ID is passed in buf, so 0 len not allowed */
+ if (bufsize == 0)
+ return (set_errno(EINVAL));
+ if (ddi_copyin((caddr_t)buf, &zreq, sizeof (vmusage_t), cpflg))
+ return (set_errno(EFAULT));
+ req_zone_id = zreq.vmu_id;
+ }
+
mutex_enter(&vmu_data.vmu_lock);
now = gethrtime();
@@ -1953,7 +2048,7 @@ start:
mutex_exit(&vmu_data.vmu_lock);
ret = vmu_copyout_results(cache, buf, nres, flags_orig,
- cpflg);
+ req_zone_id, cpflg);
mutex_enter(&vmu_data.vmu_lock);
vmu_cache_rele(cache);
if (vmu_data.vmu_pending_waiters > 0)
@@ -2009,8 +2104,11 @@ start:
mutex_exit(&vmu_data.vmu_lock);
+ /* update zone's phys. mem. rctl usage */
+ vmu_update_zone_rctls(cache);
/* copy cache */
- ret = vmu_copyout_results(cache, buf, nres, flags_orig, cpflg);
+ ret = vmu_copyout_results(cache, buf, nres, flags_orig,
+ req_zone_id, cpflg);
mutex_enter(&vmu_data.vmu_lock);
vmu_cache_rele(cache);
mutex_exit(&vmu_data.vmu_lock);
diff --git a/usr/src/uts/i86pc/Makefile.rules b/usr/src/uts/i86pc/Makefile.rules
index 84158a06bd..a0207714f7 100644
--- a/usr/src/uts/i86pc/Makefile.rules
+++ b/usr/src/uts/i86pc/Makefile.rules
@@ -220,7 +220,7 @@ DBOOT_DEFS = -D_BOOT $(DBOOT_MACH_$(CLASS))
DBOOT_DEFS += -D_MACHDEP -D_KMEMUSER -U_KERNEL -D_I32LPx
DBOOT_FLAGS = $(CCVERBOSE) $(CERRWARN) $(CCNOAUTOINLINE)
-DBOOT_CC_INCL = -I$(SRC)/common $(INCLUDE_PATH)
+DBOOT_CC_INCL = -I$(SRC)/common -I$(SRC)/common/util $(INCLUDE_PATH)
DBOOT_AS_INCL = $(AS_INC_PATH)
DBOOT_AS = $(ONBLD_TOOLS)/bin/$(MACH)/aw
diff --git a/usr/src/uts/i86pc/dboot/dboot_startkern.c b/usr/src/uts/i86pc/dboot/dboot_startkern.c
index f5f8f95682..6abb7c6349 100644
--- a/usr/src/uts/i86pc/dboot/dboot_startkern.c
+++ b/usr/src/uts/i86pc/dboot/dboot_startkern.c
@@ -23,7 +23,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
- * Copyright 2012 Joyent, Inc. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
@@ -34,6 +34,8 @@
#include <sys/mach_mmu.h>
#include <sys/multiboot.h>
#include <sys/sha1.h>
+#include <util/string.h>
+#include <util/strtolctype.h>
#if defined(__xpv)
@@ -61,6 +63,15 @@ extern int have_cpuid(void);
#define SHA1_ASCII_LENGTH (SHA1_DIGEST_LENGTH * 2)
/*
+ * Region of memory that may be corrupted by external actors. This can go away
+ * once the firmware bug RICHMOND-16 is fixed and all systems with the bug are
+ * upgraded.
+ */
+#define CORRUPT_REGION_START 0xc700000
+#define CORRUPT_REGION_SIZE 0x100000
+#define CORRUPT_REGION_END (CORRUPT_REGION_START + CORRUPT_REGION_SIZE)
+
+/*
* This file contains code that runs to transition us from either a multiboot
* compliant loader (32 bit non-paging) or a XPV domain loader to
* regular kernel execution. Its task is to setup the kernel memory image
@@ -162,8 +173,12 @@ uint_t pcimemlists_used = 0;
struct boot_memlist rsvdmemlists[MAX_MEMLIST];
uint_t rsvdmemlists_used = 0;
-#define MAX_MODULES (10)
-struct boot_modules modules[MAX_MODULES];
+/*
+ * This should match what's in the bootloader. It's arbitrary, but GRUB
+ * in particular has limitations on how much space it can use before it
+ * stops working properly. This should be enough.
+ */
+struct boot_modules modules[MAX_BOOT_MODULES];
uint_t modules_used = 0;
/*
@@ -172,6 +187,8 @@ uint_t modules_used = 0;
uint_t prom_debug = 0;
uint_t map_debug = 0;
+static char noname[2] = "-";
+
/*
* Either hypervisor-specific or grub-specific code builds the initial
* memlists. This code does the sort/merge/link for final use.
@@ -805,13 +822,20 @@ digest_a2h(const char *ascii, uint8_t *digest)
* 4 GB, which should not be a problem.
*/
static int
-check_image_hash(const char *ascii, const void *image, size_t len)
+check_image_hash(uint_t midx)
{
+ const char *ascii;
+ const void *image;
+ size_t len;
SHA1_CTX ctx;
uint8_t digest[SHA1_DIGEST_LENGTH];
uint8_t baseline[SHA1_DIGEST_LENGTH];
unsigned int i;
+ ascii = (const char *)(uintptr_t)modules[midx].bm_hash;
+ image = (const void *)(uintptr_t)modules[midx].bm_addr;
+ len = (size_t)modules[midx].bm_size;
+
digest_a2h(ascii, baseline);
SHA1Init(&ctx);
@@ -826,16 +850,80 @@ check_image_hash(const char *ascii, const void *image, size_t len)
return (0);
}
+static const char *
+type_to_str(boot_module_type_t type)
+{
+ switch (type) {
+ case BMT_ROOTFS:
+ return ("rootfs");
+ case BMT_FILE:
+ return ("file");
+ case BMT_HASH:
+ return ("hash");
+ default:
+ return ("unknown");
+ }
+}
+
static void
check_images(void)
{
- int i;
- char *hashes;
- mb_module_t *mod, *hashmod;
- char *hash;
+ uint_t i;
char displayhash[SHA1_ASCII_LENGTH + 1];
- size_t hashlen;
- size_t len;
+
+ for (i = 0; i < modules_used; i++) {
+ if (prom_debug) {
+ dboot_printf("module #%d: name %s type %s "
+ "addr %lx size %lx\n",
+ i, (char *)(uintptr_t)modules[i].bm_name,
+ type_to_str(modules[i].bm_type),
+ (ulong_t)modules[i].bm_addr,
+ (ulong_t)modules[i].bm_size);
+ }
+
+ if (modules[i].bm_type == BMT_HASH ||
+ modules[i].bm_hash == NULL) {
+ DBG_MSG("module has no hash; skipping check\n");
+ continue;
+ }
+ (void) memcpy(displayhash,
+ (void *)(uintptr_t)modules[i].bm_hash,
+ SHA1_ASCII_LENGTH);
+ displayhash[SHA1_ASCII_LENGTH] = '\0';
+ if (prom_debug) {
+ dboot_printf("checking expected hash [%s]: ",
+ displayhash);
+ }
+
+ if (check_image_hash(i) != 0)
+ dboot_panic("hash mismatch!\n");
+ else
+ DBG_MSG("OK\n");
+ }
+}
+
+/*
+ * Determine the module's starting address, size, name, and type, and fill the
+ * boot_modules structure. This structure is used by the bop code, except for
+ * hashes which are checked prior to transferring control to the kernel.
+ */
+static void
+process_module(mb_module_t *mod)
+{
+ int midx = modules_used++;
+ char *p, *q;
+
+ if (prom_debug) {
+ dboot_printf("\tmodule #%d: '%s' at 0x%lx, end 0x%lx\n",
+ midx, (char *)(mod->mod_name),
+ (ulong_t)mod->mod_start, (ulong_t)mod->mod_end);
+ }
+
+ if (mod->mod_start > mod->mod_end) {
+ dboot_panic("module #%d: module start address 0x%lx greater "
+ "than end address 0x%lx", midx,
+ (ulong_t)mod->mod_start, (ulong_t)mod->mod_end);
+ }
/*
* A brief note on lengths and sizes: GRUB, for reasons unknown, passes
@@ -851,47 +939,128 @@ check_images(void)
* we'll just cope with the bug. That means we won't actually hash the
* byte at mod_end, and we will expect that mod_end for the hash file
* itself is one greater than some multiple of 41 (40 bytes of ASCII
- * hash plus a newline for each module).
+ * hash plus a newline for each module). We set bm_size to the true
+ * correct number of bytes in each module, achieving exactly this.
*/
- if (mb_info->mods_count > 1) {
- mod = (mb_module_t *)mb_info->mods_addr;
- hashmod = mod + (mb_info->mods_count - 1);
- hashes = (char *)hashmod->mod_start;
- hashlen = (size_t)(hashmod->mod_end - hashmod->mod_start);
- hash = hashes;
- if (prom_debug) {
- dboot_printf("Hash module found at %lx size %lx\n",
- (ulong_t)hashes, (ulong_t)hashlen);
- }
- } else {
- DBG_MSG("Skipping hash check; no hash module found.\n");
+ modules[midx].bm_addr = mod->mod_start;
+ modules[midx].bm_size = mod->mod_end - mod->mod_start;
+ modules[midx].bm_name = mod->mod_name;
+ modules[midx].bm_hash = NULL;
+ modules[midx].bm_type = BMT_FILE;
+
+ if (mod->mod_name == NULL) {
+ modules[midx].bm_name = (native_ptr_t)(uintptr_t)noname;
return;
}
- for (mod = (mb_module_t *)(mb_info->mods_addr), i = 0;
- i < mb_info->mods_count - 1; ++mod, ++i) {
- if ((hash - hashes) + SHA1_ASCII_LENGTH + 1 > hashlen) {
- dboot_printf("Short hash module of length 0x%lx bytes; "
- "skipping hash checks\n", (ulong_t)hashlen);
- break;
+ p = (char *)(uintptr_t)mod->mod_name;
+ modules[midx].bm_name =
+ (native_ptr_t)(uintptr_t)strsep(&p, " \t\f\n\r");
+
+ while (p != NULL) {
+ q = strsep(&p, " \t\f\n\r");
+ if (strncmp(q, "name=", 5) == 0) {
+ if (q[5] != '\0' && !isspace(q[5])) {
+ modules[midx].bm_name =
+ (native_ptr_t)(uintptr_t)(q + 5);
+ }
+ continue;
}
- (void) memcpy(displayhash, hash, SHA1_ASCII_LENGTH);
- displayhash[SHA1_ASCII_LENGTH] = '\0';
- if (prom_debug) {
- dboot_printf("Checking hash for module %d [%s]: ",
- i, displayhash);
+ if (strncmp(q, "type=", 5) == 0) {
+ if (q[5] == '\0' || isspace(q[5]))
+ continue;
+ q += 5;
+ if (strcmp(q, "rootfs") == 0) {
+ modules[midx].bm_type = BMT_ROOTFS;
+ } else if (strcmp(q, "hash") == 0) {
+ modules[midx].bm_type = BMT_HASH;
+ } else if (strcmp(q, "file") != 0) {
+ dboot_printf("\tmodule #%d: unknown module "
+ "type '%s'; defaulting to 'file'",
+ midx, q);
+ }
+ continue;
}
- len = mod->mod_end - mod->mod_start; /* see above */
- if (check_image_hash(hash, (void *)mod->mod_start, len) != 0) {
- dboot_panic("SHA-1 hash mismatch on %s; expected %s\n",
- (char *)mod->mod_name, displayhash);
- } else {
- DBG_MSG("OK\n");
+ if (strncmp(q, "hash=", 5) == 0) {
+ if (q[5] != '\0' && !isspace(q[5])) {
+ modules[midx].bm_hash =
+ (native_ptr_t)(uintptr_t)(q + 5);
+ }
+ continue;
+ }
+
+ dboot_printf("ignoring unknown option '%s'\n", q);
+ }
+}
+
+/*
+ * Backward compatibility: if there are exactly one or two modules, both
+ * of type 'file' and neither with an embedded hash value, we have been
+ * given the legacy style modules. In this case we need to treat the first
+ * module as a rootfs and the second as a hash referencing that module.
+ * Otherwise, even if the configuration is invalid, we assume that the
+ * operator knows what he's doing or at least isn't being bitten by this
+ * interface change.
+ */
+static void
+fixup_modules(void)
+{
+ if (modules_used == 0 || modules_used > 2)
+ return;
+
+ if (modules[0].bm_type != BMT_FILE ||
+ modules_used > 1 && modules[1].bm_type != BMT_FILE) {
+ return;
+ }
+
+ if (modules[0].bm_hash != NULL ||
+ modules_used > 1 && modules[1].bm_hash != NULL) {
+ return;
+ }
+
+ modules[0].bm_type = BMT_ROOTFS;
+ if (modules_used > 1) {
+ modules[1].bm_type = BMT_HASH;
+ modules[1].bm_name = modules[0].bm_name;
+ }
+}
+
+/*
+ * For modules that do not have assigned hashes but have a separate hash module,
+ * find the assigned hash module and set the primary module's bm_hash to point
+ * to the hash data from that module. We will then ignore modules of type
+ * BMT_HASH from this point forward.
+ */
+static void
+assign_module_hashes(void)
+{
+ uint_t i, j;
+
+ for (i = 0; i < modules_used; i++) {
+ if (modules[i].bm_type == BMT_HASH ||
+ modules[i].bm_hash != NULL) {
+ continue;
+ }
+
+ for (j = 0; j < modules_used; j++) {
+ if (modules[j].bm_type != BMT_HASH ||
+ strcmp((char *)(uintptr_t)modules[j].bm_name,
+ (char *)(uintptr_t)modules[i].bm_name) != 0) {
+ continue;
+ }
+
+ if (modules[j].bm_size < SHA1_ASCII_LENGTH) {
+ dboot_printf("Short hash module of length "
+ "0x%lx bytes; ignoring\n",
+ (ulong_t)modules[j].bm_size);
+ } else {
+ modules[i].bm_hash = modules[j].bm_addr;
+ }
+ break;
}
- hash += SHA1_ASCII_LENGTH + 1;
}
}
@@ -927,9 +1096,9 @@ init_mem_alloc(void)
DBG_MSG("Entered init_mem_alloc()\n");
DBG((uintptr_t)mb_info);
- if (mb_info->mods_count > MAX_MODULES) {
+ if (mb_info->mods_count > MAX_BOOT_MODULES) {
dboot_panic("Too many modules (%d) -- the maximum is %d.",
- mb_info->mods_count, MAX_MODULES);
+ mb_info->mods_count, MAX_BOOT_MODULES);
}
/*
* search the modules to find the last used address
@@ -940,18 +1109,7 @@ init_mem_alloc(void)
for (mod = (mb_module_t *)(mb_info->mods_addr), i = 0;
i < mb_info->mods_count;
++mod, ++i) {
- if (prom_debug) {
- dboot_printf("\tmodule #%d: %s at: 0x%lx, end 0x%lx\n",
- i, (char *)(mod->mod_name),
- (ulong_t)mod->mod_start, (ulong_t)mod->mod_end);
- }
- modules[i].bm_addr = mod->mod_start;
- if (mod->mod_start > mod->mod_end) {
- dboot_panic("module[%d]: Invalid module start address "
- "(0x%llx)", i, (uint64_t)mod->mod_start);
- }
- modules[i].bm_size = mod->mod_end - mod->mod_start;
-
+ process_module(mod);
check_higher(mod->mod_end);
}
bi->bi_modules = (native_ptr_t)(uintptr_t)modules;
@@ -959,6 +1117,8 @@ init_mem_alloc(void)
bi->bi_module_cnt = mb_info->mods_count;
DBG(bi->bi_module_cnt);
+ fixup_modules();
+ assign_module_hashes();
check_images();
/*
@@ -1004,6 +1164,38 @@ init_mem_alloc(void)
case 1:
if (end > max_mem)
max_mem = end;
+
+ /*
+ * Well, this is sad. One some systems, there
+ * is a region of memory that can be corrupted
+ * until some number of seconds after we have
+ * booted. And the BIOS doesn't tell us that
+ * this memory is unsafe to use. And we don't
+ * know how long it's dangerous. So we'll
+ * chop out this range from any memory list
+ * that would otherwise be usable. Note that
+ * any system of this type will give us the
+ * new-style (0x40) memlist, so we need not
+ * fix up the other path below.
+ */
+ if (start < CORRUPT_REGION_START &&
+ end > CORRUPT_REGION_START) {
+ memlists[memlists_used].addr = start;
+ memlists[memlists_used].size =
+ CORRUPT_REGION_START - start;
+ ++memlists_used;
+ if (end > CORRUPT_REGION_END)
+ start = CORRUPT_REGION_END;
+ else
+ continue;
+ }
+ if (start >= CORRUPT_REGION_START &&
+ start < CORRUPT_REGION_END) {
+ if (end <= CORRUPT_REGION_END)
+ continue;
+ start = CORRUPT_REGION_END;
+ }
+
memlists[memlists_used].addr = start;
memlists[memlists_used].size = end - start;
++memlists_used;
diff --git a/usr/src/uts/i86pc/io/ppm/acpisleep.c b/usr/src/uts/i86pc/io/ppm/acpisleep.c
index b86f3ad963..8d9e8d42ba 100644
--- a/usr/src/uts/i86pc/io/ppm/acpisleep.c
+++ b/usr/src/uts/i86pc/io/ppm/acpisleep.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -56,6 +57,19 @@
int acpi_rtc_wake = 0x0; /* wake in N seconds */
+/*
+ * Execute optional ACPI methods for suspend/resume.
+ * The value can be ACPI_EXECUTE_GTS and/or ACPI_EXECUTE_BFS.
+ * Global so it can be set in /etc/system.
+ * From usr/src/uts/intel/io/acpica/changes.txt:
+ * It has been seen on some systems where the execution of these
+ * methods causes errors and also prevents the machine from entering S5.
+ * It is therefore suggested that host operating systems do not execute
+ * these methods by default. In the future, perhaps these methods can be
+ * optionally executed based on the age of the system...
+ */
+int acpi_sleep_flags = ACPI_NO_OPTIONAL_METHODS;
+
#if 0 /* debug */
static uint8_t branchbuf[64 * 1024]; /* for the HDT branch trace stuff */
#endif /* debug */
@@ -144,8 +158,9 @@ acpi_enter_sleepstate(s3a_t *s3ap)
* Tell the hardware to sleep.
*/
PT(PT_SXE);
- PMD(PMD_SX, ("Calling AcpiEnterSleepState(%d) ...\n", Sx))
- if (AcpiEnterSleepState(Sx) != AE_OK) {
+ PMD(PMD_SX, ("Calling AcpiEnterSleepState(%d, %d) ...\n", Sx,
+ acpi_sleep_flags))
+ if (AcpiEnterSleepState(Sx, acpi_sleep_flags) != AE_OK) {
PT(PT_SXE_FAIL);
PMD(PMD_SX, ("... failed!\n"))
}
@@ -165,6 +180,11 @@ acpi_exit_sleepstate(s3a_t *s3ap)
PMD(PMD_SX, ("!We woke up!\n"))
PT(PT_LSS);
+ if (AcpiLeaveSleepStatePrep(Sx, acpi_sleep_flags) != AE_OK) {
+ PT(PT_LSS_FAIL);
+ PMD(PMD_SX, ("Problem with LeaveSleepState!\n"))
+ }
+
if (AcpiLeaveSleepState(Sx) != AE_OK) {
PT(PT_LSS_FAIL);
PMD(PMD_SX, ("Problem with LeaveSleepState!\n"))
diff --git a/usr/src/uts/i86pc/io/psm/psm_common.c b/usr/src/uts/i86pc/io/psm/psm_common.c
index 7a3dd8a733..9c17d85228 100644
--- a/usr/src/uts/i86pc/io/psm/psm_common.c
+++ b/usr/src/uts/i86pc/io/psm/psm_common.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -979,7 +980,7 @@ acpi_poweroff(void)
return (1);
}
ACPI_DISABLE_IRQS();
- status = AcpiEnterSleepState(5);
+ status = AcpiEnterSleepState(5, ACPI_NO_OPTIONAL_METHODS);
ACPI_ENABLE_IRQS();
/* we should be off; if we get here it's an error */
diff --git a/usr/src/uts/i86pc/os/cpr_impl.c b/usr/src/uts/i86pc/os/cpr_impl.c
index acc78eaa14..0e5261eb1f 100644
--- a/usr/src/uts/i86pc/os/cpr_impl.c
+++ b/usr/src/uts/i86pc/os/cpr_impl.c
@@ -753,6 +753,20 @@ i_cpr_is_supported(int sleeptype)
if (sleeptype != CPR_TORAM)
return (0);
+ /*
+ * Unfortunately, the x86 resume code was never implemented for GAS.
+ * The only obvious problem is that a trick necessary to appease Sun
+ * Studio does the wrong thing for GAS. Doubley unfortunate is that
+ * the condition used to detect GAS is incorrect, so we do in fact
+ * compile the Studio path, it just immediately fails in resume.
+ *
+ * Given that, if we were built using GCC, never allow CPR to be
+ * attempted.
+ */
+#ifdef __GNUC__
+ return (0);
+#endif
+
/*
* The next statement tests if a specific platform has turned off
* cpr support.
diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c
index d38bcb046f..8e17a3fcab 100644
--- a/usr/src/uts/i86pc/os/fakebop.c
+++ b/usr/src/uts/i86pc/os/fakebop.c
@@ -22,10 +22,11 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- */
-/*
+ *
* Copyright (c) 2010, Intel Corporation.
* All rights reserved.
+ *
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
@@ -1164,10 +1165,12 @@ build_boot_properties(void)
int name_len;
char *value;
int value_len;
- struct boot_modules *bm;
+ struct boot_modules *bm, *rdbm;
char *propbuf;
int quoted = 0;
int boot_arg_len;
+ uint_t i, midx;
+ char modid[32];
#ifndef __xpv
static int stdout_val = 0;
uchar_t boot_device;
@@ -1185,9 +1188,32 @@ build_boot_properties(void)
DBG((uintptr_t)propbuf);
if (xbootp->bi_module_cnt > 0) {
bm = xbootp->bi_modules;
- bsetprop64("ramdisk_start", (uint64_t)(uintptr_t)bm->bm_addr);
- bsetprop64("ramdisk_end", (uint64_t)(uintptr_t)bm->bm_addr +
- bm->bm_size);
+ rdbm = NULL;
+ for (midx = i = 0; i < xbootp->bi_module_cnt; i++) {
+ if (bm[i].bm_type == BMT_ROOTFS) {
+ rdbm = &bm[i];
+ continue;
+ }
+ if (bm[i].bm_type == BMT_HASH || bm[i].bm_name == NULL)
+ continue;
+
+ (void) snprintf(modid, sizeof (modid),
+ "module-name-%u", midx);
+ bsetprops(modid, (char *)bm[i].bm_name);
+ (void) snprintf(modid, sizeof (modid),
+ "module-addr-%u", midx);
+ bsetprop64(modid, (uint64_t)(uintptr_t)bm[i].bm_addr);
+ (void) snprintf(modid, sizeof (modid),
+ "module-size-%u", midx);
+ bsetprop64(modid, (uint64_t)bm[i].bm_size);
+ ++midx;
+ }
+ if (rdbm != NULL) {
+ bsetprop64("ramdisk_start",
+ (uint64_t)(uintptr_t)rdbm->bm_addr);
+ bsetprop64("ramdisk_end",
+ (uint64_t)(uintptr_t)rdbm->bm_addr + rdbm->bm_size);
+ }
}
DBG_MSG("Parsing command line for boot properties\n");
diff --git a/usr/src/uts/i86pc/os/ibft.c b/usr/src/uts/i86pc/os/ibft.c
index 43ffad5e81..bcb8c06d58 100644
--- a/usr/src/uts/i86pc/os/ibft.c
+++ b/usr/src/uts/i86pc/os/ibft.c
@@ -38,6 +38,7 @@
#include <sys/kmem.h>
#include <sys/psm.h>
#include <sys/bootconf.h>
+#include <sys/reboot.h>
#ifndef NULL
#define NULL 0
@@ -209,6 +210,7 @@ static ibft_status_t iscsi_parse_ibft_NIC(iscsi_ibft_nic_t *nicp);
static ibft_status_t iscsi_parse_ibft_target(char *begin_of_ibft,
iscsi_ibft_tgt_t *tgtp);
+extern int boothowto;
/*
* Return value:
@@ -762,7 +764,9 @@ ld_ib_prop()
* 1) pass "-B ibft-noprobe=1" on kernel command line
* 2) add line "set ibft_noprobe=1" in /etc/system
*/
- cmn_err(CE_NOTE, IBFT_NOPROBE_MSG);
+ if (boothowto & RB_VERBOSE) {
+ cmn_err(CE_NOTE, IBFT_NOPROBE_MSG);
+ }
return;
}
diff --git a/usr/src/uts/i86pc/os/lgrpplat.c b/usr/src/uts/i86pc/os/lgrpplat.c
index ac647bea16..2d7c253204 100644
--- a/usr/src/uts/i86pc/os/lgrpplat.c
+++ b/usr/src/uts/i86pc/os/lgrpplat.c
@@ -2792,7 +2792,11 @@ lgrp_plat_process_sli(uint32_t domain_id, uchar_t *sli_info,
/*
* Read ACPI System Resource Affinity Table (SRAT) to determine which CPUs
* and memory are local to each other in the same NUMA node and return number
- * of nodes
+ * of nodes.
+ *
+ * The SRAT table pointer is populated during bootup by
+ * build_firmware_properties() in fakebop.c. Several motherboard and BIOS
+ * manufacturers are guilty of not having a SRAT table.
*/
static int
lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
@@ -2810,9 +2814,15 @@ lgrp_plat_process_srat(struct srat *tp, struct msct *mp,
/*
* Nothing to do when no SRAT or disabled
*/
- if (tp == NULL || !lgrp_plat_srat_enable)
+ if (!lgrp_plat_srat_enable)
return (-1);
+ if (tp == NULL) {
+ cmn_err(CE_WARN, "Couldn't read ACPI SRAT table from BIOS. "
+ "lgrp support will be limited to one group.\n");
+ return (-1);
+ }
+
/*
* Try to get domain information from MSCT table.
* ACPI4.0: OSPM will use information provided by the MSCT only
diff --git a/usr/src/uts/i86pc/os/mlsetup.c b/usr/src/uts/i86pc/os/mlsetup.c
index 351ed3d2c9..cd837503f8 100644
--- a/usr/src/uts/i86pc/os/mlsetup.c
+++ b/usr/src/uts/i86pc/os/mlsetup.c
@@ -60,6 +60,7 @@
#include <sys/archsystm.h>
#include <sys/promif.h>
#include <sys/pci_cfgspace.h>
+#include <sys/bootvfs.h>
#ifdef __xpv
#include <sys/hypervisor.h>
#else
@@ -199,6 +200,21 @@ mlsetup(struct regs *rp)
xen_hvm_init();
/*
+ * Before we do anything with the TSCs, we need to work around
+ * Intel erratum BT81. On some Sandy Bridge CPUs, warm reset does not
+ * clear the TSC. If we are on such a CPU, we will clear TSC ourselves
+ * here. Other CPUs will clear it when we boot them later, and the
+ * resulting skew will be handled by tsc_sync_master()/_slave();
+ * note that such skew already exists and has to be handled anyway.
+ */
+ if ((get_hwenv() & HW_XEN_HVM) == 0 &&
+ cpuid_getvendor(CPU) == X86_VENDOR_Intel &&
+ cpuid_getfamily(CPU) == 6 && cpuid_getmodel(CPU) == 0x2d &&
+ is_x86_feature(x86_featureset, X86FSET_TSC)) {
+ (void) wrmsr(REG_TSC, 0UL);
+ }
+
+ /*
* Patch the tsc_read routine with appropriate set of instructions,
* depending on the processor family and architecure, to read the
* time-stamp counter while ensuring no out-of-order execution.
@@ -466,6 +482,10 @@ mach_modpath(char *path, const char *filename)
const char isastr[] = "/amd64";
size_t isalen = strlen(isastr);
+ len = strlen(SYSTEM_BOOT_PATH "/kernel");
+ (void) strcpy(path, SYSTEM_BOOT_PATH "/kernel ");
+ path += len + 1;
+
if ((p = strrchr(filename, '/')) == NULL)
return;
diff --git a/usr/src/uts/i86pc/os/mp_startup.c b/usr/src/uts/i86pc/os/mp_startup.c
index c6e8e4b229..b52d7ac3db 100644
--- a/usr/src/uts/i86pc/os/mp_startup.c
+++ b/usr/src/uts/i86pc/os/mp_startup.c
@@ -1641,8 +1641,19 @@ mp_startup_common(boolean_t boot)
* We need to get TSC on this proc synced (i.e., any delta
* from cpu0 accounted for) as soon as we can, because many
* many things use gethrtime/pc_gethrestime, including
- * interrupts, cmn_err, etc.
+ * interrupts, cmn_err, etc. Before we can do that, we want to
+ * clear TSC if we're on a buggy Sandy Bridge Xeon CPU, so do that
+ * right away.
*/
+ bzero(new_x86_featureset, BT_SIZEOFMAP(NUM_X86_FEATURES));
+ cpuid_pass1(cp, new_x86_featureset);
+
+ if (boot && (get_hwenv() & HW_XEN_HVM) == 0 &&
+ cpuid_getvendor(CPU) == X86_VENDOR_Intel &&
+ cpuid_getfamily(CPU) == 6 && cpuid_getmodel(CPU) == 0x2d &&
+ is_x86_feature(new_x86_featureset, X86FSET_TSC)) {
+ (void) wrmsr(REG_TSC, 0UL);
+ }
/* Let the control CPU continue into tsc_sync_master() */
mp_startup_signal(&procset_slave, cp->cpu_id);
@@ -1660,9 +1671,6 @@ mp_startup_common(boolean_t boot)
*/
(void) (*ap_mlsetup)();
- bzero(new_x86_featureset, BT_SIZEOFMAP(NUM_X86_FEATURES));
- cpuid_pass1(cp, new_x86_featureset);
-
#ifndef __xpv
/*
* Program this cpu's PAT
diff --git a/usr/src/uts/i86pc/os/startup.c b/usr/src/uts/i86pc/os/startup.c
index ac3538f646..82a0a5bc82 100644
--- a/usr/src/uts/i86pc/os/startup.c
+++ b/usr/src/uts/i86pc/os/startup.c
@@ -22,6 +22,7 @@
* Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2013 Joyent, Inc. All rights reserved.
*/
/*
* Copyright (c) 2010, Intel Corporation.
@@ -121,6 +122,7 @@
#include <sys/ddi_periodic.h>
#include <sys/systeminfo.h>
#include <sys/multiboot.h>
+#include <sys/ramdisk.h>
#ifdef __xpv
@@ -2346,6 +2348,20 @@ pp_in_range(page_t *pp, uint64_t low_addr, uint64_t high_addr)
(pp->p_pagenum < btopr(high_addr)));
}
+static int
+pp_in_module(page_t *pp, const rd_existing_t *modranges)
+{
+ uint_t i;
+
+ for (i = 0; modranges[i].phys != 0; i++) {
+ if (pp_in_range(pp, modranges[i].phys,
+ modranges[i].phys + modranges[i].size))
+ return (1);
+ }
+
+ return (0);
+}
+
void
release_bootstrap(void)
{
@@ -2353,10 +2369,40 @@ release_bootstrap(void)
page_t *pp;
extern void kobj_boot_unmountroot(void);
extern dev_t rootdev;
+ uint_t i;
+ char propname[32];
+ rd_existing_t *modranges;
#if !defined(__xpv)
pfn_t pfn;
#endif
+ /*
+ * Save the bootfs module ranges so that we can reserve them below
+ * for the real bootfs.
+ */
+ modranges = kmem_alloc(sizeof (rd_existing_t) * MAX_BOOT_MODULES,
+ KM_SLEEP);
+ for (i = 0; ; i++) {
+ uint64_t start, size;
+
+ modranges[i].phys = 0;
+
+ (void) snprintf(propname, sizeof (propname),
+ "module-addr-%u", i);
+ if (do_bsys_getproplen(NULL, propname) <= 0)
+ break;
+ (void) do_bsys_getprop(NULL, propname, &start);
+
+ (void) snprintf(propname, sizeof (propname),
+ "module-size-%u", i);
+ if (do_bsys_getproplen(NULL, propname) <= 0)
+ break;
+ (void) do_bsys_getprop(NULL, propname, &size);
+
+ modranges[i].phys = start;
+ modranges[i].size = size;
+ }
+
/* unmount boot ramdisk and release kmem usage */
kobj_boot_unmountroot();
@@ -2397,9 +2443,8 @@ release_bootstrap(void)
continue;
}
-
if (root_is_ramdisk && pp_in_range(pp, ramdisk_start,
- ramdisk_end)) {
+ ramdisk_end) || pp_in_module(pp, modranges)) {
pp->p_next = rd_pages;
rd_pages = pp;
continue;
@@ -2411,6 +2456,8 @@ release_bootstrap(void)
}
PRM_POINT("Boot pages released");
+ kmem_free(modranges, sizeof (rd_existing_t) * 99);
+
#if !defined(__xpv)
/* XXPV -- note this following bunch of code needs to be revisited in Xen 3.0 */
/*
diff --git a/usr/src/uts/i86pc/sys/acpidev.h b/usr/src/uts/i86pc/sys/acpidev.h
index 6d11277aaf..a3bd54d4e3 100644
--- a/usr/src/uts/i86pc/sys/acpidev.h
+++ b/usr/src/uts/i86pc/sys/acpidev.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2009-2010, Intel Corporation.
* All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_ACPIDEV_H
@@ -128,7 +129,7 @@ typedef enum acpidev_class_id {
#ifdef _KERNEL
/* Common ACPI object names. */
-#define ACPIDEV_OBJECT_NAME_SB ACPI_NS_SYSTEM_BUS
+#define ACPIDEV_OBJECT_NAME_SB METHOD_NAME__SB_
#define ACPIDEV_OBJECT_NAME_PR "_PR_"
/* Common ACPI method names. */
diff --git a/usr/src/uts/i86pc/vm/hat_i86.c b/usr/src/uts/i86pc/vm/hat_i86.c
index 8da02a4c36..40b033d0e4 100644
--- a/usr/src/uts/i86pc/vm/hat_i86.c
+++ b/usr/src/uts/i86pc/vm/hat_i86.c
@@ -27,6 +27,7 @@
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/*
@@ -3350,15 +3351,13 @@ hati_page_unmap(page_t *pp, htable_t *ht, uint_t entry)
extern int vpm_enable;
/*
- * Unload all translations to a page. If the page is a subpage of a large
+ * Unload translations to a page. If the page is a subpage of a large
* page, the large page mappings are also removed.
- *
- * The forceflags are unused.
+ * If unloadflag is HAT_CURPROC_PGUNLOAD, then we only unload the translation
+ * for the current process, otherwise all translations are unloaded.
*/
-
-/*ARGSUSED*/
static int
-hati_pageunload(struct page *pp, uint_t pg_szcd, uint_t forceflag)
+hati_pageunload(struct page *pp, uint_t pg_szcd, uint_t unloadflag)
{
page_t *cur_pp = pp;
hment_t *hm;
@@ -3366,6 +3365,8 @@ hati_pageunload(struct page *pp, uint_t pg_szcd, uint_t forceflag)
htable_t *ht;
uint_t entry;
level_t level;
+ struct hat *curhat;
+ ulong_t cnt;
XPV_DISALLOW_MIGRATE();
@@ -3375,6 +3376,9 @@ hati_pageunload(struct page *pp, uint_t pg_szcd, uint_t forceflag)
++curthread->t_hatdepth;
ASSERT(curthread->t_hatdepth < 16);
+ if (unloadflag == HAT_CURPROC_PGUNLOAD)
+ curhat = curthread->t_procp->p_as->a_hat;
+
#if defined(__amd64)
/*
* clear the vpm ref.
@@ -3387,6 +3391,8 @@ hati_pageunload(struct page *pp, uint_t pg_szcd, uint_t forceflag)
* The loop with next_size handles pages with multiple pagesize mappings
*/
next_size:
+ if (unloadflag == HAT_CURPROC_PGUNLOAD)
+ cnt = hat_page_getshare(cur_pp);
for (;;) {
/*
@@ -3398,6 +3404,7 @@ next_size:
if (hm == NULL) {
x86_hm_exit(cur_pp);
+curproc_done:
/*
* If not part of a larger page, we're done.
*/
@@ -3424,8 +3431,21 @@ next_size:
* If this mapping size matches, remove it.
*/
level = ht->ht_level;
- if (level == pg_szcd)
- break;
+ if (level == pg_szcd) {
+ if (unloadflag != HAT_CURPROC_PGUNLOAD ||
+ ht->ht_hat == curhat)
+ break;
+ /*
+ * unloadflag == HAT_CURPROC_PGUNLOAD but it's
+ * not the hat for the current process. Leave
+ * entry in place. Also do a safety check to
+ * ensure we don't get in an infinite loop
+ */
+ if (cnt-- == 0) {
+ x86_hm_exit(cur_pp);
+ goto curproc_done;
+ }
+ }
}
/*
@@ -3435,14 +3455,18 @@ next_size:
hm = hati_page_unmap(cur_pp, ht, entry);
if (hm != NULL)
hment_free(hm);
+
+ /* Perform check above for being part of a larger page. */
+ if (unloadflag == HAT_CURPROC_PGUNLOAD)
+ goto curproc_done;
}
}
int
-hat_pageunload(struct page *pp, uint_t forceflag)
+hat_pageunload(struct page *pp, uint_t unloadflag)
{
ASSERT(PAGE_EXCL(pp));
- return (hati_pageunload(pp, 0, forceflag));
+ return (hati_pageunload(pp, 0, unloadflag));
}
/*
diff --git a/usr/src/uts/intel/Makefile.files b/usr/src/uts/intel/Makefile.files
index 01147a5314..1661f3ff93 100644
--- a/usr/src/uts/intel/Makefile.files
+++ b/usr/src/uts/intel/Makefile.files
@@ -21,7 +21,7 @@
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
#
#
@@ -167,6 +167,7 @@ VGATEXT_OBJS += vgatext.o vgasubr.o
# Kernel linker
#
KRTLD_OBJS += \
+ bootfsops.o \
bootrd.o \
ufsops.o \
hsfs.o \
@@ -184,8 +185,9 @@ ACPICA_OBJS += dbcmds.o dbdisply.o \
dbexec.o dbfileio.o dbhistry.o dbinput.o dbstats.o \
dbutils.o dbxface.o evevent.o evgpe.o evgpeblk.o \
evmisc.o evregion.o evrgnini.o evsci.o evxface.o \
- evxfevnt.o evxfregn.o hwacpi.o hwgpe.o hwregs.o \
- hwsleep.o hwtimer.o dsfield.o dsinit.o dsmethod.o \
+ evxfevnt.o evxfregn.o hwacpi.o hwesleep.o hwgpe.o \
+ hwregs.o hwsleep.o hwtimer.o hwxfsleep.o dsfield.o \
+ dsinit.o dsmethod.o \
dsmthdat.o dsobject.o dsopcode.o dsutils.o dswexec.o \
dswload.o dswscope.o dswstate.o exconfig.o exconvrt.o \
excreate.o exdump.o exfield.o exfldio.o exmisc.o \
@@ -197,16 +199,18 @@ ACPICA_OBJS += dbcmds.o dbdisply.o \
nsalloc.o nsdump.o nsdumpdv.o nseval.o nsinit.o \
nsload.o nsnames.o nsobject.o nsparse.o nssearch.o \
nsutils.o nswalk.o nsxfeval.o nsxfname.o nsxfobj.o \
- rsaddr.o rscalc.o rscreate.o rsdump.o \
+ rsaddr.o rscalc.o rscreate.o rsdump.o rsserial.o \
rsinfo.o rsio.o rsirq.o rslist.o rsmemory.o rsmisc.o \
rsutils.o rsxface.o tbfadt.o tbfind.o tbinstal.o \
- tbutils.o tbxface.o tbxfroot.o \
+ tbutils.o tbxface.o tbxfroot.o utaddress.o \
utalloc.o utclib.o utcopy.o utdebug.o utdelete.o \
uteval.o utglobal.o utinit.o utmath.o utmisc.o \
- utobject.o utresrc.o utxface.o acpica.o acpi_enum.o \
+ utobject.o utresrc.o utxface.o utxfmutex.o acpica.o \
+ acpi_enum.o \
master_ops.o osl.o osl_ml.o acpica_ec.o utcache.o \
utmutex.o utstate.o dmbuffer.o dmnames.o dmobject.o \
- dmopcode.o dmresrc.o dmresrcl.o dmresrcs.o dmutils.o \
+ dmopcode.o dmresrc.o dmresrcl.o dmresrcl2.o dmresrcs.o \
+ dmutils.o \
dmwalk.o psloop.o nspredef.o hwxface.o hwvalid.o \
utlock.o utids.o nsrepair.o nsrepair2.o \
dbmethod.o dbnames.o dsargs.o dscontrol.o dswload2.o \
@@ -261,6 +265,7 @@ IOMMULIB_OBJS = iommulib.o
# Brand modules
#
SN1_BRAND_OBJS = sn1_brand.o sn1_brand_asm.o
+SNGL_BRAND_OBJS = sngl_brand.o sngl_brand_asm.o
S10_BRAND_OBJS = s10_brand.o s10_brand_asm.o
#
diff --git a/usr/src/uts/intel/Makefile.intel b/usr/src/uts/intel/Makefile.intel
index 01574125b2..0bef0bede0 100644
--- a/usr/src/uts/intel/Makefile.intel
+++ b/usr/src/uts/intel/Makefile.intel
@@ -235,6 +235,7 @@ DRV_KMODS += devinfo
DRV_KMODS += dld
DRV_KMODS += dlpistub
DRV_KMODS_32 += dnet
+DRV_KMODS += dr_sas
DRV_KMODS += dump
DRV_KMODS += ecpp
DRV_KMODS += emlxs
@@ -346,6 +347,7 @@ DRV_KMODS += uath
DRV_KMODS += urtw
DRV_KMODS += vgatext
DRV_KMODS += heci
+DRV_KMODS += vmxnet
DRV_KMODS += vnic
DRV_KMODS += vscan
DRV_KMODS += wc
@@ -501,7 +503,7 @@ MISC_KMODS += md_sp
#
# Brand modules
#
-BRAND_KMODS += sn1_brand s10_brand
+BRAND_KMODS += sn1_brand sngl_brand s10_brand
#
# Exec Class Modules (/kernel/exec):
@@ -516,8 +518,8 @@ SCHED_KMODS += IA RT TS RT_DPTBL TS_DPTBL FSS FX FX_DPTBL SDC
#
# File System Modules (/kernel/fs):
#
-FS_KMODS += autofs cachefs ctfs dcfs dev devfs fdfs fifofs hsfs lofs
-FS_KMODS += mntfs namefs nfs objfs zfs zut
+FS_KMODS += autofs cachefs ctfs dcfs dev devfs fdfs fifofs hsfs hyprlofs
+FS_KMODS += lofs lxprocfs mntfs namefs nfs objfs zfs zut
FS_KMODS += pcfs procfs sockfs specfs tmpfs udfs ufs sharefs
FS_KMODS += smbfs
diff --git a/usr/src/uts/intel/Makefile.rules b/usr/src/uts/intel/Makefile.rules
index b246e8fcca..65c31ba168 100644
--- a/usr/src/uts/intel/Makefile.rules
+++ b/usr/src/uts/intel/Makefile.rules
@@ -61,6 +61,9 @@ $(OBJS_DIR)/%.o: $(SRC)/common/util/i386/%.s
$(OBJS_DIR)/%.o: $(UTSBASE)/intel/brand/sn1/%.s
$(COMPILE.s) -o $@ $<
+$(OBJS_DIR)/%.o: $(UTSBASE)/intel/brand/sngl/%.s
+ $(COMPILE.s) -o $@ $<
+
$(OBJS_DIR)/%.o: $(UTSBASE)/intel/brand/solaris10/%.s
$(COMPILE.s) -o $@ $<
@@ -177,6 +180,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/intel_nb5000/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
+$(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/vmxnet/%.c
+ $(COMPILE.c) -o $@ $<
+ $(CTFCONVERT_O)
+
$(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/intel_nhm/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
@@ -319,6 +326,9 @@ $(LINTS_DIR)/%.ln: $(SRC)/common/util/i386/%.s
$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/sn1/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/sngl/%.s
+ @($(LHEAD) $(LINT.s) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/brand/solaris10/%.s
@($(LHEAD) $(LINT.s) $< $(LTAIL))
@@ -457,6 +467,9 @@ $(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/scsi/targets/%.c
$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/vgatext/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
+$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/vmxnet/%.c
+ @($(LHEAD) $(LINT.c) $< $(LTAIL))
+
$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/heci/%.c
@($(LHEAD) $(LINT.c) $< $(LTAIL))
diff --git a/usr/src/uts/intel/brand/sngl/sngl_brand_asm.s b/usr/src/uts/intel/brand/sngl/sngl_brand_asm.s
new file mode 100644
index 0000000000..90932a9d6d
--- /dev/null
+++ b/usr/src/uts/intel/brand/sngl/sngl_brand_asm.s
@@ -0,0 +1,31 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2012, Joyent, Inc. All rights reserved.
+ */
+
+#define XXX_emulation_table sngl_emulation_table
+#define XXX_brand_syscall32_callback sngl_brand_syscall32_callback
+#define XXX_brand_syscall_callback sngl_brand_syscall_callback
+#define XXX_brand_sysenter_callback sngl_brand_sysenter_callback
+#define XXX_brand_int91_callback sngl_brand_int91_callback
+
+#include "../common/brand_solaris.s"
diff --git a/usr/src/uts/intel/core_pcbe/Makefile b/usr/src/uts/intel/core_pcbe/Makefile
index d9d9b02de0..7f2d1ad8e5 100644
--- a/usr/src/uts/intel/core_pcbe/Makefile
+++ b/usr/src/uts/intel/core_pcbe/Makefile
@@ -34,7 +34,7 @@ UTSBASE = ../..
MODULE = pcbe.GenuineIntel.6.15
OBJECTS = $(CORE_PCBE_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(CORE_PCBE_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE = $(USR_PCBE_DIR)/$(MODULE)
+ROOTMODULE = $(ROOT_PSM_PCBE_DIR)/$(MODULE)
SOFTLINKS = pcbe.GenuineIntel.6.23 \
pcbe.GenuineIntel.6.26 \
pcbe.GenuineIntel.6.28 \
@@ -45,7 +45,7 @@ SOFTLINKS = pcbe.GenuineIntel.6.23 \
pcbe.GenuineIntel.6.44 \
pcbe.GenuineIntel.6.46 \
pcbe.GenuineIntel.6.47
-ROOTSOFTLINKS = $(SOFTLINKS:%=$(USR_PCBE_DIR)/%)
+ROOTSOFTLINKS = $(SOFTLINKS:%=$(ROOT_PSM_PCBE_DIR)/%)
#
# Include common rules.
diff --git a/usr/src/uts/intel/dr_sas/Makefile b/usr/src/uts/intel/dr_sas/Makefile
new file mode 100644
index 0000000000..f4871b694a
--- /dev/null
+++ b/usr/src/uts/intel/dr_sas/Makefile
@@ -0,0 +1,90 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# uts/intel/dr_sas/Makefile
+#
+# This makefile drives the production of the dr_sas driver kernel module.
+#
+# intel implementation architecture dependent
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+
+#
+# Define the module and object file sets.
+#
+MODULE = dr_sas
+OBJECTS = $(DR_SAS_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(DR_SAS_OBJS:%.o=$(LINTS_DIR)/%.ln)
+ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
+CONF_SRCDIR = $(UTSBASE)/common/io/dr_sas
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/intel/Makefile.intel
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY) $(CONFMOD)
+LINT_TARGET = $(MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
+
+#
+# Kernel Module Dependencies
+#
+LDFLAGS += -dy -Nmisc/scsi
+
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+lint: $(LINT_DEPS)
+
+modlintlib: $(MODLINTLIB_DEPS)
+
+clean.lint: $(CLEAN_LINT_DEPS)
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include $(UTSBASE)/intel/Makefile.targ
diff --git a/usr/src/uts/intel/dtrace/Makefile b/usr/src/uts/intel/dtrace/Makefile
index ba914bcbaa..aeabf4a7e3 100644
--- a/usr/src/uts/intel/dtrace/Makefile
+++ b/usr/src/uts/intel/dtrace/Makefile
@@ -49,6 +49,8 @@ CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-type-limits
CERRWARN += -_gcc=-Wno-uninitialized
+CPPFLAGS += -I$(SRC)/common/util
+
ALL_TARGET = $(BINARY) $(SRC_CONFILE)
LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
diff --git a/usr/src/uts/intel/dtrace/sdt.c b/usr/src/uts/intel/dtrace/sdt.c
index 38be2233b1..27cb19e06c 100644
--- a/usr/src/uts/intel/dtrace/sdt.c
+++ b/usr/src/uts/intel/dtrace/sdt.c
@@ -23,6 +23,9 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
#include <sys/modctl.h>
#include <sys/sunddi.h>
@@ -419,9 +422,19 @@ sdt_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
dtrace_invop_add(sdt_invop);
for (prov = sdt_providers; prov->sdtp_name != NULL; prov++) {
+ uint32_t priv;
+
+ if (prov->sdtp_priv == DTRACE_PRIV_NONE) {
+ priv = DTRACE_PRIV_KERNEL;
+ sdt_pops.dtps_mode = NULL;
+ } else {
+ priv = prov->sdtp_priv;
+ ASSERT(priv == DTRACE_PRIV_USER);
+ sdt_pops.dtps_mode = sdt_mode;
+ }
+
if (dtrace_register(prov->sdtp_name, prov->sdtp_attr,
- DTRACE_PRIV_KERNEL, NULL,
- &sdt_pops, prov, &prov->sdtp_id) != 0) {
+ priv, NULL, &sdt_pops, prov, &prov->sdtp_id) != 0) {
cmn_err(CE_WARN, "failed to register sdt provider %s",
prov->sdtp_name);
}
diff --git a/usr/src/uts/intel/hook/hook.global-objs.debug64 b/usr/src/uts/intel/hook/hook.global-objs.debug64
index 48d393076f..af98d74429 100644
--- a/usr/src/uts/intel/hook/hook.global-objs.debug64
+++ b/usr/src/uts/intel/hook/hook.global-objs.debug64
@@ -22,8 +22,11 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2013 Joyent, Inc. All rights reserved
+#
modlinkage
modlmisc
hook_stack_lock
hook_stacks
+hook_hintvalue_none
diff --git a/usr/src/uts/intel/hyprlofs/Makefile b/usr/src/uts/intel/hyprlofs/Makefile
new file mode 100644
index 0000000000..919b045617
--- /dev/null
+++ b/usr/src/uts/intel/hyprlofs/Makefile
@@ -0,0 +1,83 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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
+#
+#
+# uts/intel/hyprlofs/Makefile
+#
+# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# This makefile drives the production of the hyprlofs file system
+# kernel module.
+#
+# intel architecture dependent
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+
+#
+# Define the module and object file sets.
+#
+MODULE = hyprlofs
+OBJECTS = $(HYPRLOFS_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(HYPRLOFS_OBJS:%.o=$(LINTS_DIR)/%.ln)
+ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE)
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/intel/Makefile.intel
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY)
+LINT_TARGET = $(MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+lint: $(LINT_DEPS)
+
+modlintlib: $(MODLINTLIB_DEPS)
+
+clean.lint: $(CLEAN_LINT_DEPS)
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include $(UTSBASE)/intel/Makefile.targ
diff --git a/usr/src/uts/intel/io/acpica/changes.txt b/usr/src/uts/intel/io/acpica/changes.txt
index f53fd426da..69dcdf708c 100644
--- a/usr/src/uts/intel/io/acpica/changes.txt
+++ b/usr/src/uts/intel/io/acpica/changes.txt
@@ -1,7 +1,588 @@
----------------------------------------
-27 May 2011. Summary of changes for version 20110527:
+20 March 2012. Summary of changes for version 20120320:
+
+This release is available at www.acpica.org/downloads.
+The ACPI 5.0 specification is available at www.acpi.info.
+
+1) ACPICA Core Subsystem:
+
+Enhanced the sleep/wake interfaces to optionally execute the _GTS method
+(Going To Sleep) and the _BFS method (Back From Sleep). Windows apparently
+does not execute these methods, and therefore these methods are often
+untested. It has been seen on some systems where the execution of these
+methods causes errors and also prevents the machine from entering S5. It is
+therefore suggested that host operating systems do not execute these methods
+by default. In the future, perhaps these methods can be optionally executed
+based on the age of the system and/or what is the newest version of Windows
+that the BIOS asks for via _OSI. Changed interfaces: AcpiEnterSleepState and
+AcpileaveSleepStatePrep. See the ACPICA reference and Linux BZ 13041. Lin
+Ming.
+
+Fixed a problem where the length of the local/common FADT was set too early.
+The local FADT table length cannot be set to the common length until the
+original length has been examined. There is code that checks the table length
+and sets various fields appropriately. This can affect older machines with
+early FADT versions. For example, this can cause inadvertent writes to the
+CST_CNT register. Julian Anastasov.
+
+Fixed a mapping issue related to a physical table override. Use the deferred
+mapping mechanism for tables loaded via the physical override OSL interface.
+This allows for early mapping before the virtual memory manager is available.
+Thomas Renninger, Bob Moore.
+
+Enhanced the automatic return-object repair code: Repair a common problem with
+predefined methods that are defined to return a variable-length Package of
+sub-objects. If there is only one sub-object, some BIOS ASL code mistakenly
+simply returns the single object instead of a Package with one sub-object.
+This new support will repair this error by wrapping a Package object around
+the original object, creating the correct and expected Package with one sub-
+object. Names that can be repaired in this manner include: _ALR, _CSD, _HPX,
+_MLS, _PLD, _PRT, _PSS, _TRT, _TSS, _BCL, _DOD, _FIX, and _Sx. ACPICA BZ 939.
+
+Changed the exception code returned for invalid ACPI paths passed as
+parameters to external interfaces such as AcpiEvaluateObject. Was
+AE_BAD_PARAMETER, now is the more sensible AE_BAD_PATHNAME.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug
+version of the code includes the debug output trace mechanism and has a much
+larger code and data size.
+
+ Previous Release:
+ Non-Debug Version: 93.0K Code, 25.0K Data, 118.0K Total
+ Debug Version: 172.5K Code, 73.2K Data, 245.7K Total
+ Current Release:
+ Non-Debug Version: 92.9K Code, 25.0K Data, 117.9K Total
+ Debug Version: 172.5K Code, 73.2K Data, 245.7K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Added the infrastructure and initial implementation of a integrated C-
+like preprocessor. This will simplify BIOS development process by eliminating
+the need for a separate preprocessing step during builds. On Windows, it also
+eliminates the need to install a separate C compiler. ACPICA BZ 761. Some
+features including full #define() macro support are still under development.
+These preprocessor directives are supported:
+ #define
+ #elif
+ #else
+ #endif
+ #error
+ #if
+ #ifdef
+ #ifndef
+ #include
+ #pragma message
+ #undef
+ #warning
+In addition, these new command line options are supported:
+ -D <symbol> Define symbol for preprocessor use
+ -li Create preprocessed output file (*.i)
+ -P Preprocess only and create preprocessor output file (*.i)
+
+Table Compiler: Fixed a problem where the equals operator within an expression
+did not work properly.
+
+Updated iASL to use the current versions of Bison/Flex. Updated the Windows
+project file to invoke these tools from the standard location. ACPICA BZ 904.
+Versions supported:
+ Flex for Windows: V2.5.4
+ Bison for Windows: V2.4.1
+
+----------------------------------------
+15 February 2012. Summary of changes for version 20120215:
+
+This release is available at www.acpica.org/downloads.
+The ACPI 5.0 specification is available at www.acpi.info.
+
+1) ACPICA Core Subsystem:
+
+There have been some major changes to the sleep/wake support code, as
+described below (a - e).
+
+a) The AcpiLeaveSleepState has been split into two interfaces, similar to
+AcpiEnterSleepStatePrep and AcpiEnterSleepState. The new interface is
+AcpiLeaveSleepStatePrep. This allows the host to perform actions between the
+time the _BFS method is called and the _WAK method is called. NOTE: all hosts
+must update their wake/resume code or else sleep/wake will not work properly.
+Rafael Wysocki.
+
+b) In AcpiLeaveSleepState, now enable all runtime GPEs before calling the _WAK
+method. Some machines require that the GPEs are enabled before the _WAK method
+is executed. Thomas Renninger.
+
+c) In AcpiLeaveSleepState, now always clear the WAK_STS (wake status) bit.
+Some BIOS code assumes that WAK_STS will be cleared on resume and use it to
+determine whether the system is rebooting or resuming. Matthew Garrett.
+
+d) Move the invocations of _GTS (Going To Sleep) and _BFS (Back From Sleep) to
+match the ACPI specification requirement. Rafael Wysocki.
+
+e) Implemented full support for the ACPI 5.0 SleepStatus and SleepControl
+registers within the V5 FADT. This support adds two new files:
+hardware/hwesleep.c implements the support for the new registers. Moved all
+sleep/wake external interfaces to hardware/hwxfsleep.c.
+
+
+Added a new OSL interface for ACPI table overrides,
+AcpiOsPhysicalTableOverride. This interface allows the host to override a
+table via a physical address, instead of the logical address required by
+AcpiOsTableOverride. This simplifies the host implementation. Initial
+implementation by Thomas Renninger. The ACPICA implementation creates a single
+shared function for table overrides that attempts both a logical and a
+physical override.
+
+Expanded the OSL memory read/write interfaces to 64-bit data
+(AcpiOsReadMemory, AcpiOsWriteMemory.) This enables full 64-bit memory
+transfer support for GAS register structures passed to AcpiRead and AcpiWrite.
+
+Implemented the ACPI_REDUCED_HARDWARE option to allow the creation of a custom
+build of ACPICA that supports only the ACPI 5.0 reduced hardware (SoC) model.
+See the ACPICA reference for details. ACPICA BZ 942. This option removes about
+10% of the code and 5% of the static data, and the following hardware ACPI
+features become unavailable:
+ PM Event and Control registers
+ SCI interrupt (and handler)
+ Fixed Events
+ General Purpose Events (GPEs)
+ Global Lock
+ ACPI PM timer
+ FACS table (Waking vectors and Global Lock)
+
+Updated the unix tarball directory structure to match the ACPICA git source
+tree. This ensures that the generic unix makefiles work properly (in
+generate/unix). Also updated the Linux makefiles to match. ACPICA BZ 867.
+
+Updated the return value of the _REV predefined method to integer value 5 to
+reflect ACPI 5.0 support.
+
+Moved the external ACPI PM timer interface prototypes to the public acpixf.h
+file where they belong.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug
+version of the code includes the debug output trace mechanism and has a much
+larger code and data size.
+
+ Previous Release:
+ Non-Debug Version: 92.8K Code, 24.9K Data, 117.7K Total
+ Debug Version: 171.7K Code, 72.9K Data, 244.5K Total
+ Current Release:
+ Non-Debug Version: 93.0K Code, 25.0K Data, 118.0K Total
+ Debug Version: 172.5K Code, 73.2K Data, 245.7K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Fixed a problem with the new ACPI 5.0 serial resource
+descriptors (I2C, SPI, UART) where the resource produce/consumer bit was
+incorrectly displayed.
+
+AcpiHelp: Add display of ACPI/PNP device IDs that are defined in the ACPI
+specification.
+
+----------------------------------------
+11 January 2012. Summary of changes for version 20120111:
+
+This release is available at www.acpica.org/downloads.
+The ACPI 5.0 specification is available at www.acpi.info.
+
+1) ACPICA Core Subsystem:
+
+Implemented a new mechanism to allow host device drivers to check for address
+range conflicts with ACPI Operation Regions. Both SystemMemory and SystemIO
+address spaces are supported. A new external interface, AcpiCheckAddressRange,
+allows drivers to check an address range against the ACPI namespace. See the
+ACPICA reference for additional details. Adds one new file,
+utilities/utaddress.c. Lin Ming, Bob Moore.
+
+Fixed several issues with the ACPI 5.0 FADT support: Add the sleep Control and
+Status registers, update the ACPI 5.0 flags, and update internal data
+structures to handle an FADT larger than 256 bytes. The size of the ACPI 5.0
+FADT is 268 bytes.
+
+Updated all ACPICA copyrights and signons to 2012. Added the 2012 copyright to
+all module headers and signons, including the standard Linux header. This
+affects virtually every file in the ACPICA core subsystem, iASL compiler, and
+all ACPICA utilities.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug
+version of the code includes the debug output trace mechanism and has a much
+larger code and data size.
+
+ Previous Release:
+ Non-Debug Version: 92.3K Code, 24.9K Data, 117.2K Total
+ Debug Version: 170.8K Code, 72.6K Data, 243.4K Total
+ Current Release:
+ Non-Debug Version: 92.8K Code, 24.9K Data, 117.7K Total
+ Debug Version: 171.7K Code, 72.9K Data, 244.5K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: fixed a problem with the automatic resource tag generation
+support. Fixes a problem where the resource tags are inadvertently not
+constructed if the table being disassembled contains external references to
+control methods. Moved the actual construction of the tags to after the final
+namespace is constructed (after 2nd parse is invoked due to external control
+method references.) ACPICA BZ 941.
+
+Table Compiler: Make all "generic" operators caseless. These are the operators
+like UINT8, String, etc. Making these caseless improves ease-of-use. ACPICA BZ
+934.
+
+----------------------------------------
+23 November 2011. Summary of changes for version 20111123:
+
+0) ACPI 5.0 Support:
+
+This release contains full support for the ACPI 5.0 specification, as
+summarized below.
+
+Reduced Hardware Support:
+-------------------------
+
+This support allows for ACPI systems without the usual ACPI hardware. This
+support is enabled by a flag in the revision 5 FADT. If it is set, ACPICA will
+not attempt to initialize or use any of the usual ACPI hardware. Note, when
+this flag is set, all of the following ACPI hardware is assumed to be not
+present and is not initialized or accessed:
+
+ General Purpose Events (GPEs)
+ Fixed Events (PM1a/PM1b and PM Control)
+ Power Management Timer and Console Buttons (power/sleep)
+ Real-time Clock Alarm
+ Global Lock
+ System Control Interrupt (SCI)
+ The FACS is assumed to be non-existent
+
+ACPI Tables:
+------------
+
+All new tables and updates to existing tables are fully supported in the
+ACPICA headers (for use by device drivers), the disassembler, and the iASL
+Data Table Compiler. ACPI 5.0 defines these new tables:
+
+ BGRT /* Boot Graphics Resource Table */
+ DRTM /* Dynamic Root of Trust for Measurement table */
+ FPDT /* Firmware Performance Data Table */
+ GTDT /* Generic Timer Description Table */
+ MPST /* Memory Power State Table */
+ PCCT /* Platform Communications Channel Table */
+ PMTT /* Platform Memory Topology Table */
+ RASF /* RAS Feature table */
+
+Operation Regions/SpaceIDs:
+---------------------------
+
+All new operation regions are fully supported by the iASL compiler, the
+disassembler, and the ACPICA runtime code (for dispatch to region handlers.)
+The new operation region Space IDs are:
+
+ GeneralPurposeIo
+ GenericSerialBus
+
+Resource Descriptors:
+---------------------
+
+All new ASL resource descriptors are fully supported by the iASL compiler, the
+ASL/AML disassembler, and the ACPICA runtime Resource Manager code (including
+all new predefined resource tags). New descriptors are:
+
+ FixedDma
+ GpioIo
+ GpioInt
+ I2cSerialBus
+ SpiSerialBus
+ UartSerialBus
+
+ASL/AML Operators, New and Modified:
+------------------------------------
+
+One new operator is added, the Connection operator, which is used to associate
+a GeneralPurposeIo or GenericSerialBus resource descriptor with individual
+field objects within an operation region. Several new protocols are associated
+with the AccessAs operator. All are fully supported by the iASL compiler,
+disassembler, and runtime ACPICA AML interpreter:
+
+ Connection // Declare Field Connection attributes
+ AccessAs: AttribBytes (n) // Read/Write N-Bytes Protocol
+ AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes Protocol
+ AccessAs: AttribRawProcessBytes (n) // Raw Process Call Protocol
+ RawDataBuffer // Data type for Vendor Data fields
+
+Predefined ASL/AML Objects:
+---------------------------
+
+All new predefined objects/control-methods are supported by the iASL compiler
+and the ACPICA runtime validation/repair (arguments and return values.) New
+predefined names include the following:
+
+Standard Predefined Names (Objects or Control Methods):
+ _AEI, _CLS, _CPC, _CWS, _DEP,
+ _DLM, _EVT, _GCP, _CRT, _GWS,
+ _HRV, _PRE, _PSE, _SRT, _SUB.
+
+Resource Tags (Names used to access individual fields within resource
+descriptors):
+ _DBT, _DPL, _DRS, _END, _FLC,
+ _IOR, _LIN, _MOD, _PAR, _PHA,
+ _PIN, _PPI, _POL, _RXL, _SLV,
+ _SPE, _STB, _TXL, _VEN.
+
+ACPICA External Interfaces:
+---------------------------
+
+Several new interfaces have been defined for use by ACPI-related device
+drivers and other host OS services:
+
+AcpiAcquireMutex and AcpiReleaseMutex: These interfaces allow the host OS to
+acquire and release AML mutexes that are defined in the DSDT/SSDT tables
+provided by the BIOS. They are intended to be used in conjunction with the
+ACPI 5.0 _DLM (Device Lock Method) in order to provide transaction-level
+mutual exclusion with the AML code/interpreter.
+
+AcpiGetEventResources: Returns the (formatted) resource descriptors as defined
+by the ACPI 5.0 _AEI object (ACPI Event Information). This object provides
+resource descriptors associated with hardware-reduced platform events, similar
+to the AcpiGetCurrentResources interface.
+
+Operation Region Handlers: For General Purpose IO and Generic Serial Bus
+operation regions, information about the Connection() object and any optional
+length information is passed to the region handler within the Context
+parameter.
+
+AcpiBufferToResource: This interface converts a raw AML buffer containing a
+resource template or resource descriptor to the ACPI_RESOURCE internal format
+suitable for use by device drivers. Can be used by an operation region handler
+to convert the Connection() buffer object into a ACPI_RESOURCE.
+
+Miscellaneous/Tools/TestSuites:
+-------------------------------
+
+Support for extended _HID names (Four alpha characters instead of three).
+Support for ACPI 5.0 features in the AcpiExec and AcpiHelp utilities.
+Support for ACPI 5.0 features in the ASLTS test suite.
+Fully updated documentation (ACPICA and iASL reference documents.)
+
+ACPI Table Definition Language:
+-------------------------------
+
+Support for this language was implemented and released as a subsystem of the
+iASL compiler in 2010. (See the iASL compiler User Guide.)
+
+
+Non-ACPI 5.0 changes for this release:
+--------------------------------------
+
+1) ACPICA Core Subsystem:
+
+Fix a problem with operation region declarations where a failure can occur if
+the region name and an argument that evaluates to an object (such as the
+region address) are in different namespace scopes. Lin Ming, ACPICA BZ 937.
+
+Do not abort an ACPI table load if an invalid space ID is found within. This
+will be caught later if the offending method is executed. ACPICA BZ 925.
+
+Fixed an issue with the FFixedHW space ID where the ID was not always
+recognized properly (Both ACPICA and iASL). ACPICA BZ 926.
+
+Fixed a problem with the 32-bit generation of the unix-specific OSL
+(osunixxf.c). Lin Ming, ACPICA BZ 936.
+
+Several changes made to enable generation with the GCC 4.6 compiler. ACPICA BZ
+935.
+
+New error messages: Unsupported I/O requests (not 8/16/32 bit), and Index/Bank
+field registers out-of-range.
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented the __PATH__ operator, which returns the full pathname of
+the current source file.
-This release is available at www.acpica.org/downloads
+AcpiHelp: Automatically display expanded keyword information for all ASL
+operators.
+
+Debugger: Add "Template" command to disassemble/dump resource template
+buffers.
+
+Added a new master script to generate and execute the ASLTS test suite.
+Automatically handles 32- and 64-bit generation. See tests/aslts.sh
+
+iASL: Fix problem with listing generation during processing of the Switch()
+operator where AML listing was disabled until the entire Switch block was
+completed.
+
+iASL: Improve support for semicolon statement terminators. Fix "invalid
+character" message for some cases when the semicolon is used. Semicolons are
+now allowed after every <Term> grammar element. ACPICA BZ 927.
+
+iASL: Fixed some possible aliasing warnings during generation. ACPICA BZ 923.
+
+Disassembler: Fix problem with disassembly of the DataTableRegion operator
+where an inadvertent "Unhandled deferred opcode" message could be generated.
+
+3) Example Code and Data Size
+
+These are the sizes for the OS-independent acpica.lib produced by the
+Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code
+includes the debug output trace mechanism and has a much larger code and data
+size.
+
+ Previous Release:
+ Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total
+ Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
+ Current Release:
+ Non-Debug Version: 92.3K Code, 24.9K Data, 117.2K Total
+ Debug Version: 170.8K Code, 72.6K Data, 243.4K Total
+
+----------------------------------------
+22 September 2011. Summary of changes for version 20110922:
+
+0) ACPI 5.0 News:
+
+Support for ACPI 5.0 in ACPICA has been underway for several months and will
+be released at the same time that ACPI 5.0 is officially released.
+
+The ACPI 5.0 specification is on track for release in the next few months.
+
+1) ACPICA Core Subsystem:
+
+Fixed a problem where the maximum sleep time for the Sleep() operator was
+intended to be limited to two seconds, but was inadvertently limited to 20
+seconds instead.
+
+Linux and Unix makefiles: Added header file dependencies to ensure correct
+generation of ACPICA core code and utilities. Also simplified the makefiles
+considerably through the use of the vpath variable to specify search paths.
+ACPICA BZ 924.
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented support to check the access length for all fields created to
+access named Resource Descriptor fields. For example, if a resource field is
+defined to be two bits, a warning is issued if a CreateXxxxField() is used
+with an incorrect bit length. This is implemented for all current resource
+descriptor names. ACPICA BZ 930.
+
+Disassembler: Fixed a byte ordering problem with the output of 24-bit and 56-
+bit integers.
+
+iASL: Fixed a couple of issues associated with variable-length package
+objects. 1) properly handle constants like One, Ones, Zero -- do not make a
+VAR_PACKAGE when these are used as a package length. 2) Allow the VAR_PACKAGE
+opcode (in addition to PACKAGE) when validating object types for predefined
+names.
+
+iASL: Emit statistics for all output files (instead of just the ASL input and
+AML output). Includes listings, hex files, etc.
+
+iASL: Added -G option to the table compiler to allow the compilation of custom
+ACPI tables. The only part of a table that is required is the standard 36-byte
+ACPI header.
+
+AcpiXtract: Ported to the standard ACPICA environment (with ACPICA headers),
+which also adds correct 64-bit support. Also, now all output filenames are
+completely lower case.
+
+AcpiExec: Ignore any non-AML tables (tables other than DSDT or SSDT) when
+loading table files. A warning is issued for any such tables. The only
+exception is an FADT. This also fixes a possible fault when attempting to load
+non-AML tables. ACPICA BZ 932.
+
+AcpiHelp: Added the AccessAs and Offset operators. Fixed a problem where a
+missing table terminator could cause a fault when using the -p option.
+
+AcpiSrc: Fixed a possible divide-by-zero fault when generating file
+statistics.
+
+3) Example Code and Data Size
+
+These are the sizes for the OS-independent acpica.lib produced by the
+Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code
+includes the debug output trace mechanism and has a much larger code and data
+size.
+
+ Previous Release (VC 9.0):
+ Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total
+ Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
+ Current Release (VC 9.0):
+ Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total
+ Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
+
+
+----------------------------------------
+23 June 2011. Summary of changes for version 20110623:
+
+1) ACPI CA Core Subsystem:
+
+Updated the predefined name repair mechanism to not attempt repair of a _TSS
+return object if a _PSS object is present. We can only sort the _TSS return
+package if there is no _PSS within the same scope. This is because if _PSS is
+present, the ACPI specification dictates that the _TSS Power Dissipation field
+is to be ignored, and therefore some BIOSs leave garbage values in the _TSS
+Power field(s). In this case, it is best to just return the _TSS package as-
+is. Reported by, and fixed with assistance from Fenghua Yu.
+
+Added an option to globally disable the control method return value validation
+and repair. This runtime option can be used to disable return value repair if
+this is causing a problem on a particular machine. Also added an option to
+AcpiExec (-dr) to set this disable flag.
+
+All makefiles and project files: Major changes to improve generation of ACPICA
+tools. ACPICA BZ 912:
+ Reduce default optimization levels to improve compatibility
+ For Linux, add strict-aliasing=0 for gcc 4
+ Cleanup and simplify use of command line defines
+ Cleanup multithread library support
+ Improve usage messages
+
+Linux-specific header: update handling of THREAD_ID and pthread. For the 32-
+bit case, improve casting to eliminate possible warnings, especially with the
+acpica tools.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug
+version of the code includes the debug output trace mechanism and has a much
+larger code and data size.
+
+ Previous Release (VC 9.0):
+ Non-Debug Version: 90.1K Code, 23.9K Data, 114.0K Total
+ Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
+ Current Release (VC 9.0):
+ Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total
+ Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+With this release, a new utility named "acpihelp" has been added to the ACPICA
+package. This utility summarizes the ACPI specification chapters for the ASL
+and AML languages. It generates under Linux/Unix as well as Windows, and
+provides the following functionality:
+ Find/display ASL operator(s) -- with description and syntax.
+ Find/display ASL keyword(s) -- with exact spelling and descriptions.
+ Find/display ACPI predefined name(s) -- with description, number
+ of arguments, and the return value data type.
+ Find/display AML opcode name(s) -- with opcode, arguments, and grammar.
+ Decode/display AML opcode -- with opcode name, arguments, and grammar.
+
+Service Layers: Make multi-thread support configurable. Conditionally compile
+the multi-thread support so that threading libraries will not be linked if not
+necessary. The only tool that requires multi-thread support is AcpiExec.
+
+iASL: Update yyerrror/AslCompilerError for "const" errors. Newer versions of
+Bison appear to want the interface to yyerror to be a const char * (or at
+least this is a problem when generating iASL on some systems.) ACPICA BZ 923
+Pierre Lejeune.
+
+Tools: Fix for systems where O_BINARY is not defined. Only used for Windows
+versions of the tools.
+
+----------------------------------------
+27 May 2011. Summary of changes for version 20110527:
1) ACPI CA Core Subsystem:
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbcmds.c b/usr/src/uts/intel/io/acpica/debugger/dbcmds.c
index 73387b872c..459cd916ee 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbcmds.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbcmds.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,6 +46,7 @@
#include "accommon.h"
#include "acevents.h"
#include "acdebug.h"
+#include "acnamesp.h"
#include "acresrc.h"
#include "actables.h"
@@ -69,6 +70,18 @@ AcpiDmTestResourceConversion (
ACPI_NAMESPACE_NODE *Node,
char *Name);
+static ACPI_STATUS
+AcpiDbResourceCallback (
+ ACPI_RESOURCE *Resource,
+ void *Context);
+
+static ACPI_STATUS
+AcpiDbDeviceResources (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
/*******************************************************************************
*
@@ -148,28 +161,49 @@ AcpiDbSleep (
UINT8 SleepState;
+ ACPI_FUNCTION_TRACE (AcpiDbSleep);
+
+
SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0);
AcpiOsPrintf ("**** Prepare to sleep ****\n");
Status = AcpiEnterSleepStatePrep (SleepState);
if (ACPI_FAILURE (Status))
{
- return (Status);
+ goto ErrorExit;
}
AcpiOsPrintf ("**** Going to sleep ****\n");
- Status = AcpiEnterSleepState (SleepState);
+ Status = AcpiEnterSleepState (SleepState, ACPI_NO_OPTIONAL_METHODS);
if (ACPI_FAILURE (Status))
{
- return (Status);
+ goto ErrorExit;
}
- AcpiOsPrintf ("**** returning from sleep ****\n");
+ AcpiOsPrintf ("**** Prepare to return from sleep ****\n");
+ Status = AcpiLeaveSleepStatePrep (SleepState, ACPI_NO_OPTIONAL_METHODS);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ AcpiOsPrintf ("**** Returning from sleep ****\n");
Status = AcpiLeaveSleepState (SleepState);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
return (Status);
+
+
+ErrorExit:
+
+ ACPI_EXCEPTION ((AE_INFO, Status, "During sleep test"));
+ return (Status);
}
+
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayLocks
@@ -339,25 +373,20 @@ AcpiDbSendNotify (
return;
}
- /* Decode Named object type */
+ /* Dispatch the notify if legal */
- switch (Node->Type)
+ if (AcpiEvIsNotifyObject (Node))
{
- case ACPI_TYPE_DEVICE:
- case ACPI_TYPE_THERMAL:
-
- /* Send the notify */
-
Status = AcpiEvQueueNotifyRequest (Node, Value);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not queue notify\n");
}
- break;
-
- default:
- AcpiOsPrintf ("Named object is not a device or a thermal object\n");
- break;
+ }
+ else
+ {
+ AcpiOsPrintf ("Named object [%4.4s] Type %s, must be Device/Thermal/Processor type\n",
+ AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type));
}
}
@@ -456,6 +485,78 @@ AcpiDbDisplayInterfaces (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbDisplayTemplate
+ *
+ * PARAMETERS: BufferArg - Buffer name or addrss
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump a buffer that contains a resource template
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDisplayTemplate (
+ char *BufferArg)
+{
+ ACPI_NAMESPACE_NODE *Node;
+ ACPI_STATUS Status;
+ ACPI_BUFFER ReturnObj;
+
+
+ /* Translate BufferArg to an Named object */
+
+ Node = AcpiDbConvertToNode (BufferArg);
+ if (!Node || (Node == AcpiGbl_RootNode))
+ {
+ AcpiOsPrintf ("Invalid argument: %s\n", BufferArg);
+ return;
+ }
+
+ /* We must have a buffer object */
+
+ if (Node->Type != ACPI_TYPE_BUFFER)
+ {
+ AcpiOsPrintf ("Not a Buffer object, cannot be a template: %s\n",
+ BufferArg);
+ return;
+ }
+
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+
+ /* Attempt to convert the raw buffer to a resource list */
+
+ Status = AcpiRsCreateResourceList (Node->Object, &ReturnObj);
+
+ AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
+ AcpiDbgLevel |= ACPI_LV_RESOURCES;
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n",
+ BufferArg, AcpiFormatException (Status));
+ goto DumpBuffer;
+ }
+
+ /* Now we can dump the resource list */
+
+ AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
+ ReturnObj.Pointer));
+
+DumpBuffer:
+ AcpiOsPrintf ("\nRaw data buffer:\n");
+ AcpiUtDumpBuffer ((UINT8 *) Node->Object->Buffer.Pointer,
+ Node->Object->Buffer.Length,
+ DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
+
+ AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
+ return;
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmCompareAmlResources
*
* PARAMETERS: Aml1Buffer - Contains first resource list
@@ -479,11 +580,14 @@ AcpiDmCompareAmlResources (
{
UINT8 *Aml1;
UINT8 *Aml2;
+ UINT8 *Aml1End;
+ UINT8 *Aml2End;
ACPI_RSDESC_SIZE Aml1Length;
ACPI_RSDESC_SIZE Aml2Length;
ACPI_RSDESC_SIZE Offset = 0;
UINT8 ResourceType;
UINT32 Count = 0;
+ UINT32 i;
/* Compare overall buffer sizes (may be different due to size rounding) */
@@ -491,16 +595,18 @@ AcpiDmCompareAmlResources (
if (Aml1BufferLength != Aml2BufferLength)
{
AcpiOsPrintf (
- "**** Buffer length mismatch in converted AML: original %X new %X ****\n",
+ "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n",
Aml1BufferLength, Aml2BufferLength);
}
Aml1 = Aml1Buffer;
Aml2 = Aml2Buffer;
+ Aml1End = Aml1Buffer + Aml1BufferLength;
+ Aml2End = Aml2Buffer + Aml2BufferLength;
/* Walk the descriptor lists, comparing each descriptor */
- while (Aml1 < (Aml1Buffer + Aml1BufferLength))
+ while ((Aml1 < Aml1End) && (Aml2 < Aml2End))
{
/* Get the lengths of each descriptor */
@@ -513,7 +619,7 @@ AcpiDmCompareAmlResources (
if (Aml1Length != Aml2Length)
{
AcpiOsPrintf (
- "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X L1 %X L2 %X ****\n",
+ "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n",
Count, ResourceType, Offset, Aml1Length, Aml2Length);
}
@@ -524,6 +630,15 @@ AcpiDmCompareAmlResources (
AcpiOsPrintf (
"**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n",
Count, ResourceType, Offset);
+
+ for (i = 0; i < Aml1Length; i++)
+ {
+ if (Aml1[i] != Aml2[i])
+ {
+ AcpiOsPrintf ("Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n",
+ i, Aml2[i], Aml1[i]);
+ }
+ }
}
/* Exit on EndTag descriptor */
@@ -626,160 +741,301 @@ Exit1:
/*******************************************************************************
*
- * FUNCTION: AcpiDbDisplayResources
+ * FUNCTION: AcpiDbResourceCallback
*
- * PARAMETERS: ObjectArg - String with hex value of the object
+ * PARAMETERS: ACPI_WALK_RESOURCE_CALLBACK
*
- * RETURN: None
+ * RETURN: Status
*
- * DESCRIPTION: Display the resource objects associated with a device.
+ * DESCRIPTION: Simple callback to exercise AcpiWalkResources
*
******************************************************************************/
-void
-AcpiDbDisplayResources (
- char *ObjectArg)
+static ACPI_STATUS
+AcpiDbResourceCallback (
+ ACPI_RESOURCE *Resource,
+ void *Context)
+{
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbDeviceResources
+ *
+ * PARAMETERS: ACPI_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Display the _PRT/_CRS/_PRS resources for a device object.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbDeviceResources (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node;
- ACPI_STATUS Status;
+ ACPI_NAMESPACE_NODE *PrtNode = NULL;
+ ACPI_NAMESPACE_NODE *CrsNode = NULL;
+ ACPI_NAMESPACE_NODE *PrsNode = NULL;
+ ACPI_NAMESPACE_NODE *AeiNode = NULL;
+ char *ParentPath;
ACPI_BUFFER ReturnObj;
+ ACPI_STATUS Status;
- AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
- AcpiDbgLevel |= ACPI_LV_RESOURCES;
+ Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+ ParentPath = AcpiNsGetExternalPathname (Node);
+ if (!ParentPath)
+ {
+ return (AE_NO_MEMORY);
+ }
- /* Convert string to object pointer */
+ /* Get handles to the resource methods for this device */
- Node = AcpiDbConvertToNode (ObjectArg);
- if (!Node)
+ (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode));
+ (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode));
+ (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode));
+ (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode));
+ if (!PrtNode && !CrsNode && !PrsNode && !AeiNode)
{
- return;
+ goto Cleanup; /* Nothing to do */
}
+ AcpiOsPrintf ("\nDevice: %s\n", ParentPath);
+
/* Prepare for a return object of arbitrary size */
ReturnObj.Pointer = AcpiGbl_DbBuffer;
ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+
/* _PRT */
- AcpiOsPrintf ("Evaluating _PRT\n");
+ if (PrtNode)
+ {
+ AcpiOsPrintf ("Evaluating _PRT\n");
- /* Check if _PRT exists */
+ Status = AcpiEvaluateObject (PrtNode, NULL, NULL, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not evaluate _PRT: %s\n",
+ AcpiFormatException (Status));
+ goto GetCrs;
+ }
- Status = AcpiEvaluateObject (Node, METHOD_NAME__PRT, NULL, &ReturnObj);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not obtain _PRT: %s\n",
- AcpiFormatException (Status));
- goto GetCrs;
- }
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
- ReturnObj.Pointer = AcpiGbl_DbBuffer;
- ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+ Status = AcpiGetIrqRoutingTable (Node, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n",
+ AcpiFormatException (Status));
+ goto GetCrs;
+ }
- Status = AcpiGetIrqRoutingTable (Node, &ReturnObj);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n",
- AcpiFormatException (Status));
- goto GetCrs;
+ AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer));
}
- AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer));
-
/* _CRS */
GetCrs:
- AcpiOsPrintf ("Evaluating _CRS\n");
+ if (CrsNode)
+ {
+ AcpiOsPrintf ("Evaluating _CRS\n");
- ReturnObj.Pointer = AcpiGbl_DbBuffer;
- ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
- /* Check if _CRS exists */
+ Status = AcpiEvaluateObject (CrsNode, NULL, NULL, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not evaluate _CRS: %s\n",
+ AcpiFormatException (Status));
+ goto GetPrs;
+ }
- Status = AcpiEvaluateObject (Node, METHOD_NAME__CRS, NULL, &ReturnObj);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not obtain _CRS: %s\n",
- AcpiFormatException (Status));
- goto GetPrs;
- }
+ /* This code is here to exercise the AcpiWalkResources interface */
- /* Get the _CRS resource list */
+ Status = AcpiWalkResources (Node, METHOD_NAME__CRS,
+ AcpiDbResourceCallback, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("AcpiWalkResources failed: %s\n",
+ AcpiFormatException (Status));
+ goto GetPrs;
+ }
- ReturnObj.Pointer = AcpiGbl_DbBuffer;
- ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+ /* Get the _CRS resource list */
- Status = AcpiGetCurrentResources (Node, &ReturnObj);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
- AcpiFormatException (Status));
- goto GetPrs;
- }
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
- /* Dump the _CRS resource list */
+ Status = AcpiGetCurrentResources (Node, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n",
+ AcpiFormatException (Status));
+ goto GetPrs;
+ }
- AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
- ReturnObj.Pointer));
+ /* Dump the _CRS resource list */
- /*
- * Perform comparison of original AML to newly created AML. This tests both
- * the AML->Resource conversion and the Resource->Aml conversion.
- */
- Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS);
+ AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE,
+ ReturnObj.Pointer));
- /* Execute _SRS with the resource list */
+ /*
+ * Perform comparison of original AML to newly created AML. This tests both
+ * the AML->Resource conversion and the Resource->Aml conversion.
+ */
+ Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS);
- Status = AcpiSetCurrentResources (Node, &ReturnObj);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n",
- AcpiFormatException (Status));
- goto GetPrs;
+ /* Execute _SRS with the resource list */
+
+ Status = AcpiSetCurrentResources (Node, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n",
+ AcpiFormatException (Status));
+ goto GetPrs;
+ }
}
/* _PRS */
GetPrs:
- AcpiOsPrintf ("Evaluating _PRS\n");
+ if (PrsNode)
+ {
+ AcpiOsPrintf ("Evaluating _PRS\n");
- ReturnObj.Pointer = AcpiGbl_DbBuffer;
- ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+
+ Status = AcpiEvaluateObject (PrsNode, NULL, NULL, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not evaluate _PRS: %s\n",
+ AcpiFormatException (Status));
+ goto GetAei;
+ }
- /* Check if _PRS exists */
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
- Status = AcpiEvaluateObject (Node, METHOD_NAME__PRS, NULL, &ReturnObj);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not obtain _PRS: %s\n",
- AcpiFormatException (Status));
- goto Cleanup;
+ Status = AcpiGetPossibleResources (Node, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n",
+ AcpiFormatException (Status));
+ goto GetAei;
+ }
+
+ AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
}
- ReturnObj.Pointer = AcpiGbl_DbBuffer;
- ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
- Status = AcpiGetPossibleResources (Node, &ReturnObj);
- if (ACPI_FAILURE (Status))
+ /* _AEI */
+
+GetAei:
+ if (AeiNode)
{
- AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n",
- AcpiFormatException (Status));
- goto Cleanup;
+ AcpiOsPrintf ("Evaluating _AEI\n");
+
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+
+ Status = AcpiEvaluateObject (AeiNode, NULL, NULL, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not evaluate _AEI: %s\n",
+ AcpiFormatException (Status));
+ goto Cleanup;
+ }
+
+ ReturnObj.Pointer = AcpiGbl_DbBuffer;
+ ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE;
+
+ Status = AcpiGetEventResources (Node, &ReturnObj);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("AcpiGetEventResources failed: %s\n",
+ AcpiFormatException (Status));
+ goto Cleanup;
+ }
+
+ AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
}
- AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer));
Cleanup:
+ ACPI_FREE (ParentPath);
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbDisplayResources
+ *
+ * PARAMETERS: ObjectArg - String object name or object pointer.
+ * "*" means "display resources for all devices"
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Display the resource objects associated with a device.
+ *
+ ******************************************************************************/
+
+void
+AcpiDbDisplayResources (
+ char *ObjectArg)
+{
+ ACPI_NAMESPACE_NODE *Node;
+
+
+ AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
+ AcpiDbgLevel |= ACPI_LV_RESOURCES;
+
+ /* Asterisk means "display resources for all devices" */
+
+ if (!ACPI_STRCMP (ObjectArg, "*"))
+ {
+ (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL);
+ }
+ else
+ {
+ /* Convert string to object pointer */
+
+ Node = AcpiDbConvertToNode (ObjectArg);
+ if (Node)
+ {
+ if (Node->Type != ACPI_TYPE_DEVICE)
+ {
+ AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n",
+ Node->Name.Ascii, AcpiUtGetTypeName (Node->Type));
+ }
+ else
+ {
+ (void) AcpiDbDeviceResources (Node, 0, NULL, NULL);
+ }
+ }
+ }
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
- return;
}
+#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiDbGenerateGpe
@@ -818,5 +1074,6 @@ AcpiDbGenerateGpe (
(void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
#endif /* ACPI_DEBUGGER */
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbdisply.c b/usr/src/uts/intel/io/acpica/debugger/dbdisply.c
index 61e837e751..7facc8dd08 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbdisply.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbdisply.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -90,6 +90,8 @@ static ACPI_ADR_SPACE_TYPE AcpiGbl_SpaceIdList[] =
ACPI_ADR_SPACE_CMOS,
ACPI_ADR_SPACE_PCI_BAR_TARGET,
ACPI_ADR_SPACE_IPMI,
+ ACPI_ADR_SPACE_GPIO,
+ ACPI_ADR_SPACE_GSBUS,
ACPI_ADR_SPACE_DATA_TABLE,
ACPI_ADR_SPACE_FIXED_HARDWARE
};
@@ -105,8 +107,8 @@ typedef struct acpi_handler_info
static ACPI_HANDLER_INFO AcpiGbl_HandlerList[] =
{
- {&AcpiGbl_SystemNotify.Handler, "System Notifications"},
- {&AcpiGbl_DeviceNotify.Handler, "Device Notifications"},
+ {&AcpiGbl_GlobalNotify[0].Handler, "System Notifications"},
+ {&AcpiGbl_GlobalNotify[1].Handler, "Device Notifications"},
{&AcpiGbl_TableHandler, "ACPI Table Events"},
{&AcpiGbl_ExceptionHandler, "Control Method Exceptions"},
{&AcpiGbl_InterfaceHandler, "OSI Invocations"}
@@ -768,6 +770,7 @@ AcpiDbDisplayArgumentObject (
}
+#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayGpes
@@ -930,6 +933,7 @@ AcpiDbDisplayGpes (
GpeXruptInfo = GpeXruptInfo->Next;
}
}
+#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
@@ -971,7 +975,7 @@ AcpiDbDisplayHandlers (
while (HandlerObj)
{
- if (i == HandlerObj->AddressSpace.SpaceId)
+ if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId)
{
AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
(HandlerObj->AddressSpace.HandlerFlags &
@@ -989,8 +993,28 @@ AcpiDbDisplayHandlers (
FoundHandler:;
}
+
+ /* Find all handlers for user-defined SpaceIDs */
+
+ HandlerObj = ObjDesc->Device.Handler;
+ while (HandlerObj)
+ {
+ if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN)
+ {
+ AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
+ "User-defined ID", HandlerObj->AddressSpace.SpaceId);
+ AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING,
+ (HandlerObj->AddressSpace.HandlerFlags &
+ ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User",
+ HandlerObj->AddressSpace.Handler);
+ }
+
+ HandlerObj = HandlerObj->AddressSpace.Next;
+ }
}
+#if (!ACPI_REDUCED_HARDWARE)
+
/* Fixed event handlers */
AcpiOsPrintf ("\nFixed Event Handlers:\n");
@@ -1009,6 +1033,8 @@ AcpiDbDisplayHandlers (
}
}
+#endif /* !ACPI_REDUCED_HARDWARE */
+
/* Miscellaneous global handlers */
AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbexec.c b/usr/src/uts/intel/io/acpica/debugger/dbexec.c
index bcbc7a8daf..7818c9ddbe 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbexec.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbexec.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbfileio.c b/usr/src/uts/intel/io/acpica/debugger/dbfileio.c
index 8d0ef0aaa8..ef9b7fef53 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbfileio.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbfileio.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -271,10 +271,11 @@ AcpiDbReadTable (
fseek (fp, 0, SEEK_SET);
- /* The RSDT and FACS tables do not have standard ACPI headers */
+ /* The RSDT, FACS and S3PT tables do not have standard ACPI headers */
if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ") ||
- ACPI_COMPARE_NAME (TableHeader.Signature, "FACS"))
+ ACPI_COMPARE_NAME (TableHeader.Signature, "FACS") ||
+ ACPI_COMPARE_NAME (TableHeader.Signature, "S3PT"))
{
*TableLength = FileSize;
StandardHeader = FALSE;
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbhistry.c b/usr/src/uts/intel/io/acpica/debugger/dbhistry.c
index 855d6b956f..536b69cdfa 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbhistry.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbhistry.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbinput.c b/usr/src/uts/intel/io/acpica/debugger/dbinput.c
index 1d716cfb1b..0ae313934b 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbinput.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbinput.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -131,6 +131,7 @@ enum AcpiExDebuggerCommands
CMD_STATS,
CMD_STOP,
CMD_TABLES,
+ CMD_TEMPLATE,
CMD_TERMINATE,
CMD_THREADS,
CMD_TRACE,
@@ -199,6 +200,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
{"STATS", 0},
{"STOP", 0},
{"TABLES", 0},
+ {"TEMPLATE", 1},
{"TERMINATE", 0},
{"THREADS", 3},
{"TRACE", 1},
@@ -268,9 +270,10 @@ AcpiDbDisplayHelp (
AcpiOsPrintf (" Predefined Check all predefined names\n");
AcpiOsPrintf (" Prefix [<NamePath>] Set or Get current execution prefix\n");
AcpiOsPrintf (" References <Addr> Find all references to object at addr\n");
- AcpiOsPrintf (" Resources <Device> Get and display Device resources\n");
+ AcpiOsPrintf (" Resources <DeviceName | *> Display Device resources (* = all devices)\n");
AcpiOsPrintf (" Set N <NamedObject> <Value> Set value for named integer\n");
AcpiOsPrintf (" Sleep <SleepState> Simulate sleep/wake sequence\n");
+ AcpiOsPrintf (" Template <Object> Format/dump a Buffer/ResourceTemplate\n");
AcpiOsPrintf (" Terminate Delete namespace and all internal objects\n");
AcpiOsPrintf (" Type <Object> Display object type\n");
@@ -659,12 +662,15 @@ AcpiDbCommandDispatch (
break;
case CMD_ENABLEACPI:
+#if (!ACPI_REDUCED_HARDWARE)
+
Status = AcpiEnable();
if (ACPI_FAILURE(Status))
{
AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status);
return (Status);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
break;
case CMD_EVENT:
@@ -854,6 +860,10 @@ AcpiDbCommandDispatch (
AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]);
break;
+ case CMD_TEMPLATE:
+ AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]);
+ break;
+
case CMD_TERMINATE:
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
AcpiUtSubsystemShutdown ();
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbmethod.c b/usr/src/uts/intel/io/acpica/debugger/dbmethod.c
index f0b88ebdb3..0d45d68150 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbmethod.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbmethod.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbnames.c b/usr/src/uts/intel/io/acpica/debugger/dbnames.c
index e4e4280f29..be326c5390 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbnames.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbstats.c b/usr/src/uts/intel/io/acpica/debugger/dbstats.c
index bf17c63932..fcc4998ede 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbstats.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbstats.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -227,8 +227,8 @@ AcpiDbEnumerateObject (
case ACPI_TYPE_DEVICE:
- AcpiDbEnumerateObject (ObjDesc->Device.SystemNotify);
- AcpiDbEnumerateObject (ObjDesc->Device.DeviceNotify);
+ AcpiDbEnumerateObject (ObjDesc->Device.NotifyList[0]);
+ AcpiDbEnumerateObject (ObjDesc->Device.NotifyList[1]);
AcpiDbEnumerateObject (ObjDesc->Device.Handler);
break;
@@ -248,21 +248,21 @@ AcpiDbEnumerateObject (
case ACPI_TYPE_POWER:
- AcpiDbEnumerateObject (ObjDesc->PowerResource.SystemNotify);
- AcpiDbEnumerateObject (ObjDesc->PowerResource.DeviceNotify);
+ AcpiDbEnumerateObject (ObjDesc->PowerResource.NotifyList[0]);
+ AcpiDbEnumerateObject (ObjDesc->PowerResource.NotifyList[1]);
break;
case ACPI_TYPE_PROCESSOR:
- AcpiDbEnumerateObject (ObjDesc->Processor.SystemNotify);
- AcpiDbEnumerateObject (ObjDesc->Processor.DeviceNotify);
+ AcpiDbEnumerateObject (ObjDesc->Processor.NotifyList[0]);
+ AcpiDbEnumerateObject (ObjDesc->Processor.NotifyList[1]);
AcpiDbEnumerateObject (ObjDesc->Processor.Handler);
break;
case ACPI_TYPE_THERMAL:
- AcpiDbEnumerateObject (ObjDesc->ThermalZone.SystemNotify);
- AcpiDbEnumerateObject (ObjDesc->ThermalZone.DeviceNotify);
+ AcpiDbEnumerateObject (ObjDesc->ThermalZone.NotifyList[0]);
+ AcpiDbEnumerateObject (ObjDesc->ThermalZone.NotifyList[1]);
AcpiDbEnumerateObject (ObjDesc->ThermalZone.Handler);
break;
@@ -522,6 +522,18 @@ AcpiDbDisplayStatistics (
AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE));
AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
+ AcpiOsPrintf ("\n");
+
+ AcpiOsPrintf ("Generic State %3d\n", sizeof (ACPI_GENERIC_STATE));
+ AcpiOsPrintf ("Common State %3d\n", sizeof (ACPI_COMMON_STATE));
+ AcpiOsPrintf ("Control State %3d\n", sizeof (ACPI_CONTROL_STATE));
+ AcpiOsPrintf ("Update State %3d\n", sizeof (ACPI_UPDATE_STATE));
+ AcpiOsPrintf ("Scope State %3d\n", sizeof (ACPI_SCOPE_STATE));
+ AcpiOsPrintf ("Parse Scope %3d\n", sizeof (ACPI_PSCOPE_STATE));
+ AcpiOsPrintf ("Package State %3d\n", sizeof (ACPI_PKG_STATE));
+ AcpiOsPrintf ("Thread State %3d\n", sizeof (ACPI_THREAD_STATE));
+ AcpiOsPrintf ("Result Values %3d\n", sizeof (ACPI_RESULT_VALUES));
+ AcpiOsPrintf ("Notify Info %3d\n", sizeof (ACPI_NOTIFY_INFO));
break;
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbutils.c b/usr/src/uts/intel/io/acpica/debugger/dbutils.c
index 5b071e87b6..cf29b225de 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbutils.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -190,10 +190,7 @@ AcpiDbDumpExternalObject (
case ACPI_TYPE_STRING:
AcpiOsPrintf ("[String] Length %.2X = ", ObjDesc->String.Length);
- for (i = 0; i < ObjDesc->String.Length; i++)
- {
- AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]);
- }
+ AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
AcpiOsPrintf ("\n");
break;
@@ -208,7 +205,7 @@ AcpiDbDumpExternalObject (
AcpiOsPrintf ("\n");
}
AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
- ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
+ ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
}
else
{
diff --git a/usr/src/uts/intel/io/acpica/debugger/dbxface.c b/usr/src/uts/intel/io/acpica/debugger/dbxface.c
index e638733c22..cd30273434 100644
--- a/usr/src/uts/intel/io/acpica/debugger/dbxface.c
+++ b/usr/src/uts/intel/io/acpica/debugger/dbxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmbuffer.c b/usr/src/uts/intel/io/acpica/disassembler/dmbuffer.c
index f223f89f43..9f49f92e47 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmbuffer.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmbuffer.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -108,19 +108,19 @@ AcpiDmDisasmByteList (
}
AcpiDmIndent (Level);
- if (ByteCount > 7)
+ if (ByteCount > 8)
{
- AcpiOsPrintf ("/* %04X */ ", i);
+ AcpiOsPrintf ("/* %04X */ ", i);
}
}
- AcpiOsPrintf ("0x%2.2X", (UINT32) ByteData[i]);
+ AcpiOsPrintf (" 0x%2.2X", (UINT32) ByteData[i]);
/* Add comma if there are more bytes to display */
if (i < (ByteCount -1))
{
- AcpiOsPrintf (", ");
+ AcpiOsPrintf (",");
}
}
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmnames.c b/usr/src/uts/intel/io/acpica/disassembler/dmnames.c
index b00bca8e86..92e67c2e0a 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmnames.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmobject.c b/usr/src/uts/intel/io/acpica/disassembler/dmobject.c
index 9d5d7dd92c..cb515e9427 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmobject.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmobject.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmopcode.c b/usr/src/uts/intel/io/acpica/disassembler/dmopcode.c
index 5da3847714..6d2c3e1ecf 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmopcode.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmopcode.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -303,6 +303,7 @@ AcpiDmDisassembleOneOp (
UINT32 Length;
ACPI_PARSE_OBJECT *Child;
ACPI_STATUS Status;
+ UINT8 *Aml;
if (!Op)
@@ -426,16 +427,19 @@ AcpiDmDisassembleOneOp (
* types of buffers, we have to closely look at the data in the
* buffer to determine the type.
*/
- Status = AcpiDmIsResourceTemplate (Op);
- if (ACPI_SUCCESS (Status))
+ if (!AcpiGbl_NoResourceDisassembly)
{
- Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
- AcpiOsPrintf ("ResourceTemplate");
- break;
- }
- else if (Status == AE_AML_NO_RESOURCE_END_TAG)
- {
- AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");
+ Status = AcpiDmIsResourceTemplate (Op);
+ if (ACPI_SUCCESS (Status))
+ {
+ Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
+ AcpiOsPrintf ("ResourceTemplate");
+ break;
+ }
+ else if (Status == AE_AML_NO_RESOURCE_END_TAG)
+ {
+ AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");
+ }
}
if (AcpiDmIsUnicodeBuffer (Op))
@@ -495,7 +499,7 @@ AcpiDmDisassembleOneOp (
if (Info->BitOffset % 8 == 0)
{
- AcpiOsPrintf (" Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset));
+ AcpiOsPrintf ("Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset));
}
else
{
@@ -507,16 +511,59 @@ AcpiDmDisassembleOneOp (
case AML_INT_ACCESSFIELD_OP:
+ case AML_INT_EXTACCESSFIELD_OP:
- AcpiOsPrintf (" AccessAs (%s, ",
- AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer >> 8) & 0x7]);
+ AcpiOsPrintf ("AccessAs (%s, ",
+ AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer & 0x7)]);
+
+ AcpiDmDecodeAttribute ((UINT8) (Op->Common.Value.Integer >> 8));
+
+ if (Op->Common.AmlOpcode == AML_INT_EXTACCESSFIELD_OP)
+ {
+ AcpiOsPrintf (" (0x%2.2X)", (unsigned) ((Op->Common.Value.Integer >> 16) & 0xFF));
+ }
- AcpiDmDecodeAttribute ((UINT8) Op->Common.Value.Integer);
AcpiOsPrintf (")");
AcpiDmCommaIfFieldMember (Op);
break;
+ case AML_INT_CONNECTION_OP:
+
+ /*
+ * Two types of Connection() - one with a buffer object, the
+ * other with a namestring that points to a buffer object.
+ */
+ AcpiOsPrintf ("Connection (");
+ Child = Op->Common.Value.Arg;
+
+ if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
+ {
+ AcpiOsPrintf ("\n");
+
+ Aml = Child->Named.Data;
+ Length = (UINT32) Child->Common.Value.Integer;
+
+ Info->Level += 1;
+ Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
+ AcpiDmResourceTemplate (Info, Op->Common.Parent, Aml, Length);
+
+ Info->Level -= 1;
+ AcpiDmIndent (Info->Level);
+ }
+ else
+ {
+ AcpiDmNamestring (Child->Common.Value.Name);
+ }
+
+ AcpiOsPrintf (")");
+ AcpiDmCommaIfFieldMember (Op);
+ AcpiOsPrintf ("\n");
+
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; /* for now, ignore in AcpiDmAscendingOp */
+ Child->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ break;
+
case AML_INT_BYTELIST_OP:
AcpiDmByteList (Info, Op);
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmresrc.c b/usr/src/uts/intel/io/acpica/disassembler/dmresrc.c
index fe208d5260..9c07bf7e94 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmresrc.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,12 +55,6 @@
/* Dispatch tables for Resource disassembly functions */
-typedef
-void (*ACPI_RESOURCE_HANDLER) (
- AML_RESOURCE *Resource,
- UINT32 Length,
- UINT32 Level);
-
static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] =
{
/* Small descriptors */
@@ -75,7 +69,7 @@ static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] =
AcpiDmEndDependentDescriptor, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
AcpiDmIoDescriptor, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */
AcpiDmFixedIoDescriptor, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */
- NULL, /* 0x0A, Reserved */
+ AcpiDmFixedDmaDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
NULL, /* 0x0B, Reserved */
NULL, /* 0x0C, Reserved */
NULL, /* 0x0D, Reserved */
@@ -95,7 +89,10 @@ static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] =
AcpiDmWordDescriptor, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */
AcpiDmInterruptDescriptor, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */
AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
- AcpiDmExtendedDescriptor /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
+ AcpiDmExtendedDescriptor, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
+ AcpiDmGpioDescriptor, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
+ NULL, /* 0x0D, Reserved */
+ AcpiDmSerialBusDescriptor /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */
};
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c b/usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c
index 2284928752..ed78b31c70 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -1050,4 +1050,3 @@ AcpiDmVendorLargeDescriptor (
}
#endif
-
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmresrcl2.c b/usr/src/uts/intel/io/acpica/disassembler/dmresrcl2.c
new file mode 100644
index 0000000000..e79307ee72
--- /dev/null
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmresrcl2.c
@@ -0,0 +1,700 @@
+/*******************************************************************************
+ *
+ * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2)
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acdisasm.h"
+
+
+#ifdef ACPI_DISASSEMBLER
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("dbresrcl2")
+
+/* Local prototypes */
+
+static void
+AcpiDmI2cSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+static void
+AcpiDmSpiSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+static void
+AcpiDmUartSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+static void
+AcpiDmGpioCommon (
+ AML_RESOURCE *Resource,
+ UINT32 Level);
+
+static void
+AcpiDmDumpRawDataBuffer (
+ UINT8 *Buffer,
+ UINT32 Length,
+ UINT32 Level);
+
+
+/* Dispatch table for the serial bus descriptors */
+
+static ACPI_RESOURCE_HANDLER SerialBusResourceDispatch [] =
+{
+ NULL,
+ AcpiDmI2cSerialBusDescriptor,
+ AcpiDmSpiSerialBusDescriptor,
+ AcpiDmUartSerialBusDescriptor
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpRawDataBuffer
+ *
+ * PARAMETERS: Buffer - Pointer to the data bytes
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for
+ * vendor data bytes.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmDumpRawDataBuffer (
+ UINT8 *Buffer,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT32 Index;
+ UINT32 i;
+ UINT32 j;
+
+
+ if (!Length)
+ {
+ return;
+ }
+
+ AcpiOsPrintf ("RawDataBuffer (0x%.2X) // Vendor Data", Length);
+
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("{\n");
+ AcpiDmIndent (Level + 2);
+
+ for (i = 0; i < Length;)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ Index = i + j;
+ if (Index >= Length)
+ {
+ goto Finish;
+ }
+
+ AcpiOsPrintf ("0x%2.2X", Buffer[Index]);
+ if ((Index + 1) >= Length)
+ {
+ goto Finish;
+ }
+
+ AcpiOsPrintf (", ");
+ }
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 2);
+
+ i += 8;
+ }
+
+Finish:
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmGpioCommon
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmGpioCommon (
+ AML_RESOURCE *Resource,
+ UINT32 Level)
+{
+ UINT32 PinCount;
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ UINT32 i;
+
+
+ /* ResourceSource, ResourceSourceIndex, ResourceType */
+
+ AcpiDmIndent (Level + 1);
+ if (Resource->Gpio.ResSourceOffset)
+ {
+ AcpiUtPrintString (
+ ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
+ ACPI_UINT8_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [(Resource->Gpio.Flags & 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->Gpio.VendorOffset)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->Gpio.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->Gpio.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ /* Dump the interrupt list */
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
+ Resource->Gpio.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->Gpio.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i], ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmGpioIntDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a GPIO Interrupt descriptor
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmGpioIntDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+
+ /* Dump the GpioInt-specific portion of the descriptor */
+
+ /* EdgeLevel, ActiveLevel, Shared */
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
+ AcpiGbl_HeDecode [(Resource->Gpio.IntFlags & 1)],
+ AcpiGbl_LlDecode [(Resource->Gpio.IntFlags >> 1) & 1],
+ AcpiGbl_ShrDecode [(Resource->Gpio.IntFlags >> 3) & 1]);
+
+ /* PinConfig, DebounceTimeout */
+
+ if (Resource->Gpio.PinConfig <= 3)
+ {
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
+ }
+ AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
+
+ /* Dump the GpioInt/GpioIo common portion of the descriptor */
+
+ AcpiDmGpioCommon (Resource, Level);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmGpioIoDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a GPIO Interrupt descriptor
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmGpioIoDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+
+ /* Dump the GpioIo-specific portion of the descriptor */
+
+ /* Shared, PinConfig */
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("GpioIo (%s, ",
+ AcpiGbl_ShrDecode [(Resource->Gpio.IntFlags >> 3) & 1]);
+
+ if (Resource->Gpio.PinConfig <= 3)
+ {
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
+ }
+
+ /* DebounceTimeout, DriveStrength, IoRestriction */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
+ AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
+ AcpiOsPrintf ("%s,\n",
+ AcpiGbl_IorDecode [Resource->Gpio.IntFlags & 3]);
+
+ /* Dump the GpioInt/GpioIo common portion of the descriptor */
+
+ AcpiDmGpioCommon (Resource, Level);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmGpioDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmGpioDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 ConnectionType;
+
+
+ ConnectionType = Resource->Gpio.ConnectionType;
+
+ switch (ConnectionType)
+ {
+ case AML_RESOURCE_GPIO_TYPE_INT:
+ AcpiDmGpioIntDescriptor (Resource, Length, Level);
+ break;
+
+ case AML_RESOURCE_GPIO_TYPE_IO:
+ AcpiDmGpioIoDescriptor (Resource, Length, Level);
+ break;
+
+ default:
+ AcpiOsPrintf ("Unknown GPIO type\n");
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpSerialBusVendorData
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump optional serial bus vendor data
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmDumpSerialBusVendorData (
+ AML_RESOURCE *Resource,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ UINT32 VendorLength;
+
+
+ /* Get the (optional) vendor data and length */
+
+ switch (Resource->CommonSerialBus.Type)
+ {
+ case AML_RESOURCE_I2C_SERIALBUSTYPE:
+
+ VendorLength = Resource->CommonSerialBus.TypeDataLength -
+ AML_RESOURCE_I2C_MIN_DATA_LEN;
+
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ sizeof (AML_RESOURCE_I2C_SERIALBUS));
+ break;
+
+ case AML_RESOURCE_SPI_SERIALBUSTYPE:
+
+ VendorLength = Resource->CommonSerialBus.TypeDataLength -
+ AML_RESOURCE_SPI_MIN_DATA_LEN;
+
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ sizeof (AML_RESOURCE_SPI_SERIALBUS));
+ break;
+
+ case AML_RESOURCE_UART_SERIALBUSTYPE:
+
+ VendorLength = Resource->CommonSerialBus.TypeDataLength -
+ AML_RESOURCE_UART_MIN_DATA_LEN;
+
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ sizeof (AML_RESOURCE_UART_SERIALBUS));
+ break;
+
+ default:
+ return;
+ }
+
+ /* Dump the vendor bytes as a RawDataBuffer object */
+
+ AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmI2cSerialBusDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a I2C serial bus descriptor
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmI2cSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT32 ResourceSourceOffset;
+
+
+ /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("I2cSerialBus (0x%4.4X, %s, 0x%8.8X,\n",
+ Resource->I2cSerialBus.SlaveAddress,
+ AcpiGbl_SmDecode [(Resource->I2cSerialBus.Flags & 1)],
+ Resource->I2cSerialBus.ConnectionSpeed);
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_AmDecode [(Resource->I2cSerialBus.TypeSpecificFlags & 1)]);
+
+ /* ResourceSource is a required field */
+
+ ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
+ Resource->CommonSerialBus.TypeDataLength;
+
+ AcpiUtPrintString (
+ ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ ACPI_UINT8_MAX);
+
+ /* ResourceSourceIndex, ResourceUsage */
+
+ AcpiOsPrintf (",\n");
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [(Resource->I2cSerialBus.Flags >> 1) & 1]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+ AcpiOsPrintf (",\n");
+
+ /* Dump the vendor data */
+
+ AcpiDmIndent (Level + 1);
+ AcpiDmDumpSerialBusVendorData (Resource, Level);
+ AcpiOsPrintf (")\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmSpiSerialBusDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a SPI serial bus descriptor
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmSpiSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT32 ResourceSourceOffset;
+
+
+ /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n",
+ Resource->SpiSerialBus.DeviceSelection,
+ AcpiGbl_DpDecode [(Resource->SpiSerialBus.TypeSpecificFlags >> 1) & 1],
+ AcpiGbl_WmDecode [(Resource->SpiSerialBus.TypeSpecificFlags & 1)],
+ Resource->SpiSerialBus.DataBitLength);
+
+ /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
+ AcpiGbl_SmDecode [(Resource->SpiSerialBus.Flags & 1)],
+ Resource->SpiSerialBus.ConnectionSpeed,
+ AcpiGbl_CpoDecode [(Resource->SpiSerialBus.ClockPolarity & 1)]);
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_CphDecode [(Resource->SpiSerialBus.ClockPhase & 1)]);
+
+ /* ResourceSource is a required field */
+
+ ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
+ Resource->CommonSerialBus.TypeDataLength;
+
+ AcpiUtPrintString (
+ ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ ACPI_UINT8_MAX);
+
+ /* ResourceSourceIndex, ResourceUsage */
+
+ AcpiOsPrintf (",\n");
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [(Resource->SpiSerialBus.Flags >> 1) & 1]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+ AcpiOsPrintf (",\n");
+
+ /* Dump the vendor data */
+
+ AcpiDmIndent (Level + 1);
+ AcpiDmDumpSerialBusVendorData (Resource, Level);
+ AcpiOsPrintf (")\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmUartSerialBusDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a UART serial bus descriptor
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmUartSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT32 ResourceSourceOffset;
+
+
+ /* ConnectionSpeed, BitsPerByte, StopBits */
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n",
+ Resource->UartSerialBus.DefaultBaudRate,
+ AcpiGbl_BpbDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 4) & 3],
+ AcpiGbl_SbDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 2) & 3]);
+
+ /* LinesInUse, IsBigEndian, Parity, FlowControl */
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
+ Resource->UartSerialBus.LinesEnabled,
+ AcpiGbl_EdDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 7) & 1],
+ AcpiGbl_PtDecode [Resource->UartSerialBus.Parity & 7],
+ AcpiGbl_FcDecode [Resource->UartSerialBus.TypeSpecificFlags & 3]);
+
+ /* ReceiveBufferSize, TransmitBufferSize */
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
+ Resource->UartSerialBus.RxFifoSize,
+ Resource->UartSerialBus.TxFifoSize);
+
+ /* ResourceSource is a required field */
+
+ ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
+ Resource->CommonSerialBus.TypeDataLength;
+
+ AcpiUtPrintString (
+ ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ ACPI_UINT8_MAX);
+
+ /* ResourceSourceIndex, ResourceUsage */
+
+ AcpiOsPrintf (",\n");
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [(Resource->UartSerialBus.Flags >> 1) & 1]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+ AcpiOsPrintf (",\n");
+
+ /* Dump the vendor data */
+
+ AcpiDmIndent (Level + 1);
+ AcpiDmDumpSerialBusVendorData (Resource, Level);
+ AcpiOsPrintf (")\n");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmSerialBusDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+
+ SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
+ Resource, Length, Level);
+}
+
+#endif
+
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmresrcs.c b/usr/src/uts/intel/io/acpica/disassembler/dmresrcs.c
index 52b0fa3ea3..32759d991b 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmresrcs.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmresrcs.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -121,9 +121,9 @@ AcpiDmDmaDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("DMA (%s, %s, %s, ",
- AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3],
- AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1],
- AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]);
+ AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3],
+ AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1],
+ AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]);
/* Insert a descriptor name */
@@ -137,6 +137,49 @@ AcpiDmDmaDescriptor (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmFixedDmaDescriptor
+ *
+ * PARAMETERS: Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a FixedDMA descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmFixedDmaDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ",
+ Resource->FixedDma.RequestLines,
+ Resource->FixedDma.Channels);
+
+ if (Resource->FixedDma.Width <= 5)
+ {
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_DtsDecode [Resource->FixedDma.Width]);
+ }
+ else
+ {
+ AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ", Resource->FixedDma.Width);
+ }
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+ AcpiOsPrintf (")\n");
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmIoDescriptor
*
* PARAMETERS: Resource - Pointer to the resource descriptor
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmutils.c b/usr/src/uts/intel/io/acpica/disassembler/dmutils.c
index b3db9312d5..ce3443ec3f 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmutils.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -135,7 +135,8 @@ const char *AcpiGbl_IrqDecode[] =
*
* RETURN: None
*
- * DESCRIPTION: Decode the AccessAs attribute byte. (Mostly SMBus stuff)
+ * DESCRIPTION: Decode the AccessAs attribute byte. (Mostly SMBus and
+ * GenericSerialBus stuff.)
*
******************************************************************************/
@@ -146,44 +147,61 @@ AcpiDmDecodeAttribute (
switch (Attribute)
{
- case AML_FIELD_ATTRIB_SMB_QUICK:
+ case AML_FIELD_ATTRIB_QUICK:
- AcpiOsPrintf ("SMBQuick");
+ AcpiOsPrintf ("AttribQuick");
break;
- case AML_FIELD_ATTRIB_SMB_SEND_RCV:
+ case AML_FIELD_ATTRIB_SEND_RCV:
- AcpiOsPrintf ("SMBSendReceive");
+ AcpiOsPrintf ("AttribSendReceive");
break;
- case AML_FIELD_ATTRIB_SMB_BYTE:
+ case AML_FIELD_ATTRIB_BYTE:
- AcpiOsPrintf ("SMBByte");
+ AcpiOsPrintf ("AttribByte");
break;
- case AML_FIELD_ATTRIB_SMB_WORD:
+ case AML_FIELD_ATTRIB_WORD:
- AcpiOsPrintf ("SMBWord");
+ AcpiOsPrintf ("AttribWord");
break;
- case AML_FIELD_ATTRIB_SMB_WORD_CALL:
+ case AML_FIELD_ATTRIB_BLOCK:
- AcpiOsPrintf ("SMBProcessCall");
+ AcpiOsPrintf ("AttribBlock");
break;
- case AML_FIELD_ATTRIB_SMB_BLOCK:
+ case AML_FIELD_ATTRIB_MULTIBYTE:
- AcpiOsPrintf ("SMBBlock");
+ AcpiOsPrintf ("AttribBytes");
break;
- case AML_FIELD_ATTRIB_SMB_BLOCK_CALL:
+ case AML_FIELD_ATTRIB_WORD_CALL:
- AcpiOsPrintf ("SMBBlockProcessCall");
+ AcpiOsPrintf ("AttribProcessCall");
+ break;
+
+ case AML_FIELD_ATTRIB_BLOCK_CALL:
+
+ AcpiOsPrintf ("AttribBlockProcessCall");
+ break;
+
+ case AML_FIELD_ATTRIB_RAW_BYTES:
+
+ AcpiOsPrintf ("AttribRawBytes");
+ break;
+
+ case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+ AcpiOsPrintf ("AttribRawProcessBytes");
break;
default:
- AcpiOsPrintf ("0x%.2X", Attribute);
+ /* A ByteConst is allowed by the grammar */
+
+ AcpiOsPrintf ("0x%2.2X", Attribute);
break;
}
}
diff --git a/usr/src/uts/intel/io/acpica/disassembler/dmwalk.c b/usr/src/uts/intel/io/acpica/disassembler/dmwalk.c
index 2a4b5e545f..dd3ee00255 100644
--- a/usr/src/uts/intel/io/acpica/disassembler/dmwalk.c
+++ b/usr/src/uts/intel/io/acpica/disassembler/dmwalk.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -464,7 +464,8 @@ AcpiDmDescendingOp (
AcpiDmDisassembleOneOp (NULL, Info, Op);
- if (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_PREFIX)
+ if ((Op->Common.DisasmOpcode == ACPI_DASM_LNOT_PREFIX) ||
+ (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP))
{
return (AE_OK);
}
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsargs.c b/usr/src/uts/intel/io/acpica/dispatcher/dsargs.c
index 87def86051..ea0d7bee88 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsargs.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsargs.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -424,7 +424,15 @@ AcpiDsGetRegionArguments (
/* Execute the argument AML */
- Status = AcpiDsExecuteArguments (Node, Node->Parent,
+ Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode,
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
+ ObjDesc->Region.Address, ObjDesc->Region.Length,
+ Node);
return_ACPI_STATUS (Status);
}
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c b/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
index 41a44951c2..5c5c51a573 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsfield.c b/usr/src/uts/intel/io/acpica/dispatcher/dsfield.c
index 886b6c24c5..1c3c523720 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsfield.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -243,6 +243,7 @@ AcpiDsGetFieldNames (
{
ACPI_STATUS Status;
UINT64 Position;
+ ACPI_PARSE_OBJECT *Child;
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
@@ -257,10 +258,11 @@ AcpiDsGetFieldNames (
while (Arg)
{
/*
- * Three types of field elements are handled:
- * 1) Offset - specifies a bit offset
- * 2) AccessAs - changes the access mode
- * 3) Name - Enters a new named field into the namespace
+ * Four types of field elements are handled:
+ * 1) Name - Enters a new named field into the namespace
+ * 2) Offset - specifies a bit offset
+ * 3) AccessAs - changes the access mode/attributes
+ * 4) Connection - Associate a resource template with the field
*/
switch (Arg->Common.AmlOpcode)
{
@@ -279,24 +281,67 @@ AcpiDsGetFieldNames (
Info->FieldBitPosition = (UINT32) Position;
break;
-
case AML_INT_ACCESSFIELD_OP:
-
+ case AML_INT_EXTACCESSFIELD_OP:
/*
- * Get a new AccessType and AccessAttribute -- to be used for all
- * field units that follow, until field end or another AccessAs
- * keyword.
+ * Get new AccessType, AccessAttribute, and AccessLength fields
+ * -- to be used for all field units that follow, until the
+ * end-of-field or another AccessAs keyword is encountered.
+ * NOTE. These three bytes are encoded in the integer value
+ * of the parseop for convenience.
*
* In FieldFlags, preserve the flag bits other than the
- * ACCESS_TYPE bits
+ * ACCESS_TYPE bits.
*/
+
+ /* AccessType (ByteAcc, WordAcc, etc.) */
+
Info->FieldFlags = (UINT8)
((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
- ((UINT8) ((UINT32) Arg->Common.Value.Integer >> 8)));
+ ((UINT8) ((UINT32) (Arg->Common.Value.Integer & 0x07))));
+
+ /* AccessAttribute (AttribQuick, AttribByte, etc.) */
+
+ Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
+
+ /* AccessLength (for serial/buffer protocols) */
- Info->Attribute = (UINT8) (Arg->Common.Value.Integer);
+ Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
break;
+ case AML_INT_CONNECTION_OP:
+ /*
+ * Clear any previous connection. New connection is used for all
+ * fields that follow, similar to AccessAs
+ */
+ Info->ResourceBuffer = NULL;
+ Info->ConnectionNode = NULL;
+
+ /*
+ * A Connection() is either an actual resource descriptor (buffer)
+ * or a named reference to a resource template
+ */
+ Child = Arg->Common.Value.Arg;
+ if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
+ {
+ Info->ResourceBuffer = Child->Named.Data;
+ Info->ResourceLength = (UINT16) Child->Named.Value.Integer;
+ }
+ else
+ {
+ /* Lookup the Connection() namepath, it should already exist */
+
+ Status = AcpiNsLookup (WalkState->ScopeInfo,
+ Child->Common.Value.Name, ACPI_TYPE_ANY,
+ ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
+ WalkState, &Info->ConnectionNode);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
+ return_ACPI_STATUS (Status);
+ }
+ }
+ break;
case AML_INT_NAMEDFIELD_OP:
@@ -348,7 +393,6 @@ AcpiDsGetFieldNames (
Info->FieldBitPosition += Info->FieldBitLength;
break;
-
default:
ACPI_ERROR ((AE_INFO,
@@ -406,6 +450,8 @@ AcpiDsCreateField (
}
}
+ ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
+
/* Second arg is the field flags */
Arg = Arg->Common.Next;
@@ -418,7 +464,6 @@ AcpiDsCreateField (
Info.RegionNode = RegionNode;
Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
-
return_ACPI_STATUS (Status);
}
@@ -514,8 +559,8 @@ AcpiDsInitFieldObjects (
while (Arg)
{
/*
- * Ignore OFFSET and ACCESSAS terms here; we are only interested in the
- * field names in order to enter them into the namespace.
+ * Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested
+ * in the field names in order to enter them into the namespace.
*/
if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
{
@@ -697,7 +742,6 @@ AcpiDsCreateIndexField (
Info.RegionNode = RegionNode;
Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
-
return_ACPI_STATUS (Status);
}
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsinit.c b/usr/src/uts/intel/io/acpica/dispatcher/dsinit.c
index 154e5de34f..1c7ad88492 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsinit.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c b/usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c
index 1cfa1c6853..670382ac9b 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c b/usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c
index 74ee4bdf31..b4509e7710 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsobject.c b/usr/src/uts/intel/io/acpica/dispatcher/dsobject.c
index 69888505c6..b3567766a2 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsobject.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsopcode.c b/usr/src/uts/intel/io/acpica/dispatcher/dsopcode.c
index 45fbed1e62..7569236f2e 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsopcode.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dsutils.c b/usr/src/uts/intel/io/acpica/dispatcher/dsutils.c
index 278009795c..66431aad53 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dsutils.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dswexec.c b/usr/src/uts/intel/io/acpica/dispatcher/dswexec.c
index 7983787958..5732855bbe 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dswexec.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dswexec.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dswload.c b/usr/src/uts/intel/io/acpica/dispatcher/dswload.c
index d8e77a6538..d40f911f41 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dswload.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dswload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dswload2.c b/usr/src/uts/intel/io/acpica/dispatcher/dswload2.c
index 608d525b36..27e3176209 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dswload2.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dswload2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dswscope.c b/usr/src/uts/intel/io/acpica/dispatcher/dswscope.c
index 9842b85b21..a59fdc9dca 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dswscope.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dswscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dswstate.c b/usr/src/uts/intel/io/acpica/dispatcher/dswstate.c
index f97ccadb60..dd11a18130 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dswstate.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dswstate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/events/evevent.c b/usr/src/uts/intel/io/acpica/events/evevent.c
index 0f5785a634..b5a7acde72 100644
--- a/usr/src/uts/intel/io/acpica/events/evevent.c
+++ b/usr/src/uts/intel/io/acpica/events/evevent.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evevent")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
+
/* Local prototypes */
static ACPI_STATUS
@@ -81,6 +83,13 @@ AcpiEvInitializeEvents (
ACPI_FUNCTION_TRACE (EvInitializeEvents);
+ /* If Hardware Reduced flag is set, there are no fixed events */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/*
* Initialize the Fixed and General Purpose Events. This is done prior to
* enabling SCIs to prevent interrupts from occurring before the handlers
@@ -128,6 +137,13 @@ AcpiEvInstallXruptHandlers (
ACPI_FUNCTION_TRACE (EvInstallXruptHandlers);
+ /* If Hardware Reduced flag is set, there is no ACPI h/w */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* Install the SCI handler */
Status = AcpiEvInstallSciHandler ();
@@ -315,4 +331,6 @@ AcpiEvFixedEventDispatch (
AcpiGbl_FixedEventHandlers[Event].Context));
}
+#endif /* !ACPI_REDUCED_HARDWARE */
+
diff --git a/usr/src/uts/intel/io/acpica/events/evglock.c b/usr/src/uts/intel/io/acpica/events/evglock.c
index cab444d06d..f40d129508 100644
--- a/usr/src/uts/intel/io/acpica/events/evglock.c
+++ b/usr/src/uts/intel/io/acpica/events/evglock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evglock")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
@@ -79,6 +80,13 @@ AcpiEvInitGlobalLockHandler (
ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler);
+ /* If Hardware Reduced flag is set, there is no global lock */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* Attempt installation of the global lock handler */
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
@@ -365,3 +373,5 @@ AcpiEvReleaseGlobalLock (
AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex);
return_ACPI_STATUS (Status);
}
+
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evgpe.c b/usr/src/uts/intel/io/acpica/events/evgpe.c
index c4326c721b..a3781a55c6 100644
--- a/usr/src/uts/intel/io/acpica/events/evgpe.c
+++ b/usr/src/uts/intel/io/acpica/events/evgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpe")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
+
/* Local prototypes */
static void ACPI_SYSTEM_XFACE
@@ -826,3 +828,4 @@ AcpiEvGpeDispatch (
return_UINT32 (ACPI_INTERRUPT_HANDLED);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evgpeblk.c b/usr/src/uts/intel/io/acpica/events/evgpeblk.c
index b8b7af254e..c281855c2c 100644
--- a/usr/src/uts/intel/io/acpica/events/evgpeblk.c
+++ b/usr/src/uts/intel/io/acpica/events/evgpeblk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpeblk")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
+
/* Local prototypes */
static ACPI_STATUS
@@ -545,3 +547,4 @@ AcpiEvInitializeGpeBlock (
return_ACPI_STATUS (AE_OK);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evgpeinit.c b/usr/src/uts/intel/io/acpica/events/evgpeinit.c
index f1d38ed853..f8962e947f 100644
--- a/usr/src/uts/intel/io/acpica/events/evgpeinit.c
+++ b/usr/src/uts/intel/io/acpica/events/evgpeinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,7 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpeinit")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*
* Note: History of _PRW support in ACPICA
@@ -457,3 +458,5 @@ AcpiEvMatchGpeMethod (
Name, GpeNumber));
return_ACPI_STATUS (AE_OK);
}
+
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evgpeutil.c b/usr/src/uts/intel/io/acpica/events/evgpeutil.c
index e706fbb7c7..70580cd853 100644
--- a/usr/src/uts/intel/io/acpica/events/evgpeutil.c
+++ b/usr/src/uts/intel/io/acpica/events/evgpeutil.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
@@ -50,6 +49,7 @@
ACPI_MODULE_NAME ("evgpeutil")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiEvWalkGpeList
@@ -422,3 +422,4 @@ AcpiEvDeleteGpeHandlers (
return_ACPI_STATUS (AE_OK);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evmisc.c b/usr/src/uts/intel/io/acpica/events/evmisc.c
index 1667f075db..68f751aca3 100644
--- a/usr/src/uts/intel/io/acpica/events/evmisc.c
+++ b/usr/src/uts/intel/io/acpica/events/evmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -111,105 +111,82 @@ AcpiEvQueueNotifyRequest (
UINT32 NotifyValue)
{
ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_OPERAND_OBJECT *HandlerObj = NULL;
- ACPI_GENERIC_STATE *NotifyInfo;
+ ACPI_OPERAND_OBJECT *HandlerListHead = NULL;
+ ACPI_GENERIC_STATE *Info;
+ UINT8 HandlerListId = 0;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_NAME (EvQueueNotifyRequest);
- /*
- * For value 3 (Ejection Request), some device method may need to be run.
- * For value 2 (Device Wake) if _PRW exists, the _PS0 method may need
- * to be run.
- * For value 0x80 (Status Change) on the power button or sleep button,
- * initiate soft-off or sleep operation?
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n",
- AcpiUtGetNodeName (Node), Node, NotifyValue,
- AcpiUtGetNotifyName (NotifyValue)));
-
- /* Get the notify object attached to the NS Node */
+ /* Are Notifies allowed on this object? */
- ObjDesc = AcpiNsGetAttachedObject (Node);
- if (ObjDesc)
+ if (!AcpiEvIsNotifyObject (Node))
{
- /* We have the notify object, Get the right handler */
-
- switch (Node->Type)
- {
- /* Notify allowed only on these types */
+ return (AE_TYPE);
+ }
- case ACPI_TYPE_DEVICE:
- case ACPI_TYPE_THERMAL:
- case ACPI_TYPE_PROCESSOR:
+ /* Get the correct notify list type (System or Device) */
- if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
- {
- HandlerObj = ObjDesc->CommonNotify.SystemNotify;
- }
- else
- {
- HandlerObj = ObjDesc->CommonNotify.DeviceNotify;
- }
- break;
+ if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
+ {
+ HandlerListId = ACPI_SYSTEM_HANDLER_LIST;
+ }
+ else
+ {
+ HandlerListId = ACPI_DEVICE_HANDLER_LIST;
+ }
- default:
+ /* Get the notify object attached to the namespace Node */
- /* All other types are not supported */
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (ObjDesc)
+ {
+ /* We have an attached object, Get the correct handler list */
- return (AE_TYPE);
- }
+ HandlerListHead = ObjDesc->CommonNotify.NotifyList[HandlerListId];
}
/*
- * If there is any handler to run, schedule the dispatcher.
- * Check for:
- * 1) Global system notify handler
- * 2) Global device notify handler
- * 3) Per-device notify handler
+ * If there is no notify handler (Global or Local)
+ * for this object, just ignore the notify
*/
- if ((AcpiGbl_SystemNotify.Handler &&
- (NotifyValue <= ACPI_MAX_SYS_NOTIFY)) ||
- (AcpiGbl_DeviceNotify.Handler &&
- (NotifyValue > ACPI_MAX_SYS_NOTIFY)) ||
- HandlerObj)
+ if (!AcpiGbl_GlobalNotify[HandlerListId].Handler && !HandlerListHead)
{
- NotifyInfo = AcpiUtCreateGenericState ();
- if (!NotifyInfo)
- {
- return (AE_NO_MEMORY);
- }
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n",
+ AcpiUtGetNodeName (Node), NotifyValue, Node));
- if (!HandlerObj)
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Executing system notify handler for Notify (%4.4s, %X) "
- "node %p\n",
- AcpiUtGetNodeName (Node), NotifyValue, Node));
- }
+ return (AE_OK);
+ }
- NotifyInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
- NotifyInfo->Notify.Node = Node;
- NotifyInfo->Notify.Value = (UINT16) NotifyValue;
- NotifyInfo->Notify.HandlerObj = HandlerObj;
+ /* Setup notify info and schedule the notify dispatcher */
- Status = AcpiOsExecute (
- OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch, NotifyInfo);
- if (ACPI_FAILURE (Status))
- {
- AcpiUtDeleteGenericState (NotifyInfo);
- }
- }
- else
+ Info = AcpiUtCreateGenericState ();
+ if (!Info)
{
- /* There is no notify handler (per-device or system) for this device */
+ return (AE_NO_MEMORY);
+ }
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "No notify handler for Notify (%4.4s, %X) node %p\n",
- AcpiUtGetNodeName (Node), NotifyValue, Node));
+ Info->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
+
+ Info->Notify.Node = Node;
+ Info->Notify.Value = (UINT16) NotifyValue;
+ Info->Notify.HandlerListId = HandlerListId;
+ Info->Notify.HandlerListHead = HandlerListHead;
+ Info->Notify.Global = &AcpiGbl_GlobalNotify[HandlerListId];
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
+ AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
+ NotifyValue, AcpiUtGetNotifyName (NotifyValue), Node));
+
+ Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
+ Info);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtDeleteGenericState (Info);
}
return (Status);
@@ -233,64 +210,41 @@ static void ACPI_SYSTEM_XFACE
AcpiEvNotifyDispatch (
void *Context)
{
- ACPI_GENERIC_STATE *NotifyInfo = (ACPI_GENERIC_STATE *) Context;
- ACPI_NOTIFY_HANDLER GlobalHandler = NULL;
- void *GlobalContext = NULL;
+ ACPI_GENERIC_STATE *Info = (ACPI_GENERIC_STATE *) Context;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_FUNCTION_ENTRY ();
- /*
- * We will invoke a global notify handler if installed. This is done
- * _before_ we invoke the per-device handler attached to the device.
- */
- if (NotifyInfo->Notify.Value <= ACPI_MAX_SYS_NOTIFY)
- {
- /* Global system notification handler */
-
- if (AcpiGbl_SystemNotify.Handler)
- {
- GlobalHandler = AcpiGbl_SystemNotify.Handler;
- GlobalContext = AcpiGbl_SystemNotify.Context;
- }
- }
- else
- {
- /* Global driver notification handler */
+ /* Invoke a global notify handler if installed */
- if (AcpiGbl_DeviceNotify.Handler)
- {
- GlobalHandler = AcpiGbl_DeviceNotify.Handler;
- GlobalContext = AcpiGbl_DeviceNotify.Context;
- }
- }
-
- /* Invoke the system handler first, if present */
-
- if (GlobalHandler)
+ if (Info->Notify.Global->Handler)
{
- GlobalHandler (NotifyInfo->Notify.Node, NotifyInfo->Notify.Value,
- GlobalContext);
+ Info->Notify.Global->Handler (Info->Notify.Node,
+ Info->Notify.Value,
+ Info->Notify.Global->Context);
}
- /* Now invoke the per-device handler, if present */
+ /* Now invoke the local notify handler(s) if any are installed */
- HandlerObj = NotifyInfo->Notify.HandlerObj;
- if (HandlerObj)
+ HandlerObj = Info->Notify.HandlerListHead;
+ while (HandlerObj)
{
- HandlerObj->Notify.Handler (NotifyInfo->Notify.Node,
- NotifyInfo->Notify.Value,
+ HandlerObj->Notify.Handler (Info->Notify.Node,
+ Info->Notify.Value,
HandlerObj->Notify.Context);
+
+ HandlerObj = HandlerObj->Notify.Next[Info->Notify.HandlerListId];
}
/* All done with the info object */
- AcpiUtDeleteGenericState (NotifyInfo);
+ AcpiUtDeleteGenericState (Info);
}
+#if (!ACPI_REDUCED_HARDWARE)
/******************************************************************************
*
* FUNCTION: AcpiEvTerminate
@@ -370,3 +324,5 @@ AcpiEvTerminate (
}
return_VOID;
}
+
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evregion.c b/usr/src/uts/intel/io/acpica/events/evregion.c
index 193eb07b92..8c1a8ebbae 100644
--- a/usr/src/uts/intel/io/acpica/events/evregion.c
+++ b/usr/src/uts/intel/io/acpica/events/evregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -372,6 +372,7 @@ Cleanup1:
* FUNCTION: AcpiEvAddressSpaceDispatch
*
* PARAMETERS: RegionObj - Internal region object
+ * FieldObj - Corresponding field. Can be NULL.
* Function - Read or Write operation
* RegionOffset - Where in the region to read or write
* BitWidth - Field width in bits (8, 16, 32, or 64)
@@ -388,6 +389,7 @@ Cleanup1:
ACPI_STATUS
AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *RegionObj,
+ ACPI_OPERAND_OBJECT *FieldObj,
UINT32 Function,
UINT32 RegionOffset,
UINT32 BitWidth,
@@ -399,6 +401,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *HandlerDesc;
ACPI_OPERAND_OBJECT *RegionObj2;
void *RegionContext = NULL;
+ ACPI_CONNECTION_INFO *Context;
ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
@@ -423,6 +426,8 @@ AcpiEvAddressSpaceDispatch (
return_ACPI_STATUS (AE_NOT_EXIST);
}
+ Context = HandlerDesc->AddressSpace.Context;
+
/*
* It may be the case that the region has never been initialized.
* Some types of regions require special init code
@@ -450,7 +455,7 @@ AcpiEvAddressSpaceDispatch (
AcpiExExitInterpreter ();
Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE,
- HandlerDesc->AddressSpace.Context, &RegionContext);
+ Context, &RegionContext);
/* Re-enter the interpreter */
@@ -499,6 +504,27 @@ AcpiEvAddressSpaceDispatch (
ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+
+ /*
+ * Special handling for GenericSerialBus and GeneralPurposeIo:
+ * There are three extra parameters that must be passed to the
+ * handler via the context:
+ * 1) Connection buffer, a resource template from Connection() op.
+ * 2) Length of the above buffer.
+ * 3) Actual access length from the AccessAs() op.
+ */
+ if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
+ (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
+ Context &&
+ FieldObj)
+ {
+ /* Get the Connection (ResourceTemplate) buffer */
+
+ Context->Connection = FieldObj->Field.ResourceBuffer;
+ Context->Length = FieldObj->Field.ResourceLength;
+ Context->AccessLength = FieldObj->Field.AccessLength;
+ }
+
if (!(HandlerDesc->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
{
@@ -514,7 +540,7 @@ AcpiEvAddressSpaceDispatch (
Status = Handler (Function,
(RegionObj->Region.Address + RegionOffset), BitWidth, Value,
- HandlerDesc->AddressSpace.Context, RegionObj2->Extra.RegionContext);
+ Context, RegionObj2->Extra.RegionContext);
if (ACPI_FAILURE (Status))
{
diff --git a/usr/src/uts/intel/io/acpica/events/evrgnini.c b/usr/src/uts/intel/io/acpica/events/evrgnini.c
index 496e40e1aa..92946b5aaa 100644
--- a/usr/src/uts/intel/io/acpica/events/evrgnini.c
+++ b/usr/src/uts/intel/io/acpica/events/evrgnini.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/events/evsci.c b/usr/src/uts/intel/io/acpica/events/evsci.c
index 157c184f2b..c47cccc8db 100644
--- a/usr/src/uts/intel/io/acpica/events/evsci.c
+++ b/usr/src/uts/intel/io/acpica/events/evsci.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evsci")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
+
/* Local prototypes */
static UINT32 ACPI_SYSTEM_XFACE
@@ -204,4 +206,4 @@ AcpiEvRemoveSciHandler (
return_ACPI_STATUS (Status);
}
-
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evxface.c b/usr/src/uts/intel/io/acpica/events/evxface.c
index 8a903a6b47..1b709a5787 100644
--- a/usr/src/uts/intel/io/acpica/events/evxface.c
+++ b/usr/src/uts/intel/io/acpica/events/evxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,6 +56,337 @@
/*******************************************************************************
*
+ * FUNCTION: AcpiInstallNotifyHandler
+ *
+ * PARAMETERS: Device - The device for which notifies will be handled
+ * HandlerType - The type of handler:
+ * ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
+ * ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
+ * ACPI_ALL_NOTIFY: Both System and Device
+ * Handler - Address of the handler
+ * Context - Value passed to the handler on each GPE
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Install a handler for notifications on an ACPI Device,
+ * ThermalZone, or Processor object.
+ *
+ * NOTES: The Root namespace object may have only one handler for each
+ * type of notify (System/Device). Device/Thermal/Processor objects
+ * may have one device notify handler, and multiple system notify
+ * handlers.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInstallNotifyHandler (
+ ACPI_HANDLE Device,
+ UINT32 HandlerType,
+ ACPI_NOTIFY_HANDLER Handler,
+ void *Context)
+{
+ ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device);
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *HandlerObj;
+ ACPI_STATUS Status;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler);
+
+
+ /* Parameter validation */
+
+ if ((!Device) || (!Handler) || (!HandlerType) ||
+ (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /*
+ * Root Object:
+ * Registering a notify handler on the root object indicates that the
+ * caller wishes to receive notifications for all objects. Note that
+ * only one global handler can be registered per notify type.
+ * Ensure that a handler is not already installed.
+ */
+ if (Device == ACPI_ROOT_OBJECT)
+ {
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
+ {
+ if (HandlerType & (i+1))
+ {
+ if (AcpiGbl_GlobalNotify[i].Handler)
+ {
+ Status = AE_ALREADY_EXISTS;
+ goto UnlockAndExit;
+ }
+
+ AcpiGbl_GlobalNotify[i].Handler = Handler;
+ AcpiGbl_GlobalNotify[i].Context = Context;
+ }
+ }
+
+ goto UnlockAndExit; /* Global notify handler installed, all done */
+ }
+
+ /*
+ * All Other Objects:
+ * Caller will only receive notifications specific to the target
+ * object. Note that only certain object types are allowed to
+ * receive notifications.
+ */
+
+ /* Are Notifies allowed on this object? */
+
+ if (!AcpiEvIsNotifyObject (Node))
+ {
+ Status = AE_TYPE;
+ goto UnlockAndExit;
+ }
+
+ /* Check for an existing internal object, might not exist */
+
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (!ObjDesc)
+ {
+ /* Create a new object */
+
+ ObjDesc = AcpiUtCreateInternalObject (Node->Type);
+ if (!ObjDesc)
+ {
+ Status = AE_NO_MEMORY;
+ goto UnlockAndExit;
+ }
+
+ /* Attach new object to the Node, remove local reference */
+
+ Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type);
+ AcpiUtRemoveReference (ObjDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ goto UnlockAndExit;
+ }
+ }
+
+ /* Ensure that the handler is not already installed in the lists */
+
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
+ {
+ if (HandlerType & (i+1))
+ {
+ HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
+ while (HandlerObj)
+ {
+ if (HandlerObj->Notify.Handler == Handler)
+ {
+ Status = AE_ALREADY_EXISTS;
+ goto UnlockAndExit;
+ }
+
+ HandlerObj = HandlerObj->Notify.Next[i];
+ }
+ }
+ }
+
+ /* Create and populate a new notify handler object */
+
+ HandlerObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_NOTIFY);
+ if (!HandlerObj)
+ {
+ Status = AE_NO_MEMORY;
+ goto UnlockAndExit;
+ }
+
+ HandlerObj->Notify.Node = Node;
+ HandlerObj->Notify.HandlerType = HandlerType;
+ HandlerObj->Notify.Handler = Handler;
+ HandlerObj->Notify.Context = Context;
+
+ /* Install the handler at the list head(s) */
+
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
+ {
+ if (HandlerType & (i+1))
+ {
+ HandlerObj->Notify.Next[i] =
+ ObjDesc->CommonNotify.NotifyList[i];
+
+ ObjDesc->CommonNotify.NotifyList[i] = HandlerObj;
+ }
+ }
+
+ /* Add an extra reference if handler was installed in both lists */
+
+ if (HandlerType == ACPI_ALL_NOTIFY)
+ {
+ AcpiUtAddReference (HandlerObj);
+ }
+
+
+UnlockAndExit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiInstallNotifyHandler)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRemoveNotifyHandler
+ *
+ * PARAMETERS: Device - The device for which the handler is installed
+ * HandlerType - The type of handler:
+ * ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
+ * ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
+ * ACPI_ALL_NOTIFY: Both System and Device
+ * Handler - Address of the handler
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Remove a handler for notifies on an ACPI device
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiRemoveNotifyHandler (
+ ACPI_HANDLE Device,
+ UINT32 HandlerType,
+ ACPI_NOTIFY_HANDLER Handler)
+{
+ ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device);
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *HandlerObj;
+ ACPI_OPERAND_OBJECT *PreviousHandlerObj;
+ ACPI_STATUS Status;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler);
+
+
+ /* Parameter validation */
+
+ if ((!Device) || (!Handler) || (!HandlerType) ||
+ (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
+#ifdef _UNDER_DEVELOPMENT
+ /* Make sure all deferred tasks are completed */
+
+ AcpiOsWaitEventsComplete (NULL);
+#endif
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Root Object. Global handlers are removed here */
+
+ if (Device == ACPI_ROOT_OBJECT)
+ {
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
+ {
+ if (HandlerType & (i+1))
+ {
+ if (!AcpiGbl_GlobalNotify[i].Handler ||
+ (AcpiGbl_GlobalNotify[i].Handler != Handler))
+ {
+ Status = AE_NOT_EXIST;
+ goto UnlockAndExit;
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Removing global notify handler\n"));
+
+ AcpiGbl_GlobalNotify[i].Handler = NULL;
+ AcpiGbl_GlobalNotify[i].Context = NULL;
+ }
+ }
+
+ goto UnlockAndExit;
+ }
+
+ /* All other objects: Are Notifies allowed on this object? */
+
+ if (!AcpiEvIsNotifyObject (Node))
+ {
+ Status = AE_TYPE;
+ goto UnlockAndExit;
+ }
+
+ /* Must have an existing internal object */
+
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (!ObjDesc)
+ {
+ Status = AE_NOT_EXIST;
+ goto UnlockAndExit;
+ }
+
+ /* Internal object exists. Find the handler and remove it */
+
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
+ {
+ if (HandlerType & (i+1))
+ {
+ HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
+ PreviousHandlerObj = NULL;
+
+ /* Attempt to find the handler in the handler list */
+
+ while (HandlerObj &&
+ (HandlerObj->Notify.Handler != Handler))
+ {
+ PreviousHandlerObj = HandlerObj;
+ HandlerObj = HandlerObj->Notify.Next[i];
+ }
+
+ if (!HandlerObj)
+ {
+ Status = AE_NOT_EXIST;
+ goto UnlockAndExit;
+ }
+
+ /* Remove the handler object from the list */
+
+ if (PreviousHandlerObj) /* Handler is not at the list head */
+ {
+ PreviousHandlerObj->Notify.Next[i] =
+ HandlerObj->Notify.Next[i];
+ }
+ else /* Handler is at the list head */
+ {
+ ObjDesc->CommonNotify.NotifyList[i] =
+ HandlerObj->Notify.Next[i];
+ }
+
+ AcpiUtRemoveReference (HandlerObj);
+ }
+ }
+
+
+UnlockAndExit:
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler)
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiInstallExceptionHandler
*
* PARAMETERS: Handler - Pointer to the handler function for the
@@ -103,6 +434,7 @@ Cleanup:
ACPI_EXPORT_SYMBOL (AcpiInstallExceptionHandler)
+#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiInstallGlobalEventHandler
@@ -307,357 +639,6 @@ ACPI_EXPORT_SYMBOL (AcpiRemoveFixedEventHandler)
/*******************************************************************************
*
- * FUNCTION: AcpiInstallNotifyHandler
- *
- * PARAMETERS: Device - The device for which notifies will be handled
- * HandlerType - The type of handler:
- * ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f)
- * ACPI_DEVICE_NOTIFY: DriverHandler (80-ff)
- * ACPI_ALL_NOTIFY: both system and device
- * Handler - Address of the handler
- * Context - Value passed to the handler on each GPE
- *
- * RETURN: Status
- *
- * DESCRIPTION: Install a handler for notifies on an ACPI device
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiInstallNotifyHandler (
- ACPI_HANDLE Device,
- UINT32 HandlerType,
- ACPI_NOTIFY_HANDLER Handler,
- void *Context)
-{
- ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_OPERAND_OBJECT *NotifyObj;
- ACPI_NAMESPACE_NODE *Node;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler);
-
-
- /* Parameter validation */
-
- if ((!Device) ||
- (!Handler) ||
- (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
- {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Convert and validate the device handle */
-
- Node = AcpiNsValidateHandle (Device);
- if (!Node)
- {
- Status = AE_BAD_PARAMETER;
- goto UnlockAndExit;
- }
-
- /*
- * Root Object:
- * Registering a notify handler on the root object indicates that the
- * caller wishes to receive notifications for all objects. Note that
- * only one <external> global handler can be regsitered (per notify type).
- */
- if (Device == ACPI_ROOT_OBJECT)
- {
- /* Make sure the handler is not already installed */
-
- if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&
- AcpiGbl_SystemNotify.Handler) ||
- ((HandlerType & ACPI_DEVICE_NOTIFY) &&
- AcpiGbl_DeviceNotify.Handler))
- {
- Status = AE_ALREADY_EXISTS;
- goto UnlockAndExit;
- }
-
- if (HandlerType & ACPI_SYSTEM_NOTIFY)
- {
- AcpiGbl_SystemNotify.Node = Node;
- AcpiGbl_SystemNotify.Handler = Handler;
- AcpiGbl_SystemNotify.Context = Context;
- }
-
- if (HandlerType & ACPI_DEVICE_NOTIFY)
- {
- AcpiGbl_DeviceNotify.Node = Node;
- AcpiGbl_DeviceNotify.Handler = Handler;
- AcpiGbl_DeviceNotify.Context = Context;
- }
-
- /* Global notify handler installed */
- }
-
- /*
- * All Other Objects:
- * Caller will only receive notifications specific to the target object.
- * Note that only certain object types can receive notifications.
- */
- else
- {
- /* Notifies allowed on this object? */
-
- if (!AcpiEvIsNotifyObject (Node))
- {
- Status = AE_TYPE;
- goto UnlockAndExit;
- }
-
- /* Check for an existing internal object */
-
- ObjDesc = AcpiNsGetAttachedObject (Node);
- if (ObjDesc)
- {
- /* Object exists - make sure there's no handler */
-
- if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&
- ObjDesc->CommonNotify.SystemNotify) ||
- ((HandlerType & ACPI_DEVICE_NOTIFY) &&
- ObjDesc->CommonNotify.DeviceNotify))
- {
- Status = AE_ALREADY_EXISTS;
- goto UnlockAndExit;
- }
- }
- else
- {
- /* Create a new object */
-
- ObjDesc = AcpiUtCreateInternalObject (Node->Type);
- if (!ObjDesc)
- {
- Status = AE_NO_MEMORY;
- goto UnlockAndExit;
- }
-
- /* Attach new object to the Node */
-
- Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type);
-
- /* Remove local reference to the object */
-
- AcpiUtRemoveReference (ObjDesc);
- if (ACPI_FAILURE (Status))
- {
- goto UnlockAndExit;
- }
- }
-
- /* Install the handler */
-
- NotifyObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_NOTIFY);
- if (!NotifyObj)
- {
- Status = AE_NO_MEMORY;
- goto UnlockAndExit;
- }
-
- NotifyObj->Notify.Node = Node;
- NotifyObj->Notify.Handler = Handler;
- NotifyObj->Notify.Context = Context;
-
- if (HandlerType & ACPI_SYSTEM_NOTIFY)
- {
- ObjDesc->CommonNotify.SystemNotify = NotifyObj;
- }
-
- if (HandlerType & ACPI_DEVICE_NOTIFY)
- {
- ObjDesc->CommonNotify.DeviceNotify = NotifyObj;
- }
-
- if (HandlerType == ACPI_ALL_NOTIFY)
- {
- /* Extra ref if installed in both */
-
- AcpiUtAddReference (NotifyObj);
- }
- }
-
-
-UnlockAndExit:
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiInstallNotifyHandler)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiRemoveNotifyHandler
- *
- * PARAMETERS: Device - The device for which notifies will be handled
- * HandlerType - The type of handler:
- * ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f)
- * ACPI_DEVICE_NOTIFY: DriverHandler (80-ff)
- * ACPI_ALL_NOTIFY: both system and device
- * Handler - Address of the handler
- *
- * RETURN: Status
- *
- * DESCRIPTION: Remove a handler for notifies on an ACPI device
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiRemoveNotifyHandler (
- ACPI_HANDLE Device,
- UINT32 HandlerType,
- ACPI_NOTIFY_HANDLER Handler)
-{
- ACPI_OPERAND_OBJECT *NotifyObj;
- ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_NAMESPACE_NODE *Node;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler);
-
-
- /* Parameter validation */
-
- if ((!Device) ||
- (!Handler) ||
- (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
- {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Convert and validate the device handle */
-
- Node = AcpiNsValidateHandle (Device);
- if (!Node)
- {
- Status = AE_BAD_PARAMETER;
- goto UnlockAndExit;
- }
-
- /* Root Object */
-
- if (Device == ACPI_ROOT_OBJECT)
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Removing notify handler for namespace root object\n"));
-
- if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&
- !AcpiGbl_SystemNotify.Handler) ||
- ((HandlerType & ACPI_DEVICE_NOTIFY) &&
- !AcpiGbl_DeviceNotify.Handler))
- {
- Status = AE_NOT_EXIST;
- goto UnlockAndExit;
- }
-
- if (HandlerType & ACPI_SYSTEM_NOTIFY)
- {
- AcpiGbl_SystemNotify.Node = NULL;
- AcpiGbl_SystemNotify.Handler = NULL;
- AcpiGbl_SystemNotify.Context = NULL;
- }
-
- if (HandlerType & ACPI_DEVICE_NOTIFY)
- {
- AcpiGbl_DeviceNotify.Node = NULL;
- AcpiGbl_DeviceNotify.Handler = NULL;
- AcpiGbl_DeviceNotify.Context = NULL;
- }
- }
-
- /* All Other Objects */
-
- else
- {
- /* Notifies allowed on this object? */
-
- if (!AcpiEvIsNotifyObject (Node))
- {
- Status = AE_TYPE;
- goto UnlockAndExit;
- }
-
- /* Check for an existing internal object */
-
- ObjDesc = AcpiNsGetAttachedObject (Node);
- if (!ObjDesc)
- {
- Status = AE_NOT_EXIST;
- goto UnlockAndExit;
- }
-
- /* Object exists - make sure there's an existing handler */
-
- if (HandlerType & ACPI_SYSTEM_NOTIFY)
- {
- NotifyObj = ObjDesc->CommonNotify.SystemNotify;
- if (!NotifyObj)
- {
- Status = AE_NOT_EXIST;
- goto UnlockAndExit;
- }
-
- if (NotifyObj->Notify.Handler != Handler)
- {
- Status = AE_BAD_PARAMETER;
- goto UnlockAndExit;
- }
-
- /* Remove the handler */
-
- ObjDesc->CommonNotify.SystemNotify = NULL;
- AcpiUtRemoveReference (NotifyObj);
- }
-
- if (HandlerType & ACPI_DEVICE_NOTIFY)
- {
- NotifyObj = ObjDesc->CommonNotify.DeviceNotify;
- if (!NotifyObj)
- {
- Status = AE_NOT_EXIST;
- goto UnlockAndExit;
- }
-
- if (NotifyObj->Notify.Handler != Handler)
- {
- Status = AE_BAD_PARAMETER;
- goto UnlockAndExit;
- }
-
- /* Remove the handler */
-
- ObjDesc->CommonNotify.DeviceNotify = NULL;
- AcpiUtRemoveReference (NotifyObj);
- }
- }
-
-
-UnlockAndExit:
- (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
- return_ACPI_STATUS (Status);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler)
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiInstallGpeHandler
*
* PARAMETERS: GpeDevice - Namespace node for the GPE (NULL for FADT
@@ -975,3 +956,4 @@ AcpiReleaseGlobalLock (
ACPI_EXPORT_SYMBOL (AcpiReleaseGlobalLock)
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evxfevnt.c b/usr/src/uts/intel/io/acpica/events/evxfevnt.c
index a813dd3c96..254214af19 100644
--- a/usr/src/uts/intel/io/acpica/events/evxfevnt.c
+++ b/usr/src/uts/intel/io/acpica/events/evxfevnt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,7 @@
ACPI_MODULE_NAME ("evxfevnt")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiEnable
@@ -377,4 +378,4 @@ AcpiGetEventStatus (
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
-
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evxfgpe.c b/usr/src/uts/intel/io/acpica/events/evxfgpe.c
index 76019969ec..c0dd88c777 100644
--- a/usr/src/uts/intel/io/acpica/events/evxfgpe.c
+++ b/usr/src/uts/intel/io/acpica/events/evxfgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -53,6 +53,7 @@
ACPI_MODULE_NAME ("evxfgpe")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiUpdateAllGpes
@@ -898,3 +899,5 @@ AcpiGetGpeDevice (
}
ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice)
+
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/events/evxfregn.c b/usr/src/uts/intel/io/acpica/events/evxfregn.c
index 4fd637e31f..493df9217d 100644
--- a/usr/src/uts/intel/io/acpica/events/evxfregn.c
+++ b/usr/src/uts/intel/io/acpica/events/evxfregn.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exconfig.c b/usr/src/uts/intel/io/acpica/executer/exconfig.c
index d7677e99ce..9e05497b9f 100644
--- a/usr/src/uts/intel/io/acpica/executer/exconfig.c
+++ b/usr/src/uts/intel/io/acpica/executer/exconfig.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -334,7 +334,7 @@ AcpiExRegionRead (
for (i = 0; i < Length; i++)
{
- Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ,
+ Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ,
RegionOffset, 8, &Value);
if (ACPI_FAILURE (Status))
{
diff --git a/usr/src/uts/intel/io/acpica/executer/exconvrt.c b/usr/src/uts/intel/io/acpica/executer/exconvrt.c
index 6894acdec7..e79cbc96e9 100644
--- a/usr/src/uts/intel/io/acpica/executer/exconvrt.c
+++ b/usr/src/uts/intel/io/acpica/executer/exconvrt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/excreate.c b/usr/src/uts/intel/io/acpica/executer/excreate.c
index fe93e0e940..888ff7d7c4 100644
--- a/usr/src/uts/intel/io/acpica/executer/excreate.c
+++ b/usr/src/uts/intel/io/acpica/executer/excreate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -284,7 +284,7 @@ Cleanup:
*
* PARAMETERS: AmlStart - Pointer to the region declaration AML
* AmlLength - Max length of the declaration AML
- * RegionSpace - SpaceID for the region
+ * SpaceId - Address space ID for the region
* WalkState - Current state
*
* RETURN: Status
@@ -297,7 +297,7 @@ ACPI_STATUS
AcpiExCreateRegion (
UINT8 *AmlStart,
UINT32 AmlLength,
- UINT8 RegionSpace,
+ UINT8 SpaceId,
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
@@ -326,16 +326,18 @@ AcpiExCreateRegion (
* Space ID must be one of the predefined IDs, or in the user-defined
* range
*/
- if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) &&
- (RegionSpace < ACPI_USER_REGION_BEGIN) &&
- (RegionSpace != ACPI_ADR_SPACE_DATA_TABLE))
+ if (!AcpiIsValidSpaceId (SpaceId))
{
- ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace));
- return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
+ /*
+ * Print an error message, but continue. We don't want to abort
+ * a table load for this exception. Instead, if the region is
+ * actually used at runtime, abort the executing method.
+ */
+ ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
}
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
- AcpiUtGetRegionName (RegionSpace), RegionSpace));
+ AcpiUtGetRegionName (SpaceId), SpaceId));
/* Create the region descriptor */
@@ -353,10 +355,18 @@ AcpiExCreateRegion (
RegionObj2 = ObjDesc->Common.NextObject;
RegionObj2->Extra.AmlStart = AmlStart;
RegionObj2->Extra.AmlLength = AmlLength;
+ if (WalkState->ScopeInfo)
+ {
+ RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node;
+ }
+ else
+ {
+ RegionObj2->Extra.ScopeNode = Node;
+ }
/* Init the region from the operands */
- ObjDesc->Region.SpaceId = RegionSpace;
+ ObjDesc->Region.SpaceId = SpaceId;
ObjDesc->Region.Address = 0;
ObjDesc->Region.Length = 0;
ObjDesc->Region.Node = Node;
diff --git a/usr/src/uts/intel/io/acpica/executer/exdebug.c b/usr/src/uts/intel/io/acpica/executer/exdebug.c
index 62bf810c79..166b2af170 100644
--- a/usr/src/uts/intel/io/acpica/executer/exdebug.c
+++ b/usr/src/uts/intel/io/acpica/executer/exdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exdump.c b/usr/src/uts/intel/io/acpica/executer/exdump.c
index 60003e6154..0943e668c1 100644
--- a/usr/src/uts/intel/io/acpica/executer/exdump.c
+++ b/usr/src/uts/intel/io/acpica/executer/exdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -131,8 +131,8 @@ static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.Handler), "Handler"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.SystemNotify), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.DeviceNotify), "Device Notify"}
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"}
};
static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
@@ -179,8 +179,8 @@ static ACPI_EXDUMP_INFO AcpiExDumpPower[5] =
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.SystemNotify), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.DeviceNotify), "Device Notify"}
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"}
};
static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
@@ -189,16 +189,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Processor.ProcId), "Processor ID"},
{ACPI_EXD_UINT8 , ACPI_EXD_OFFSET (Processor.Length), "Length"},
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Processor.Address), "Address"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.SystemNotify), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.DeviceNotify), "Device Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[0]), "System Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[1]), "Device Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.Handler), "Handler"}
};
static ACPI_EXDUMP_INFO AcpiExDumpThermal[4] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal), NULL},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.SystemNotify), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.DeviceNotify), "Device Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]), "System Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]), "Device Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.Handler), "Handler"}
};
@@ -209,11 +209,13 @@ static ACPI_EXDUMP_INFO AcpiExDumpBufferField[3] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpRegionField[3] =
+static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL},
{ACPI_EXD_FIELD, 0, NULL},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"}
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"}
};
static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] =
@@ -256,11 +258,15 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpNotify[3] =
+static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Node), "Node"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"}
+ {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[0]), "Next System Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}
};
@@ -999,10 +1005,7 @@ AcpiExDumpPackageObj (
case ACPI_TYPE_STRING:
AcpiOsPrintf ("[String] Value: ");
- for (i = 0; i < ObjDesc->String.Length; i++)
- {
- AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]);
- }
+ AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
AcpiOsPrintf ("\n");
break;
diff --git a/usr/src/uts/intel/io/acpica/executer/exfield.c b/usr/src/uts/intel/io/acpica/executer/exfield.c
index 098a18650e..a682406826 100644
--- a/usr/src/uts/intel/io/acpica/executer/exfield.c
+++ b/usr/src/uts/intel/io/acpica/executer/exfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -113,19 +113,25 @@ AcpiExReadDataFromField (
}
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
+ ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
- * This is an SMBus or IPMI read. We must create a buffer to hold
+ * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold
* the data and then directly access the region handler.
*
- * Note: Smbus protocol value is passed in upper 16-bits of Function
+ * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function
*/
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
{
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
}
+ else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
+ {
+ Length = ACPI_GSBUS_BUFFER_SIZE;
+ Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
+ }
else /* IPMI */
{
Length = ACPI_IPMI_BUFFER_SIZE;
@@ -274,23 +280,24 @@ AcpiExWriteDataToField (
}
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
+ ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
- * This is an SMBus or IPMI write. We will bypass the entire field
+ * This is an SMBus, GSBus or IPMI write. We will bypass the entire field
* mechanism and handoff the buffer directly to the handler. For
* these address spaces, the buffer is bi-directional; on a write,
* return data is returned in the same buffer.
*
* Source must be a buffer of sufficient size:
- * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE.
+ * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
*
- * Note: SMBus protocol type is passed in upper 16-bits of Function
+ * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
*/
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR ((AE_INFO,
- "SMBus or IPMI write requires Buffer, found type %s",
+ "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -301,6 +308,11 @@ AcpiExWriteDataToField (
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
}
+ else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
+ {
+ Length = ACPI_GSBUS_BUFFER_SIZE;
+ Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
+ }
else /* IPMI */
{
Length = ACPI_IPMI_BUFFER_SIZE;
@@ -310,7 +322,7 @@ AcpiExWriteDataToField (
if (SourceDesc->Buffer.Length < Length)
{
ACPI_ERROR ((AE_INFO,
- "SMBus or IPMI write requires Buffer of length %u, found length %u",
+ "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
Length, SourceDesc->Buffer.Length));
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
diff --git a/usr/src/uts/intel/io/acpica/executer/exfldio.c b/usr/src/uts/intel/io/acpica/executer/exfldio.c
index bf663a2f5e..e138e9a13c 100644
--- a/usr/src/uts/intel/io/acpica/executer/exfldio.c
+++ b/usr/src/uts/intel/io/acpica/executer/exfldio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -98,6 +98,7 @@ AcpiExSetupRegion (
{
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *RgnDesc;
+ UINT8 SpaceId;
ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset);
@@ -116,6 +117,16 @@ AcpiExSetupRegion (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
+ SpaceId = RgnDesc->Region.SpaceId;
+
+ /* Validate the Space ID */
+
+ if (!AcpiIsValidSpaceId (SpaceId))
+ {
+ ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
+ return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
+ }
+
/*
* If the Region Address and Length have not been previously evaluated,
* evaluate them now and save the results.
@@ -130,11 +141,12 @@ AcpiExSetupRegion (
}
/*
- * Exit now for SMBus or IPMI address space, it has a non-linear
+ * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear
* address space and the request cannot be directly validated
*/
- if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
- RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI)
+ if (SpaceId == ACPI_ADR_SPACE_SMBUS ||
+ SpaceId == ACPI_ADR_SPACE_GSBUS ||
+ SpaceId == ACPI_ADR_SPACE_IPMI)
{
/* SMBus or IPMI has a non-linear address space */
@@ -290,7 +302,8 @@ AcpiExAccessRegion (
/* Invoke the appropriate AddressSpace/OpRegion handler */
- Status = AcpiEvAddressSpaceDispatch (RgnDesc, Function, RegionOffset,
+ Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc,
+ Function, RegionOffset,
ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
if (ACPI_FAILURE (Status))
@@ -353,6 +366,11 @@ AcpiExRegisterOverflow (
* The Value is larger than the maximum value that can fit into
* the register.
*/
+ ACPI_ERROR ((AE_INFO,
+ "Index value 0x%8.8X%8.8X overflows field width 0x%X",
+ ACPI_FORMAT_UINT64 (Value),
+ ObjDesc->CommonField.BitLength));
+
return (TRUE);
}
diff --git a/usr/src/uts/intel/io/acpica/executer/exmisc.c b/usr/src/uts/intel/io/acpica/executer/exmisc.c
index c5dd280fe4..63114f5584 100644
--- a/usr/src/uts/intel/io/acpica/executer/exmisc.c
+++ b/usr/src/uts/intel/io/acpica/executer/exmisc.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exmutex.c b/usr/src/uts/intel/io/acpica/executer/exmutex.c
index 6a893f0e90..4c702b8baa 100644
--- a/usr/src/uts/intel/io/acpica/executer/exmutex.c
+++ b/usr/src/uts/intel/io/acpica/executer/exmutex.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exnames.c b/usr/src/uts/intel/io/acpica/executer/exnames.c
index 2188ec0a2f..c3cb6b0b4c 100644
--- a/usr/src/uts/intel/io/acpica/executer/exnames.c
+++ b/usr/src/uts/intel/io/acpica/executer/exnames.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exoparg1.c b/usr/src/uts/intel/io/acpica/executer/exoparg1.c
index 6ac685c82b..9a6cd9fcab 100644
--- a/usr/src/uts/intel/io/acpica/executer/exoparg1.c
+++ b/usr/src/uts/intel/io/acpica/executer/exoparg1.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exoparg2.c b/usr/src/uts/intel/io/acpica/executer/exoparg2.c
index d131277aae..b76da75c49 100644
--- a/usr/src/uts/intel/io/acpica/executer/exoparg2.c
+++ b/usr/src/uts/intel/io/acpica/executer/exoparg2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exoparg3.c b/usr/src/uts/intel/io/acpica/executer/exoparg3.c
index 6adb1afac2..0edac68e60 100644
--- a/usr/src/uts/intel/io/acpica/executer/exoparg3.c
+++ b/usr/src/uts/intel/io/acpica/executer/exoparg3.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exoparg6.c b/usr/src/uts/intel/io/acpica/executer/exoparg6.c
index fd6e039c01..bfc6585301 100644
--- a/usr/src/uts/intel/io/acpica/executer/exoparg6.c
+++ b/usr/src/uts/intel/io/acpica/executer/exoparg6.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exprep.c b/usr/src/uts/intel/io/acpica/executer/exprep.c
index ee96a6a090..9ec78275bd 100644
--- a/usr/src/uts/intel/io/acpica/executer/exprep.c
+++ b/usr/src/uts/intel/io/acpica/executer/exprep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
+#include "acdispat.h"
#define _COMPONENT ACPI_EXECUTER
@@ -484,6 +485,32 @@ AcpiExPrepFieldValue (
ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode);
+ /* Fields specific to GenericSerialBus fields */
+
+ ObjDesc->Field.AccessLength = Info->AccessLength;
+
+ if (Info->ConnectionNode)
+ {
+ SecondDesc = Info->ConnectionNode->Object;
+ if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID))
+ {
+ Status = AcpiDsGetBufferArguments (SecondDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtDeleteObjectDesc (ObjDesc);
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
+ ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
+ }
+ else if (Info->ResourceBuffer)
+ {
+ ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer;
+ ObjDesc->Field.ResourceLength = Info->ResourceLength;
+ }
+
/* Allow full data read from EC address space */
if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
diff --git a/usr/src/uts/intel/io/acpica/executer/exregion.c b/usr/src/uts/intel/io/acpica/executer/exregion.c
index b3b9aa6e66..8a40250794 100644
--- a/usr/src/uts/intel/io/acpica/executer/exregion.c
+++ b/usr/src/uts/intel/io/acpica/executer/exregion.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exresnte.c b/usr/src/uts/intel/io/acpica/executer/exresnte.c
index cf8a55531f..03962edf97 100644
--- a/usr/src/uts/intel/io/acpica/executer/exresnte.c
+++ b/usr/src/uts/intel/io/acpica/executer/exresnte.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exresolv.c b/usr/src/uts/intel/io/acpica/executer/exresolv.c
index 652d95dd54..e92fb2468e 100644
--- a/usr/src/uts/intel/io/acpica/executer/exresolv.c
+++ b/usr/src/uts/intel/io/acpica/executer/exresolv.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exresop.c b/usr/src/uts/intel/io/acpica/executer/exresop.c
index 12c872f99a..1bcba69033 100644
--- a/usr/src/uts/intel/io/acpica/executer/exresop.c
+++ b/usr/src/uts/intel/io/acpica/executer/exresop.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exstore.c b/usr/src/uts/intel/io/acpica/executer/exstore.c
index 8679e790b8..656b649478 100644
--- a/usr/src/uts/intel/io/acpica/executer/exstore.c
+++ b/usr/src/uts/intel/io/acpica/executer/exstore.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exstoren.c b/usr/src/uts/intel/io/acpica/executer/exstoren.c
index 71d8809a2d..464d6b1065 100644
--- a/usr/src/uts/intel/io/acpica/executer/exstoren.c
+++ b/usr/src/uts/intel/io/acpica/executer/exstoren.c
@@ -7,7 +7,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exstorob.c b/usr/src/uts/intel/io/acpica/executer/exstorob.c
index 4dfcf15fe3..e74d5b3485 100644
--- a/usr/src/uts/intel/io/acpica/executer/exstorob.c
+++ b/usr/src/uts/intel/io/acpica/executer/exstorob.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exsystem.c b/usr/src/uts/intel/io/acpica/executer/exsystem.c
index 10d6edc951..37f5b234a3 100644
--- a/usr/src/uts/intel/io/acpica/executer/exsystem.c
+++ b/usr/src/uts/intel/io/acpica/executer/exsystem.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/executer/exutils.c b/usr/src/uts/intel/io/acpica/executer/exutils.c
index 4daa44f527..b5eca064a2 100644
--- a/usr/src/uts/intel/io/acpica/executer/exutils.c
+++ b/usr/src/uts/intel/io/acpica/executer/exutils.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -499,4 +499,34 @@ AcpiExIntegerToString (
}
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiIsValidSpaceId
+ *
+ * PARAMETERS: SpaceId - ID to be validated
+ *
+ * RETURN: TRUE if valid/supported ID.
+ *
+ * DESCRIPTION: Validate an operation region SpaceID.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiIsValidSpaceId (
+ UINT8 SpaceId)
+{
+
+ if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) &&
+ (SpaceId < ACPI_USER_REGION_BEGIN) &&
+ (SpaceId != ACPI_ADR_SPACE_DATA_TABLE) &&
+ (SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE))
+ {
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
+
+
#endif
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwacpi.c b/usr/src/uts/intel/io/acpica/hardware/hwacpi.c
index 577666100e..d9f16ef9d7 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwacpi.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwacpi.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,7 @@
ACPI_MODULE_NAME ("hwacpi")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/******************************************************************************
*
* FUNCTION: AcpiHwSetMode
@@ -204,3 +205,5 @@ AcpiHwGetMode (
return_UINT32 (ACPI_SYS_MODE_LEGACY);
}
}
+
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwesleep.c b/usr/src/uts/intel/io/acpica/hardware/hwesleep.c
new file mode 100644
index 0000000000..1587af019c
--- /dev/null
+++ b/usr/src/uts/intel/io/acpica/hardware/hwesleep.c
@@ -0,0 +1,277 @@
+/******************************************************************************
+ *
+ * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
+ * extended FADT-V5 sleep registers.
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT ACPI_HARDWARE
+ ACPI_MODULE_NAME ("hwesleep")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiHwExecuteSleepMethod
+ *
+ * PARAMETERS: MethodPathname - Pathname of method to execute
+ * IntegerArgument - Argument to pass to the method
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Execute a sleep/wake related method with one integer argument
+ * and no return value.
+ *
+ ******************************************************************************/
+
+void
+AcpiHwExecuteSleepMethod (
+ char *MethodPathname,
+ UINT32 IntegerArgument)
+{
+ ACPI_OBJECT_LIST ArgList;
+ ACPI_OBJECT Arg;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (HwExecuteSleepMethod);
+
+
+ /* One argument, IntegerArgument; No return value expected */
+
+ ArgList.Count = 1;
+ ArgList.Pointer = &Arg;
+ Arg.Type = ACPI_TYPE_INTEGER;
+ Arg.Integer.Value = (UINT64) IntegerArgument;
+
+ Status = AcpiEvaluateObject (NULL, MethodPathname, &ArgList, NULL);
+ if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "While executing method %s",
+ MethodPathname));
+ }
+
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiHwExtendedSleep
+ *
+ * PARAMETERS: SleepState - Which sleep state to enter
+ * Flags - ACPI_EXECUTE_GTS to run optional method
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Enter a system sleep state via the extended FADT sleep
+ * registers (V5 FADT).
+ * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiHwExtendedSleep (
+ UINT8 SleepState,
+ UINT8 Flags)
+{
+ ACPI_STATUS Status;
+ UINT8 SleepTypeValue;
+ UINT64 SleepStatus;
+
+
+ ACPI_FUNCTION_TRACE (HwExtendedSleep);
+
+
+ /* Extended sleep registers must be valid */
+
+ if (!AcpiGbl_FADT.SleepControl.Address ||
+ !AcpiGbl_FADT.SleepStatus.Address)
+ {
+ return_ACPI_STATUS (AE_NOT_EXIST);
+ }
+
+ /* Clear wake status (WAK_STS) */
+
+ Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ AcpiGbl_SystemAwakeAndRunning = FALSE;
+
+ /* Optionally execute _GTS (Going To Sleep) */
+
+ if (Flags & ACPI_EXECUTE_GTS)
+ {
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
+ }
+
+ /* Flush caches, as per ACPI specification */
+
+ ACPI_FLUSH_CPU_CACHE ();
+
+ /*
+ * Set the SLP_TYP and SLP_EN bits.
+ *
+ * Note: We only use the first value returned by the \_Sx method
+ * (AcpiGbl_SleepTypeA) - As per ACPI specification.
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
+ "Entering sleep state [S%u]\n", SleepState));
+
+ SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
+ ACPI_X_SLEEP_TYPE_MASK);
+
+ Status = AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
+ &AcpiGbl_FADT.SleepControl);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Wait for transition back to Working State */
+
+ do
+ {
+ Status = AcpiRead (&SleepStatus, &AcpiGbl_FADT.SleepStatus);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ } while (!(((UINT8) SleepStatus) & ACPI_X_WAKE_STATUS));
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiHwExtendedWakePrep
+ *
+ * PARAMETERS: SleepState - Which sleep state we just exited
+ * Flags - ACPI_EXECUTE_BFS to run optional method
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform first part of OS-independent ACPI cleanup after
+ * a sleep. Called with interrupts ENABLED.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiHwExtendedWakePrep (
+ UINT8 SleepState,
+ UINT8 Flags)
+{
+ ACPI_STATUS Status;
+ UINT8 SleepTypeValue;
+
+
+ ACPI_FUNCTION_TRACE (HwExtendedWakePrep);
+
+
+ Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
+ &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
+ if (ACPI_SUCCESS (Status))
+ {
+ SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
+ ACPI_X_SLEEP_TYPE_MASK);
+
+ (void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
+ &AcpiGbl_FADT.SleepControl);
+ }
+
+ /* Optionally execute _BFS (Back From Sleep) */
+
+ if (Flags & ACPI_EXECUTE_BFS)
+ {
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
+ }
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiHwExtendedWake
+ *
+ * PARAMETERS: SleepState - Which sleep state we just exited
+ * Flags - Reserved, set to zero
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
+ * Called with interrupts ENABLED.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiHwExtendedWake (
+ UINT8 SleepState,
+ UINT8 Flags)
+{
+ ACPI_FUNCTION_TRACE (HwExtendedWake);
+
+
+ /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
+
+ AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
+
+ /* Execute the wake methods */
+
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING);
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState);
+
+ /*
+ * Some BIOS code assumes that WAK_STS will be cleared on resume
+ * and use it to determine whether the system is rebooting or
+ * resuming. Clear WAK_STS for compatibility.
+ */
+ (void) AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
+ AcpiGbl_SystemAwakeAndRunning = TRUE;
+
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
+ return_ACPI_STATUS (AE_OK);
+}
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwgpe.c b/usr/src/uts/intel/io/acpica/hardware/hwgpe.c
index 335814f942..c94f17be26 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwgpe.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwgpe.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,8 @@
#define _COMPONENT ACPI_HARDWARE
ACPI_MODULE_NAME ("hwgpe")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
+
/* Local prototypes */
static ACPI_STATUS
@@ -538,3 +540,4 @@ AcpiHwEnableAllWakeupGpes (
return_ACPI_STATUS (Status);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwpci.c b/usr/src/uts/intel/io/acpica/hardware/hwpci.c
index 96a2dfcdbe..065e42d95e 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwpci.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwpci.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwregs.c b/usr/src/uts/intel/io/acpica/hardware/hwregs.c
index 61e61a1e6b..6d89883179 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwregs.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwregs.c
@@ -7,7 +7,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -53,6 +53,8 @@
ACPI_MODULE_NAME ("hwregs")
+#if (!ACPI_REDUCED_HARDWARE)
+
/* Local Prototypes */
static ACPI_STATUS
@@ -67,6 +69,7 @@ AcpiHwWriteMultiple (
ACPI_GENERIC_ADDRESS *RegisterA,
ACPI_GENERIC_ADDRESS *RegisterB);
+#endif /* !ACPI_REDUCED_HARDWARE */
/******************************************************************************
*
@@ -170,6 +173,7 @@ AcpiHwRead (
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
+ UINT64 Value64;
ACPI_STATUS Status;
@@ -195,7 +199,9 @@ AcpiHwRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, Value, Reg->BitWidth);
+ Address, &Value64, Reg->BitWidth);
+
+ *Value = (UINT32) Value64;
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
@@ -254,7 +260,7 @@ AcpiHwWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, Value, Reg->BitWidth);
+ Address, (UINT64) Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
@@ -271,6 +277,7 @@ AcpiHwWrite (
}
+#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiHwClearAcpiStatus
@@ -321,7 +328,7 @@ UnlockAndExit:
/*******************************************************************************
*
- * FUNCTION: AcpiHwGetRegisterBitMask
+ * FUNCTION: AcpiHwGetBitRegisterInfo
*
* PARAMETERS: RegisterId - Index of ACPI Register to access
*
@@ -731,3 +738,4 @@ AcpiHwWriteMultiple (
return (Status);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwsleep.c b/usr/src/uts/intel/io/acpica/hardware/hwsleep.c
index 1c8ca2440f..1953ff846e 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwsleep.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwsleep.c
@@ -1,12 +1,12 @@
-
/******************************************************************************
*
- * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
+ * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
+ * original/legacy sleep/PM registers.
*
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,210 +49,38 @@
ACPI_MODULE_NAME ("hwsleep")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
- * FUNCTION: AcpiSetFirmwareWakingVector
- *
- * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
- * entry point.
- *
- * RETURN: Status
- *
- * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiSetFirmwareWakingVector (
- UINT32 PhysicalAddress)
-{
- ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
-
-
- /* Set the 32-bit vector */
-
- AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
-
- /* Clear the 64-bit vector if it exists */
-
- if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
- {
- AcpiGbl_FACS->XFirmwareWakingVector = 0;
- }
-
- return_ACPI_STATUS (AE_OK);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
-
-
-#if ACPI_MACHINE_WIDTH == 64
-/*******************************************************************************
- *
- * FUNCTION: AcpiSetFirmwareWakingVector64
- *
- * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
- * mode entry point.
- *
- * RETURN: Status
- *
- * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
- * it exists in the table. This function is intended for use with
- * 64-bit host operating systems.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiSetFirmwareWakingVector64 (
- UINT64 PhysicalAddress)
-{
- ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
-
-
- /* Determine if the 64-bit vector actually exists */
-
- if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
- {
- return_ACPI_STATUS (AE_NOT_EXIST);
- }
-
- /* Clear 32-bit vector, set the 64-bit X_ vector */
-
- AcpiGbl_FACS->FirmwareWakingVector = 0;
- AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
- return_ACPI_STATUS (AE_OK);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
-#endif
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiEnterSleepStatePrep
+ * FUNCTION: AcpiHwLegacySleep
*
* PARAMETERS: SleepState - Which sleep state to enter
+ * Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
- * DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231)
- * This function must execute with interrupts enabled.
- * We break sleeping into 2 stages so that OSPM can handle
- * various OS-specific tasks between the two steps.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiEnterSleepStatePrep (
- UINT8 SleepState)
-{
- ACPI_STATUS Status;
- ACPI_OBJECT_LIST ArgList;
- ACPI_OBJECT Arg;
-
-
- ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
-
-
- /* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */
-
- Status = AcpiGetSleepTypeData (SleepState,
- &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Execute the _PTS method (Prepare To Sleep) */
-
- ArgList.Count = 1;
- ArgList.Pointer = &Arg;
- Arg.Type = ACPI_TYPE_INTEGER;
- Arg.Integer.Value = SleepState;
-
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__PTS, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Setup the argument to the _SST method (System STatus) */
-
- switch (SleepState)
- {
- case ACPI_STATE_S0:
- Arg.Integer.Value = ACPI_SST_WORKING;
- break;
-
- case ACPI_STATE_S1:
- case ACPI_STATE_S2:
- case ACPI_STATE_S3:
- Arg.Integer.Value = ACPI_SST_SLEEPING;
- break;
-
- case ACPI_STATE_S4:
- Arg.Integer.Value = ACPI_SST_SLEEP_CONTEXT;
- break;
-
- default:
- Arg.Integer.Value = ACPI_SST_INDICATOR_OFF; /* Default is off */
- break;
- }
-
- /*
- * Set the system indicators to show the desired sleep state.
- * _SST is an optional method (return no error if not found)
- */
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "While executing method _SST"));
- }
-
- return_ACPI_STATUS (AE_OK);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiEnterSleepState
- *
- * PARAMETERS: SleepState - Which sleep state to enter
- *
- * RETURN: Status
- *
- * DESCRIPTION: Enter a system sleep state
+ * DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
ACPI_STATUS
-AcpiEnterSleepState (
- UINT8 SleepState)
+AcpiHwLegacySleep (
+ UINT8 SleepState,
+ UINT8 Flags)
{
- UINT32 Pm1aControl;
- UINT32 Pm1bControl;
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
+ UINT32 Pm1aControl;
+ UINT32 Pm1bControl;
UINT32 InValue;
- ACPI_OBJECT_LIST ArgList;
- ACPI_OBJECT Arg;
ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
+ ACPI_FUNCTION_TRACE (HwLegacySleep);
- if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
- (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
- {
- ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
- AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
- return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
- }
-
- SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE);
+ SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE);
SleepEnableRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_ENABLE);
/* Clear wake status */
@@ -302,17 +130,11 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
- /* Execute the _GTS method (Going To Sleep) */
-
- ArgList.Count = 1;
- ArgList.Pointer = &Arg;
- Arg.Type = ACPI_TYPE_INTEGER;
- Arg.Integer.Value = SleepState;
+ /* Optionally execute _GTS (Going To Sleep) */
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__GTS, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
+ if (Flags & ACPI_EXECUTE_GTS)
{
- return_ACPI_STATUS (Status);
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
}
/* Get current value of PM1A control */
@@ -390,7 +212,7 @@ AcpiEnterSleepState (
}
}
- /* Wait until we enter sleep state */
+ /* Wait for transition back to Working State */
do
{
@@ -400,110 +222,32 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
- /* Spin until we wake */
-
} while (!InValue);
return_ACPI_STATUS (AE_OK);
}
-ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
-
/*******************************************************************************
*
- * FUNCTION: AcpiEnterSleepStateS4bios
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Perform a S4 bios request.
- * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiEnterSleepStateS4bios (
- void)
-{
- UINT32 InValue;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
-
-
- /* Clear the wake status bit (PM1) */
-
- Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- Status = AcpiHwClearAcpiStatus ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /*
- * 1) Disable/Clear all GPEs
- * 2) Enable all wakeup GPEs
- */
- Status = AcpiHwDisableAllGpes ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- AcpiGbl_SystemAwakeAndRunning = FALSE;
-
- Status = AcpiHwEnableAllWakeupGpes ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- ACPI_FLUSH_CPU_CACHE ();
-
- Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
- (UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
-
- do {
- AcpiOsStall(1000);
- Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- } while (!InValue);
-
- return_ACPI_STATUS (AE_OK);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiLeaveSleepState
+ * FUNCTION: AcpiHwLegacyWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
+ * Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
- * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
+ * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
+ * sleep.
* Called with interrupts ENABLED.
*
******************************************************************************/
ACPI_STATUS
-AcpiLeaveSleepState (
- UINT8 SleepState)
+AcpiHwLegacyWakePrep (
+ UINT8 SleepState,
+ UINT8 Flags)
{
- ACPI_OBJECT_LIST ArgList;
- ACPI_OBJECT Arg;
ACPI_STATUS Status;
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
@@ -511,8 +255,7 @@ AcpiLeaveSleepState (
UINT32 Pm1bControl;
- ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
-
+ ACPI_FUNCTION_TRACE (HwLegacyWakePrep);
/*
* Set SLP_TYPE and SLP_EN to state S0.
@@ -553,40 +296,50 @@ AcpiLeaveSleepState (
}
}
- /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
+ /* Optionally execute _BFS (Back From Sleep) */
- AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
+ if (Flags & ACPI_EXECUTE_BFS)
+ {
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
+ }
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiHwLegacyWake
+ *
+ * PARAMETERS: SleepState - Which sleep state we just exited
+ * Flags - Reserved, set to zero
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
+ * Called with interrupts ENABLED.
+ *
+ ******************************************************************************/
- /* Setup parameter object */
+ACPI_STATUS
+AcpiHwLegacyWake (
+ UINT8 SleepState,
+ UINT8 Flags)
+{
+ ACPI_STATUS Status;
- ArgList.Count = 1;
- ArgList.Pointer = &Arg;
- Arg.Type = ACPI_TYPE_INTEGER;
- /* Ignore any errors from these methods */
+ ACPI_FUNCTION_TRACE (HwLegacyWake);
- Arg.Integer.Value = ACPI_SST_WAKING;
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST"));
- }
- Arg.Integer.Value = SleepState;
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__BFS, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Method _BFS"));
- }
+ /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__WAK, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Method _WAK"));
- }
- /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
+ AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING);
/*
+ * GPEs must be enabled before _WAK is called as GPEs
+ * might get fired there
+ *
* Restore the GPEs:
* 1) Disable/Clear all GPEs
* 2) Enable all runtime GPEs
@@ -596,7 +349,6 @@ AcpiLeaveSleepState (
{
return_ACPI_STATUS (Status);
}
- AcpiGbl_SystemAwakeAndRunning = TRUE;
Status = AcpiHwEnableAllRuntimeGpes ();
if (ACPI_FAILURE (Status))
@@ -604,6 +356,20 @@ AcpiLeaveSleepState (
return_ACPI_STATUS (Status);
}
+ /*
+ * Now we can execute _WAK, etc. Some machines require that the GPEs
+ * are enabled before the wake methods are executed.
+ */
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState);
+
+ /*
+ * Some BIOS code assumes that WAK_STS will be cleared on resume
+ * and use it to determine whether the system is rebooting or
+ * resuming. Clear WAK_STS for compatibility.
+ */
+ (void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
+ AcpiGbl_SystemAwakeAndRunning = TRUE;
+
/* Enable power button */
(void) AcpiWriteBitRegister(
@@ -625,15 +391,8 @@ AcpiLeaveSleepState (
return_ACPI_STATUS (Status);
}
- Arg.Integer.Value = ACPI_SST_WORKING;
- Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
- if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
- {
- ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST"));
- }
-
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
-
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwtimer.c b/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
index faf6770283..15dc58f0bf 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwtimer.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
ACPI_MODULE_NAME ("hwtimer")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/******************************************************************************
*
* FUNCTION: AcpiGetTimerResolution
@@ -214,3 +215,4 @@ AcpiGetTimerDuration (
ACPI_EXPORT_SYMBOL (AcpiGetTimerDuration)
+#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwvalid.c b/usr/src/uts/intel/io/acpica/hardware/hwvalid.c
index 869c9f18fd..4462434bbf 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwvalid.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwvalid.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -149,6 +149,8 @@ AcpiHwValidateIoRequest (
(BitWidth != 16) &&
(BitWidth != 32))
{
+ ACPI_ERROR ((AE_INFO,
+ "Bad BitWidth parameter: %8.8X", BitWidth));
return (AE_BAD_PARAMETER);
}
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwxface.c b/usr/src/uts/intel/io/acpica/hardware/hwxface.c
index f26c511ec8..3fec9b566f 100644
--- a/usr/src/uts/intel/io/acpica/hardware/hwxface.c
+++ b/usr/src/uts/intel/io/acpica/hardware/hwxface.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -154,12 +154,6 @@ AcpiRead (
return (Status);
}
- Width = Reg->BitWidth;
- if (Width == 64)
- {
- Width = 32; /* Break into two 32-bit transfers */
- }
-
/* Initialize entire 64-bit return value to zero */
*ReturnValue = 0;
@@ -172,28 +166,20 @@ AcpiRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, &Value, Width);
+ Address, ReturnValue, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- *ReturnValue = Value;
-
- if (Reg->BitWidth == 64)
- {
- /* Read the top 32 bits */
-
- Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- (Address + 4), &Value, 32);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- *ReturnValue |= ((UINT64) Value << 32);
- }
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
+ Width = Reg->BitWidth;
+ if (Width == 64)
+ {
+ Width = 32; /* Break into two 32-bit transfers */
+ }
+
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address, &Value, Width);
if (ACPI_FAILURE (Status))
@@ -262,12 +248,6 @@ AcpiWrite (
return (Status);
}
- Width = Reg->BitWidth;
- if (Width == 64)
- {
- Width = 32; /* Break into two 32-bit transfers */
- }
-
/*
* Two address spaces supported: Memory or IO. PCI_Config is
* not supported here because the GAS structure is insufficient
@@ -275,24 +255,20 @@ AcpiWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, ACPI_LODWORD (Value), Width);
+ Address, Value, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
}
-
- if (Reg->BitWidth == 64)
- {
- Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- (Address + 4), ACPI_HIDWORD (Value), 32);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- }
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
+ Width = Reg->BitWidth;
+ if (Width == 64)
+ {
+ Width = 32; /* Break into two 32-bit transfers */
+ }
+
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address, ACPI_LODWORD (Value), Width);
if (ACPI_FAILURE (Status))
@@ -323,6 +299,7 @@ AcpiWrite (
ACPI_EXPORT_SYMBOL (AcpiWrite)
+#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiReadBitRegister
@@ -505,6 +482,8 @@ UnlockAndExit:
ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister)
+#endif /* !ACPI_REDUCED_HARDWARE */
+
/*******************************************************************************
*
diff --git a/usr/src/uts/intel/io/acpica/hardware/hwxfsleep.c b/usr/src/uts/intel/io/acpica/hardware/hwxfsleep.c
new file mode 100644
index 0000000000..b7cbbc813e
--- /dev/null
+++ b/usr/src/uts/intel/io/acpica/hardware/hwxfsleep.c
@@ -0,0 +1,478 @@
+/******************************************************************************
+ *
+ * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT ACPI_HARDWARE
+ ACPI_MODULE_NAME ("hwxfsleep")
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiHwSleepDispatch (
+ UINT8 SleepState,
+ UINT8 Flags,
+ UINT32 FunctionId);
+
+/*
+ * Dispatch table used to efficiently branch to the various sleep
+ * functions.
+ */
+#define ACPI_SLEEP_FUNCTION_ID 0
+#define ACPI_WAKE_PREP_FUNCTION_ID 1
+#define ACPI_WAKE_FUNCTION_ID 2
+
+/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
+
+static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
+{
+ {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
+ {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
+ {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
+};
+
+
+/*
+ * These functions are removed for the ACPI_REDUCED_HARDWARE case:
+ * AcpiSetFirmwareWakingVector
+ * AcpiSetFirmwareWakingVector64
+ * AcpiEnterSleepStateS4bios
+ */
+
+#if (!ACPI_REDUCED_HARDWARE)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiSetFirmwareWakingVector
+ *
+ * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
+ * entry point.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiSetFirmwareWakingVector (
+ UINT32 PhysicalAddress)
+{
+ ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
+
+
+ /* Set the 32-bit vector */
+
+ AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
+
+ /* Clear the 64-bit vector if it exists */
+
+ if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
+ {
+ AcpiGbl_FACS->XFirmwareWakingVector = 0;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
+
+
+#if ACPI_MACHINE_WIDTH == 64
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiSetFirmwareWakingVector64
+ *
+ * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
+ * mode entry point.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
+ * it exists in the table. This function is intended for use with
+ * 64-bit host operating systems.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiSetFirmwareWakingVector64 (
+ UINT64 PhysicalAddress)
+{
+ ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
+
+
+ /* Determine if the 64-bit vector actually exists */
+
+ if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
+ {
+ return_ACPI_STATUS (AE_NOT_EXIST);
+ }
+
+ /* Clear 32-bit vector, set the 64-bit X_ vector */
+
+ AcpiGbl_FACS->FirmwareWakingVector = 0;
+ AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
+ return_ACPI_STATUS (AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
+#endif
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiEnterSleepStateS4bios
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform a S4 bios request.
+ * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiEnterSleepStateS4bios (
+ void)
+{
+ UINT32 InValue;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
+
+
+ /* Clear the wake status bit (PM1) */
+
+ Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ Status = AcpiHwClearAcpiStatus ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /*
+ * 1) Disable/Clear all GPEs
+ * 2) Enable all wakeup GPEs
+ */
+ Status = AcpiHwDisableAllGpes ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ AcpiGbl_SystemAwakeAndRunning = FALSE;
+
+ Status = AcpiHwEnableAllWakeupGpes ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ ACPI_FLUSH_CPU_CACHE ();
+
+ Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
+ (UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
+
+ do {
+ AcpiOsStall(1000);
+ Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ } while (!InValue);
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiHwSleepDispatch
+ *
+ * PARAMETERS: SleepState - Which sleep state to enter/exit
+ * FunctionId - Sleep, WakePrep, or Wake
+ *
+ * RETURN: Status from the invoked sleep handling function.
+ *
+ * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
+ * function.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiHwSleepDispatch (
+ UINT8 SleepState,
+ UINT8 Flags,
+ UINT32 FunctionId)
+{
+ ACPI_STATUS Status;
+ ACPI_SLEEP_FUNCTIONS *SleepFunctions = &AcpiSleepDispatch[FunctionId];
+
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+ /*
+ * If the Hardware Reduced flag is set (from the FADT), we must
+ * use the extended sleep registers
+ */
+ if (AcpiGbl_ReducedHardware ||
+ AcpiGbl_FADT.SleepControl.Address)
+ {
+ Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
+ }
+ else
+ {
+ /* Legacy sleep */
+
+ Status = SleepFunctions->LegacyFunction (SleepState, Flags);
+ }
+
+ return (Status);
+
+#else
+ /*
+ * For the case where reduced-hardware-only code is being generated,
+ * we know that only the extended sleep registers are available
+ */
+ Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
+ return (Status);
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiEnterSleepStatePrep
+ *
+ * PARAMETERS: SleepState - Which sleep state to enter
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Prepare to enter a system sleep state.
+ * This function must execute with interrupts enabled.
+ * We break sleeping into 2 stages so that OSPM can handle
+ * various OS-specific tasks between the two steps.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiEnterSleepStatePrep (
+ UINT8 SleepState)
+{
+ ACPI_STATUS Status;
+ ACPI_OBJECT_LIST ArgList;
+ ACPI_OBJECT Arg;
+ UINT32 SstValue;
+
+
+ ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
+
+
+ Status = AcpiGetSleepTypeData (SleepState,
+ &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Execute the _PTS method (Prepare To Sleep) */
+
+ ArgList.Count = 1;
+ ArgList.Pointer = &Arg;
+ Arg.Type = ACPI_TYPE_INTEGER;
+ Arg.Integer.Value = SleepState;
+
+ Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL);
+ if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Setup the argument to the _SST method (System STatus) */
+
+ switch (SleepState)
+ {
+ case ACPI_STATE_S0:
+ SstValue = ACPI_SST_WORKING;
+ break;
+
+ case ACPI_STATE_S1:
+ case ACPI_STATE_S2:
+ case ACPI_STATE_S3:
+ SstValue = ACPI_SST_SLEEPING;
+ break;
+
+ case ACPI_STATE_S4:
+ SstValue = ACPI_SST_SLEEP_CONTEXT;
+ break;
+
+ default:
+ SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */
+ break;
+ }
+
+ /*
+ * Set the system indicators to show the desired sleep state.
+ * _SST is an optional method (return no error if not found)
+ */
+ AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue);
+ return_ACPI_STATUS (AE_OK);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiEnterSleepState
+ *
+ * PARAMETERS: SleepState - Which sleep state to enter
+ * Flags - ACPI_EXECUTE_GTS to run optional method
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Enter a system sleep state
+ * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiEnterSleepState (
+ UINT8 SleepState,
+ UINT8 Flags)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
+
+
+ if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
+ (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
+ {
+ ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
+ AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
+ return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
+ }
+
+ Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_SLEEP_FUNCTION_ID);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLeaveSleepStatePrep
+ *
+ * PARAMETERS: SleepState - Which sleep state we are exiting
+ * Flags - ACPI_EXECUTE_BFS to run optional method
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
+ * sleep. Called with interrupts DISABLED.
+ * We break wake/resume into 2 stages so that OSPM can handle
+ * various OS-specific tasks between the two steps.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiLeaveSleepStatePrep (
+ UINT8 SleepState,
+ UINT8 Flags)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
+
+
+ Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_WAKE_PREP_FUNCTION_ID);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiLeaveSleepStatePrep)
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLeaveSleepState
+ *
+ * PARAMETERS: SleepState - Which sleep state we are exiting
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
+ * Called with interrupts ENABLED.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiLeaveSleepState (
+ UINT8 SleepState)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
+
+
+ Status = AcpiHwSleepDispatch (SleepState, 0, ACPI_WAKE_FUNCTION_ID);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsaccess.c b/usr/src/uts/intel/io/acpica/namespace/nsaccess.c
index 1bb2b4b6e6..9dfa76fb08 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsaccess.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsaccess.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsalloc.c b/usr/src/uts/intel/io/acpica/namespace/nsalloc.c
index ac12ba4faf..c7e83e0eb4 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsalloc.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsalloc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsdump.c b/usr/src/uts/intel/io/acpica/namespace/nsdump.c
index 58137abbc5..6b7c505779 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsdump.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -270,7 +270,21 @@ AcpiNsDumpOneObject (
if (!ObjDesc)
{
- /* No attached object, we are done */
+ /* No attached object. Some types should always have an object */
+
+ switch (Type)
+ {
+ case ACPI_TYPE_INTEGER:
+ case ACPI_TYPE_PACKAGE:
+ case ACPI_TYPE_BUFFER:
+ case ACPI_TYPE_STRING:
+ case ACPI_TYPE_METHOD:
+ AcpiOsPrintf ("<No attached object>");
+ break;
+
+ default:
+ break;
+ }
AcpiOsPrintf ("\n");
return (AE_OK);
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsdumpdv.c b/usr/src/uts/intel/io/acpica/namespace/nsdumpdv.c
index 11aab7a3a9..9d30886608 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsdumpdv.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsdumpdv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -141,7 +141,7 @@ AcpiNsDumpRootDevices (
return;
}
- Status = AcpiGetHandle (NULL, ACPI_NS_SYSTEM_BUS, &SysBusHandle);
+ Status = AcpiGetHandle (NULL, METHOD_NAME__SB_, &SysBusHandle);
if (ACPI_FAILURE (Status))
{
return;
diff --git a/usr/src/uts/intel/io/acpica/namespace/nseval.c b/usr/src/uts/intel/io/acpica/namespace/nseval.c
index c376ac7213..0183f7e774 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nseval.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nseval.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsinit.c b/usr/src/uts/intel/io/acpica/namespace/nsinit.c
index 1822bf519f..f3907aafb3 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsinit.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsload.c b/usr/src/uts/intel/io/acpica/namespace/nsload.c
index 5825f6bc9d..3ef33f9ce9 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsload.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsnames.c b/usr/src/uts/intel/io/acpica/namespace/nsnames.c
index e59b2e9569..f70900da1d 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsnames.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsobject.c b/usr/src/uts/intel/io/acpica/namespace/nsobject.c
index dadd2e8d98..9b219a5624 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsobject.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsobject.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsparse.c b/usr/src/uts/intel/io/acpica/namespace/nsparse.c
index 983697eaaf..2c768c0b69 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsparse.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nspredef.c b/usr/src/uts/intel/io/acpica/namespace/nspredef.c
index 95c3edf04d..3a61aa3666 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nspredef.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nspredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -216,14 +216,20 @@ AcpiNsCheckPredefinedNames (
}
/*
- * 1) We have a return value, but if one wasn't expected, just exit, this is
- * not a problem. For example, if the "Implicit Return" feature is
- * enabled, methods will always return a value.
+ * Return value validation and possible repair.
*
- * 2) If the return value can be of any type, then we cannot perform any
- * validation, exit.
+ * 1) Don't perform return value validation/repair if this feature
+ * has been disabled via a global option.
+ *
+ * 2) We have a return value, but if one wasn't expected, just exit,
+ * this is not a problem. For example, if the "Implicit Return"
+ * feature is enabled, methods will always return a value.
+ *
+ * 3) If the return value can be of any type, then we cannot perform
+ * any validation, just exit.
*/
- if ((!Predefined->Info.ExpectedBtypes) ||
+ if (AcpiGbl_DisableAutoRepair ||
+ (!Predefined->Info.ExpectedBtypes) ||
(Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL))
{
goto Cleanup;
@@ -237,6 +243,7 @@ AcpiNsCheckPredefinedNames (
goto Cleanup;
}
Data->Predefined = Predefined;
+ Data->Node = Node;
Data->NodeFlags = Node->Flags;
Data->Pathname = Pathname;
@@ -658,6 +665,7 @@ AcpiNsCheckPackage (
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
case ACPI_PTYPE2_COUNT:
+ case ACPI_PTYPE2_FIX_VAR:
/*
* These types all return a single Package that consists of a
@@ -673,7 +681,7 @@ AcpiNsCheckPackage (
{
/* Create the new outer package and populate it */
- Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr);
+ Status = AcpiNsWrapWithPackage (Data, *Elements, ReturnObjectPtr);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -800,6 +808,29 @@ AcpiNsCheckPackageList (
break;
+ case ACPI_PTYPE2_FIX_VAR:
+ /*
+ * Each subpackage has a fixed number of elements and an
+ * optional element
+ */
+ ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
+ if (SubPackage->Package.Count < ExpectedCount)
+ {
+ goto PackageTooSmall;
+ }
+
+ Status = AcpiNsCheckPackageElements (Data, SubElements,
+ Package->RetInfo.ObjectType1,
+ Package->RetInfo.Count1,
+ Package->RetInfo.ObjectType2,
+ SubPackage->Package.Count - Package->RetInfo.Count1, 0);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ break;
+
+
case ACPI_PTYPE2_FIXED:
/* Each sub-package has a fixed length */
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsrepair.c b/usr/src/uts/intel/io/acpica/namespace/nsrepair.c
index be73953ded..be9d3e889d 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsrepair.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsrepair.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -74,11 +74,10 @@
* Buffer -> String
* Buffer -> Package of Integers
* Package -> Package of one Package
+ * An incorrect standalone object is wrapped with required outer package
*
* Additional possible repairs:
- *
* Required package elements that are NULL replaced by Integer/String/Buffer
- * Incorrect standalone package wrapped with required outer package
*
******************************************************************************/
@@ -100,11 +99,6 @@ AcpiNsConvertToBuffer (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
-static ACPI_STATUS
-AcpiNsConvertToPackage (
- ACPI_OPERAND_OBJECT *OriginalObject,
- ACPI_OPERAND_OBJECT **ReturnObject);
-
/*******************************************************************************
*
@@ -172,10 +166,24 @@ AcpiNsRepairObject (
}
if (ExpectedBtypes & ACPI_RTYPE_PACKAGE)
{
- Status = AcpiNsConvertToPackage (ReturnObject, &NewObject);
+ /*
+ * A package is expected. We will wrap the existing object with a
+ * new package object. It is often the case that if a variable-length
+ * package is required, but there is only a single object needed, the
+ * BIOS will return that object instead of wrapping it with a Package
+ * object. Note: after the wrapping, the package will be validated
+ * for correct contents (expected object type or types).
+ */
+ Status = AcpiNsWrapWithPackage (Data, ReturnObject, &NewObject);
if (ACPI_SUCCESS (Status))
{
- goto ObjectRepaired;
+ /*
+ * The original object just had its reference count
+ * incremented for being inserted into the new package.
+ */
+ *ReturnObjectPtr = NewObject; /* New Package object */
+ Data->Flags |= ACPI_OBJECT_REPAIRED;
+ return (AE_OK);
}
}
@@ -188,24 +196,30 @@ ObjectRepaired:
/* Object was successfully repaired */
- /*
- * If the original object is a package element, we need to:
- * 1. Set the reference count of the new object to match the
- * reference count of the old object.
- * 2. Decrement the reference count of the original object.
- */
if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
{
- NewObject->Common.ReferenceCount =
- ReturnObject->Common.ReferenceCount;
-
- if (ReturnObject->Common.ReferenceCount > 1)
+ /*
+ * The original object is a package element. We need to
+ * decrement the reference count of the original object,
+ * for removing it from the package.
+ *
+ * However, if the original object was just wrapped with a
+ * package object as part of the repair, we don't need to
+ * change the reference count.
+ */
+ if (!(Data->Flags & ACPI_OBJECT_WRAPPED))
{
- ReturnObject->Common.ReferenceCount--;
+ NewObject->Common.ReferenceCount =
+ ReturnObject->Common.ReferenceCount;
+
+ if (ReturnObject->Common.ReferenceCount > 1)
+ {
+ ReturnObject->Common.ReferenceCount--;
+ }
}
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
- "%s: Converted %s to expected %s at index %u\n",
+ "%s: Converted %s to expected %s at Package index %u\n",
Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject),
AcpiUtGetObjectTypeName (NewObject), PackageIndex));
}
@@ -498,71 +512,6 @@ AcpiNsConvertToBuffer (
/*******************************************************************************
*
- * FUNCTION: AcpiNsConvertToPackage
- *
- * PARAMETERS: OriginalObject - Object to be converted
- * ReturnObject - Where the new converted object is returned
- *
- * RETURN: Status. AE_OK if conversion was successful.
- *
- * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of
- * the buffer is converted to a single integer package element.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiNsConvertToPackage (
- ACPI_OPERAND_OBJECT *OriginalObject,
- ACPI_OPERAND_OBJECT **ReturnObject)
-{
- ACPI_OPERAND_OBJECT *NewObject;
- ACPI_OPERAND_OBJECT **Elements;
- UINT32 Length;
- UINT8 *Buffer;
-
-
- switch (OriginalObject->Common.Type)
- {
- case ACPI_TYPE_BUFFER:
-
- /* Buffer-to-Package conversion */
-
- Length = OriginalObject->Buffer.Length;
- NewObject = AcpiUtCreatePackageObject (Length);
- if (!NewObject)
- {
- return (AE_NO_MEMORY);
- }
-
- /* Convert each buffer byte to an integer package element */
-
- Elements = NewObject->Package.Elements;
- Buffer = OriginalObject->Buffer.Pointer;
-
- while (Length--)
- {
- *Elements = AcpiUtCreateIntegerObject ((UINT64) *Buffer);
- if (!*Elements)
- {
- AcpiUtRemoveReference (NewObject);
- return (AE_NO_MEMORY);
- }
- Elements++;
- Buffer++;
- }
- break;
-
- default:
- return (AE_AML_OPERAND_TYPE);
- }
-
- *ReturnObject = NewObject;
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiNsRepairNullElement
*
* PARAMETERS: Data - Pointer to validation data structure
@@ -696,6 +645,7 @@ AcpiNsRemoveNullElements (
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
case ACPI_PTYPE2_REV_FIXED:
+ case ACPI_PTYPE2_FIX_VAR:
break;
default:
@@ -744,42 +694,43 @@ AcpiNsRemoveNullElements (
/*******************************************************************************
*
- * FUNCTION: AcpiNsRepairPackageList
+ * FUNCTION: AcpiNsWrapWithPackage
*
* PARAMETERS: Data - Pointer to validation data structure
- * ObjDescPtr - Pointer to the object to repair. The new
- * package object is returned here,
- * overwriting the old object.
+ * OriginalObject - Pointer to the object to repair.
+ * ObjDescPtr - The new package object is returned here
*
* RETURN: Status, new object in *ObjDescPtr
*
- * DESCRIPTION: Repair a common problem with objects that are defined to return
- * a variable-length Package of Packages. If the variable-length
- * is one, some BIOS code mistakenly simply declares a single
- * Package instead of a Package with one sub-Package. This
- * function attempts to repair this error by wrapping a Package
- * object around the original Package, creating the correct
- * Package with one sub-Package.
+ * DESCRIPTION: Repair a common problem with objects that are defined to
+ * return a variable-length Package of sub-objects. If there is
+ * only one sub-object, some BIOS code mistakenly simply declares
+ * the single object instead of a Package with one sub-object.
+ * This function attempts to repair this error by wrapping a
+ * Package object around the original object, creating the
+ * correct and expected Package with one sub-object.
*
* Names that can be repaired in this manner include:
- * _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS
+ * _ALR, _CSD, _HPX, _MLS, _PLD, _PRT, _PSS, _TRT, _TSS,
+ * _BCL, _DOD, _FIX, _Sx
*
******************************************************************************/
ACPI_STATUS
-AcpiNsRepairPackageList (
+AcpiNsWrapWithPackage (
ACPI_PREDEFINED_DATA *Data,
+ ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_OPERAND_OBJECT *PkgObjDesc;
- ACPI_FUNCTION_NAME (NsRepairPackageList);
+ ACPI_FUNCTION_NAME (NsWrapWithPackage);
/*
* Create the new outer package and populate it. The new package will
- * have a single element, the lone subpackage.
+ * have a single element, the lone sub-object.
*/
PkgObjDesc = AcpiUtCreatePackageObject (1);
if (!PkgObjDesc)
@@ -787,15 +738,15 @@ AcpiNsRepairPackageList (
return (AE_NO_MEMORY);
}
- PkgObjDesc->Package.Elements[0] = *ObjDescPtr;
+ PkgObjDesc->Package.Elements[0] = OriginalObject;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
+ "%s: Wrapped %s with expected Package object\n",
+ Data->Pathname, AcpiUtGetObjectTypeName (OriginalObject)));
/* Return the new object in the object pointer */
*ObjDescPtr = PkgObjDesc;
- Data->Flags |= ACPI_OBJECT_REPAIRED;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
- "%s: Repaired incorrectly formed Package\n", Data->Pathname));
-
+ Data->Flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED;
return (AE_OK);
}
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsrepair2.c b/usr/src/uts/intel/io/acpica/namespace/nsrepair2.c
index 4c9c6d7825..a6a4d6874d 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsrepair2.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsrepair2.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -516,11 +516,12 @@ AcpiNsRepair_HID (
}
/*
- * Copy and uppercase the string. From the ACPI specification:
+ * Copy and uppercase the string. From the ACPI 5.0 specification:
*
* A valid PNP ID must be of the form "AAA####" where A is an uppercase
* letter and # is a hex digit. A valid ACPI ID must be of the form
- * "ACPI####" where # is a hex digit.
+ * "NNNN####" where N is an uppercase letter or decimal digit, and
+ * # is a hex digit.
*/
for (Dest = NewString->String.Pointer; *Source; Dest++, Source++)
{
@@ -555,8 +556,23 @@ AcpiNsRepair_TSS (
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_STATUS Status;
+ ACPI_NAMESPACE_NODE *Node;
+ /*
+ * We can only sort the _TSS return package if there is no _PSS in the
+ * same scope. This is because if _PSS is present, the ACPI specification
+ * dictates that the _TSS Power Dissipation field is to be ignored, and
+ * therefore some BIOSs leave garbage values in the _TSS Power field(s).
+ * In this case, it is best to just return the _TSS package as-is.
+ * (May, 2011)
+ */
+ Status = AcpiNsGetNode (Data->Node, "^_PSS", ACPI_NS_NO_UPSEARCH, &Node);
+ if (ACPI_SUCCESS (Status))
+ {
+ return (AE_OK);
+ }
+
Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1,
ACPI_SORT_DESCENDING, "PowerDissipation");
diff --git a/usr/src/uts/intel/io/acpica/namespace/nssearch.c b/usr/src/uts/intel/io/acpica/namespace/nssearch.c
index 1951c2548b..d6f59ccbd1 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nssearch.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nssearch.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsutils.c b/usr/src/uts/intel/io/acpica/namespace/nsutils.c
index fad2a57c5e..43f734e819 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsutils.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsutils.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -405,7 +405,7 @@ AcpiNsBuildInternalName (
if (!AcpiNsValidPathSeparator (*ExternalName) &&
(*ExternalName != 0))
{
- return_ACPI_STATUS (AE_BAD_PARAMETER);
+ return_ACPI_STATUS (AE_BAD_PATHNAME);
}
/* Move on the next segment */
diff --git a/usr/src/uts/intel/io/acpica/namespace/nswalk.c b/usr/src/uts/intel/io/acpica/namespace/nswalk.c
index d44775212a..35c3e17896 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nswalk.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsxfeval.c b/usr/src/uts/intel/io/acpica/namespace/nsxfeval.c
index 0854cac9e9..5006588e85 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsxfeval.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsxfeval.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsxfname.c b/usr/src/uts/intel/io/acpica/namespace/nsxfname.c
index b0ccff5bdc..4690d09e90 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsxfname.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsxfname.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/namespace/nsxfobj.c b/usr/src/uts/intel/io/acpica/namespace/nsxfobj.c
index 9910248220..02f7777a39 100644
--- a/usr/src/uts/intel/io/acpica/namespace/nsxfobj.c
+++ b/usr/src/uts/intel/io/acpica/namespace/nsxfobj.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/osl.c b/usr/src/uts/intel/io/acpica/osl.c
index d5bfab754f..44f8d2f48f 100644
--- a/usr/src/uts/intel/io/acpica/osl.c
+++ b/usr/src/uts/intel/io/acpica/osl.c
@@ -22,7 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- * Copyright 2011 Joyent, Inc. All rights reserved.
+ * Copyright 2012 Joyent, Inc. All rights reserved.
*/
/*
* Copyright (c) 2009-2010, Intel Corporation.
@@ -315,6 +315,12 @@ AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable,
return (AE_OK);
}
+ACPI_STATUS
+AcpiOsPhysicalTableOverride(ACPI_TABLE_HEADER *ExistingTable,
+ ACPI_PHYSICAL_ADDRESS *NewAddress, UINT32 *NewTableLength)
+{
+ return (AE_SUPPORT);
+}
/*
* ACPI semaphore implementation
@@ -883,7 +889,7 @@ AcpiOsWritePort(ACPI_IO_ADDRESS Address, UINT32 Value, UINT32 Width)
static void
-osl_rw_memory(ACPI_PHYSICAL_ADDRESS Address, UINT32 *Value,
+osl_rw_memory(ACPI_PHYSICAL_ADDRESS Address, UINT64 *Value,
UINT32 Width, int write)
{
size_t maplen = Width / 8;
@@ -902,6 +908,9 @@ osl_rw_memory(ACPI_PHYSICAL_ADDRESS Address, UINT32 *Value,
case 4:
OSL_RW(ptr, Value, uint32_t, write);
break;
+ case 8:
+ OSL_RW(ptr, Value, uint64_t, write);
+ break;
default:
cmn_err(CE_WARN, "!osl_rw_memory: invalid size %d",
Width);
@@ -913,7 +922,7 @@ osl_rw_memory(ACPI_PHYSICAL_ADDRESS Address, UINT32 *Value,
ACPI_STATUS
AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS Address,
- UINT32 *Value, UINT32 Width)
+ UINT64 *Value, UINT32 Width)
{
osl_rw_memory(Address, Value, Width, 0);
return (AE_OK);
@@ -921,7 +930,7 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS Address,
ACPI_STATUS
AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS Address,
- UINT32 Value, UINT32 Width)
+ UINT64 Value, UINT32 Width)
{
osl_rw_memory(Address, &Value, Width, 1);
return (AE_OK);
diff --git a/usr/src/uts/intel/io/acpica/parser/psargs.c b/usr/src/uts/intel/io/acpica/parser/psargs.c
index e383def11e..8140fdbb9d 100644
--- a/usr/src/uts/intel/io/acpica/parser/psargs.c
+++ b/usr/src/uts/intel/io/acpica/parser/psargs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -531,37 +531,57 @@ static ACPI_PARSE_OBJECT *
AcpiPsGetNextField (
ACPI_PARSE_STATE *ParserState)
{
- UINT32 AmlOffset = (UINT32)
- ACPI_PTR_DIFF (ParserState->Aml,
- ParserState->AmlStart);
+ UINT32 AmlOffset;
ACPI_PARSE_OBJECT *Field;
+ ACPI_PARSE_OBJECT *Arg = NULL;
UINT16 Opcode;
UINT32 Name;
+ UINT8 AccessType;
+ UINT8 AccessAttribute;
+ UINT8 AccessLength;
+ UINT32 PkgLength;
+ UINT8 *PkgEnd;
+ UINT32 BufferLength;
ACPI_FUNCTION_TRACE (PsGetNextField);
+ AmlOffset = (UINT32) ACPI_PTR_DIFF (
+ ParserState->Aml, ParserState->AmlStart);
+
/* Determine field type */
switch (ACPI_GET8 (ParserState->Aml))
{
- default:
+ case AML_FIELD_OFFSET_OP:
- Opcode = AML_INT_NAMEDFIELD_OP;
+ Opcode = AML_INT_RESERVEDFIELD_OP;
+ ParserState->Aml++;
break;
- case 0x00:
+ case AML_FIELD_ACCESS_OP:
- Opcode = AML_INT_RESERVEDFIELD_OP;
+ Opcode = AML_INT_ACCESSFIELD_OP;
ParserState->Aml++;
break;
- case 0x01:
+ case AML_FIELD_CONNECTION_OP:
- Opcode = AML_INT_ACCESSFIELD_OP;
+ Opcode = AML_INT_CONNECTION_OP;
+ ParserState->Aml++;
+ break;
+
+ case AML_FIELD_EXT_ACCESS_OP:
+
+ Opcode = AML_INT_EXTACCESSFIELD_OP;
ParserState->Aml++;
break;
+
+ default:
+
+ Opcode = AML_INT_NAMEDFIELD_OP;
+ break;
}
/* Allocate a new field op */
@@ -601,17 +621,118 @@ AcpiPsGetNextField (
case AML_INT_ACCESSFIELD_OP:
+ case AML_INT_EXTACCESSFIELD_OP:
/*
* Get AccessType and AccessAttrib and merge into the field Op
- * AccessType is first operand, AccessAttribute is second
+ * AccessType is first operand, AccessAttribute is second. stuff
+ * these bytes into the node integer value for convenience.
*/
- Field->Common.Value.Integer = (((UINT32) ACPI_GET8 (ParserState->Aml) << 8));
+
+ /* Get the two bytes (Type/Attribute) */
+
+ AccessType = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
- Field->Common.Value.Integer |= ACPI_GET8 (ParserState->Aml);
+ AccessAttribute = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
+
+ Field->Common.Value.Integer = (UINT8) AccessType;
+ Field->Common.Value.Integer |= (UINT16) (AccessAttribute << 8);
+
+ /* This opcode has a third byte, AccessLength */
+
+ if (Opcode == AML_INT_EXTACCESSFIELD_OP)
+ {
+ AccessLength = ACPI_GET8 (ParserState->Aml);
+ ParserState->Aml++;
+
+ Field->Common.Value.Integer |= (UINT32) (AccessLength << 16);
+ }
break;
+
+ case AML_INT_CONNECTION_OP:
+
+ /*
+ * Argument for Connection operator can be either a Buffer
+ * (resource descriptor), or a NameString.
+ */
+ if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP)
+ {
+ ParserState->Aml++;
+
+ PkgEnd = ParserState->Aml;
+ PkgLength = AcpiPsGetNextPackageLength (ParserState);
+ PkgEnd += PkgLength;
+
+ if (ParserState->Aml < PkgEnd)
+ {
+ /* Non-empty list */
+
+ Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP);
+ if (!Arg)
+ {
+ AcpiPsFreeOp (Field);
+ return_PTR (NULL);
+ }
+
+ /* Get the actual buffer length argument */
+
+ Opcode = ACPI_GET8 (ParserState->Aml);
+ ParserState->Aml++;
+
+ switch (Opcode)
+ {
+ case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
+ BufferLength = ACPI_GET8 (ParserState->Aml);
+ ParserState->Aml += 1;
+ break;
+
+ case AML_WORD_OP: /* AML_WORDDATA_ARG */
+ BufferLength = ACPI_GET16 (ParserState->Aml);
+ ParserState->Aml += 2;
+ break;
+
+ case AML_DWORD_OP: /* AML_DWORDATA_ARG */
+ BufferLength = ACPI_GET32 (ParserState->Aml);
+ ParserState->Aml += 4;
+ break;
+
+ default:
+ BufferLength = 0;
+ break;
+ }
+
+ /* Fill in bytelist data */
+
+ Arg->Named.Value.Size = BufferLength;
+ Arg->Named.Data = ParserState->Aml;
+ }
+
+ /* Skip to End of byte data */
+
+ ParserState->Aml = PkgEnd;
+ }
+ else
+ {
+ Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
+ if (!Arg)
+ {
+ AcpiPsFreeOp (Field);
+ return_PTR (NULL);
+ }
+
+ /* Get the Namestring argument */
+
+ Arg->Common.Value.Name = AcpiPsGetNextNamestring (ParserState);
+ }
+
+ /* Link the buffer/namestring to parent (CONNECTION_OP) */
+
+ AcpiPsAppendArg (Field, Arg);
+ break;
+
+
default:
/* Opcode was set in previous switch */
diff --git a/usr/src/uts/intel/io/acpica/parser/psloop.c b/usr/src/uts/intel/io/acpica/parser/psloop.c
index a98989e099..d578c7e36b 100644
--- a/usr/src/uts/intel/io/acpica/parser/psloop.c
+++ b/usr/src/uts/intel/io/acpica/parser/psloop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/parser/psopcode.c b/usr/src/uts/intel/io/acpica/parser/psopcode.c
index 0d82976d7f..ef2257e86f 100644
--- a/usr/src/uts/intel/io/acpica/parser/psopcode.c
+++ b/usr/src/uts/intel/io/acpica/parser/psopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -328,12 +328,17 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT),
/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
-/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
+/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE),
/* ACPI 3.0 opcodes */
-/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R)
+/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R),
+
+/* ACPI 5.0 opcodes */
+
+/* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
+/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0)
/*! [End] no source code translation !*/
};
@@ -353,7 +358,7 @@ static const UINT8 AcpiGbl_ShortOpIndex[256] =
/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D,
-/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
+/* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
diff --git a/usr/src/uts/intel/io/acpica/parser/psparse.c b/usr/src/uts/intel/io/acpica/parser/psparse.c
index f817749b75..bcf46adfe5 100644
--- a/usr/src/uts/intel/io/acpica/parser/psparse.c
+++ b/usr/src/uts/intel/io/acpica/parser/psparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/parser/psscope.c b/usr/src/uts/intel/io/acpica/parser/psscope.c
index 827531d460..1df5a33af3 100644
--- a/usr/src/uts/intel/io/acpica/parser/psscope.c
+++ b/usr/src/uts/intel/io/acpica/parser/psscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/parser/pstree.c b/usr/src/uts/intel/io/acpica/parser/pstree.c
index d62bc7b9db..8271314e16 100644
--- a/usr/src/uts/intel/io/acpica/parser/pstree.c
+++ b/usr/src/uts/intel/io/acpica/parser/pstree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,12 @@ AcpiPsGetArg (
ACPI_FUNCTION_ENTRY ();
-
+/*
+ if (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP)
+ {
+ return (Op->Common.Value.Arg);
+ }
+*/
/* Get the info structure for this opcode */
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
diff --git a/usr/src/uts/intel/io/acpica/parser/psutils.c b/usr/src/uts/intel/io/acpica/parser/psutils.c
index 426d2ccdd7..e28b75cc8f 100644
--- a/usr/src/uts/intel/io/acpica/parser/psutils.c
+++ b/usr/src/uts/intel/io/acpica/parser/psutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/parser/pswalk.c b/usr/src/uts/intel/io/acpica/parser/pswalk.c
index dbb4a17fe9..9734c4d177 100644
--- a/usr/src/uts/intel/io/acpica/parser/pswalk.c
+++ b/usr/src/uts/intel/io/acpica/parser/pswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/parser/psxface.c b/usr/src/uts/intel/io/acpica/parser/psxface.c
index e7a5d9fe9a..2a012c2915 100644
--- a/usr/src/uts/intel/io/acpica/parser/psxface.c
+++ b/usr/src/uts/intel/io/acpica/parser/psxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/resources/rsaddr.c b/usr/src/uts/intel/io/acpica/resources/rsaddr.c
index c11e8ca128..90e7d43b6e 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsaddr.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsaddr.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/resources/rscalc.c b/usr/src/uts/intel/io/acpica/resources/rscalc.c
index 15cf685857..845ed69c7d 100644
--- a/usr/src/uts/intel/io/acpica/resources/rscalc.c
+++ b/usr/src/uts/intel/io/acpica/resources/rscalc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -345,6 +345,26 @@ AcpiRsGetAmlLength (
break;
+ case ACPI_RESOURCE_TYPE_GPIO:
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize + (Resource->Data.Gpio.PinTableLength * 2) +
+ Resource->Data.Gpio.ResourceSource.StringLength +
+ Resource->Data.Gpio.VendorLength);
+
+ break;
+
+
+ case ACPI_RESOURCE_TYPE_SERIAL_BUS:
+
+ TotalSize = AcpiGbl_AmlResourceSerialBusSizes [Resource->Data.CommonSerialBus.Type];
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ Resource->Data.I2cSerialBus.ResourceSource.StringLength +
+ Resource->Data.I2cSerialBus.VendorLength);
+
+ break;
+
+
default:
break;
}
@@ -395,12 +415,13 @@ AcpiRsGetListLength (
UINT32 ExtraStructBytes;
UINT8 ResourceIndex;
UINT8 MinimumAmlResourceLength;
+ AML_RESOURCE *AmlResource;
ACPI_FUNCTION_TRACE (RsGetListLength);
- *SizeNeeded = 0;
+ *SizeNeeded = ACPI_RS_SIZE_MIN; /* Minimum size is one EndTag */
EndAml = AmlBuffer + AmlBufferLength;
/* Walk the list of AML resource descriptors */
@@ -412,9 +433,15 @@ AcpiRsGetListLength (
Status = AcpiUtValidateResource (AmlBuffer, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
+ /*
+ * Exit on failure. Cannot continue because the descriptor length
+ * may be bogus also.
+ */
return_ACPI_STATUS (Status);
}
+ AmlResource = (void *) AmlBuffer;
+
/* Get the resource length and base (minimum) AML size */
ResourceLength = AcpiUtGetResourceLength (AmlBuffer);
@@ -460,10 +487,8 @@ AcpiRsGetListLength (
case ACPI_RESOURCE_NAME_END_TAG:
/*
- * End Tag:
- * This is the normal exit, add size of EndTag
+ * End Tag: This is the normal exit
*/
- *SizeNeeded += ACPI_RS_SIZE_MIN;
return_ACPI_STATUS (AE_OK);
@@ -494,6 +519,30 @@ AcpiRsGetListLength (
ResourceLength - ExtraStructBytes, MinimumAmlResourceLength);
break;
+ case ACPI_RESOURCE_NAME_GPIO:
+
+ /* Vendor data is optional */
+
+ if (AmlResource->Gpio.VendorLength)
+ {
+ ExtraStructBytes += AmlResource->Gpio.VendorOffset -
+ AmlResource->Gpio.PinTableOffset + AmlResource->Gpio.VendorLength;
+ }
+ else
+ {
+ ExtraStructBytes += AmlResource->LargeHeader.ResourceLength +
+ sizeof (AML_RESOURCE_LARGE_HEADER) -
+ AmlResource->Gpio.PinTableOffset;
+ }
+ break;
+
+ case ACPI_RESOURCE_NAME_SERIAL_BUS:
+
+ MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[
+ AmlResource->CommonSerialBus.Type];
+ ExtraStructBytes += AmlResource->CommonSerialBus.ResourceLength -
+ MinimumAmlResourceLength;
+ break;
default:
break;
@@ -505,8 +554,16 @@ AcpiRsGetListLength (
* Important: Round the size up for the appropriate alignment. This
* is a requirement on IA64.
*/
- BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] +
+ if (AcpiUtGetResourceType (AmlBuffer) == ACPI_RESOURCE_NAME_SERIAL_BUS)
+ {
+ BufferSize = AcpiGbl_ResourceStructSerialBusSizes[
+ AmlResource->CommonSerialBus.Type] + ExtraStructBytes;
+ }
+ else
+ {
+ BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] +
ExtraStructBytes;
+ }
BufferSize = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (BufferSize);
*SizeNeeded += BufferSize;
diff --git a/usr/src/uts/intel/io/acpica/resources/rscreate.c b/usr/src/uts/intel/io/acpica/resources/rscreate.c
index 40cf447c29..f06ea0cb4d 100644
--- a/usr/src/uts/intel/io/acpica/resources/rscreate.c
+++ b/usr/src/uts/intel/io/acpica/resources/rscreate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,79 @@
/*******************************************************************************
*
+ * FUNCTION: AcpiBufferToResource
+ *
+ * PARAMETERS: AmlBuffer - Pointer to the resource byte stream
+ * AmlBufferLength - Length of the AmlBuffer
+ * ResourcePtr - Where the converted resource is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a raw AML buffer to a resource list
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiBufferToResource (
+ UINT8 *AmlBuffer,
+ UINT16 AmlBufferLength,
+ ACPI_RESOURCE **ResourcePtr)
+{
+ ACPI_STATUS Status;
+ ACPI_SIZE ListSizeNeeded;
+ void *Resource;
+ void *CurrentResourcePtr;
+
+ /*
+ * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
+ * is not required here.
+ */
+
+ /* Get the required length for the converted resource */
+
+ Status = AcpiRsGetListLength (AmlBuffer, AmlBufferLength,
+ &ListSizeNeeded);
+ if (Status == AE_AML_NO_RESOURCE_END_TAG)
+ {
+ Status = AE_OK;
+ }
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Allocate a buffer for the converted resource */
+
+ Resource = ACPI_ALLOCATE_ZEROED (ListSizeNeeded);
+ CurrentResourcePtr = Resource;
+ if (!Resource)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Perform the AML-to-Resource conversion */
+
+ Status = AcpiUtWalkAmlResources (AmlBuffer, AmlBufferLength,
+ AcpiRsConvertAmlToResources, &CurrentResourcePtr);
+ if (Status == AE_AML_NO_RESOURCE_END_TAG)
+ {
+ Status = AE_OK;
+ }
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (Resource);
+ }
+ else
+ {
+ *ResourcePtr = Resource;
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiRsCreateResourceList
*
* PARAMETERS: AmlBuffer - Pointer to the resource byte stream
diff --git a/usr/src/uts/intel/io/acpica/resources/rsdump.c b/usr/src/uts/intel/io/acpica/resources/rsdump.c
index 5470677447..68564739eb 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsdump.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsdump.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -91,6 +91,11 @@ AcpiRsDumpByteList (
UINT8 *Data);
static void
+AcpiRsDumpWordList (
+ UINT16 Length,
+ UINT16 *Data);
+
+static void
AcpiRsDumpDwordList (
UINT8 Length,
UINT32 *Data);
@@ -289,6 +294,87 @@ ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] =
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (GenericReg.Address), "Address", NULL}
};
+ACPI_RSDUMP_INFO AcpiRsDumpGpio[16] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGpio), "GPIO", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.RevisionId), "RevisionId", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.ConnectionType), "ConnectionType", AcpiGbl_CtDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Gpio.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.PinConfig), "PinConfig", AcpiGbl_PpcDecode},
+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.Sharable), "Sharable", AcpiGbl_ShrDecode},
+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.IoRestriction), "IoRestriction", AcpiGbl_IorDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Gpio.Triggering), "Triggering", AcpiGbl_HeDecode},
+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.Polarity), "Polarity", AcpiGbl_LlDecode},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.DriveStrength), "DriveStrength", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.DebounceTimeout), "DebounceTimeout", NULL},
+ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Gpio.ResourceSource), "ResourceSource", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.PinTableLength), "PinTableLength", NULL},
+ {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (Gpio.PinTable), "PinTable", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.VendorLength), "VendorLength", NULL},
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (Gpio.VendorData), "VendorData", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[4] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedDma), "FixedDma", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedDma.RequestLines), "RequestLines", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedDma.Channels), "Channels", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedDma.Width), "TransferWidth", AcpiGbl_DtsDecode},
+};
+
+#define ACPI_RS_DUMP_COMMON_SERIAL_BUS \
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.RevisionId), "RevisionId", NULL}, \
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.Type), "Type", AcpiGbl_SbtDecode}, \
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, \
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.SlaveMode), "SlaveMode", AcpiGbl_SmDecode}, \
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.TypeRevisionId), "TypeRevisionId", NULL}, \
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.TypeDataLength), "TypeDataLength", NULL}, \
+ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (CommonSerialBus.ResourceSource), "ResourceSource", NULL}, \
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.VendorLength), "VendorLength", NULL}, \
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (CommonSerialBus.VendorData), "VendorData", NULL},
+
+ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[10] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpCommonSerialBus), "Common Serial Bus", NULL},
+ ACPI_RS_DUMP_COMMON_SERIAL_BUS
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[13] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpI2cSerialBus), "I2C Serial Bus", NULL},
+ ACPI_RS_DUMP_COMMON_SERIAL_BUS
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (I2cSerialBus.AccessMode), "AccessMode", AcpiGbl_AmDecode},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (I2cSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (I2cSerialBus.SlaveAddress), "SlaveAddress", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[17] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpSpiSerialBus), "Spi Serial Bus", NULL},
+ ACPI_RS_DUMP_COMMON_SERIAL_BUS
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (SpiSerialBus.WireMode), "WireMode", AcpiGbl_WmDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (SpiSerialBus.DevicePolarity), "DevicePolarity", AcpiGbl_DpDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.DataBitLength), "DataBitLength", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.ClockPhase), "ClockPhase", AcpiGbl_CphDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.ClockPolarity), "ClockPolarity", AcpiGbl_CpoDecode},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (SpiSerialBus.DeviceSelection), "DeviceSelection", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (SpiSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[19] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpUartSerialBus), "Uart Serial Bus", NULL},
+ ACPI_RS_DUMP_COMMON_SERIAL_BUS
+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.FlowControl), "FlowControl", AcpiGbl_FcDecode},
+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.StopBits), "StopBits", AcpiGbl_SbDecode},
+ {ACPI_RSD_3BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.DataBits), "DataBits", AcpiGbl_BpbDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.Endian), "Endian", AcpiGbl_EdDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (UartSerialBus.Parity), "Parity", AcpiGbl_PtDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (UartSerialBus.LinesEnabled), "LinesEnabled", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (UartSerialBus.RxFifoSize), "RxFifoSize", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (UartSerialBus.TxFifoSize), "TxFifoSize", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (UartSerialBus.DefaultBaudRate), "ConnectionSpeed", NULL},
+};
/*
* Tables used for common address descriptor flag fields
@@ -391,7 +477,15 @@ AcpiRsDumpDescriptor (
/* Data items, 8/16/32/64 bit */
case ACPI_RSD_UINT8:
- AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
+ if (Table->Pointer)
+ {
+ AcpiRsOutString (Name, ACPI_CAST_PTR (char,
+ Table->Pointer [*Target]));
+ }
+ else
+ {
+ AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
+ }
break;
case ACPI_RSD_UINT16:
@@ -418,6 +512,11 @@ AcpiRsDumpDescriptor (
Table->Pointer [*Target & 0x03]));
break;
+ case ACPI_RSD_3BITFLAG:
+ AcpiRsOutString (Name, ACPI_CAST_PTR (char,
+ Table->Pointer [*Target & 0x07]));
+ break;
+
case ACPI_RSD_SHORTLIST:
/*
* Short byte list (single line output) for DMA and IRQ resources
@@ -430,6 +529,19 @@ AcpiRsDumpDescriptor (
}
break;
+ case ACPI_RSD_SHORTLISTX:
+ /*
+ * Short byte list (single line output) for GPIO vendor data
+ * Note: The list length is obtained from the previous table entry
+ */
+ if (PreviousTarget)
+ {
+ AcpiRsOutTitle (Name);
+ AcpiRsDumpShortByteList (*PreviousTarget,
+ *(ACPI_CAST_INDIRECT_PTR (UINT8, Target)));
+ }
+ break;
+
case ACPI_RSD_LONGLIST:
/*
* Long byte list for Vendor resource data
@@ -453,6 +565,18 @@ AcpiRsDumpDescriptor (
}
break;
+ case ACPI_RSD_WORDLIST:
+ /*
+ * Word list for GPIO Pin Table
+ * Note: The list length is obtained from the previous table entry
+ */
+ if (PreviousTarget)
+ {
+ AcpiRsDumpWordList (*PreviousTarget,
+ *(ACPI_CAST_INDIRECT_PTR (UINT16, Target)));
+ }
+ break;
+
case ACPI_RSD_ADDRESS:
/*
* Common flags for all Address resources
@@ -613,13 +737,20 @@ AcpiRsDumpResourceList (
/* Dump the resource descriptor */
- AcpiRsDumpDescriptor (&ResourceList->Data,
- AcpiGbl_DumpResourceDispatch[Type]);
+ if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
+ {
+ AcpiRsDumpDescriptor (&ResourceList->Data,
+ AcpiGbl_DumpSerialBusDispatch[ResourceList->Data.CommonSerialBus.Type]);
+ }
+ else
+ {
+ AcpiRsDumpDescriptor (&ResourceList->Data,
+ AcpiGbl_DumpResourceDispatch[Type]);
+ }
/* Point to the next resource structure */
- ResourceList = ACPI_ADD_PTR (ACPI_RESOURCE, ResourceList,
- ResourceList->Length);
+ ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
/* Exit when END_TAG descriptor is reached */
@@ -796,5 +927,20 @@ AcpiRsDumpDwordList (
}
}
+static void
+AcpiRsDumpWordList (
+ UINT16 Length,
+ UINT16 *Data)
+{
+ UINT16 i;
+
+
+ for (i = 0; i < Length; i++)
+ {
+ AcpiOsPrintf ("%25s%2.2X : %4.4X\n",
+ "Word", i, Data[i]);
+ }
+}
+
#endif
diff --git a/usr/src/uts/intel/io/acpica/resources/rsinfo.c b/usr/src/uts/intel/io/acpica/resources/rsinfo.c
index 5753667806..e7287d5455 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsinfo.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,10 @@ ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[] =
AcpiRsConvertAddress64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
AcpiRsConvertExtAddress64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
AcpiRsConvertExtIrq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
- AcpiRsConvertGenericReg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+ AcpiRsConvertGenericReg, /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+ AcpiRsConvertGpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */
+ AcpiRsConvertFixedDma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */
+ NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */
};
/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
@@ -101,7 +104,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] =
AcpiRsConvertEndDpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
AcpiRsConvertIo, /* 0x08, ACPI_RESOURCE_NAME_IO */
AcpiRsConvertFixedIo, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
- NULL, /* 0x0A, Reserved */
+ AcpiRsConvertFixedDma, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
NULL, /* 0x0B, Reserved */
NULL, /* 0x0C, Reserved */
NULL, /* 0x0D, Reserved */
@@ -121,7 +124,20 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] =
AcpiRsConvertAddress16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
AcpiRsConvertExtIrq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
AcpiRsConvertAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
- AcpiRsConvertExtAddress64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
+ AcpiRsConvertExtAddress64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
+ AcpiRsConvertGpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
+ NULL, /* 0x0D, Reserved */
+ NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
+};
+
+/* Subtype table for SerialBus -- I2C, SPI, and UART */
+
+ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[] =
+{
+ NULL,
+ AcpiRsConvertI2cSerialBus,
+ AcpiRsConvertSpiSerialBus,
+ AcpiRsConvertUartSerialBus,
};
@@ -148,6 +164,17 @@ ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[] =
AcpiRsDumpExtAddress64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
AcpiRsDumpExtIrq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
AcpiRsDumpGenericReg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+ AcpiRsDumpGpio, /* ACPI_RESOURCE_TYPE_GPIO */
+ AcpiRsDumpFixedDma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */
+ NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
+};
+
+ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] =
+{
+ NULL,
+ AcpiRsDumpI2cSerialBus, /* AML_RESOURCE_I2C_BUS_TYPE */
+ AcpiRsDumpSpiSerialBus, /* AML_RESOURCE_SPI_BUS_TYPE */
+ AcpiRsDumpUartSerialBus, /* AML_RESOURCE_UART_BUS_TYPE */
};
#endif
@@ -175,7 +202,10 @@ const UINT8 AcpiGbl_AmlResourceSizes[] =
sizeof (AML_RESOURCE_ADDRESS64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),/*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
sizeof (AML_RESOURCE_EXTENDED_IRQ), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
- sizeof (AML_RESOURCE_GENERIC_REGISTER) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+ sizeof (AML_RESOURCE_GENERIC_REGISTER), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
+ sizeof (AML_RESOURCE_GPIO), /* ACPI_RESOURCE_TYPE_GPIO */
+ sizeof (AML_RESOURCE_FIXED_DMA), /* ACPI_RESOURCE_TYPE_FIXED_DMA */
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
};
@@ -193,7 +223,7 @@ const UINT8 AcpiGbl_ResourceStructSizes[] =
ACPI_RS_SIZE_MIN,
ACPI_RS_SIZE (ACPI_RESOURCE_IO),
ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_IO),
- 0,
+ ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA),
0,
0,
0,
@@ -213,6 +243,23 @@ const UINT8 AcpiGbl_ResourceStructSizes[] =
ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS16),
ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ),
ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64),
- ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64)
+ ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64),
+ ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
+ ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS)
+};
+
+const UINT8 AcpiGbl_AmlResourceSerialBusSizes[] =
+{
+ 0,
+ sizeof (AML_RESOURCE_I2C_SERIALBUS),
+ sizeof (AML_RESOURCE_SPI_SERIALBUS),
+ sizeof (AML_RESOURCE_UART_SERIALBUS),
};
+const UINT8 AcpiGbl_ResourceStructSerialBusSizes[] =
+{
+ 0,
+ ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
+ ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
+ ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
+};
diff --git a/usr/src/uts/intel/io/acpica/resources/rsio.c b/usr/src/uts/intel/io/acpica/resources/rsio.c
index 2d0f9f7baa..065108cfa1 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsio.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsio.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/resources/rsirq.c b/usr/src/uts/intel/io/acpica/resources/rsirq.c
index ff952f96ff..c2a88ee89a 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsirq.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsirq.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -274,3 +274,35 @@ ACPI_RSCONVERT_INFO AcpiRsConvertDma[6] =
ACPI_RS_OFFSET (Data.Dma.ChannelCount)}
};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertFixedDma
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[4] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA,
+ ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedDma)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA,
+ sizeof (AML_RESOURCE_FIXED_DMA),
+ 0},
+
+ /*
+ * These fields are contiguous in both the source and destination:
+ * RequestLines
+ * Channels
+ */
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.FixedDma.RequestLines),
+ AML_OFFSET (FixedDma.RequestLines),
+ 2},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.FixedDma.Width),
+ AML_OFFSET (FixedDma.Width),
+ 1},
+
+};
diff --git a/usr/src/uts/intel/io/acpica/resources/rslist.c b/usr/src/uts/intel/io/acpica/resources/rslist.c
index c64065f2ca..187d56cd42 100644
--- a/usr/src/uts/intel/io/acpica/resources/rslist.c
+++ b/usr/src/uts/intel/io/acpica/resources/rslist.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,6 +77,8 @@ AcpiRsConvertAmlToResources (
ACPI_RESOURCE **ResourcePtr = ACPI_CAST_INDIRECT_PTR (
ACPI_RESOURCE, Context);
ACPI_RESOURCE *Resource;
+ AML_RESOURCE *AmlResource;
+ ACPI_RSCONVERT_INFO *ConversionTable;
ACPI_STATUS Status;
@@ -94,11 +96,42 @@ AcpiRsConvertAmlToResources (
"Misaligned resource pointer %p", Resource));
}
- /* Convert the AML byte stream resource to a local resource struct */
+ /* Get the appropriate conversion info table */
+
+ AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml);
+ if (AcpiUtGetResourceType (Aml) == ACPI_RESOURCE_NAME_SERIAL_BUS)
+ {
+ if (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)
+ {
+ ConversionTable = NULL;
+ }
+ else
+ {
+ /* This is an I2C, SPI, or UART SerialBus descriptor */
+
+ ConversionTable =
+ AcpiGbl_ConvertResourceSerialBusDispatch[
+ AmlResource->CommonSerialBus.Type];
+ }
+ }
+ else
+ {
+ ConversionTable =
+ AcpiGbl_GetResourceDispatch[ResourceIndex];
+ }
+
+ if (!ConversionTable)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/unsupported resource descriptor: Type 0x%2.2X",
+ ResourceIndex));
+ return (AE_AML_INVALID_RESOURCE_TYPE);
+ }
+
+ /* Convert the AML byte stream resource to a local resource struct */
Status = AcpiRsConvertAmlToResource (
- Resource, ACPI_CAST_PTR (AML_RESOURCE, Aml),
- AcpiGbl_GetResourceDispatch[ResourceIndex]);
+ Resource, AmlResource, ConversionTable);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -113,7 +146,7 @@ AcpiRsConvertAmlToResources (
/* Point to the next structure in the output buffer */
- *ResourcePtr = ACPI_ADD_PTR (void, Resource, Resource->Length);
+ *ResourcePtr = ACPI_NEXT_RESOURCE (Resource);
return_ACPI_STATUS (AE_OK);
}
@@ -145,6 +178,7 @@ AcpiRsConvertResourcesToAml (
{
UINT8 *Aml = OutputBuffer;
UINT8 *EndAml = OutputBuffer + AmlSizeNeeded;
+ ACPI_RSCONVERT_INFO *ConversionTable;
ACPI_STATUS Status;
@@ -167,9 +201,36 @@ AcpiRsConvertResourcesToAml (
/* Perform the conversion */
+ if (Resource->Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
+ {
+ if (Resource->Data.CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)
+ {
+ ConversionTable = NULL;
+ }
+ else
+ {
+ /* This is an I2C, SPI, or UART SerialBus descriptor */
+
+ ConversionTable = AcpiGbl_ConvertResourceSerialBusDispatch[
+ Resource->Data.CommonSerialBus.Type];
+ }
+ }
+ else
+ {
+ ConversionTable = AcpiGbl_SetResourceDispatch[Resource->Type];
+ }
+
+ if (!ConversionTable)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/unsupported resource descriptor: Type 0x%2.2X",
+ Resource->Type));
+ return (AE_AML_INVALID_RESOURCE_TYPE);
+ }
+
Status = AcpiRsConvertResourceToAml (Resource,
- ACPI_CAST_PTR (AML_RESOURCE, Aml),
- AcpiGbl_SetResourceDispatch[Resource->Type]);
+ ACPI_CAST_PTR (AML_RESOURCE, Aml),
+ ConversionTable);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -204,7 +265,7 @@ AcpiRsConvertResourcesToAml (
/* Point to the next input resource descriptor */
- Resource = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, Resource->Length);
+ Resource = ACPI_NEXT_RESOURCE (Resource);
}
/* Completed buffer, but did not find an EndTag resource descriptor */
diff --git a/usr/src/uts/intel/io/acpica/resources/rsmemory.c b/usr/src/uts/intel/io/acpica/resources/rsmemory.c
index 06262fa64b..83d131956f 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsmemory.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsmemory.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/resources/rsmisc.c b/usr/src/uts/intel/io/acpica/resources/rsmisc.c
index 45415faacc..dfad696ca1 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsmisc.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,11 @@ AcpiRsConvertAmlToResource (
ACPI_FUNCTION_TRACE (RsConvertAmlToResource);
+ if (!Info)
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
if (((ACPI_SIZE) Resource) & 0x3)
{
/* Each internal resource struct is expected to be 32-bit aligned */
@@ -112,7 +117,6 @@ AcpiRsConvertAmlToResource (
* table length (# of table entries)
*/
Count = INIT_TABLE_LENGTH (Info);
-
while (Count)
{
/*
@@ -162,6 +166,15 @@ AcpiRsConvertAmlToResource (
break;
+ case ACPI_RSC_3BITFLAG:
+ /*
+ * Mask and shift the flag bits
+ */
+ ACPI_SET8 (Destination) = (UINT8)
+ ((ACPI_GET8 (Source) >> Info->Value) & 0x07);
+ break;
+
+
case ACPI_RSC_COUNT:
ItemCount = ACPI_GET8 (Source);
@@ -182,6 +195,75 @@ AcpiRsConvertAmlToResource (
break;
+ case ACPI_RSC_COUNT_GPIO_PIN:
+
+ Target = ACPI_ADD_PTR (void, Aml, Info->Value);
+ ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source);
+
+ Resource->Length = Resource->Length + ItemCount;
+ ItemCount = ItemCount / 2;
+ ACPI_SET16 (Destination) = ItemCount;
+ break;
+
+
+ case ACPI_RSC_COUNT_GPIO_VEN:
+
+ ItemCount = ACPI_GET8 (Source);
+ ACPI_SET8 (Destination) = (UINT8) ItemCount;
+
+ Resource->Length = Resource->Length +
+ (Info->Value * ItemCount);
+ break;
+
+
+ case ACPI_RSC_COUNT_GPIO_RES:
+
+ /*
+ * Vendor data is optional (length/offset may both be zero)
+ * Examine vendor data length field first
+ */
+ Target = ACPI_ADD_PTR (void, Aml, (Info->Value + 2));
+ if (ACPI_GET16 (Target))
+ {
+ /* Use vendor offset to get resource source length */
+
+ Target = ACPI_ADD_PTR (void, Aml, Info->Value);
+ ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source);
+ }
+ else
+ {
+ /* No vendor data to worry about */
+
+ ItemCount = Aml->LargeHeader.ResourceLength +
+ sizeof (AML_RESOURCE_LARGE_HEADER) -
+ ACPI_GET16 (Source);
+ }
+
+ Resource->Length = Resource->Length + ItemCount;
+ ACPI_SET16 (Destination) = ItemCount;
+ break;
+
+
+ case ACPI_RSC_COUNT_SERIAL_VEN:
+
+ ItemCount = ACPI_GET16 (Source) - Info->Value;
+
+ Resource->Length = Resource->Length + ItemCount;
+ ACPI_SET16 (Destination) = ItemCount;
+ break;
+
+
+ case ACPI_RSC_COUNT_SERIAL_RES:
+
+ ItemCount = (AmlResourceLength +
+ sizeof (AML_RESOURCE_LARGE_HEADER)) -
+ ACPI_GET16 (Source) - Info->Value;
+
+ Resource->Length = Resource->Length + ItemCount;
+ ACPI_SET16 (Destination) = ItemCount;
+ break;
+
+
case ACPI_RSC_LENGTH:
Resource->Length = Resource->Length + Info->Value;
@@ -204,6 +286,66 @@ AcpiRsConvertAmlToResource (
break;
+ case ACPI_RSC_MOVE_GPIO_PIN:
+
+ /* Generate and set the PIN data pointer */
+
+ Target = (char *) ACPI_ADD_PTR (void, Resource,
+ (Resource->Length - ItemCount * 2));
+ *(UINT16 **) Destination = ACPI_CAST_PTR (UINT16, Target);
+
+ /* Copy the PIN data */
+
+ Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source));
+ AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
+ break;
+
+
+ case ACPI_RSC_MOVE_GPIO_RES:
+
+ /* Generate and set the ResourceSource string pointer */
+
+ Target = (char *) ACPI_ADD_PTR (void, Resource,
+ (Resource->Length - ItemCount));
+ *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target);
+
+ /* Copy the ResourceSource string */
+
+ Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source));
+ AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
+ break;
+
+
+ case ACPI_RSC_MOVE_SERIAL_VEN:
+
+ /* Generate and set the Vendor Data pointer */
+
+ Target = (char *) ACPI_ADD_PTR (void, Resource,
+ (Resource->Length - ItemCount));
+ *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target);
+
+ /* Copy the Vendor Data */
+
+ Source = ACPI_ADD_PTR (void, Aml, Info->Value);
+ AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
+ break;
+
+
+ case ACPI_RSC_MOVE_SERIAL_RES:
+
+ /* Generate and set the ResourceSource string pointer */
+
+ Target = (char *) ACPI_ADD_PTR (void, Resource,
+ (Resource->Length - ItemCount));
+ *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target);
+
+ /* Copy the ResourceSource string */
+
+ Source = ACPI_ADD_PTR (void, Aml, (ACPI_GET16 (Source) + Info->Value));
+ AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode);
+ break;
+
+
case ACPI_RSC_SET8:
ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value);
@@ -243,11 +385,12 @@ AcpiRsConvertAmlToResource (
* Optional ResourceSource (Index and String). This is the more
* complicated case used by the Interrupt() macro
*/
- Target = ACPI_ADD_PTR (char, Resource, Info->AmlOffset + (ItemCount * 4));
+ Target = ACPI_ADD_PTR (char, Resource,
+ Info->AmlOffset + (ItemCount * 4));
Resource->Length +=
- AcpiRsGetResourceSource (AmlResourceLength,
- (ACPI_RS_LENGTH) (((ItemCount - 1) * sizeof (UINT32)) + Info->Value),
+ AcpiRsGetResourceSource (AmlResourceLength, (ACPI_RS_LENGTH)
+ (((ItemCount - 1) * sizeof (UINT32)) + Info->Value),
Destination, Aml, Target);
break;
@@ -356,6 +499,7 @@ AcpiRsConvertResourceToAml (
{
void *Source = NULL;
void *Destination;
+ char *Target;
ACPI_RSDESC_SIZE AmlLength = 0;
UINT8 Count;
UINT16 Temp16 = 0;
@@ -365,6 +509,11 @@ AcpiRsConvertResourceToAml (
ACPI_FUNCTION_TRACE (RsConvertResourceToAml);
+ if (!Info)
+ {
+ return_ACPI_STATUS (AE_BAD_PARAMETER);
+ }
+
/*
* First table entry must be ACPI_RSC_INITxxx and must contain the
* table length (# of table entries)
@@ -420,6 +569,15 @@ AcpiRsConvertResourceToAml (
break;
+ case ACPI_RSC_3BITFLAG:
+ /*
+ * Mask and shift the flag bits
+ */
+ ACPI_SET8 (Destination) |= (UINT8)
+ ((ACPI_GET8 (Source) & 0x07) << Info->Value);
+ break;
+
+
case ACPI_RSC_COUNT:
ItemCount = ACPI_GET8 (Source);
@@ -437,6 +595,68 @@ AcpiRsConvertResourceToAml (
break;
+ case ACPI_RSC_COUNT_GPIO_PIN:
+
+ ItemCount = ACPI_GET16 (Source);
+ ACPI_SET16 (Destination) = (UINT16) AmlLength;
+
+ AmlLength = (UINT16) (AmlLength + ItemCount * 2);
+ Target = ACPI_ADD_PTR (void, Aml, Info->Value);
+ ACPI_SET16 (Target) = (UINT16) AmlLength;
+ AcpiRsSetResourceLength (AmlLength, Aml);
+ break;
+
+
+ case ACPI_RSC_COUNT_GPIO_VEN:
+
+ ItemCount = ACPI_GET16 (Source);
+ ACPI_SET16 (Destination) = (UINT16) ItemCount;
+
+ AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount));
+ AcpiRsSetResourceLength (AmlLength, Aml);
+ break;
+
+
+ case ACPI_RSC_COUNT_GPIO_RES:
+
+ /* Set resource source string length */
+
+ ItemCount = ACPI_GET16 (Source);
+ ACPI_SET16 (Destination) = (UINT16) AmlLength;
+
+ /* Compute offset for the Vendor Data */
+
+ AmlLength = (UINT16) (AmlLength + ItemCount);
+ Target = ACPI_ADD_PTR (void, Aml, Info->Value);
+
+ /* Set vendor offset only if there is vendor data */
+
+ if (Resource->Data.Gpio.VendorLength)
+ {
+ ACPI_SET16 (Target) = (UINT16) AmlLength;
+ }
+
+ AcpiRsSetResourceLength (AmlLength, Aml);
+ break;
+
+
+ case ACPI_RSC_COUNT_SERIAL_VEN:
+
+ ItemCount = ACPI_GET16 (Source);
+ ACPI_SET16 (Destination) = ItemCount + Info->Value;
+ AmlLength = (UINT16) (AmlLength + ItemCount);
+ AcpiRsSetResourceLength (AmlLength, Aml);
+ break;
+
+
+ case ACPI_RSC_COUNT_SERIAL_RES:
+
+ ItemCount = ACPI_GET16 (Source);
+ AmlLength = (UINT16) (AmlLength + ItemCount);
+ AcpiRsSetResourceLength (AmlLength, Aml);
+ break;
+
+
case ACPI_RSC_LENGTH:
AcpiRsSetResourceLength (Info->Value, Aml);
@@ -456,6 +676,44 @@ AcpiRsConvertResourceToAml (
break;
+ case ACPI_RSC_MOVE_GPIO_PIN:
+
+ Destination = (char *) ACPI_ADD_PTR (void, Aml,
+ ACPI_GET16 (Destination));
+ Source = * (UINT16 **) Source;
+ AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
+ break;
+
+
+ case ACPI_RSC_MOVE_GPIO_RES:
+
+ /* Used for both ResourceSource string and VendorData */
+
+ Destination = (char *) ACPI_ADD_PTR (void, Aml,
+ ACPI_GET16 (Destination));
+ Source = * (UINT8 **) Source;
+ AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
+ break;
+
+
+ case ACPI_RSC_MOVE_SERIAL_VEN:
+
+ Destination = (char *) ACPI_ADD_PTR (void, Aml,
+ (AmlLength - ItemCount));
+ Source = * (UINT8 **) Source;
+ AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
+ break;
+
+
+ case ACPI_RSC_MOVE_SERIAL_RES:
+
+ Destination = (char *) ACPI_ADD_PTR (void, Aml,
+ (AmlLength - ItemCount));
+ Source = * (UINT8 **) Source;
+ AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode);
+ break;
+
+
case ACPI_RSC_ADDRESS:
/* Set the Resource Type, General Flags, and Type-Specific Flags */
diff --git a/usr/src/uts/intel/io/acpica/resources/rsserial.c b/usr/src/uts/intel/io/acpica/resources/rsserial.c
new file mode 100644
index 0000000000..3a7784e96c
--- /dev/null
+++ b/usr/src/uts/intel/io/acpica/resources/rsserial.c
@@ -0,0 +1,425 @@
+/*******************************************************************************
+ *
+ * Module Name: rsserial - GPIO/SerialBus resource descriptors
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __RSIRQ_C__
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acresrc.h"
+
+#define _COMPONENT ACPI_RESOURCES
+ ACPI_MODULE_NAME ("rsserial")
+
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertGpio
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertGpio[17] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO,
+ ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO,
+ sizeof (AML_RESOURCE_GPIO),
+ 0},
+
+ /*
+ * These fields are contiguous in both the source and destination:
+ * RevisionId
+ * ConnectionType
+ */
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.RevisionId),
+ AML_OFFSET (Gpio.RevisionId),
+ 2},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer),
+ AML_OFFSET (Gpio.Flags),
+ 0},
+
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Sharable),
+ AML_OFFSET (Gpio.IntFlags),
+ 3},
+
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction),
+ AML_OFFSET (Gpio.IntFlags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering),
+ AML_OFFSET (Gpio.IntFlags),
+ 0},
+
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity),
+ AML_OFFSET (Gpio.IntFlags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.PinConfig),
+ AML_OFFSET (Gpio.PinConfig),
+ 1},
+
+ /*
+ * These fields are contiguous in both the source and destination:
+ * DriveStrength
+ * DebounceTimeout
+ */
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Gpio.DriveStrength),
+ AML_OFFSET (Gpio.DriveStrength),
+ 2},
+
+ /* Pin Table */
+
+ {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength),
+ AML_OFFSET (Gpio.PinTableOffset),
+ AML_OFFSET (Gpio.ResSourceOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable),
+ AML_OFFSET (Gpio.PinTableOffset),
+ 0},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index),
+ AML_OFFSET (Gpio.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength),
+ AML_OFFSET (Gpio.ResSourceOffset),
+ AML_OFFSET (Gpio.VendorOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr),
+ AML_OFFSET (Gpio.ResSourceOffset),
+ 0},
+
+ /* Vendor Data */
+
+ {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.Gpio.VendorLength),
+ AML_OFFSET (Gpio.VendorLength),
+ 1},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.VendorData),
+ AML_OFFSET (Gpio.VendorOffset),
+ 0},
+};
+
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertI2cSerialBus
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[16] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
+ ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
+ sizeof (AML_RESOURCE_I2C_SERIALBUS),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
+ AML_OFFSET (CommonSerialBus.RevisionId),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
+ AML_OFFSET (CommonSerialBus.Type),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
+ AML_OFFSET (CommonSerialBus.Flags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
+ AML_OFFSET (CommonSerialBus.Flags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
+ AML_OFFSET (CommonSerialBus.TypeRevisionId),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ 1},
+
+ /* Vendor data */
+
+ {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ AML_RESOURCE_I2C_MIN_DATA_LEN},
+
+ {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
+ 0,
+ sizeof (AML_RESOURCE_I2C_SERIALBUS)},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
+ AML_OFFSET (CommonSerialBus.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
+
+ {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
+
+ /* I2C bus type specific */
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode),
+ AML_OFFSET (I2cSerialBus.TypeSpecificFlags),
+ 0},
+
+ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed),
+ AML_OFFSET (I2cSerialBus.ConnectionSpeed),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress),
+ AML_OFFSET (I2cSerialBus.SlaveAddress),
+ 1},
+};
+
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertSpiSerialBus
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[20] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
+ ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
+ sizeof (AML_RESOURCE_SPI_SERIALBUS),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
+ AML_OFFSET (CommonSerialBus.RevisionId),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
+ AML_OFFSET (CommonSerialBus.Type),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
+ AML_OFFSET (CommonSerialBus.Flags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
+ AML_OFFSET (CommonSerialBus.Flags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
+ AML_OFFSET (CommonSerialBus.TypeRevisionId),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ 1},
+
+ /* Vendor data */
+
+ {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ AML_RESOURCE_SPI_MIN_DATA_LEN},
+
+ {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
+ 0,
+ sizeof (AML_RESOURCE_SPI_SERIALBUS)},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
+ AML_OFFSET (CommonSerialBus.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
+
+ {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
+
+ /* Spi bus type specific */
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode),
+ AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity),
+ AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength),
+ AML_OFFSET (SpiSerialBus.DataBitLength),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase),
+ AML_OFFSET (SpiSerialBus.ClockPhase),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity),
+ AML_OFFSET (SpiSerialBus.ClockPolarity),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection),
+ AML_OFFSET (SpiSerialBus.DeviceSelection),
+ 1},
+
+ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed),
+ AML_OFFSET (SpiSerialBus.ConnectionSpeed),
+ 1},
+};
+
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertUartSerialBus
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[22] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
+ ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
+ sizeof (AML_RESOURCE_UART_SERIALBUS),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
+ AML_OFFSET (CommonSerialBus.RevisionId),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
+ AML_OFFSET (CommonSerialBus.Type),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
+ AML_OFFSET (CommonSerialBus.Flags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
+ AML_OFFSET (CommonSerialBus.Flags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
+ AML_OFFSET (CommonSerialBus.TypeRevisionId),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ 1},
+
+ /* Vendor data */
+
+ {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ AML_RESOURCE_UART_MIN_DATA_LEN},
+
+ {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
+ 0,
+ sizeof (AML_RESOURCE_UART_SERIALBUS)},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
+ AML_OFFSET (CommonSerialBus.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
+
+ {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
+ AML_OFFSET (CommonSerialBus.TypeDataLength),
+ sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
+
+ /* Uart bus type specific */
+
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl),
+ AML_OFFSET (UartSerialBus.TypeSpecificFlags),
+ 0},
+
+ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits),
+ AML_OFFSET (UartSerialBus.TypeSpecificFlags),
+ 2},
+
+ {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits),
+ AML_OFFSET (UartSerialBus.TypeSpecificFlags),
+ 4},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian),
+ AML_OFFSET (UartSerialBus.TypeSpecificFlags),
+ 7},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.Parity),
+ AML_OFFSET (UartSerialBus.Parity),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled),
+ AML_OFFSET (UartSerialBus.LinesEnabled),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize),
+ AML_OFFSET (UartSerialBus.RxFifoSize),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize),
+ AML_OFFSET (UartSerialBus.TxFifoSize),
+ 1},
+
+ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate),
+ AML_OFFSET (UartSerialBus.DefaultBaudRate),
+ 1},
+};
diff --git a/usr/src/uts/intel/io/acpica/resources/rsutils.c b/usr/src/uts/intel/io/acpica/resources/rsutils.c
index 400bbcd91f..062678651e 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsutils.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -173,6 +173,9 @@ AcpiRsMoveData (
* since there are no alignment or endian issues
*/
case ACPI_RSC_MOVE8:
+ case ACPI_RSC_MOVE_GPIO_RES:
+ case ACPI_RSC_MOVE_SERIAL_VEN:
+ case ACPI_RSC_MOVE_SERIAL_RES:
ACPI_MEMCPY (Destination, Source, ItemCount);
return;
@@ -182,6 +185,7 @@ AcpiRsMoveData (
* misaligned memory transfers
*/
case ACPI_RSC_MOVE16:
+ case ACPI_RSC_MOVE_GPIO_PIN:
ACPI_MOVE_16_TO_16 (&ACPI_CAST_PTR (UINT16, Destination)[i],
&ACPI_CAST_PTR (UINT16, Source)[i]);
break;
@@ -653,6 +657,61 @@ AcpiRsGetPrsMethodData (
/*******************************************************************************
*
+ * FUNCTION: AcpiRsGetAeiMethodData
+ *
+ * PARAMETERS: Node - Device node
+ * RetBuffer - Pointer to a buffer structure for the
+ * results
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to get the _AEI value of an object
+ * contained in an object specified by the handle passed in
+ *
+ * If the function fails an appropriate status will be returned
+ * and the contents of the callers buffer is undefined.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiRsGetAeiMethodData (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_BUFFER *RetBuffer)
+{
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (RsGetAeiMethodData);
+
+
+ /* Parameters guaranteed valid by caller */
+
+ /* Execute the method, no parameters */
+
+ Status = AcpiUtEvaluateObject (Node, METHOD_NAME__AEI,
+ ACPI_BTYPE_BUFFER, &ObjDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /*
+ * Make the call to create a resource linked list from the
+ * byte stream buffer that comes back from the _CRS method
+ * execution.
+ */
+ Status = AcpiRsCreateResourceList (ObjDesc, RetBuffer);
+
+ /* On exit, we must delete the object returned by evaluateObject */
+
+ AcpiUtRemoveReference (ObjDesc);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiRsGetMethodData
*
* PARAMETERS: Handle - Handle to the containing object
diff --git a/usr/src/uts/intel/io/acpica/resources/rsxface.c b/usr/src/uts/intel/io/acpica/resources/rsxface.c
index 0aea206b73..d8c3938b31 100644
--- a/usr/src/uts/intel/io/acpica/resources/rsxface.c
+++ b/usr/src/uts/intel/io/acpica/resources/rsxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -351,6 +351,52 @@ AcpiSetCurrentResources (
ACPI_EXPORT_SYMBOL (AcpiSetCurrentResources)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiGetEventResources
+ *
+ * PARAMETERS: DeviceHandle - Handle to the device object for the
+ * device we are getting resources
+ * InBuffer - Pointer to a buffer containing the
+ * resources to be set for the device
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to get the event resources for a
+ * specific device. The caller must first acquire a handle for
+ * the desired device. The resource data is passed to the routine
+ * the buffer pointed to by the InBuffer variable. Uses the
+ * _AEI method.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiGetEventResources (
+ ACPI_HANDLE DeviceHandle,
+ ACPI_BUFFER *RetBuffer)
+{
+ ACPI_STATUS Status;
+ ACPI_NAMESPACE_NODE *Node;
+
+
+ ACPI_FUNCTION_TRACE (AcpiGetEventResources);
+
+
+ /* Validate parameters then dispatch to internal routine */
+
+ Status = AcpiRsValidateParameters (DeviceHandle, RetBuffer, &Node);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ Status = AcpiRsGetAeiMethodData (Node, RetBuffer);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiGetEventResources)
+
+
/******************************************************************************
*
* FUNCTION: AcpiResourceToAddress64
@@ -544,8 +590,9 @@ AcpiRsMatchVendorResource (
*
* PARAMETERS: DeviceHandle - Handle to the device object for the
* device we are querying
- * Name - Method name of the resources we want
- * (METHOD_NAME__CRS or METHOD_NAME__PRS)
+ * Name - Method name of the resources we want.
+ * (METHOD_NAME__CRS, METHOD_NAME__PRS, or
+ * METHOD_NAME__AEI)
* UserFunction - Called for each resource
* Context - Passed to UserFunction
*
@@ -577,12 +624,13 @@ AcpiWalkResources (
if (!DeviceHandle || !UserFunction || !Name ||
(!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) &&
- !ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS)))
+ !ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS) &&
+ !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI)))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the _CRS or _PRS resource list */
+ /* Get the _CRS/_PRS/_AEI resource list */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer);
diff --git a/usr/src/uts/intel/io/acpica/tables/tbfadt.c b/usr/src/uts/intel/io/acpica/tables/tbfadt.c
index f8c63408b9..e877320447 100644
--- a/usr/src/uts/intel/io/acpica/tables/tbfadt.c
+++ b/usr/src/uts/intel/io/acpica/tables/tbfadt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,14 +77,15 @@ AcpiTbSetupFadtRegisters (
typedef struct acpi_fadt_info
{
char *Name;
- UINT8 Address64;
- UINT8 Address32;
- UINT8 Length;
+ UINT16 Address64;
+ UINT16 Address32;
+ UINT16 Length;
UINT8 DefaultLength;
UINT8 Type;
} ACPI_FADT_INFO;
+#define ACPI_FADT_OPTIONAL 0
#define ACPI_FADT_REQUIRED 1
#define ACPI_FADT_SEPARATE_LENGTH 2
@@ -102,7 +103,7 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (Pm1bEventBlock),
ACPI_FADT_OFFSET (Pm1EventLength),
ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */
- 0},
+ ACPI_FADT_OPTIONAL},
{"Pm1aControlBlock",
ACPI_FADT_OFFSET (XPm1aControlBlock),
@@ -116,7 +117,7 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (Pm1bControlBlock),
ACPI_FADT_OFFSET (Pm1ControlLength),
ACPI_PM1_REGISTER_WIDTH,
- 0},
+ ACPI_FADT_OPTIONAL},
{"Pm2ControlBlock",
ACPI_FADT_OFFSET (XPm2ControlBlock),
@@ -156,7 +157,7 @@ static ACPI_FADT_INFO FadtInfoTable[] =
typedef struct acpi_fadt_pm_info
{
ACPI_GENERIC_ADDRESS *Target;
- UINT8 Source;
+ UINT16 Source;
UINT8 RegisterNum;
} ACPI_FADT_PM_INFO;
@@ -280,8 +281,13 @@ AcpiTbParseFadt (
AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt,
ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
- AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
- ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+ /* If Hardware Reduced flag is set, there is no FACS */
+
+ if (!AcpiGbl_ReducedHardware)
+ {
+ AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
+ ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+ }
}
@@ -309,13 +315,13 @@ AcpiTbCreateLocalFadt (
/*
* Check if the FADT is larger than the largest table that we expect
- * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
+ * (the ACPI 5.0 version). If so, truncate the table, and issue
* a warning.
*/
if (Length > sizeof (ACPI_TABLE_FADT))
{
ACPI_WARNING ((AE_INFO,
- "FADT (revision %u) is longer than ACPI 2.0 version, "
+ "FADT (revision %u) is longer than ACPI 5.0 version, "
"truncating length %u to %u",
Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT)));
}
@@ -329,6 +335,14 @@ AcpiTbCreateLocalFadt (
ACPI_MEMCPY (&AcpiGbl_FADT, Table,
ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT)));
+ /* Take a copy of the Hardware Reduced flag */
+
+ AcpiGbl_ReducedHardware = FALSE;
+ if (AcpiGbl_FADT.Flags & ACPI_FADT_HW_REDUCED)
+ {
+ AcpiGbl_ReducedHardware = TRUE;
+ }
+
/* Convert the local copy of the FADT to the common internal format */
AcpiTbConvertFadt ();
@@ -386,10 +400,6 @@ AcpiTbConvertFadt (
UINT32 i;
- /* Update the local FADT table header length */
-
- AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
-
/*
* Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
* Later code will always use the X 64-bit field.
@@ -423,6 +433,13 @@ AcpiTbConvertFadt (
}
/*
+ * Now we can update the local FADT length to the length of the
+ * current FADT version as defined by the ACPI specification.
+ * Thus, we will have a common FADT internally.
+ */
+ AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
+
+ /*
* Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
* generic address structures as necessary. Later code will always use
* the 64-bit address structures.
@@ -530,6 +547,13 @@ AcpiTbValidateFadt (
AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
}
+ /* If Hardware Reduced flag is set, we are all done */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return;
+ }
+
/* Examine all of the 64-bit extended address fields (X fields) */
for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
diff --git a/usr/src/uts/intel/io/acpica/tables/tbfind.c b/usr/src/uts/intel/io/acpica/tables/tbfind.c
index 3b7c420f01..d7e2440b32 100644
--- a/usr/src/uts/intel/io/acpica/tables/tbfind.c
+++ b/usr/src/uts/intel/io/acpica/tables/tbfind.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/tables/tbinstal.c b/usr/src/uts/intel/io/acpica/tables/tbinstal.c
index ab69691a1e..f100ab43f7 100644
--- a/usr/src/uts/intel/io/acpica/tables/tbinstal.c
+++ b/usr/src/uts/intel/io/acpica/tables/tbinstal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -128,7 +128,6 @@ AcpiTbAddTable (
{
UINT32 i;
ACPI_STATUS Status = AE_OK;
- ACPI_TABLE_HEADER *OverrideTable = NULL;
ACPI_FUNCTION_TRACE (TbAddTable);
@@ -242,26 +241,10 @@ AcpiTbAddTable (
/*
* ACPI Table Override:
* Allow the host to override dynamically loaded tables.
+ * NOTE: the table is fully mapped at this point, and the mapping will
+ * be deleted by TbTableOverride if the table is actually overridden.
*/
- Status = AcpiOsTableOverride (TableDesc->Pointer, &OverrideTable);
- if (ACPI_SUCCESS (Status) && OverrideTable)
- {
- ACPI_INFO ((AE_INFO,
- "%4.4s @ 0x%p Table override, replaced with:",
- TableDesc->Pointer->Signature,
- ACPI_CAST_PTR (void, TableDesc->Address)));
-
- /* We can delete the table that was passed as a parameter */
-
- AcpiTbDeleteTable (TableDesc);
-
- /* Setup descriptor for the new table */
-
- TableDesc->Address = ACPI_PTR_TO_PHYSADDR (OverrideTable);
- TableDesc->Pointer = OverrideTable;
- TableDesc->Length = OverrideTable->Length;
- TableDesc->Flags = ACPI_TABLE_ORIGIN_OVERRIDE;
- }
+ (void) AcpiTbTableOverride (TableDesc->Pointer, TableDesc);
/* Add the table to the global root table list */
@@ -283,6 +266,98 @@ Release:
/*******************************************************************************
*
+ * FUNCTION: AcpiTbTableOverride
+ *
+ * PARAMETERS: TableHeader - Header for the original table
+ * TableDesc - Table descriptor initialized for the
+ * original table. May or may not be mapped.
+ *
+ * RETURN: Pointer to the entire new table. NULL if table not overridden.
+ * If overridden, installs the new table within the input table
+ * descriptor.
+ *
+ * DESCRIPTION: Attempt table override by calling the OSL override functions.
+ * Note: If the table is overridden, then the entire new table
+ * is mapped and returned by this function.
+ *
+ ******************************************************************************/
+
+ACPI_TABLE_HEADER *
+AcpiTbTableOverride (
+ ACPI_TABLE_HEADER *TableHeader,
+ ACPI_TABLE_DESC *TableDesc)
+{
+ ACPI_STATUS Status;
+ ACPI_TABLE_HEADER *NewTable = NULL;
+ ACPI_PHYSICAL_ADDRESS NewAddress = 0;
+ UINT32 NewTableLength = 0;
+ UINT8 NewFlags;
+ char *OverrideType;
+
+
+ /* (1) Attempt logical override (returns a logical address) */
+
+ Status = AcpiOsTableOverride (TableHeader, &NewTable);
+ if (ACPI_SUCCESS (Status) && NewTable)
+ {
+ NewAddress = ACPI_PTR_TO_PHYSADDR (NewTable);
+ NewTableLength = NewTable->Length;
+ NewFlags = ACPI_TABLE_ORIGIN_OVERRIDE;
+ OverrideType = "Logical";
+ goto FinishOverride;
+ }
+
+ /* (2) Attempt physical override (returns a physical address) */
+
+ Status = AcpiOsPhysicalTableOverride (TableHeader,
+ &NewAddress, &NewTableLength);
+ if (ACPI_SUCCESS (Status) && NewAddress && NewTableLength)
+ {
+ /* Map the entire new table */
+
+ NewTable = AcpiOsMapMemory (NewAddress, NewTableLength);
+ if (!NewTable)
+ {
+ ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+ "%4.4s %p Attempted physical table override failed",
+ TableHeader->Signature,
+ ACPI_CAST_PTR (void, TableDesc->Address)));
+ return (NULL);
+ }
+
+ OverrideType = "Physical";
+ NewFlags = ACPI_TABLE_ORIGIN_MAPPED;
+ goto FinishOverride;
+ }
+
+ return (NULL); /* There was no override */
+
+
+FinishOverride:
+
+ ACPI_INFO ((AE_INFO,
+ "%4.4s %p %s table override, new table: %p",
+ TableHeader->Signature,
+ ACPI_CAST_PTR (void, TableDesc->Address),
+ OverrideType, NewTable));
+
+ /* We can now unmap/delete the original table (if fully mapped) */
+
+ AcpiTbDeleteTable (TableDesc);
+
+ /* Setup descriptor for the new table */
+
+ TableDesc->Address = NewAddress;
+ TableDesc->Pointer = NewTable;
+ TableDesc->Length = NewTableLength;
+ TableDesc->Flags = NewFlags;
+
+ return (NewTable);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTbResizeRootTableList
*
* PARAMETERS: None
@@ -435,8 +510,10 @@ AcpiTbDeleteTable (
ACPI_FREE (TableDesc->Pointer);
break;
+ /* Not mapped or allocated, there is nothing we can do */
+
default:
- break;
+ return;
}
TableDesc->Pointer = NULL;
diff --git a/usr/src/uts/intel/io/acpica/tables/tbutils.c b/usr/src/uts/intel/io/acpica/tables/tbutils.c
index bff6540e07..e8b5705e96 100644
--- a/usr/src/uts/intel/io/acpica/tables/tbutils.c
+++ b/usr/src/uts/intel/io/acpica/tables/tbutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,7 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbutils")
+
/* Local prototypes */
static void
@@ -68,6 +69,7 @@ AcpiTbGetRootTableEntry (
UINT32 TableEntrySize);
+#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiTbInitializeFacs
@@ -88,10 +90,19 @@ AcpiTbInitializeFacs (
ACPI_STATUS Status;
+ /* If Hardware Reduced flag is set, there is no FACS */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ AcpiGbl_FACS = NULL;
+ return (AE_OK);
+ }
+
Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS,
ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS));
return (Status);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
@@ -415,7 +426,7 @@ AcpiTbCopyDsdt (
* RETURN: None
*
* DESCRIPTION: Install an ACPI table into the global data structure. The
- * table override mechanism is implemented here to allow the host
+ * table override mechanism is called to allow the host
* OS to replace any table before it is installed in the root
* table array.
*
@@ -427,11 +438,9 @@ AcpiTbInstallTable (
char *Signature,
UINT32 TableIndex)
{
- UINT8 Flags;
- ACPI_STATUS Status;
- ACPI_TABLE_HEADER *TableToInstall;
- ACPI_TABLE_HEADER *MappedTable;
- ACPI_TABLE_HEADER *OverrideTable = NULL;
+ ACPI_TABLE_HEADER *Table;
+ ACPI_TABLE_HEADER *FinalTable;
+ ACPI_TABLE_DESC *TableDesc;
if (!Address)
@@ -443,70 +452,84 @@ AcpiTbInstallTable (
/* Map just the table header */
- MappedTable = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
- if (!MappedTable)
+ Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
+ if (!Table)
{
+ ACPI_ERROR ((AE_INFO, "Could not map memory for table [%s] at %p",
+ Signature, ACPI_CAST_PTR (void, Address)));
return;
}
/* If a particular signature is expected (DSDT/FACS), it must match */
if (Signature &&
- !ACPI_COMPARE_NAME (MappedTable->Signature, Signature))
+ !ACPI_COMPARE_NAME (Table->Signature, Signature))
{
ACPI_ERROR ((AE_INFO,
"Invalid signature 0x%X for ACPI table, expected [%s]",
- *ACPI_CAST_PTR (UINT32, MappedTable->Signature), Signature));
+ *ACPI_CAST_PTR (UINT32, Table->Signature), Signature));
goto UnmapAndExit;
}
/*
+ * Initialize the table entry. Set the pointer to NULL, since the
+ * table is not fully mapped at this time.
+ */
+ TableDesc = &AcpiGbl_RootTableList.Tables[TableIndex];
+
+ TableDesc->Address = Address;
+ TableDesc->Pointer = NULL;
+ TableDesc->Length = Table->Length;
+ TableDesc->Flags = ACPI_TABLE_ORIGIN_MAPPED;
+ ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);
+
+ /*
* ACPI Table Override:
*
* Before we install the table, let the host OS override it with a new
* one if desired. Any table within the RSDT/XSDT can be replaced,
* including the DSDT which is pointed to by the FADT.
+ *
+ * NOTE: If the table is overridden, then FinalTable will contain a
+ * mapped pointer to the full new table. If the table is not overridden,
+ * or if there has been a physical override, then the table will be
+ * fully mapped later (in verify table). In any case, we must
+ * unmap the header that was mapped above.
*/
- Status = AcpiOsTableOverride (MappedTable, &OverrideTable);
- if (ACPI_SUCCESS (Status) && OverrideTable)
+ FinalTable = AcpiTbTableOverride (Table, TableDesc);
+ if (!FinalTable)
{
- ACPI_INFO ((AE_INFO,
- "%4.4s @ 0x%p Table override, replaced with:",
- MappedTable->Signature, ACPI_CAST_PTR (void, Address)));
-
- AcpiGbl_RootTableList.Tables[TableIndex].Pointer = OverrideTable;
- Address = ACPI_PTR_TO_PHYSADDR (OverrideTable);
-
- TableToInstall = OverrideTable;
- Flags = ACPI_TABLE_ORIGIN_OVERRIDE;
- }
- else
- {
- TableToInstall = MappedTable;
- Flags = ACPI_TABLE_ORIGIN_MAPPED;
+ FinalTable = Table; /* There was no override */
}
- /* Initialize the table entry */
-
- AcpiGbl_RootTableList.Tables[TableIndex].Address = Address;
- AcpiGbl_RootTableList.Tables[TableIndex].Length = TableToInstall->Length;
- AcpiGbl_RootTableList.Tables[TableIndex].Flags = Flags;
-
- ACPI_MOVE_32_TO_32 (
- &(AcpiGbl_RootTableList.Tables[TableIndex].Signature),
- TableToInstall->Signature);
+ AcpiTbPrintTableHeader (TableDesc->Address, FinalTable);
- AcpiTbPrintTableHeader (Address, TableToInstall);
+ /* Set the global integer width (based upon revision of the DSDT) */
if (TableIndex == ACPI_TABLE_INDEX_DSDT)
{
- /* Global integer width is based upon revision of the DSDT */
+ AcpiUtSetIntegerWidth (FinalTable->Revision);
+ }
- AcpiUtSetIntegerWidth (TableToInstall->Revision);
+ /*
+ * If we have a physical override during this early loading of the ACPI
+ * tables, unmap the table for now. It will be mapped again later when
+ * it is actually used. This supports very early loading of ACPI tables,
+ * before virtual memory is fully initialized and running within the
+ * host OS. Note: A logical override has the ACPI_TABLE_ORIGIN_OVERRIDE
+ * flag set and will not be deleted below.
+ */
+ if (FinalTable != Table)
+ {
+ AcpiTbDeleteTable (TableDesc);
}
+
UnmapAndExit:
- AcpiOsUnmapMemory (MappedTable, sizeof (ACPI_TABLE_HEADER));
+
+ /* Always unmap the table header that we mapped above */
+
+ AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
}
diff --git a/usr/src/uts/intel/io/acpica/tables/tbxface.c b/usr/src/uts/intel/io/acpica/tables/tbxface.c
index 465bf95c64..58dae6935d 100644
--- a/usr/src/uts/intel/io/acpica/tables/tbxface.c
+++ b/usr/src/uts/intel/io/acpica/tables/tbxface.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/tables/tbxfroot.c b/usr/src/uts/intel/io/acpica/tables/tbxfroot.c
index e447108ebe..17e52ef7f4 100644
--- a/usr/src/uts/intel/io/acpica/tables/tbxfroot.c
+++ b/usr/src/uts/intel/io/acpica/tables/tbxfroot.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utaddress.c b/usr/src/uts/intel/io/acpica/utilities/utaddress.c
new file mode 100644
index 0000000000..0b357b681b
--- /dev/null
+++ b/usr/src/uts/intel/io/acpica/utilities/utaddress.c
@@ -0,0 +1,322 @@
+/******************************************************************************
+ *
+ * Module Name: utaddress - OpRegion address range check
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __UTADDRESS_C__
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acnamesp.h"
+
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utaddress")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtAddAddressRange
+ *
+ * PARAMETERS: SpaceId - Address space ID
+ * Address - OpRegion start address
+ * Length - OpRegion length
+ * RegionNode - OpRegion namespace node
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Add the Operation Region address range to the global list.
+ * The only supported Space IDs are Memory and I/O. Called when
+ * the OpRegion address/length operands are fully evaluated.
+ *
+ * MUTEX: Locks the namespace
+ *
+ * NOTE: Because this interface is only called when an OpRegion argument
+ * list is evaluated, there cannot be any duplicate RegionNodes.
+ * Duplicate Address/Length values are allowed, however, so that multiple
+ * address conflicts can be detected.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtAddAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT32 Length,
+ ACPI_NAMESPACE_NODE *RegionNode)
+{
+ ACPI_ADDRESS_RANGE *RangeInfo;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (UtAddAddressRange);
+
+
+ if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
+ (SpaceId != ACPI_ADR_SPACE_SYSTEM_IO))
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
+ /* Allocate/init a new info block, add it to the appropriate list */
+
+ RangeInfo = ACPI_ALLOCATE (sizeof (ACPI_ADDRESS_RANGE));
+ if (!RangeInfo)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ RangeInfo->StartAddress = Address;
+ RangeInfo->EndAddress = (Address + Length - 1);
+ RangeInfo->RegionNode = RegionNode;
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (RangeInfo);
+ return_ACPI_STATUS (Status);
+ }
+
+ RangeInfo->Next = AcpiGbl_AddressRangeList[SpaceId];
+ AcpiGbl_AddressRangeList[SpaceId] = RangeInfo;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "\nAdded [%4.4s] address range: 0x%p-0x%p\n",
+ AcpiUtGetNodeName (RangeInfo->RegionNode),
+ ACPI_CAST_PTR (void, Address),
+ ACPI_CAST_PTR (void, RangeInfo->EndAddress)));
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtRemoveAddressRange
+ *
+ * PARAMETERS: SpaceId - Address space ID
+ * RegionNode - OpRegion namespace node
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Remove the Operation Region from the global list. The only
+ * supported Space IDs are Memory and I/O. Called when an
+ * OpRegion is deleted.
+ *
+ * MUTEX: Assumes the namespace is locked
+ *
+ ******************************************************************************/
+
+void
+AcpiUtRemoveAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_NAMESPACE_NODE *RegionNode)
+{
+ ACPI_ADDRESS_RANGE *RangeInfo;
+ ACPI_ADDRESS_RANGE *Prev;
+
+
+ ACPI_FUNCTION_TRACE (UtRemoveAddressRange);
+
+
+ if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
+ (SpaceId != ACPI_ADR_SPACE_SYSTEM_IO))
+ {
+ return_VOID;
+ }
+
+ /* Get the appropriate list head and check the list */
+
+ RangeInfo = Prev = AcpiGbl_AddressRangeList[SpaceId];
+ while (RangeInfo)
+ {
+ if (RangeInfo->RegionNode == RegionNode)
+ {
+ if (RangeInfo == Prev) /* Found at list head */
+ {
+ AcpiGbl_AddressRangeList[SpaceId] = RangeInfo->Next;
+ }
+ else
+ {
+ Prev->Next = RangeInfo->Next;
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "\nRemoved [%4.4s] address range: 0x%p-0x%p\n",
+ AcpiUtGetNodeName (RangeInfo->RegionNode),
+ ACPI_CAST_PTR (void, RangeInfo->StartAddress),
+ ACPI_CAST_PTR (void, RangeInfo->EndAddress)));
+
+ ACPI_FREE (RangeInfo);
+ return_VOID;
+ }
+
+ Prev = RangeInfo;
+ RangeInfo = RangeInfo->Next;
+ }
+
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtCheckAddressRange
+ *
+ * PARAMETERS: SpaceId - Address space ID
+ * Address - Start address
+ * Length - Length of address range
+ * Warn - TRUE if warning on overlap desired
+ *
+ * RETURN: Count of the number of conflicts detected. Zero is always
+ * returned for Space IDs other than Memory or I/O.
+ *
+ * DESCRIPTION: Check if the input address range overlaps any of the
+ * ASL operation region address ranges. The only supported
+ * Space IDs are Memory and I/O.
+ *
+ * MUTEX: Assumes the namespace is locked.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiUtCheckAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT32 Length,
+ BOOLEAN Warn)
+{
+ ACPI_ADDRESS_RANGE *RangeInfo;
+ ACPI_PHYSICAL_ADDRESS EndAddress;
+ char *Pathname;
+ UINT32 OverlapCount = 0;
+
+
+ ACPI_FUNCTION_TRACE (UtCheckAddressRange);
+
+
+ if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
+ (SpaceId != ACPI_ADR_SPACE_SYSTEM_IO))
+ {
+ return_UINT32 (0);
+ }
+
+ RangeInfo = AcpiGbl_AddressRangeList[SpaceId];
+ EndAddress = Address + Length - 1;
+
+ /* Check entire list for all possible conflicts */
+
+ while (RangeInfo)
+ {
+ /*
+ * Check if the requested Address/Length overlaps this AddressRange.
+ * Four cases to consider:
+ *
+ * 1) Input address/length is contained completely in the address range
+ * 2) Input address/length overlaps range at the range start
+ * 3) Input address/length overlaps range at the range end
+ * 4) Input address/length completely encompasses the range
+ */
+ if ((Address <= RangeInfo->EndAddress) &&
+ (EndAddress >= RangeInfo->StartAddress))
+ {
+ /* Found an address range overlap */
+
+ OverlapCount++;
+ if (Warn) /* Optional warning message */
+ {
+ Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
+
+ ACPI_WARNING ((AE_INFO,
+ "0x%p-0x%p %s conflicts with Region %s %d",
+ ACPI_CAST_PTR (void, Address),
+ ACPI_CAST_PTR (void, EndAddress),
+ AcpiUtGetRegionName (SpaceId), Pathname, OverlapCount));
+ ACPI_FREE (Pathname);
+ }
+ }
+
+ RangeInfo = RangeInfo->Next;
+ }
+
+ return_UINT32 (OverlapCount);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtDeleteAddressLists
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete all global address range lists (called during
+ * subsystem shutdown).
+ *
+ ******************************************************************************/
+
+void
+AcpiUtDeleteAddressLists (
+ void)
+{
+ ACPI_ADDRESS_RANGE *Next;
+ ACPI_ADDRESS_RANGE *RangeInfo;
+ int i;
+
+
+ /* Delete all elements in all address range lists */
+
+ for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
+ {
+ Next = AcpiGbl_AddressRangeList[i];
+
+ while (Next)
+ {
+ RangeInfo = Next;
+ Next = RangeInfo->Next;
+ ACPI_FREE (RangeInfo);
+ }
+
+ AcpiGbl_AddressRangeList[i] = NULL;
+ }
+}
diff --git a/usr/src/uts/intel/io/acpica/utilities/utalloc.c b/usr/src/uts/intel/io/acpica/utilities/utalloc.c
index 4c024f1a30..d2eb11edcb 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utalloc.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utalloc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utcache.c b/usr/src/uts/intel/io/acpica/utilities/utcache.c
index 96d64b05a5..7b3abe2894 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utcache.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utcache.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utclib.c b/usr/src/uts/intel/io/acpica/utilities/utclib.c
index 70d17bb1be..d0153ec5d2 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utclib.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utclib.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utcopy.c b/usr/src/uts/intel/io/acpica/utilities/utcopy.c
index 907f272f7e..ab04a7a7aa 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utcopy.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utcopy.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utdebug.c b/usr/src/uts/intel/io/acpica/utilities/utdebug.c
index 24d2eb5cfa..051d47b443 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utdebug.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utdecode.c b/usr/src/uts/intel/io/acpica/utilities/utdecode.c
index feca6c725c..718d73db4e 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utdecode.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utdecode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -187,7 +187,9 @@ const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
"SMBus",
"SystemCMOS",
"PCIBARTarget",
- "IPMI"
+ "IPMI",
+ "GeneralPurposeIo",
+ "GenericSerialBus"
};
@@ -565,20 +567,21 @@ AcpiUtGetMutexName (
/* Names for Notify() values, used for debug output */
-static const char *AcpiGbl_NotifyValueNames[] =
+static const char *AcpiGbl_NotifyValueNames[ACPI_NOTIFY_MAX + 1] =
{
- "Bus Check",
- "Device Check",
- "Device Wake",
- "Eject Request",
- "Device Check Light",
- "Frequency Mismatch",
- "Bus Mode Mismatch",
- "Power Fault",
- "Capabilities Check",
- "Device PLD Check",
- "Reserved",
- "System Locality Update"
+ /* 00 */ "Bus Check",
+ /* 01 */ "Device Check",
+ /* 02 */ "Device Wake",
+ /* 03 */ "Eject Request",
+ /* 04 */ "Device Check Light",
+ /* 05 */ "Frequency Mismatch",
+ /* 06 */ "Bus Mode Mismatch",
+ /* 07 */ "Power Fault",
+ /* 08 */ "Capabilities Check",
+ /* 09 */ "Device PLD Check",
+ /* 10 */ "Reserved",
+ /* 11 */ "System Locality Update",
+ /* 12 */ "Shutdown Request"
};
const char *
@@ -594,9 +597,13 @@ AcpiUtGetNotifyName (
{
return ("Reserved");
}
- else /* Greater or equal to 0x80 */
+ else if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY)
{
- return ("**Device Specific**");
+ return ("Device Specific");
+ }
+ else
+ {
+ return ("Hardware Specific");
}
}
#endif
diff --git a/usr/src/uts/intel/io/acpica/utilities/utdelete.c b/usr/src/uts/intel/io/acpica/utilities/utdelete.c
index b87d2f0d59..fb32611121 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utdelete.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utdelete.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -167,7 +167,7 @@ AcpiUtDeleteInternalObj (
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:
- /* Walk the notify handler list for this object */
+ /* Walk the address handler list for this object */
HandlerDesc = Object->CommonNotify.Handler;
while (HandlerDesc)
@@ -235,6 +235,16 @@ AcpiUtDeleteInternalObj (
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"***** Region %p\n", Object));
+ /*
+ * Update AddressRange list. However, only permanent regions
+ * are installed in this list. (Not created within a method)
+ */
+ if (!(Object->Region.Node->Flags & ANOBJ_TEMPORARY))
+ {
+ AcpiUtRemoveAddressRange (Object->Region.SpaceId,
+ Object->Region.Node);
+ }
+
SecondDesc = AcpiNsGetSecondaryObject (Object);
if (SecondDesc)
{
@@ -513,6 +523,7 @@ AcpiUtUpdateObjectReference (
ACPI_STATUS Status = AE_OK;
ACPI_GENERIC_STATE *StateList = NULL;
ACPI_OPERAND_OBJECT *NextObject = NULL;
+ ACPI_OPERAND_OBJECT *PrevObject;
ACPI_GENERIC_STATE *State;
UINT32 i;
@@ -542,10 +553,20 @@ AcpiUtUpdateObjectReference (
case ACPI_TYPE_POWER:
case ACPI_TYPE_THERMAL:
- /* Update the notify objects for these types (if present) */
-
- AcpiUtUpdateRefCount (Object->CommonNotify.SystemNotify, Action);
- AcpiUtUpdateRefCount (Object->CommonNotify.DeviceNotify, Action);
+ /*
+ * Update the notify objects for these types (if present)
+ * Two lists, system and device notify handlers.
+ */
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
+ {
+ PrevObject = Object->CommonNotify.NotifyList[i];
+ while (PrevObject)
+ {
+ NextObject = PrevObject->Notify.Next[i];
+ AcpiUtUpdateRefCount (PrevObject, Action);
+ PrevObject = NextObject;
+ }
+ }
break;
case ACPI_TYPE_PACKAGE:
diff --git a/usr/src/uts/intel/io/acpica/utilities/uteval.c b/usr/src/uts/intel/io/acpica/utilities/uteval.c
index 0042f411ff..0bcb894b58 100644
--- a/usr/src/uts/intel/io/acpica/utilities/uteval.c
+++ b/usr/src/uts/intel/io/acpica/utilities/uteval.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utglobal.c b/usr/src/uts/intel/io/acpica/utilities/utglobal.c
index 336f6706c1..f913e32228 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utglobal.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utglobal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -155,6 +155,7 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
};
+#if (!ACPI_REDUCED_HARDWARE)
/******************************************************************************
*
* Event and Hardware globals
@@ -199,6 +200,7 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
/* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
/* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE},
};
+#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
@@ -233,6 +235,13 @@ AcpiUtInitGlobals (
return_ACPI_STATUS (Status);
}
+ /* Address Range lists */
+
+ for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
+ {
+ AcpiGbl_AddressRangeList[i] = NULL;
+ }
+
/* Mutex locked flags */
for (i = 0; i < ACPI_NUM_MUTEX; i++)
@@ -262,6 +271,8 @@ AcpiUtInitGlobals (
AcpiFixedEventCount[i] = 0;
}
+#if (!ACPI_REDUCED_HARDWARE)
+
/* GPE support */
AcpiGbl_AllGpesInitialized = FALSE;
@@ -270,15 +281,18 @@ AcpiUtInitGlobals (
AcpiGbl_GpeFadtBlocks[1] = NULL;
AcpiCurrentGpeCount = 0;
+ AcpiGbl_GlobalEventHandler = NULL;
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
/* Global handlers */
- AcpiGbl_SystemNotify.Handler = NULL;
- AcpiGbl_DeviceNotify.Handler = NULL;
+ AcpiGbl_GlobalNotify[0].Handler = NULL;
+ AcpiGbl_GlobalNotify[1].Handler = NULL;
AcpiGbl_ExceptionHandler = NULL;
AcpiGbl_InitHandler = NULL;
AcpiGbl_TableHandler = NULL;
AcpiGbl_InterfaceHandler = NULL;
- AcpiGbl_GlobalEventHandler = NULL;
/* Global Lock support */
diff --git a/usr/src/uts/intel/io/acpica/utilities/utids.c b/usr/src/uts/intel/io/acpica/utilities/utids.c
index 36dc3afce6..226d8c1631 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utids.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utids.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utinit.c b/usr/src/uts/intel/io/acpica/utilities/utinit.c
index 9e253f01d3..6831595e68 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utinit.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,21 +58,33 @@
static void AcpiUtTerminate (
void);
+#if (!ACPI_REDUCED_HARDWARE)
+static void
+AcpiUtFreeGpeLists (
+ void);
+
+#else
+
+#define AcpiUtFreeGpeLists()
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+
+#if (!ACPI_REDUCED_HARDWARE)
/******************************************************************************
*
- * FUNCTION: AcpiUtTerminate
+ * FUNCTION: AcpiUtFreeGpeLists
*
* PARAMETERS: none
*
* RETURN: none
*
- * DESCRIPTION: Free global memory
+ * DESCRIPTION: Free global GPE lists
*
******************************************************************************/
static void
-AcpiUtTerminate (
+AcpiUtFreeGpeLists (
void)
{
ACPI_GPE_BLOCK_INFO *GpeBlock;
@@ -81,9 +93,6 @@ AcpiUtTerminate (
ACPI_GPE_XRUPT_INFO *NextGpeXruptInfo;
- ACPI_FUNCTION_TRACE (UtTerminate);
-
-
/* Free global GPE blocks and related info structures */
GpeXruptInfo = AcpiGbl_GpeXruptListHead;
@@ -103,7 +112,30 @@ AcpiUtTerminate (
ACPI_FREE (GpeXruptInfo);
GpeXruptInfo = NextGpeXruptInfo;
}
+}
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiUtTerminate
+ *
+ * PARAMETERS: none
+ *
+ * RETURN: none
+ *
+ * DESCRIPTION: Free global memory
+ *
+ ******************************************************************************/
+
+static void
+AcpiUtTerminate (
+ void)
+{
+ ACPI_FUNCTION_TRACE (UtTerminate);
+ AcpiUtFreeGpeLists ();
+ AcpiUtDeleteAddressLists ();
return_VOID;
}
diff --git a/usr/src/uts/intel/io/acpica/utilities/utlock.c b/usr/src/uts/intel/io/acpica/utilities/utlock.c
index fd2fb2bb1d..61585ad499 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utlock.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utlock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utmath.c b/usr/src/uts/intel/io/acpica/utilities/utmath.c
index 032b72d074..d0fad7cb6c 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utmath.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utmath.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utmisc.c b/usr/src/uts/intel/io/acpica/utilities/utmisc.c
index d20ad7e3a1..062c768e72 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utmisc.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -466,6 +466,44 @@ AcpiUtStrlwr (
return;
}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiUtStricmp
+ *
+ * PARAMETERS: String1 - first string to compare
+ * String2 - second string to compare
+ *
+ * RETURN: int that signifies string relationship. Zero means strings
+ * are equal.
+ *
+ * DESCRIPTION: Implementation of the non-ANSI stricmp function (compare
+ * strings with no case sensitivity)
+ *
+ ******************************************************************************/
+
+int
+AcpiUtStricmp (
+ char *String1,
+ char *String2)
+{
+ int c1;
+ int c2;
+
+
+ do
+ {
+ c1 = tolower ((int) *String1);
+ c2 = tolower ((int) *String2);
+
+ String1++;
+ String2++;
+ }
+ while ((c1 == c2) && (c1));
+
+ return (c1 - c2);
+}
#endif
diff --git a/usr/src/uts/intel/io/acpica/utilities/utmutex.c b/usr/src/uts/intel/io/acpica/utilities/utmutex.c
index f7af803de1..f1cdb01804 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utmutex.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -335,15 +335,10 @@ ACPI_STATUS
AcpiUtReleaseMutex (
ACPI_MUTEX_HANDLE MutexId)
{
- ACPI_THREAD_ID ThisThreadId;
-
-
ACPI_FUNCTION_NAME (UtReleaseMutex);
-
- ThisThreadId = AcpiOsGetThreadId ();
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n",
- (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
+ (UINT32) AcpiOsGetThreadId (), AcpiUtGetMutexName (MutexId)));
if (MutexId > ACPI_MAX_MUTEX)
{
@@ -374,7 +369,7 @@ AcpiUtReleaseMutex (
*/
for (i = MutexId; i < ACPI_NUM_MUTEX; i++)
{
- if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId)
+ if (AcpiGbl_MutexInfo[i].ThreadId == AcpiOsGetThreadId ())
{
if (i == MutexId)
{
diff --git a/usr/src/uts/intel/io/acpica/utilities/utobject.c b/usr/src/uts/intel/io/acpica/utilities/utobject.c
index ea621c741e..fea140946c 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utobject.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utosi.c b/usr/src/uts/intel/io/acpica/utilities/utosi.c
index 053d6adc9b..dcce8a99e1 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utosi.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utosi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utresrc.c b/usr/src/uts/intel/io/acpica/utilities/utresrc.c
index 468ffd6a1a..c2c135b7d2 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utresrc.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@
#include "acpi.h"
#include "accommon.h"
-#include "amlresrc.h"
+#include "acresrc.h"
#define _COMPONENT ACPI_UTILITIES
@@ -179,6 +179,154 @@ const char *AcpiGbl_TypDecode[] =
"TypeF"
};
+const char *AcpiGbl_PpcDecode[] =
+{
+ "PullDefault",
+ "PullUp",
+ "PullDown",
+ "PullNone"
+};
+
+const char *AcpiGbl_IorDecode[] =
+{
+ "IoRestrictionNone",
+ "IoRestrictionInputOnly",
+ "IoRestrictionOutputOnly",
+ "IoRestrictionNoneAndPreserve"
+};
+
+const char *AcpiGbl_DtsDecode[] =
+{
+ "Width8bit",
+ "Width16bit",
+ "Width32bit",
+ "Width64bit",
+ "Width128bit",
+ "Width256bit",
+};
+
+/* GPIO connection type */
+
+const char *AcpiGbl_CtDecode[] =
+{
+ "Interrupt",
+ "I/O"
+};
+
+/* Serial bus type */
+
+const char *AcpiGbl_SbtDecode[] =
+{
+ "/* UNKNOWN serial bus type */",
+ "I2C",
+ "SPI",
+ "UART"
+};
+
+/* I2C serial bus access mode */
+
+const char *AcpiGbl_AmDecode[] =
+{
+ "AddressingMode7Bit",
+ "AddressingMode10Bit"
+};
+
+/* I2C serial bus slave mode */
+
+const char *AcpiGbl_SmDecode[] =
+{
+ "ControllerInitiated",
+ "DeviceInitiated"
+};
+
+/* SPI serial bus wire mode */
+
+const char *AcpiGbl_WmDecode[] =
+{
+ "FourWireMode",
+ "ThreeWireMode"
+};
+
+/* SPI serial clock phase */
+
+const char *AcpiGbl_CphDecode[] =
+{
+ "ClockPhaseFirst",
+ "ClockPhaseSecond"
+};
+
+/* SPI serial bus clock polarity */
+
+const char *AcpiGbl_CpoDecode[] =
+{
+ "ClockPolarityLow",
+ "ClockPolarityHigh"
+};
+
+/* SPI serial bus device polarity */
+
+const char *AcpiGbl_DpDecode[] =
+{
+ "PolarityLow",
+ "PolarityHigh"
+};
+
+/* UART serial bus endian */
+
+const char *AcpiGbl_EdDecode[] =
+{
+ "LittleEndian",
+ "BigEndian"
+};
+
+/* UART serial bus bits per byte */
+
+const char *AcpiGbl_BpbDecode[] =
+{
+ "DataBitsFive",
+ "DataBitsSix",
+ "DataBitsSeven",
+ "DataBitsEight",
+ "DataBitsNine",
+ "/* UNKNOWN Bits per byte */",
+ "/* UNKNOWN Bits per byte */",
+ "/* UNKNOWN Bits per byte */"
+};
+
+/* UART serial bus stop bits */
+
+const char *AcpiGbl_SbDecode[] =
+{
+ "StopBitsNone",
+ "StopBitsOne",
+ "StopBitsOnePlusHalf",
+ "StopBitsTwo"
+};
+
+/* UART serial bus flow control */
+
+const char *AcpiGbl_FcDecode[] =
+{
+ "FlowControlNone",
+ "FlowControlHardware",
+ "FlowControlXON",
+ "/* UNKNOWN flow control keyword */"
+};
+
+/* UART serial bus parity type */
+
+const char *AcpiGbl_PtDecode[] =
+{
+ "ParityTypeNone",
+ "ParityTypeEven",
+ "ParityTypeOdd",
+ "ParityTypeMark",
+ "ParityTypeSpace",
+ "/* UNKNOWN parity keyword */",
+ "/* UNKNOWN parity keyword */",
+ "/* UNKNOWN parity keyword */"
+};
+
#endif
@@ -200,7 +348,7 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] =
ACPI_AML_SIZE_SMALL (AML_RESOURCE_END_DEPENDENT),
ACPI_AML_SIZE_SMALL (AML_RESOURCE_IO),
ACPI_AML_SIZE_SMALL (AML_RESOURCE_FIXED_IO),
- 0,
+ ACPI_AML_SIZE_SMALL (AML_RESOURCE_FIXED_DMA),
0,
0,
0,
@@ -220,7 +368,18 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] =
ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS16),
ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_IRQ),
ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS64),
- ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64)
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO),
+ 0,
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_COMMON_SERIALBUS),
+};
+
+const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[] =
+{
+ 0,
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_I2C_SERIALBUS),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_SPI_SERIALBUS),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_UART_SERIALBUS),
};
@@ -238,35 +397,49 @@ static const UINT8 AcpiGbl_ResourceTypes[] =
0,
0,
0,
- ACPI_SMALL_VARIABLE_LENGTH,
- ACPI_FIXED_LENGTH,
- ACPI_SMALL_VARIABLE_LENGTH,
- ACPI_FIXED_LENGTH,
- ACPI_FIXED_LENGTH,
- ACPI_FIXED_LENGTH,
- 0,
+ ACPI_SMALL_VARIABLE_LENGTH, /* 04 IRQ */
+ ACPI_FIXED_LENGTH, /* 05 DMA */
+ ACPI_SMALL_VARIABLE_LENGTH, /* 06 StartDependentFunctions */
+ ACPI_FIXED_LENGTH, /* 07 EndDependentFunctions */
+ ACPI_FIXED_LENGTH, /* 08 IO */
+ ACPI_FIXED_LENGTH, /* 09 FixedIO */
+ ACPI_FIXED_LENGTH, /* 0A FixedDMA */
0,
0,
0,
- ACPI_VARIABLE_LENGTH,
- ACPI_FIXED_LENGTH,
+ ACPI_VARIABLE_LENGTH, /* 0E VendorShort */
+ ACPI_FIXED_LENGTH, /* 0F EndTag */
/* Large descriptors */
0,
- ACPI_FIXED_LENGTH,
- ACPI_FIXED_LENGTH,
+ ACPI_FIXED_LENGTH, /* 01 Memory24 */
+ ACPI_FIXED_LENGTH, /* 02 GenericRegister */
+ 0,
+ ACPI_VARIABLE_LENGTH, /* 04 VendorLong */
+ ACPI_FIXED_LENGTH, /* 05 Memory32 */
+ ACPI_FIXED_LENGTH, /* 06 Memory32Fixed */
+ ACPI_VARIABLE_LENGTH, /* 07 Dword* address */
+ ACPI_VARIABLE_LENGTH, /* 08 Word* address */
+ ACPI_VARIABLE_LENGTH, /* 09 ExtendedIRQ */
+ ACPI_VARIABLE_LENGTH, /* 0A Qword* address */
+ ACPI_FIXED_LENGTH, /* 0B Extended* address */
+ ACPI_VARIABLE_LENGTH, /* 0C Gpio* */
0,
- ACPI_VARIABLE_LENGTH,
- ACPI_FIXED_LENGTH,
- ACPI_FIXED_LENGTH,
- ACPI_VARIABLE_LENGTH,
- ACPI_VARIABLE_LENGTH,
- ACPI_VARIABLE_LENGTH,
- ACPI_VARIABLE_LENGTH,
- ACPI_FIXED_LENGTH
+ ACPI_VARIABLE_LENGTH /* 0E *SerialBus */
};
+/*
+ * For the iASL compiler/disassembler, we don't want any error messages
+ * because the disassembler uses the resource validation code to determine
+ * if Buffer objects are actually Resource Templates.
+ */
+#ifdef ACPI_ASL_COMPILER
+#define ACPI_RESOURCE_ERROR(plist)
+#else
+#define ACPI_RESOURCE_ERROR(plist) ACPI_ERROR(plist)
+#endif
+
/*******************************************************************************
*
@@ -297,6 +470,7 @@ AcpiUtWalkAmlResources (
UINT8 ResourceIndex;
UINT32 Length;
UINT32 Offset = 0;
+ UINT8 EndTag[2] = {0x79, 0x00};
ACPI_FUNCTION_TRACE (UtWalkAmlResources);
@@ -322,6 +496,10 @@ AcpiUtWalkAmlResources (
Status = AcpiUtValidateResource (Aml, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
+ /*
+ * Exit on failure. Cannot continue because the descriptor length
+ * may be bogus also.
+ */
return_ACPI_STATUS (Status);
}
@@ -336,7 +514,7 @@ AcpiUtWalkAmlResources (
Status = UserFunction (Aml, Length, Offset, ResourceIndex, Context);
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
}
@@ -371,7 +549,19 @@ AcpiUtWalkAmlResources (
/* Did not find an EndTag descriptor */
- return (AE_AML_NO_RESOURCE_END_TAG);
+ if (UserFunction)
+ {
+ /* Insert an EndTag anyway. AcpiRsGetListLength always leaves room */
+
+ (void) AcpiUtValidateResource (EndTag, &ResourceIndex);
+ Status = UserFunction (EndTag, 2, Offset, ResourceIndex, Context);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
+ return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
}
@@ -396,6 +586,7 @@ AcpiUtValidateResource (
void *Aml,
UINT8 *ReturnIndex)
{
+ AML_RESOURCE *AmlResource;
UINT8 ResourceType;
UINT8 ResourceIndex;
ACPI_RS_LENGTH ResourceLength;
@@ -420,7 +611,7 @@ AcpiUtValidateResource (
if (ResourceType > ACPI_RESOURCE_NAME_LARGE_MAX)
{
- return (AE_AML_INVALID_RESOURCE_TYPE);
+ goto InvalidResource;
}
/*
@@ -439,17 +630,18 @@ AcpiUtValidateResource (
((ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3);
}
- /* Check validity of the resource type, zero indicates name is invalid */
-
+ /*
+ * Check validity of the resource type, via AcpiGbl_ResourceTypes. Zero
+ * indicates an invalid resource.
+ */
if (!AcpiGbl_ResourceTypes[ResourceIndex])
{
- return (AE_AML_INVALID_RESOURCE_TYPE);
+ goto InvalidResource;
}
-
/*
- * 2) Validate the ResourceLength field. This ensures that the length
- * is at least reasonable, and guarantees that it is non-zero.
+ * Validate the ResourceLength field. This ensures that the length
+ * is at least reasonable, and guarantees that it is non-zero.
*/
ResourceLength = AcpiUtGetResourceLength (Aml);
MinimumResourceLength = AcpiGbl_ResourceAmlSizes[ResourceIndex];
@@ -464,7 +656,7 @@ AcpiUtValidateResource (
if (ResourceLength != MinimumResourceLength)
{
- return (AE_AML_BAD_RESOURCE_LENGTH);
+ goto BadResourceLength;
}
break;
@@ -474,7 +666,7 @@ AcpiUtValidateResource (
if (ResourceLength < MinimumResourceLength)
{
- return (AE_AML_BAD_RESOURCE_LENGTH);
+ goto BadResourceLength;
}
break;
@@ -485,7 +677,7 @@ AcpiUtValidateResource (
if ((ResourceLength > MinimumResourceLength) ||
(ResourceLength < (MinimumResourceLength - 1)))
{
- return (AE_AML_BAD_RESOURCE_LENGTH);
+ goto BadResourceLength;
}
break;
@@ -493,7 +685,22 @@ AcpiUtValidateResource (
/* Shouldn't happen (because of validation earlier), but be sure */
- return (AE_AML_INVALID_RESOURCE_TYPE);
+ goto InvalidResource;
+ }
+
+ AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml);
+ if (ResourceType == ACPI_RESOURCE_NAME_SERIAL_BUS)
+ {
+ /* Validate the BusType field */
+
+ if ((AmlResource->CommonSerialBus.Type == 0) ||
+ (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE))
+ {
+ ACPI_RESOURCE_ERROR ((AE_INFO,
+ "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
+ AmlResource->CommonSerialBus.Type));
+ return (AE_AML_INVALID_RESOURCE_TYPE);
+ }
}
/* Optionally return the resource table index */
@@ -504,6 +711,22 @@ AcpiUtValidateResource (
}
return (AE_OK);
+
+
+InvalidResource:
+
+ ACPI_RESOURCE_ERROR ((AE_INFO,
+ "Invalid/unsupported resource descriptor: Type 0x%2.2X",
+ ResourceType));
+ return (AE_AML_INVALID_RESOURCE_TYPE);
+
+BadResourceLength:
+
+ ACPI_RESOURCE_ERROR ((AE_INFO,
+ "Invalid resource descriptor length: Type "
+ "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
+ ResourceType, ResourceLength, MinimumResourceLength));
+ return (AE_AML_BAD_RESOURCE_LENGTH);
}
diff --git a/usr/src/uts/intel/io/acpica/utilities/utstate.c b/usr/src/uts/intel/io/acpica/utilities/utstate.c
index bc84915ab0..62a1aefec7 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utstate.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utstate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/uttrack.c b/usr/src/uts/intel/io/acpica/utilities/uttrack.c
index 6ecec63f31..7d58f5c8a8 100644
--- a/usr/src/uts/intel/io/acpica/utilities/uttrack.c
+++ b/usr/src/uts/intel/io/acpica/utilities/uttrack.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -633,21 +633,21 @@ AcpiUtDumpAllocations (
switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor))
{
case ACPI_DESC_TYPE_OPERAND:
- if (Element->Size == sizeof (ACPI_DESC_TYPE_OPERAND))
+ if (Element->Size == sizeof (ACPI_OPERAND_OBJECT))
{
DescriptorType = ACPI_DESC_TYPE_OPERAND;
}
break;
case ACPI_DESC_TYPE_PARSER:
- if (Element->Size == sizeof (ACPI_DESC_TYPE_PARSER))
+ if (Element->Size == sizeof (ACPI_PARSE_OBJECT))
{
DescriptorType = ACPI_DESC_TYPE_PARSER;
}
break;
case ACPI_DESC_TYPE_NAMED:
- if (Element->Size == sizeof (ACPI_DESC_TYPE_NAMED))
+ if (Element->Size == sizeof (ACPI_NAMESPACE_NODE))
{
DescriptorType = ACPI_DESC_TYPE_NAMED;
}
diff --git a/usr/src/uts/intel/io/acpica/utilities/utxface.c b/usr/src/uts/intel/io/acpica/utilities/utxface.c
index 63b081b758..3e858c9b0f 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utxface.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,6 @@
#ifndef ACPI_ASL_COMPILER
-
/*******************************************************************************
*
* FUNCTION: AcpiInitializeSubsystem
@@ -162,6 +161,8 @@ AcpiEnableSubsystem (
ACPI_FUNCTION_TRACE (AcpiEnableSubsystem);
+#if (!ACPI_REDUCED_HARDWARE)
+
/* Enable ACPI mode */
if (!(Flags & ACPI_NO_ACPI_ENABLE))
@@ -189,6 +190,8 @@ AcpiEnableSubsystem (
return_ACPI_STATUS (Status);
}
+#endif /* !ACPI_REDUCED_HARDWARE */
+
/*
* Install the default OpRegion handlers. These are installed unless
* other handlers have already been installed via the
@@ -206,6 +209,7 @@ AcpiEnableSubsystem (
}
}
+#if (!ACPI_REDUCED_HARDWARE)
/*
* Initialize ACPI Event handling (Fixed and General Purpose)
*
@@ -248,6 +252,8 @@ AcpiEnableSubsystem (
}
}
+#endif /* !ACPI_REDUCED_HARDWARE */
+
return_ACPI_STATUS (Status);
}
@@ -785,5 +791,47 @@ AcpiInstallInterfaceHandler (
ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler)
-#endif /* !ACPI_ASL_COMPILER */
+/*****************************************************************************
+ *
+ * FUNCTION: AcpiCheckAddressRange
+ *
+ * PARAMETERS: SpaceId - Address space ID
+ * Address - Start address
+ * Length - Length
+ * Warn - TRUE if warning on overlap desired
+ *
+ * RETURN: Count of the number of conflicts detected.
+ *
+ * DESCRIPTION: Check if the input address range overlaps any of the
+ * ASL operation region address ranges.
+ *
+ ****************************************************************************/
+
+UINT32
+AcpiCheckAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_PHYSICAL_ADDRESS Address,
+ ACPI_SIZE Length,
+ BOOLEAN Warn)
+{
+ UINT32 Overlaps;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (0);
+ }
+
+ Overlaps = AcpiUtCheckAddressRange (SpaceId, Address,
+ (UINT32) Length, Warn);
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ return (Overlaps);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiCheckAddressRange)
+
+#endif /* !ACPI_ASL_COMPILER */
diff --git a/usr/src/uts/intel/io/acpica/utilities/utxferror.c b/usr/src/uts/intel/io/acpica/utilities/utxferror.c
index a371308d6b..8ffb274894 100644
--- a/usr/src/uts/intel/io/acpica/utilities/utxferror.c
+++ b/usr/src/uts/intel/io/acpica/utilities/utxferror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/io/acpica/utilities/utxfmutex.c b/usr/src/uts/intel/io/acpica/utilities/utxfmutex.c
new file mode 100644
index 0000000000..c4784310d3
--- /dev/null
+++ b/usr/src/uts/intel/io/acpica/utilities/utxfmutex.c
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ *
+ * Module Name: utxfmutex - external AML mutex access functions
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#define __UTXFMUTEX_C__
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acnamesp.h"
+
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utxfmutex")
+
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiUtGetMutexObject (
+ ACPI_HANDLE Handle,
+ ACPI_STRING Pathname,
+ ACPI_OPERAND_OBJECT **RetObj);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtGetMutexObject
+ *
+ * PARAMETERS: Handle - Mutex or prefix handle (optional)
+ * Pathname - Mutex pathname (optional)
+ * RetObj - Where the mutex object is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get an AML mutex object. The mutex node is pointed to by
+ * Handle:Pathname. Either Handle or Pathname can be NULL, but
+ * not both.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtGetMutexObject (
+ ACPI_HANDLE Handle,
+ ACPI_STRING Pathname,
+ ACPI_OPERAND_OBJECT **RetObj)
+{
+ ACPI_NAMESPACE_NODE *MutexNode;
+ ACPI_OPERAND_OBJECT *MutexObj;
+ ACPI_STATUS Status;
+
+
+ /* Parameter validation */
+
+ if (!RetObj || (!Handle && !Pathname))
+ {
+ return (AE_BAD_PARAMETER);
+ }
+
+ /* Get a the namespace node for the mutex */
+
+ MutexNode = Handle;
+ if (Pathname != NULL)
+ {
+ Status = AcpiGetHandle (Handle, Pathname,
+ ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode));
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ }
+
+ /* Ensure that we actually have a Mutex object */
+
+ if (!MutexNode ||
+ (MutexNode->Type != ACPI_TYPE_MUTEX))
+ {
+ return (AE_TYPE);
+ }
+
+ /* Get the low-level mutex object */
+
+ MutexObj = AcpiNsGetAttachedObject (MutexNode);
+ if (!MutexObj)
+ {
+ return (AE_NULL_OBJECT);
+ }
+
+ *RetObj = MutexObj;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAcquireMutex
+ *
+ * PARAMETERS: Handle - Mutex or prefix handle (optional)
+ * Pathname - Mutex pathname (optional)
+ * Timeout - Max time to wait for the lock (millisec)
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Acquire an AML mutex. This is a device driver interface to
+ * AML mutex objects, and allows for transaction locking between
+ * drivers and AML code. The mutex node is pointed to by
+ * Handle:Pathname. Either Handle or Pathname can be NULL, but
+ * not both.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiAcquireMutex (
+ ACPI_HANDLE Handle,
+ ACPI_STRING Pathname,
+ UINT16 Timeout)
+{
+ ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *MutexObj;
+
+
+ /* Get the low-level mutex associated with Handle:Pathname */
+
+ Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Acquire the OS mutex */
+
+ Status = AcpiOsAcquireMutex (MutexObj->Mutex.OsMutex, Timeout);
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiReleaseMutex
+ *
+ * PARAMETERS: Handle - Mutex or prefix handle (optional)
+ * Pathname - Mutex pathname (optional)
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Release an AML mutex. This is a device driver interface to
+ * AML mutex objects, and allows for transaction locking between
+ * drivers and AML code. The mutex node is pointed to by
+ * Handle:Pathname. Either Handle or Pathname can be NULL, but
+ * not both.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiReleaseMutex (
+ ACPI_HANDLE Handle,
+ ACPI_STRING Pathname)
+{
+ ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *MutexObj;
+
+
+ /* Get the low-level mutex associated with Handle:Pathname */
+
+ Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Release the OS mutex */
+
+ AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex);
+ return (AE_OK);
+}
diff --git a/usr/src/uts/intel/io/dktp/dcdev/dadk.c b/usr/src/uts/intel/io/dktp/dcdev/dadk.c
index 3fd4477fd1..a496c3aba7 100644
--- a/usr/src/uts/intel/io/dktp/dcdev/dadk.c
+++ b/usr/src/uts/intel/io/dktp/dcdev/dadk.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
/*
@@ -170,6 +171,8 @@ static int dadk_debug = DGEOM;
#endif /* DADK_DEBUG */
+#define ONE_MIN ((longlong_t)60 * NANOSEC)
+
static int dadk_check_media_time = 3000000; /* 3 Second State Check */
static int dadk_dk_maxphys = 0x80000;
@@ -1378,6 +1381,47 @@ static struct dadkio_derr dadk_errtab[] = {
{COMMAND_DONE_ERROR, GDA_FATAL}, /* 23 DERR_RESV */
};
+/*
+ * A bad disk can result in a large number of errors spewed to the log.
+ * This can in turn lead to /var/adm/messages filling up the file system on
+ * a machine with a small root or /var file system.
+ *
+ * Instead of logging every error, if we're seeing repeated errors on a disk
+ * only log them periodically.
+ */
+static void
+dadk_logerr(struct dadk *dadkp, struct cmpkt *pktp, char *label,
+ int severity, daddr_t blkno, daddr_t err_blkno,
+ char **cmdvec, char **senvec)
+{
+ hrtime_t now;
+
+ now = gethrtime();
+ if ((now - dadkp->dad_last_log) < ONE_MIN) {
+ atomic_add_32(&dadkp->dad_err_cnt, 1);
+ return;
+ }
+
+ if (dadkp->dad_err_cnt > 0) {
+ dev_info_t *dev = dadkp->dad_sd->sd_dev;
+ char name[256], buf[256];
+
+ if (dev)
+ (void) snprintf(name, sizeof (name), "%s (%s%d)",
+ ddi_pathname(dev, buf), label,
+ ddi_get_instance(dev));
+ else
+ (void) strlcpy(name, label, sizeof (name));
+ cmn_err(CE_WARN, "%s: %d additional unlogged errors\n",
+ name, dadkp->dad_err_cnt);
+ }
+
+ gda_errmsg(dadkp->dad_sd, pktp, label, severity, blkno, err_blkno,
+ cmdvec, senvec);
+ dadkp->dad_err_cnt = 0;
+ dadkp->dad_last_log = now;
+}
+
static int
dadk_chkerr(struct cmpkt *pktp)
{
@@ -1464,7 +1508,7 @@ dadk_chkerr(struct cmpkt *pktp)
return (COMMAND_DONE);
}
if (pktp->cp_passthru == NULL) {
- gda_errmsg(dadkp->dad_sd, pktp, dadk_name,
+ dadk_logerr(dadkp, pktp, dadk_name,
dadk_errtab[scb].d_severity, pktp->cp_srtsec,
err_blkno, dadk_cmds, dadk_sense);
}
@@ -1521,7 +1565,7 @@ dadk_recorderr(struct cmpkt *pktp, struct dadkio_rwcmd *rwcmdp)
if (rwcmdp->flags & DADKIO_FLAG_SILENT)
return;
- gda_errmsg(dadkp->dad_sd, pktp, dadk_name, dadk_errtab[scb].d_severity,
+ dadk_logerr(dadkp, pktp, dadk_name, dadk_errtab[scb].d_severity,
rwcmdp->blkaddr, rwcmdp->status.failed_blk,
dadk_cmds, dadk_sense);
}
diff --git a/usr/src/uts/intel/io/ipmi/ipmi_kcs.c b/usr/src/uts/intel/io/ipmi/ipmi_kcs.c
index 6502646905..08302639b8 100644
--- a/usr/src/uts/intel/io/ipmi/ipmi_kcs.c
+++ b/usr/src/uts/intel/io/ipmi/ipmi_kcs.c
@@ -27,7 +27,7 @@
/* $FreeBSD: src/sys/dev/ipmi/ipmi_kcs.c,v 1.3 2008/08/28 02:11:04 jhb */
/*
- * Copyright 2012, Joyent, Inc. All rights reserved.
+ * Copyright 2013, Joyent, Inc. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
@@ -195,7 +195,7 @@ kcs_start_write(struct ipmi_softc *sc)
status = kcs_wait_for_ibf(sc, 0);
if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_WRITE)
break;
- delay(1000000);
+ delay(drv_usectohz(1000000));
}
if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE)
diff --git a/usr/src/uts/intel/io/ipmi/ipmi_main.c b/usr/src/uts/intel/io/ipmi/ipmi_main.c
index b77434a0a5..857cd36fa0 100644
--- a/usr/src/uts/intel/io/ipmi/ipmi_main.c
+++ b/usr/src/uts/intel/io/ipmi/ipmi_main.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
@@ -65,6 +65,7 @@ static struct ipmi_softc softc;
static struct ipmi_softc *sc = &softc;
static list_t dev_list;
static id_space_t *minor_ids;
+static kmutex_t dev_list_lock;
#define PTRIN(p) ((void *)(uintptr_t)(p))
#define PTROUT(p) ((uintptr_t)(p))
@@ -130,10 +131,14 @@ lookup_ipmidev_by_dev(dev_t dev)
{
ipmi_device_t *p;
+ mutex_enter(&dev_list_lock);
for (p = list_head(&dev_list); p; p = list_next(&dev_list, p)) {
- if (dev == p->ipmi_dev)
+ if (dev == p->ipmi_dev) {
+ mutex_exit(&dev_list_lock);
return (p);
+ }
}
+ mutex_exit(&dev_list_lock);
return (NULL);
}
@@ -172,7 +177,9 @@ ipmi_open(dev_t *devp, int flag, int otyp, cred_t *cred)
dev->ipmi_dev = *devp;
cv_init(&dev->ipmi_cv, NULL, CV_DEFAULT, NULL);
+ mutex_enter(&dev_list_lock);
list_insert_head(&dev_list, dev);
+ mutex_exit(&dev_list_lock);
return (0);
}
@@ -211,7 +218,9 @@ ipmi_close(dev_t dev, int flag, int otyp, cred_t *cred)
ipmi_free_request(req);
}
+ mutex_enter(&dev_list_lock);
list_remove(&dev_list, dp);
+ mutex_exit(&dev_list_lock);
id_free(minor_ids, getminor(dev));
cv_destroy(&dp->ipmi_cv);
kmem_free(dp->ipmi_pollhead, sizeof (pollhead_t));
@@ -490,6 +499,7 @@ ipmi_cleanup(dev_info_t *dip)
ipmi_dip = NULL;
list_destroy(&dev_list);
+ mutex_destroy(&dev_list_lock);
id_space_destroy(minor_ids);
sc->ipmi_detaching = 0;
@@ -536,6 +546,7 @@ ipmi_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
list_create(&dev_list, sizeof (ipmi_device_t),
offsetof(ipmi_device_t, ipmi_node));
+ mutex_init(&dev_list_lock, NULL, MUTEX_DRIVER, NULL);
/* Create ID space for open devs. ID 0 is reserved. */
minor_ids = id_space_create("ipmi_id_space", 1, 128);
@@ -559,8 +570,12 @@ ipmi_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
if (ipmi_found == B_FALSE)
return (DDI_SUCCESS);
- if (!list_is_empty(&dev_list))
+ mutex_enter(&dev_list_lock);
+ if (!list_is_empty(&dev_list)) {
+ mutex_exit(&dev_list_lock);
return (DDI_FAILURE);
+ }
+ mutex_exit(&dev_list_lock);
ipmi_cleanup(dip);
diff --git a/usr/src/uts/intel/io/ipmi/ipmivars.h b/usr/src/uts/intel/io/ipmi/ipmivars.h
index 7fd819cd3d..f547d6f043 100644
--- a/usr/src/uts/intel/io/ipmi/ipmivars.h
+++ b/usr/src/uts/intel/io/ipmi/ipmivars.h
@@ -78,6 +78,7 @@ struct ipmi_request {
#define SMIC_CTL_STS 1
#define SMIC_FLAGS 2
+struct ipmi_softc;
#define IPMI_BUSY 0x1
#define IPMI_CLOSING 0x2
diff --git a/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c b/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c
index 01da6c0ed0..8aa0546c6b 100644
--- a/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c
+++ b/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.c
@@ -2532,6 +2532,7 @@ arcmsr_initialize(struct ACB *acb)
realccb_size = P2ROUNDUP(sizeof (struct CCB), 32);
switch (wval) {
case PCI_DEVICE_ID_ARECA_1880:
+ case PCI_DEVICE_ID_ARECA_1882:
{
uint32_t *iop_mu_regs_map0;
diff --git a/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.h b/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.h
index 8a86827e8d..8d419d92ae 100644
--- a/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.h
+++ b/usr/src/uts/intel/io/scsi/adapters/arcmsr/arcmsr.h
@@ -145,6 +145,7 @@ typedef struct ACB *PACB;
#define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */
+#define PCI_DEVICE_ID_ARECA_1882 0x1882 /* Device ID */
#define dma_addr_hi32(addr) (uint32_t)((addr>>16)>>16)
#define dma_addr_lo32(addr) (uint32_t)(addr & 0xffffffff)
diff --git a/usr/src/uts/intel/io/vmxnet/buildNumber.h b/usr/src/uts/intel/io/vmxnet/buildNumber.h
new file mode 100644
index 0000000000..97f18a3cbc
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/buildNumber.h
@@ -0,0 +1,12 @@
+#define BUILD_NUMBER \
+ "build-425873"
+#define BUILD_NUMBER_NUMERIC \
+ 425873
+#define BUILD_NUMBER_NUMERIC_STRING \
+ "425873"
+#define PRODUCT_BUILD_NUMBER \
+ "product-build-6261"
+#define PRODUCT_BUILD_NUMBER_NUMERIC \
+ 6261
+#define PRODUCT_BUILD_NUMBER_NUMERIC_STRING \
+ "6261"
diff --git a/usr/src/uts/intel/io/vmxnet/includeCheck.h b/usr/src/uts/intel/io/vmxnet/includeCheck.h
new file mode 100644
index 0000000000..c414d6daf5
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/includeCheck.h
@@ -0,0 +1,159 @@
+/*********************************************************
+ * Copyright (C) 1998 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *********************************************************/
+
+/*********************************************************
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of VMware Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission of VMware Inc.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+/*
+ * includeCheck.h --
+ *
+ * Restrict include file use.
+ *
+ * In every .h file, define one or more of these
+ *
+ * INCLUDE_ALLOW_VMX
+ * INCLUDE_ALLOW_USERLEVEL
+ * INCLUDE_ALLOW_VMCORE
+ * INCLUDE_ALLOW_MODULE
+ * INCLUDE_ALLOW_VMKERNEL
+ * INCLUDE_ALLOW_DISTRIBUTE
+ * INCLUDE_ALLOW_VMK_MODULE
+ * INCLUDE_ALLOW_VMKDRIVERS
+ * INCLUDE_ALLOW_VMIROM
+ *
+ * Then include this file.
+ *
+ * Any file that has INCLUDE_ALLOW_DISTRIBUTE defined will potentially
+ * be distributed in source form along with GPLed code. Ensure
+ * that this is acceptable.
+ */
+
+
+/*
+ * Declare a VMCORE-only variable to help classify object
+ * files. The variable goes in the common block and does
+ * not create multiple definition link-time conflicts.
+ */
+
+#if defined VMCORE && defined VMX86_DEVEL && defined VMX86_DEBUG && \
+ defined linux && !defined MODULE && \
+ !defined COMPILED_WITH_VMCORE
+#define COMPILED_WITH_VMCORE compiled_with_vmcore
+#ifdef ASM
+ .comm compiled_with_vmcore, 0
+#else
+ asm(".comm compiled_with_vmcore, 0");
+#endif /* ASM */
+#endif
+
+
+#if defined VMCORE && \
+ !(defined VMX86_VMX || defined VMM || \
+ defined MONITOR_APP || defined VMMON)
+#error "Makefile problem: VMCORE without VMX86_VMX or \
+ VMM or MONITOR_APP or MODULE."
+#endif
+
+#if defined VMCORE && !defined INCLUDE_ALLOW_VMCORE
+#error "The surrounding include file is not allowed in vmcore."
+#endif
+#undef INCLUDE_ALLOW_VMCORE
+
+#if defined VMX86_VMX && !defined VMCORE && \
+ !(defined INCLUDE_ALLOW_VMX || defined INCLUDE_ALLOW_USERLEVEL)
+#error "The surrounding include file is not allowed in the VMX."
+#endif
+#undef INCLUDE_ALLOW_VMX
+
+#if defined USERLEVEL && !defined VMX86_VMX && !defined VMCORE && \
+ !defined INCLUDE_ALLOW_USERLEVEL
+#error "The surrounding include file is not allowed at userlevel."
+#endif
+#undef INCLUDE_ALLOW_USERLEVEL
+
+#if defined MODULE && !defined VMKERNEL_MODULE && \
+ !defined VMMON && !defined INCLUDE_ALLOW_MODULE
+#error "The surrounding include file is not allowed in driver modules."
+#endif
+#undef INCLUDE_ALLOW_MODULE
+
+#if defined VMMON && !defined INCLUDE_ALLOW_VMMON
+#error "The surrounding include file is not allowed in vmmon."
+#endif
+#undef INCLUDE_ALLOW_VMMON
+
+#if defined VMKERNEL && !defined INCLUDE_ALLOW_VMKERNEL
+#error "The surrounding include file is not allowed in the vmkernel."
+#endif
+#undef INCLUDE_ALLOW_VMKERNEL
+
+#if defined GPLED_CODE && !defined INCLUDE_ALLOW_DISTRIBUTE
+#error "The surrounding include file is not allowed in GPL code."
+#endif
+#undef INCLUDE_ALLOW_DISTRIBUTE
+
+#if defined VMKERNEL_MODULE && !defined VMKERNEL && \
+ !defined INCLUDE_ALLOW_VMK_MODULE && !defined INCLUDE_ALLOW_VMKDRIVERS
+#error "The surrounding include file is not allowed in vmkernel modules."
+#endif
+#undef INCLUDE_ALLOW_VMK_MODULE
+#undef INCLUDE_ALLOW_VMKDRIVERS
+
+#if defined VMIROM && ! defined INCLUDE_ALLOW_VMIROM
+#error "The surrounding include file is not allowed in vmirom."
+#endif
+#undef INCLUDE_ALLOW_VMIROM
diff --git a/usr/src/uts/intel/io/vmxnet/net.h b/usr/src/uts/intel/io/vmxnet/net.h
new file mode 100644
index 0000000000..41b6eb1d14
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/net.h
@@ -0,0 +1,220 @@
+/*********************************************************
+ * Copyright (C) 1998 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+/************************************************************
+ *
+ * net.h
+ *
+ * This file should contain all network global defines.
+ * No vlance/vmxnet/vnet/vmknet specific stuff should be
+ * put here only defines used/usable by all network code.
+ * --gustav
+ *
+ ************************************************************/
+
+#ifndef VMWARE_DEVICES_NET_H
+#define VMWARE_DEVICES_NET_H
+
+#define INCLUDE_ALLOW_USERLEVEL
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMCORE
+
+#include "includeCheck.h"
+#include "vm_device_version.h"
+
+#ifdef VMCORE
+#include "config.h"
+#include "str.h"
+#include "strutil.h"
+#endif
+
+#define ETHERNET_MTU 1518
+#define ETH_MIN_FRAME_LEN 60
+
+#ifndef ETHER_ADDR_LEN
+#define ETHER_ADDR_LEN 6 /* length of MAC address */
+#endif
+#define ETH_HEADER_LEN 14 /* length of Ethernet header */
+#define IP_ADDR_LEN 4 /* length of IPv4 address */
+#define IP_HEADER_LEN 20 /* minimum length of IPv4 header */
+
+#define ETHER_MAX_QUEUED_PACKET 1600
+
+
+/*
+ * State's that a NIC can be in currently we only use this
+ * in VLance but if we implement/emulate new adapters that
+ * we also want to be able to morph a new corresponding
+ * state should be added.
+ */
+
+#define LANCE_CHIP 0x2934
+#define VMXNET_CHIP 0x4392
+
+/*
+ * Size of reserved IO space needed by the LANCE adapter and
+ * the VMXNET adapter. If you add more ports to Vmxnet than
+ * there is reserved space you must bump VMXNET_CHIP_IO_RESV_SIZE.
+ * The sizes must be powers of 2.
+ */
+
+#define LANCE_CHIP_IO_RESV_SIZE 0x20
+#define VMXNET_CHIP_IO_RESV_SIZE 0x40
+
+#define MORPH_PORT_SIZE 4
+
+#ifdef VMCORE
+typedef struct Net_AdapterCount {
+ uint8 vlance;
+ uint8 vmxnet2;
+ uint8 vmxnet3;
+ uint8 e1000;
+ uint8 e1000e;
+} Net_AdapterCount;
+#endif
+
+#ifdef USERLEVEL
+
+/*
+ *----------------------------------------------------------------------------
+ *
+ * Net_AddAddrToLADRF --
+ *
+ * Given a MAC address, sets the corresponding bit in the LANCE style
+ * Logical Address Filter 'ladrf'.
+ * The caller should have initialized the ladrf to all 0's, as this
+ * function only ORs on a bit in the array.
+ * 'addr' is presumed to be ETHER_ADDR_LEN in size;
+ * 'ladrf' is presumed to point to a 64-bit vector.
+ *
+ * Derived from a long history of derivations, originally inspired by
+ * sample code from the AMD "Network Products: Ethernet Controllers 1998
+ * Data Book, Book 2", pages 1-53..1-55.
+ *
+ * Returns:
+ * None.
+ *
+ * Side effects:
+ * Updates 'ladrf'.
+ *
+ *----------------------------------------------------------------------------
+ */
+
+static INLINE void
+Net_AddAddrToLadrf(const uint8 *addr, // IN: pointer to MAC address
+ uint8 *ladrf) // IN/OUT: pointer to ladrf
+{
+#define CRC_POLYNOMIAL_BE 0x04c11db7UL /* Ethernet CRC, big endian */
+
+ uint16 hashcode;
+ int32 crc = 0xffffffff; /* init CRC for each address */
+ int32 j;
+ int32 bit;
+ int32 byte;
+
+ ASSERT(addr);
+ ASSERT(ladrf);
+
+ for (byte = 0; byte < ETHER_ADDR_LEN; byte++) { /* for each address byte */
+ /* process each address bit */
+ for (bit = *addr++, j = 0;
+ j < 8;
+ j++, bit >>= 1) {
+ crc = (crc << 1) ^ ((((crc < 0 ? 1 : 0) ^ bit) & 0x01) ?
+ CRC_POLYNOMIAL_BE : 0);
+ }
+ }
+ hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */
+ for (j = 0; j < 5; j++) { /* ... in reverse order. */
+ hashcode = (hashcode << 1) | ((crc>>=1) & 1);
+ }
+
+ ladrf[hashcode >> 3] |= 1 << (hashcode & 0x07);
+}
+#endif // USERLEVEL
+
+#ifdef VMCORE
+/*
+ *----------------------------------------------------------------------
+ *
+ * Net_GetNumAdapters --
+ *
+ * Returns the number of each type of network adapter configured in this
+ * VM.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static INLINE void
+Net_GetNumAdapters(Net_AdapterCount *counts)
+{
+ uint32 i;
+
+ counts->vlance = 0;
+ counts->vmxnet2 = 0;
+ counts->vmxnet3 = 0;
+ counts->e1000 = 0;
+ counts->e1000e = 0;
+
+ for (i = 0; i < MAX_ETHERNET_CARDS; i++) {
+ char* adapterStr;
+
+ if (!Config_GetBool(FALSE, "ethernet%d.present", i)) {
+ continue;
+ }
+ adapterStr = Config_GetString("vlance", "ethernet%d.virtualDev", i);
+ if (Str_Strcasecmp(adapterStr, "vmxnet3") == 0) {
+ counts->vmxnet3++;
+ } else if (Str_Strcasecmp(adapterStr, "vlance") == 0) {
+ counts->vlance++;
+ } else if (Str_Strcasecmp(adapterStr, "vmxnet") == 0) {
+ counts->vmxnet2++;
+ } else if (Str_Strcasecmp(adapterStr, "e1000") == 0) {
+ counts->e1000++;
+ } else if (Str_Strcasecmp(adapterStr, "e1000e") == 0) {
+ counts->e1000e++;
+ } else {
+ LOG_ONCE(("%s: unknown adapter: %s\n", __FUNCTION__, adapterStr));
+ }
+ free(adapterStr);
+ }
+}
+
+#endif // VMCORE
+
+#endif // VMWARE_DEVICES_NET_H
diff --git a/usr/src/uts/intel/io/vmxnet/net_sg.h b/usr/src/uts/intel/io/vmxnet/net_sg.h
new file mode 100644
index 0000000000..f6c30fb2b5
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/net_sg.h
@@ -0,0 +1,84 @@
+/*********************************************************
+ * Copyright (C) 2000 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+/*
+ * net_sg.h --
+ *
+ * Network packet scatter gather structure.
+ */
+
+
+#ifndef _NET_SG_H
+#define _NET_SG_H
+
+#define INCLUDE_ALLOW_USERLEVEL
+
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMK_MODULE
+#define INCLUDE_ALLOW_VMKERNEL
+#define INCLUDE_ALLOW_DISTRIBUTE
+#include "includeCheck.h"
+
+#define NET_SG_DEFAULT_LENGTH 16
+
+/*
+ * A single scatter-gather element for a network packet.
+ * The address is split into low and high to save space.
+ * If we make it 64 bits then Windows pads things out such that
+ * we lose a lot of space for each scatter gather array.
+ * This adds up when you have embedded scatter-gather
+ * arrays for transmit and receive ring buffers.
+ */
+typedef struct NetSG_Elem {
+ uint32 addrLow;
+ uint16 addrHi;
+ uint16 length;
+} NetSG_Elem;
+
+typedef enum NetSG_AddrType {
+ NET_SG_MACH_ADDR,
+ NET_SG_PHYS_ADDR,
+ NET_SG_VIRT_ADDR,
+} NetSG_AddrType;
+
+typedef struct NetSG_Array {
+ uint16 addrType;
+ uint16 length;
+ NetSG_Elem sg[NET_SG_DEFAULT_LENGTH];
+} NetSG_Array;
+
+#define NET_SG_SIZE(len) (sizeof(NetSG_Array) + (len - NET_SG_DEFAULT_LENGTH) * sizeof(NetSG_Elem))
+
+#define NET_SG_MAKE_PA(elem) (PA)QWORD(elem.addrHi, elem.addrLow)
+#define NET_SG_MAKE_PTR(elem) (char *)(uintptr_t)QWORD(elem.addrHi, elem.addrLow)
+
+#endif
diff --git a/usr/src/uts/intel/io/vmxnet/vm_basic_types.h b/usr/src/uts/intel/io/vmxnet/vm_basic_types.h
new file mode 100644
index 0000000000..adeac1b708
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vm_basic_types.h
@@ -0,0 +1,1037 @@
+/*********************************************************
+ * Copyright (C) 1998-2009 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *********************************************************/
+
+/*********************************************************
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of VMware Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission of VMware Inc.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+/*
+ *
+ * vm_basic_types.h --
+ *
+ * basic data types.
+ */
+
+
+#ifndef _VM_BASIC_TYPES_H_
+#define _VM_BASIC_TYPES_H_
+
+#define INCLUDE_ALLOW_USERLEVEL
+
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMMON
+#define INCLUDE_ALLOW_VMKERNEL
+#define INCLUDE_ALLOW_VMKDRIVERS
+#define INCLUDE_ALLOW_VMK_MODULE
+#define INCLUDE_ALLOW_DISTRIBUTE
+#define INCLUDE_ALLOW_VMCORE
+#define INCLUDE_ALLOW_VMIROM
+#include "includeCheck.h"
+
+/* STRICT ANSI means the Xserver build and X defines Bool differently. */
+#if !defined(_XTYPEDEF_BOOL) && \
+ (!defined(__STRICT_ANSI__) || defined(__FreeBSD__) || defined(__MINGW32__))
+#define _XTYPEDEF_BOOL
+typedef char Bool;
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#define IsBool(x) (((x) & ~1) == 0)
+#define IsBool2(x, y) ((((x) | (y)) & ~1) == 0)
+
+/*
+ * Macros __i386__ and __ia64 are intrinsically defined by GCC
+ */
+#if defined _MSC_VER && defined _M_X64
+# define __x86_64__
+#elif defined _MSC_VER && defined _M_IX86
+# define __i386__
+#endif
+
+#ifdef __i386__
+#define VM_I386
+#endif
+
+#ifdef __x86_64__
+#define VM_X86_64
+#define VM_I386
+#define vm_x86_64 (1)
+#else
+#define vm_x86_64 (0)
+#endif
+
+
+#ifdef _MSC_VER
+
+#pragma warning (3 :4505) // unreferenced local function
+#pragma warning (disable :4018) // signed/unsigned mismatch
+#pragma warning (disable :4761) // integral size mismatch in argument; conversion supplied
+#pragma warning (disable :4305) // truncation from 'const int' to 'short'
+#pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char'
+#pragma warning (disable :4267) // truncation of 'size_t'
+#pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned
+#pragma warning (disable :4142) // benign redefinition of type
+
+#endif
+
+#if defined(__APPLE__) || defined(HAVE_STDINT_H)
+
+/*
+ * TODO: This is a C99 standard header. We should be able to test for
+ * #if __STDC_VERSION__ >= 199901L, but that breaks the Netware build
+ * (which doesn't have stdint.h).
+ */
+
+#include <stdint.h>
+
+typedef uint64_t uint64;
+typedef int64_t int64;
+typedef uint32_t uint32;
+typedef int32_t int32;
+typedef uint16_t uint16;
+typedef int16_t int16;
+typedef uint8_t uint8;
+typedef int8_t int8;
+
+/*
+ * Note: C does not specify whether char is signed or unsigned, and
+ * both gcc and msvc implement processor-specific signedness. With
+ * three types:
+ * typeof(char) != typeof(signed char) != typeof(unsigned char)
+ *
+ * Be careful here, because gcc (4.0.1 and others) likes to warn about
+ * conversions between signed char * and char *.
+ */
+
+#else /* !HAVE_STDINT_H */
+
+#ifdef _MSC_VER
+
+typedef unsigned __int64 uint64;
+typedef signed __int64 int64;
+
+#elif defined(__GNUC__) || defined(__SUNPRO_C)
+/* The Xserver source compiles with -ansi -pendantic */
+# if !defined(__STRICT_ANSI__) || defined(__FreeBSD__)
+# if defined(VM_X86_64)
+typedef unsigned long uint64;
+typedef long int64;
+# else
+typedef unsigned long long uint64;
+typedef long long int64;
+# endif
+# endif
+#else
+# error - Need compiler define for int64/uint64
+#endif /* _MSC_VER */
+
+typedef unsigned int uint32;
+typedef unsigned short uint16;
+typedef unsigned char uint8;
+
+typedef int int32;
+typedef short int16;
+typedef signed char int8;
+
+#endif /* HAVE_STDINT_H */
+
+/*
+ * FreeBSD (for the tools build) unconditionally defines these in
+ * sys/inttypes.h so don't redefine them if this file has already
+ * been included. [greg]
+ *
+ * This applies to Solaris as well.
+ */
+
+/*
+ * Before trying to do the includes based on OS defines, see if we can use
+ * feature-based defines to get as much functionality as possible
+ */
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_INTTYPES_H
+#include <sys/inttypes.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef __FreeBSD__
+#include <sys/param.h> /* For __FreeBSD_version */
+#endif
+
+#if !defined(USING_AUTOCONF)
+# if defined(__FreeBSD__) || defined(sun)
+# ifdef KLD_MODULE
+# include <sys/types.h>
+# else
+# if __FreeBSD_version >= 500043
+# if !defined(VMKERNEL)
+# include <inttypes.h>
+# endif
+# include <sys/types.h>
+# else
+# include <sys/inttypes.h>
+# endif
+# endif
+# elif defined __APPLE__
+# if KERNEL
+# include <sys/unistd.h>
+# include <sys/types.h> /* mostly for size_t */
+# include <stdint.h>
+# else
+# include <unistd.h>
+# include <inttypes.h>
+# include <stdlib.h>
+# include <stdint.h>
+# endif
+# else
+# if !defined(__intptr_t_defined) && !defined(intptr_t)
+# ifdef VM_I386
+# define __intptr_t_defined
+# ifdef VM_X86_64
+typedef int64 intptr_t;
+# else
+typedef int32 intptr_t;
+# endif
+# elif defined(__arm__)
+typedef int32 intptr_t;
+# endif
+# endif
+
+# ifndef _STDINT_H
+# ifdef VM_I386
+# ifdef VM_X86_64
+typedef uint64 uintptr_t;
+# else
+typedef uint32 uintptr_t;
+# endif
+# elif defined(__arm__)
+typedef uint32 uintptr_t;
+# endif
+# endif
+# endif
+#endif
+
+
+/*
+ * Time
+ * XXX These should be cleaned up. -- edward
+ */
+
+typedef int64 VmTimeType; /* Time in microseconds */
+typedef int64 VmTimeRealClock; /* Real clock kept in microseconds */
+typedef int64 VmTimeVirtualClock; /* Virtual Clock kept in CPU cycles */
+
+/*
+ * Printf format specifiers for size_t and 64-bit number.
+ * Use them like this:
+ * printf("%"FMT64"d\n", big);
+ *
+ * FMTH is for handles/fds.
+ */
+
+#ifdef _MSC_VER
+ #define FMT64 "I64"
+ #ifdef VM_X86_64
+ #define FMTSZ "I64"
+ #define FMTPD "I64"
+ #define FMTH "I64"
+ #else
+ #define FMTSZ "I"
+ #define FMTPD "I"
+ #define FMTH "I"
+ #endif
+#elif defined __APPLE__
+ /* Mac OS hosts use the same formatters for 32- and 64-bit. */
+ #define FMT64 "ll"
+ #if KERNEL
+ #define FMTSZ "l"
+ #else
+ #define FMTSZ "z"
+ #endif
+ #define FMTPD "l"
+ #define FMTH ""
+#elif defined(__GNUC__) || defined(__SUNPRO_C)
+ #define FMTH ""
+ #if defined(N_PLAT_NLM) || defined(sun) || \
+ (defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) < 5))
+ /*
+ * Why (__FreeBSD__ + 0)? See bug 141008.
+ * Yes, we really need to test both (__FreeBSD__ + 0) and
+ * ((__FreeBSD__ + 0) < 5). No, we can't remove "+ 0" from
+ * ((__FreeBSD__ + 0) < 5).
+ */
+ #ifdef VM_X86_64
+ #define FMTSZ "l"
+ #define FMTPD "l"
+ #else
+ #define FMTSZ ""
+ #define FMTPD ""
+ #endif
+ #elif defined(__linux__) \
+ || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \
+ || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
+ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L)
+ /* BSD, Linux */
+ #define FMTSZ "z"
+
+ #if defined(VM_X86_64)
+ #define FMTPD "l"
+ #else
+ #define FMTPD ""
+ #endif
+ #else
+ /* Systems with a pre-C99 libc */
+ #define FMTSZ "Z"
+ #ifdef VM_X86_64
+ #define FMTPD "l"
+ #else
+ #define FMTPD ""
+ #endif
+ #endif
+ #ifdef VM_X86_64
+ #define FMT64 "l"
+ #elif defined(sun) || defined(__FreeBSD__)
+ #define FMT64 "ll"
+ #else
+ #define FMT64 "L"
+ #endif
+#else
+ #error - Need compiler define for FMT64 and FMTSZ
+#endif
+
+/*
+ * Suffix for 64-bit constants. Use it like this:
+ * CONST64(0x7fffffffffffffff) for signed or
+ * CONST64U(0x7fffffffffffffff) for unsigned.
+ *
+ * 2004.08.30(thutt):
+ * The vmcore/asm64/gen* programs are compiled as 32-bit
+ * applications, but must handle 64 bit constants. If the
+ * 64-bit-constant defining macros are already defined, the
+ * definition will not be overwritten.
+ */
+
+#if !defined(CONST64) || !defined(CONST64U)
+#ifdef _MSC_VER
+#define CONST64(c) c##I64
+#define CONST64U(c) c##uI64
+#elif defined __APPLE__
+#define CONST64(c) c##LL
+#define CONST64U(c) c##uLL
+#elif defined(__GNUC__) || defined(__SUNPRO_C)
+#ifdef VM_X86_64
+#define CONST64(c) c##L
+#define CONST64U(c) c##uL
+#else
+#define CONST64(c) c##LL
+#define CONST64U(c) c##uLL
+#endif
+#else
+#error - Need compiler define for CONST64
+#endif
+#endif
+
+/*
+ * Use CONST3264/CONST3264U if you want a constant to be
+ * treated as a 32-bit number on 32-bit compiles and
+ * a 64-bit number on 64-bit compiles. Useful in the case
+ * of shifts, like (CONST3264U(1) << x), where x could be
+ * more than 31 on a 64-bit compile.
+ */
+
+#ifdef VM_X86_64
+ #define CONST3264(a) CONST64(a)
+ #define CONST3264U(a) CONST64U(a)
+#else
+ #define CONST3264(a) (a)
+ #define CONST3264U(a) (a)
+#endif
+
+#define MIN_INT8 ((int8)0x80)
+#define MAX_INT8 ((int8)0x7f)
+
+#define MIN_UINT8 ((uint8)0)
+#define MAX_UINT8 ((uint8)0xff)
+
+#define MIN_INT16 ((int16)0x8000)
+#define MAX_INT16 ((int16)0x7fff)
+
+#define MIN_UINT16 ((uint16)0)
+#define MAX_UINT16 ((uint16)0xffff)
+
+#define MIN_INT32 ((int32)0x80000000)
+#define MAX_INT32 ((int32)0x7fffffff)
+
+#define MIN_UINT32 ((uint32)0)
+#define MAX_UINT32 ((uint32)0xffffffff)
+
+#define MIN_INT64 (CONST64(0x8000000000000000))
+#define MAX_INT64 (CONST64(0x7fffffffffffffff))
+
+#define MIN_UINT64 (CONST64U(0))
+#define MAX_UINT64 (CONST64U(0xffffffffffffffff))
+
+typedef uint8 *TCA; /* Pointer into TC (usually). */
+
+/*
+ * Type big enough to hold an integer between 0..100
+ */
+typedef uint8 Percent;
+#define AsPercent(v) ((Percent)(v))
+#define CHOOSE_PERCENT AsPercent(101)
+
+
+typedef uintptr_t VA;
+typedef uintptr_t VPN;
+
+typedef uint64 PA;
+typedef uint32 PPN;
+
+typedef uint64 PhysMemOff;
+typedef uint64 PhysMemSize;
+
+/* The Xserver source compiles with -ansi -pendantic */
+#ifndef __STRICT_ANSI__
+typedef uint64 BA;
+#endif
+typedef uint32 BPN;
+typedef uint32 PageNum;
+typedef unsigned MemHandle;
+typedef int32 World_ID;
+
+/* !! do not alter the definition of INVALID_WORLD_ID without ensuring
+ * that the values defined in both bora/public/vm_basic_types.h and
+ * lib/vprobe/vm_basic_types.h are the same. Additionally, the definition
+ * of VMK_INVALID_WORLD_ID in vmkapi_world.h also must be defined with
+ * the same value
+ */
+
+#define INVALID_WORLD_ID ((World_ID)0)
+
+typedef World_ID User_CartelID;
+#define INVALID_CARTEL_ID INVALID_WORLD_ID
+
+typedef User_CartelID User_SessionID;
+#define INVALID_SESSION_ID INVALID_CARTEL_ID
+
+typedef User_CartelID User_CartelGroupID;
+#define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID
+
+typedef uint32 Worldlet_ID;
+#define INVALID_WORLDLET_ID ((Worldlet_ID)-1)
+
+/* The Xserver source compiles with -ansi -pendantic */
+#ifndef __STRICT_ANSI__
+typedef uint64 MA;
+typedef uint32 MPN;
+#endif
+
+/*
+ * This type should be used for variables that contain sector
+ * position/quantity.
+ */
+typedef uint64 SectorType;
+
+/*
+ * Linear address
+ */
+
+typedef uintptr_t LA;
+typedef uintptr_t LPN;
+#define LA_2_LPN(_la) ((_la) >> PAGE_SHIFT)
+#define LPN_2_LA(_lpn) ((_lpn) << PAGE_SHIFT)
+
+#define LAST_LPN ((((LA) 1) << (8 * sizeof(LA) - PAGE_SHIFT)) - 1)
+#define LAST_LPN32 ((((LA32)1) << (8 * sizeof(LA32) - PAGE_SHIFT)) - 1)
+#define LAST_LPN64 ((((LA64)1) << (8 * sizeof(LA64) - PAGE_SHIFT)) - 1)
+
+/* Valid bits in a LPN. */
+#define LPN_MASK LAST_LPN
+#define LPN_MASK32 LAST_LPN32
+#define LPN_MASK64 LAST_LPN64
+
+/*
+ * On 64 bit platform, address and page number types default
+ * to 64 bit. When we need to represent a 32 bit address, we use
+ * types defined below.
+ *
+ * On 32 bit platform, the following types are the same as the
+ * default types.
+ */
+typedef uint32 VA32;
+typedef uint32 VPN32;
+typedef uint32 LA32;
+typedef uint32 LPN32;
+typedef uint32 PA32;
+typedef uint32 PPN32;
+typedef uint32 MA32;
+typedef uint32 MPN32;
+
+/*
+ * On 64 bit platform, the following types are the same as the
+ * default types.
+ */
+typedef uint64 VA64;
+typedef uint64 VPN64;
+typedef uint64 LA64;
+typedef uint64 LPN64;
+typedef uint64 PA64;
+typedef uint64 PPN64;
+typedef uint64 MA64;
+typedef uint64 MPN64;
+
+/*
+ * VA typedefs for user world apps.
+ */
+typedef VA32 UserVA32;
+typedef VA64 UserVA64;
+typedef UserVA64 UserVAConst; /* Userspace ptr to data that we may only read. */
+typedef UserVA32 UserVA32Const; /* Userspace ptr to data that we may only read. */
+typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */
+#ifdef VMKERNEL
+typedef UserVA64 UserVA;
+#else
+typedef void * UserVA;
+#endif
+
+
+/*
+ * Maximal possible PPN value (errors too) that PhysMem can handle.
+ * Must be at least as large as MAX_PPN which is the maximum PPN
+ * for any region other than buserror.
+ */
+#define PHYSMEM_MAX_PPN ((PPN)0xffffffff)
+#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */
+#define INVALID_PPN ((PPN)0xffffffff)
+
+#define INVALID_BPN ((BPN)0x1fffffff)
+
+#define RESERVED_MPN ((MPN) 0)
+#define INVALID_MPN ((MPN)-1)
+#define MEMREF_MPN ((MPN)-2)
+#define RELEASED_MPN ((MPN)-3)
+#define MAX_MPN ((MPN)0x7fffffff) /* 43 bits of address space. */
+
+#define INVALID_LPN ((LPN)-1)
+#define INVALID_VPN ((VPN)-1)
+#define INVALID_LPN64 ((LPN64)-1)
+#define INVALID_PAGENUM ((PageNum)-1)
+
+
+/*
+ * Format modifier for printing VA, LA, and VPN.
+ * Use them like this: Log("%#"FMTLA"x\n", laddr)
+ */
+
+#if defined(VMM) || defined(FROBOS64) || vm_x86_64 || defined __APPLE__
+# define FMTLA "l"
+# define FMTVA "l"
+# define FMTVPN "l"
+#else
+# define FMTLA ""
+# define FMTVA ""
+# define FMTVPN ""
+#endif
+
+#ifndef EXTERN
+#define EXTERN extern
+#endif
+#define CONST const
+
+
+#ifndef INLINE
+# ifdef _MSC_VER
+# define INLINE __inline
+# else
+# define INLINE inline
+# endif
+#endif
+
+
+/*
+ * Annotation for data that may be exported into a DLL and used by other
+ * apps that load that DLL and import the data.
+ */
+#if defined(_WIN32) && defined(VMX86_IMPORT_DLLDATA)
+# define VMX86_EXTERN_DATA extern __declspec(dllimport)
+#else // !_WIN32
+# define VMX86_EXTERN_DATA extern
+#endif
+
+#if defined(_WIN32) && !defined(VMX86_NO_THREADS)
+#define THREADSPECIFIC __declspec(thread)
+#else
+#define THREADSPECIFIC
+#endif
+
+/*
+ * Due to the wonderful "registry redirection" feature introduced in
+ * 64-bit Windows, if you access any key under HKLM\Software in 64-bit
+ * code, you need to open/create/delete that key with
+ * VMKEY_WOW64_32KEY if you want a consistent view with 32-bit code.
+ */
+
+#ifdef _WIN32
+#ifdef _WIN64
+#define VMW_KEY_WOW64_32KEY KEY_WOW64_32KEY
+#else
+#define VMW_KEY_WOW64_32KEY 0x0
+#endif
+#endif
+
+
+/*
+ * Consider the following reasons functions are inlined:
+ *
+ * 1) inlined for performance reasons
+ * 2) inlined because it's a single-use function
+ *
+ * Functions which meet only condition 2 should be marked with this
+ * inline macro; It is not critical to be inlined (but there is a
+ * code-space & runtime savings by doing so), so when other callers
+ * are added the inline-ness should be removed.
+ */
+
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+/*
+ * Starting at version 3.3, gcc does not always inline functions marked
+ * 'inline' (it depends on their size). To force gcc to do so, one must use the
+ * extra __always_inline__ attribute.
+ */
+# define INLINE_SINGLE_CALLER INLINE __attribute__((__always_inline__))
+#else
+# define INLINE_SINGLE_CALLER INLINE
+#endif
+
+/*
+ * Used when a hard guaranteed of no inlining is needed. Very few
+ * instances need this since the absence of INLINE is a good hint
+ * that gcc will not do inlining.
+ */
+
+#if defined(__GNUC__) && defined(VMM)
+#define ABSOLUTELY_NOINLINE __attribute__((__noinline__))
+#endif
+
+/*
+ * Attributes placed on function declarations to tell the compiler
+ * that the function never returns.
+ */
+
+#ifdef _MSC_VER
+#define NORETURN __declspec(noreturn)
+#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 9)
+#define NORETURN __attribute__((__noreturn__))
+#else
+#define NORETURN
+#endif
+
+/*
+ * GCC 3.2 inline asm needs the + constraint for input/ouput memory operands.
+ * Older GCCs don't know about it --hpreg
+ */
+
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+# define VM_ASM_PLUS 1
+#else
+# define VM_ASM_PLUS 0
+#endif
+
+/*
+ * Branch prediction hints:
+ * LIKELY(exp) - Expression exp is likely TRUE.
+ * UNLIKELY(exp) - Expression exp is likely FALSE.
+ * Usage example:
+ * if (LIKELY(excCode == EXC_NONE)) {
+ * or
+ * if (UNLIKELY(REAL_MODE(vc))) {
+ *
+ * We know how to predict branches on gcc3 and later (hopefully),
+ * all others we don't so we do nothing.
+ */
+
+#if (__GNUC__ >= 3)
+/*
+ * gcc3 uses __builtin_expect() to inform the compiler of an expected value.
+ * We use this to inform the static branch predictor. The '!!' in LIKELY
+ * will convert any !=0 to a 1.
+ */
+#define LIKELY(_exp) __builtin_expect(!!(_exp), 1)
+#define UNLIKELY(_exp) __builtin_expect((_exp), 0)
+#else
+#define LIKELY(_exp) (_exp)
+#define UNLIKELY(_exp) (_exp)
+#endif
+
+/*
+ * GCC's argument checking for printf-like functions
+ * This is conditional until we have replaced all `"%x", void *'
+ * with `"0x%08x", (uint32) void *'. Note that %p prints different things
+ * on different platforms. Argument checking is enabled for the
+ * vmkernel, which has already been cleansed.
+ *
+ * fmtPos is the position of the format string argument, beginning at 1
+ * varPos is the position of the variable argument, beginning at 1
+ */
+
+#if defined(__GNUC__)
+# define PRINTF_DECL(fmtPos, varPos) __attribute__((__format__(__printf__, fmtPos, varPos)))
+#else
+# define PRINTF_DECL(fmtPos, varPos)
+#endif
+
+#if defined(__GNUC__)
+# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos)))
+#else
+# define SCANF_DECL(fmtPos, varPos)
+#endif
+
+/*
+ * UNUSED_PARAM should surround the parameter name and type declaration,
+ * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))"
+ *
+ */
+
+#ifndef UNUSED_PARAM
+# if defined(__GNUC__)
+# define UNUSED_PARAM(_parm) _parm __attribute__((__unused__))
+# else
+# define UNUSED_PARAM(_parm) _parm
+# endif
+#endif
+
+/*
+ * REGPARM defaults to REGPARM3; i.e., a request that gcc
+ * put the first three arguments in registers. (It is fine
+ * if the function has fewer than three arguments.) Gcc only.
+ * Syntactically, put REGPARM where you'd put INLINE or NORETURN.
+ *
+ * Note that 64-bit code already puts the first six arguments in
+ * registers, so these attributes are only useful for 32-bit code.
+ */
+
+#if defined(__GNUC__)
+# define REGPARM0 __attribute__((regparm(0)))
+# define REGPARM1 __attribute__((regparm(1)))
+# define REGPARM2 __attribute__((regparm(2)))
+# define REGPARM3 __attribute__((regparm(3)))
+# define REGPARM REGPARM3
+#else
+# define REGPARM0
+# define REGPARM1
+# define REGPARM2
+# define REGPARM3
+# define REGPARM
+#endif
+
+/*
+ * ALIGNED specifies minimum alignment in "n" bytes.
+ */
+
+#ifdef __GNUC__
+#define ALIGNED(n) __attribute__((__aligned__(n)))
+#else
+#define ALIGNED(n)
+#endif
+
+/*
+ * __func__ is a stringified function name that is part of the C99 standard. The block
+ * below defines __func__ on older systems where the compiler does not support that
+ * macro.
+ */
+#if defined(__GNUC__) \
+ && ((__GNUC__ == 2 && __GNUC_MINOR < 96) \
+ || (__GNUC__ < 2))
+# define __func__ __FUNCTION__
+#endif
+
+/*
+ * Once upon a time, this was used to silence compiler warnings that
+ * get generated when the compiler thinks that a function returns
+ * when it is marked noreturn. Don't do it. Use NOT_REACHED().
+ */
+
+#define INFINITE_LOOP() do { } while (1)
+
+/*
+ * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_
+ * is defined. Use the same logic here so we don't define it twice. [greg]
+ */
+#ifdef __FreeBSD__
+# ifdef _BSD_SIZE_T_
+# undef _BSD_SIZE_T_
+# ifdef VM_I386
+# ifdef VM_X86_64
+ typedef uint64 size_t;
+# else
+ typedef uint32 size_t;
+# endif
+# endif /* VM_I386 */
+# endif
+
+# ifdef _BSD_SSIZE_T_
+# undef _BSD_SSIZE_T_
+# ifdef VM_I386
+# ifdef VM_X86_64
+ typedef int64 ssize_t;
+# else
+ typedef int32 ssize_t;
+# endif
+# endif /* VM_I386 */
+# endif
+
+#else
+# ifndef _SIZE_T
+# ifdef VM_I386
+# define _SIZE_T
+# ifdef VM_X86_64
+ typedef uint64 size_t;
+# else
+ typedef uint32 size_t;
+# endif
+# elif defined(__arm__)
+# define _SIZE_T
+ typedef uint32 size_t;
+# endif
+# endif
+
+# if !defined(FROBOS) && !defined(_SSIZE_T) && !defined(_SSIZE_T_) && \
+ !defined(ssize_t) && !defined(__ssize_t_defined) && \
+ !defined(_SSIZE_T_DECLARED)
+# ifdef VM_I386
+# define _SSIZE_T
+# define __ssize_t_defined
+# define _SSIZE_T_DECLARED
+# ifdef VM_X86_64
+ typedef int64 ssize_t;
+# else
+ typedef int32 ssize_t;
+# endif
+# elif defined(__arm__)
+# define _SSIZE_T
+# define __ssize_t_defined
+# define _SSIZE_T_DECLARED
+ typedef int32 ssize_t;
+# endif
+# endif
+
+#endif
+
+/*
+ * Format modifier for printing pid_t. On sun the pid_t is a ulong, but on
+ * Linux it's an int.
+ * Use this like this: printf("The pid is %"FMTPID".\n", pid);
+ */
+#ifdef sun
+# ifdef VM_X86_64
+# define FMTPID "d"
+# else
+# define FMTPID "lu"
+# endif
+#else
+# define FMTPID "d"
+#endif
+
+/*
+ * Format modifier for printing uid_t. On Solaris 10 and earlier, uid_t
+ * is a ulong, but on other platforms it's an unsigned int.
+ * Use this like this: printf("The uid is %"FMTUID".\n", uid);
+ */
+#if defined(sun) && !defined(SOL11)
+# ifdef VM_X86_64
+# define FMTUID "u"
+# else
+# define FMTUID "lu"
+# endif
+#else
+# define FMTUID "u"
+#endif
+
+/*
+ * Format modifier for printing mode_t. On sun the mode_t is a ulong, but on
+ * Linux it's an int.
+ * Use this like this: printf("The mode is %"FMTMODE".\n", mode);
+ */
+#ifdef sun
+# ifdef VM_X86_64
+# define FMTMODE "o"
+# else
+# define FMTMODE "lo"
+# endif
+#else
+# define FMTMODE "o"
+#endif
+
+/*
+ * Format modifier for printing time_t. Most platforms define a time_t to be
+ * a long int, but on FreeBSD (as of 5.0, it seems), the time_t is a signed
+ * size quantity. Refer to the definition of FMTSZ to see why we need silly
+ * preprocessor arithmetic.
+ * Use this like this: printf("The mode is %"FMTTIME".\n", time);
+ */
+#if defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) >= 5)
+# define FMTTIME FMTSZ"d"
+#else
+# if defined(_MSC_VER)
+# ifndef _SAFETIME_H_
+# if (_MSC_VER < 1400) || defined(_USE_32BIT_TIME_T)
+# define FMTTIME "ld"
+# else
+# define FMTTIME FMT64"d"
+# endif
+# else
+# ifndef FMTTIME
+# error "safetime.h did not define FMTTIME"
+# endif
+# endif
+# else
+# define FMTTIME "ld"
+# endif
+#endif
+
+#ifdef __APPLE__
+/*
+ * Format specifier for all these annoying types such as {S,U}Int32
+ * which are 'long' in 32-bit builds
+ * and 'int' in 64-bit builds.
+ */
+# ifdef __LP64__
+# define FMTLI ""
+# else
+# define FMTLI "l"
+# endif
+
+/*
+ * Format specifier for all these annoying types such as NS[U]Integer
+ * which are 'int' in 32-bit builds
+ * and 'long' in 64-bit builds.
+ */
+# ifdef __LP64__
+# define FMTIL "l"
+# else
+# define FMTIL ""
+# endif
+#endif
+
+
+/*
+ * Define MXSemaHandle here so both vmmon and vmx see this definition.
+ */
+
+#ifdef _WIN32
+typedef uintptr_t MXSemaHandle;
+#else
+typedef int MXSemaHandle;
+#endif
+
+/*
+ * Define type for poll device handles.
+ */
+
+typedef int64 PollDevHandle;
+
+/*
+ * Define the utf16_t type.
+ */
+
+#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED)
+typedef wchar_t utf16_t;
+#else
+typedef uint16 utf16_t;
+#endif
+
+/*
+ * Define for point and rectangle types. Defined here so they
+ * can be used by other externally facing headers in bora/public.
+ */
+
+typedef struct VMPoint {
+ int x, y;
+} VMPoint;
+
+#if defined _WIN32 && defined USERLEVEL
+struct tagRECT;
+typedef struct tagRECT VMRect;
+#else
+typedef struct VMRect {
+ int left;
+ int top;
+ int right;
+ int bottom;
+} VMRect;
+#endif
+
+/*
+ * ranked locks "everywhere"
+ */
+
+typedef uint32 MX_Rank;
+
+#endif /* _VM_BASIC_TYPES_H_ */
diff --git a/usr/src/uts/intel/io/vmxnet/vm_device_version.h b/usr/src/uts/intel/io/vmxnet/vm_device_version.h
new file mode 100644
index 0000000000..7046594a6c
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vm_device_version.h
@@ -0,0 +1,246 @@
+/*********************************************************
+ * Copyright (C) 1998 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *********************************************************/
+
+#ifndef VM_DEVICE_VERSION_H
+#define VM_DEVICE_VERSION_H
+
+#define INCLUDE_ALLOW_USERLEVEL
+
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMKERNEL
+#define INCLUDE_ALLOW_VMCORE
+#include "includeCheck.h"
+
+#ifdef _WIN32
+#ifdef __MINGW32__
+#include "initguid.h"
+#else
+#include "guiddef.h"
+#endif
+#endif
+
+/* LSILogic 53C1030 Parallel SCSI controller
+ * LSILogic SAS1068 SAS controller
+ */
+#define PCI_VENDOR_ID_LSILOGIC 0x1000
+#define PCI_DEVICE_ID_LSI53C1030 0x0030
+#define PCI_DEVICE_ID_LSISAS1068 0x0054
+
+/* Our own PCI IDs
+ * VMware SVGA II (Unified VGA)
+ * VMware SVGA (PCI Accelerator)
+ * VMware vmxnet (Idealized NIC)
+ * VMware vmxscsi (Abortive idealized SCSI controller)
+ * VMware chipset (Subsystem ID for our motherboards)
+ * VMware e1000 (Subsystem ID)
+ * VMware vmxnet3 (Uniform Pass Through NIC)
+ * VMware HD Audio codec
+ * VMware HD Audio controller
+ */
+#define PCI_VENDOR_ID_VMWARE 0x15AD
+#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
+#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710
+#define PCI_DEVICE_ID_VMWARE_NET 0x0720
+#define PCI_DEVICE_ID_VMWARE_SCSI 0x0730
+#define PCI_DEVICE_ID_VMWARE_VMCI 0x0740
+#define PCI_DEVICE_ID_VMWARE_CHIPSET 0x1976
+#define PCI_DEVICE_ID_VMWARE_82545EM 0x0750 /* single port */
+#define PCI_DEVICE_ID_VMWARE_82546EB 0x0760 /* dual port */
+#define PCI_DEVICE_ID_VMWARE_EHCI 0x0770
+#define PCI_DEVICE_ID_VMWARE_UHCI 0x0774
+#define PCI_DEVICE_ID_VMWARE_XHCI 0x0778
+#define PCI_DEVICE_ID_VMWARE_1394 0x0780
+#define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790
+#define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0
+#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0
+#define PCI_DEVICE_ID_VMWARE_VMXWIFI 0x07B8
+#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0
+#define PCI_DEVICE_ID_VMWARE_82574 0x07D0
+#define PCI_DEVICE_ID_VMWARE_HDAUDIO_CODEC 0x1975
+#define PCI_DEVICE_ID_VMWARE_HDAUDIO_CONTROLLER 0x1977
+
+/* The hypervisor device might grow. Please leave room
+ * for 7 more subfunctions.
+ */
+#define PCI_DEVICE_ID_VMWARE_HYPER 0x0800
+#define PCI_DEVICE_ID_VMWARE_VMI 0x0801
+
+#define PCI_DEVICE_VMI_CLASS 0x05
+#define PCI_DEVICE_VMI_SUBCLASS 0x80
+#define PCI_DEVICE_VMI_INTERFACE 0x00
+#define PCI_DEVICE_VMI_REVISION 0x01
+
+/* From linux/pci_ids.h:
+ * AMD Lance Ethernet controller
+ * BusLogic SCSI controller
+ * Ensoniq ES1371 sound controller
+ */
+#define PCI_VENDOR_ID_AMD 0x1022
+#define PCI_DEVICE_ID_AMD_VLANCE 0x2000
+#define PCI_VENDOR_ID_BUSLOGIC 0x104B
+#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
+#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
+#define PCI_VENDOR_ID_ENSONIQ 0x1274
+#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371
+
+/* From linux/pci_ids.h:
+ * Intel 82439TX (430 HX North Bridge)
+ * Intel 82371AB (PIIX4 South Bridge)
+ * Intel 82443BX (440 BX North Bridge and AGP Bridge)
+ * Intel 82545EM (e1000, server adapter, single port)
+ * Intel 82546EB (e1000, server adapter, dual port)
+ * Intel HECI (as embedded in ich9m)
+ */
+#define PCI_VENDOR_ID_INTEL 0x8086
+#define PCI_DEVICE_ID_INTEL_82439TX 0x7100
+#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110
+#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112
+#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113
+#define PCI_DEVICE_ID_INTEL_82371AB 0x7111
+#define PCI_DEVICE_ID_INTEL_82443BX 0x7190
+#define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191
+#define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 /* Used when no AGP support */
+#define PCI_DEVICE_ID_INTEL_82545EM 0x100f
+#define PCI_DEVICE_ID_INTEL_82546EB 0x1010
+#define PCI_DEVICE_ID_INTEL_82574 0x10d3
+#define PCI_DEVICE_ID_INTEL_82574_APPLE 0x10f6
+#define PCI_DEVICE_ID_INTEL_HECI 0x2a74
+
+#define E1000E_PCI_DEVICE_ID_CONFIG_STR "e1000e.pci.deviceID"
+#define E1000E_PCI_SUB_VENDOR_ID_CONFIG_STR "e1000e.pci.subVendorID"
+#define E1000E_PCI_SUB_DEVICE_ID_CONFIG_STR "e1000e.pci.subDeviceID"
+
+/*
+ * Intel HD Audio controller and Realtek ALC885 codec.
+ */
+#define PCI_DEVICE_ID_INTEL_631XESB_632XESB 0x269a
+#define PCI_VENDOR_ID_REALTEK 0x10ec
+#define PCI_DEVICE_ID_REALTEK_ALC885 0x0885
+
+
+/*
+ * Fresco Logic xHCI (USB 3.0) Controller
+ */
+#define PCI_VENDOR_ID_FRESCO 0x1B73
+#define PCI_DEVICE_ID_FRESCO_FL1000 0x1000 // Original 1-port chip
+#define PCI_DEVICE_ID_FRESCO_FL1009 0x1009 // New 2-port chip (Driver 3.0.98+)
+#define PCI_DEVICE_ID_FRESCO_FL1400 0x1400 // Unknown (4-port? Dev hardware?)
+
+/*
+ * NEC/Renesas xHCI (USB 3.0) Controller
+ */
+#define PCI_VENDOR_ID_NEC 0x1033
+#define PCI_DEVICE_ID_NEC_UPD720200 0x0194
+#define PCI_REVISION_NEC_UPD720200 0x03
+#define PCI_FIRMWARE_NEC_UPD720200 0x3015
+
+
+/************* Strings for IDE Identity Fields **************************/
+#define VIDE_ID_SERIAL_STR "00000000000000000001" /* Must be 20 Bytes */
+#define VIDE_ID_FIRMWARE_STR "00000001" /* Must be 8 Bytes */
+
+/* No longer than 40 Bytes */
+#define VIDE_ATA_MODEL_STR PRODUCT_GENERIC_NAME " Virtual IDE Hard Drive"
+#define VIDE_ATAPI_MODEL_STR PRODUCT_GENERIC_NAME " Virtual IDE CDROM Drive"
+
+#define ATAPI_VENDOR_ID "NECVMWar" /* Must be 8 Bytes */
+#define ATAPI_PRODUCT_ID PRODUCT_GENERIC_NAME " IDE CDROM" /* Must be 16 Bytes */
+#define ATAPI_REV_LEVEL "1.00" /* Must be 4 Bytes */
+
+#define IDE_NUM_INTERFACES 2 /* support for two interfaces */
+#define IDE_DRIVES_PER_IF 2
+
+/************* Strings for SCSI Identity Fields **************************/
+#define SCSI_DISK_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SCSI Hard Drive"
+#define SCSI_DISK_VENDOR_NAME COMPANY_NAME
+#define SCSI_DISK_REV_LEVEL "1.0"
+#define SCSI_CDROM_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SCSI CDROM Drive"
+#define SCSI_CDROM_VENDOR_NAME COMPANY_NAME
+#define SCSI_CDROM_REV_LEVEL "1.0"
+
+/************* SCSI implementation limits ********************************/
+#define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering
+#define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16
+#define PVSCSI_MAX_DEVICES 255 // 255 (including the controller)
+/*
+ * VSCSI_BV_INTS is the number of uint32's needed for a bit vector
+ * to cover all scsi devices per target.
+ */
+#define VSCSI_BV_INTS CEILING(PVSCSI_MAX_DEVICES, 8 * sizeof (uint32))
+#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS
+#define SCSI_IDE_HOSTED_CHANNEL (SCSI_MAX_CONTROLLERS + 1)
+#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 2)
+
+/************* Strings for the VESA BIOS Identity Fields *****************/
+#define VBE_OEM_STRING COMPANY_NAME " SVGA"
+#define VBE_VENDOR_NAME COMPANY_NAME
+#define VBE_PRODUCT_NAME PRODUCT_GENERIC_NAME
+
+/************* PCI implementation limits ********************************/
+#define PCI_MAX_BRIDGES 15
+
+/************* Ethernet implementation limits ***************************/
+#define MAX_ETHERNET_CARDS 10
+
+/********************** Floppy limits ***********************************/
+#define MAX_FLOPPY_DRIVES 2
+
+/************* PCI Passthrough implementation limits ********************/
+#define MAX_PCI_PASSTHRU_DEVICES 6
+
+/************* USB implementation limits ********************************/
+#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127
+
+/************* Strings for Host USB Driver *******************************/
+
+#ifdef _WIN32
+
+/*
+ * Globally unique ID for the VMware device interface. Define INITGUID before including
+ * this header file to instantiate the variable.
+ */
+DEFINE_GUID(GUID_DEVICE_INTERFACE_VMWARE_USB_DEVICES,
+0x2da1fe75, 0xaab3, 0x4d2c, 0xac, 0xdf, 0x39, 0x8, 0x8c, 0xad, 0xa6, 0x65);
+
+/*
+ * Globally unique ID for the VMware device setup class.
+ */
+DEFINE_GUID(GUID_CLASS_VMWARE_USB_DEVICES,
+0x3b3e62a5, 0x3556, 0x4d7e, 0xad, 0xad, 0xf5, 0xfa, 0x3a, 0x71, 0x2b, 0x56);
+
+/*
+ * This string defines the device ID string of a VMware USB device.
+ * The format is USB\Vid_XXXX&Pid_YYYY, where XXXX and YYYY are the
+ * hexadecimal representations of the vendor and product ids, respectively.
+ *
+ * The official vendor ID for VMware, Inc. is 0x0E0F.
+ * The product id for USB generic devices is 0x0001.
+ */
+#define USB_VMWARE_DEVICE_ID_WIDE L"USB\\Vid_0E0F&Pid_0001"
+#define USB_DEVICE_ID_LENGTH (sizeof(USB_VMWARE_DEVICE_ID_WIDE) / sizeof(WCHAR))
+
+#ifdef UNICODE
+#define USB_PNP_SETUP_CLASS_NAME L"VMwareUSBDevices"
+#define USB_PNP_DRIVER_NAME L"vmusb"
+#else
+#define USB_PNP_SETUP_CLASS_NAME "VMwareUSBDevices"
+#define USB_PNP_DRIVER_NAME "vmusb"
+#endif
+#endif
+
+#endif /* VM_DEVICE_VERSION_H */
diff --git a/usr/src/uts/intel/io/vmxnet/vmnet_def.h b/usr/src/uts/intel/io/vmxnet/vmnet_def.h
new file mode 100644
index 0000000000..6e44aea2bb
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vmnet_def.h
@@ -0,0 +1,91 @@
+/*********************************************************
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+/*
+ * vmnet_def.h
+ *
+ * - definitions which are (mostly) not vmxnet or vlance specific
+ */
+
+#ifndef _VMNET_DEF_H_
+#define _VMNET_DEF_H_
+
+#define INCLUDE_ALLOW_USERLEVEL
+#define INCLUDE_ALLOW_VMCORE
+
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMK_MODULE
+#define INCLUDE_ALLOW_VMKERNEL
+#define INCLUDE_ALLOW_DISTRIBUTE
+#include "includeCheck.h"
+
+#define VMNET_NAME_BUFFER_LEN 128 /* Increased for i18n. */
+#define VMNET_COAL_SCHEME_NAME_LEN 16
+
+
+/*
+ * capabilities - not all of these are implemented in the virtual HW
+ * (eg VLAN support is in the virtual switch) so even vlance
+ * can use them
+ */
+#define VMNET_CAP_SG 0x0001 /* Can do scatter-gather transmits. */
+#define VMNET_CAP_IP4_CSUM 0x0002 /* Can checksum only TCP/UDP over IPv4. */
+#define VMNET_CAP_HW_CSUM 0x0004 /* Can checksum all packets. */
+#define VMNET_CAP_HIGH_DMA 0x0008 /* Can DMA to high memory. */
+#define VMNET_CAP_TOE 0x0010 /* Supports TCP/IP offload. */
+#define VMNET_CAP_TSO 0x0020 /* Supports TCP Segmentation offload */
+#define VMNET_CAP_SW_TSO 0x0040 /* Supports SW TCP Segmentation */
+#define VMNET_CAP_VMXNET_APROM 0x0080 /* Vmxnet APROM support */
+#define VMNET_CAP_HW_TX_VLAN 0x0100 /* Can we do VLAN tagging in HW */
+#define VMNET_CAP_HW_RX_VLAN 0x0200 /* Can we do VLAN untagging in HW */
+#define VMNET_CAP_SW_VLAN 0x0400 /* Can we do VLAN tagging/untagging in SW */
+#define VMNET_CAP_WAKE_PCKT_RCV 0x0800 /* Can wake on network packet recv? */
+#define VMNET_CAP_ENABLE_INT_INLINE 0x1000 /* Enable Interrupt Inline */
+#define VMNET_CAP_ENABLE_HEADER_COPY 0x2000 /* copy header for vmkernel */
+#define VMNET_CAP_TX_CHAIN 0x4000 /* Guest can use multiple tx entries for a pkt */
+#define VMNET_CAP_RX_CHAIN 0x8000 /* a pkt can span multiple rx entries */
+#define VMNET_CAP_LPD 0x10000 /* large pkt delivery */
+#define VMNET_CAP_BPF 0x20000 /* BPF Support in VMXNET Virtual Hardware */
+#define VMNET_CAP_SG_SPAN_PAGES 0x40000 /* Can do scatter-gather span multiple pages transmits. */
+#define VMNET_CAP_IP6_CSUM 0x80000 /* Can do IPv6 csum offload. */
+#define VMNET_CAP_TSO6 0x100000 /* Can do TSO segmentation offload for IPv6 pkts. */
+#define VMNET_CAP_TSO256k 0x200000 /* Can do TSO segmentation offload for pkts up to 256kB. */
+#define VMNET_CAP_UPT 0x400000 /* Support UPT */
+#define VMNET_CAP_RDONLY_INETHDRS 0x800000 /* Modifies inet headers for TSO/CSUm */
+#define VMNET_CAP_NPA 0x1000000 /* Support NPA */
+#define VMNET_CAP_DCB 0x2000000 /* Support DCB */
+#define VMNET_CAP_OFFLOAD_8OFFSET 0x4000000 /* supports 8bit parameterized offsets */
+#define VMNET_CAP_OFFLOAD_16OFFSET 0x8000000 /* supports 16bit parameterized offsets */
+#define VMNET_CAP_IP6_CSUM_EXT_HDRS 0x10000000 /* support csum of ip6 ext hdrs */
+#define VMNET_CAP_TSO6_EXT_HDRS 0x20000000 /* support TSO for ip6 ext hdrs */
+#define VMNET_CAP_SCHED 0x40000000 /* compliant with network scheduling */
+#endif // _VMNET_DEF_H_
diff --git a/usr/src/uts/intel/io/vmxnet/vmxnet.c b/usr/src/uts/intel/io/vmxnet/vmxnet.c
new file mode 100644
index 0000000000..e0046d8deb
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vmxnet.c
@@ -0,0 +1,2438 @@
+/*********************************************************
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/debug.h>
+#include <sys/stropts.h>
+#include <sys/stream.h>
+#include <sys/strlog.h>
+#include <sys/kmem.h>
+#include <sys/stat.h>
+#include <sys/kstat.h>
+#include <sys/vtrace.h>
+#include <sys/dlpi.h>
+#include <sys/strsun.h>
+#include <sys/ethernet.h>
+#include <sys/modctl.h>
+#include <sys/errno.h>
+#include <sys/ddi.h>
+#include <sys/sunddi.h>
+#include <sys/ddi_impldefs.h>
+#include <sys/gld.h>
+#include <sys/pci.h>
+#include <sys/strsubr.h>
+
+/*
+ * This used to be defined in sys/gld.h, but was flagged as private,
+ * and we used it anyway. Now it no longer exists, and we're stuck
+ * with it for the time being.
+ */
+#ifndef GLD_MAX_MULTICAST
+#define GLD_MAX_MULTICAST 64
+#endif
+
+#define __intptr_t_defined
+#define _STDINT_H
+#include "vm_basic_types.h"
+#include "vmxnet2_def.h"
+#include "vm_device_version.h"
+#include "net.h"
+#include "buildNumber.h"
+
+#define SOLVMXNET_SUCCESS 1
+#define SOLVMXNET_FAILURE 0
+
+#ifdef SOLVMXNET_DEBUG_LEVEL
+static int vxn_debug = SOLVMXNET_DEBUG_LEVEL;
+#define DPRINTF(n, args) if (vxn_debug>(n)) cmn_err args
+#else
+#define DPRINTF(n, args)
+#endif
+
+static char ident[] = "VMware Ethernet Adapter b" BUILD_NUMBER_NUMERIC_STRING;
+char _depends_on[] = {"misc/gld"};
+
+#define MAX_NUM_RECV_BUFFERS 128
+#define DEFAULT_NUM_RECV_BUFFERS 100
+#define MAX_NUM_XMIT_BUFFERS 128
+#define DEFAULT_NUM_XMIT_BUFFERS 100
+#define CRC_POLYNOMIAL_LE 0xedb88320UL
+#define SOLVMXNET_MAXNAME 20
+#define MAX_TX_WAIT_ON_STOP 2000
+
+#define ETHERALIGN 2
+#define SLACKBYTES 4
+#define MAXPKTBUF (14 + ETHERALIGN + ETHERMTU + SLACKBYTES)
+
+
+#define QHIWATER (MAX_NUM_RECV_BUFFERS*ETHERMTU)
+
+#define OUTB(dp, p, v) \
+ ddi_put8((dp)->vxnIOHdl, \
+ (uint8_t *)((caddr_t)((dp)->vxnIOp) + (p)), v)
+#define OUTW(dp, p, v) \
+ ddi_put16((dp)->vxnIOHdl, \
+ (uint16_t *)((caddr_t)((dp)->vxnIOp) + (p)), v)
+#define OUTL(dp, p, v) \
+ ddi_put32((dp)->vxnIOHdl, \
+ (uint32_t *)((caddr_t)((dp)->vxnIOp) + (p)), v)
+#define INB(dp, p) \
+ ddi_get8((dp)->vxnIOHdl, \
+ (uint8_t *)(((caddr_t)(dp)->vxnIOp) + (p)))
+#define INW(dp, p) \
+ ddi_get16((dp)->vxnIOHdl, \
+ (uint16_t *)(((caddr_t)(dp)->vxnIOp) + (p)))
+#define INL(dp, p) \
+ ddi_get32((dp)->vxnIOHdl, \
+ (uint32_t *)(((caddr_t)(dp)->vxnIOp) + (p)))
+
+#define VMXNET_INC(val, max) \
+ val++; \
+ if (UNLIKELY(val == max)) { \
+ val = 0; \
+ }
+
+#define TX_RINGBUF_MBLK(dp, idx) (dp->txRingBuf[idx].mblk)
+#define TX_RINGBUF_DMAMEM(dp, idx) (dp->txRingBuf[idx].dmaMem)
+
+typedef struct {
+ caddr_t buf; /* Virtual address */
+ uint32_t phyBuf; /* Physical address */
+ size_t bufLen; /* Buffer length */
+ ddi_dma_cookie_t cookie; /* Dma cookie */
+ uint_t cookieCount; /* Cookie count */
+ ddi_dma_handle_t dmaHdl; /* Dma handle */
+ ddi_acc_handle_t dataAccHdl; /* Dada access handle */
+} dma_buf_t;
+
+typedef struct rx_dma_buf {
+ dma_buf_t dmaDesc; /* Dma descriptor */
+ mblk_t *mblk; /* Streams message block */
+ frtn_t freeCB; /* Free callback */
+ struct vxn_softc *softc; /* Back pointer to softc */
+ struct rx_dma_buf *next; /* Next one in list */
+} rx_dma_buf_t;
+
+typedef struct vxn_stats {
+ uint32_t errxmt; /* Transmit errors */
+ uint32_t errrcv; /* Receive errors */
+ uint32_t runt; /* Runt packets */
+ uint32_t norcvbuf; /* Buffer alloc errors */
+ uint32_t interrupts; /* Interrupts */
+ uint32_t defer; /* Deferred transmits */
+} vxn_stats_t;
+
+typedef struct tx_ring_buf {
+ mblk_t *mblk;
+ dma_buf_t dmaMem;
+} tx_ring_buf_t;
+
+typedef struct vxn_softc {
+ char drvName[SOLVMXNET_MAXNAME]; /* Driver name string */
+ int unit; /* Driver instance */
+ vxn_stats_t stats; /* Stats */
+
+ dev_info_t *dip; /* Info pointer */
+ ddi_iblock_cookie_t iblockCookie; /* Interrupt block cookie */
+ gld_mac_info_t *macInfo; /* GLD mac info */
+ ddi_acc_handle_t confHdl; /* Configuration space handle */
+ ddi_acc_handle_t vxnIOHdl; /* I/O space handle */
+ caddr_t vxnIOp; /* I/O space pointer */
+ boolean_t morphed; /* Adapter morphed ? */
+
+ kmutex_t intrlock; /* Interrupt lock */
+ kmutex_t xmitlock; /* Transmit lock */
+ kmutex_t rxlistlock; /* Rx free pool lock */
+
+ boolean_t nicActive; /* NIC active flag */
+ boolean_t inIntr; /* Interrupt processing flag */
+
+ struct ether_addr devAddr; /* MAC address */
+
+ uint32_t vxnNumRxBufs; /* Number of reveice buffers */
+ uint32_t vxnNumTxBufs; /* Number of transmit buffers */
+
+ dma_buf_t driverDataDmaMem; /* Driver Data (dma handle) */
+ Vmxnet2_DriverData *driverData; /* Driver Data */
+ void *driverDataPhy; /* Driver Data busaddr pointer */
+ Vmxnet2_RxRingEntry *rxRing; /* Receive ring */
+ Vmxnet2_TxRingEntry *txRing; /* Transmit ring */
+ ddi_dma_handle_t txDmaHdl; /* Tx buffers dma handle */
+ rx_dma_buf_t *rxRingBuffPtr[MAX_NUM_RECV_BUFFERS];
+ /* DMA buffers associated with rxRing */
+ tx_ring_buf_t txRingBuf[MAX_NUM_XMIT_BUFFERS]; /* tx Ring buffers */
+
+ rx_dma_buf_t *rxFreeBufList;
+ uint32_t rxNumFreeBufs; /* current # of buffers in pool */
+ uint32_t rxMaxFreeBufs; /* max # of buffers in pool */
+
+ uint32_t txPending; /* Pending transmits */
+ uint32_t maxTxFrags; /* Max Tx fragments */
+
+ int multiCount; /* Multicast address count */
+ struct ether_addr multicastList[GLD_MAX_MULTICAST]; /* Multicast list */
+
+ struct vxn_softc *next; /* Circular list of instances */
+ struct vxn_softc *prev;
+} vxn_softc_t;
+
+/* used for rx buffers or buffers allocated by ddi_dma_mem_alloc() */
+static ddi_dma_attr_t vxn_dma_attrs = {
+ DMA_ATTR_V0, /* dma_attr version */
+ 0, /* dma_attr_addr_lo */
+ (uint64_t)0xFFFFFFFF, /* dma_attr_addr_hi */
+ 0x7FFFFFFF, /* dma_attr_count_max */
+ 4, /* dma_attr_align */
+ 0x3F, /* dma_attr_burstsizes */
+ 1, /* dma_attr_minxfer */
+ (uint64_t)0xFFFFFFFF, /* dma_attr_maxxfer */
+ (uint64_t)0xFFFFFFFF, /* dma_attr_seg */
+ 1, /* dma_attr_sgllen */
+ 1, /* dma_attr_granular */
+ 0, /* dma_attr_flags */
+};
+
+/* used for tx buffers */
+static ddi_dma_attr_t vxn_dma_attrs_tx = {
+ DMA_ATTR_V0, /* dma_attr version */
+ 0, /* dma_attr_addr_lo */
+ (uint64_t)0xFFFFFFFF, /* dma_attr_addr_hi */
+ 0x7FFFFFFF, /* dma_attr_count_max */
+ 1, /* dma_attr_align */
+ 0x3F, /* dma_attr_burstsizes */
+ 1, /* dma_attr_minxfer */
+ (uint64_t)0xFFFFFFFF, /* dma_attr_maxxfer */
+ (uint64_t)0xFFFFFFFF, /* dma_attr_seg */
+ 1, /* dma_attr_sgllen */
+ 1, /* dma_attr_granular */
+ 0, /* dma_attr_flags */
+};
+
+
+static struct ether_addr etherbroadcastaddr = {
+ {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
+};
+
+static struct ddi_device_acc_attr vxn_buf_attrs = {
+ DDI_DEVICE_ATTR_V0,
+ DDI_STRUCTURE_LE_ACC,
+ DDI_STRICTORDER_ACC
+};
+
+static struct ddi_device_acc_attr dev_attr = {
+ DDI_DEVICE_ATTR_V0,
+ DDI_STRUCTURE_LE_ACC,
+ DDI_STRICTORDER_ACC
+};
+
+static vxn_softc_t vxnList; /* for debugging */
+static kmutex_t vxnListLock;
+
+static void *Vxn_Memset(void *s, int c, size_t n);
+static int Vxn_Reset(gld_mac_info_t *macInfo);
+static int Vxn_SetPromiscuous(gld_mac_info_t *macInfo, int flag);
+static int Vxn_GetStats(gld_mac_info_t *macInfo, struct gld_stats *gs);
+static void Vxn_ApplyAddressFilter(vxn_softc_t *dp);
+static int Vxn_SetMulticast(gld_mac_info_t *macinfo, uint8_t *ep, int flag);
+static int Vxn_SetMacAddress(gld_mac_info_t *macInfo, uint8_t *mac);
+static int Vxn_Start(gld_mac_info_t *macInfo);
+static int Vxn_Stop(gld_mac_info_t *macInfo);
+static void Vxn_FreeTxBuf(vxn_softc_t *dp, int idx);
+static int Vxn_EncapTxBuf(vxn_softc_t *dp, mblk_t *mp, Vmxnet2_TxRingEntry *xre,
+ tx_ring_buf_t *txBuf);
+static int Vxn_Send(gld_mac_info_t *macinfo, mblk_t *mp);
+static boolean_t Vxn_TxComplete(vxn_softc_t *dp, boolean_t *reschedp);
+static boolean_t Vxn_Receive(vxn_softc_t *dp);
+static u_int Vxn_Interrupt(gld_mac_info_t *macInfo);
+static void Vxn_ReclaimRxBuf(rx_dma_buf_t *rxDesc);
+static void Vxn_FreeRxBuf(rx_dma_buf_t *rxDesc);
+static rx_dma_buf_t *Vxn_AllocRxBuf(vxn_softc_t *dp, int cansleep);
+static void Vxn_FreeInitBuffers(vxn_softc_t *dp);
+static int Vxn_AllocInitBuffers(vxn_softc_t *dp);
+static void Vxn_FreeDmaMem(dma_buf_t *dma);
+static int Vxn_AllocDmaMem(vxn_softc_t *dp, int size, int cansleep, dma_buf_t *dma);
+static void Vxn_FreeDriverData(vxn_softc_t *dp);
+static int Vxn_AllocDriverData(vxn_softc_t *dp);
+static int Vxn_Attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
+static int Vxn_Detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
+static int Vxn_AllocRxBufPool(vxn_softc_t *dp);
+static void Vxn_FreeRxBufPool(vxn_softc_t *dp);
+static rx_dma_buf_t * Vxn_AllocRxBufFromPool(vxn_softc_t *dp);
+static void Vxn_FreeRxBufToPool(rx_dma_buf_t *rxDesc);
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Memset --
+ * memset() (Because bzero does not get resolved by module loader)
+ *
+ * Results:
+ * pointer to the memory area s
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void *
+Vxn_Memset(void *s, int c, size_t n)
+{
+ while (n--) {
+ ((uint8_t *)s)[n] = c;
+ }
+
+ return s;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Reset --
+ * Stub routine to reset hardware. Presently does nothing. Start/Stop should
+ * take care of resets.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_Reset(gld_mac_info_t *macInfo)
+{
+ return GLD_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_SetPromiscuous --
+ * Set/Reset NIC to/from promiscuous mode
+ *
+ * Results:
+ * GLD_SUCCESS
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_SetPromiscuous(gld_mac_info_t *macInfo, int flag)
+{
+ vxn_softc_t *dp = (vxn_softc_t *)macInfo->gldm_private;
+ Vmxnet2_DriverData *dd = dp->driverData;
+
+ mutex_enter(&dp->intrlock);
+ if (flag == GLD_MAC_PROMISC_PHYS) {
+ dd->ifflags |= VMXNET_IFF_PROMISC;
+ } else if (flag == GLD_MAC_PROMISC_MULTI) {
+ /*
+ * This should really set VMXNET_IFF_ALLMULTI,
+ * but unfortunately it doesn't exist. The next
+ * best thing would be to set the LADRFs to all
+ * 0xFFs and set VMXNET_IFF_MULTICAST, but that
+ * opens up a whole new set of potential pitfalls,
+ * so this is a reasonable temporary solution.
+ */
+ dd->ifflags |= VMXNET_IFF_PROMISC;
+ } else if (flag == GLD_MAC_PROMISC_NONE) {
+ dd->ifflags &= ~VMXNET_IFF_PROMISC;
+ } else {
+ /* This could be GLD_MAC_PROMISC_NOOP? */
+ mutex_exit(&dp->intrlock);
+ cmn_err(CE_WARN, "%s%d: Vxn_SetPromiscuous: Unexpected mode flag: 0x%x",
+ dp->drvName, dp->unit, flag);
+
+ return GLD_FAILURE;
+ }
+
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_UPDATE_IFF);
+ mutex_exit(&dp->intrlock);
+
+ return GLD_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_GetStats --
+ * Get driver specific stats
+ *
+ * Results:
+ * GLD_SUCCESS
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_GetStats(gld_mac_info_t *macInfo, struct gld_stats *gs)
+{
+ vxn_softc_t *dp = (vxn_softc_t *)macInfo->gldm_private;
+
+ gs->glds_errxmt = dp->stats.errxmt;
+ gs->glds_errrcv = dp->stats.errrcv;
+ gs->glds_short = dp->stats.runt;
+ gs->glds_norcvbuf = dp->stats.norcvbuf;
+ gs->glds_intr = dp->stats.interrupts;
+ gs->glds_defer = dp->stats.defer;
+
+ return GLD_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_ApplyAddressFilter --
+ * Go over multicast list and compute/apply address filter
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_ApplyAddressFilter(vxn_softc_t *dp)
+{
+ uint8_t *ep;
+ int i, j, bit, byte;
+ uint32_t crc, poly = CRC_POLYNOMIAL_LE;
+ Vmxnet2_DriverData *dd = dp->driverData;
+ volatile uint16_t *mcastTable = (uint16_t *)dd->LADRF;
+
+ ASSERT(MUTEX_HELD(&dp->intrlock));
+
+ /* clear the multicast filter */
+ dd->LADRF[0] = 0;
+ dd->LADRF[1] = 0;
+
+ for (i = 0; i < dp->multiCount; i++) {
+ crc = 0xffffffff;
+ ep = (uint8_t *)&dp->multicastList[i].ether_addr_octet;
+
+ for (byte = 0; byte < 6; byte++) {
+ for (bit = *ep++, j = 0; j < 8; j++, bit >>= 1) {
+ int test;
+
+ test = ((bit ^ crc) & 0x01);
+ crc >>= 1;
+
+ if (test) {
+ crc = crc ^ poly;
+ }
+ }
+ }
+
+ crc = crc >> 26;
+ mcastTable[crc >> 4] |= 1 << (crc & 0xf);
+ }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_SetMulticast --
+ * Add delete entry from multicast list
+ *
+ * Results:
+ * GLD_FAILURE on failure
+ * GLD_SUCCESS on success
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_SetMulticast(gld_mac_info_t *macinfo, uint8_t *ep, int flag)
+{
+ int i;
+ int copyLen;
+ vxn_softc_t *dp = (vxn_softc_t *)macinfo->gldm_private;
+ Vmxnet2_DriverData *dd = dp->driverData;
+
+ if (flag == GLD_MULTI_ENABLE) {
+ /*
+ * Exceeded multicast address limit
+ */
+ if (dp->multiCount >= GLD_MAX_MULTICAST) {
+ return GLD_FAILURE;
+ }
+
+ /*
+ * Add mac address to multicast list
+ */
+ bcopy(ep, dp->multicastList[dp->multiCount].ether_addr_octet,
+ ETHERADDRL);
+ dp->multiCount++;
+ }
+ else {
+ for (i=0; i<dp->multiCount; i++) {
+ if (bcmp(ep, dp->multicastList[i].ether_addr_octet, ETHERADDRL) == 0) {
+ goto found;
+ }
+ }
+ return GLD_FAILURE;
+
+ found:
+ /*
+ * Delete mac address from multicast list
+ */
+ copyLen = (dp->multiCount - (i+1)) * sizeof(struct ether_addr);
+ if (copyLen > 0) {
+ bcopy(&dp->multicastList[i+1], &dp->multicastList[i], copyLen);
+ }
+ dp->multiCount--;
+ }
+
+ /*
+ * Compute address filter from list of addressed and apply it
+ */
+ mutex_enter(&dp->intrlock);
+ Vxn_ApplyAddressFilter(dp);
+
+ if (dp->multiCount) {
+ ASSERT(dd->LADRF[0] || dd->LADRF[1]);
+ dd->ifflags |= VMXNET_IFF_MULTICAST;
+ } else {
+ ASSERT(!(dd->LADRF[0] || dd->LADRF[1]));
+ dd->ifflags &= ~VMXNET_IFF_MULTICAST;
+ }
+
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_UPDATE_IFF);
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_UPDATE_LADRF);
+ mutex_exit(&dp->intrlock);
+
+ return GLD_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_SetMacAddress --
+ * Change device MAC address
+ *
+ * Results:
+ * GLD_SUCCESS
+ * GLD_FAILURE
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_SetMacAddress(gld_mac_info_t *macInfo, uint8_t *mac)
+{
+ int i;
+ int err = GLD_SUCCESS;
+ vxn_softc_t * dp = (vxn_softc_t *)macInfo->gldm_private;
+
+ mutex_enter(&dp->intrlock);
+ mutex_enter(&dp->xmitlock);
+
+ /*
+ * Don't change MAC address on a running NIC
+ */
+ if (dp->nicActive) {
+ err = GLD_FAILURE;
+ goto out;
+ }
+
+ /*
+ * Save new MAC address
+ */
+ for (i = 0; i < 6; i++) {
+ dp->devAddr.ether_addr_octet[i] = mac[i];
+ }
+
+ /*
+ * Push new MAC address down into hardware
+ */
+ for (i = 0; i < 6; i++) {
+ OUTB(dp, VMXNET_MAC_ADDR + i, mac[i]);
+ }
+
+out:
+ mutex_exit(&dp->xmitlock);
+ mutex_exit(&dp->intrlock);
+ return err;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Start --
+ * Device start routine. Called on "ifconfig plumb"
+ *
+ * Results:
+ * GLD_SUCCESS
+ * GLD_FAILURE
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_Start(gld_mac_info_t *macInfo)
+{
+ int err = GLD_SUCCESS;
+ uint32_t r, capabilities, features;
+ vxn_softc_t * dp = (vxn_softc_t *)macInfo->gldm_private;
+
+ mutex_enter(&dp->intrlock);
+ mutex_enter(&dp->xmitlock);
+
+ if (!dp->nicActive) {
+ /*
+ * Register ring structure with hardware
+ *
+ * This downcast is OK because we requested a 32-bit physical address
+ */
+ OUTL(dp, VMXNET_INIT_ADDR, (uint32_t)(uintptr_t)dp->driverDataPhy);
+ OUTL(dp, VMXNET_INIT_LENGTH, dp->driverData->length);
+
+ /*
+ * Make sure registeration succeded
+ */
+ r = INL(dp, VMXNET_INIT_LENGTH);
+ if (!r) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Start: failed to register ring",
+ dp->drvName, dp->unit);
+ err = GLD_FAILURE;
+ goto out;
+ }
+
+ /*
+ * Get maximum tx fragments supported
+ */
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_GET_CAPABILITIES);
+ capabilities = INL(dp, VMXNET_COMMAND_ADDR);
+
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_GET_FEATURES);
+ features = INL(dp, VMXNET_COMMAND_ADDR);
+
+ DPRINTF(3, (CE_CONT, "%s%d: chip capabilities=0x%x features=0x%x\n",
+ dp->drvName, dp->unit, capabilities, features));
+
+ if ((capabilities & VMNET_CAP_SG) &&
+ (features & VMXNET_FEATURE_ZERO_COPY_TX)) {
+ dp->maxTxFrags = VMXNET2_SG_DEFAULT_LENGTH;
+ } else {
+ dp->maxTxFrags = 1;
+ }
+ ASSERT(dp->maxTxFrags >= 1);
+
+ /*
+ * Alloc Tx DMA handle
+ */
+ vxn_dma_attrs_tx.dma_attr_sgllen = dp->maxTxFrags;
+ if (ddi_dma_alloc_handle(dp->dip, &vxn_dma_attrs_tx, DDI_DMA_SLEEP,
+ NULL, &dp->txDmaHdl) != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Start: failed to alloc tx dma handle",
+ dp->drvName, dp->unit);
+ err = GLD_FAILURE;
+ goto out;
+ }
+
+ /*
+ * Enable interrupts on the card
+ */
+ dp->driverData->ifflags |= VMXNET_IFF_BROADCAST | VMXNET_IFF_DIRECTED;
+
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_INTR_ENABLE);
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_UPDATE_IFF);
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_UPDATE_LADRF);
+
+ dp->nicActive = TRUE;
+ }
+
+out:
+ mutex_exit(&dp->xmitlock);
+ mutex_exit(&dp->intrlock);
+ return err;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Stop --
+ * Device stop routine. Called on "ifconfig unplumb"
+ *
+ * Results:
+ * GLD_SUCCESS
+ * GLD_FAILURE
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_Stop(gld_mac_info_t *macInfo)
+{
+ int i;
+ int err = GLD_SUCCESS;
+ vxn_softc_t * dp = (vxn_softc_t *)macInfo->gldm_private;
+ boolean_t resched;
+
+ mutex_enter(&dp->intrlock);
+ mutex_enter(&dp->xmitlock);
+
+ if (!dp->nicActive) {
+ goto out;
+ }
+
+ /*
+ * Disable interrupts
+ */
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_INTR_DISABLE);
+
+ /*
+ * Wait for pending transmits
+ */
+ if (dp->txPending) {
+ for (i=0; i < MAX_TX_WAIT_ON_STOP && dp->txPending; i++) {
+ delay(drv_usectohz(1000));
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_CHECK_TX_DONE);
+ (void) Vxn_TxComplete(dp, &resched);
+ /*
+ * Don't worry about rescheduling transmits - GLD handles
+ * this automatically.
+ */
+ }
+ }
+ if (dp->txPending) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Stop: giving up on %d pending transmits",
+ dp->drvName, dp->unit, dp->txPending);
+ }
+
+ OUTL(dp, VMXNET_INIT_ADDR, 0);
+ dp->nicActive = FALSE;
+
+ /*
+ * Free Tx DMA handle
+ *
+ * The ddi_dma_free_handle() man page says that ddi_dma_unbind_handle() must be called
+ * prior to calling ddi_dma_free_handle().
+ * However, call to ddi_dma_unbind_handle() is not required here, because
+ * ddi_dma_addr_bind_handle() and matching ddi_dma_unbind_handle() are called from
+ * Vxn_EncapTxBuf().
+ * xmitlock is held in Vxn_EncapTxBuf() as well as acquired above in Vxn_Stop().
+ */
+ ddi_dma_free_handle(&dp->txDmaHdl);
+ dp->txDmaHdl = NULL;
+
+out:
+ mutex_exit(&dp->xmitlock);
+ mutex_exit(&dp->intrlock);
+ return err;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeTxBuf --
+ * Free transmit buffer
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeTxBuf(vxn_softc_t *dp, int idx)
+{
+ mblk_t **txMblkp = &TX_RINGBUF_MBLK(dp, idx);
+ dma_buf_t *dmaMem = &TX_RINGBUF_DMAMEM(dp, idx);
+
+ if (*txMblkp) {
+ freemsg(*txMblkp);
+ *txMblkp = NULL;
+ }
+
+ if (dmaMem->buf) {
+ Vxn_FreeDmaMem(dmaMem);
+ ASSERT(dmaMem->buf == NULL);
+ }
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_EncapTxBuf --
+ * Go over dma mappings of Tx buffers and drop buffer physical address
+ * into ring entry
+ *
+ * Results:
+ * SOLVMXNET_SUCCESS on success
+ * SOLVMXNET_FAILURE on failure
+ *
+ * Side effects:
+ * None
+ *---------------- -------------------------------------------------------------
+ */
+static int
+Vxn_EncapTxBuf(vxn_softc_t *dp,
+ mblk_t *mp,
+ Vmxnet2_TxRingEntry *xre,
+ tx_ring_buf_t *txBuf)
+{
+ int frag;
+ int fragcount;
+ int rval;
+ mblk_t *tp;
+ mblk_t *mblk;
+ boolean_t needPullup = FALSE;
+ boolean_t dmaMemAlloced = FALSE;
+
+ ASSERT(txBuf);
+ ASSERT(txBuf->mblk == NULL);
+ ASSERT(MUTEX_HELD(&dp->xmitlock));
+
+ xre->sg.length = 0;
+ xre->flags = 0;
+
+ fragcount = 0;
+ for (tp = mp; tp != NULL; tp = tp->b_cont) {
+ fragcount++;
+ }
+ if (fragcount > dp->maxTxFrags) {
+ needPullup = TRUE;
+ }
+
+pullup:
+ frag = 0;
+ if (needPullup) {
+ if (!(mblk = msgpullup(mp, -1))) {
+ cmn_err(CE_WARN, "%s%d: Vxn_EncapTxBuf: msgpullup failed",
+ dp->drvName, dp->unit);
+ goto err;
+ }
+ } else {
+ mblk = mp;
+ }
+
+ /*
+ * Go through message chain and drop packet pointers into ring
+ * scatter/gather array
+ */
+ for (tp = mblk; tp != NULL; tp = tp->b_cont) {
+
+ uint_t nCookies;
+ ddi_dma_cookie_t dmaCookie;
+ int len = tp->b_wptr - tp->b_rptr;
+
+ if (len) {
+ /*
+ * Associate tx buffer with dma handle
+ */
+ ASSERT(dp->txDmaHdl);
+ if ((rval = ddi_dma_addr_bind_handle(dp->txDmaHdl, NULL, (caddr_t)tp->b_rptr,
+ len, DDI_DMA_RDWR | DDI_DMA_STREAMING,
+ DDI_DMA_DONTWAIT, NULL,
+ &dmaCookie, &nCookies))
+ != DDI_DMA_MAPPED) {
+
+ /*
+ * Try to handle bind failure caused by a page boundary spill
+ * by allocating a private dma buffer and copying data into it
+ */
+ if ((rval == DDI_DMA_TOOBIG) && !dmaMemAlloced ) {
+ /*
+ * Force pullup
+ */
+ if (!needPullup && (dp->maxTxFrags > 1)) {
+ needPullup = TRUE;
+ goto pullup;
+ }
+
+ if (Vxn_AllocDmaMem(dp, len, FALSE, &txBuf->dmaMem)
+ != SOLVMXNET_SUCCESS) {
+ goto err;
+ }
+
+ dmaMemAlloced = TRUE;
+
+ /*
+ * Copy data into DMA capable buffer
+ */
+ bcopy(tp->b_rptr, txBuf->dmaMem.buf, len);
+
+ /*
+ * Stick buffer physical addr in the ring
+ */
+ xre->sg.sg[frag].addrLow = txBuf->dmaMem.phyBuf;
+ xre->sg.sg[frag].length = len;
+ frag++;
+
+ continue;
+
+ } else {
+ cmn_err(CE_WARN, "%s%d: Vxn_EncapTxBuf: failed (%d) to bind dma "
+ "handle for len %d. [dmaMemAlloced=%d]",
+ dp->drvName, dp->unit, rval, len, dmaMemAlloced);
+ goto err;
+ }
+ }
+
+ /*
+ * Extract tx buffer physical addresses from cookie
+ */
+ while (nCookies) {
+ if (UNLIKELY(frag == dp->maxTxFrags)) {
+ (void)ddi_dma_unbind_handle(dp->txDmaHdl);
+
+ if (!needPullup) {
+ ASSERT(!dmaMemAlloced);
+ needPullup = TRUE;
+ goto pullup;
+ } else {
+ cmn_err(CE_WARN, "%s%d: Vxn_EncapTxBuf: "
+ "exceeded max (%d) fragments in message",
+ dp->drvName, dp->unit, dp->maxTxFrags);
+ goto err;
+ }
+ }
+
+ /*
+ * Stick it in the ring
+ */
+ xre->sg.sg[frag].addrLow = dmaCookie.dmac_address;
+ xre->sg.sg[frag].length = dmaCookie.dmac_size;
+ frag++;
+
+ if (--nCookies) {
+ ddi_dma_nextcookie(dp->txDmaHdl, &dmaCookie);
+ }
+ }
+
+ (void)ddi_dma_unbind_handle(dp->txDmaHdl);
+ }
+ }
+
+ if (frag > 0) {
+ xre->sg.length = frag;
+
+ /* Give ownership to NIC */
+ xre->sg.addrType = NET_SG_PHYS_ADDR;
+ xre->ownership = VMXNET2_OWNERSHIP_NIC;
+ xre->flags |= VMXNET2_TX_CAN_KEEP;
+ txBuf->mblk = mblk;
+
+ /*
+ * If we called msgpullup to concatenate fragments, free
+ * original mblk now since we're going to return success.
+ */
+ if (mblk != mp) {
+ freemsg(mp);
+ }
+
+ return SOLVMXNET_SUCCESS;
+ }
+
+err:
+ if (mblk != NULL && mblk != mp) {
+ /*
+ * Free mblk allocated by msgpullup.
+ */
+ freemsg(mblk);
+ }
+
+ if (dmaMemAlloced) {
+ ASSERT(txBuf->dmaMem.buf);
+ Vxn_FreeDmaMem(&txBuf->dmaMem);
+ }
+
+ return SOLVMXNET_FAILURE;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Send --
+ * GLD Transmit routine. Starts packet hard tx.
+ *
+ * Results:
+ * GLD_SUCCESS on success
+ * GLD_FAILURE on failure
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_Send(gld_mac_info_t *macinfo, mblk_t *mp)
+{
+ Vmxnet2_TxRingEntry *xre;
+ int err = GLD_SUCCESS;
+ vxn_softc_t *dp = (vxn_softc_t *)macinfo->gldm_private;
+ Vmxnet2_DriverData *dd = dp->driverData;
+ boolean_t resched = FALSE;
+
+ mutex_enter(&dp->xmitlock);
+
+ /*
+ * Check if ring entry at drop pointer is available
+ */
+ if (TX_RINGBUF_MBLK(dp, dd->txDriverNext) != NULL) {
+ DPRINTF(3, (CE_NOTE, "%s%d: Vxn_Send: tx ring full",
+ dp->drvName, dp->unit));
+ err = GLD_NORESOURCES;
+ dd->txStopped = TRUE;
+ dp->stats.defer++;
+ goto out;
+ }
+
+ xre = &dp->txRing[dd->txDriverNext];
+
+ /*
+ * Drop packet into ring entry
+ */
+ if (Vxn_EncapTxBuf(dp, mp, xre, &dp->txRingBuf[dd->txDriverNext])
+ != SOLVMXNET_SUCCESS) {
+ err = GLD_FAILURE;
+ dp->stats.errxmt++;
+ goto out;
+ }
+
+ /*
+ * Increment drop pointer
+ */
+ VMXNET_INC(dd->txDriverNext, dd->txRingLength);
+ dd->txNumDeferred++;
+ dp->txPending++;
+
+ /*
+ * Transmit, if number of pending packets > tx cluster length
+ */
+ if (dd->txNumDeferred >= dd->txClusterLength) {
+ dd->txNumDeferred = 0;
+
+ /*
+ * Call hardware transmit
+ */
+ INL(dp, VMXNET_TX_ADDR);
+ }
+
+ /*
+ * Clean up transmit ring. TX completion interrupts are not guaranteed
+ */
+ (void) Vxn_TxComplete(dp, &resched);
+
+out:
+ mutex_exit(&dp->xmitlock);
+ if (resched) {
+ /* Tell GLD to retry any deferred packets */
+ gld_sched(dp->macInfo);
+ }
+ return err;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_TxComplete --
+ * Scan Tx ring for completed transmits. Reclaim Tx buffers.
+ *
+ * Results:
+ * Returns TRUE if it found a completed transmit, FALSE otherwise.
+ * Also sets *reschedp to TRUE if the caller should call gld_sched
+ * to reschedule transmits (once all locks are dropped).
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static boolean_t
+Vxn_TxComplete(vxn_softc_t *dp, boolean_t *reschedp)
+{
+ Vmxnet2_DriverData *dd = dp->driverData;
+ boolean_t found = FALSE;
+ boolean_t needresched = FALSE;
+
+ ASSERT(MUTEX_HELD(&dp->xmitlock));
+
+ while (1) {
+ Vmxnet2_TxRingEntry *xre = &dp->txRing[dd->txDriverCur];
+
+ if (xre->ownership != VMXNET2_OWNERSHIP_DRIVER ||
+ (TX_RINGBUF_MBLK(dp, dd->txDriverCur) == NULL)) {
+ break;
+ }
+
+ found = TRUE;
+ Vxn_FreeTxBuf(dp, dd->txDriverCur);
+
+ dp->txPending--;
+ VMXNET_INC(dd->txDriverCur, dd->txRingLength);
+ if (dd->txStopped) {
+ needresched = TRUE;
+ dd->txStopped = FALSE;
+ }
+ }
+
+ *reschedp = needresched;
+ return found;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Receive --
+ * Rx handler. First assembles the packets into a chain of mblks,
+ * then drops locks and passes them up the stack to GLD.
+ *
+ * Results:
+ * Returns TRUE if it find a packet ready for processing, FALSE
+ * otherwise.
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static boolean_t
+Vxn_Receive(vxn_softc_t *dp)
+{
+ int ringnext;
+ short pktlen;
+ Vmxnet2_DriverData *dd = dp->driverData;
+ rx_dma_buf_t *rxDesc;
+ rx_dma_buf_t *newRxDesc;
+ mblk_t *mblk;
+ mblk_t *head = NULL;
+ mblk_t **tail = &head;
+ mblk_t *next;
+ boolean_t found = FALSE; /* Did we find at least one packet? */
+
+ ASSERT(MUTEX_HELD(&dp->intrlock));
+
+ /*
+ * Walk receive ring looking for entries with ownership
+ * reverted back to driver
+ */
+ while (1) {
+ Vmxnet2_RxRingEntry *rre;
+ rx_dma_buf_t **rbuf;
+
+ ringnext = dd->rxDriverNext;
+ rre = &dp->rxRing[ringnext];
+ rbuf = &dp->rxRingBuffPtr[ringnext];
+
+ if (rre->ownership != VMXNET2_OWNERSHIP_DRIVER) {
+ break;
+ }
+
+ found = TRUE;
+
+ pktlen = rre->actualLength;
+
+ if (pktlen < (60 - 4)) {
+ /*
+ * Ethernet header vlan tags are 4 bytes. Some vendors generate
+ * 60byte frames including vlan tags. When vlan tag
+ * is stripped, such frames become 60 - 4. (PR106153)
+ */
+ dp->stats.errrcv++;
+ if (pktlen != 0) {
+ DPRINTF(3, (CE_CONT, "%s%d: runt packet\n", dp->drvName, dp->unit));
+ dp->stats.runt++;
+ }
+ } else {
+ /*
+ * Alloc new Rx buffer to replace current one
+ */
+ newRxDesc = Vxn_AllocRxBufFromPool(dp);
+
+ if (newRxDesc) {
+ rxDesc = *rbuf;
+ mblk = rxDesc->mblk;
+
+ *rbuf = newRxDesc;
+ rre->paddr = newRxDesc->dmaDesc.phyBuf + ETHERALIGN;
+ rre->bufferLength = MAXPKTBUF - ETHERALIGN;
+ rre->actualLength = 0;
+
+ /*
+ * Advance write pointer past packet length
+ */
+ mblk->b_wptr = mblk->b_rptr + pktlen;
+
+ /*
+ * Add to end of chain.
+ */
+ mblk->b_next = NULL;
+ *tail = mblk;
+ tail = &mblk->b_next;
+ } else {
+ dp->stats.errrcv++;
+ dp->stats.norcvbuf++;
+ }
+ }
+
+ /* Give the descriptor back to NIC */
+ rre->ownership = VMXNET2_OWNERSHIP_NIC;
+ VMXNET_INC(dd->rxDriverNext, dd->rxRingLength);
+ }
+
+ /*
+ * Walk chain and pass mblks up to gld_recv one by one.
+ */
+ mutex_exit(&dp->intrlock);
+ for (mblk = head; mblk != NULL; mblk = next) {
+ next = mblk->b_next;
+ mblk->b_next = NULL;
+ gld_recv(dp->macInfo, mblk);
+ }
+ mutex_enter(&dp->intrlock);
+
+ return (found);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Interrupt --
+ * GLD interrupt handler. Scan: Rx ring for received packets, Tx ring for
+ * completed transmits
+ *
+ * Results:
+ * - DDI_INTR_CLAIMED (if we found something to do)
+ * - DDI_INTR_UNCLAIMED (if not)
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static u_int
+Vxn_Interrupt(gld_mac_info_t *macInfo)
+{
+ u_int ret = DDI_INTR_UNCLAIMED;
+ vxn_softc_t *dp = (vxn_softc_t *)macInfo->gldm_private;
+ boolean_t foundRx, foundTx;
+ boolean_t resched = FALSE;
+
+ mutex_enter(&dp->intrlock);
+ dp->inIntr = TRUE;
+
+ if (!dp->nicActive) {
+ goto out;
+ }
+
+ /*
+ * Ack interrupt
+ */
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_INTR_ACK);
+
+ foundRx = Vxn_Receive(dp);
+
+ mutex_enter(&dp->xmitlock);
+ foundTx = Vxn_TxComplete(dp, &resched);
+ mutex_exit(&dp->xmitlock);
+
+ if (foundRx || foundTx) {
+ ret = DDI_INTR_CLAIMED;
+ dp->stats.interrupts++;
+ }
+
+out:
+ dp->inIntr = FALSE;
+ mutex_exit(&dp->intrlock);
+
+ if (resched) {
+ gld_sched(dp->macInfo);
+ }
+
+ return ret;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_ReclaimRxBuf --
+ * Callback handler invoked by freemsg(). Frees Rx buffer memory and mappings
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_ReclaimRxBuf(rx_dma_buf_t *rxDesc)
+{
+ Vxn_FreeRxBufToPool(rxDesc);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeRxBuf --
+ * Free allocated Rx buffer
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeRxBuf(rx_dma_buf_t *rxDesc)
+{
+ ASSERT(rxDesc);
+
+ if (rxDesc->mblk) {
+ freemsg(rxDesc->mblk);
+ } else {
+ Vxn_FreeDmaMem(&rxDesc->dmaDesc);
+ kmem_free(rxDesc, sizeof(rx_dma_buf_t));
+ }
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_AllocRxBuf --
+ * Allocate Rx buffer
+ *
+ * Results:
+ * Pointer to Rx buffer descriptor - on success
+ * NULL - on failure
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static rx_dma_buf_t *
+Vxn_AllocRxBuf(vxn_softc_t *dp, int cansleep)
+{
+ rx_dma_buf_t *rxDesc;
+
+ rxDesc = (rx_dma_buf_t *)kmem_zalloc(sizeof(rx_dma_buf_t),
+ cansleep ? KM_SLEEP : KM_NOSLEEP);
+ if (!rxDesc) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocRxBuf: kmem_zalloc failed",
+ dp->drvName, dp->unit);
+ return NULL;
+ }
+
+ rxDesc->softc = dp;
+
+ /*
+ * Alloc dma-able packet memory
+ */
+ if (Vxn_AllocDmaMem(dp, MAXPKTBUF, cansleep, &rxDesc->dmaDesc)
+ != SOLVMXNET_SUCCESS) {
+ kmem_free(rxDesc, sizeof(rx_dma_buf_t));
+ return NULL;
+ }
+
+ /*
+ * Fill in free callback; fired by freemsg()
+ */
+ rxDesc->freeCB.free_func = &Vxn_ReclaimRxBuf;
+ rxDesc->freeCB.free_arg = (caddr_t) rxDesc;
+
+ rxDesc->mblk = NULL;
+ return rxDesc;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeInitBuffers --
+ * Free allocated Tx and Rx buffers
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeInitBuffers(vxn_softc_t *dp)
+{
+ int i;
+
+ for (i=0; i<dp->vxnNumRxBufs; i++) {
+ if (dp->rxRingBuffPtr[i]) {
+ Vxn_FreeRxBuf(dp->rxRingBuffPtr[i]);
+ dp->rxRingBuffPtr[i] = NULL;
+ }
+ }
+
+ for (i=0; i<dp->vxnNumTxBufs; i++) {
+ if (TX_RINGBUF_MBLK(dp, i)) {
+ Vxn_FreeTxBuf(dp, i);
+ }
+ }
+
+ /*
+ * Rx pool must get freed last. Rx buffers above will
+ * show up on the pool when freemsg callback fires.
+ */
+ Vxn_FreeRxBufPool(dp);
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_AllocRxBufPool --
+ * Allocate pool of rx buffers - 3 * configured Rx buffers
+ *
+ * Results:
+ * SOLVMXNET_SUCCESS/SOLVMXNET_FAILURE
+ *
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_AllocRxBufPool(vxn_softc_t *dp)
+{
+ int i;
+
+ dp->rxFreeBufList = NULL;
+
+ // Allow list to double in size if needed. Any additional buffers
+ // that are allocated on the fly will be freed back to main memory.
+ dp->rxMaxFreeBufs = dp->vxnNumRxBufs * 6;
+
+ for (i = 0; i < dp->vxnNumRxBufs * 3; i++) {
+ rx_dma_buf_t *rxDesc;
+
+ /*
+ * Alloc rx buffer
+ */
+ if (!(rxDesc = Vxn_AllocRxBuf(dp, TRUE))) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocRxBufPool: failed to allocate memory",
+ dp->drvName, dp->unit);
+ dp->rxNumFreeBufs = i;
+ return SOLVMXNET_FAILURE;
+ }
+ /*
+ * Add to free list
+ */
+ rxDesc->next = dp->rxFreeBufList;
+ dp->rxFreeBufList = rxDesc;
+ }
+
+ dp->rxNumFreeBufs = i;
+ return SOLVMXNET_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeRxBufPool --
+ * Free rx buffers pool
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeRxBufPool(vxn_softc_t *dp)
+{
+ while (dp->rxFreeBufList) {
+ rx_dma_buf_t *rxDesc = dp->rxFreeBufList;
+
+ /* unlink */
+ dp->rxFreeBufList = rxDesc->next;
+
+ ASSERT(rxDesc->mblk == NULL);
+ Vxn_FreeDmaMem(&rxDesc->dmaDesc);
+ kmem_free(rxDesc, sizeof(rx_dma_buf_t));
+ }
+ dp->rxNumFreeBufs = 0;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_AllocRxBufFromPool --
+ * Allocate Rx buffer from free pool
+ *
+ * Results:
+ * Pointer to Rx buffer descriptor - on success
+ * NULL - on failure
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static rx_dma_buf_t *
+Vxn_AllocRxBufFromPool(vxn_softc_t *dp)
+{
+ rx_dma_buf_t *rxDesc = NULL;
+
+ mutex_enter(&dp->rxlistlock);
+ if (dp->rxFreeBufList) {
+ rxDesc = dp->rxFreeBufList;
+ dp->rxFreeBufList = rxDesc->next;
+ ASSERT(dp->rxNumFreeBufs >= 1);
+ dp->rxNumFreeBufs--;
+ }
+ mutex_exit(&dp->rxlistlock);
+
+ if (!rxDesc) {
+ /*
+ * Try to allocate new descriptor from memory. Can't block here
+ * since we could be being called from interrupt context.
+ */
+ DPRINTF(5, (CE_NOTE, "%s%d: allocating rx buf from memory",
+ dp->drvName, dp->unit));
+ if (!(rxDesc = Vxn_AllocRxBuf(dp, FALSE))) {
+ cmn_err(CE_WARN,
+ "%s%d: Vxn_AllocRxBufFromPool : pool rx alloc failed",
+ dp->drvName, dp->unit);
+ return NULL;
+ }
+ }
+
+ /*
+ * Allocate new message block for this buffer
+ */
+ rxDesc->mblk = desballoc((uchar_t *)rxDesc->dmaDesc.buf + ETHERALIGN,
+ rxDesc->dmaDesc.bufLen - ETHERALIGN,
+ BPRI_MED, &rxDesc->freeCB);
+ if (!rxDesc->mblk) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocRxBufFromPool : desballoc failed",
+ dp->drvName, dp->unit);
+
+ /* put back on free list */
+ Vxn_FreeRxBufToPool(rxDesc);
+ return NULL;
+ }
+
+ return rxDesc;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeRxBufToPool --
+ * Return rx buffer to free pool
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeRxBufToPool(rx_dma_buf_t *rxDesc)
+{
+ vxn_softc_t *dp = rxDesc->softc;
+
+ rxDesc->mblk = NULL;
+
+ /*
+ * Insert on free list, or free if the list is full
+ */
+ mutex_enter(&dp->rxlistlock);
+ if (dp->rxNumFreeBufs >= dp->rxMaxFreeBufs) {
+ DPRINTF(5, (CE_NOTE, "%s%d: freeing rx buf to memory",
+ dp->drvName, dp->unit));
+ Vxn_FreeRxBuf(rxDesc);
+ } else {
+ rxDesc->next = dp->rxFreeBufList;
+ dp->rxFreeBufList = rxDesc;
+ dp->rxNumFreeBufs++;
+ }
+ mutex_exit(&dp->rxlistlock);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_AllocInitBuffers --
+ * Allocated Rx buffers and init ring entries
+ *
+ * Results:
+ * SOLVMXNET_SUCCESS - on success
+ * SOLVMXNET_FAILURE - on failure
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_AllocInitBuffers(vxn_softc_t *dp)
+{
+ Vmxnet2_DriverData *dd;
+ uint32_t i, offset;
+
+ dd = dp->driverData;
+ offset = sizeof(*dd);
+
+ /*
+ * Init shared structures
+ */
+ dd->rxRingLength = dp->vxnNumRxBufs;
+ dd->rxRingOffset = offset;
+ dp->rxRing = (Vmxnet2_RxRingEntry *)((uintptr_t)dd + offset);
+ offset += dp->vxnNumRxBufs * sizeof(Vmxnet2_RxRingEntry);
+
+ dd->rxRingLength2 = 1;
+ dd->rxRingOffset2 = offset;
+ offset += sizeof(Vmxnet2_RxRingEntry);
+
+ dd->txRingLength = dp->vxnNumTxBufs;
+ dd->txRingOffset = offset;
+ dp->txRing = (Vmxnet2_TxRingEntry *)((uintptr_t)dd + offset);
+ offset += dp->vxnNumTxBufs * sizeof(Vmxnet2_TxRingEntry);
+
+ /*
+ * Alloc Rx buffers pool
+ */
+ if ( Vxn_AllocRxBufPool(dp) != SOLVMXNET_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocInitBuffers: failed to alloc buf pool",
+ dp->drvName, dp->unit);
+ return SOLVMXNET_FAILURE;
+ }
+
+ /*
+ * Allocate receive buffers
+ */
+ for (i = 0; i < dp->vxnNumRxBufs; i++) {
+ rx_dma_buf_t *rxDesc;
+ Vmxnet2_RxRingEntry *rre = &dp->rxRing[i];
+
+ if (!(rxDesc = Vxn_AllocRxBufFromPool(dp))) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocInitBuffers: "
+ "failed to alloc buf from pool", dp->drvName, dp->unit);
+ goto err;
+ }
+
+ /*
+ * Init ring entries
+ */
+ rre->paddr = rxDesc->dmaDesc.phyBuf + ETHERALIGN;
+ rre->bufferLength = MAXPKTBUF - ETHERALIGN;
+ rre->actualLength = 0;
+ dp->rxRingBuffPtr[i] = rxDesc;
+ rre->ownership = VMXNET2_OWNERSHIP_NIC;
+ }
+
+ dp->txDmaHdl = NULL;
+
+ /*
+ * Dummy recvRing2 tacked on to the end, with a single unusable entry
+ */
+ dp->rxRing[i].paddr = 0;
+ dp->rxRing[i].bufferLength = 0;
+ dp->rxRing[i].actualLength = 0;
+ dp->rxRingBuffPtr[i] = NULL;
+ dp->rxRing[i].ownership = VMXNET2_OWNERSHIP_DRIVER;
+
+ dd->rxDriverNext = 0;
+
+ /*
+ * Give xmit ring ownership to DRIVER
+ */
+ for (i = 0; i < dp->vxnNumTxBufs; i++) {
+ dp->txRing[i].ownership = VMXNET2_OWNERSHIP_DRIVER;
+ dp->txRingBuf[i].mblk = NULL;
+ dp->txRingBuf[i].dmaMem.buf = NULL;
+ dp->txRing[i].sg.sg[0].addrHi = 0;
+ }
+
+ dd->txDriverCur = dd->txDriverNext = 0;
+ dd->txStopped = FALSE;
+
+ return SOLVMXNET_SUCCESS;
+
+err:
+ for (i=0; i<dp->vxnNumRxBufs; i++) {
+ if (dp->rxRingBuffPtr[i]) {
+ Vxn_FreeRxBuf(dp->rxRingBuffPtr[i]);
+ dp->rxRingBuffPtr[i] = NULL;
+ }
+ }
+
+ Vxn_FreeRxBufPool(dp);
+ return SOLVMXNET_FAILURE;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeDmaMem --
+ * Free allocated dma memory
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeDmaMem(dma_buf_t *dma)
+{
+ ddi_dma_unbind_handle(dma->dmaHdl);
+ ddi_dma_mem_free(&dma->dataAccHdl);
+ ddi_dma_free_handle(&dma->dmaHdl);
+
+ dma->buf = NULL;
+ dma->phyBuf = NULL;
+ dma->bufLen = 0;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_AllocDmaMem --
+ * Allocate dma-able memory and fill passed in dma descriptor pointer
+ * if successful
+ *
+ * Results:
+ * SOLVMXNET_SUCCESS on success
+ * SOLVMXNET_FAILURE on failure
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_AllocDmaMem(vxn_softc_t *dp, int size, int cansleep, dma_buf_t *dma)
+{
+ /*
+ * Allocate handle
+ */
+ if (ddi_dma_alloc_handle(dp->dip, &vxn_dma_attrs,
+ cansleep ? DDI_DMA_SLEEP : DDI_DMA_DONTWAIT,
+ NULL, &dma->dmaHdl) != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocDmaMem: failed to allocate handle",
+ dp->drvName, dp->unit);
+ return SOLVMXNET_FAILURE;
+ }
+
+ /*
+ * Allocate memory
+ */
+ if (ddi_dma_mem_alloc(dma->dmaHdl, size, &vxn_buf_attrs, DDI_DMA_CONSISTENT,
+ cansleep ? DDI_DMA_SLEEP : DDI_DMA_DONTWAIT, NULL,
+ &dma->buf, &dma->bufLen, &dma->dataAccHdl)
+ != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocDmaMem: "
+ "ddi_dma_mem_alloc %d bytes failed",
+ dp->drvName, dp->unit, size);
+ ddi_dma_free_handle(&dma->dmaHdl);
+ return SOLVMXNET_FAILURE;
+ }
+
+ /*
+ * Mapin memory
+ */
+ if (ddi_dma_addr_bind_handle(dma->dmaHdl, NULL, dma->buf, dma->bufLen,
+ DDI_DMA_RDWR | DDI_DMA_STREAMING,
+ cansleep ? DDI_DMA_SLEEP : DDI_DMA_DONTWAIT,
+ NULL, &dma->cookie, &dma->cookieCount)
+ != DDI_DMA_MAPPED) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocDmaMem: failed to bind handle",
+ dp->drvName, dp->unit);
+ ddi_dma_mem_free(&dma->dataAccHdl);
+ ddi_dma_free_handle(&dma->dmaHdl);
+ return SOLVMXNET_FAILURE;
+ }
+
+ if (dma->cookieCount != 1) {
+ cmn_err(CE_WARN, "%s%d: Vxn_AllocDmaMem: too many DMA cookies",
+ dp->drvName, dp->unit);
+ Vxn_FreeDmaMem(dma);
+ return SOLVMXNET_FAILURE;
+ }
+
+ /*
+ * Save physical address (for easy use)
+ */
+ dma->phyBuf = dma->cookie.dmac_address;
+
+ return SOLVMXNET_SUCCESS;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_FreeDriverData --
+ * Free driver data structures and Tx Rx buffers
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static void
+Vxn_FreeDriverData(vxn_softc_t *dp)
+{
+ Vxn_FreeInitBuffers(dp);
+ Vxn_FreeDmaMem(&dp->driverDataDmaMem);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_AllocDriverData --
+ * Allocate driver data structures and Tx Rx buffers on init
+ *
+ * Results:
+ * SOLVMXNET_SUCCESS on success
+ * SOLVMXNET_FAILURE on failure
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_AllocDriverData(vxn_softc_t *dp)
+{
+ uint32_t r, driverDataSize;
+
+ /*
+ * Get configured receive buffers
+ */
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_GET_NUM_RX_BUFFERS);
+ r = INL(dp, VMXNET_COMMAND_ADDR);
+ if (r == 0 || r > MAX_NUM_RECV_BUFFERS) {
+ r = DEFAULT_NUM_RECV_BUFFERS;
+ }
+ dp->vxnNumRxBufs = r;
+
+ /*
+ * Get configured transmit buffers
+ */
+ OUTL(dp, VMXNET_COMMAND_ADDR, VMXNET_CMD_GET_NUM_TX_BUFFERS);
+ r = INL(dp, VMXNET_COMMAND_ADDR);
+ if (r == 0 || r > MAX_NUM_XMIT_BUFFERS) {
+ r = DEFAULT_NUM_XMIT_BUFFERS;
+ }
+ dp->vxnNumTxBufs = r;
+
+ /*
+ * Calculate shared data size and allocate memory for it
+ */
+ driverDataSize =
+ sizeof(Vmxnet2_DriverData) +
+ /* numRecvBuffers + 1 for the dummy recvRing2 (used only by Windows) */
+ (dp->vxnNumRxBufs + 1) * sizeof(Vmxnet2_RxRingEntry) +
+ dp->vxnNumTxBufs * sizeof(Vmxnet2_TxRingEntry);
+
+ if (Vxn_AllocDmaMem(dp, driverDataSize, TRUE, &dp->driverDataDmaMem)
+ != SOLVMXNET_SUCCESS) {
+ return SOLVMXNET_FAILURE;
+ }
+
+ /*
+ * Clear memory (bzero isn't resolved by module loader for some reason)
+ */
+ ASSERT(dp->driverDataDmaMem.buf && dp->driverDataDmaMem.bufLen);
+ Vxn_Memset(dp->driverDataDmaMem.buf, 0, dp->driverDataDmaMem.bufLen);
+
+ dp->driverData = (Vmxnet2_DriverData *)dp->driverDataDmaMem.buf;
+ dp->driverDataPhy = (void *)(uintptr_t)dp->driverDataDmaMem.phyBuf;
+
+ /* So that the vmkernel can check it is compatible */
+ dp->driverData->magic = VMXNET2_MAGIC;
+ dp->driverData->length = driverDataSize;
+
+ /*
+ * Alloc rx/tx buffers, init ring, register with hardware etc.
+ */
+ if (Vxn_AllocInitBuffers(dp) != SOLVMXNET_SUCCESS) {
+ Vxn_FreeDmaMem(&dp->driverDataDmaMem);
+ return SOLVMXNET_FAILURE;
+ }
+
+ DPRINTF(3, (CE_CONT, "%s%d: numRxBufs=(%d*%"FMT64"d) numTxBufs=(%d*%"FMT64"d)"
+ " driverDataSize=%d driverDataPhy=0x%p\n",
+ dp->drvName, dp->unit,
+ dp->vxnNumRxBufs, (uint64_t)sizeof(Vmxnet2_RxRingEntry),
+ dp->vxnNumTxBufs, (uint64_t)sizeof(Vmxnet2_TxRingEntry),
+ driverDataSize, dp->driverDataPhy));
+
+ return SOLVMXNET_SUCCESS;
+}
+
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Attach --
+ * Probe and attach driver to stack
+ *
+ * Results:
+ * DDI_SUCCESS
+ * DDI_FAILURE
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_Attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
+{
+ int i, ret, len, unit;
+ const char *drvName;
+ ddi_acc_handle_t confHdl;
+ uint16_t vid, did;
+ uint8_t revid;
+ struct pci_phys_spec *regs;
+ caddr_t vxnIOp;
+ ddi_acc_handle_t vxnIOHdl;
+ uint32_t vLow, vHigh;
+ gld_mac_info_t *macInfo;
+ vxn_softc_t *dp;
+ boolean_t morphed = FALSE;
+ uint_t regSpaceSize;
+ uint_t chip;
+ uint_t vxnIOSize;
+
+ if (cmd != DDI_ATTACH) {
+ return DDI_FAILURE;
+ }
+
+ unit = ddi_get_instance(dip);
+ drvName = ddi_driver_name(dip);
+
+ /*
+ * Check if chip is supported.
+ */
+ if (pci_config_setup(dip, &confHdl) != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: pci_config_setup() failed", drvName, unit);
+ return DDI_FAILURE;
+ }
+
+ vid = pci_config_get16(confHdl, PCI_CONF_VENID);
+ did = pci_config_get16(confHdl, PCI_CONF_DEVID);
+ revid = pci_config_get8(confHdl, PCI_CONF_REVID);
+
+ if (vid == PCI_VENDOR_ID_VMWARE && did == PCI_DEVICE_ID_VMWARE_NET) {
+ /* Found vmxnet */
+ chip = VMXNET_CHIP;
+ }
+ else if (vid == PCI_VENDOR_ID_AMD && did == PCI_DEVICE_ID_AMD_VLANCE) {
+ /* Found vlance (maybe a vmxnet disguise) */
+ chip = LANCE_CHIP;
+ }
+ else {
+ /* Not Found */
+ DPRINTF(3, (CE_WARN, "%s: Vxn_Attach: wrong PCI venid/devid (0x%x, 0x%x)",
+ drvName, vid, did));
+ goto err;
+ }
+
+ DPRINTF(3, (CE_CONT, "%s%d: (vid: 0x%04x, did: 0x%04x, revid: 0x%02x)\n",
+ drvName, unit, vid, did, revid));
+
+ /*
+ * Get device properties
+ */
+ regs = NULL;
+ len = 0;
+ if (ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
+ "reg", (caddr_t)&regs, &len) != DDI_PROP_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: failed to get reg property",
+ drvName, unit);
+ goto err;
+ }
+
+ ASSERT(regs != NULL && len > 0);
+
+ /*
+ * Search device properties for IO-space
+ */
+ for (i = 0; i <len / sizeof(struct pci_phys_spec); i++) {
+ if ((regs[i].pci_phys_hi & PCI_REG_ADDR_M) == PCI_ADDR_IO) {
+ regSpaceSize = regs[i].pci_size_low;
+ DPRINTF(5, (CE_CONT, "%s%d: Vxn_Attach: regSpaceSize=%d\n",
+ drvName, unit, regSpaceSize));
+ kmem_free(regs, len);
+ goto map_space_found;
+ }
+ }
+
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: failed to find IO space", drvName, unit);
+ kmem_free(regs, len);
+ goto err;
+
+map_space_found:
+
+ /*
+ * Ensure we can access registers through IO space.
+ */
+ ret = pci_config_get16(confHdl, PCI_CONF_COMM);
+ ret |= PCI_COMM_IO | PCI_COMM_ME;
+ pci_config_put16(confHdl, PCI_CONF_COMM, ret);
+
+ if (ddi_regs_map_setup(dip, i, (caddr_t *)&vxnIOp, 0, 0, &dev_attr,
+ &vxnIOHdl) != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: ddi_regs_map_setup failed",
+ drvName, unit);
+ goto err;
+ }
+
+ if (chip == VMXNET_CHIP) {
+ vxnIOSize = VMXNET_CHIP_IO_RESV_SIZE;
+ }
+ else {
+ /*
+ * Since this is a vlance adapter we can only use it if
+ * its I/0 space is big enough for the adapter to be
+ * capable of morphing. This is the first requirement
+ * for this adapter to potentially be morphable. The
+ * layout of a morphable LANCE adapter is
+ *
+ * I/O space:
+ *
+ * |------------------|
+ * | LANCE IO PORTS |
+ * |------------------|
+ * | MORPH PORT |
+ * |------------------|
+ * | VMXNET IO PORTS |
+ * |------------------|
+ *
+ * VLance has 8 ports of size 4 bytes, the morph port is 4 bytes, and
+ * Vmxnet has 10 ports of size 4 bytes.
+ *
+ * We shift up the ioaddr with the size of the LANCE I/O space since
+ * we want to access the vmxnet ports. We also shift the ioaddr up by
+ * the MORPH_PORT_SIZE so other port access can be independent of
+ * whether we are Vmxnet or a morphed VLance. This means that when
+ * we want to access the MORPH port we need to subtract the size
+ * from ioaddr to get to it.
+ */
+ vxnIOp += LANCE_CHIP_IO_RESV_SIZE + MORPH_PORT_SIZE;
+ vxnIOSize = LANCE_CHIP_IO_RESV_SIZE + MORPH_PORT_SIZE +
+ VMXNET_CHIP_IO_RESV_SIZE;
+ }
+
+ /*
+ * Do not attempt to morph non-morphable AMD PCnet
+ */
+ if (vxnIOSize > regSpaceSize) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: "
+ "vlance device is not supported by this driver", drvName, unit);
+ goto err_free_regs_map;
+ }
+
+ /*
+ * Morph, if we found a vlance adapter
+ */
+ if (chip == LANCE_CHIP) {
+ uint16_t magic;
+
+ /* Read morph port to verify that we can morph the adapter */
+ magic = ddi_get16(vxnIOHdl, (uint16_t *)(vxnIOp - MORPH_PORT_SIZE));
+ if (magic != LANCE_CHIP && magic != VMXNET_CHIP) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: Invalid magic, read: 0x%08X",
+ drvName, unit, magic);
+ goto err_free_regs_map;
+ }
+
+ /* Morph */
+ ddi_put16(vxnIOHdl, (uint16_t *)(vxnIOp - MORPH_PORT_SIZE), VMXNET_CHIP);
+ morphed = TRUE;
+
+ /* Verify that we morphed correctly */
+ magic = ddi_get16(vxnIOHdl, (uint16_t *)(vxnIOp - MORPH_PORT_SIZE));
+ if (magic != VMXNET_CHIP) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: Couldn't morph adapter."
+ " Invalid magic, read:: 0x%08X", drvName, unit, magic);
+ goto err_morph_back;
+ }
+ }
+
+ /*
+ * Check the version number of the device implementation
+ */
+ vLow = (uint32_t)ddi_get32(vxnIOHdl,
+ (uint32_t *)(vxnIOp+VMXNET_LOW_VERSION));
+ vHigh = (uint32_t)ddi_get32(vxnIOHdl,
+ (uint32_t *)(vxnIOp+VMXNET_HIGH_VERSION));
+
+ if ((vLow & 0xffff0000) != (VMXNET2_MAGIC & 0xffff0000) ||
+ ((VMXNET2_MAGIC < vLow) || (VMXNET2_MAGIC > vHigh))) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: driver version 0x%08X doesn't "
+ "match device 0x%08X:0x%08X",
+ drvName, unit, VMXNET2_MAGIC, vLow, vHigh);
+ goto err_version_mismatch;
+ }
+
+ /*
+ * Alloc soft state
+ */
+ macInfo = gld_mac_alloc(dip);
+ if (!macInfo) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: gld_mac_alloc failed",
+ drvName, unit);
+ goto err_gld_mac_alloc;
+ }
+
+ dp = (vxn_softc_t *) kmem_zalloc(sizeof(vxn_softc_t), KM_SLEEP);
+ ASSERT(dp);
+
+ /*
+ * Get interrupt cookie
+ */
+ if (ddi_get_iblock_cookie(dip, 0, &dp->iblockCookie) != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Attach: ddi_get_iblock_cookie failed",
+ drvName, unit);
+ goto err_get_iblock_cookie;
+ }
+
+ strncpy(dp->drvName, drvName, SOLVMXNET_MAXNAME);
+ dp->unit = unit;
+ dp->dip = dip;
+ dp->macInfo = macInfo;
+ dp->confHdl = confHdl;
+ dp->vxnIOHdl = vxnIOHdl;
+ dp->vxnIOp = vxnIOp;
+ dp->morphed = morphed;
+ dp->nicActive = FALSE;
+ dp->txPending = 0;
+ dp->maxTxFrags = 1;
+
+ /*
+ * Initialize mutexes
+ */
+ mutex_init(&dp->intrlock, NULL, MUTEX_DRIVER, (void *)dp->iblockCookie);
+ mutex_init(&dp->xmitlock, NULL, MUTEX_DRIVER, (void *)dp->iblockCookie);
+ mutex_init(&dp->rxlistlock, NULL, MUTEX_DRIVER, (void *)dp->iblockCookie);
+
+ /*
+ * Allocate and initialize our private and shared data structures
+ */
+ if (Vxn_AllocDriverData(dp) != SOLVMXNET_SUCCESS) {
+ goto err_alloc_driverdata;
+ }
+
+ /*
+ * Read the MAC address from the device
+ */
+ for (i = 0; i < 6; i++) {
+ dp->devAddr.ether_addr_octet[i] =
+ (uint8_t)ddi_get8(vxnIOHdl, (uint8_t *)(vxnIOp + VMXNET_MAC_ADDR + i));
+ }
+ macInfo->gldm_vendor_addr = dp->devAddr.ether_addr_octet;
+ macInfo->gldm_broadcast_addr = etherbroadcastaddr.ether_addr_octet;
+
+ DPRINTF(3, (CE_CONT,
+ "MAC address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+ dp->devAddr.ether_addr_octet[0],
+ dp->devAddr.ether_addr_octet[1],
+ dp->devAddr.ether_addr_octet[2],
+ dp->devAddr.ether_addr_octet[3],
+ dp->devAddr.ether_addr_octet[4],
+ dp->devAddr.ether_addr_octet[5]));
+
+ /*
+ * Configure GLD entry points
+ */
+ macInfo->gldm_devinfo = dip;
+ macInfo->gldm_private = (caddr_t)dp;
+ macInfo->gldm_cookie = dp->iblockCookie;
+ macInfo->gldm_reset = Vxn_Reset;
+ macInfo->gldm_start = Vxn_Start;
+ macInfo->gldm_stop = Vxn_Stop;
+ macInfo->gldm_set_mac_addr = Vxn_SetMacAddress;
+ macInfo->gldm_send = Vxn_Send;
+ macInfo->gldm_set_promiscuous = Vxn_SetPromiscuous;
+ macInfo->gldm_get_stats = Vxn_GetStats;
+ macInfo->gldm_ioctl = NULL;
+ macInfo->gldm_set_multicast= Vxn_SetMulticast;
+ macInfo->gldm_intr = Vxn_Interrupt;
+ macInfo->gldm_mctl = NULL;
+
+ macInfo->gldm_ident = (char *)ddi_driver_name(dip);
+ macInfo->gldm_type = DL_ETHER;
+ macInfo->gldm_minpkt = 0;
+ macInfo->gldm_maxpkt = ETHERMTU;
+ macInfo->gldm_addrlen = ETHERADDRL;
+ macInfo->gldm_saplen = -2;
+ macInfo->gldm_ppa = unit;
+
+ /*
+ * Register with GLD (Generic Lan Driver) framework
+ */
+ if (gld_register(dip,
+ (char *)ddi_driver_name(dip), macInfo) != DDI_SUCCESS) {
+ goto err_gld_register;
+ }
+
+ /*
+ * Add interrupt to system.
+ */
+ if (ddi_add_intr(dip, 0, NULL, NULL, gld_intr,
+ (caddr_t)macInfo) != DDI_SUCCESS) {
+ cmn_err(CE_WARN, "%s%d: ddi_add_intr failed", drvName, unit);
+ goto err_ddi_add_intr;
+ }
+
+ /*
+ * Add to list of interfaces.
+ */
+ mutex_enter(&vxnListLock);
+ dp->next = &vxnList;
+ dp->prev = vxnList.prev;
+ vxnList.prev->next = dp;
+ vxnList.prev = dp;
+ mutex_exit(&vxnListLock);
+
+ /*
+ * Success
+ */
+ return DDI_SUCCESS;
+
+err_ddi_add_intr:
+ gld_unregister(macInfo);
+
+err_gld_register:
+ Vxn_FreeDriverData(dp);
+
+err_alloc_driverdata:
+ mutex_destroy(&dp->intrlock);
+ mutex_destroy(&dp->xmitlock);
+
+err_get_iblock_cookie:
+ kmem_free(dp, sizeof(*dp));
+ gld_mac_free(macInfo);
+
+err_gld_mac_alloc:
+err_version_mismatch:
+err_morph_back:
+ if (morphed) {
+ ddi_put16(vxnIOHdl, (uint16_t *)(vxnIOp - MORPH_PORT_SIZE), LANCE_CHIP);
+ }
+
+err_free_regs_map:
+ ddi_regs_map_free(&vxnIOHdl);
+
+err:
+ pci_config_teardown(&confHdl);
+ return DDI_FAILURE;
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Vxn_Detach --
+ * Called on module unload
+ *
+ * Results:
+ * DDI_SUCCESS
+ * DDI_FAILURE
+ *
+ * Side effects:
+ * None
+ *-----------------------------------------------------------------------------
+ */
+static int
+Vxn_Detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
+{
+ gld_mac_info_t *macInfo;
+ vxn_softc_t *dp;
+
+ macInfo = (gld_mac_info_t *)ddi_get_driver_private(dip);
+ dp = (vxn_softc_t *)macInfo->gldm_private;
+
+ if (cmd == DDI_DETACH) {
+ /*
+ * Tear down interrupt
+ */
+ ddi_remove_intr(dip, 0, macInfo->gldm_cookie);
+ gld_unregister(macInfo);
+
+ /*
+ * Quiesce hardware
+ */
+ Vxn_Stop(macInfo);
+
+ /*
+ * Free driver-data, tx/rx buffers etc
+ */
+ Vxn_FreeDriverData(dp);
+
+ /*
+ * Destroy locks
+ */
+ mutex_destroy(&dp->intrlock);
+ mutex_destroy(&dp->xmitlock);
+
+ /*
+ * Unmorph
+ */
+ if (dp->morphed) {
+ uint16_t magic;
+
+ /* Verify that we had morphed earlier */
+ magic = ddi_get16(dp->vxnIOHdl,
+ (uint16_t *)(dp->vxnIOp - MORPH_PORT_SIZE));
+ if (magic != VMXNET_CHIP) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Detach: Adapter not morphed"
+ " magic=0x%08X", dp->drvName, dp->unit, magic);
+ }
+ else {
+ /* Unmorph */
+ ddi_put16(dp->vxnIOHdl,
+ (uint16_t *)(dp->vxnIOp - MORPH_PORT_SIZE), LANCE_CHIP);
+
+ /* Verify */
+ magic = ddi_get16(dp->vxnIOHdl,
+ (uint16_t *)(dp->vxnIOp - MORPH_PORT_SIZE));
+ if (magic != LANCE_CHIP) {
+ cmn_err(CE_WARN, "%s%d: Vxn_Detach: Unable to unmorph adapter"
+ " magic=0x%08X", dp->drvName, dp->unit, magic);
+ }
+ }
+ }
+
+ /*
+ * Release resister mappings
+ */
+ ddi_regs_map_free(&dp->vxnIOHdl);
+ pci_config_teardown(&dp->confHdl);
+
+ /*
+ * Remove from list of interfaces.
+ */
+ mutex_enter(&vxnListLock);
+ ASSERT(dp != &vxnList);
+ dp->prev->next = dp->next;
+ dp->next->prev = dp->prev;
+ mutex_exit(&vxnListLock);
+
+ /*
+ * Release memory
+ */
+ kmem_free(dp, sizeof(*dp));
+ gld_mac_free(macInfo);
+
+ return DDI_SUCCESS;
+ }
+ else {
+ return DDI_FAILURE;
+ }
+}
+
+static struct module_info vxnminfo = {
+ 0, /* mi_idnum */
+ "vmxnet", /* mi_idname */
+ 0, /* mi_minpsz */
+ ETHERMTU, /* mi_maxpsz */
+ QHIWATER, /* mi_hiwat */
+ 1, /* mi_lowat */
+};
+
+static struct qinit vxnrinit = {
+ NULL, /* qi_putp */
+ gld_rsrv, /* qi_srvp */
+ gld_open, /* qi_qopen */
+ gld_close, /* qi_qclose */
+ NULL, /* qi_qadmin */
+ &vxnminfo, /* qi_minfo */
+ NULL /* qi_mstat */
+};
+
+static struct qinit vxnwinit = {
+ gld_wput, /* qi_putp */
+ gld_wsrv, /* qi_srvp */
+ NULL, /* qi_qopen */
+ NULL, /* qi_qclose */
+ NULL, /* qi_qadmin */
+ &vxnminfo, /* qi_minfo */
+ NULL /* qi_mstat */
+};
+
+static struct streamtab vxn_info = {
+ &vxnrinit, /* st_rdinit */
+ &vxnwinit, /* st_wrinit */
+ NULL, /* st_muxrinit */
+ NULL /* st_muxwrinit */
+};
+
+static struct cb_ops cb_vxn_ops = {
+ nulldev, /* cb_open */
+ nulldev, /* cb_close */
+ nodev, /* cb_strategy */
+ nodev, /* cb_print */
+ nodev, /* cb_dump */
+ nodev, /* cb_read */
+ nodev, /* cb_write */
+ nodev, /* cb_ioctl */
+ nodev, /* cb_devmap */
+ nodev, /* cb_mmap */
+ nodev, /* cb_segmap */
+ nochpoll, /* cb_chpoll */
+ ddi_prop_op, /* cb_prop_op */
+ &vxn_info, /* cb_stream */
+ D_NEW|D_MP /* cb_flag */
+};
+
+static struct dev_ops vxn_ops = {
+ DEVO_REV, /* devo_rev */
+ 0, /* devo_refcnt */
+ gld_getinfo, /* devo_getinfo */
+ nulldev, /* devo_identify */
+ nulldev, /* devo_probe */
+ Vxn_Attach, /* devo_attach */
+ Vxn_Detach, /* devo_detach */
+ nodev, /* devo_reset */
+ &cb_vxn_ops, /* devo_cb_ops */
+ NULL, /* devo_bus_ops */
+ ddi_power /* devo_power */
+};
+
+static struct modldrv modldrv = {
+ &mod_driverops,
+ ident,
+ &vxn_ops,
+};
+
+static struct modlinkage modlinkage = {
+ MODREV_1, {&modldrv, NULL,}
+};
+
+
+/*
+ * Module load entry point
+ */
+int
+_init(void)
+{
+ int err;
+
+ DPRINTF(5, (CE_CONT, "vxn: _init:\n"));
+ /* Initialize interface list */
+ vxnList.next = vxnList.prev = &vxnList;
+ mutex_init(&vxnListLock, NULL, MUTEX_DRIVER, NULL);
+ if ((err = mod_install(&modlinkage)) != 0) {
+ mutex_destroy(&vxnListLock);
+ }
+ return err;
+}
+
+/*
+ * Module unload entry point
+ */
+int
+_fini(void)
+{
+ int err;
+
+ DPRINTF(5, (CE_CONT, "vxn: _fini:\n"));
+ if ((err = mod_remove(&modlinkage)) == 0) {
+ mutex_destroy(&vxnListLock);
+ }
+ return err;
+}
+
+/*
+ * Module info entry point
+ */
+int
+_info(struct modinfo *modinfop)
+{
+ return (mod_info(&modlinkage, modinfop));
+}
+
diff --git a/usr/src/uts/intel/io/vmxnet/vmxnet.conf b/usr/src/uts/intel/io/vmxnet/vmxnet.conf
new file mode 100644
index 0000000000..eb3b160412
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vmxnet.conf
@@ -0,0 +1,24 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
diff --git a/usr/src/uts/intel/io/vmxnet/vmxnet2_def.h b/usr/src/uts/intel/io/vmxnet/vmxnet2_def.h
new file mode 100644
index 0000000000..5ea437df72
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vmxnet2_def.h
@@ -0,0 +1,436 @@
+/*********************************************************
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+#ifndef _VMXNET2_DEF_H_
+#define _VMXNET2_DEF_H_
+
+#define INCLUDE_ALLOW_USERLEVEL
+
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMK_MODULE
+#define INCLUDE_ALLOW_VMKERNEL
+#define INCLUDE_ALLOW_DISTRIBUTE
+#include "includeCheck.h"
+
+#include "net_sg.h"
+#include "vmxnet_def.h"
+
+
+/*
+ * Magic number that identifies this version of the vmxnet protocol.
+ */
+#define VMXNET2_MAGIC 0xbabe864f
+
+/* size of the rx ring */
+#define VMXNET2_MAX_NUM_RX_BUFFERS 128
+#define VMXNET2_DEFAULT_NUM_RX_BUFFERS 100
+
+
+/* size of the rx ring when enhanced vmxnet is used */
+#define ENHANCED_VMXNET2_MAX_NUM_RX_BUFFERS 512
+#define ENHANCED_VMXNET2_DEFAULT_NUM_RX_BUFFERS 150
+
+/* size of the 2nd rx ring */
+#define VMXNET2_MAX_NUM_RX_BUFFERS2 2048
+#define VMXNET2_DEFAULT_NUM_RX_BUFFERS2 512
+
+/* size of the tx ring */
+#define VMXNET2_MAX_NUM_TX_BUFFERS 128
+#define VMXNET2_DEFAULT_NUM_TX_BUFFERS 100
+
+/* size of the tx ring when tso/jf is used */
+#define VMXNET2_MAX_NUM_TX_BUFFERS_TSO 512
+#define VMXNET2_DEFAULT_NUM_TX_BUFFERS_TSO 256
+
+enum {
+ VMXNET2_OWNERSHIP_DRIVER,
+ VMXNET2_OWNERSHIP_DRIVER_PENDING,
+ VMXNET2_OWNERSHIP_NIC,
+ VMXNET2_OWNERSHIP_NIC_PENDING,
+ VMXNET2_OWNERSHIP_NIC_FRAG,
+ VMXNET2_OWNERSHIP_DRIVER_FRAG,
+};
+
+#define VMXNET2_SG_DEFAULT_LENGTH 6
+
+typedef struct Vmxnet2_SG_Array {
+ uint16 addrType;
+ uint16 length;
+ NetSG_Elem sg[VMXNET2_SG_DEFAULT_LENGTH];
+} Vmxnet2_SG_Array;
+
+typedef struct Vmxnet2_RxRingEntry {
+ uint64 paddr; /* Physical address of the packet data. */
+ uint32 bufferLength; /* The length of the data at paddr. */
+ uint32 actualLength; /* The actual length of the received data. */
+ uint16 ownership; /* Who owns the packet. */
+ uint16 flags; /* Flags as defined below. */
+ uint32 index; /*
+ * Currently:
+ *
+ * This is being used as an packet index to
+ * rx buffers.
+ *
+ * Originally:
+ *
+ * was void* driverData ("Driver specific data.")
+ * which was used for sk_buf**s in Linux and
+ * VmxnetRxBuff*s in Windows. It could not be
+ * here because the structure needs to be the
+ * same size between architectures, and it was
+ * not used on the device side, anyway. Look
+ * for its replacement in
+ * Vmxnet_Private.rxRingBuffPtr on Linux and
+ * VmxnetAdapter.rxRingBuffPtr on Windows.
+ */
+} Vmxnet2_RxRingEntry;
+
+/*
+ * Vmxnet2_RxRingEntry flags:
+ *
+ * VMXNET2_RX_HW_XSUM_OK The hardware verified the TCP/UDP checksum.
+ * VMXNET2_RX_WITH_FRAG More data is in the 2nd ring
+ * VMXNET2_RX_FRAG_EOP This is the last frag, the only valid flag for
+ * 2nd ring entry
+ *
+ */
+#define VMXNET2_RX_HW_XSUM_OK 0x01
+#define VMXNET2_RX_WITH_FRAG 0x02
+#define VMXNET2_RX_FRAG_EOP 0x04
+
+typedef struct Vmxnet2_TxRingEntry {
+ uint16 flags; /* Flags as defined below. */
+ uint16 ownership; /* Who owns this packet. */
+ uint32 extra; /*
+ * was void* driverData ("Driver specific data.")
+ * which was used for sk_buf*s in Linux and
+ * VmxnetTxInfo*s in Windows. It could not be
+ * here because the structure needs to be the
+ * same size between architectures, and it was
+ * not used on the device side, anyway. Look
+ * for its replacement in
+ * Vmxnet_Private.txRingBuffPtr on Linux and
+ * VmxnetAdapter.txRingBuffPtr on Windows.
+ */
+ uint32 tsoMss; /* TSO pkt MSS */
+ Vmxnet2_SG_Array sg; /* Packet data. */
+} Vmxnet2_TxRingEntry;
+
+/*
+ * Vmxnet2_TxRingEntry flags:
+ *
+ * VMXNET2_TX_CAN_KEEP The implementation can return the tx ring entry
+ * to the driver when it is ready as opposed to
+ * before the transmit call from the driver completes.
+ * VMXNET2_TX_RING_LOW The driver's transmit ring buffer is low on free
+ * slots.
+ * VMXNET2_TX_HW_XSUM The hardware should perform the TCP/UDP checksum
+ * VMXNET2_TX_TSO The hardware should do TCP segmentation.
+ * VMXNET2_TX_PINNED_BUFFER The driver used one of the preallocated vmkernel
+ * buffers *and* it has been pinned with Net_PinTxBuffers.
+ * VMXNET2_TX_MORE This is *not* the last tx entry for the pkt.
+ * All flags except VMXNET2_TX_MORE are ignored
+ * for the subsequent tx entries.
+ */
+#define VMXNET2_TX_CAN_KEEP 0x0001
+#define VMXNET2_TX_RING_LOW 0x0002
+#define VMXNET2_TX_HW_XSUM 0x0004
+#define VMXNET2_TX_TSO 0x0008
+#define VMXNET2_TX_PINNED_BUFFER 0x0010
+#define VMXNET2_TX_MORE 0x0020
+
+/*
+ * Structure used by implementations. This structure allows the inline
+ * functions below to be used.
+ */
+typedef struct Vmxnet2_RxRingInfo {
+ Vmxnet2_RxRingEntry *base; /* starting addr of the ring */
+ uint32 nicNext; /* next entry to use in the ring */
+ uint32 ringLength; /* # of entries in the ring */
+ PA startPA; /* PA of the starting addr of the ring */
+#ifdef VMX86_DEBUG
+ const char *name;
+#endif
+} Vmxnet2_RxRingInfo;
+
+typedef struct Vmxnet2_TxRingInfo {
+ Vmxnet2_TxRingEntry *base; /* starting addr of the ring */
+ uint32 nicNext; /* next entry to use in the ring */
+ uint32 ringLength; /* # of entries in the ring */
+ PA startPA; /* PA of the starting addr of the ring */
+#ifdef VMX86_DEBUG
+ const char *name;
+#endif
+} Vmxnet2_TxRingInfo;
+
+typedef struct Vmxnet2_ImplData {
+ Vmxnet2_RxRingInfo rxRing;
+ Vmxnet2_RxRingInfo rxRing2;
+ Vmxnet2_TxRingInfo txRing;
+
+ struct PhysMem_Token *ddPhysMemToken;
+} Vmxnet2_ImplData;
+
+/*
+ * Used internally for performance studies. By default this will be off so there
+ * should be no compatibilty or other interferences.
+ */
+
+/* #define ENABLE_VMXNET2_PROFILING */
+
+
+#ifdef ENABLE_VMXNET2_PROFILING
+typedef struct Vmxnet2_VmmStats {
+ uint64 vIntTSC; /* the time that virtual int was posted */
+ uint64 actionsCount; /* Number of actions received */
+ uint64 numWasteActions; /* Number of non-productive actions */
+} Vmxnet2_VmmStats;
+#endif
+
+typedef struct Vmxnet2_DriverStats {
+ uint32 transmits; /* # of times that the drivers transmit function */
+ /* is called. The driver could transmit more */
+ /* than one packet per call. */
+ uint32 pktsTransmitted; /* # of packets transmitted. */
+ uint32 noCopyTransmits; /* # of packets that are transmitted without */
+ /* copying any data. */
+ uint32 copyTransmits; /* # of packets that are transmittted by copying */
+ /* the data into a buffer. */
+ uint32 maxTxsPending; /* Max # of transmits outstanding. */
+ uint32 txStopped; /* # of times that transmits got stopped because */
+ /* the tx ring was full. */
+ uint32 txRingOverflow; /* # of times that transmits got deferred bc */
+ /* the tx ring was full. This must be >= */
+ /* txStopped since there will be one */
+ /* txStopped when the ring fills up and then */
+ /* one txsRingOverflow for each packet that */
+ /* that gets deferred until there is space. */
+ uint32 interrupts; /* # of times interrupted. */
+ uint32 pktsReceived; /* # of packets received. */
+ uint32 rxBuffersLow; /* # of times that the driver was low on */
+ /* receive buffers. */
+#ifdef ENABLE_VMXNET2_PROFILING
+ Vmxnet2_VmmStats vmmStats; /* vmm related stats for perf study */
+#endif
+} Vmxnet2_DriverStats;
+
+/*
+ * Shared data structure between the vm, the vmm, and the vmkernel.
+ * This structure was originally arranged to try to group common data
+ * on 32-byte cache lines, but bit rot and the fact that we no longer
+ * run on many CPUs with that cacheline size killed that optimization.
+ * vmxnet3 should target 128 byte sizes and alignments to optimize for
+ * the 64 byte cacheline pairs on P4.
+ */
+typedef struct Vmxnet2_DriverData {
+ /*
+ * Magic must be first.
+ */
+ Vmxnet_DDMagic magic;
+
+ /*
+ * Receive fields.
+ */
+ uint32 rxRingLength; /* Length of the receive ring. */
+ uint32 rxDriverNext; /* Index of the next packet that will */
+ /* be filled in by the impl */
+
+ uint32 rxRingLength2; /* Length of the 2nd receive ring. */
+ uint32 rxDriverNext2; /* Index of the next packet that will */
+ /* be filled in by the impl */
+
+ uint32 notUsed1; /* was "irq" */
+
+ /*
+ * Interface flags and multicast filter.
+ */
+ uint32 ifflags;
+ uint32 LADRF[VMXNET_MAX_LADRF];
+
+ /*
+ * Transmit fields
+ */
+ uint32 txDontClusterSize; /* All packets <= this will be transmitted */
+ /* immediately, regardless of clustering */
+ /* settings [was fill[1]] */
+ uint32 txRingLength; /* Length of the transmit ring. */
+ uint32 txDriverCur; /* Index of the next packet to be */
+ /* returned by the implementation.*/
+ uint32 txDriverNext; /* Index of the entry in the ring */
+ /* buffer to use for the next packet.*/
+ uint32 txStopped; /* The driver has stopped transmitting */
+ /* because its ring buffer is full.*/
+ uint32 txClusterLength; /* Maximum number of packets to */
+ /* put in the ring buffer before */
+ /* asking the implementation to */
+ /* transmit the packets in the buffer.*/
+ uint32 txNumDeferred; /* Number of packets that have been */
+ /* queued in the ring buffer since */
+ /* the last time the implementation */
+ /* was asked to transmit. */
+ uint32 notUsed3; /* This field is deprecated but still used */
+ /* as minXmitPhysLength on the escher branch. */
+ /* It cannot be used for other purposes */
+ /* until escher vms no longer are allowed */
+ /* to install this driver. */
+
+ uint32 totalRxBuffers; /* used by esx for max rx buffers */
+ uint64 rxBufferPhysStart; /* used by esx for pinng rx buffers */
+ /*
+ * Extra fields for future expansion.
+ */
+ uint32 extra[2];
+
+ uint16 maxFrags; /* # of frags the driver can handle */
+ uint16 featureCtl; /* for driver to enable some feature */
+
+ /*
+ * The following fields are used to save the nicNext indexes part
+ * of implData in the vmkernel when disconnecting the adapter, we
+ * need them when we reconnect. This mechanism is used for
+ * checkpointing as well.
+ */
+ uint32 savedRxNICNext;
+ uint32 savedRxNICNext2;
+ uint32 savedTxNICNext;
+
+ /*
+ * Fields used during initialization or debugging.
+ */
+ uint32 length;
+ uint32 rxRingOffset;
+ uint32 rxRingOffset2;
+ uint32 txRingOffset;
+ uint32 debugLevel;
+ uint32 txBufferPhysStart;
+ uint32 txBufferPhysLength;
+ uint32 txPktMaxSize;
+
+ /*
+ * Driver statistics.
+ */
+ Vmxnet2_DriverStats stats;
+} Vmxnet2_DriverData;
+
+/*
+ * Shared between VMM and Vmkernel part of vmxnet2 to optimize action posting
+ * VMM writes 1 (don't post) or 0 (okay to post) and vmk reads this.
+ */
+typedef struct VmxnetVMKShared {
+ uint32 dontPostActions;
+} VmxnetVMKShared;
+
+#if defined VMX86_VMX || defined VMKERNEL
+
+/*
+ * Inline functions used to assist the implementation of the vmxnet interface.
+ */
+
+/*
+ * Get the next empty packet out of the receive ring and move to
+ * the next packet.
+ */
+static INLINE Vmxnet2_RxRingEntry *
+Vmxnet2_GetNextRx(Vmxnet2_RxRingInfo *ri, uint16 ownership)
+{
+ Vmxnet2_RxRingEntry *rre = ri->base + ri->nicNext;
+ if (rre->ownership == ownership) {
+ VMXNET_INC(ri->nicNext, ri->ringLength);
+ } else {
+ rre = NULL;
+ }
+
+ return rre;
+}
+
+/*
+ * Return ownership of a packet in the receive ring to the driver.
+ */
+static INLINE void
+Vmxnet2_PutRx(Vmxnet2_RxRingEntry *rre, uint32 pktLength, uint16 ownership)
+{
+ rre->actualLength = pktLength;
+ COMPILER_MEM_BARRIER();
+ rre->ownership = ownership;
+}
+
+/*
+ * Get the next pending packet out of the transmit ring.
+ */
+static INLINE Vmxnet2_TxRingEntry *
+Vmxnet2_GetNextTx(Vmxnet2_TxRingInfo *ri)
+{
+ Vmxnet2_TxRingEntry *txre = ri->base + ri->nicNext;
+ if (txre->ownership == VMXNET2_OWNERSHIP_NIC) {
+ return txre;
+ } else {
+ return NULL;
+ }
+}
+
+/*
+ * Move to the next entry in the transmit ring.
+ */
+static INLINE unsigned int
+Vmxnet2_IncNextTx(Vmxnet2_TxRingInfo *ri)
+{
+ unsigned int prev = ri->nicNext;
+ Vmxnet2_TxRingEntry *txre = ri->base + ri->nicNext;
+
+ txre->ownership = VMXNET2_OWNERSHIP_NIC_PENDING;
+
+ VMXNET_INC(ri->nicNext, ri->ringLength);
+ return prev;
+}
+
+/*
+ * Get the indicated entry from transmit ring.
+ */
+static INLINE Vmxnet2_TxRingEntry *
+Vmxnet2_GetTxEntry(Vmxnet2_TxRingInfo *ri, unsigned int idx)
+{
+ return ri->base + idx;
+}
+
+/*
+ * Get the indicated entry from the given rx ring
+ */
+static INLINE Vmxnet2_RxRingEntry *
+Vmxnet2_GetRxEntry(Vmxnet2_RxRingInfo *ri, unsigned int idx)
+{
+ return ri->base + idx;
+}
+
+#endif /* defined VMX86_VMX || defined VMKERNEL */
+
+#endif
+
diff --git a/usr/src/uts/intel/io/vmxnet/vmxnet_def.h b/usr/src/uts/intel/io/vmxnet/vmxnet_def.h
new file mode 100644
index 0000000000..703466c995
--- /dev/null
+++ b/usr/src/uts/intel/io/vmxnet/vmxnet_def.h
@@ -0,0 +1,184 @@
+/*********************************************************
+ * Copyright (C) 1999 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *********************************************************/
+
+/*********************************************************
+ * The contents of this file are subject to the terms of the Common
+ * Development and Distribution License (the "License") version 1.0
+ * and no later version. You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://www.opensource.org/licenses/cddl1.php
+ *
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ *********************************************************/
+
+#ifndef _VMXNET_DEF_H_
+#define _VMXNET_DEF_H_
+
+#define INCLUDE_ALLOW_USERLEVEL
+
+#define INCLUDE_ALLOW_MODULE
+#define INCLUDE_ALLOW_VMK_MODULE
+#define INCLUDE_ALLOW_VMKERNEL
+#define INCLUDE_ALLOW_DISTRIBUTE
+#include "includeCheck.h"
+
+#include "net_sg.h"
+#include "vmnet_def.h"
+
+
+/*
+ * Vmxnet I/O ports, used by both the vmxnet driver and
+ * the device emulation code.
+ */
+
+#define VMXNET_INIT_ADDR 0x00
+#define VMXNET_INIT_LENGTH 0x04
+#define VMXNET_TX_ADDR 0x08
+#define VMXNET_COMMAND_ADDR 0x0c
+#define VMXNET_MAC_ADDR 0x10
+#define VMXNET_LOW_VERSION 0x18
+#define VMXNET_HIGH_VERSION 0x1c
+#define VMXNET_STATUS_ADDR 0x20
+#define VMXNET_TOE_INIT_ADDR 0x24
+#define VMXNET_APROM_ADDR 0x28
+#define VMXNET_INT_ENABLE_ADDR 0x30
+#define VMXNET_WAKE_PKT_PATTERNS 0x34
+
+/*
+ * Vmxnet command register values.
+ */
+#define VMXNET_CMD_INTR_ACK 0x0001
+#define VMXNET_CMD_UPDATE_LADRF 0x0002
+#define VMXNET_CMD_UPDATE_IFF 0x0004
+#define VMXNET_CMD_UNUSED 1 0x0008
+#define VMXNET_CMD_UNUSED_2 0x0010
+#define VMXNET_CMD_INTR_DISABLE 0x0020
+#define VMXNET_CMD_INTR_ENABLE 0x0040
+#define VMXNET_CMD_UNUSED_3 0x0080
+#define VMXNET_CMD_CHECK_TX_DONE 0x0100
+#define VMXNET_CMD_GET_NUM_RX_BUFFERS 0x0200
+#define VMXNET_CMD_GET_NUM_TX_BUFFERS 0x0400
+#define VMXNET_CMD_PIN_TX_BUFFERS 0x0800
+#define VMXNET_CMD_GET_CAPABILITIES 0x1000
+#define VMXNET_CMD_GET_FEATURES 0x2000
+#define VMXNET_CMD_SET_POWER_FULL 0x4000
+#define VMXNET_CMD_SET_POWER_LOW 0x8000
+
+/*
+ * Vmxnet status register values.
+ */
+#define VMXNET_STATUS_CONNECTED 0x0001
+#define VMXNET_STATUS_ENABLED 0x0002
+#define VMXNET_STATUS_TX_PINNED 0x0004
+
+/*
+ * Values for the interface flags.
+ */
+#define VMXNET_IFF_PROMISC 0x01
+#define VMXNET_IFF_BROADCAST 0x02
+#define VMXNET_IFF_MULTICAST 0x04
+#define VMXNET_IFF_DIRECTED 0x08
+
+/*
+ * Length of the multicast address filter.
+ */
+#define VMXNET_MAX_LADRF 2
+
+/*
+ * Size of Vmxnet APROM.
+ */
+#define VMXNET_APROM_SIZE 6
+
+/*
+ * An invalid ring index.
+ */
+#define VMXNET_INVALID_RING_INDEX (-1)
+
+/*
+ * Features that are implemented by the driver. These are driver
+ * specific so not all features will be listed here. In addition not all
+ * drivers have to pay attention to these feature flags.
+ *
+ * VMXNET_FEATURE_ZERO_COPY_TX The driver won't do any copies as long as
+ * the packet length is >
+ * Vmxnet_DriverData.minTxPhysLength.
+ *
+ * VMXNET_FEATURE_TSO The driver will use the TSO capabilities
+ * of the underlying hardware if available
+ * and enabled.
+ *
+ * VMXNET_FEATURE_JUMBO_FRAME The driver can send/rcv jumbo frame
+ *
+ * VMXNET_FEATURE_LPD The backend can deliver large pkts
+ */
+#define VMXNET_FEATURE_ZERO_COPY_TX 0x01
+#define VMXNET_FEATURE_TSO 0x02
+#define VMXNET_FEATURE_JUMBO_FRAME 0x04
+#define VMXNET_FEATURE_LPD 0x08
+
+/*
+ * Define the set of capabilities required by each feature above
+ */
+#define VMXNET_FEATURE_ZERO_COPY_TX_CAPS VMXNET_CAP_SG
+#define VMXNET_FEATURE_TSO_CAPS VMXNET_CAP_TSO
+#define VMXNET_HIGHEST_FEATURE_BIT VMXNET_FEATURE_TSO
+
+#define VMXNET_INC(val, max) \
+ val++; \
+ if (UNLIKELY(val == max)) { \
+ val = 0; \
+ }
+
+/*
+ * code that just wants to switch on the different versions of the
+ * guest<->implementation protocol can cast driver data to this.
+ */
+typedef uint32 Vmxnet_DDMagic;
+
+/*
+ * Wake packet pattern commands sent through VMXNET_WAKE_PKT_PATTERNS port
+ */
+
+#define VMXNET_PM_OPCODE_START 3 /* args: cnt of wake packet patterns */
+#define VMXNET_PM_OPCODE_LEN 2 /* args: index of wake packet pattern */
+ /* number of pattern byte values */
+#define VMXNET_PM_OPCODE_DATA 1 /* args: index of wake packet pattern */
+ /* offset in pattern byte values list */
+ /* packet byte offset */
+ /* packet byte value */
+#define VMXNET_PM_OPCODE_END 0 /* args: <none> */
+
+typedef union Vmxnet_WakePktCmd {
+ uint32 pktData : 32;
+ struct {
+ unsigned cmd : 2; /* wake packet pattern cmd [from list above] */
+ unsigned cnt : 3; /* cnt wk pkt pttrns 1..MAX_NUM_FILTER_PTTRNS */
+ unsigned ind : 3; /* ind wk pkt pttrn 0..MAX_NUM_FILTER_PTTRNS-1 */
+ unsigned lenOff : 8; /* num pttrn byte vals 1..MAX_PKT_FILTER_SIZE */
+ /* OR offset in pattern byte values list */
+ /* 0..MAX_PKT_FILTER_SIZE-1 */
+ unsigned byteOff : 8; /* pkt byte offset 0..MAX_PKT_FILTER_SIZE-1 */
+ unsigned byteVal : 8; /* packet byte value 0..255 */
+ } pktPttrn;
+} Vmxnet_WakePktCmd;
+
+#endif /* _VMXNET_DEF_H_ */
diff --git a/usr/src/uts/intel/ip/ip.global-objs.debug64 b/usr/src/uts/intel/ip/ip.global-objs.debug64
index b05d399caf..3098f98265 100644
--- a/usr/src/uts/intel/ip/ip.global-objs.debug64
+++ b/usr/src/uts/intel/ip/ip.global-objs.debug64
@@ -105,7 +105,6 @@ ilb_sticky_expiry
ilb_sticky_timer_size
ilb_sticky_timeout
ill_no_arena
-ill_null
inet_dev_info
inet_devops
ip6_ftable_hash_size
diff --git a/usr/src/uts/intel/ip/ip.global-objs.obj64 b/usr/src/uts/intel/ip/ip.global-objs.obj64
index 7dd30502a0..f182d7198e 100644
--- a/usr/src/uts/intel/ip/ip.global-objs.obj64
+++ b/usr/src/uts/intel/ip/ip.global-objs.obj64
@@ -105,7 +105,6 @@ ilb_sticky_expiry
ilb_sticky_timer_size
ilb_sticky_timeout
ill_no_arena
-ill_null
inet_dev_info
inet_devops
ip6_ftable_hash_size
diff --git a/usr/src/uts/intel/ipf/ipf.global-objs.debug64 b/usr/src/uts/intel/ipf/ipf.global-objs.debug64
index 203dd14416..663613cee3 100644
--- a/usr/src/uts/intel/ipf/ipf.global-objs.debug64
+++ b/usr/src/uts/intel/ipf/ipf.global-objs.debug64
@@ -22,11 +22,33 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2013 Joyent, Inc. All rights reserved
+#
fr_availfuncs
fr_features
fr_objbytes
hdrsizes
+hook4_in
+hook4_in_gz
+hook4_loop_in
+hook4_loop_in_gz
+hook4_loop_out
+hook4_loop_out_gz
+hook4_nicevents
+hook4_nicevents_gz
+hook4_out
+hook4_out_gz
+hook6_in
+hook6_in_gz
+hook6_loop_in
+hook6_loop_in_gz
+hook6_loop_out
+hook6_loop_out_gz
+hook6_nicevents
+hook6_nicevents_gz
+hook6_out
+hook6_out_gz
icmpreplytype4
icmpreplytype6
icmptoicmp6types
@@ -37,10 +59,12 @@ ipf_cb_ops
ipf_dev_info
ipf_devfiles
ipf_kstat_tmp
+ipf_minor
ipf_ops
ipf_proxy_debug
ipf_stack_lock
ipf_stacks
+ipf_state
ipfilter_version
ipfncb
ipl_magic
diff --git a/usr/src/uts/intel/kdi/kdi_idt.c b/usr/src/uts/intel/kdi/kdi_idt.c
index 4bd6ca73e1..73d9628e62 100644
--- a/usr/src/uts/intel/kdi/kdi_idt.c
+++ b/usr/src/uts/intel/kdi/kdi_idt.c
@@ -217,7 +217,8 @@ kdi_idt_patch(caddr_t code, size_t sz)
continue; /* uses kernel's handler */
gd = &kdi_idt[i];
- patch = (uchar_t *)GATESEG_GETOFFSET(gd) + KDI_MSR_PATCHOFF;
+ patch = ((uchar_t *)(uintptr_t)GATESEG_GETOFFSET(gd)) +
+ KDI_MSR_PATCHOFF;
/*
* We can't ASSERT that there's a nop here, because this may be
diff --git a/usr/src/uts/intel/lxprocfs/Makefile b/usr/src/uts/intel/lxprocfs/Makefile
new file mode 100644
index 0000000000..c6ffec0199
--- /dev/null
+++ b/usr/src/uts/intel/lxprocfs/Makefile
@@ -0,0 +1,88 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (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
+#
+#
+# uts/intel/lxprocfs/Makefile
+#
+# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# This makefile drives the production of the lxprocfs file system
+# kernel module.
+#
+# intel architecture dependent
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+
+#
+# Define the module and object file sets.
+#
+MODULE = lxprocfs
+OBJECTS = $(LXPROC_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(LXPROC_OBJS:%.o=$(LINTS_DIR)/%.ln)
+ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE)
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/intel/Makefile.intel
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY)
+LINT_TARGET = $(MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
+
+#
+# Depends on procfs
+#
+LDFLAGS += -dy -Nfs/procfs
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+lint: $(LINT_DEPS)
+
+modlintlib: $(MODLINTLIB_DEPS)
+
+clean.lint: $(CLEAN_LINT_DEPS)
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include $(UTSBASE)/intel/Makefile.targ
diff --git a/usr/src/uts/intel/opteron_pcbe/Makefile b/usr/src/uts/intel/opteron_pcbe/Makefile
index aea8e89fbe..7431f50329 100644
--- a/usr/src/uts/intel/opteron_pcbe/Makefile
+++ b/usr/src/uts/intel/opteron_pcbe/Makefile
@@ -34,7 +34,7 @@ UTSBASE = ../..
MODULE = pcbe.AuthenticAMD
OBJECTS = $(OPTERON_PCBE_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(OPTERON_PCBE_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE = $(USR_PCBE_DIR)/$(MODULE)
+ROOTMODULE = $(ROOT_PSM_PCBE_DIR)/$(MODULE)
#
# Include common rules.
diff --git a/usr/src/uts/intel/os/driver_aliases b/usr/src/uts/intel/os/driver_aliases
index 3116819932..1cea287121 100644
--- a/usr/src/uts/intel/os/driver_aliases
+++ b/usr/src/uts/intel/os/driver_aliases
@@ -1 +1,2 @@
asy "pci11c1,480"
+vmxnet "pci15ad,720"
diff --git a/usr/src/uts/intel/os/name_to_major b/usr/src/uts/intel/os/name_to_major
index c5ad4c9bf0..1fb86f9a50 100644
--- a/usr/src/uts/intel/os/name_to_major
+++ b/usr/src/uts/intel/os/name_to_major
@@ -2,3 +2,4 @@ md 85
devinfo 88
asy 106
did 239
+vmxnet 270
diff --git a/usr/src/uts/intel/p123_pcbe/Makefile b/usr/src/uts/intel/p123_pcbe/Makefile
index 71b7d9bcec..d591d52e62 100644
--- a/usr/src/uts/intel/p123_pcbe/Makefile
+++ b/usr/src/uts/intel/p123_pcbe/Makefile
@@ -35,8 +35,8 @@ UTSBASE = ../..
MODULE = pcbe.GenuineIntel.6
OBJECTS = $(P123_PCBE_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(P123_PCBE_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE = $(USR_PCBE_DIR)/$(MODULE)
-ROOTLINK = $(USR_PCBE_DIR)/pcbe.GenuineIntel.5
+ROOTMODULE = $(ROOT_PSM_PCBE_DIR)/$(MODULE)
+ROOTLINK = $(ROOT_PSM_PCBE_DIR)/pcbe.GenuineIntel.5
#
# Include common rules.
diff --git a/usr/src/uts/intel/p4_pcbe/Makefile b/usr/src/uts/intel/p4_pcbe/Makefile
index 07689646c1..42dc040eee 100644
--- a/usr/src/uts/intel/p4_pcbe/Makefile
+++ b/usr/src/uts/intel/p4_pcbe/Makefile
@@ -35,7 +35,7 @@ UTSBASE = ../..
MODULE = pcbe.GenuineIntel.15
OBJECTS = $(P4_PCBE_OBJS:%=$(OBJS_DIR)/%)
LINTS = $(P4_PCBE_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE = $(USR_PCBE_DIR)/$(MODULE)
+ROOTMODULE = $(ROOT_PSM_PCBE_DIR)/$(MODULE)
#
# Include common rules.
diff --git a/usr/src/uts/intel/sngl_brand/Makefile b/usr/src/uts/intel/sngl_brand/Makefile
new file mode 100644
index 0000000000..cec2141e89
--- /dev/null
+++ b/usr/src/uts/intel/sngl_brand/Makefile
@@ -0,0 +1,98 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2012, Joyent, Inc. All rights reserved.
+#
+# This makefile drives the production of the kernel component of
+# the SNGL brand
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+SNGL_BASE = $(UTSBASE)/common/brand/sngl
+
+#
+# Define the module and object file sets.
+#
+MODULE = sngl_brand
+OBJECTS = $(SNGL_BRAND_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(SNGL_BRAND_OBJS:%.o=$(LINTS_DIR)/%.ln)
+ROOTMODULE = $(USR_BRAND_DIR)/$(MODULE)
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/intel/Makefile.intel
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY)
+LINT_TARGET = $(MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
+
+
+#
+# Update compiler variables.
+#
+INC_PATH += -I$(SNGL_BASE) -I$(OBJS_DIR)
+AS_INC_PATH += -I$(UTSBASE)/i86pc/genassym/$(OBJS_DIR)
+LDFLAGS += -dy -Nexec/elfexec
+
+#
+# Ugh, this is a gross hack. sngl_brand_asm.s uses lots of defines
+# to simplify variable access. All these defines work fine for amd64
+# compiles because when compiling for amd64 we use the GNU assembler,
+# gas. For 32-bit code we use the Sun assembler, as. Unfortunatly
+# as does not handle certian constructs that gas does. So rather than
+# make our code less readable, we'll just use gas to compile our 32-bit
+# code as well.
+#
+i386_AS = $(amd64_AS)
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+lint: $(LINT_DEPS)
+
+modlintlib: $(MODLINTLIB_DEPS)
+
+clean.lint: $(CLEAN_LINT_DEPS)
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include $(UTSBASE)/intel/Makefile.targ
diff --git a/usr/src/uts/intel/sys/acpi/acapps.h b/usr/src/uts/intel/sys/acpi/acapps.h
index 2d3f84186e..0382ca8547 100644
--- a/usr/src/uts/intel/sys/acpi/acapps.h
+++ b/usr/src/uts/intel/sys/acpi/acapps.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,7 @@
/* Common info for tool signons */
#define ACPICA_NAME "Intel ACPI Component Architecture"
-#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2011 Intel Corporation"
+#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2012 Intel Corporation"
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH "-64"
@@ -81,6 +81,15 @@
Prefix, ACPICA_COPYRIGHT, \
Prefix
+/* Macros for usage messages */
+
+#define ACPI_USAGE_HEADER(Usage) \
+ printf ("Usage: %s\nOptions:\n", Usage);
+
+#define ACPI_OPTION(Name, Description) \
+ printf (" %-18s%s\n", Name, Description);
+
+
#define FILE_SUFFIX_DISASSEMBLY "dsl"
#define ACPI_TABLE_FILE_SUFFIX ".dat"
diff --git a/usr/src/uts/intel/sys/acpi/accommon.h b/usr/src/uts/intel/sys/acpi/accommon.h
index 58bb83ddb6..7e6d05aa8d 100644
--- a/usr/src/uts/intel/sys/acpi/accommon.h
+++ b/usr/src/uts/intel/sys/acpi/accommon.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/acconfig.h b/usr/src/uts/intel/sys/acpi/acconfig.h
index 7a2107aa76..7880516e47 100644
--- a/usr/src/uts/intel/sys/acpi/acconfig.h
+++ b/usr/src/uts/intel/sys/acpi/acconfig.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -86,6 +86,23 @@
*/
#define ACPI_CHECKSUM_ABORT FALSE
+/*
+ * Generate a version of ACPICA that only supports "reduced hardware"
+ * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
+ * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
+ * model. In other words, no ACPI hardware is supported.
+ *
+ * If TRUE, this means no support for the following:
+ * PM Event and Control registers
+ * SCI interrupt (and handler)
+ * Fixed Events
+ * General Purpose Events (GPEs)
+ * Global Lock
+ * ACPI PM timer
+ * FACS table (Waking vectors and Global Lock)
+ */
+#define ACPI_REDUCED_HARDWARE FALSE
+
/******************************************************************************
*
@@ -95,7 +112,7 @@
/* Version of ACPI supported */
-#define ACPI_CA_SUPPORT_LEVEL 3
+#define ACPI_CA_SUPPORT_LEVEL 5
/* Maximum count for a semaphore object */
@@ -123,7 +140,11 @@
/* Maximum sleep allowed via Sleep() operator */
-#define ACPI_MAX_SLEEP 20000 /* Two seconds */
+#define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */
+
+/* Address Range lists are per-SpaceId (Memory and I/O only) */
+
+#define ACPI_ADDRESS_RANGE_MAX 2
/******************************************************************************
@@ -183,9 +204,10 @@
#define ACPI_RSDP_CHECKSUM_LENGTH 20
#define ACPI_RSDP_XCHECKSUM_LENGTH 36
-/* SMBus and IPMI bidirectional buffer size */
+/* SMBus, GSBus and IPMI bidirectional buffer size */
#define ACPI_SMBUS_BUFFER_SIZE 34
+#define ACPI_GSBUS_BUFFER_SIZE 34
#define ACPI_IPMI_BUFFER_SIZE 66
/* _SxD and _SxW control methods */
diff --git a/usr/src/uts/intel/sys/acpi/acdebug.h b/usr/src/uts/intel/sys/acpi/acdebug.h
index 2c1fe73429..bcc505c8d5 100644
--- a/usr/src/uts/intel/sys/acpi/acdebug.h
+++ b/usr/src/uts/intel/sys/acpi/acdebug.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -107,6 +107,10 @@ AcpiDbDisplayTableInfo (
char *TableArg);
void
+AcpiDbDisplayTemplate (
+ char *BufferArg);
+
+void
AcpiDbUnloadAcpiTable (
char *TableArg,
char *InstanceArg);
@@ -133,18 +137,20 @@ void
AcpiDbDisplayResources (
char *ObjectArg);
+ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayGpes (
- void);
+ void))
void
AcpiDbDisplayHandlers (
void);
+ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiDbGenerateGpe (
char *GpeArg,
- char *BlockArg);
+ char *BlockArg))
/*
diff --git a/usr/src/uts/intel/sys/acpi/acdisasm.h b/usr/src/uts/intel/sys/acpi/acdisasm.h
index aaaac11d86..9ec12713b4 100644
--- a/usr/src/uts/intel/sys/acpi/acdisasm.h
+++ b/usr/src/uts/intel/sys/acpi/acdisasm.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@
typedef const struct acpi_dmtable_info
{
UINT8 Opcode;
- UINT8 Offset;
+ UINT16 Offset;
char *Name;
UINT8 Flags;
@@ -80,57 +80,82 @@ typedef const struct acpi_dmtable_info
/*
* Values for Opcode above.
- * Note: 0-7 must not change, used as a flag shift value
+ * Note: 0-7 must not change, they are used as a flag shift value. Other
+ * than those, new values can be added wherever appropriate.
*/
-#define ACPI_DMT_FLAG0 0
-#define ACPI_DMT_FLAG1 1
-#define ACPI_DMT_FLAG2 2
-#define ACPI_DMT_FLAG3 3
-#define ACPI_DMT_FLAG4 4
-#define ACPI_DMT_FLAG5 5
-#define ACPI_DMT_FLAG6 6
-#define ACPI_DMT_FLAG7 7
-#define ACPI_DMT_FLAGS0 8
-#define ACPI_DMT_FLAGS2 9
-#define ACPI_DMT_UINT8 10
-#define ACPI_DMT_UINT16 11
-#define ACPI_DMT_UINT24 12
-#define ACPI_DMT_UINT32 13
-#define ACPI_DMT_UINT56 14
-#define ACPI_DMT_UINT64 15
-#define ACPI_DMT_STRING 16
-#define ACPI_DMT_NAME4 17
-#define ACPI_DMT_NAME6 18
-#define ACPI_DMT_NAME8 19
-#define ACPI_DMT_CHKSUM 20
-#define ACPI_DMT_SPACEID 21
-#define ACPI_DMT_GAS 22
-#define ACPI_DMT_ASF 23
-#define ACPI_DMT_DMAR 24
-#define ACPI_DMT_HEST 25
-#define ACPI_DMT_HESTNTFY 26
-#define ACPI_DMT_HESTNTYP 27
-#define ACPI_DMT_MADT 28
-#define ACPI_DMT_SRAT 29
-#define ACPI_DMT_EXIT 30
-#define ACPI_DMT_SIG 31
-#define ACPI_DMT_FADTPM 32
-#define ACPI_DMT_BUF16 33
-#define ACPI_DMT_IVRS 34
-#define ACPI_DMT_BUFFER 35
-#define ACPI_DMT_PCI_PATH 36
-#define ACPI_DMT_EINJACT 37
-#define ACPI_DMT_EINJINST 38
-#define ACPI_DMT_ERSTACT 39
-#define ACPI_DMT_ERSTINST 40
-#define ACPI_DMT_ACCWIDTH 41
-#define ACPI_DMT_UNICODE 42
-#define ACPI_DMT_UUID 43
-#define ACPI_DMT_DEVICE_PATH 44
-#define ACPI_DMT_LABEL 45
-#define ACPI_DMT_BUF7 46
-#define ACPI_DMT_BUF128 47
-#define ACPI_DMT_SLIC 48
+typedef enum
+{
+ /* Simple Data Types */
+
+ ACPI_DMT_FLAG0 = 0,
+ ACPI_DMT_FLAG1 = 1,
+ ACPI_DMT_FLAG2 = 2,
+ ACPI_DMT_FLAG3 = 3,
+ ACPI_DMT_FLAG4 = 4,
+ ACPI_DMT_FLAG5 = 5,
+ ACPI_DMT_FLAG6 = 6,
+ ACPI_DMT_FLAG7 = 7,
+ ACPI_DMT_FLAGS0,
+ ACPI_DMT_FLAGS1,
+ ACPI_DMT_FLAGS2,
+ ACPI_DMT_FLAGS4,
+ ACPI_DMT_UINT8,
+ ACPI_DMT_UINT16,
+ ACPI_DMT_UINT24,
+ ACPI_DMT_UINT32,
+ ACPI_DMT_UINT40,
+ ACPI_DMT_UINT48,
+ ACPI_DMT_UINT56,
+ ACPI_DMT_UINT64,
+ ACPI_DMT_BUF7,
+ ACPI_DMT_BUF16,
+ ACPI_DMT_BUF128,
+ ACPI_DMT_SIG,
+ ACPI_DMT_STRING,
+ ACPI_DMT_NAME4,
+ ACPI_DMT_NAME6,
+ ACPI_DMT_NAME8,
+
+ /* Types that are decoded to strings and miscellaneous */
+
+ ACPI_DMT_ACCWIDTH,
+ ACPI_DMT_CHKSUM,
+ ACPI_DMT_GAS,
+ ACPI_DMT_SPACEID,
+ ACPI_DMT_UNICODE,
+ ACPI_DMT_UUID,
+
+ /* Types used only for the Data Table Compiler */
+
+ ACPI_DMT_BUFFER,
+ ACPI_DMT_DEVICE_PATH,
+ ACPI_DMT_LABEL,
+ ACPI_DMT_PCI_PATH,
+
+ /* Types that are specific to particular ACPI tables */
+
+ ACPI_DMT_ASF,
+ ACPI_DMT_DMAR,
+ ACPI_DMT_EINJACT,
+ ACPI_DMT_EINJINST,
+ ACPI_DMT_ERSTACT,
+ ACPI_DMT_ERSTINST,
+ ACPI_DMT_FADTPM,
+ ACPI_DMT_HEST,
+ ACPI_DMT_HESTNTFY,
+ ACPI_DMT_HESTNTYP,
+ ACPI_DMT_IVRS,
+ ACPI_DMT_MADT,
+ ACPI_DMT_PMTT,
+ ACPI_DMT_SLIC,
+ ACPI_DMT_SRAT,
+
+ /* Special opcodes */
+
+ ACPI_DMT_EXTRA_TEXT,
+ ACPI_DMT_EXIT
+
+} ACPI_ENTRY_TYPES;
typedef
void (*ACPI_DMTABLE_HANDLER) (
@@ -175,6 +200,11 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) (
#define ASL_WALK_CALLBACK_DEFINED
#endif
+typedef
+void (*ACPI_RESOURCE_HANDLER) (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
typedef struct acpi_resource_tag
{
@@ -202,6 +232,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[];
@@ -212,6 +243,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
@@ -221,7 +253,13 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[];
@@ -254,14 +292,34 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[];
@@ -354,6 +412,10 @@ AcpiDmDumpFadt (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpFpdt (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpHest (
ACPI_TABLE_HEADER *Table);
@@ -362,17 +424,29 @@ AcpiDmDumpIvrs (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpMadt (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpMcfg (
ACPI_TABLE_HEADER *Table);
void
-AcpiDmDumpMadt (
+AcpiDmDumpMpst (
ACPI_TABLE_HEADER *Table);
void
AcpiDmDumpMsct (
ACPI_TABLE_HEADER *Table);
+void
+AcpiDmDumpPcct (
+ ACPI_TABLE_HEADER *Table);
+
+void
+AcpiDmDumpPmtt (
+ ACPI_TABLE_HEADER *Table);
+
UINT32
AcpiDmDumpRsdp (
ACPI_TABLE_HEADER *Table);
@@ -381,6 +455,10 @@ void
AcpiDmDumpRsdt (
ACPI_TABLE_HEADER *Table);
+UINT32
+AcpiDmDumpS3pt (
+ ACPI_TABLE_HEADER *Table);
+
void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table);
@@ -671,6 +749,18 @@ AcpiDmVendorLargeDescriptor (
UINT32 Level);
void
+AcpiDmGpioDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
+AcpiDmSerialBusDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
AcpiDmVendorCommon (
char *Name,
UINT8 *ByteData,
@@ -694,6 +784,12 @@ AcpiDmDmaDescriptor (
UINT32 Level);
void
+AcpiDmFixedDmaDescriptor (
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
AcpiDmIoDescriptor (
AML_RESOURCE *Resource,
UINT32 Length,
diff --git a/usr/src/uts/intel/sys/acpi/acdispat.h b/usr/src/uts/intel/sys/acpi/acdispat.h
index ae8dd93154..0699ee77a1 100644
--- a/usr/src/uts/intel/sys/acpi/acdispat.h
+++ b/usr/src/uts/intel/sys/acpi/acdispat.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/acevents.h b/usr/src/uts/intel/sys/acpi/acevents.h
index 8681ed5f38..3b874f1075 100644
--- a/usr/src/uts/intel/sys/acpi/acevents.h
+++ b/usr/src/uts/intel/sys/acpi/acevents.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,13 +85,15 @@ ACPI_STATUS
AcpiEvInitGlobalLockHandler (
void);
+ACPI_HW_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiEvAcquireGlobalLock(
- UINT16 Timeout);
+ UINT16 Timeout))
+ACPI_HW_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiEvReleaseGlobalLock(
- void);
+ void))
ACPI_STATUS
AcpiEvRemoveGlobalLockHandler (
@@ -154,9 +156,10 @@ AcpiEvInitializeGpeBlock (
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
+ACPI_HW_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiEvDeleteGpeBlock (
- ACPI_GPE_BLOCK_INFO *GpeBlock);
+ ACPI_GPE_BLOCK_INFO *GpeBlock))
UINT32
AcpiEvGpeDispatch (
@@ -171,9 +174,10 @@ ACPI_STATUS
AcpiEvGpeInitialize (
void);
+ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiEvUpdateGpes (
- ACPI_OWNER_ID TableOwnerId);
+ ACPI_OWNER_ID TableOwnerId))
ACPI_STATUS
AcpiEvMatchGpeMethod (
@@ -228,7 +232,8 @@ AcpiEvInitializeOpRegions (
ACPI_STATUS
AcpiEvAddressSpaceDispatch (
- ACPI_OPERAND_OBJECT *RegionObj,
+ ACPI_OPERAND_OBJECT *RegionObj,
+ ACPI_OPERAND_OBJECT *FieldObj,
UINT32 Function,
UINT32 RegionOffset,
UINT32 BitWidth,
@@ -334,9 +339,9 @@ UINT32
AcpiEvInitializeSCI (
UINT32 ProgramSCI);
+ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiEvTerminate (
- void);
-
+ void))
#endif /* __ACEVENTS_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/acexcep.h b/usr/src/uts/intel/sys/acpi/acexcep.h
index 7d426d0f26..10f5a113da 100644
--- a/usr/src/uts/intel/sys/acpi/acexcep.h
+++ b/usr/src/uts/intel/sys/acpi/acexcep.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -92,8 +92,9 @@
#define AE_SAME_HANDLER (ACPI_STATUS) (0x0019 | AE_CODE_ENVIRONMENTAL)
#define AE_NO_HANDLER (ACPI_STATUS) (0x001A | AE_CODE_ENVIRONMENTAL)
#define AE_OWNER_ID_LIMIT (ACPI_STATUS) (0x001B | AE_CODE_ENVIRONMENTAL)
+#define AE_NOT_CONFIGURED (ACPI_STATUS) (0x001C | AE_CODE_ENVIRONMENTAL)
-#define AE_CODE_ENV_MAX 0x001B
+#define AE_CODE_ENV_MAX 0x001C
/*
@@ -222,7 +223,8 @@ char const *AcpiGbl_ExceptionNames_Env[] =
"AE_ABORT_METHOD",
"AE_SAME_HANDLER",
"AE_NO_HANDLER",
- "AE_OWNER_ID_LIMIT"
+ "AE_OWNER_ID_LIMIT",
+ "AE_NOT_CONFIGURED"
};
char const *AcpiGbl_ExceptionNames_Pgm[] =
diff --git a/usr/src/uts/intel/sys/acpi/acglobal.h b/usr/src/uts/intel/sys/acpi/acglobal.h
index ebbae0f595..79e53d07e2 100644
--- a/usr/src/uts/intel/sys/acpi/acglobal.h
+++ b/usr/src/uts/intel/sys/acpi/acglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -128,6 +128,12 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
*/
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE);
+
/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
@@ -137,7 +143,18 @@ UINT32 AcpiGbl_TraceFlags;
ACPI_NAME AcpiGbl_TraceMethodName;
BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-#endif
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+BOOLEAN AcpiGbl_ReducedHardware;
+
+#endif /* DEFINE_ACPI_GLOBALS */
+
+/* Do not disassemble buffers to resource descriptors */
+
+ACPI_EXTERN UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE);
/*****************************************************************************
*
@@ -150,8 +167,12 @@ BOOLEAN AcpiGbl_SystemAwakeAndRunning;
* found in the RSDT/XSDT.
*/
ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList;
+
+#if (!ACPI_REDUCED_HARDWARE)
ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS;
+#endif /* !ACPI_REDUCED_HARDWARE */
+
/* These addresses are calculated from the FADT Event Block addresses */
ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus;
@@ -177,7 +198,7 @@ ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
/*****************************************************************************
*
- * Mutual exlusion within ACPICA subsystem
+ * Mutual exclusion within ACPICA subsystem
*
****************************************************************************/
@@ -233,8 +254,7 @@ ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_OperandCache;
/* Global handlers */
-ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_DeviceNotify;
-ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_SystemNotify;
+ACPI_EXTERN ACPI_GLOBAL_NOTIFY_HANDLER AcpiGbl_GlobalNotify[2];
ACPI_EXTERN ACPI_EXCEPTION_HANDLER AcpiGbl_ExceptionHandler;
ACPI_EXTERN ACPI_INIT_HANDLER AcpiGbl_InitHandler;
ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler;
@@ -265,6 +285,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
ACPI_EXTERN UINT8 AcpiGbl_OsiData;
ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
+ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX];
#ifndef DEFINE_ACPI_GLOBALS
@@ -362,6 +383,8 @@ ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
*
****************************************************************************/
+#if (!ACPI_REDUCED_HARDWARE)
+
ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized;
ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead;
ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS];
@@ -370,6 +393,7 @@ ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext;
ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS];
extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
+#endif /* !ACPI_REDUCED_HARDWARE */
/*****************************************************************************
*
diff --git a/usr/src/uts/intel/sys/acpi/achware.h b/usr/src/uts/intel/sys/acpi/achware.h
index ae4a77a9f2..f607d1702a 100644
--- a/usr/src/uts/intel/sys/acpi/achware.h
+++ b/usr/src/uts/intel/sys/acpi/achware.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -110,6 +110,49 @@ AcpiHwClearAcpiStatus (
/*
+ * hwsleep - sleep/wake support (Legacy sleep registers)
+ */
+ACPI_STATUS
+AcpiHwLegacySleep (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+ACPI_STATUS
+AcpiHwLegacyWakePrep (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+ACPI_STATUS
+AcpiHwLegacyWake (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+
+/*
+ * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
+ */
+void
+AcpiHwExecuteSleepMethod (
+ char *MethodName,
+ UINT32 IntegerArgument);
+
+ACPI_STATUS
+AcpiHwExtendedSleep (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+ACPI_STATUS
+AcpiHwExtendedWakePrep (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+ACPI_STATUS
+AcpiHwExtendedWake (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+
+/*
* hwvalid - Port I/O with validation
*/
ACPI_STATUS
@@ -188,22 +231,4 @@ AcpiHwDerivePciId (
ACPI_HANDLE PciRegion);
-/*
- * hwtimer - ACPI Timer prototypes
- */
-ACPI_STATUS
-AcpiGetTimerResolution (
- UINT32 *Resolution);
-
-ACPI_STATUS
-AcpiGetTimer (
- UINT32 *Ticks);
-
-ACPI_STATUS
-AcpiGetTimerDuration (
- UINT32 StartTicks,
- UINT32 EndTicks,
- UINT32 *TimeElapsed);
-
-
#endif /* __ACHWARE_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/acinterp.h b/usr/src/uts/intel/sys/acpi/acinterp.h
index 8ac828c59c..45e9814f79 100644
--- a/usr/src/uts/intel/sys/acpi/acinterp.h
+++ b/usr/src/uts/intel/sys/acpi/acinterp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -642,6 +642,10 @@ AcpiExIntegerToString (
char *Dest,
UINT64 Value);
+BOOLEAN
+AcpiIsValidSpaceId (
+ UINT8 SpaceId);
+
/*
* exregion - default OpRegion handlers
diff --git a/usr/src/uts/intel/sys/acpi/aclocal.h b/usr/src/uts/intel/sys/acpi/aclocal.h
index 2eb6fc21d4..68ea95b7c8 100644
--- a/usr/src/uts/intel/sys/acpi/aclocal.h
+++ b/usr/src/uts/intel/sys/acpi/aclocal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,7 +54,7 @@ typedef UINT32 ACPI_MUTEX_HANDLE;
/* Total number of aml opcodes defined */
-#define AML_NUM_OPCODES 0x7F
+#define AML_NUM_OPCODES 0x81
/* Forward declarations */
@@ -213,7 +213,6 @@ typedef struct acpi_namespace_node
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
-#define ANOBJ_IS_BIT_OFFSET 0x40 /* iASL only: Reference is a bit offset */
#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
@@ -286,12 +285,16 @@ typedef struct acpi_create_field_info
ACPI_NAMESPACE_NODE *FieldNode;
ACPI_NAMESPACE_NODE *RegisterNode;
ACPI_NAMESPACE_NODE *DataRegisterNode;
+ ACPI_NAMESPACE_NODE *ConnectionNode;
+ UINT8 *ResourceBuffer;
UINT32 BankValue;
UINT32 FieldBitPosition;
UINT32 FieldBitLength;
+ UINT16 ResourceLength;
UINT8 FieldFlags;
UINT8 Attribute;
UINT8 FieldType;
+ UINT8 AccessLength;
} ACPI_CREATE_FIELD_INFO;
@@ -359,7 +362,8 @@ typedef struct acpi_name_info
/*
* Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
- * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
+ * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
+ * ACPI_PTYPE2_FIX_VAR
*/
typedef struct acpi_package_info
{
@@ -411,6 +415,7 @@ typedef struct acpi_predefined_data
char *Pathname;
const ACPI_PREDEFINED_INFO *Predefined;
union acpi_operand_object *ParentPackage;
+ ACPI_NAMESPACE_NODE *Node;
UINT32 Flags;
UINT8 NodeFlags;
@@ -419,6 +424,7 @@ typedef struct acpi_predefined_data
/* Defines for Flags field above */
#define ACPI_OBJECT_REPAIRED 1
+#define ACPI_OBJECT_WRAPPED 2
/*
@@ -710,6 +716,15 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
struct acpi_walk_state *WalkState);
+/* Global handlers for AML Notifies */
+
+typedef struct acpi_global_notify_handler
+{
+ ACPI_NOTIFY_HANDLER Handler;
+ void *Context;
+
+} ACPI_GLOBAL_NOTIFY_HANDLER;
+
/*
* Notify info - used to pass info to the deferred notify
* handler/dispatcher.
@@ -717,8 +732,10 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
typedef struct acpi_notify_info
{
ACPI_STATE_COMMON
+ UINT8 HandlerListId;
ACPI_NAMESPACE_NODE *Node;
- union acpi_operand_object *HandlerObj;
+ union acpi_operand_object *HandlerListHead;
+ ACPI_GLOBAL_NOTIFY_HANDLER *Global;
} ACPI_NOTIFY_INFO;
@@ -750,6 +767,17 @@ typedef
ACPI_STATUS (*ACPI_EXECUTE_OP) (
struct acpi_walk_state *WalkState);
+/* Address Range info block */
+
+typedef struct acpi_address_range
+{
+ struct acpi_address_range *Next;
+ ACPI_NAMESPACE_NODE *RegionNode;
+ ACPI_PHYSICAL_ADDRESS StartAddress;
+ ACPI_PHYSICAL_ADDRESS EndAddress;
+
+} ACPI_ADDRESS_RANGE;
+
/*****************************************************************************
*
@@ -774,6 +802,17 @@ typedef struct acpi_opcode_info
} ACPI_OPCODE_INFO;
+/* Structure for Resource Tag information */
+
+typedef struct acpi_tag_info
+{
+ UINT32 BitOffset;
+ UINT32 BitLength;
+
+} ACPI_TAG_INFO;
+
+/* Value associated with the parse object */
+
typedef union acpi_parse_value
{
UINT64 Integer; /* Integer constant (Up to 64 bits) */
@@ -782,6 +821,7 @@ typedef union acpi_parse_value
UINT8 *Buffer; /* buffer or string */
char *Name; /* NULL terminated string */
union acpi_parse_object *Arg; /* arguments and contained ops */
+ ACPI_TAG_INFO Tag; /* Resource descriptor tag info */
} ACPI_PARSE_VALUE;
@@ -1112,7 +1152,7 @@ typedef struct acpi_port_info
#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
#define ACPI_RESOURCE_NAME_IO 0x40
#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
-#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
+#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
@@ -1134,7 +1174,9 @@ typedef struct acpi_port_info
#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
-#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
+#define ACPI_RESOURCE_NAME_GPIO 0x8C
+#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
+#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
/*****************************************************************************
diff --git a/usr/src/uts/intel/sys/acpi/acmacros.h b/usr/src/uts/intel/sys/acpi/acmacros.h
index 6581d111c9..cdb9cb109e 100644
--- a/usr/src/uts/intel/sys/acpi/acmacros.h
+++ b/usr/src/uts/intel/sys/acpi/acmacros.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -428,7 +428,6 @@
#endif /* ACPI_SIMPLE_RETURN_MACROS */
-
/* Conditional execution */
#define ACPI_DEBUG_EXEC(a) a
@@ -477,6 +476,14 @@
#endif /* ACPI_DEBUG_OUTPUT */
+
+#if (!ACPI_REDUCED_HARDWARE)
+#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr
+#else
+#define ACPI_HW_OPTIONAL_FUNCTION(addr) NULL
+#endif
+
+
/*
* Some code only gets executed when the debugger is built in.
* Note that this is entirely independent of whether the
diff --git a/usr/src/uts/intel/sys/acpi/acnames.h b/usr/src/uts/intel/sys/acpi/acnames.h
index e08302dd30..4c5fab696f 100644
--- a/usr/src/uts/intel/sys/acpi/acnames.h
+++ b/usr/src/uts/intel/sys/acpi/acnames.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,6 +46,7 @@
/* Method names - these methods can appear anywhere in the namespace */
+#define METHOD_NAME__SB_ "_SB_"
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__CID "_CID"
#define METHOD_NAME__UID "_UID"
@@ -58,16 +59,17 @@
#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__CRS "_CRS"
#define METHOD_NAME__PRS "_PRS"
+#define METHOD_NAME__AEI "_AEI"
#define METHOD_NAME__PRW "_PRW"
#define METHOD_NAME__SRS "_SRS"
/* Method names - these methods must appear at the namespace root */
-#define METHOD_NAME__BFS "\\_BFS"
-#define METHOD_NAME__GTS "\\_GTS"
-#define METHOD_NAME__PTS "\\_PTS"
-#define METHOD_NAME__SST "\\_SI._SST"
-#define METHOD_NAME__WAK "\\_WAK"
+#define METHOD_PATHNAME__BFS "\\_BFS"
+#define METHOD_PATHNAME__GTS "\\_GTS"
+#define METHOD_PATHNAME__PTS "\\_PTS"
+#define METHOD_PATHNAME__SST "\\_SI._SST"
+#define METHOD_PATHNAME__WAK "\\_WAK"
/* Definitions of the predefined namespace names */
@@ -78,7 +80,6 @@
#define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */
#define ACPI_NS_ROOT_PATH "\\"
-#define ACPI_NS_SYSTEM_BUS "_SB_"
#endif /* __ACNAMES_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/acnamesp.h b/usr/src/uts/intel/sys/acpi/acnamesp.h
index 77f65d0ae4..4a91108eae 100644
--- a/usr/src/uts/intel/sys/acpi/acnamesp.h
+++ b/usr/src/uts/intel/sys/acpi/acnamesp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -368,8 +368,9 @@ AcpiNsRepairObject (
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
ACPI_STATUS
-AcpiNsRepairPackageList (
+AcpiNsWrapWithPackage (
ACPI_PREDEFINED_DATA *Data,
+ ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ObjDescPtr);
ACPI_STATUS
diff --git a/usr/src/uts/intel/sys/acpi/acobject.h b/usr/src/uts/intel/sys/acpi/acobject.h
index 27a21e6858..f2f8a1cfb1 100644
--- a/usr/src/uts/intel/sys/acpi/acobject.h
+++ b/usr/src/uts/intel/sys/acpi/acobject.h
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -246,8 +246,7 @@ typedef struct acpi_object_method
* Common fields for objects that support ASL notifications
*/
#define ACPI_COMMON_NOTIFY_INFO \
- union acpi_operand_object *SystemNotify; /* Handler for system notifies */\
- union acpi_operand_object *DeviceNotify; /* Handler for driver notifies */\
+ union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\
union acpi_operand_object *Handler; /* Handler for Address space */
@@ -320,6 +319,7 @@ typedef struct acpi_object_thermal_zone
UINT32 BaseByteOffset; /* Byte offset within containing object */\
UINT32 Value; /* Value to store into the Bank or Index register */\
UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
+ UINT8 AccessLength; /* For serial regions/fields */
typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
@@ -335,7 +335,9 @@ typedef struct acpi_object_region_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
+ UINT16 ResourceLength;
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
+ UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
} ACPI_OBJECT_REGION_FIELD;
@@ -386,8 +388,10 @@ typedef struct acpi_object_notify_handler
{
ACPI_OBJECT_COMMON_HEADER
ACPI_NAMESPACE_NODE *Node; /* Parent device */
- ACPI_NOTIFY_HANDLER Handler;
+ UINT32 HandlerType; /* Type: Device/System/Both */
+ ACPI_NOTIFY_HANDLER Handler; /* Handler addess */
void *Context;
+ union acpi_operand_object *Next[2]; /* Device and System handler lists */
} ACPI_OBJECT_NOTIFY_HANDLER;
@@ -463,6 +467,7 @@ typedef struct acpi_object_extra
{
ACPI_OBJECT_COMMON_HEADER
ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */
+ ACPI_NAMESPACE_NODE *ScopeNode;
void *RegionContext; /* Region-specific data */
UINT8 *AmlStart;
UINT32 AmlLength;
diff --git a/usr/src/uts/intel/sys/acpi/acopcode.h b/usr/src/uts/intel/sys/acpi/acopcode.h
index d8e1c75a7b..e182a07e61 100644
--- a/usr/src/uts/intel/sys/acpi/acopcode.h
+++ b/usr/src/uts/intel/sys/acpi/acopcode.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,7 @@
#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
+#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_CONTINUE_OP ARG_NONE
#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME)
#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
@@ -165,6 +166,7 @@
#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
#define ARGP_REVISION_OP ARG_NONE
#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
+#define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
@@ -225,6 +227,7 @@
#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
+#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
@@ -296,6 +299,7 @@
#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
#define ARGI_REVISION_OP ARG_NONE
#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
+#define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
diff --git a/usr/src/uts/intel/sys/acpi/acoutput.h b/usr/src/uts/intel/sys/acpi/acoutput.h
index c8007e21fb..a1d89d408c 100644
--- a/usr/src/uts/intel/sys/acpi/acoutput.h
+++ b/usr/src/uts/intel/sys/acpi/acoutput.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,7 @@
#define ACPI_EXAMPLE 0x00004000
#define ACPI_DRIVER 0x00008000
#define DT_COMPILER 0x00010000
+#define ASL_PREPROCESSOR 0x00020000
#define ACPI_ALL_COMPONENTS 0x0001FFFF
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
diff --git a/usr/src/uts/intel/sys/acpi/acparser.h b/usr/src/uts/intel/sys/acpi/acparser.h
index 83b3c4fc06..f46d3cbc2c 100644
--- a/usr/src/uts/intel/sys/acpi/acparser.h
+++ b/usr/src/uts/intel/sys/acpi/acparser.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/acpi.h b/usr/src/uts/intel/sys/acpi/acpi.h
index 0f4f607120..aa40219112 100644
--- a/usr/src/uts/intel/sys/acpi/acpi.h
+++ b/usr/src/uts/intel/sys/acpi/acpi.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/acpiosxf.h b/usr/src/uts/intel/sys/acpi/acpiosxf.h
index 85b0ff6108..b79d0e6ade 100644
--- a/usr/src/uts/intel/sys/acpi/acpiosxf.h
+++ b/usr/src/uts/intel/sys/acpi/acpiosxf.h
@@ -9,7 +9,7 @@
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -112,6 +112,12 @@ AcpiOsTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_TABLE_HEADER **NewTable);
+ACPI_STATUS
+AcpiOsPhysicalTableOverride (
+ ACPI_TABLE_HEADER *ExistingTable,
+ ACPI_PHYSICAL_ADDRESS *NewAddress,
+ UINT32 *NewTableLength);
+
/*
* Spinlock primitives
@@ -302,13 +308,13 @@ AcpiOsWritePort (
ACPI_STATUS
AcpiOsReadMemory (
ACPI_PHYSICAL_ADDRESS Address,
- UINT32 *Value,
+ UINT64 *Value,
UINT32 Width);
ACPI_STATUS
AcpiOsWriteMemory (
ACPI_PHYSICAL_ADDRESS Address,
- UINT32 Value,
+ UINT64 Value,
UINT32 Width);
diff --git a/usr/src/uts/intel/sys/acpi/acpixf.h b/usr/src/uts/intel/sys/acpi/acpixf.h
index 82b677e615..7478c78940 100644
--- a/usr/src/uts/intel/sys/acpi/acpixf.h
+++ b/usr/src/uts/intel/sys/acpi/acpixf.h
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,8 +48,9 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20110527
+#define ACPI_CA_VERSION 0x20120420
+#include "acconfig.h"
#include "actypes.h"
#include "actbl.h"
@@ -59,6 +60,7 @@
extern UINT32 AcpiCurrentGpeCount;
extern ACPI_TABLE_FADT AcpiGbl_FADT;
extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
+extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */
/* Runtime configuration of debug print levels */
@@ -76,6 +78,35 @@ extern UINT32 AcpiGbl_TraceFlags;
extern UINT8 AcpiGbl_EnableAmlDebugObject;
extern UINT8 AcpiGbl_CopyDsdtLocally;
extern UINT8 AcpiGbl_TruncateIoAddresses;
+extern UINT8 AcpiGbl_DisableAutoRepair;
+
+
+/*
+ * Hardware-reduced prototypes. All interfaces that use these macros will
+ * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
+ * is set to TRUE.
+ */
+#if (!ACPI_REDUCED_HARDWARE)
+#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
+ Prototype;
+
+#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
+ Prototype;
+
+#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
+
+#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_OK);}
+
+#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {}
+
+#endif /* !ACPI_REDUCED_HARDWARE */
/*
@@ -107,13 +138,15 @@ AcpiTerminate (
/*
* Miscellaneous global interfaces
*/
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnable (
- void);
+ void))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiDisable (
- void);
+ void))
ACPI_STATUS
AcpiSubsystemStatus (
@@ -143,6 +176,13 @@ ACPI_STATUS
AcpiRemoveInterface (
ACPI_STRING InterfaceName);
+UINT32
+AcpiCheckAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_PHYSICAL_ADDRESS Address,
+ ACPI_SIZE Length,
+ BOOLEAN Warn);
+
/*
* ACPI Memory management
@@ -312,35 +352,40 @@ AcpiInstallInitializationHandler (
ACPI_INIT_HANDLER Handler,
UINT32 Function);
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiInstallGlobalEventHandler (
ACPI_GBL_EVENT_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiInstallFixedEventHandler (
UINT32 AcpiEvent,
ACPI_EVENT_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveFixedEventHandler (
UINT32 AcpiEvent,
- ACPI_EVENT_HANDLER Handler);
+ ACPI_EVENT_HANDLER Handler))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiInstallGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT32 Type,
ACPI_GPE_HANDLER Address,
- void *Context);
+ void *Context))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
- ACPI_GPE_HANDLER Address);
+ ACPI_GPE_HANDLER Address))
ACPI_STATUS
AcpiInstallNotifyHandler (
@@ -381,113 +426,148 @@ AcpiInstallInterfaceHandler (
/*
* Global Lock interfaces
*/
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiAcquireGlobalLock (
UINT16 Timeout,
- UINT32 *Handle);
+ UINT32 *Handle))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiReleaseGlobalLock (
- UINT32 Handle);
+ UINT32 Handle))
+
+
+/*
+ * Interfaces to AML mutex objects
+ */
+ACPI_STATUS
+AcpiAcquireMutex (
+ ACPI_HANDLE Handle,
+ ACPI_STRING Pathname,
+ UINT16 Timeout);
+
+ACPI_STATUS
+AcpiReleaseMutex (
+ ACPI_HANDLE Handle,
+ ACPI_STRING Pathname);
/*
* Fixed Event interfaces
*/
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnableEvent (
UINT32 Event,
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiDisableEvent (
UINT32 Event,
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiClearEvent (
- UINT32 Event);
+ UINT32 Event))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiGetEventStatus (
UINT32 Event,
- ACPI_EVENT_STATUS *EventStatus);
+ ACPI_EVENT_STATUS *EventStatus))
/*
* General Purpose Event (GPE) Interfaces
*/
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiUpdateAllGpes (
- void);
+ void))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnableGpe (
ACPI_HANDLE GpeDevice,
- UINT32 GpeNumber);
+ UINT32 GpeNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiDisableGpe (
ACPI_HANDLE GpeDevice,
- UINT32 GpeNumber);
+ UINT32 GpeNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiClearGpe (
ACPI_HANDLE GpeDevice,
- UINT32 GpeNumber);
+ UINT32 GpeNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiSetGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
- UINT8 Action);
+ UINT8 Action))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiFinishGpe (
ACPI_HANDLE GpeDevice,
- UINT32 GpeNumber);
+ UINT32 GpeNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiSetupGpeForWake (
ACPI_HANDLE ParentDevice,
ACPI_HANDLE GpeDevice,
- UINT32 GpeNumber);
+ UINT32 GpeNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiSetGpeWakeMask (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
- UINT8 Action);
+ UINT8 Action))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiGetGpeStatus (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
- ACPI_EVENT_STATUS *EventStatus);
+ ACPI_EVENT_STATUS *EventStatus))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiDisableAllGpes (
- void);
+ void))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnableAllRuntimeGpes (
- void);
+ void))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiGetGpeDevice (
UINT32 GpeIndex,
- ACPI_HANDLE *GpeDevice);
+ ACPI_HANDLE *GpeDevice))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiInstallGpeBlock (
ACPI_HANDLE GpeDevice,
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
UINT32 RegisterCount,
- UINT32 InterruptNumber);
+ UINT32 InterruptNumber))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveGpeBlock (
- ACPI_HANDLE GpeDevice);
+ ACPI_HANDLE GpeDevice))
/*
@@ -516,6 +596,11 @@ AcpiGetPossibleResources (
ACPI_BUFFER *RetBuffer);
ACPI_STATUS
+AcpiGetEventResources (
+ ACPI_HANDLE DeviceHandle,
+ ACPI_BUFFER *RetBuffer);
+
+ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE Device,
char *Name,
@@ -537,6 +622,12 @@ AcpiResourceToAddress64 (
ACPI_RESOURCE *Resource,
ACPI_RESOURCE_ADDRESS64 *Out);
+ACPI_STATUS
+AcpiBufferToResource (
+ UINT8 *AmlBuffer,
+ UINT16 AmlBufferLength,
+ ACPI_RESOURCE **ResourcePtr);
+
/*
* Hardware (ACPI device) interfaces
@@ -555,16 +646,22 @@ AcpiWrite (
UINT64 Value,
ACPI_GENERIC_ADDRESS *Reg);
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiReadBitRegister (
UINT32 RegisterId,
- UINT32 *ReturnValue);
+ UINT32 *ReturnValue))
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiWriteBitRegister (
UINT32 RegisterId,
- UINT32 Value);
+ UINT32 Value))
+
+/*
+ * Sleep/Wake interfaces
+ */
ACPI_STATUS
AcpiGetSleepTypeData (
UINT8 SleepState,
@@ -577,28 +674,58 @@ AcpiEnterSleepStatePrep (
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState);
+ UINT8 SleepState,
+ UINT8 Flags);
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStateS4bios (
- void);
+ void))
+
+ACPI_STATUS
+AcpiLeaveSleepStatePrep (
+ UINT8 SleepState,
+ UINT8 Flags);
ACPI_STATUS
AcpiLeaveSleepState (
- UINT8 SleepState)
- ;
+ UINT8 SleepState);
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiSetFirmwareWakingVector (
- UINT32 PhysicalAddress);
+ UINT32 PhysicalAddress))
#if ACPI_MACHINE_WIDTH == 64
+ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiSetFirmwareWakingVector64 (
- UINT64 PhysicalAddress);
+ UINT64 PhysicalAddress))
#endif
/*
+ * ACPI Timer interfaces
+ */
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
+AcpiGetTimerResolution (
+ UINT32 *Resolution))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
+AcpiGetTimer (
+ UINT32 *Ticks))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
+AcpiGetTimerDuration (
+ UINT32 StartTicks,
+ UINT32 EndTicks,
+ UINT32 *TimeElapsed))
+
+
+/*
* Error/Warning output
*/
void ACPI_INTERNAL_VAR_XFACE
diff --git a/usr/src/uts/intel/sys/acpi/acpredef.h b/usr/src/uts/intel/sys/acpi/acpredef.h
index 0496767a86..c17a6d9145 100644
--- a/usr/src/uts/intel/sys/acpi/acpredef.h
+++ b/usr/src/uts/intel/sys/acpi/acpredef.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,14 @@
* ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length
* (Used for _ART, _FPS)
*
+ * ACPI_PTYPE2_FIX_VAR: Each subpackage consists of some fixed-length elements
+ * followed by an optional element
+ * object type
+ * count
+ * object type
+ * count = 0 (optional)
+ * (Used for _DLM)
+ *
*****************************************************************************/
enum AcpiReturnPackageTypes
@@ -106,7 +114,8 @@ enum AcpiReturnPackageTypes
ACPI_PTYPE2_PKG_COUNT = 6,
ACPI_PTYPE2_FIXED = 7,
ACPI_PTYPE2_MIN = 8,
- ACPI_PTYPE2_REV_FIXED = 9
+ ACPI_PTYPE2_REV_FIXED = 9,
+ ACPI_PTYPE2_FIX_VAR = 10
};
@@ -159,6 +168,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_AC8", 0, ACPI_RTYPE_INTEGER}},
{{"_AC9", 0, ACPI_RTYPE_INTEGER}},
{{"_ADR", 0, ACPI_RTYPE_INTEGER}},
+ {{"_AEI", 0, ACPI_RTYPE_BUFFER}},
{{"_AL0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
@@ -231,6 +241,12 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}},
+ {{"_CLS", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */
+ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0}, 0,0}},
+
+ {{"_CPC", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Bufs) */
+ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,0}, 0,0}},
+
{{"_CRS", 0, ACPI_RTYPE_BUFFER}},
{{"_CRT", 0, ACPI_RTYPE_INTEGER}},
{{"_CSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n-1 Int) */
@@ -239,12 +255,20 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_CST", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */
{{{ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER}, 3,0}},
+ {{"_CWS", 1, ACPI_RTYPE_INTEGER}},
{{"_DCK", 1, ACPI_RTYPE_INTEGER}},
{{"_DCS", 0, ACPI_RTYPE_INTEGER}},
{{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}},
{{"_DDN", 0, ACPI_RTYPE_STRING}},
+ {{"_DEP", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
+ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
+
{{"_DGS", 0, ACPI_RTYPE_INTEGER}},
{{"_DIS", 0, 0}},
+
+ {{"_DLM", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (1 Ref, 0/1 Optional Buf/Ref) */
+ {{{ACPI_PTYPE2_FIX_VAR, ACPI_RTYPE_REFERENCE, 1, ACPI_RTYPE_REFERENCE | ACPI_RTYPE_BUFFER}, 0,0}},
+
{{"_DMA", 0, ACPI_RTYPE_BUFFER}},
{{"_DOD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}},
@@ -264,6 +288,8 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_EJ3", 1, 0}},
{{"_EJ4", 1, 0}},
{{"_EJD", 0, ACPI_RTYPE_STRING}},
+ {{"_ERR", 3, ACPI_RTYPE_INTEGER}}, /* Internal use only, used by ACPICA test suites */
+ {{"_EVT", 1, 0}},
{{"_FDE", 0, ACPI_RTYPE_BUFFER}},
{{"_FDI", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int) */
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}},
@@ -284,14 +310,17 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_GAI", 0, ACPI_RTYPE_INTEGER}},
+ {{"_GCP", 0, ACPI_RTYPE_INTEGER}},
{{"_GHL", 0, ACPI_RTYPE_INTEGER}},
{{"_GLK", 0, ACPI_RTYPE_INTEGER}},
{{"_GPD", 0, ACPI_RTYPE_INTEGER}},
{{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */
+ {{"_GRT", 0, ACPI_RTYPE_BUFFER}},
{{"_GSB", 0, ACPI_RTYPE_INTEGER}},
{{"_GTF", 0, ACPI_RTYPE_BUFFER}},
{{"_GTM", 0, ACPI_RTYPE_BUFFER}},
{{"_GTS", 1, 0}},
+ {{"_GWS", 1, ACPI_RTYPE_INTEGER}},
{{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}},
{{"_HOT", 0, ACPI_RTYPE_INTEGER}},
{{"_HPP", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */
@@ -306,6 +335,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_HPX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (var Ints) */
{{{ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0}, 0,0}},
+ {{"_HRV", 0, ACPI_RTYPE_INTEGER}},
{{"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */
{{"_INI", 0, 0}},
{{"_IRC", 0, 0}},
@@ -363,6 +393,9 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
+ {{"_PRE", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
+ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
+
{{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
@@ -393,6 +426,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_PSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (5 Int) with count */
{{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0}, 0,0}},
+ {{"_PSE", 1, 0}},
{{"_PSL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
@@ -459,6 +493,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_SLI", 0, ACPI_RTYPE_BUFFER}},
{{"_SPD", 1, ACPI_RTYPE_INTEGER}},
{{"_SRS", 1, 0}},
+ {{"_SRT", 1, ACPI_RTYPE_INTEGER}},
{{"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */
{{"_SST", 1, 0}},
{{"_STA", 0, ACPI_RTYPE_INTEGER}},
@@ -466,6 +501,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_STP", 2, ACPI_RTYPE_INTEGER}},
{{"_STR", 0, ACPI_RTYPE_BUFFER}},
{{"_STV", 2, ACPI_RTYPE_INTEGER}},
+ {{"_SUB", 0, ACPI_RTYPE_STRING}},
{{"_SUN", 0, ACPI_RTYPE_INTEGER}},
{{"_SWS", 0, ACPI_RTYPE_INTEGER}},
{{"_TC1", 0, ACPI_RTYPE_INTEGER}},
diff --git a/usr/src/uts/intel/sys/acpi/acresrc.h b/usr/src/uts/intel/sys/acpi/acresrc.h
index 00c4bb2530..c879fdc4a3 100644
--- a/usr/src/uts/intel/sys/acpi/acresrc.h
+++ b/usr/src/uts/intel/sys/acpi/acresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -75,28 +75,42 @@ typedef const struct acpi_rsconvert_info
/* Resource conversion opcodes */
-#define ACPI_RSC_INITGET 0
-#define ACPI_RSC_INITSET 1
-#define ACPI_RSC_FLAGINIT 2
-#define ACPI_RSC_1BITFLAG 3
-#define ACPI_RSC_2BITFLAG 4
-#define ACPI_RSC_COUNT 5
-#define ACPI_RSC_COUNT16 6
-#define ACPI_RSC_LENGTH 7
-#define ACPI_RSC_MOVE8 8
-#define ACPI_RSC_MOVE16 9
-#define ACPI_RSC_MOVE32 10
-#define ACPI_RSC_MOVE64 11
-#define ACPI_RSC_SET8 12
-#define ACPI_RSC_DATA8 13
-#define ACPI_RSC_ADDRESS 14
-#define ACPI_RSC_SOURCE 15
-#define ACPI_RSC_SOURCEX 16
-#define ACPI_RSC_BITMASK 17
-#define ACPI_RSC_BITMASK16 18
-#define ACPI_RSC_EXIT_NE 19
-#define ACPI_RSC_EXIT_LE 20
-#define ACPI_RSC_EXIT_EQ 21
+typedef enum
+{
+ ACPI_RSC_INITGET = 0,
+ ACPI_RSC_INITSET,
+ ACPI_RSC_FLAGINIT,
+ ACPI_RSC_1BITFLAG,
+ ACPI_RSC_2BITFLAG,
+ ACPI_RSC_3BITFLAG,
+ ACPI_RSC_ADDRESS,
+ ACPI_RSC_BITMASK,
+ ACPI_RSC_BITMASK16,
+ ACPI_RSC_COUNT,
+ ACPI_RSC_COUNT16,
+ ACPI_RSC_COUNT_GPIO_PIN,
+ ACPI_RSC_COUNT_GPIO_RES,
+ ACPI_RSC_COUNT_GPIO_VEN,
+ ACPI_RSC_COUNT_SERIAL_RES,
+ ACPI_RSC_COUNT_SERIAL_VEN,
+ ACPI_RSC_DATA8,
+ ACPI_RSC_EXIT_EQ,
+ ACPI_RSC_EXIT_LE,
+ ACPI_RSC_EXIT_NE,
+ ACPI_RSC_LENGTH,
+ ACPI_RSC_MOVE_GPIO_PIN,
+ ACPI_RSC_MOVE_GPIO_RES,
+ ACPI_RSC_MOVE_SERIAL_RES,
+ ACPI_RSC_MOVE_SERIAL_VEN,
+ ACPI_RSC_MOVE8,
+ ACPI_RSC_MOVE16,
+ ACPI_RSC_MOVE32,
+ ACPI_RSC_MOVE64,
+ ACPI_RSC_SET8,
+ ACPI_RSC_SOURCE,
+ ACPI_RSC_SOURCEX
+
+} ACPI_RSCONVERT_OPCODES;
/* Resource Conversion sub-opcodes */
@@ -109,6 +123,9 @@ typedef const struct acpi_rsconvert_info
#define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
+/*
+ * Individual entry for the resource dump tables
+ */
typedef const struct acpi_rsdump_info
{
UINT8 Opcode;
@@ -120,20 +137,27 @@ typedef const struct acpi_rsdump_info
/* Values for the Opcode field above */
-#define ACPI_RSD_TITLE 0
-#define ACPI_RSD_LITERAL 1
-#define ACPI_RSD_STRING 2
-#define ACPI_RSD_UINT8 3
-#define ACPI_RSD_UINT16 4
-#define ACPI_RSD_UINT32 5
-#define ACPI_RSD_UINT64 6
-#define ACPI_RSD_1BITFLAG 7
-#define ACPI_RSD_2BITFLAG 8
-#define ACPI_RSD_SHORTLIST 9
-#define ACPI_RSD_LONGLIST 10
-#define ACPI_RSD_DWORDLIST 11
-#define ACPI_RSD_ADDRESS 12
-#define ACPI_RSD_SOURCE 13
+typedef enum
+{
+ ACPI_RSD_TITLE = 0,
+ ACPI_RSD_1BITFLAG,
+ ACPI_RSD_2BITFLAG,
+ ACPI_RSD_3BITFLAG,
+ ACPI_RSD_ADDRESS,
+ ACPI_RSD_DWORDLIST,
+ ACPI_RSD_LITERAL,
+ ACPI_RSD_LONGLIST,
+ ACPI_RSD_SHORTLIST,
+ ACPI_RSD_SHORTLISTX,
+ ACPI_RSD_SOURCE,
+ ACPI_RSD_STRING,
+ ACPI_RSD_UINT8,
+ ACPI_RSD_UINT16,
+ ACPI_RSD_UINT32,
+ ACPI_RSD_UINT64,
+ ACPI_RSD_WORDLIST
+
+} ACPI_RSDUMP_OPCODES;
/* restore default alignment */
@@ -143,13 +167,16 @@ typedef const struct acpi_rsdump_info
/* Resource tables indexed by internal resource type */
extern const UINT8 AcpiGbl_AmlResourceSizes[];
+extern const UINT8 AcpiGbl_AmlResourceSerialBusSizes[];
extern ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[];
/* Resource tables indexed by raw AML resource descriptor type */
extern const UINT8 AcpiGbl_ResourceStructSizes[];
+extern const UINT8 AcpiGbl_ResourceStructSerialBusSizes[];
extern ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[];
+extern ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[];
typedef struct acpi_vendor_walk_info
{
@@ -208,6 +235,10 @@ AcpiRsSetSrsMethodData (
ACPI_NAMESPACE_NODE *Node,
ACPI_BUFFER *RetBuffer);
+ACPI_STATUS
+AcpiRsGetAeiMethodData (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_BUFFER *RetBuffer);
/*
* rscalc
@@ -348,6 +379,11 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertGpio[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[];
/* These resources require separate get/set tables */
@@ -366,6 +402,7 @@ extern ACPI_RSCONVERT_INFO AcpiRsSetVendor[];
* rsinfo
*/
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
+extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];
/*
* rsdump
@@ -387,6 +424,12 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64[];
extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[];
extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[];
#endif
#endif /* __ACRESRC_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/acrestyp.h b/usr/src/uts/intel/sys/acpi/acrestyp.h
index 03e7e2ce08..b927c9c58e 100644
--- a/usr/src/uts/intel/sys/acpi/acrestyp.h
+++ b/usr/src/uts/intel/sys/acpi/acrestyp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,11 +62,14 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
#define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02
#define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03
+/*! [Begin] no source code translation */
/*
* IO Attributes
* The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
* The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
*/
+/*! [End] no source code translation !*/
+
#define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01
#define ACPI_ISA_ONLY_RANGES (UINT8) 0x02
#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
@@ -82,16 +85,26 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
#define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */
/*
- * IRQ Attributes
+ * Interrupt attributes - used in multiple descriptors
*/
+
+/* Triggering */
+
#define ACPI_LEVEL_SENSITIVE (UINT8) 0x00
#define ACPI_EDGE_SENSITIVE (UINT8) 0x01
+/* Polarity */
+
#define ACPI_ACTIVE_HIGH (UINT8) 0x00
#define ACPI_ACTIVE_LOW (UINT8) 0x01
+#define ACPI_ACTIVE_BOTH (UINT8) 0x02
+
+/* Sharing */
#define ACPI_EXCLUSIVE (UINT8) 0x00
#define ACPI_SHARED (UINT8) 0x01
+#define ACPI_EXCLUSIVE_AND_WAKE (UINT8) 0x02
+#define ACPI_SHARED_AND_WAKE (UINT8) 0x03
/*
* DMA Attributes
@@ -128,6 +141,8 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
#define ACPI_POS_DECODE (UINT8) 0x00
#define ACPI_SUB_DECODE (UINT8) 0x01
+/* Producer/Consumer */
+
#define ACPI_PRODUCER (UINT8) 0x00
#define ACPI_CONSUMER (UINT8) 0x01
@@ -167,7 +182,7 @@ typedef struct acpi_resource_irq
} ACPI_RESOURCE_IRQ;
-typedef struct ACPI_RESOURCE_DMA
+typedef struct acpi_resource_dma
{
UINT8 Type;
UINT8 BusMaster;
@@ -209,6 +224,24 @@ typedef struct acpi_resource_fixed_io
} ACPI_RESOURCE_FIXED_IO;
+typedef struct acpi_resource_fixed_dma
+{
+ UINT16 RequestLines;
+ UINT16 Channels;
+ UINT8 Width;
+
+} ACPI_RESOURCE_FIXED_DMA;
+
+/* Values for Width field above */
+
+#define ACPI_DMA_WIDTH8 0
+#define ACPI_DMA_WIDTH16 1
+#define ACPI_DMA_WIDTH32 2
+#define ACPI_DMA_WIDTH64 3
+#define ACPI_DMA_WIDTH128 4
+#define ACPI_DMA_WIDTH256 5
+
+
typedef struct acpi_resource_vendor
{
UINT16 ByteLength;
@@ -385,6 +418,184 @@ typedef struct acpi_resource_generic_register
} ACPI_RESOURCE_GENERIC_REGISTER;
+typedef struct acpi_resource_gpio
+{
+ UINT8 RevisionId;
+ UINT8 ConnectionType;
+ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
+ UINT8 PinConfig;
+ UINT8 Sharable; /* For values, see Interrupt Attributes above */
+ UINT8 IoRestriction;
+ UINT8 Triggering; /* For values, see Interrupt Attributes above */
+ UINT8 Polarity; /* For values, see Interrupt Attributes above */
+ UINT16 DriveStrength;
+ UINT16 DebounceTimeout;
+ UINT16 PinTableLength;
+ UINT16 VendorLength;
+ ACPI_RESOURCE_SOURCE ResourceSource;
+ UINT16 *PinTable;
+ UINT8 *VendorData;
+
+} ACPI_RESOURCE_GPIO;
+
+/* Values for GPIO ConnectionType field above */
+
+#define ACPI_RESOURCE_GPIO_TYPE_INT 0
+#define ACPI_RESOURCE_GPIO_TYPE_IO 1
+
+/* Values for PinConfig field above */
+
+#define ACPI_PIN_CONFIG_DEFAULT 0
+#define ACPI_PIN_CONFIG_PULLUP 1
+#define ACPI_PIN_CONFIG_PULLDOWN 2
+#define ACPI_PIN_CONFIG_NOPULL 3
+
+/* Values for IoRestriction field above */
+
+#define ACPI_IO_RESTRICT_NONE 0
+#define ACPI_IO_RESTRICT_INPUT 1
+#define ACPI_IO_RESTRICT_OUTPUT 2
+#define ACPI_IO_RESTRICT_NONE_PRESERVE 3
+
+
+/* Common structure for I2C, SPI, and UART serial descriptors */
+
+#define ACPI_RESOURCE_SERIAL_COMMON \
+ UINT8 RevisionId; \
+ UINT8 Type; \
+ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\
+ UINT8 SlaveMode; \
+ UINT8 TypeRevisionId; \
+ UINT16 TypeDataLength; \
+ UINT16 VendorLength; \
+ ACPI_RESOURCE_SOURCE ResourceSource; \
+ UINT8 *VendorData;
+
+typedef struct acpi_resource_common_serialbus
+{
+ ACPI_RESOURCE_SERIAL_COMMON
+
+} ACPI_RESOURCE_COMMON_SERIALBUS;
+
+/* Values for the Type field above */
+
+#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
+#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
+#define ACPI_RESOURCE_SERIAL_TYPE_UART 3
+
+/* Values for SlaveMode field above */
+
+#define ACPI_CONTROLLER_INITIATED 0
+#define ACPI_DEVICE_INITIATED 1
+
+
+typedef struct acpi_resource_i2c_serialbus
+{
+ ACPI_RESOURCE_SERIAL_COMMON
+ UINT8 AccessMode;
+ UINT16 SlaveAddress;
+ UINT32 ConnectionSpeed;
+
+} ACPI_RESOURCE_I2C_SERIALBUS;
+
+/* Values for AccessMode field above */
+
+#define ACPI_I2C_7BIT_MODE 0
+#define ACPI_I2C_10BIT_MODE 1
+
+
+typedef struct acpi_resource_spi_serialbus
+{
+ ACPI_RESOURCE_SERIAL_COMMON
+ UINT8 WireMode;
+ UINT8 DevicePolarity;
+ UINT8 DataBitLength;
+ UINT8 ClockPhase;
+ UINT8 ClockPolarity;
+ UINT16 DeviceSelection;
+ UINT32 ConnectionSpeed;
+
+} ACPI_RESOURCE_SPI_SERIALBUS;
+
+/* Values for WireMode field above */
+
+#define ACPI_SPI_4WIRE_MODE 0
+#define ACPI_SPI_3WIRE_MODE 1
+
+/* Values for DevicePolarity field above */
+
+#define ACPI_SPI_ACTIVE_LOW 0
+#define ACPI_SPI_ACTIVE_HIGH 1
+
+/* Values for ClockPhase field above */
+
+#define ACPI_SPI_FIRST_PHASE 0
+#define ACPI_SPI_SECOND_PHASE 1
+
+/* Values for ClockPolarity field above */
+
+#define ACPI_SPI_START_LOW 0
+#define ACPI_SPI_START_HIGH 1
+
+
+typedef struct acpi_resource_uart_serialbus
+{
+ ACPI_RESOURCE_SERIAL_COMMON
+ UINT8 Endian;
+ UINT8 DataBits;
+ UINT8 StopBits;
+ UINT8 FlowControl;
+ UINT8 Parity;
+ UINT8 LinesEnabled;
+ UINT16 RxFifoSize;
+ UINT16 TxFifoSize;
+ UINT32 DefaultBaudRate;
+
+} ACPI_RESOURCE_UART_SERIALBUS;
+
+/* Values for Endian field above */
+
+#define ACPI_UART_LITTLE_ENDIAN 0
+#define ACPI_UART_BIG_ENDIAN 1
+
+/* Values for DataBits field above */
+
+#define ACPI_UART_5_DATA_BITS 0
+#define ACPI_UART_6_DATA_BITS 1
+#define ACPI_UART_7_DATA_BITS 2
+#define ACPI_UART_8_DATA_BITS 3
+#define ACPI_UART_9_DATA_BITS 4
+
+/* Values for StopBits field above */
+
+#define ACPI_UART_NO_STOP_BITS 0
+#define ACPI_UART_1_STOP_BIT 1
+#define ACPI_UART_1P5_STOP_BITS 2
+#define ACPI_UART_2_STOP_BITS 3
+
+/* Values for FlowControl field above */
+
+#define ACPI_UART_FLOW_CONTROL_NONE 0
+#define ACPI_UART_FLOW_CONTROL_HW 1
+#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
+
+/* Values for Parity field above */
+
+#define ACPI_UART_PARITY_NONE 0
+#define ACPI_UART_PARITY_EVEN 1
+#define ACPI_UART_PARITY_ODD 2
+#define ACPI_UART_PARITY_MARK 3
+#define ACPI_UART_PARITY_SPACE 4
+
+/* Values for LinesEnabled bitfield above */
+
+#define ACPI_UART_CARRIER_DETECT (1<<2)
+#define ACPI_UART_RING_INDICATOR (1<<3)
+#define ACPI_UART_DATA_SET_READY (1<<4)
+#define ACPI_UART_DATA_TERMINAL_READY (1<<5)
+#define ACPI_UART_CLEAR_TO_SEND (1<<6)
+#define ACPI_UART_REQUEST_TO_SEND (1<<7)
+
/* ACPI_RESOURCE_TYPEs */
@@ -405,7 +616,10 @@ typedef struct acpi_resource_generic_register
#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
-#define ACPI_RESOURCE_TYPE_MAX 16
+#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
+#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
+#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
+#define ACPI_RESOURCE_TYPE_MAX 19
/* Master union for resource descriptors */
@@ -416,6 +630,7 @@ typedef union acpi_resource_data
ACPI_RESOURCE_START_DEPENDENT StartDpf;
ACPI_RESOURCE_IO Io;
ACPI_RESOURCE_FIXED_IO FixedIo;
+ ACPI_RESOURCE_FIXED_DMA FixedDma;
ACPI_RESOURCE_VENDOR Vendor;
ACPI_RESOURCE_VENDOR_TYPED VendorTyped;
ACPI_RESOURCE_END_TAG EndTag;
@@ -428,6 +643,11 @@ typedef union acpi_resource_data
ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;
ACPI_RESOURCE_GENERIC_REGISTER GenericReg;
+ ACPI_RESOURCE_GPIO Gpio;
+ ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus;
+ ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;
+ ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;
+ ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
/* Common fields */
diff --git a/usr/src/uts/intel/sys/acpi/acstruct.h b/usr/src/uts/intel/sys/acpi/acstruct.h
index ff588f5234..b3927caa41 100644
--- a/usr/src/uts/intel/sys/acpi/acstruct.h
+++ b/usr/src/uts/intel/sys/acpi/acstruct.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/actables.h b/usr/src/uts/intel/sys/acpi/actables.h
index 6aad862bc9..26a7947dc9 100644
--- a/usr/src/uts/intel/sys/acpi/actables.h
+++ b/usr/src/uts/intel/sys/acpi/actables.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -84,6 +84,11 @@ ACPI_STATUS
AcpiTbVerifyTable (
ACPI_TABLE_DESC *TableDesc);
+ACPI_TABLE_HEADER *
+AcpiTbTableOverride (
+ ACPI_TABLE_HEADER *TableHeader,
+ ACPI_TABLE_DESC *TableDesc);
+
ACPI_STATUS
AcpiTbAddTable (
ACPI_TABLE_DESC *TableDesc,
diff --git a/usr/src/uts/intel/sys/acpi/actbl.h b/usr/src/uts/intel/sys/acpi/actbl.h
index e632291cd0..7da7378d14 100644
--- a/usr/src/uts/intel/sys/acpi/actbl.h
+++ b/usr/src/uts/intel/sys/acpi/actbl.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -298,6 +298,8 @@ typedef struct acpi_table_fadt
ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
+ ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register */
+ ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register */
} ACPI_TABLE_FADT;
@@ -309,6 +311,7 @@ typedef struct acpi_table_fadt
#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */
#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
+#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
/* Masks for FADT flags */
@@ -332,6 +335,8 @@ typedef struct acpi_table_fadt
#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */
#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */
+#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */
+#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */
/* Values for PreferredProfile (Prefered Power Management Profiles) */
@@ -344,9 +349,18 @@ enum AcpiPreferedPmProfiles
PM_WORKSTATION = 3,
PM_ENTERPRISE_SERVER = 4,
PM_SOHO_SERVER = 5,
- PM_APPLIANCE_PC = 6
+ PM_APPLIANCE_PC = 6,
+ PM_PERFORMANCE_SERVER = 7,
+ PM_TABLET = 8
};
+/* Values for SleepStatus and SleepControl registers (V5 FADT) */
+
+#define ACPI_X_WAKE_STATUS 0x80
+#define ACPI_X_SLEEP_TYPE_MASK 0x1C
+#define ACPI_X_SLEEP_TYPE_POSITION 0x02
+#define ACPI_X_SLEEP_ENABLE 0x20
+
/* Reset to default packing */
@@ -392,10 +406,11 @@ typedef struct acpi_table_desc
*/
#include "actbl1.h"
#include "actbl2.h"
+#include "actbl3.h"
/* Macros used to generate offsets to specific table fields */
-#define ACPI_FADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FADT, f)
+#define ACPI_FADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FADT, f)
/*
* Sizes of the various flavors of FADT. We need to look closely
@@ -405,12 +420,15 @@ typedef struct acpi_table_desc
* FADT is the bottom line as to what the version really is.
*
* For reference, the values below are as follows:
- * FADT V1 size: 0x74
- * FADT V2 size: 0x84
- * FADT V3+ size: 0xF4
+ * FADT V1 size: 0x074
+ * FADT V2 size: 0x084
+ * FADT V3 size: 0x0F4
+ * FADT V4 size: 0x0F4
+ * FADT V5 size: 0x10C
*/
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
-#define ACPI_FADT_V3_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
+#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl))
+#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
#endif /* __ACTBL_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/actbl1.h b/usr/src/uts/intel/sys/acpi/actbl1.h
index ad6c82fc3c..824135d3dd 100644
--- a/usr/src/uts/intel/sys/acpi/actbl1.h
+++ b/usr/src/uts/intel/sys/acpi/actbl1.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -252,16 +252,17 @@ typedef struct acpi_einj_entry
enum AcpiEinjActions
{
- ACPI_EINJ_BEGIN_OPERATION = 0,
- ACPI_EINJ_GET_TRIGGER_TABLE = 1,
- ACPI_EINJ_SET_ERROR_TYPE = 2,
- ACPI_EINJ_GET_ERROR_TYPE = 3,
- ACPI_EINJ_END_OPERATION = 4,
- ACPI_EINJ_EXECUTE_OPERATION = 5,
- ACPI_EINJ_CHECK_BUSY_STATUS = 6,
- ACPI_EINJ_GET_COMMAND_STATUS = 7,
- ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */
- ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
+ ACPI_EINJ_BEGIN_OPERATION = 0,
+ ACPI_EINJ_GET_TRIGGER_TABLE = 1,
+ ACPI_EINJ_SET_ERROR_TYPE = 2,
+ ACPI_EINJ_GET_ERROR_TYPE = 3,
+ ACPI_EINJ_END_OPERATION = 4,
+ ACPI_EINJ_EXECUTE_OPERATION = 5,
+ ACPI_EINJ_CHECK_BUSY_STATUS = 6,
+ ACPI_EINJ_GET_COMMAND_STATUS = 7,
+ ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
+ ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
+ ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
};
/* Values for Instruction field above */
@@ -273,9 +274,33 @@ enum AcpiEinjInstructions
ACPI_EINJ_WRITE_REGISTER = 2,
ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
ACPI_EINJ_NOOP = 4,
- ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */
+ ACPI_EINJ_FLUSH_CACHELINE = 5,
+ ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
};
+typedef struct acpi_einj_error_type_with_addr
+{
+ UINT32 ErrorType;
+ UINT32 VendorStructOffset;
+ UINT32 Flags;
+ UINT32 ApicId;
+ UINT64 Address;
+ UINT64 Range;
+ UINT32 PcieId;
+
+} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
+
+typedef struct acpi_einj_vendor
+{
+ UINT32 Length;
+ UINT32 PcieId;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT8 RevisionId;
+ UINT8 Reserved[3];
+
+} ACPI_EINJ_VENDOR;
+
/* EINJ Trigger Error Action Table */
@@ -313,6 +338,7 @@ enum AcpiEinjCommandStatus
#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
+#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
/*******************************************************************************
@@ -731,7 +757,9 @@ enum AcpiMadtType
ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
- ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */
+ ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
+ ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
+ ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
};
@@ -886,11 +914,42 @@ typedef struct acpi_madt_local_x2apic_nmi
} ACPI_MADT_LOCAL_X2APIC_NMI;
+/* 11: Generic Interrupt (ACPI 5.0) */
+
+typedef struct acpi_madt_generic_interrupt
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* Reserved - must be zero */
+ UINT32 GicId;
+ UINT32 Uid;
+ UINT32 Flags;
+ UINT32 ParkingVersion;
+ UINT32 PerformanceInterrupt;
+ UINT64 ParkedAddress;
+ UINT64 BaseAddress;
+
+} ACPI_MADT_GENERIC_INTERRUPT;
+
+
+/* 12: Generic Distributor (ACPI 5.0) */
+
+typedef struct acpi_madt_generic_distributor
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* Reserved - must be zero */
+ UINT32 GicId;
+ UINT64 BaseAddress;
+ UINT32 GlobalIrqBase;
+ UINT32 Reserved2; /* Reserved - must be zero */
+
+} ACPI_MADT_GENERIC_DISTRIBUTOR;
+
+
/*
* Common flags fields for MADT subtables
*/
-/* MADT Local APIC flags (LapicFlags) */
+/* MADT Local APIC flags (LapicFlags) and GIC flags */
#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
diff --git a/usr/src/uts/intel/sys/acpi/actbl2.h b/usr/src/uts/intel/sys/acpi/actbl2.h
index e4f01e3f6b..70c6a09a3c 100644
--- a/usr/src/uts/intel/sys/acpi/actbl2.h
+++ b/usr/src/uts/intel/sys/acpi/actbl2.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/actbl3.h b/usr/src/uts/intel/sys/acpi/actbl3.h
new file mode 100644
index 0000000000..c5dd4184dd
--- /dev/null
+++ b/usr/src/uts/intel/sys/acpi/actbl3.h
@@ -0,0 +1,650 @@
+/******************************************************************************
+ *
+ * Name: actbl3.h - ACPI Table Definitions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACTBL3_H__
+#define __ACTBL3_H__
+
+
+/*******************************************************************************
+ *
+ * Additional ACPI Tables (3)
+ *
+ * These tables are not consumed directly by the ACPICA subsystem, but are
+ * included here to support device drivers and the AML disassembler.
+ *
+ * The tables in this file are fully defined within the ACPI specification.
+ *
+ ******************************************************************************/
+
+
+/*
+ * Values for description table header signatures for tables defined in this
+ * file. Useful because they make it more difficult to inadvertently type in
+ * the wrong signature.
+ */
+#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
+#define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
+#define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
+#define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
+#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
+#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
+#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
+#define ACPI_SIG_RASF "RASF" /* RAS Feature table */
+
+#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
+
+/* Reserved table signatures */
+
+#define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */
+#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table 2 */
+#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
+#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
+#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
+
+/*
+ * All tables must be byte-packed to match the ACPI specification, since
+ * the tables are provided by the system BIOS.
+ */
+#pragma pack(1)
+
+/*
+ * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
+ * This is the only type that is even remotely portable. Anything else is not
+ * portable, so do not use any other bitfield types.
+ */
+
+
+/*******************************************************************************
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_bgrt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT16 Version;
+ UINT8 Status;
+ UINT8 ImageType;
+ UINT64 ImageAddress;
+ UINT32 ImageOffsetX;
+ UINT32 ImageOffsetY;
+
+} ACPI_TABLE_BGRT;
+
+
+/*******************************************************************************
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_drtm
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT64 EntryBaseAddress;
+ UINT64 EntryLength;
+ UINT32 EntryAddress32;
+ UINT64 EntryAddress64;
+ UINT64 ExitAddress;
+ UINT64 LogAreaAddress;
+ UINT32 LogAreaLength;
+ UINT64 ArchDependentAddress;
+ UINT32 Flags;
+
+} ACPI_TABLE_DRTM;
+
+/* 1) Validated Tables List */
+
+typedef struct acpi_drtm_vtl_list
+{
+ UINT32 ValidatedTableListCount;
+
+} ACPI_DRTM_VTL_LIST;
+
+/* 2) Resources List */
+
+typedef struct acpi_drtm_resource_list
+{
+ UINT32 ResourceListCount;
+
+} ACPI_DRTM_RESOURCE_LIST;
+
+/* 3) Platform-specific Identifiers List */
+
+typedef struct acpi_drtm_id_list
+{
+ UINT32 IdListCount;
+
+} ACPI_DRTM_ID_LIST;
+
+
+/*******************************************************************************
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_fpdt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_FPDT;
+
+
+/* FPDT subtable header */
+
+typedef struct acpi_fpdt_header
+{
+ UINT16 Type;
+ UINT8 Length;
+ UINT8 Revision;
+
+} ACPI_FPDT_HEADER;
+
+/* Values for Type field above */
+
+enum AcpiFpdtType
+{
+ ACPI_FPDT_TYPE_BOOT = 0,
+ ACPI_FPDT_TYPE_S3PERF = 1,
+};
+
+
+/*
+ * FPDT subtables
+ */
+
+/* 0: Firmware Basic Boot Performance Record */
+
+typedef struct acpi_fpdt_boot
+{
+ ACPI_FPDT_HEADER Header;
+ UINT8 Reserved[4];
+ UINT64 ResetEnd;
+ UINT64 LoadStart;
+ UINT64 StartupStart;
+ UINT64 ExitServicesEntry;
+ UINT64 ExitServicesExit;
+
+} ACPI_FPDT_BOOT;
+
+
+/* 1: S3 Performance Table Pointer Record */
+
+typedef struct acpi_fpdt_s3pt_ptr
+{
+ ACPI_FPDT_HEADER Header;
+ UINT8 Reserved[4];
+ UINT64 Address;
+
+} ACPI_FPDT_S3PT_PTR;
+
+
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * FPDT S3 Pointer Record above.
+ */
+typedef struct acpi_table_s3pt
+{
+ UINT8 Signature[4]; /* "S3PT" */
+ UINT32 Length;
+
+} ACPI_TABLE_S3PT;
+
+
+/*
+ * S3PT Subtables
+ */
+typedef struct acpi_s3pt_header
+{
+ UINT16 Type;
+ UINT8 Length;
+ UINT8 Revision;
+
+} ACPI_S3PT_HEADER;
+
+/* Values for Type field above */
+
+enum AcpiS3ptType
+{
+ ACPI_S3PT_TYPE_RESUME = 0,
+ ACPI_S3PT_TYPE_SUSPEND = 1,
+};
+
+typedef struct acpi_s3pt_resume
+{
+ ACPI_S3PT_HEADER Header;
+ UINT32 ResumeCount;
+ UINT64 FullResume;
+ UINT64 AverageResume;
+
+} ACPI_S3PT_RESUME;
+
+typedef struct acpi_s3pt_suspend
+{
+ ACPI_S3PT_HEADER Header;
+ UINT64 SuspendStart;
+ UINT64 SuspendEnd;
+
+} ACPI_S3PT_SUSPEND;
+
+
+/*******************************************************************************
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_gtdt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT64 Address;
+ UINT32 Flags;
+ UINT32 SecurePl1Interrupt;
+ UINT32 SecurePl1Flags;
+ UINT32 NonSecurePl1Interrupt;
+ UINT32 NonSecurePl1Flags;
+ UINT32 VirtualTimerInterrupt;
+ UINT32 VirtualTimerFlags;
+ UINT32 NonSecurePl2Interrupt;
+ UINT32 NonSecurePl2Flags;
+
+} ACPI_TABLE_GTDT;
+
+/* Values for Flags field above */
+
+#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
+
+/* Values for all "TimerFlags" fields above */
+
+#define ACPI_GTDT_INTERRUPT_MODE 1
+#define ACPI_GTDT_INTERRUPT_POLARITY 2
+
+
+/*******************************************************************************
+ *
+ * MPST - Memory Power State Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+#define ACPI_MPST_CHANNEL_INFO \
+ UINT16 Reserved1; \
+ UINT8 ChannelId; \
+ UINT8 Reserved2; \
+ UINT16 PowerNodeCount;
+
+/* Main table */
+
+typedef struct acpi_table_mpst
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
+
+} ACPI_TABLE_MPST;
+
+
+/* Memory Platform Communication Channel Info */
+
+typedef struct acpi_mpst_channel
+{
+ ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
+
+} ACPI_MPST_CHANNEL;
+
+
+/* Memory Power Node Structure */
+
+typedef struct acpi_mpst_power_node
+{
+ UINT8 Flags;
+ UINT8 Reserved1;
+ UINT16 NodeId;
+ UINT32 Length;
+ UINT64 RangeAddress;
+ UINT64 RangeLength;
+ UINT8 NumPowerStates;
+ UINT8 NumPhysicalComponents;
+ UINT16 Reserved2;
+
+} ACPI_MPST_POWER_NODE;
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_ENABLED 1
+#define ACPI_MPST_POWER_MANAGED 2
+#define ACPI_MPST_HOT_PLUG_CAPABLE 4
+
+
+/* Memory Power State Structure (follows POWER_NODE above) */
+
+typedef struct acpi_mpst_power_state
+{
+ UINT8 PowerState;
+ UINT8 InfoIndex;
+
+} ACPI_MPST_POWER_STATE;
+
+
+/* Physical Component ID Structure (follows POWER_STATE above) */
+
+typedef struct acpi_mpst_component
+{
+ UINT16 ComponentId;
+
+} ACPI_MPST_COMPONENT;
+
+
+/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
+
+typedef struct acpi_mpst_data_hdr
+{
+ UINT16 CharacteristicsCount;
+
+} ACPI_MPST_DATA_HDR;
+
+typedef struct acpi_mpst_power_data
+{
+ UINT8 Revision;
+ UINT8 Flags;
+ UINT16 Reserved1;
+ UINT32 AveragePower;
+ UINT32 PowerSaving;
+ UINT64 ExitLatency;
+ UINT64 Reserved2;
+
+} ACPI_MPST_POWER_DATA;
+
+/* Values for Flags field above */
+
+#define ACPI_MPST_PRESERVE 1
+#define ACPI_MPST_AUTOENTRY 2
+#define ACPI_MPST_AUTOEXIT 4
+
+
+/* Shared Memory Region (not part of an ACPI table) */
+
+typedef struct acpi_mpst_shared
+{
+ UINT32 Signature;
+ UINT16 PccCommand;
+ UINT16 PccStatus;
+ UINT16 CommandRegister;
+ UINT16 StatusRegister;
+ UINT16 PowerStateId;
+ UINT16 PowerNodeId;
+ UINT64 EnergyConsumed;
+ UINT64 AveragePower;
+
+} ACPI_MPST_SHARED;
+
+
+/*******************************************************************************
+ *
+ * PCCT - Platform Communications Channel Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_pcct
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 Flags;
+ UINT32 Latency;
+ UINT32 Reserved;
+
+} ACPI_TABLE_PCCT;
+
+/* Values for Flags field above */
+
+#define ACPI_PCCT_DOORBELL 1
+
+/*
+ * PCCT subtables
+ */
+
+/* 0: Generic Communications Subspace */
+
+typedef struct acpi_pcct_subspace
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 Reserved[6];
+ UINT64 BaseAddress;
+ UINT64 Length;
+ ACPI_GENERIC_ADDRESS DoorbellRegister;
+ UINT64 PreserveMask;
+ UINT64 WriteMask;
+
+} ACPI_PCCT_SUBSPACE;
+
+
+/*
+ * PCC memory structures (not part of the ACPI table)
+ */
+
+/* Shared Memory Region */
+
+typedef struct acpi_pcct_shared_memory
+{
+ UINT32 Signature;
+ UINT16 Command;
+ UINT16 Status;
+
+} ACPI_PCCT_SHARED_MEMORY;
+
+
+/*******************************************************************************
+ *
+ * PMTT - Platform Memory Topology Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_pmtt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 Reserved;
+
+} ACPI_TABLE_PMTT;
+
+
+/* Common header for PMTT subtables that follow main table */
+
+typedef struct acpi_pmtt_header
+{
+ UINT8 Type;
+ UINT8 Reserved1;
+ UINT16 Length;
+ UINT16 Flags;
+ UINT16 Reserved2;
+
+} ACPI_PMTT_HEADER;
+
+/* Values for Type field above */
+
+#define ACPI_PMTT_TYPE_SOCKET 0
+#define ACPI_PMTT_TYPE_CONTROLLER 1
+#define ACPI_PMTT_TYPE_DIMM 2
+#define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
+
+/* Values for Flags field above */
+
+#define ACPI_PMTT_TOP_LEVEL 0x0001
+#define ACPI_PMTT_PHYSICAL 0x0002
+#define ACPI_PMTT_MEMORY_TYPE 0x000C
+
+
+/*
+ * PMTT subtables, correspond to Type in acpi_pmtt_header
+ */
+
+
+/* 0: Socket Structure */
+
+typedef struct acpi_pmtt_socket
+{
+ ACPI_PMTT_HEADER Header;
+ UINT16 SocketId;
+ UINT16 Reserved;
+
+} ACPI_PMTT_SOCKET;
+
+
+/* 1: Memory Controller subtable */
+
+typedef struct acpi_pmtt_controller
+{
+ ACPI_PMTT_HEADER Header;
+ UINT32 ReadLatency;
+ UINT32 WriteLatency;
+ UINT32 ReadBandwidth;
+ UINT32 WriteBandwidth;
+ UINT16 AccessWidth;
+ UINT16 Alignment;
+ UINT16 Reserved;
+ UINT16 DomainCount;
+
+} ACPI_PMTT_CONTROLLER;
+
+/* 1a: Proximity Domain substructure */
+
+typedef struct acpi_pmtt_domain
+{
+ UINT32 ProximityDomain;
+
+} ACPI_PMTT_DOMAIN;
+
+
+/* 2: Physical Component Identifier (DIMM) */
+
+typedef struct acpi_pmtt_physical_component
+{
+ ACPI_PMTT_HEADER Header;
+ UINT16 ComponentId;
+ UINT16 Reserved;
+ UINT32 MemorySize;
+ UINT32 BiosHandle;
+
+} ACPI_PMTT_PHYSICAL_COMPONENT;
+
+
+/*******************************************************************************
+ *
+ * RASF - RAS Feature Table (ACPI 5.0)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_rasf
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT8 ChannelId[12];
+
+} ACPI_TABLE_RASF;
+
+/* RASF Platform Communication Channel Shared Memory Region */
+
+typedef struct acpi_rasf_shared_memory
+{
+ UINT32 Signature;
+ UINT16 Command;
+ UINT16 Status;
+ UINT64 RequestedAddress;
+ UINT64 RequestedLength;
+ UINT64 ActualAddress;
+ UINT64 ActualLength;
+ UINT16 Flags;
+ UINT8 Speed;
+
+} ACPI_RASF_SHARED_MEMORY;
+
+/* Masks for Flags and Speed fields above */
+
+#define ACPI_RASF_SCRUBBER_RUNNING 1
+#define ACPI_RASF_SPEED (7<<1)
+
+/* Channel Commands */
+
+enum AcpiRasfCommands
+{
+ ACPI_RASF_GET_RAS_CAPABILITIES = 1,
+ ACPI_RASF_GET_PATROL_PARAMETERS = 2,
+ ACPI_RASF_START_PATROL_SCRUBBER = 3,
+ ACPI_RASF_STOP_PATROL_SCRUBBER = 4
+};
+
+/* Channel Command flags */
+
+#define ACPI_RASF_GENERATE_SCI (1<<15)
+
+/* Status values */
+
+enum AcpiRasfStatus
+{
+ ACPI_RASF_SUCCESS = 0,
+ ACPI_RASF_NOT_VALID = 1,
+ ACPI_RASF_NOT_SUPPORTED = 2,
+ ACPI_RASF_BUSY = 3,
+ ACPI_RASF_FAILED = 4,
+ ACPI_RASF_ABORTED = 5,
+ ACPI_RASF_INVALID_DATA = 6
+};
+
+/* Status flags */
+
+#define ACPI_RASF_COMMAND_COMPLETE (1)
+#define ACPI_RASF_SCI_DOORBELL (1<<1)
+#define ACPI_RASF_ERROR (1<<2)
+#define ACPI_RASF_STATUS (0x1F<<3)
+
+
+/* Reset to default packing */
+
+#pragma pack()
+
+#endif /* __ACTBL3_H__ */
diff --git a/usr/src/uts/intel/sys/acpi/actypes.h b/usr/src/uts/intel/sys/acpi/actypes.h
index 095e589607..4a5188544e 100644
--- a/usr/src/uts/intel/sys/acpi/actypes.h
+++ b/usr/src/uts/intel/sys/acpi/actypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -520,6 +520,13 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_SLEEP_TYPE_INVALID 0xFF
/*
+ * Sleep/Wake flags
+ */
+#define ACPI_NO_OPTIONAL_METHODS 0x00 /* Do not execute any optional methods */
+#define ACPI_EXECUTE_GTS 0x01 /* For enter sleep interface */
+#define ACPI_EXECUTE_BFS 0x02 /* For leave sleep prep interface */
+
+/*
* Standard notify values
*/
#define ACPI_NOTIFY_BUS_CHECK (UINT8) 0x00
@@ -534,8 +541,9 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09
#define ACPI_NOTIFY_RESERVED (UINT8) 0x0A
#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
+#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
-#define ACPI_NOTIFY_MAX 0x0B
+#define ACPI_NOTIFY_MAX 0x0C
/*
* Types associated with ACPI names and objects. The first group of
@@ -700,8 +708,13 @@ typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_DEVICE_NOTIFY 0x2
#define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3
+#define ACPI_NUM_NOTIFY_TYPES 2
+
+#define ACPI_MAX_SYS_NOTIFY 0x7F
+#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF
-#define ACPI_MAX_SYS_NOTIFY 0x7f
+#define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */
+#define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */
/* Address Space (Operation Region) Types */
@@ -716,8 +729,10 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
#define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
#define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
#define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7
+#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8
+#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9
-#define ACPI_NUM_PREDEFINED_REGIONS 8
+#define ACPI_NUM_PREDEFINED_REGIONS 10
/*
* Special Address Spaces
@@ -790,6 +805,20 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
#define ACPI_DISABLE_EVENT 0
+/* Sleep function dispatch */
+
+typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) (
+ UINT8 SleepState,
+ UINT8 Flags);
+
+typedef struct acpi_sleep_functions
+{
+ ACPI_SLEEP_FUNCTION LegacyFunction;
+ ACPI_SLEEP_FUNCTION ExtendedFunction;
+
+} ACPI_SLEEP_FUNCTIONS;
+
+
/*
* External ACPI object definition
*/
@@ -1030,6 +1059,17 @@ ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) (
#define ACPI_DEFAULT_HANDLER NULL
+/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */
+
+typedef struct acpi_connection_info
+{
+ UINT8 *Connection;
+ UINT16 Length;
+ UINT8 AccessLength;
+
+} ACPI_CONNECTION_INFO;
+
+
typedef
ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
ACPI_HANDLE RegionHandle,
diff --git a/usr/src/uts/intel/sys/acpi/acutils.h b/usr/src/uts/intel/sys/acpi/acutils.h
index 489f195eb9..e9c9b95dda 100644
--- a/usr/src/uts/intel/sys/acpi/acutils.h
+++ b/usr/src/uts/intel/sys/acpi/acutils.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,6 +46,7 @@
extern const UINT8 AcpiGbl_ResourceAmlSizes[];
+extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[];
/* Strings used by the disassembler and debugger resource dump routines */
@@ -69,6 +70,22 @@ extern const char *AcpiGbl_SizDecode[];
extern const char *AcpiGbl_TrsDecode[];
extern const char *AcpiGbl_TtpDecode[];
extern const char *AcpiGbl_TypDecode[];
+extern const char *AcpiGbl_PpcDecode[];
+extern const char *AcpiGbl_IorDecode[];
+extern const char *AcpiGbl_DtsDecode[];
+extern const char *AcpiGbl_CtDecode[];
+extern const char *AcpiGbl_SbtDecode[];
+extern const char *AcpiGbl_AmDecode[];
+extern const char *AcpiGbl_SmDecode[];
+extern const char *AcpiGbl_WmDecode[];
+extern const char *AcpiGbl_CphDecode[];
+extern const char *AcpiGbl_CpoDecode[];
+extern const char *AcpiGbl_DpDecode[];
+extern const char *AcpiGbl_EdDecode[];
+extern const char *AcpiGbl_BpbDecode[];
+extern const char *AcpiGbl_SbDecode[];
+extern const char *AcpiGbl_FcDecode[];
+extern const char *AcpiGbl_PtDecode[];
#endif
/* Types for Resource descriptor entries */
@@ -113,7 +130,6 @@ typedef struct acpi_pkg_info
#define DB_DWORD_DISPLAY 4
#define DB_QWORD_DISPLAY 8
-
/*
* utglobal - Global data structures and procedures
*/
@@ -722,6 +738,11 @@ void
AcpiUtStrlwr (
char *SrcString);
+int
+AcpiUtStricmp (
+ char *String1,
+ char *String2);
+
void
AcpiUtPrintString (
char *String,
@@ -897,6 +918,31 @@ AcpiUtCreateList (
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+/*
+ * utaddress - address range check
+ */
+ACPI_STATUS
+AcpiUtAddAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT32 Length,
+ ACPI_NAMESPACE_NODE *RegionNode);
+
+void
+AcpiUtRemoveAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_NAMESPACE_NODE *RegionNode);
+
+UINT32
+AcpiUtCheckAddressRange (
+ ACPI_ADR_SPACE_TYPE SpaceId,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT32 Length,
+ BOOLEAN Warn);
+
+void
+AcpiUtDeleteAddressLists (
+ void);
/*
* utxferror - various error/warning output functions
diff --git a/usr/src/uts/intel/sys/acpi/amlcode.h b/usr/src/uts/intel/sys/acpi/amlcode.h
index f6e0de3b35..f778bb0780 100644
--- a/usr/src/uts/intel/sys/acpi/amlcode.h
+++ b/usr/src/uts/intel/sys/acpi/amlcode.h
@@ -7,7 +7,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -191,6 +191,15 @@
/*
+ * Opcodes for "Field" operators
+ */
+#define AML_FIELD_OFFSET_OP (UINT8) 0x00
+#define AML_FIELD_ACCESS_OP (UINT8) 0x01
+#define AML_FIELD_CONNECTION_OP (UINT8) 0x02 /* ACPI 5.0 */
+#define AML_FIELD_EXT_ACCESS_OP (UINT8) 0x03 /* ACPI 5.0 */
+
+
+/*
* Internal opcodes
* Use only "Unknown" AML opcodes, don't attempt to use
* any valid ACPI ASCII values (A-Z, 0-9, '-')
@@ -204,7 +213,8 @@
#define AML_INT_METHODCALL_OP (UINT16) 0x0035
#define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037
-
+#define AML_INT_CONNECTION_OP (UINT16) 0x0038
+#define AML_INT_EXTACCESSFIELD_OP (UINT16) 0x0039
#define ARG_NONE 0x0
@@ -478,13 +488,16 @@ typedef enum
*/
typedef enum
{
- AML_FIELD_ATTRIB_SMB_QUICK = 0x02,
- AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04,
- AML_FIELD_ATTRIB_SMB_BYTE = 0x06,
- AML_FIELD_ATTRIB_SMB_WORD = 0x08,
- AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A,
- AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C,
- AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D
+ AML_FIELD_ATTRIB_QUICK = 0x02,
+ AML_FIELD_ATTRIB_SEND_RCV = 0x04,
+ AML_FIELD_ATTRIB_BYTE = 0x06,
+ AML_FIELD_ATTRIB_WORD = 0x08,
+ AML_FIELD_ATTRIB_BLOCK = 0x0A,
+ AML_FIELD_ATTRIB_MULTIBYTE = 0x0B,
+ AML_FIELD_ATTRIB_WORD_CALL = 0x0C,
+ AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D,
+ AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
+ AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F
} AML_ACCESS_ATTRIBUTE;
diff --git a/usr/src/uts/intel/sys/acpi/amlresrc.h b/usr/src/uts/intel/sys/acpi/amlresrc.h
index 1375d96cf8..6d85b8a2d0 100644
--- a/usr/src/uts/intel/sys/acpi/amlresrc.h
+++ b/usr/src/uts/intel/sys/acpi/amlresrc.h
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -59,29 +59,48 @@
#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT"
#define ACPI_RESTAG_BASEADDRESS "_BAS"
#define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */
+#define ACPI_RESTAG_DEBOUNCETIME "_DBT"
#define ACPI_RESTAG_DECODE "_DEC"
+#define ACPI_RESTAG_DEVICEPOLARITY "_DPL"
#define ACPI_RESTAG_DMA "_DMA"
#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
+#define ACPI_RESTAG_DRIVESTRENGTH "_DRS"
+#define ACPI_RESTAG_ENDIANNESS "_END"
+#define ACPI_RESTAG_FLOWCONTROL "_FLC"
#define ACPI_RESTAG_GRANULARITY "_GRA"
#define ACPI_RESTAG_INTERRUPT "_INT"
#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */
#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */
#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
+#define ACPI_RESTAG_IORESTRICTION "_IOR"
#define ACPI_RESTAG_LENGTH "_LEN"
+#define ACPI_RESTAG_LINE "_LIN"
#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
#define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ACPI_RESTAG_MAXADDR "_MAX"
#define ACPI_RESTAG_MINADDR "_MIN"
#define ACPI_RESTAG_MAXTYPE "_MAF"
#define ACPI_RESTAG_MINTYPE "_MIF"
+#define ACPI_RESTAG_MODE "_MOD"
+#define ACPI_RESTAG_PARITY "_PAR"
+#define ACPI_RESTAG_PHASE "_PHA"
+#define ACPI_RESTAG_PIN "_PIN"
+#define ACPI_RESTAG_PINCONFIG "_PPI"
+#define ACPI_RESTAG_POLARITY "_POL"
#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
#define ACPI_RESTAG_RANGETYPE "_RNG"
#define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */
+#define ACPI_RESTAG_LENGTH_RX "_RXL"
+#define ACPI_RESTAG_LENGTH_TX "_TXL"
+#define ACPI_RESTAG_SLAVEMODE "_SLV"
+#define ACPI_RESTAG_SPEED "_SPE"
+#define ACPI_RESTAG_STOPBITS "_STB"
#define ACPI_RESTAG_TRANSLATION "_TRA"
#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */
+#define ACPI_RESTAG_VENDORDATA "_VEN"
/* Default sizes for "small" resource descriptors */
@@ -92,6 +111,7 @@
#define ASL_RDESC_END_DEPEND_SIZE 0x00
#define ASL_RDESC_IO_SIZE 0x07
#define ASL_RDESC_FIXED_IO_SIZE 0x03
+#define ASL_RDESC_FIXED_DMA_SIZE 0x05
#define ASL_RDESC_END_TAG_SIZE 0x01
@@ -214,6 +234,16 @@ typedef struct aml_resource_end_tag
} AML_RESOURCE_END_TAG;
+typedef struct aml_resource_fixed_dma
+{
+ AML_RESOURCE_SMALL_HEADER_COMMON
+ UINT16 RequestLines;
+ UINT16 Channels;
+ UINT8 Width;
+
+} AML_RESOURCE_FIXED_DMA;
+
+
/*
* LARGE descriptors
*/
@@ -368,6 +398,130 @@ typedef struct aml_resource_generic_register
} AML_RESOURCE_GENERIC_REGISTER;
+
+/* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */
+
+typedef struct aml_resource_gpio
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ UINT8 RevisionId;
+ UINT8 ConnectionType;
+ UINT16 Flags;
+ UINT16 IntFlags;
+ UINT8 PinConfig;
+ UINT16 DriveStrength;
+ UINT16 DebounceTimeout;
+ UINT16 PinTableOffset;
+ UINT8 ResSourceIndex;
+ UINT16 ResSourceOffset;
+ UINT16 VendorOffset;
+ UINT16 VendorLength;
+ /*
+ * Optional fields follow immediately:
+ * 1) PIN list (Words)
+ * 2) Resource Source String
+ * 3) Vendor Data bytes
+ */
+
+} AML_RESOURCE_GPIO;
+
+#define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */
+
+/* Values for ConnectionType above */
+
+#define AML_RESOURCE_GPIO_TYPE_INT 0
+#define AML_RESOURCE_GPIO_TYPE_IO 1
+#define AML_RESOURCE_MAX_GPIOTYPE 1
+
+
+/* Common preamble for all serial descriptors (ACPI 5.0) */
+
+#define AML_RESOURCE_SERIAL_COMMON \
+ UINT8 RevisionId; \
+ UINT8 ResSourceIndex; \
+ UINT8 Type; \
+ UINT8 Flags; \
+ UINT16 TypeSpecificFlags; \
+ UINT8 TypeRevisionId; \
+ UINT16 TypeDataLength; \
+
+/* Values for the type field above */
+
+#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
+#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
+#define AML_RESOURCE_UART_SERIALBUSTYPE 3
+#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
+#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
+
+typedef struct aml_resource_common_serialbus
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_SERIAL_COMMON
+
+} AML_RESOURCE_COMMON_SERIALBUS;
+
+typedef struct aml_resource_i2c_serialbus
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_SERIAL_COMMON
+ UINT32 ConnectionSpeed;
+ UINT16 SlaveAddress;
+ /*
+ * Optional fields follow immediately:
+ * 1) Vendor Data bytes
+ * 2) Resource Source String
+ */
+
+} AML_RESOURCE_I2C_SERIALBUS;
+
+#define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */
+#define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */
+#define AML_RESOURCE_I2C_MIN_DATA_LEN 6
+
+typedef struct aml_resource_spi_serialbus
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_SERIAL_COMMON
+ UINT32 ConnectionSpeed;
+ UINT8 DataBitLength;
+ UINT8 ClockPhase;
+ UINT8 ClockPolarity;
+ UINT16 DeviceSelection;
+ /*
+ * Optional fields follow immediately:
+ * 1) Vendor Data bytes
+ * 2) Resource Source String
+ */
+
+} AML_RESOURCE_SPI_SERIALBUS;
+
+#define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */
+#define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */
+#define AML_RESOURCE_SPI_MIN_DATA_LEN 9
+
+
+typedef struct aml_resource_uart_serialbus
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ AML_RESOURCE_SERIAL_COMMON
+ UINT32 DefaultBaudRate;
+ UINT16 RxFifoSize;
+ UINT16 TxFifoSize;
+ UINT8 Parity;
+ UINT8 LinesEnabled;
+ /*
+ * Optional fields follow immediately:
+ * 1) Vendor Data bytes
+ * 2) Resource Source String
+ */
+
+} AML_RESOURCE_UART_SERIALBUS;
+
+#define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */
+#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */
+#define AML_RESOURCE_UART_MIN_DATA_LEN 10
+
+
/* restore default alignment */
#pragma pack()
@@ -390,6 +544,7 @@ typedef union aml_resource
AML_RESOURCE_END_DEPENDENT EndDpf;
AML_RESOURCE_IO Io;
AML_RESOURCE_FIXED_IO FixedIo;
+ AML_RESOURCE_FIXED_DMA FixedDma;
AML_RESOURCE_VENDOR_SMALL VendorSmall;
AML_RESOURCE_END_TAG EndTag;
@@ -405,6 +560,11 @@ typedef union aml_resource
AML_RESOURCE_ADDRESS64 Address64;
AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
AML_RESOURCE_EXTENDED_IRQ ExtendedIrq;
+ AML_RESOURCE_GPIO Gpio;
+ AML_RESOURCE_I2C_SERIALBUS I2cSerialBus;
+ AML_RESOURCE_SPI_SERIALBUS SpiSerialBus;
+ AML_RESOURCE_UART_SERIALBUS UartSerialBus;
+ AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
/* Utility overlays */
diff --git a/usr/src/uts/intel/sys/acpi/platform/accygwin.h b/usr/src/uts/intel/sys/acpi/platform/accygwin.h
index 10ae3e83b7..831f313987 100644
--- a/usr/src/uts/intel/sys/acpi/platform/accygwin.h
+++ b/usr/src/uts/intel/sys/acpi/platform/accygwin.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acefi.h b/usr/src/uts/intel/sys/acpi/platform/acefi.h
index 9249ae8d24..bab6159381 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acefi.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acefi.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acenv.h b/usr/src/uts/intel/sys/acpi/platform/acenv.h
index 7f893c13ff..19ca03baac 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acenv.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acenv.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@
#define ACPI_SINGLE_THREADED
#endif
-/* AcpiExec and AcpiBin configuration */
+/* AcpiExec configuration. Multithreaded with full AML debugger */
#ifdef ACPI_EXEC_APP
#define ACPI_APPLICATION
@@ -88,7 +88,27 @@
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
-#ifdef ACPI_BIN_APP
+/* AcpiNames configuration. Single threaded with debugger output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUGGER
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
+/*
+ * AcpiBin/AcpiHelp/AcpiSrc configuration. All single threaded, with
+ * no debug output.
+ */
+#if (defined ACPI_BIN_APP) || \
+ (defined ACPI_SRC_APP) || \
+ (defined ACPI_XTRACT_APP)
+#define ACPI_APPLICATION
+#define ACPI_SINGLE_THREADED
+#endif
+
+#ifdef ACPI_HELP_APP
+#define ACPI_DEBUG_OUTPUT
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
diff --git a/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h b/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h
index ad106ecf5e..98f972f373 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acfreebsd.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acgcc.h b/usr/src/uts/intel/sys/acpi/platform/acgcc.h
index 4b197ff63a..d2eafff395 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acgcc.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acgcc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acintel.h b/usr/src/uts/intel/sys/acpi/platform/acintel.h
index cf7e0bc224..46d238bedb 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acintel.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acintel.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/aclinux.h b/usr/src/uts/intel/sys/acpi/platform/aclinux.h
index 3fc3d97cb8..edfff150ed 100644
--- a/usr/src/uts/intel/sys/acpi/platform/aclinux.h
+++ b/usr/src/uts/intel/sys/acpi/platform/aclinux.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -87,17 +87,18 @@
/* Host-dependent types and defines for user-space ACPICA */
#define ACPI_FLUSH_CPU_CACHE()
-#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
#if defined(__ia64__) || defined(__x86_64__)
#define ACPI_MACHINE_WIDTH 64
#define COMPILER_DEPENDENT_INT64 long
#define COMPILER_DEPENDENT_UINT64 unsigned long
+#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
#else
#define ACPI_MACHINE_WIDTH 32
#define COMPILER_DEPENDENT_INT64 long long
#define COMPILER_DEPENDENT_UINT64 unsigned long long
#define ACPI_USE_NATIVE_DIVIDE
+#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread))
#endif
#ifndef __cdecl
diff --git a/usr/src/uts/intel/sys/acpi/platform/acmsvc.h b/usr/src/uts/intel/sys/acpi/platform/acmsvc.h
index 8590d95fd0..b73a62caf1 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acmsvc.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acmsvc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,6 +44,28 @@
#ifndef __ACMSVC_H__
#define __ACMSVC_H__
+
+/*
+ * Map low I/O functions for MS. This allows us to disable MS language
+ * extensions for maximum portability.
+ */
+#define open _open
+#define read _read
+#define write _write
+#define close _close
+#define stat _stat
+#define fstat _fstat
+#define mkdir _mkdir
+#define strlwr _strlwr
+#define O_RDONLY _O_RDONLY
+#define O_BINARY _O_BINARY
+#define O_CREAT _O_CREAT
+#define O_WRONLY _O_WRONLY
+#define O_TRUNC _O_TRUNC
+#define S_IREAD _S_IREAD
+#define S_IWRITE _S_IWRITE
+#define S_IFDIR _S_IFDIR
+
/* Eliminate warnings for "old" (non-secure) versions of clib functions */
#ifndef _CRT_SECURE_NO_WARNINGS
diff --git a/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h b/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h
index 7c7a63ec94..23b0e8c4c3 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acnetbsd.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acos2.h b/usr/src/uts/intel/sys/acpi/platform/acos2.h
index f01d697e31..0704c50161 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acos2.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acos2.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acwin.h b/usr/src/uts/intel/sys/acpi/platform/acwin.h
index 1355827ccb..c7d4bcd386 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acwin.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acwin.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/acpi/platform/acwin64.h b/usr/src/uts/intel/sys/acpi/platform/acwin64.h
index b4d184294c..022baf050e 100644
--- a/usr/src/uts/intel/sys/acpi/platform/acwin64.h
+++ b/usr/src/uts/intel/sys/acpi/platform/acwin64.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/usr/src/uts/intel/sys/bootinfo.h b/usr/src/uts/intel/sys/bootinfo.h
index 08ff9c3ca0..3adce64fc4 100644
--- a/usr/src/uts/intel/sys/bootinfo.h
+++ b/usr/src/uts/intel/sys/bootinfo.h
@@ -32,6 +32,13 @@ extern "C" {
#endif
/*
+ * This is used by bootfs and dboot. It should be at least as large as the
+ * number of modules that bootloaders (e.g., grub) can support. This figure
+ * has been chosen to match grub's value exactly.
+ */
+#define MAX_BOOT_MODULES 99
+
+/*
* The 32-bit kernel loader code needs to build several structures that the
* kernel is expecting. They will contain native sized pointers for the
* target kernel.
@@ -51,6 +58,12 @@ typedef void *native_ptr_t;
#endif
+typedef enum boot_module_type {
+ BMT_ROOTFS,
+ BMT_FILE,
+ BMT_HASH
+} boot_module_type_t;
+
struct boot_memlist {
uint64_t addr;
uint64_t size;
@@ -62,9 +75,11 @@ struct boot_memlist {
* The kernel needs to know how to find its modules.
*/
struct boot_modules {
- native_ptr_t bm_addr;
- uint32_t bm_size;
- uint32_t bm_padding;
+ native_ptr_t bm_addr;
+ native_ptr_t bm_name;
+ native_ptr_t bm_hash;
+ uint32_t bm_size;
+ boot_module_type_t bm_type;
};
/*
diff --git a/usr/src/uts/intel/sys/bootvfs.h b/usr/src/uts/intel/sys/bootvfs.h
index 63696395da..b1cdabaccc 100644
--- a/usr/src/uts/intel/sys/bootvfs.h
+++ b/usr/src/uts/intel/sys/bootvfs.h
@@ -69,6 +69,18 @@ struct boot_fs_ops {
extern struct boot_fs_ops *bfs_ops;
+#ifdef _KERNEL
+
+extern int BRD_MOUNTROOT(struct boot_fs_ops *, char *);
+extern int BRD_UNMOUNTROOT(struct boot_fs_ops *);
+extern int BRD_OPEN(struct boot_fs_ops *, char *, int);
+extern int BRD_CLOSE(struct boot_fs_ops *, int);
+extern ssize_t BRD_READ(struct boot_fs_ops *, int, caddr_t, size_t);
+extern off_t BRD_SEEK(struct boot_fs_ops *, int, off_t, int);
+extern int BRD_FSTAT(struct boot_fs_ops *, int, struct bootstat *);
+
+#else
+
#define BRD_MOUNTROOT(ops, str) ((ops)->fsw_mountroot)(str)
#define BRD_UNMOUNTROOT(ops) ((ops)->fsw_unmountroot)()
#define BRD_OPEN(ops, file, flag) ((ops)->fsw_open)(file, flag)
@@ -77,6 +89,11 @@ extern struct boot_fs_ops *bfs_ops;
#define BRD_SEEK(ops, fd, addr, w) ((ops)->fsw_lseek)(fd, addr, w)
#define BRD_FSTAT(ops, fd, stp) ((ops)->fsw_fstat)(fd, stp)
+#endif
+
+#define SYSTEM_BOOT_PATH "/system/boot"
+#define BFD_F_SYSTEM_BOOT 0x40000000
+
#ifdef _BOOT
extern int mountroot(char *str);
diff --git a/usr/src/uts/intel/sys/x86_archext.h b/usr/src/uts/intel/sys/x86_archext.h
index 29265387a3..81083eea05 100644
--- a/usr/src/uts/intel/sys/x86_archext.h
+++ b/usr/src/uts/intel/sys/x86_archext.h
@@ -97,7 +97,7 @@ extern "C" {
#define CPUID_INTC_ECX_SSE3 0x00000001 /* Yet more SSE extensions */
#define CPUID_INTC_ECX_PCLMULQDQ 0x00000002 /* PCLMULQDQ insn */
- /* 0x00000004 - reserved */
+#define CPUID_INTC_ECX_DTES64 0x00000004 /* 64-bit DS area */
#define CPUID_INTC_ECX_MON 0x00000008 /* MONITOR/MWAIT */
#define CPUID_INTC_ECX_DSCPL 0x00000010 /* CPL-qualified debug store */
#define CPUID_INTC_ECX_VMX 0x00000020 /* Hardware VM extensions */
@@ -107,17 +107,19 @@ extern "C" {
#define CPUID_INTC_ECX_SSSE3 0x00000200 /* Supplemental SSE3 insns */
#define CPUID_INTC_ECX_CID 0x00000400 /* L1 context ID */
/* 0x00000800 - reserved */
- /* 0x00001000 - reserved */
+#define CPUID_INTC_ECX_FMA 0x00001000 /* Fused Multiply Add */
#define CPUID_INTC_ECX_CX16 0x00002000 /* cmpxchg16 */
#define CPUID_INTC_ECX_ETPRD 0x00004000 /* extended task pri messages */
- /* 0x00008000 - reserved */
+#define CPUID_INTC_ECX_PDCM 0x00008000 /* Perf/Debug Capability MSR */
/* 0x00010000 - reserved */
- /* 0x00020000 - reserved */
+#define CPUID_INTC_ECX_PCID 0x00020000 /* process-context ids */
#define CPUID_INTC_ECX_DCA 0x00040000 /* direct cache access */
#define CPUID_INTC_ECX_SSE4_1 0x00080000 /* SSE4.1 insns */
#define CPUID_INTC_ECX_SSE4_2 0x00100000 /* SSE4.2 insns */
+#define CPUID_INTC_ECX_X2APIC 0x00200000 /* x2apic support */
#define CPUID_INTC_ECX_MOVBE 0x00400000 /* MOVBE insn */
#define CPUID_INTC_ECX_POPCNT 0x00800000 /* POPCNT insn */
+#define CPUID_INTC_ECX_TSCDL 0x01000000 /* Deadline TSC */
#define CPUID_INTC_ECX_AES 0x02000000 /* AES insns */
#define CPUID_INTC_ECX_XSAVE 0x04000000 /* XSAVE/XRESTOR insns */
#define CPUID_INTC_ECX_OSXSAVE 0x08000000 /* OS supports XSAVE insns */
@@ -129,10 +131,10 @@ extern "C" {
#define FMT_CPUID_INTC_ECX \
"\20" \
"\37rdrand\36f16c\35avx\34osxsav\33xsave" \
- "\32aes" \
- "\30popcnt\27movbe\25sse4.2\24sse4.1\23dca" \
- "\20\17etprd\16cx16\13cid\12ssse3\11tm2" \
- "\10est\7smx\6vmx\5dscpl\4mon\2pclmulqdq\1sse3"
+ "\32aes\31tscdl" \
+ "\30popcnt\27movbe\26x2apic\25sse4.2\24sse4.1\23dca" \
+ "\20\18pdcm\17etprd\16cx16\13cid\12ssse3\11tm2" \
+ "\10est\7smx\6vmx\5dscpl\4mon\3dtes64\2pclmulqdq\1sse3"
/*
* cpuid instruction feature flags in %edx (extended function 0x80000001)
@@ -190,16 +192,25 @@ extern "C" {
#define CPUID_AMD_ECX_3DNP 0x00000100 /* AMD: 3DNowPrefectch */
#define CPUID_AMD_ECX_OSVW 0x00000200 /* AMD: OSVW */
#define CPUID_AMD_ECX_IBS 0x00000400 /* AMD: IBS */
-#define CPUID_AMD_ECX_SSE5 0x00000800 /* AMD: SSE5 */
+#define CPUID_AMD_ECX_SSE5 0x00000800 /* AMD: Extended AVX */
#define CPUID_AMD_ECX_SKINIT 0x00001000 /* AMD: SKINIT */
#define CPUID_AMD_ECX_WDT 0x00002000 /* AMD: WDT */
+ /* 0x00004000 - reserved */
+#define CPUID_AMD_ECX_LWP 0x00008000 /* AMD: Lightweight profiling */
+#define CPUID_AMD_ECX_FMA4 0x00010000 /* AMD: 4-operand FMA support */
+ /* 0x00020000 - reserved */
+ /* 0x00040000 - reserved */
+#define CPUID_AMD_ECX_NIDMSR 0x00080000 /* AMD: Node ID MSR */
+ /* 0x00100000 - reserved */
+#define CPUID_AMD_ECX_TBM 0x00200000 /* AMD: trailing bit manips. */
#define CPUID_AMD_ECX_TOPOEXT 0x00400000 /* AMD: Topology Extensions */
+
#define FMT_CPUID_AMD_ECX \
"\20" \
- "\22topoext" \
+ "\23topoext\22tbm\20nimdsr\17fma4\16lwp" \
"\14wdt\13skinit\12sse5\11ibs\10osvw\93dnp\8mas" \
- "\7sse4a\6lzcnt\5cr8d\3svm\2lcmplgcy\1ahf64"
+ "\7sse4a\6lzcnt\5cr8d\4eas\3svm\2lcmplgcy\1ahf64"
/*
* Intel now seems to have claimed part of the "extended" function
diff --git a/usr/src/uts/intel/vmxnet/Makefile b/usr/src/uts/intel/vmxnet/Makefile
new file mode 100644
index 0000000000..4f3ebcf5af
--- /dev/null
+++ b/usr/src/uts/intel/vmxnet/Makefile
@@ -0,0 +1,93 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# VMware Ethernet Adapter b module
+#
+
+#
+# Path to the base of the uts directory tree (usually /usr/src/uts).
+#
+UTSBASE = ../..
+UTSCLOSED = ../../../../closed/uts
+
+#
+# Define the module and object file sets.
+#
+MODULE = vmxnet
+#
+ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE)
+CONF_SRCDIR = $(UTSBASE)/intel/io/vmxnet
+
+#
+# Include common rules.
+#
+include $(UTSBASE)/intel/Makefile.intel
+
+#
+# The list of object files is defined here, rather than in Makefile.files,
+# because the "$(CLOSED_BUILD)" macro has not been defined at the time
+# Makefile.files is processed.
+#
+VMXNET_OBJS += vmxnet.o
+
+OBJECTS = $(VMXNET_OBJS:%=$(OBJS_DIR)/%)
+LINTS = $(VMXNET_OBJS:%.o=$(LINTS_DIR)/%.ln)
+
+#
+# Define targets
+#
+ALL_TARGET = $(BINARY) $(SRC_CONFFILE)
+LINT_TARGET = $(LINT_MODULE).lint
+INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
+
+CPPFLAGS += -I$(UTSBASE)/i86pc
+LDFLAGS += -dy -N misc/gld
+
+#
+# Default build targets.
+#
+.KEEP_STATE:
+
+def: $(DEF_DEPS)
+
+all: $(ALL_DEPS)
+
+clean: $(CLEAN_DEPS)
+
+clobber: $(CLOBBER_DEPS)
+
+#
+# Intentionally don't build lint libraries to minimize divergence with
+# the upstream source.
+#
+lint:
+modlintlib:
+clean.lint:
+
+install: $(INSTALL_DEPS)
+
+#
+# Include common targets.
+#
+include ../Makefile.targ
diff --git a/usr/src/uts/sparc/dtrace/Makefile b/usr/src/uts/sparc/dtrace/Makefile
index 3a2d5341b1..7fbedc8cbe 100644
--- a/usr/src/uts/sparc/dtrace/Makefile
+++ b/usr/src/uts/sparc/dtrace/Makefile
@@ -52,6 +52,7 @@ DTRACE_INC_64 = -I$(UTSBASE)/sparc/v9
CFLAGS += $(CCVERBOSE)
CPPFLAGS += $(DTRACE_INC_$(CLASS))
+CPPFLAGS += -I$(SRC)/common/util
DTRACE_XAS_32 = -xarch=v8plus
DTRACE_XAS_64 = -xarch=v9
diff --git a/usr/src/uts/sparc/dtrace/sdt.c b/usr/src/uts/sparc/dtrace/sdt.c
index af9ea8e155..8fbdf24fee 100644
--- a/usr/src/uts/sparc/dtrace/sdt.c
+++ b/usr/src/uts/sparc/dtrace/sdt.c
@@ -23,6 +23,9 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
#include <sys/modctl.h>
#include <sys/sunddi.h>
@@ -373,9 +376,19 @@ sdt_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
sdt_devi = devi;
for (prov = sdt_providers; prov->sdtp_name != NULL; prov++) {
+ uint32_t priv;
+
+ if (prov->sdtp_priv == DTRACE_PRIV_NONE) {
+ priv = DTRACE_PRIV_KERNEL;
+ sdt_pops.dtps_mode = NULL;
+ } else {
+ priv = prov->sdtp_priv;
+ ASSERT(priv == DTRACE_PRIV_USER);
+ sdt_pops.dtps_mode = sdt_mode;
+ }
+
if (dtrace_register(prov->sdtp_name, prov->sdtp_attr,
- DTRACE_PRIV_KERNEL, NULL,
- &sdt_pops, prov, &prov->sdtp_id) != 0) {
+ priv, NULL, &sdt_pops, prov, &prov->sdtp_id) != 0) {
cmn_err(CE_WARN, "failed to register sdt provider %s",
prov->sdtp_name);
}
diff --git a/usr/src/uts/sparc/ip/ip.global-objs.debug64 b/usr/src/uts/sparc/ip/ip.global-objs.debug64
index b05d399caf..3098f98265 100644
--- a/usr/src/uts/sparc/ip/ip.global-objs.debug64
+++ b/usr/src/uts/sparc/ip/ip.global-objs.debug64
@@ -105,7 +105,6 @@ ilb_sticky_expiry
ilb_sticky_timer_size
ilb_sticky_timeout
ill_no_arena
-ill_null
inet_dev_info
inet_devops
ip6_ftable_hash_size
diff --git a/usr/src/uts/sparc/ip/ip.global-objs.obj64 b/usr/src/uts/sparc/ip/ip.global-objs.obj64
index 7dd30502a0..f182d7198e 100644
--- a/usr/src/uts/sparc/ip/ip.global-objs.obj64
+++ b/usr/src/uts/sparc/ip/ip.global-objs.obj64
@@ -105,7 +105,6 @@ ilb_sticky_expiry
ilb_sticky_timer_size
ilb_sticky_timeout
ill_no_arena
-ill_null
inet_dev_info
inet_devops
ip6_ftable_hash_size
diff --git a/usr/src/uts/sun4u/io/pci/pcisch.c b/usr/src/uts/sun4u/io/pci/pcisch.c
index 27916bcc74..2a2bd05970 100644
--- a/usr/src/uts/sun4u/io/pci/pcisch.c
+++ b/usr/src/uts/sun4u/io/pci/pcisch.c
@@ -2973,11 +2973,12 @@ iommu_tlb_scrub(iommu_t *iommu_p, int scrub)
"\tContext=%lx %sWritable %sStreamable\n"
"\tPCI Page Size=%sk Address in page %lx\n",
ddi_driver_name(dip), ddi_get_instance(dip), errstat, i,
- (tag & TLBTAG_CONTEXT_BITS) >> TLBTAG_CONTEXT_SHIFT,
+ (uint64_t)(tag & TLBTAG_CONTEXT_BITS) >>
+ TLBTAG_CONTEXT_SHIFT,
(tag & TLBTAG_WRITABLE_BIT) ? "" : neg,
(tag & TLBTAG_STREAM_BIT) ? "" : neg,
(tag & TLBTAG_PGSIZE_BIT) ? "64" : "8",
- (tag & TLBTAG_PCIVPN_BITS) << 13);
+ (uint64_t)(tag & TLBTAG_PCIVPN_BITS) << 13);
cmn_err(CE_CONT, "Memory: %sValid %sCacheable Page Frame=%lx\n",
(data & TLBDATA_VALID_BIT) ? "" : neg,
(data & TLBDATA_CACHE_BIT) ? "" : neg, pfn);